Changeset 12351
- Timestamp:
- 06/04/12 10:17:05 (13 years ago)
- Location:
- issm/trunk-jpl/src/m
- Files:
-
- 2 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/clusters/acenet.m
r12326 r12351 8 8 classdef acenet 9 9 properties (SetAccess=public) 10 % {{{ 110 % {{{ 11 11 name='glacdyn.ace-net.ca' 12 12 %name='placentia.ace-net.ca' … … 23 23 end 24 24 methods 25 function cluster=acenet(varargin) % {{{ 125 function cluster=acenet(varargin) % {{{ 26 26 %use provided options to change fields 27 27 options=pairoptions(varargin{:}); … … 34 34 end 35 35 %}}} 36 function disp(cluster) % {{{ 136 function disp(cluster) % {{{ 37 37 % display the object 38 38 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1))); … … 47 47 end 48 48 %}}} 49 function checkconsistency(cluster,md,solution,analyses) % {{{ 149 function checkconsistency(cluster,md,solution,analyses) % {{{ 50 50 51 51 available_queues={'debug','shortq','longq'}; … … 56 56 end 57 57 %}}} 58 function BuildQueueScript(cluster,m d) % {{{158 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{ 59 59 60 %retrieve parameters 61 modelname=md.miscellaneous.name; 62 solution=md.private.solution; 60 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end 61 if(isgprof), disp('gprof not supported by cluster, ignoring...'); end 63 62 64 % open file for writing:63 %write queuing script 65 64 fid=fopen([modelname '.queue'],'w'); 66 67 %write instructions for launching a job on the cluster68 % fprintf(fid,'#!/bin/sh\n');69 65 fprintf(fid,'#!/bin/bash\n'); 70 %fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...71 % cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);72 66 fprintf(fid,'#$ -cwd\n'); 73 67 fprintf(fid,'#$ -N issm\n'); 74 %fprintf(fid,'#$ -l h_rt=%i\n',cluster.time);75 68 fprintf(fid,'#$ -l h_rt=10:0:0\n'); 76 %fprintf(fid,'#$ -l h_rt=1:0:0,test=true\n');77 69 fprintf(fid,'#$ -pe ompi* %i\n',cluster.np); 78 70 fprintf(fid,'#$ -j y\n'); … … 81 73 fprintf(fid,'module load issm\n'); 82 74 fprintf(fid,'\n'); 83 %fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);84 75 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',... 85 76 cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname); 86 87 % fprintf(fid,'#PBS -l select=%i:ncpus=1\n',cluster.np);88 % fprintf(fid,'#PBS -N %s\n',modelname);89 % fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds.90 % fprintf(fid,'#PBS -q %s\n',queue);91 % fprintf(fid,'#PBS -o %s.outlog \n',modelname);92 % fprintf(fid,'#PBS -e %s.errlog \n',modelname);93 % fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);94 % fprintf(fid,'cd $PBS_O_WORKDIR\n');95 % fprintf(fid,'export OMP_NUM_THREADS=1\n');96 % fprintf(fid,'ulimit -s unlimited\n');97 % fprintf(fid,'ulimit -c 0\n');98 % fprintf(fid,'/opt/mpich/gm/intel10.1/bin/mpiexec -np %i %s/issm.exe %s %s %s',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);99 100 %close file101 77 fclose(fid); 102 78 103 79 end 104 80 %}}} 105 function LaunchQueueJob(cluster,md,options)% {{{ 181 function LaunchQueueJob(cluster,md,options)% {{{ 106 82 %retrieve parameters 107 83 modelname=md.miscellaneous.name; … … 134 110 end 135 111 %}}} 136 function Download(cluster,md)% {{{ 1112 function Download(cluster,md)% {{{ 137 113 138 114 %some check -
issm/trunk-jpl/src/m/classes/clusters/castor.m
r11867 r12351 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 checkconsistency(cluster,md,solution,analyses) % {{{ 40 40 41 41 available_queues={'shortc','longc'}; … … 46 46 end 47 47 %}}} 48 function BuildQueueScript(cluster,m d) % {{{148 function BuildQueueScript(cluster,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)% {{{ 172 function LaunchQueueJob(cluster,md,options)% {{{ 78 73 79 74 %lauch command, to be executed via ssh … … 103 98 end 104 99 %}}} 105 function Download(cluster,md)% {{{ 1100 function Download(cluster,md)% {{{ 106 101 107 102 %some check -
issm/trunk-jpl/src/m/classes/clusters/cosmos.m
r11867 r12351 8 8 classdef cosmos 9 9 properties (SetAccess=public) 10 % {{{ 110 % {{{ 11 11 name='cosmos' 12 12 login='username'; … … 20 20 end 21 21 methods 22 function cluster=cosmos(varargin) % {{{ 122 function cluster=cosmos(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 checkconsistency(cluster,md,solution,analyses) % {{{ 40 40 41 41 available_queues={'debug','shortq','longq'}; … … 46 46 end 47 47 %}}} 48 function BuildQueueScript(cluster,m d) % {{{148 function BuildQueueScript(cluster,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/bash\n'); 58 56 fprintf(fid,'#PBS -l select=%i:ncpus=1\n',cluster.np); … … 68 66 fprintf(fid,'ulimit -c 0\n'); 69 67 fprintf(fid,'/opt/mpich/gm/intel10.1/bin/mpiexec -np %i %s/issm.exe %s %s %s',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname); 70 71 %close file72 68 fclose(fid); 73 69 74 70 end 75 71 %}}} 76 function LaunchQueueJob(cluster,md,options)% {{{ 172 function LaunchQueueJob(cluster,md,options)% {{{ 77 73 78 74 %lauch command, to be executed via ssh … … 102 98 end 103 99 %}}} 104 function Download(cluster,md)% {{{ 1100 function Download(cluster,md)% {{{ 105 101 106 102 %some check -
issm/trunk-jpl/src/m/classes/clusters/gemini.m
r11867 r12351 8 8 classdef gemini 9 9 properties (SetAccess=public) 10 % {{{ 110 % {{{ 11 11 name='gemini' 12 12 login='username'; … … 20 20 end 21 21 methods 22 function cluster=gemini(varargin) % {{{ 122 function cluster=gemini(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 checkconsistency(cluster,md,solution,analyses) % {{{ 40 40 41 41 available_queues={'debug','shortg','longg'}; … … 46 46 end 47 47 %}}} 48 function BuildQueueScript(cluster,m d) % {{{148 function BuildQueueScript(cluster,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. … … 69 67 fprintf(fid,'export OMP_NUM_THREADS=1\n'); 70 68 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 69 fclose(fid); 74 70 75 71 end 76 72 %}}} 77 function LaunchQueueJob(cluster,md,options)% {{{ 173 function LaunchQueueJob(cluster,md,options)% {{{ 78 74 79 75 %lauch command, to be executed via ssh … … 103 99 end 104 100 %}}} 105 function Download(cluster,md)% {{{ 1101 function Download(cluster,md)% {{{ 106 102 107 103 %some check -
issm/trunk-jpl/src/m/classes/clusters/generic.m
r12155 r12351 7 7 classdef generic 8 8 properties (SetAccess=public) 9 % {{{ 19 % {{{ 10 10 name=''; 11 11 login=''; … … 21 21 end 22 22 methods 23 function cluster=generic(varargin) % {{{ 123 function cluster=generic(varargin) % {{{ 24 24 25 25 %use provided options to change fields … … 36 36 end 37 37 %}}} 38 function disp(cluster) % {{{ 138 function disp(cluster) % {{{ 39 39 % display the object 40 40 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1))); … … 50 50 end 51 51 %}}} 52 function checkconsistency(cluster,md,solution,analyses) % {{{ 152 function checkconsistency(cluster,md,solution,analyses) % {{{ 53 53 if cluster.np<1 54 54 checkmessage(['number of processors should be at least 1']); … … 59 59 end 60 60 %}}} 61 function BuildQueueScript(cluster,m d) % {{{161 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{ 62 62 63 %retrieve parameters 64 modelname=md.miscellaneous.name; 65 solution=md.private.solution; 66 isvalgrind=md.debug.valgrind; 67 isgprof=md.debug.gprof; 68 69 %open file for writing: 63 %write queuing script 70 64 if ~ispc, 71 65 fid=fopen([modelname '.queue'],'w'); … … 115 109 end 116 110 117 if ~md.settings.io_gather, 118 if ~ispc, 119 %concatenate the output files: 111 if ~io_gather, 112 if ~ispc, %concatenate the output files: 120 113 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname); 121 114 else 122 115 error('iogather not supported on windows platforms'); 123 116 end 124 125 117 end 126 127 %close file:128 118 fclose(fid); 129 119 … … 133 123 fid=fopen([modelname '.outlog'],'w'); fclose(fid); 134 124 end 135 136 137 125 end 138 126 %}}} 139 function LaunchQueueJob(cluster,md,options)% {{{ 1127 function LaunchQueueJob(cluster,md,options)% {{{ 140 128 141 129 if ~ispc, … … 171 159 172 160 end %}}} 173 function Download(cluster,md)% {{{ 1161 function Download(cluster,md)% {{{ 174 162 175 163 if ~ispc, -
issm/trunk-jpl/src/m/classes/clusters/generic.py
r12155 r12351 36 36 return string 37 37 #}}} 38 39 40 #old matlab41 # function cluster=generic(varargin) % {{{142 #43 # %use provided options to change fields44 # options=pairoptions(varargin{:});45 #46 # %get name47 # if ~exist(options,'name'), error('option ''name'' has not been provided'); end48 # cluster.name=getfieldvalue(options,'name');49 #50 # %initialize cluster using user settings if provided51 # if (exist([cluster.name '_settings'])==2), eval([cluster.name '_settings']); end52 #53 # %OK get other fields54 # for i=1:size(options.list,1),55 # fieldname=options.list{i,1};56 # fieldvalue=options.list{i,2};57 # if ismember(fieldname,properties('generic')),58 # cluster.(fieldname)=fieldvalue;59 # else60 # disp(['''' fieldname ''' is not a property of cluster generic']);61 # end62 # end63 # end64 # %}}}65 # function checkconsistency(cluster,md,solution,analyses) % {{{166 # if cluster.np<167 # checkmessage(['number of processors should be at least 1']);68 # end69 # if isnan(cluster.np),70 # checkessage('number of processors should not be NaN!');71 # end72 # end73 # %}}}74 # function BuildQueueScript(cluster,md) % {{{175 #76 # %retrieve parameters77 # modelname=md.miscellaneous.name;78 # solution=md.private.solution;79 # isvalgrind=md.debug.valgrind;80 # isgprof=md.debug.gprof;81 #82 # %open file for writing:83 # if ~ispc,84 # fid=fopen([modelname '.queue'],'w');85 # else86 # fid=fopen([modelname '.bat'],'w');87 # end88 #89 # %write instructions for launching a job on the cluster90 # if ~ispc,91 # fprintf(fid,'#!/bin/sh\n');92 # else93 # fprintf(fid,'@echo off\n');94 # end95 #96 # if ~isvalgrind,97 # if cluster.interactive98 # if ~ispc,99 # fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);100 # else101 # fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);102 # end103 # else104 # if ~ispc,105 # 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);106 # else107 # fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);108 # end109 # end110 # else111 # if ~ispc,112 # %Add --gen-suppressions=all to get suppression lines113 # fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);114 # fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...115 # cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);116 # else117 # error('valgrind not supported on windows platforms');118 # end119 # end120 #121 # if isgprof,122 # if ~ispc,123 # fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);124 # else125 # error('gprof not supported on windows platforms');126 # end127 #128 # end129 #130 # if ~md.settings.io_gather,131 # if ~ispc,132 # %concatenate the output files:133 # fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);134 # else135 # error('iogather not supported on windows platforms');136 # end137 #138 # end139 #140 # %close file:141 # fclose(fid);142 #143 # %in interactive mode, create a run file, and errlog and outlog file144 # if cluster.interactive,145 # fid=fopen([modelname '.errlog'],'w'); fclose(fid);146 # fid=fopen([modelname '.outlog'],'w'); fclose(fid);147 # end148 #149 #150 # end151 # %}}}152 # function LaunchQueueJob(cluster,md,options)% {{{1153 #154 # if ~ispc,155 # %lauch command, to be executed via ssh156 # launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.private.runtimename ' && mkdir ' md.private.runtimename ...157 # ' && cd ' md.private.runtimename ' && mv ../' md.private.runtimename '.tar.gz ./ && tar -zxf ' md.private.runtimename '.tar.gz && source ' md.miscellaneous.name '.queue '];158 #159 # if ~strcmpi(options.batch,'yes'),160 #161 # %compress the files into one zip.162 # compressstring=['tar -zcf ' md.private.runtimename '.tar.gz ' md.miscellaneous.name '.bin ' md.miscellaneous.name '.queue ' md.miscellaneous.name '.petsc '];163 # if md.qmu.isdakota,164 # compressstring=[compressstring md.miscellaneous.name '.qmu.in'];165 # end166 # if cluster.interactive,167 # compressstring=[compressstring ' ' md.miscellaneous.name '.errlog ' md.miscellaneous.name '.outlog '];168 # end169 # system(compressstring);170 #171 # disp('uploading input file and queueing script');172 # issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[md.private.runtimename '.tar.gz']});173 #174 # disp('launching solution sequence on remote cluster');175 # issmssh(cluster.name,cluster.login,cluster.port,launchcommand);176 # else177 # disp('batch mode requested: not launching job interactively');178 # disp('launch solution sequence on remote cluster by hand');179 # end180 # else181 # %launch right here, do not compress or archive.182 # system([md.miscellaneous.name '.bat']);183 # end184 #185 # end %}}}186 # function Download(cluster,md)% {{{1187 #188 # if ~ispc,189 # %some check190 # if isempty(md.private.runtimename),191 # error('supply runtime name for results to be loaded!');192 # end193 #194 # %Figure out the directory where all the files are in:195 # directory=[cluster.executionpath '/' md.private.runtimename '/'];196 #197 # %What packages are we picking up from remote cluster198 # packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};199 # if md.qmu.isdakota,200 # packages{end+1}=[md.miscellaneous.name '.qmu.err'];201 # packages{end+1}=[md.miscellaneous.name '.qmu.out'];202 # if isfield(md.qmu.params,'tabular_graphics_data'),203 # if md.qmu.params.tabular_graphics_data==true,204 # packages{end+1}='dakota_tabular.dat';205 # end206 # end207 # else208 # packages{end+1}=[md.miscellaneous.name '.outbin'];209 # end210 #211 # %copy files from cluster to present directory212 # issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);213 # else214 # %do nothing!215 # end216 # end %}}}217 # -
issm/trunk-jpl/src/m/classes/clusters/greenplanet.m
r11867 r12351 8 8 classdef greenplanet 9 9 properties (SetAccess=public) 10 % {{{ 110 % {{{ 11 11 name='greenplanet' 12 12 login=''; … … 24 24 end 25 25 methods 26 function cluster=greenplanet(varargin) % {{{ 126 function cluster=greenplanet(varargin) % {{{ 27 27 28 28 %initialize cluster using default settings if provided … … 33 33 end 34 34 %}}} 35 function disp(cluster) % {{{ 135 function disp(cluster) % {{{ 36 36 % display the object 37 37 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1))); … … 48 48 end 49 49 %}}} 50 function checkconsistency(cluster,md,solution,analyses) % {{{ 150 function checkconsistency(cluster,md,solution,analyses) % {{{ 51 51 52 52 available_queues={'rignot','default'}; … … 63 63 end 64 64 %}}} 65 function BuildQueueScript(cluster,m d) % {{{165 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{ 66 66 67 %retrieve parameters 68 modelname=md.miscellaneous.name; 69 solution=md.private.solution; 70 isvalgrind=md.debug.valgrind; 67 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end 68 if(isgprof), disp('gprof not supported by cluster, ignoring...'); end 71 69 72 70 %compute number of processors 73 71 cluster.np=cluster.numnodes*cluster.cpuspernode; 74 72 75 % open file for writing:73 %write queuing script 76 74 fid=fopen([modelname '.queue'],'w'); 77 78 75 fprintf(fid,'#PBS -S /bin/bash\n'); 79 76 fprintf(fid,'#PBS -N %s\n',modelname); … … 84 81 fprintf(fid,'#PBS -o %s.outlog \n',modelname); 85 82 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname); 86 87 83 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,md.private.runtimename); 88 84 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname); 89 90 if ~md.settings.io_gather, 91 %concatenate the output files: 85 if ~io_gather, %concatenate the output files: 92 86 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname); 93 87 end 94 95 %close file96 88 fclose(fid); 97 89 … … 100 92 fid=fopen([modelname '.run'],'w'); 101 93 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname); 102 103 if ~md.settings.io_gather, 104 %concatenate the output files: 94 if ~io_gather, %concatenate the output files: 105 95 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname); 106 96 end … … 112 102 end 113 103 end %}}} 114 function LaunchQueueJob(cluster,md,options)% {{{ 1104 function LaunchQueueJob(cluster,md,options)% {{{ 115 105 116 106 %lauch command, to be executed via ssh … … 152 142 end 153 143 %}}} 154 function Download(cluster,md)% {{{ 1144 function Download(cluster,md)% {{{ 155 145 156 146 %some check -
issm/trunk-jpl/src/m/classes/clusters/none.m
r12030 r12351 11 11 end 12 12 methods 13 function cluster=none(varargin) % {{{ 113 function cluster=none(varargin) % {{{ 14 14 error('Cannot assign md.cluster to ''none'': ISSM is not available in serial model anymore'); 15 15 end -
issm/trunk-jpl/src/m/classes/clusters/pfe.m
r11867 r12351 8 8 classdef pfe 9 9 properties (SetAccess=public) 10 % {{{ 110 % {{{ 11 11 name='pfe' 12 12 login=''; … … 29 29 end 30 30 methods 31 function cluster=pfe(varargin) % {{{ 131 function cluster=pfe(varargin) % {{{ 32 32 33 33 %initialize cluster using default settings if provided … … 38 38 end 39 39 %}}} 40 function disp(cluster) % {{{ 140 function disp(cluster) % {{{ 41 41 % display the object 42 42 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1))); … … 56 56 end 57 57 %}}} 58 function checkconsistency(cluster,md,solution,analyses) % {{{ 158 function checkconsistency(cluster,md,solution,analyses) % {{{ 59 59 60 60 available_queues={'long','normal','debug'}; … … 96 96 end 97 97 %}}} 98 function BuildQueueScript(cluster,md) % {{{1 99 100 %retrieve parameters 101 modelname=md.miscellaneous.name; 102 solution=md.private.solution; 103 isvalgrind=md.debug.valgrind; 98 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{ 99 100 if(isgprof), disp('gprof not supported by cluster, ignoring...'); end 104 101 105 102 %compute number of processors 106 103 cluster.np=cluster.numnodes*cluster.cpuspernode; 107 104 108 % open file for writing:105 %write queuing script 109 106 fid=fopen([modelname '.queue'],'w'); 110 111 107 fprintf(fid,'#PBS -S /bin/bash\n'); 112 108 % fprintf(fid,'#PBS -N %s\n',modelname); … … 118 114 fprintf(fid,'#PBS -o %s.outlog \n',modelname); 119 115 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname); 120 121 116 fprintf(fid,'. /usr/share/modules/init/bash\n\n'); 122 123 117 fprintf(fid,'module load comp-intel/11.1.046\n'); 124 118 fprintf(fid,'module load mpi/mpt.1.25\n'); 125 119 fprintf(fid,'module load math/intel_mkl_64_10.0.011\n\n'); 126 127 120 fprintf(fid,'export PATH="$PATH:."\n\n'); 128 121 fprintf(fid,'export MPI_GROUP_MAX=64\n\n'); 129 130 122 fprintf(fid,'cd $PBS_O_WORKDIR\n\n'); 131 132 123 fprintf(fid,'mpiexec -np %i %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),modelname); 133 134 if ~md.settings.io_gather, 135 %concatenate the output files: 124 if ~io_gather, %concatenate the output files: 136 125 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname); 137 126 end 138 139 %close file140 127 fclose(fid); 141 128 … … 148 135 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),modelname); 149 136 end 150 151 if ~md.settings.io_gather, 152 %concatenate the output files: 137 if ~io_gather, %concatenate the output files: 153 138 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname); 154 139 end … … 160 145 end 161 146 end %}}} 162 function LaunchQueueJob(cluster,md,options)% {{{ 1147 function LaunchQueueJob(cluster,md,options)% {{{ 163 148 164 149 %lauch command, to be executed via ssh … … 204 189 end 205 190 %}}} 206 function Download(cluster,md)% {{{ 1191 function Download(cluster,md)% {{{ 207 192 208 193 %some check -
issm/trunk-jpl/src/m/classes/clusters/pollux.m
r11867 r12351 8 8 classdef pollux 9 9 properties (SetAccess=public) 10 % {{{ 110 % {{{ 11 11 name='pollux' 12 12 login='username'; … … 20 20 end 21 21 methods 22 function cluster=pollux(varargin) % {{{ 122 function cluster=pollux(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 checkconsistency(cluster,md,solution,analyses) % {{{ 40 40 41 41 available_queues={'shortp','longp'}; … … 46 46 end 47 47 %}}} 48 function BuildQueueScript(cluster,m d) % {{{148 function BuildQueueScript(cluster,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)% {{{ 172 function LaunchQueueJob(cluster,md,options)% {{{ 78 73 79 74 %lauch command, to be executed via ssh … … 103 98 end 104 99 %}}} 105 function Download(cluster,md)% {{{ 1100 function Download(cluster,md)% {{{ 106 101 107 102 %some check -
issm/trunk-jpl/src/m/classes/model/model.m
r12335 r12351 242 242 if isfield(structmd,'pressureload'), md.diagnostic.icefront=structmd.pressureload; end 243 243 if isfield(structmd,'diagnostic_ref'), md.diagnostic.referential=structmd.diagnostic_ref; end 244 245 246 247 244 if isfield(structmd,'npart'); md.qmu.numberofpartitions=structmd.npart; end 245 if isfield(structmd,'part'); md.qmu.partition=structmd.part; end 246 248 247 %Field changes 249 248 if (isfield(structmd,'type') & ischar(structmd.type)), … … 356 355 md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6); 357 356 end 358 if isfield(structmd,'npart'); md.qmu.numberofpartitions=structmd.npart; end 359 if isfield(structmd,'part'); md.qmu.partition=structmd.part; end 360 357 361 358 end% }}} 362 359 function md = setdefaultparameters(md) % {{{1 -
issm/trunk-jpl/src/m/classes/pairoptions.m
r11872 r12351 223 223 end 224 224 end % }}} 225 function marshall(obj,fid)% {{{ 226 disp('No options marshalled for now'); 227 for i=1:size(obj.list,1), 228 name = obj.list{i,1}; 229 value = obj.list{i,2}; 230 231 if (isnumeric(value) & numel(value)==1), 232 % 233 elseif ischar(value), 234 % 235 else 236 error(['Cannot marshall option ' name ': format not supported yet']); 237 end 238 end 239 end % }}} 225 240 end 226 241 end -
issm/trunk-jpl/src/m/model/solve.m
r10969 r12351 24 24 % md=solve(md,DiagnosticSolutionEnum); 25 25 26 %recover options26 %recover and process solve options 27 27 options=pairoptions(varargin{:},'solution_type',solutionenum); 28 29 %add default options30 28 options=process_solve_options(options); 31 29 … … 46 44 end 47 45 48 %if running qmu analysis, some preprocessing of dakota files using 49 % modelsfields needs to be carried out.46 %if running qmu analysis, some preprocessing of dakota files using models 47 %fields needs to be carried out. 50 48 if md.qmu.isdakota, 51 49 md=preqmu(md,options); 52 50 end 53 51 54 %Save model as is (in case of a crash)55 assignin('base',inputname(1),md);56 57 52 %flaim analysis 58 if ( md.private.solution== FlaimSolutionEnum)53 if (options.solution_type == FlaimSolutionEnum) 59 54 md=flaim_sol(md,options); 60 55 md.private.solution=EnumToString(options.solution_type); … … 62 57 end 63 58 64 %Marshall model data into a binary file. 65 marshall(md); 66 67 %write a template file for issm to use, in parallel 68 PetscFile(md.solver,[md.miscellaneous.name '.petsc']); 69 70 %If running in parallel, we have a different way of launching the solution 71 %sequences. 72 if ~strcmpi(md.cluster.name,'none'), 73 md=solveparallel(md,options); 59 %Do we load results only? 60 if options.loadonly, 61 md=loadresultsfromcluster(md); 74 62 return; 75 63 end 76 64 77 %Launch correct solution sequence 78 md=issm(md,md.private.solution); 65 %Wite all input files 66 marshall(md); % bin file 67 PetscFile(md.solver,[md.miscellaneous.name '.petsc']); % petsc file 79 68 80 % post processes qmu results if necessary81 if md.qmu.isdakota, 82 md=postqmu(md); 83 cd .. 84 if ~strncmpi(options.keep,'y',1) 85 system(['rm -rf qmu' num2str(feature('GetPid'))]);86 end69 %Launch job on remote cluster 70 cluster=md.cluster; 71 72 %we need to make sure we have PETSC support, otherwise, we run with only one cpu: 73 if ~ispetsc, 74 disp('PETSC support not included, running on 1 cpu only!'); 75 cluster.np=1; 87 76 end 88 77 89 %convert analysis type to string finally 90 md.private.solution=EnumToString(options.solution_type); 78 %First, build a runtime name that is unique 79 c=clock; md.private.runtimename=sprintf('%s-%02i-%02i-%04i-%02i-%02i-%02i-%i',md.miscellaneous.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),feature('GetPid')); 80 81 BuildQueueScript(cluster,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof); 82 LaunchQueueJob(cluster,md,options); 83 84 if ~strcmpi(options.upload,'on'), %did we even try to run? if so, wait on lock 85 86 %Do we return, or just wait for results? 87 if (md.settings.waitonlock>0 & ~strcmpi(options.batch,'yes')), 88 %we wait for the done file 89 islock=waitonlock(md); 90 if islock==0, %no results to be loaded 91 disp('The results must be loaded manually with md=loadresultsfromcluster(md).'); 92 else %load results 93 disp('loading results from cluster'); 94 md=loadresultsfromcluster(md); 95 end 96 end 97 98 %post processes qmu results if necessary 99 if md.qmu.isdakota, 100 if ~strncmpi(options.keep,'y',1) 101 system(['rm -rf qmu' num2str(feature('GetPid'))]); 102 end 103 end 104 else 105 disp('solve done uploading test decks'); 106 end
Note:
See TracChangeset
for help on using the changeset viewer.