- Timestamp:
- 02/29/12 13:35:30 (13 years ago)
- Location:
- issm/branches/trunk-jpl-damage
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/branches/trunk-jpl-damage
- Property svn:ignore
-
old new 17 17 stamp-h1 18 18 svn-commit* 19 nightlylog
-
- Property svn:mergeinfo changed
/issm/trunk merged: 11239-11240,11329,11334,11344,11384,11527
- Property svn:ignore
-
issm/branches/trunk-jpl-damage/src/m
-
Property svn:ignore
set to
Makefile.in
Makefile
-
Property svn:ignore
set to
-
issm/branches/trunk-jpl-damage/src/m/classes
-
Property svn:ignore
set to
Makefile.in
Makefile
-
Property svn:ignore
set to
-
issm/branches/trunk-jpl-damage/src/m/classes/clusters
-
Property svn:ignore
set to
Makefile.in
Makefile
-
Property svn:ignore
set to
-
issm/branches/trunk-jpl-damage/src/m/classes/clusters/generic.m
r11218 r11577 78 78 79 79 %open file for writing: 80 fid=fopen([modelname '.queue'],'w'); 80 if ~ispc, 81 fid=fopen([modelname '.queue'],'w'); 82 else 83 fid=fopen([modelname '.bat'],'w'); 84 end 81 85 82 86 %write instructions for launching a job on the cluster 83 fprintf(fid,'#!/bin/sh\n'); 87 if ~ispc, 88 fprintf(fid,'#!/bin/sh\n'); 89 else 90 fprintf(fid,'@echo off\n'); 91 end 92 84 93 if ~isvalgrind, 85 94 if cluster.interactive 86 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',... 87 cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname); 88 else 89 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',... 90 cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname); 95 if ~ispc, 96 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname); 97 else 98 fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname); 99 end 100 else 101 if ~ispc, 102 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname); 103 else 104 fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname); 105 end 91 106 end 92 107 else 93 %Add --gen-suppressions=all to get suppression lines 94 fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib); 95 fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',... 108 if ~ispc, 109 %Add --gen-suppressions=all to get suppression lines 110 fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib); 111 fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',... 96 112 cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname); 113 else 114 error('valgrind not supported on windows platforms'); 115 end 97 116 end 98 117 99 118 if isgprof, 100 fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname); 119 if ~ispc, 120 fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname); 121 else 122 error('gprof not supported on windows platforms'); 123 end 124 101 125 end 102 126 103 127 if ~md.settings.io_gather, 104 %concatenate the output files: 105 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname); 106 end 128 if ~ispc, 129 %concatenate the output files: 130 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname); 131 else 132 error('iogather not supported on windows platforms'); 133 end 134 135 end 136 137 %close file: 138 fclose(fid); 107 139 108 140 %in interactive mode, create a run file, and errlog and outlog file … … 112 144 end 113 145 146 114 147 end 115 148 %}}} 116 149 function LaunchQueueJob(cluster,md,options)% {{{1 117 150 118 %lauch command, to be executed via ssh 119 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.private.runtimename ' && mkdir ' md.private.runtimename ... 120 ' && cd ' md.private.runtimename ' && mv ../' md.private.runtimename '.tar.gz ./ && tar -zxf ' md.private.runtimename '.tar.gz && source ' md.miscellaneous.name '.queue ']; 121 122 if ~strcmpi(options.batch,'yes'), 123 124 %compress the files into one zip. 125 compressstring=['tar -zcf ' md.private.runtimename '.tar.gz ' md.miscellaneous.name '.bin ' md.miscellaneous.name '.queue ' md.miscellaneous.name '.petsc ']; 126 if md.qmu.isdakota, 127 compressstring=[compressstring md.miscellaneous.name '.qmu.in']; 128 end 129 if cluster.interactive, 130 compressstring=[compressstring ' ' md.miscellaneous.name '.errlog ' md.miscellaneous.name '.outlog ']; 131 end 132 system(compressstring); 133 134 disp('uploading input file and queueing script'); 135 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[md.private.runtimename '.tar.gz']}); 136 137 disp('launching solution sequence on remote cluster'); 138 issmssh(cluster.name,cluster.login,cluster.port,launchcommand); 139 else 140 disp('batch mode requested: not launching job interactively'); 141 disp('launch solution sequence on remote cluster by hand'); 142 end 143 144 end %}}} 145 function Download(cluster,md)% {{{1 146 147 %some check 148 if isempty(md.private.runtimename), 149 error('supply runtime name for results to be loaded!'); 150 end 151 152 %Figure out the directory where all the files are in: 153 directory=[cluster.executionpath '/' md.private.runtimename '/']; 154 155 %What packages are we picking up from remote cluster 156 packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']}; 157 if md.qmu.isdakota, 158 packages{end+1}=[md.miscellaneous.name '.qmu.err']; 159 packages{end+1}=[md.miscellaneous.name '.qmu.out']; 160 if isfield(md.qmu.params,'tabular_graphics_data'), 161 if md.qmu.params.tabular_graphics_data==true, 162 packages{end+1}='dakota_tabular.dat'; 151 if ~ispc, 152 %lauch command, to be executed via ssh 153 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.private.runtimename ' && mkdir ' md.private.runtimename ... 154 ' && cd ' md.private.runtimename ' && mv ../' md.private.runtimename '.tar.gz ./ && tar -zxf ' md.private.runtimename '.tar.gz && source ' md.miscellaneous.name '.queue ']; 155 156 if ~strcmpi(options.batch,'yes'), 157 158 %compress the files into one zip. 159 compressstring=['tar -zcf ' md.private.runtimename '.tar.gz ' md.miscellaneous.name '.bin ' md.miscellaneous.name '.queue ' md.miscellaneous.name '.petsc ']; 160 if md.qmu.isdakota, 161 compressstring=[compressstring md.miscellaneous.name '.qmu.in']; 163 162 end 163 if cluster.interactive, 164 compressstring=[compressstring ' ' md.miscellaneous.name '.errlog ' md.miscellaneous.name '.outlog ']; 165 end 166 system(compressstring); 167 168 disp('uploading input file and queueing script'); 169 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[md.private.runtimename '.tar.gz']}); 170 171 disp('launching solution sequence on remote cluster'); 172 issmssh(cluster.name,cluster.login,cluster.port,launchcommand); 173 else 174 disp('batch mode requested: not launching job interactively'); 175 disp('launch solution sequence on remote cluster by hand'); 164 176 end 165 177 else 166 packages{end+1}=[md.miscellaneous.name '.outbin']; 178 %launch right here, do not compress or archive. 179 system([md.miscellaneous.name '.bat']); 167 180 end 168 181 169 %copy files from cluster to present directory 170 issmscpin(cluster.name, cluster.login, cluster.port, directory, packages); 182 end %}}} 183 function Download(cluster,md)% {{{1 184 185 if ~ispc, 186 %some check 187 if isempty(md.private.runtimename), 188 error('supply runtime name for results to be loaded!'); 189 end 190 191 %Figure out the directory where all the files are in: 192 directory=[cluster.executionpath '/' md.private.runtimename '/']; 193 194 %What packages are we picking up from remote cluster 195 packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']}; 196 if md.qmu.isdakota, 197 packages{end+1}=[md.miscellaneous.name '.qmu.err']; 198 packages{end+1}=[md.miscellaneous.name '.qmu.out']; 199 if isfield(md.qmu.params,'tabular_graphics_data'), 200 if md.qmu.params.tabular_graphics_data==true, 201 packages{end+1}='dakota_tabular.dat'; 202 end 203 end 204 else 205 packages{end+1}=[md.miscellaneous.name '.outbin']; 206 end 207 208 %copy files from cluster to present directory 209 issmscpin(cluster.name, cluster.login, cluster.port, directory, packages); 210 else 211 %do nothing! 212 end 171 213 end %}}} 172 214 end
Note:
See TracChangeset
for help on using the changeset viewer.