Changeset 5546
- Timestamp:
- 08/24/10 14:08:32 (15 years ago)
- Location:
- issm/trunk/src/m/classes
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/@model/model.m
r5524 r5546 12 12 %Model general information 13 13 md.notes=''; 14 md.name=''; 14 md.name=''; 15 md.runtimename=''; %name used when running a parallel job 15 16 md.counter=0; %1 mesh, 2 geography, 3 parameterize 16 17 md.domainoutline=NaN; -
issm/trunk/src/m/classes/public/loadresultsfromcluster.m
r5162 r5546 10 10 %Figure out parameters for this particular cluster 11 11 [codepath,executionpath,login,port]=ClusterParameters(md.cluster,cluster_rc_location); 12 13 %Figure out the directory where all the files are in: 14 directory=[executionpath '/' md.runtimename '/']; 12 15 13 16 %What packages are we picking up from remote cluster … … 26 29 27 30 %copy files from cluster to present directory 28 issmscpin(md.cluster, login, port, executionpath, packages);31 issmscpin(md.cluster, login, port, directory, packages); 29 32 30 33 %read log files onto fields -
issm/trunk/src/m/classes/public/queue/ClusterLaunchCommand.m
r3176 r5546 1 function command=ClusterLaunchCommand(cluster, name,executionpath)1 function command=ClusterLaunchCommand(cluster,runtimename,name,executionpath) 2 2 %CLUSTERLAUNCHCOMMAND: build command to launch job on cluster 3 3 % … … 7 7 %if cluster is current hostname, just source queue file 8 8 if strcmpi(oshostname(),cluster), 9 command=['cd ' executionpath ' && source' name '.queue '];9 command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxvf ' runtimename '.tar.gz && source ' name '.queue ']; 10 10 else 11 11 if strcmpi(cluster,'cosmos'), 12 command=['cd ' executionpath ' && rm -rf ' name '.lock ' name '.outlog ' name '.errlog ' name '.outbin&& qsub -S/bin/sh ' name '.queue '];12 command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxvf ' runtimename '.tar.gz && qsub -S/bin/sh ' name '.queue ']; 13 13 elseif strcmpi(cluster,'gemini'), 14 command=['cd ' executionpath ' && rm -rf ' name '.lock ' name '.outlog ' name '.errlog ' name '.outbin&& qsub ' name '.queue '];14 command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxvf ' runtimename '.tar.gz && qsub ' name '.queue ']; 15 15 elseif strcmpi(cluster,'pollux'), 16 command=['cd ' executionpath ' && rm -rf ' name '.lock ' name '.outlog ' name '.errlog ' name '.outbin&& qsub ' name '.queue '];16 command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxvf ' runtimename '.tar.gz && qsub ' name '.queue ']; 17 17 elseif strcmpi(cluster,'castor'), 18 command=['cd ' executionpath ' && rm -rf ' name '.lock ' name '.outlog ' name '.errlog ' name '.outbin&& qsub ' name '.queue '];18 command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxvf ' runtimename '.tar.gz && qsub ' name '.queue ']; 19 19 elseif strcmpi(cluster,'pfe'), 20 command=['cd ' executionpath ' && rm -rf ' name '.lock ' name '.outlog ' name '.errlog ' name '.outbin&& qsub ' name '.queue '];20 command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxvf ' runtimename '.tar.gz && qsub ' name '.queue ']; 21 21 else 22 22 error('ClusterLaunchCommand error message: unknown cluster command'); -
issm/trunk/src/m/classes/public/queue/ClusterScript.m
r5264 r5546 11 11 fprintf(fid,'#!/bin/bash\n'); 12 12 fprintf(fid,'#PBS -l select=%i:ncpus=1\n',np); 13 fprintf(fid,'#PBS -N %s\n',name); 13 14 fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds. 14 15 fprintf(fid,'#PBS -q %s\n',queue); … … 26 27 27 28 fprintf(fid,'#!/bin/sh\n'); 28 fprintf(fid,'rm -rf %s/%s.lock\n',executionpath,name);29 29 if mem_debug==0, 30 30 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.outbin %s.lock 2> %s.errlog >%s.outlog & ',np,codepath,EnumToString(analysis_type),executionpath,name,name,name,name,name); … … 39 39 fprintf(fid,'#!/bin/sh\n'); 40 40 fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds. 41 fprintf(fid,'#PBS -N %s\n',name); 41 42 fprintf(fid,'#PBS -l ncpus=%i\n',np); 42 43 if ~isempty(queue), -
issm/trunk/src/m/classes/public/queue/LaunchQueueJob.m
r3173 r5546 21 21 if ~strcmpi(options.batch,'yes'), 22 22 23 % what files are we sending?24 packages={[md.name '.bin'],[md.name '.queue']};23 %compress the files into one zip. 24 compressstring=['tar -zcvf ' md.runtimename '.tar.gz ' md.name '.bin ' md.name '.queue ']; 25 25 if md.qmu_analysis, 26 packages{end+1}=[md.name '.qmu.in'];26 compressstring=[compressstring md.name '.qmu.in']; 27 27 end 28 28 system(compressstring); 29 29 30 disp('uploading input file and queueing script'); 30 issmscpout(md.cluster,executionpath,login,port, packages);31 issmscpout(md.cluster,executionpath,login,port,{[md.runtimename '.tar.gz']}); 31 32 32 33 disp('launching solution sequence on remote cluster'); 33 issmssh(md.cluster,login,port,ClusterLaunchCommand(md.cluster,md. name,executionpath));34 issmssh(md.cluster,login,port,ClusterLaunchCommand(md.cluster,md.runtimename,md.name,executionpath)); 34 35 35 36 else -
issm/trunk/src/m/classes/public/solveparallel.m
r5357 r5546 5 5 % md=solveparallel(md); 6 6 7 %First, build a runtime name that is unique, that we will use to create 8 %directories, name jobs, etc ... 9 c=clock; 10 md.runtimename=sprintf('%s-%i-%i-%i-%i-%i-%i',md.name,GetPId,c(2),c(3),c(1),c(4),c(5)); 7 11 8 12 %Get cluster.rc location … … 11 15 %Figure out parameters for this particular cluster 12 16 [codepath,executionpath,login,port]=ClusterParameters(md.cluster,cluster_rc_location); 13 14 %Append name of directory if specified in options:15 executionpath=[executionpath '/' options.directory];16 17 17 18 %Marshall model data into a binary file. -
issm/trunk/src/m/classes/public/waitonlock.m
r5299 r5546 9 9 10 10 %Get filename (lock file) and options 11 filename=[executionpath '/' md. name '.lock'];11 filename=[executionpath '/' md.runtimename '/' md.name '.lock']; 12 12 cluster=md.cluster; 13 13 timelimit=md.waitonlock; … … 22 22 time=0; ispresent=0; 23 23 while (ispresent==0 & time<timelimit) 24 [status, result]=system(['ssh -q -p ' num2str(port) ' ' login '@localhost "if ( -e ' executionpath '/' md.name '.lock ) echo 1"']); 24 [status, result]=system(['ssh -q -p ' num2str(port) ' ' login '@localhost "if ( -e ' executionpath '/' md.runtimename '/' md.name '.lock ) echo 1"']); 25 result 25 26 if ~isempty(result), 26 27 if ismember('1',result),
Note:
See TracChangeset
for help on using the changeset viewer.