- Timestamp:
- 08/02/12 17:13:12 (13 years ago)
- Location:
- issm/branches/trunk-jpl-damage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/branches/trunk-jpl-damage
- Property svn:mergeinfo changed
-
issm/branches/trunk-jpl-damage/src/m/classes/clusters/castor.m
r12004 r12878 8 8 classdef castor 9 9 properties (SetAccess=public) 10 % {{{ 110 % {{{ 11 11 name='castor' 12 12 login='username'; … … 20 20 end 21 21 methods 22 function cluster=castor(varargin) % {{{ 122 function cluster=castor(varargin) % {{{ 23 23 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster); 24 24 end 25 25 %}}} 26 function disp(cluster) % {{{ 126 function disp(cluster) % {{{ 27 27 % display the object 28 28 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1))); … … 37 37 end 38 38 %}}} 39 function checkconsistency(cluster,md,solution,analyses) % {{{139 function md = checkconsistency(cluster,md,solution,analyses) % {{{ 40 40 41 41 available_queues={'shortc','longc'}; … … 46 46 end 47 47 %}}} 48 function BuildQueueScript(cluster, md) % {{{148 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof) % {{{ 49 49 50 %retrieve parameters 51 modelname=md.miscellaneous.name; 52 solution=md.private.solution; 50 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end 51 if(isgprof), disp('gprof not supported by cluster, ignoring...'); end 53 52 54 % open file for writing:53 %write queuing script 55 54 fid=fopen([modelname '.queue'],'w'); 56 57 55 fprintf(fid,'#!/bin/sh\n'); 58 56 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds. … … 64 62 fprintf(fid,'#PBS -o %s.outlog \n',modelname); 65 63 fprintf(fid,'#PBS -e %s.errlog \n',modelname); 66 67 64 fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath); 68 65 fprintf(fid,'cd $PBS_O_WORKDIR\n'); 69 66 fprintf(fid,'export OMP_NUM_THREADS=1\n'); 70 67 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname); 71 72 %close file73 68 fclose(fid); 74 69 75 70 end 76 71 %}}} 77 function LaunchQueueJob(cluster,md,options)% {{{1 78 79 %lauch command, to be executed via ssh 80 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.private.runtimename ' && mkdir ' md.private.runtimename ... 81 ' && cd ' md.private.runtimename ' && mv ../' md.private.runtimename '.tar.gz ./ && tar -zxf ' md.private.runtimename '.tar.gz && qsub ' modelname '.queue ']; 72 function LaunchQueueJob(cluster,modelname,dirname,filelist)% {{{ 82 73 83 if ~strcmpi(options.batch,'yes'), 84 85 %compress the files into one zip. 86 compressstring=['tar -zcf ' md.private.runtimename '.tar.gz ' md.miscellaneous.name '.bin ' md.miscellaneous.name '.queue ' md.miscellaneous.name '.petsc ']; 87 if md.qmu.isdakota, 88 compressstring=[compressstring md.miscellaneous.name '.qmu.in']; 89 end 90 system(compressstring); 91 92 disp('uploading input file and queueing script'); 93 issmscpout(md.cluster.name,md.cluster.executionpath,md.cluster.login,md.cluster.port,{[md.private.runtimename '.tar.gz']}); 94 95 disp('launching solution sequence on remote cluster'); 96 issmssh(md.cluster.name,md.cluster.login,md.cluster.port,launchcommand); 74 %compress the files into one zip. 75 compressstring=['tar -zcf ' dirname '.tar.gz ']; 76 for i=1:numel(filelist), 77 compressstring = [compressstring ' ' filelist{i}]; 78 end 79 if cluster.interactive, 80 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog ']; 81 end 82 system(compressstring); 97 83 98 else 99 disp('batch mode requested: not launching job interactively'); 100 disp('launch solution sequence on remote cluster by hand'); 101 end 84 disp('uploading input file and queueing script'); 85 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']}); 102 86 103 end 104 %}}} 105 function Download(cluster,md)% {{{1 87 disp('launching solution sequence on remote cluster'); 88 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ... 89 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz && qsub ' modelname '.queue ']; 90 issmssh(cluster.name,cluster.login,cluster.port,launchcommand); 91 end %}}} 92 function Download(cluster,dirname,filelist)% {{{ 106 93 107 %some check 108 if isempty(md.private.runtimename), 109 error('pfe Download error message: supply runtime name for results to be loaded!'); 110 end 94 %copy files from cluster to current directory 95 directory=[cluster.executionpath '/' dirname '/']; 96 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist); 111 97 112 %Figure out the directory where all the files are in: 113 directory=[cluster.executionpath '/' md.private.runtimename '/']; 114 115 %What packages are we picking up from remote cluster 116 packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']}; 117 if md.qmu.isdakota, 118 packages{end+1}=[md.miscellaneous.name '.qmu.err']; 119 packages{end+1}=[md.miscellaneous.name '.qmu.out']; 120 if isfield(md.qmu.params,'tabular_graphics_data'), 121 if md.qmu.params.tabular_graphics_data==true, 122 packages{end+1}='dakota_tabular.dat'; 123 end 124 end 125 else 126 packages{end+1}=[md.miscellaneous.name '.outbin']; 127 end 128 129 %copy files from cluster to present directory 130 issmscpin(cluster.name, cluster.login, cluster.port, directory, packages); 131 end %}}} 98 end %}}} 132 99 end 133 100 end
Note:
See TracChangeset
for help on using the changeset viewer.