Changes between Version 2 and Version 3 of multiplejobs
- Timestamp:
- 10/02/20 12:55:39 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
multiplejobs
v2 v3 1 Sometimes we want to submit multiple jobs with a parameter that changes value. Here is how you can do that for basal friction changing from 50 to 100 by increments of 1 (as an example). 2 3 We are going to use a variable in the MATLAB workspace called `friction` that will be changing within a loop. In your `runme.m` script, prepare your step with a dynamic step name: 4 1 5 {{{ 2 6 #!m 3 for N=1:20 4 runme 5 end 6 md.settings.waitonlock = 0; 7 %Do we need to submit the job or download the results? 8 loadonly = 0; 9 10 if perform(org,['FrictionTest_' num2str(friction) ]) 11 loadmodel(org,'PreviousStepName'); 12 13 %Change friction according to friction variable 14 md.friction.coefficient = friction; 15 16 %Make sure jobs are submitted without MATLAB waiting for the results, and job name is unique 7 17 md.settings.waitonlock = 0; 8 md.miscellaneous.name = 'NAMEforTHISstep; 18 md.miscellaneous.name = ['FrictionTest_' num2str(friction) ]; 19 20 %Submit job or download results, make sure that there is no runtime name (that includes the date) 9 21 md=solve(md,'Transient','runtimename',false,'loadonly',loadonly); 22 23 %Save model if necessary 10 24 if loadonly, 11 25 savemodel(org,md); 12 26 end 13 if perform(org,['Transient_TF_+' num2str(TFextra) 'C_qsg_x' num2str(qsgmult) ])14 md.miscellaneous.name = ['Transient_TF_+' num2str(TFextra) 'C_qsg_x' num2str(qsgmult) ];15 27 }}} 28 29 Now, to submit jobs, set `loadonly = 0` and launch your jobs: 30 31 {{{ 32 #!m 33 for friction=50:100 34 runme; 35 end 36 }}} 37 38 Once all the jobs are fully completed, you can set `loadonly = 1` and run the same loop, all the results will be downloaded and the model will be saved with a unique name. Good luck!