Diff for "AutomaticAnalysisParallel" - MRC CBU Imaging Wiki
location: Diff for "AutomaticAnalysisParallel"
Differences between revisions 3 and 4
Revision 3 as of 2007-08-20 11:41:38
Size: 4201
Editor: RhodriCusack
Comment:
Revision 4 as of 2007-08-20 11:43:03
Size: 4297
Editor: RhodriCusack
Comment:
Deletions are marked like this. Additions are marked like this.
Line 37: Line 37:
|| Study || Never || - || || Study || If multiple study-level stages are marked as executing simultanously || Not in standard recipes at present ||

Include(AutomaticAnalysisTopbar)


Contents TableOfContents


Summary

aa version 2.0 and above contain the facility to run things in parallel. Only one small change is required to your user script. A single subject analyses should speed up by a factor of 2 or so, and multiple subjects by a factor of 5-10 [benchmarking in progress - improvement factors are dependent on the number of jobs you are allocated, which is determined by the memory, processor and Matlab license load on the Linux system].

How to use it

In your user script, replace the (usually final) line

aa_doprocessing

with

aa_doprocessing_parallel

How it works

Master and slaves

A master Matlab/SPM/aa job - the one you run your user script on - coordinates the processing, but does not actually process anything. A number of slave jobs do the processing.

The slaves are launched without a matlab desktop, in a iconified xterm (i.e., it just appears in the task bar at the bottom). If you maximize one of these, you will see the writing is yellow. The slave id in the title bar (e.g., aaslave_0123456). Any error the slave has encountered will be display here.

Slaves that have executed without a problem will disappear if they are dormant for 3 minutes or more. Ones that have encountered an error will not disappear. In aa version 2.0, the master will hang if a slave crashes. Viva la revolucion.

Scheduling

Multiple modules are run simultaneously where possible. Within a module, there is no parallel execution. Part of the aa module definition specifies whether a module is run once per study, once per subject, or once per session.

Domain

When run in parallel

Benefit

Session

Always

Any time

Subject

When multiple subjects are being processed

Only for multi-subject studies

Study

If multiple study-level stages are marked as executing simultanously

Not in standard recipes at present

Dependencies

Most processing stages wait for the previous stage to complete before executing. However, some stages can execute before this. For example, realignment and tsdiffana can both execute together as soon as the dicom-to-nifti conversion of the EPIs is complete.

By default, stages wait for the previous stage. However, the aas_addtask command, which is usually called from the tasklist (but occasionally from user scripts) may now include a fourth "tobecompleted" parameter, which specifies that this stage is dependent not on the previous one, but some other stage.

For example, the aap_tasklist_general_ver02 now looks like this:

% EPI file prefix definitions now moved here as depends so strongly on
% tasklist - second parameter for functions that have EPI input, blank if not

aap.tasklist.epiprefix=[];      % reset prefix list
aap.tasklist.stages=[];         % reset list of stages
aap.tasklist.tobecompletedfirst=[];             % reset list of dependencies

aap=aas_addtask(aap,'aamod_study_init');
aap=aas_addtask(aap,'aamod_newsubj_init');
aap=aas_addtask(aap,'aamod_converttmaps');
aap=aas_addtask(aap,'aamod_copystructural',[],'aamod_newsubj_init');
aap=aas_addtask(aap,'aamod_convert_epis',[],'aamod_newsubj_init');
aap=aas_addtask(aap,'aamod_tsdiffana');
aap=aas_addtask(aap,'aamod_realign',[],'aamod_convert_epis');
aap=aas_addtask(aap,'aamod_slicetiming','r');
aap=aas_addtask(aap,'aamod_coreg_noss','r','aamod_realign');
aap=aas_addtask(aap,'aamod_norm_noss','ar');
aap=aas_addtask(aap,'aamod_norm_write','ar');
aap=aas_addtask(aap,'aamod_smooth','war');

Note the fourth parameters for aamod_copystructural, aamod_convert_epis (which may be run together, and at the same time as aamod_converttmaps), aa_realign (run at the same time as tsdiffana) and aamod_coreg_noss (run at the same time as slice timing).

The exact form of the dependency depends on the domain of each of the stages:

If a stage is executed once-per-study, it will wait for all subjects/sessions from the previous stage to completed. If it is executed once-per-subject, it will wait for all of the sessions from this subject to be complete. If it is executed once-per-session, it will execute as soon as the session is completed from the previous stage.

CbuImaging: AutomaticAnalysisParallel (last edited 2013-03-07 21:23:46 by localhost)