Changeset 2226
- Timestamp:
- 09/14/09 08:00:29 (16 years ago)
- Location:
- issm/trunk/src/m/classes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/@model/setdefaultparameters.m
r2211 r2226 213 213 md.cluster='none'; 214 214 215 %this option can be activated (1)to load automatically the results215 %this option can be activated to load automatically the results 216 216 %onto the model after a parallel run by waiting for the lock file 217 %that is generated once the solution has converged 218 md.waitonlock=1; 217 %N minutes that is generated once the solution has converged 218 %0 to desactivate 219 md.waitonlock=Inf; 219 220 220 221 %number of processors to be used (if parallel) -
issm/trunk/src/m/classes/public/display/displayparallel.m
r1277 r2226 17 17 fielddisplay(md,'time','amount of time requested on cluster'); 18 18 fielddisplay(md,'alloc_cleanup','allocation cleanup before starting a job, default 1'); 19 fielddisplay(md,'waitonlock',' wait for batch results 1, or return 0. default is to return');19 fielddisplay(md,'waitonlock','maximum number of minutes to wait for batch results, or return 0'); 20 20 fielddisplay(md,'queue','special queue name on cluster? default is '''' '); 21 21 -
issm/trunk/src/m/classes/public/solveparallel.m
r1676 r2226 26 26 27 27 %Do we return, or just wait for results? 28 if md.waitonlock ,28 if md.waitonlock~=0, 29 29 %we wait for the done file 30 waitonlock([executionpath '/' md.name '.lock']); 31 %load results 32 displaystring(md.debug,'loading results from cluster'); 33 md=loadresultsfromcluster(md); 30 islock=waitonlock([executionpath '/' md.name '.lock'],md.waitonlock); 31 if islock==0, 32 %no results to be loaded 33 disp('The results must be loaded manually with loadmodelfromcluster.'); 34 error(['solveparallel info message: time limit exceeded']) 35 else 36 %load results 37 displaystring(md.debug,'loading results from cluster'); 38 md=loadresultsfromcluster(md); 39 end 34 40 end -
issm/trunk/src/m/classes/public/waitonlock.m
r1 r2226 1 function waitonlock(filename)1 function flag=waitonlock(filename,timelimit) 2 2 %WAITONLOCK - wait for a file 3 3 % 4 4 % This routine will return when a file named 'filename' is written to disk. 5 % If the time limit given in input is exceeded, return 0 5 6 % 6 7 % Usage: 7 % waitonlock(filename)8 % flag=waitonlock(filename,timelimit) 8 9 9 test=0; 10 %initialize time and file presence test flag 11 time=0; 12 ispresent=0; 10 13 disp(['waiting for ' filename ' hold on... (Ctrl+C to exit)']) 11 while test==0 12 test=exist(filename,'file'); 13 pause(1) 14 15 %loop till file .lock exist or time is up 16 while (ispresent==0 & time<timelimit) 17 ispresent=exist(filename,'file'); 18 pause(1); 19 time=time+1/60; 14 20 end 21 22 %build output 23 if (time>timelimit), 24 flag=0; 25 else 26 flag=1; 27 end
Note:
See TracChangeset
for help on using the changeset viewer.