Back to the main page.
Bug 1891 - it would be nice if qsubcellfun could evaluate private private functions
Status | CLOSED WONTFIX |
Reported | 2012-12-13 17:49:00 +0100 |
Modified | 2015-02-11 10:40:45 +0100 |
Product: | FieldTrip |
Component: | qsub |
Version: | unspecified |
Hardware: | PC |
Operating System: | Mac OS |
Importance: | P3 enhancement |
Assigned to: | Robert Oostenveld |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Tim van Mourik - 2012-12-13 17:49:57 +0100
e.g. boundaryRegistration does either [w, p] = cellfun(@recursiveRegistration, ...) or [w, p] = qsubcellfun(@recursiveRegistration, ...) where boundaryRegistration is in /home/common/matlab/BoundaryRegistration and recursiveRegistration is in /home/common/matlab/BoundaryRegistration/private. It works for cellfun, but not for qsubcellfun.
Robert Oostenveld - 2012-12-17 13:00:58 +0100
I created somepath/mainfunction.m somepath/private/subfunction.m and can do >> cd somepath >> a = mainfunction({1, 2}) a = [0.8615] [2x2 double] but the following results in an error >> cd /tmp >> a = mainfunction({1, 2}) stacking 2 matlab jobs in each qsub job submitting job roboos_dccn_c012_p1291_b20_j001... qstat job id 1463561.dccn-l014.dccn.nl job roboos_dccn_c012_p1291_b20_j001 returned, it required NaN seconds and NaN GB %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % an error was detected inside MATLAB, the diary output of the remote execution follows %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ??? Error using ==> cellfun Undefined function handle. Error in ==> fexec at 154 [argout{:}] = feval(fname, argin{:}); Error in ==> qsubexec at 56 [argout, optout] = fexec(argin, optin);
Robert Oostenveld - 2012-12-17 13:01:42 +0100
(In reply to comment #1) note that in the second case I also did addpath ~/somepath
Robert Oostenveld - 2012-12-17 14:13:55 +0100
I have made the function handling smarter, it now passes the full filename. This allows the function handle to be updated on the fly if it is invalid. roboos@mentat002> svn commit Sending qsub/qsubcellfun.m Sending qsub/qsubexec.m Sending qsub/qsubfeval.m Transmitting file data ... Committed revision 7213. @Tim: can you please give it a try?
Robert Oostenveld - 2012-12-17 19:25:12 +0100
enhancement - allow stacking in combination with a private function. roboos@mentat001> svn commit Sending qsub/qsubcellfun.m Sending qsub/qsubexec.m Transmitting file data .. Committed revision 7214.
Robert Oostenveld - 2012-12-17 20:51:07 +0100
the recent changes cause a regression error in fieldtrip/test/test_qsubcellfun3, which is a test function that uses a subfunction. Hmm... When reverting svn to revision 7208, the problem does not happen and the test script runs through.
Robert Oostenveld - 2012-12-17 20:59:17 +0100
roboos@mentat001> svn commit Sending qsub/qsubcellfun.m Transmitting file data . Committed revision 7218. bugfix - the handling of private functions caused a regression in the case a subfunction was being evaluated with qsubcellfun. Fixed it by being less strict on the construction of whichfunction. See also bug 1891. This resolves the problem with test_qsubcellfun3, while remaining compatible with the evaluation of private functions.
Robert Oostenveld - 2012-12-17 21:16:51 +0100
(In reply to comment #6) I have made a test script specifically for this. See fieldtrip/test/test_qsubcellfun4.m and /home/common/matlab/fieldtrip/data/test/bug1891/somepath roboos@mentat001> svn add test/test_qsubcellfun4.m A test/test_qsubcellfun4.m roboos@mentat001> svn commit test/test_qsubcellfun4.m Adding test/test_qsubcellfun4.m Transmitting file data . Committed revision 7219.
Robert Oostenveld - 2014-10-07 15:55:34 +0200
Given the low priority of this, I will not spend further time on it.