mortonne/aperture

matlabpool computing irregularity

GoogleCodeExporter opened this issue · 4 comments

What steps will reproduce the problem?
1. run modify_events through apply_to_ev with params.dist set to 0 - this 
should work
2. run modify_events through apply_to_ev with params.dist set to 2 - this 
should fail


It fails in parallel:
> params = [];
>> params.save_as = 'study_recall';
>> params.overwrite = true;
>> params.res_dir =  '/Users/cohenzd/results/tfrs/';
>> exp.subj = apply_to_ev(exp.subj, 'study_recall', @modify_events, 
{@task_trans_fields_taskFR, {}, params}, 2)
SRC012
modifying "study_recall" events...Warning: Broken file reference in events 
object 'study_recall'. 
> In exist_mat at 29
  In get_mat at 27
  In modify_events at 95
  In apply_to_obj at 88
  In apply_to_subj>(parfor body) at 122
  In parallel_function>make_general_channel/channel_general at 892
  In remoteParallelFunction at 31


It works in serial:
>> exp.subj = apply_to_ev(exp.subj, 'study_recall', @modify_events, 
{@task_trans_fields_taskFR, {}, params}, 0)
SRC002
modifying "study_recall" events...saved.
SRC004
modifying "study_recall" events...saved.


If one examines obj.file in exist_mat, one sees the irregularity that might be 
causing the problem. When in serial, obj.file = 
'/Users/cohenzd/results/tfrs/events/events_study_recall_SRC002.mat'. When in 
parallel, obj.file = 'events'. I'm not sure why the file name changes when 
parallel computing is used, but it seems like it does....

Original issue reported on code.google.com by zachary....@gmail.com on 18 Mar 2011 at 4:08

I started to have the same issue in serial mode, and for this issue I found the 
following: 
1. it seems that for some file references (both events and patterns) the file 
string doesn't include the '.mat' extension at the end, and so exist_mat.m and 
get_mat.m both fail to find it. I added a piece of code to both of these 
scripts:

in get_mat.m I added the code at line 42 and in exist_mat.m I added the code at 
line 24. 


    %ZDC HACK for files that don't have extension specified
    if ~exist(obj.file, 'file')
      if exist([obj.file '.mat'])
        obj.file = [obj.file '.mat'];
      end
    end
    %end ZDC HACK

I believe this is the same issue that I was encountering in parallel computing, 
as this hack seems to have fixed both calls to apply_to* . 

Original comment by zachary....@gmail.com on 28 Mar 2011 at 5:05

Good catch, this is related to a change I made in how filenames get generated.  
I've committed fixes similar to yours.

Original comment by morto...@gmail.com on 28 Mar 2011 at 5:37

  • Changed state: Fixed
it seems that the fix has created another problem. now when I run grand_average 
it tells me that it is unable to write the file... in keyboarding in it seems 
like the file name is correct (in that it doesn't include the .mat extension) 
but it simply won't save... 

Original comment by zachary....@gmail.com on 28 Mar 2011 at 8:09

I've committed a fix to remove leading and trailing spaces from filepaths 
before saving/loading.

Original comment by morto...@gmail.com on 28 Mar 2011 at 11:08