Changeset 8109
- Timestamp:
- 05/02/11 17:51:48 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/model/solveparallel.m
r6569 r8109 8 8 cluster=md.cluster; 9 9 10 %First, build a runtime name that is unique, that we will use to create 11 %directories, name jobs, etc ... 12 c=clock; md.runtimename=sprintf('%s-%i-%i-%i-%i-%i-%i-%i',md.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),GetPId()); 10 if ~md.loadresults, 13 11 14 %Marshall model data into a binary file. 15 marshall(md); 12 %First, build a runtime name that is unique, that we will use to create 13 %directories, name jobs, etc ... 14 c=clock; md.runtimename=sprintf('%s-%i-%i-%i-%i-%i-%i-%i',md.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),GetPId()); 16 15 17 %add qmu fields to binary file if running qmu analysis 18 if md.qmu_analysis, 19 qmumarshall(md,md.variables(options.ivar),md.responses(options.iresp)); 20 end 16 %Marshall model data into a binary file. 17 marshall(md); 21 18 22 %Now, we need to build the queuing script, used by the cluster to launch the job. 23 cluster.BuildQueueScript(md); 24 25 %Now, launch the queueing script 26 cluster.LaunchQueueJob(md,options); 27 28 if ~strcmpi(options.upload,'on'), %did we even try to run? if so, wait on lock 29 30 %Do we return, or just wait for results? 31 if (md.waitonlock>0 & ~strcmpi(options.batch,'yes')), 32 %we wait for the done file 33 islock=waitonlock(md); 34 if islock==0, 35 %no results to be loaded 36 disp('The results must be loaded manually with md=loadresultsfromcluster(md).'); 37 else 38 %load results 39 disp('loading results from cluster'); 40 md=loadresultsfromcluster(md); 41 end 19 %add qmu fields to binary file if running qmu analysis 20 if md.qmu_analysis, 21 qmumarshall(md,md.variables(options.ivar),md.responses(options.iresp)); 42 22 end 43 23 44 %post processes qmu results if necessary 45 if md.qmu_analysis, 46 if ~strncmpi(options.keep,'y',1) 47 system(['rm -rf qmu' num2str(GetPId)]); 24 %Now, we need to build the queuing script, used by the cluster to launch the job. 25 cluster.BuildQueueScript(md); 26 27 %Now, launch the queueing script 28 cluster.LaunchQueueJob(md,options); 29 30 if ~strcmpi(options.upload,'on'), %did we even try to run? if so, wait on lock 31 32 %Do we return, or just wait for results? 33 if (md.waitonlock>0 & ~strcmpi(options.batch,'yes')), 34 %we wait for the done file 35 islock=waitonlock(md); 36 if islock==0, 37 %no results to be loaded 38 disp('The results must be loaded manually with md=loadresultsfromcluster(md).'); 39 else 40 %load results 41 disp('loading results from cluster'); 42 md=loadresultsfromcluster(md); 43 end 48 44 end 45 46 %post processes qmu results if necessary 47 if md.qmu_analysis, 48 if ~strncmpi(options.keep,'y',1) 49 system(['rm -rf qmu' num2str(GetPId)]); 50 end 51 end 52 else 53 error('solveparallel done uploading test decks'); 49 54 end 50 55 else 51 error('solveparallel done uploading test decks'); 56 %just load results 57 md=loadresultsfromcluster(md); 52 58 end
Note:
See TracChangeset
for help on using the changeset viewer.