Changeset 2555
- Timestamp:
- 10/28/09 08:41:52 (15 years ago)
- Location:
- issm/trunk/src/m/classes/public
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/LaunchQueueJobGeneric.m
r2049 r2555 1 1 function md=LaunchQueueJobGeneric(md,executionpath,options) 2 %LAUNCHQUEUEJOBGENERIC - ...2 %LAUNCHQUEUEJOBGENERIC - Generic routine to launch queueing job 3 3 % 4 4 % Usage: … … 28 28 issmssh(md.cluster,['cd ' executionpath ' && source ' md.name '.queue ']); 29 29 30 %waitonlock will work if the lock is on the same machine only:31 if ~strcmpi(oshostname(),md.cluster),32 disp('solution launched on remote cluster. log in to detect job completion, then run md=loadresultsfromcluster(md)');33 md.waitonlock=0;34 end35 36 30 else 37 31 disp('batch mode requested: not launching job interactively'); 38 32 disp(['launch solution sequence by copying files ' md.name '.bin' ',' md.name '.queue and ' md.name '.qmu.in, onto remote cluster ' md.cluster]); 39 33 disp([' then log int ' md.cluster ' and source queue file ' md.name '.queue']); 40 md.waitonlock=0;41 34 end -
issm/trunk/src/m/classes/public/LaunchQueueJobcosmos.m
r2537 r2555 18 18 disp('uploading input file, queueing script and variables script'); 19 19 if md.qmu_analysis, 20 eval(['!scp ' md.name '.bin' ' ' md.name '.queue ' md.name '.qmu.in ' md.cluster ':' executionpath]);20 system(['scp ' md.name '.bin' ' ' md.name '.queue ' md.name '.qmu.in ' md.cluster ':' executionpath]); 21 21 else 22 eval(['!scp ' md.name '.bin' ' ' md.name '.queue ' md.cluster ':' executionpath]);22 system(['scp ' md.name '.bin' ' ' md.name '.queue ' md.cluster ':' executionpath]); 23 23 end 24 24 … … 31 31 disp(['launch solution sequence on remote cluster by logging into it and typing qsub -S/bin/csh ' md.name '.queue']); 32 32 end 33 md.waitonlock=0; %cannot wait for lock -
issm/trunk/src/m/classes/public/LaunchQueueJobgemini.m
r2537 r2555 18 18 disp('uploading input file, queueing script and variables script'); 19 19 if md.qmu_analysis, 20 eval(['!scp ' md.name '.bin' ' ' md.name '.queue ' md.name '.qmu.in ' md.cluster ':' executionpath]);20 system(['scp ' md.name '.bin' ' ' md.name '.queue ' md.name '.qmu.in ' md.cluster ':' executionpath]); 21 21 else 22 eval(['!scp ' md.name '.bin' ' ' md.name '.queue ' md.cluster ':' executionpath]);22 system(['scp ' md.name '.bin' ' ' md.name '.queue ' md.cluster ':' executionpath]); 23 23 end 24 24 … … 31 31 disp(['launch solution sequence on remote cluster by logging into it and typing qsub < ' md.name '.queue']); 32 32 end 33 md.waitonlock=0; %cannot wait for lock -
issm/trunk/src/m/classes/public/LaunchQueueJobgreenplanet.m
r2378 r2555 18 18 disp('uploading input file, queueing script and variables script'); 19 19 if md.qmu_analysis, 20 eval(['!scp -P 1025 -o HostKeyAlias=huey.jpl.nasa.gov ' md.name '.bin' ' ' md.name '.queue ' md.name '.qmu.in elarour@localhost:' executionpath]);20 system(['scp -P 1025 -o HostKeyAlias=huey.jpl.nasa.gov ' md.name '.bin' ' ' md.name '.queue ' md.name '.qmu.in elarour@localhost:' executionpath]); 21 21 else 22 eval(['!scp -P 1025 -o HostKeyAlias=huey.jpl.nasa.gov ' md.name '.bin' ' ' md.name '.queue elarour@localhost:' executionpath ]);22 system(['scp -P 1025 -o HostKeyAlias=huey.jpl.nasa.gov ' md.name '.bin' ' ' md.name '.queue elarour@localhost:' executionpath ]); 23 23 end 24 24 else … … 28 28 %new greenplanet cannot launch across cluster using ssh 29 29 disp(['launch solution sequence on remote cluster by logging into it and typing qsub < ' md.name '.queue']); 30 md.waitonlock=0; -
issm/trunk/src/m/classes/public/solveparallel.m
r2330 r2555 25 25 md=LaunchQueueJob(md,executionpath,options); 26 26 27 %timing28 t1=clock;29 30 27 %Do we return, or just wait for results? 31 28 if md.waitonlock~=0, 32 29 %we wait for the done file 33 islock=waitonlock( [executionpath '/' md.name '.lock'],md.waitonlock);30 islock=waitonlock(md,executionpath); 34 31 if islock==0, 35 32 %no results to be loaded 36 disp('The results must be loaded manually with loadmodelfromcluster.'); 37 error(['solveparallel info message: time limit exceeded']) 33 disp('The results must be loaded manually with md=loadmodelfromcluster(md).'); 38 34 else 39 35 %load results 40 %stop timing41 t2=clock;42 displaystring(md.verbose,'\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']);43 44 36 displaystring(md.verbose,'loading results from cluster'); 45 37 md=loadresultsfromcluster(md); -
issm/trunk/src/m/classes/public/waitonlock.m
r2226 r2555 1 function flag=waitonlock( filename,timelimit)1 function flag=waitonlock(md,executionpath) 2 2 %WAITONLOCK - wait for a file 3 3 % … … 6 6 % 7 7 % Usage: 8 % flag=waitonlock( filename,timelimit)8 % flag=waitonlock(md,executionpath) 9 9 10 % initialize time and file presence test flag11 time=0;12 ispresent=0;13 disp(['waiting for ' filename ' hold on... (Ctrl+C to exit)']) 10 %Get filename (lock file) and options 11 filename=[executionpath '/' md.name '.lock']; 12 cluster=md.cluster; 13 timelinit=md.waitonlock; 14 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; 15 %waitonlock will work if the lock is on the same machine only: 16 if ~strcmpi(oshostname(),cluster), 17 disp('solution launched on remote cluster. log in to detect job completion.'); 18 choice=input('Is the job successfully completed? (y/n)','s'); 19 if ~strcmp(choice,'y'), 20 disp('Results not loaded... exiting'); 21 flag=0; 22 else 23 flag=1; 24 end 25 26 %job is running on the same machine 27 else 28 29 %initialize time and file presence test flag 30 time=0; ispresent=0; 31 disp(['waiting for ' filename ' hold on... (Ctrl+C to exit)']) 32 33 %loop till file .lock exist or time is up 34 while (ispresent==0 & time<timelimit) 35 ispresent=exist(filename,'file'); 36 pause(1); 37 time=time+1/60; 38 end 39 40 %build output 41 if (time>timelimit), 42 disp(['waitonlock info message: time limit exceeded']); 43 flag=0; 44 else 45 flag=1; 46 end 20 47 end 21 22 %build output23 if (time>timelimit),24 flag=0;25 else26 flag=1;27 end
Note:
See TracChangeset
for help on using the changeset viewer.