Changeset 12363


Ignore:
Timestamp:
06/04/12 14:36:57 (13 years ago)
Author:
Mathieu Morlighem
Message:

Simplifying cluster

Location:
issm/trunk-jpl/src/m
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/clusters/acenet.m

    r12351 r12363  
    110110                 end
    111111                 %}}}
    112                  function Download(cluster,md)% {{{
     112                 function Download(cluster,dirname,filelist)% {{{
    113113
    114                         %some check
    115                         if isempty(md.private.runtimename),
    116                                 error('pfe Download error message: supply runtime name for results to be loaded!');
    117                         end
     114                         %copy files from cluster to current directory
     115                         directory=[cluster.executionpath '/' dirname '/'];
     116                         issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
    118117
    119                         %Figure out the  directory where all the files are in:
    120                         directory=[cluster.executionpath '/' md.private.runtimename '/'];
    121 
    122                         %What packages are we picking up from remote cluster
    123                         packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
    124                         %packages={};
    125                         if md.qmu.isdakota,
    126                                 packages{end+1}=[md.miscellaneous.name '.qmu.err'];
    127                                 packages{end+1}=[md.miscellaneous.name '.qmu.out'];
    128                                 if isfield(md.qmu.params,'tabular_graphics_data'),
    129                                         if md.qmu.params.tabular_graphics_data==true,
    130                                                 packages{end+1}='dakota_tabular.dat';
    131                                         end
    132                                 end
    133                         else
    134                                 packages{end+1}=[md.miscellaneous.name '.outbin'];
    135                         end
    136 
    137                         %copy files from cluster to present directory
    138                         issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
    139                 end %}}}
     118                 end %}}}
    140119        end
    141120end
  • issm/trunk-jpl/src/m/classes/clusters/castor.m

    r12351 r12363  
    9898                 end
    9999                 %}}}
    100                  function Download(cluster,md)% {{{
     100                 function Download(cluster,dirname,filelist)% {{{
    101101
    102                         %some check
    103                         if isempty(md.private.runtimename),
    104                                 error('pfe Download error message: supply runtime name for results to be loaded!');
    105                         end
     102                         %copy files from cluster to current directory
     103                         directory=[cluster.executionpath '/' dirname '/'];
     104                         issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
    106105
    107                         %Figure out the  directory where all the files are in:
    108                         directory=[cluster.executionpath '/' md.private.runtimename '/'];
    109 
    110                         %What packages are we picking up from remote cluster
    111                         packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
    112                         if md.qmu.isdakota,
    113                                 packages{end+1}=[md.miscellaneous.name '.qmu.err'];
    114                                 packages{end+1}=[md.miscellaneous.name '.qmu.out'];
    115                                 if isfield(md.qmu.params,'tabular_graphics_data'),
    116                                         if md.qmu.params.tabular_graphics_data==true,
    117                                                 packages{end+1}='dakota_tabular.dat';
    118                                         end
    119                                 end
    120                         else
    121                                 packages{end+1}=[md.miscellaneous.name '.outbin'];
    122                         end
    123 
    124                         %copy files from cluster to present directory
    125                         issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
    126                 end %}}}
     106                 end %}}}
    127107        end
    128108end
  • issm/trunk-jpl/src/m/classes/clusters/cosmos.m

    r12351 r12363  
    9898                 end
    9999                 %}}}
    100                  function Download(cluster,md)% {{{
     100                 function Download(cluster,dirname,filelist)% {{{
    101101
    102                         %some check
    103                         if isempty(md.private.runtimename),
    104                                 error('pfe Download error message: supply runtime name for results to be loaded!');
    105                         end
     102                         %copy files from cluster to current directory
     103                         directory=[cluster.executionpath '/' dirname '/'];
     104                         issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
    106105
    107                         %Figure out the  directory where all the files are in:
    108                         directory=[cluster.executionpath '/' md.private.runtimename '/'];
    109 
    110                         %What packages are we picking up from remote cluster
    111                         packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
    112                         if md.qmu.isdakota,
    113                                 packages{end+1}=[md.miscellaneous.name '.qmu.err'];
    114                                 packages{end+1}=[md.miscellaneous.name '.qmu.out'];
    115                                 if isfield(md.qmu.params,'tabular_graphics_data'),
    116                                         if md.qmu.params.tabular_graphics_data==true,
    117                                                 packages{end+1}='dakota_tabular.dat';
    118                                         end
    119                                 end
    120                         else
    121                                 packages{end+1}=[md.miscellaneous.name '.outbin'];
    122                         end
    123 
    124                         %copy files from cluster to present directory
    125                         issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
    126                 end %}}}
     106                 end %}}}
    127107        end
    128108end
  • issm/trunk-jpl/src/m/classes/clusters/gemini.m

    r12351 r12363  
    9999                 end
    100100                 %}}}
    101                  function Download(cluster,md)% {{{
     101                 function Download(cluster,dirname,filelist)% {{{
    102102
    103                         %some check
    104                         if isempty(md.private.runtimename),
    105                                 error('pfe Download error message: supply runtime name for results to be loaded!');
    106                         end
     103                         %copy files from cluster to current directory
     104                         directory=[cluster.executionpath '/' dirname '/'];
     105                         issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
    107106
    108                         %Figure out the  directory where all the files are in:
    109                         directory=[cluster.executionpath '/' md.private.runtimename '/'];
    110 
    111                         %What packages are we picking up from remote cluster
    112                         packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
    113                         if md.qmu.isdakota,
    114                                 packages{end+1}=[md.miscellaneous.name '.qmu.err'];
    115                                 packages{end+1}=[md.miscellaneous.name '.qmu.out'];
    116                                 if isfield(md.qmu.params,'tabular_graphics_data'),
    117                                         if md.qmu.params.tabular_graphics_data==true,
    118                                                 packages{end+1}='dakota_tabular.dat';
    119                                         end
    120                                 end
    121                         else
    122                                 packages{end+1}=[md.miscellaneous.name '.outbin'];
    123                         end
    124 
    125                         %copy files from cluster to present directory
    126                         issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
    127                 end %}}}
     107                 end %}}}
    128108        end
    129109end
  • issm/trunk-jpl/src/m/classes/clusters/generic.m

    r12351 r12363  
    6060                 %}}}
    6161                 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
    62                  
     62
    6363                         %write queuing script
    6464                         if ~ispc,
     65
    6566                                 fid=fopen([modelname '.queue'],'w');
    66                          else
    67                                  fid=fopen([modelname '.bat'],'w');
    68                          end
    69 
    70                          %write instructions for launching a job on the cluster
    71                          if ~ispc,
    7267                                 fprintf(fid,'#!/bin/sh\n');
    73                          else
    74                                  fprintf(fid,'@echo off\n');
    75                          end
    76                          
    77                          if ~isvalgrind,
    78                                  if cluster.interactive
    79                                          if ~ispc,
     68                                 if ~isvalgrind,
     69                                         if cluster.interactive
    8070                                                 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
    8171                                         else
    82                                                  fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
     72                                                 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);
    8373                                         end
     74                                 elseif isgprof,
     75                                         fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
    8476                                 else
    85                                          if ~ispc,
    86                                                  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);
    87                                          else
    88                                                  fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
    89                                          end
    90                                  end
    91                          else
    92                                  if ~ispc,
    9377                                         %Add --gen-suppressions=all to get suppression lines
    9478                                         fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
    9579                                         fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
    96                                          cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
     80                                                 cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
     81                                 end
     82                                 if ~io_gather, %concatenate the output files:
     83                                         fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
     84                                 end
     85                                 fclose(fid);
     86
     87                         else % Windows
     88
     89                                 fid=fopen([modelname '.bat'],'w');
     90                                 fprintf(fid,'@echo off\n');
     91                                 if cluster.interactive
     92                                         fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
    9793                                 else
    98                                          error('valgrind not supported on windows platforms');
     94                                         fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog',...
     95                                                 cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
    9996                                 end
     97                                 fclose(fid);
    10098                         end
    101 
    102                          if isgprof,
    103                                  if ~ispc,
    104                                          fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
    105                                  else
    106                                          error('gprof not supported on windows platforms');
    107                                  end
    108 
    109                          end
    110 
    111                          if ~io_gather,
    112                                  if ~ispc, %concatenate the output files:
    113                                          fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
    114                                  else
    115                                          error('iogather not supported on windows platforms');
    116                                  end
    117                          end
    118                          fclose(fid);
    11999
    120100                         %in interactive mode, create a run file, and errlog and outlog file
     
    125105                 end
    126106                 %}}}
    127                  function LaunchQueueJob(cluster,md,options)% {{{
     107                 function LaunchQueueJob(cluster,modelname,dirname,filelist)% {{{
    128108                         
    129                          if ~ispc,
    130                                          %lauch command, to be executed via ssh
    131                                          launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.private.runtimename ' && mkdir ' md.private.runtimename ...
    132                                          ' && cd ' md.private.runtimename ' && mv ../' md.private.runtimename '.tar.gz ./ && tar -zxf ' md.private.runtimename '.tar.gz  && source  ' md.miscellaneous.name '.queue '];
     109                         if ispc,
     110                                 %launch right here, do not compress or archive
     111                                 system([modelname '.bat']);
     112                                 return;
     113                         end
    133114
    134                                          if ~strcmpi(options.batch,'yes'),
     115                         %compress the files into one zip.
     116                         compressstring=['tar -zcf ' dirname '.tar.gz ' modelname '.bin ' modelname '.queue '  modelname '.petsc '];
     117                         for i=1:numel(filelist),
     118                                 compressstring = [compressstring ' ' filelist{i}];
     119                         end
     120                         if cluster.interactive,
     121                                 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
     122                         end
     123                         system(compressstring);
    135124
    136                                                  %compress the files into one zip.
    137                                                  compressstring=['tar -zcf ' md.private.runtimename '.tar.gz ' md.miscellaneous.name '.bin ' md.miscellaneous.name '.queue '  md.miscellaneous.name '.petsc '];
    138                                                  if md.qmu.isdakota,
    139                                                          compressstring=[compressstring md.miscellaneous.name '.qmu.in'];
    140                                         end
    141                                         if cluster.interactive,
    142                                                 compressstring=[compressstring ' ' md.miscellaneous.name '.errlog ' md.miscellaneous.name '.outlog '];
    143                                         end
    144                                         system(compressstring);
     125                         disp('uploading input file and queueing script');
     126                         issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
    145127
    146                                         disp('uploading input file and queueing script');
    147                                         issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[md.private.runtimename '.tar.gz']});
     128                         disp('launching solution sequence on remote cluster');
     129                         launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
     130                                 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && source  ' modelname '.queue '];
     131                         issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
     132                end %}}}
     133                 function Download(cluster,dirname,filelist)% {{{
    148134
    149                                         disp('launching solution sequence on remote cluster');
    150                                         issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
    151                                 else
    152                                         disp('batch mode requested: not launching job interactively');
    153                                         disp('launch solution sequence on remote cluster by hand');
    154                                 end
    155                         else
    156                                 %launch right here, do not compress or archive.
    157                                 system([md.miscellaneous.name '.bat']);
     135                        if ispc,
     136                                %do nothing
     137                                return;
    158138                        end
    159139
    160                 end %}}}
    161                  function Download(cluster,md)% {{{
    162 
    163                         if ~ispc,
    164                                 %some check
    165                                 if isempty(md.private.runtimename),
    166                                         error('supply runtime name for results to be loaded!');
    167                                 end
    168 
    169                                 %Figure out the  directory where all the files are in:
    170                                 directory=[cluster.executionpath '/' md.private.runtimename '/'];
    171 
    172                                 %What packages are we picking up from remote cluster
    173                                 packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
    174                                 if md.qmu.isdakota,
    175                                         packages{end+1}=[md.miscellaneous.name '.qmu.err'];
    176                                         packages{end+1}=[md.miscellaneous.name '.qmu.out'];
    177                                         if isfield(md.qmu.params,'tabular_graphics_data'),
    178                                                 if md.qmu.params.tabular_graphics_data==true,
    179                                                         packages{end+1}='dakota_tabular.dat';
    180                                                 end
    181                                         end
    182                                 else
    183                                         packages{end+1}=[md.miscellaneous.name '.outbin'];
    184                                 end
    185 
    186                                 %copy files from cluster to present directory
    187                                 issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
    188                         else
    189                                 %do nothing!
    190                         end
     140                        %copy files from cluster to current directory
     141                        directory=[cluster.executionpath '/' dirname '/'];
     142                        issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
    191143                end %}}}
    192144        end
  • issm/trunk-jpl/src/m/classes/clusters/greenplanet.m

    r12351 r12363  
    142142                 end
    143143                 %}}}
    144                  function Download(cluster,md)% {{{
     144                 function Download(cluster,dirname,filelist)% {{{
    145145
    146                         %some check
    147                         if isempty(md.private.runtimename),
    148                                 if ~cluster.interactive,
    149                                         error('greenplanet Download error message: supply runtime name for results to be loaded!');
    150                                 end
    151                         end
     146                         %copy files from cluster to current directory
     147                         directory=[cluster.executionpath '/' dirname '/'];
     148                         issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
    152149
    153                         %Figure out the  directory where all the files are in:
    154                         if ~cluster.interactive,
    155                                 directory=[cluster.executionpath '/' md.private.runtimename '/'];
    156                         else
    157                                 directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive) '/'];
    158                         end
    159 
    160                         %What packages are we picking up from remote cluster
    161                         if ~cluster.interactive,
    162                                 packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
    163                         else
    164                                 packages={};
    165                         end
    166                         if md.qmu.isdakota,
    167                                 packages{end+1}=[md.miscellaneous.name '.qmu.err'];
    168                                 packages{end+1}=[md.miscellaneous.name '.qmu.out'];
    169                                 if isfield(md.qmu.params,'tabular_graphics_data'),
    170                                         if md.qmu.params.tabular_graphics_data==true,
    171                                                 packages{end+1}='dakota_tabular.dat';
    172                                         end
    173                                 end
    174                         else
    175                                 packages{end+1}=[md.miscellaneous.name '.outbin'];
    176                         end
    177 
    178                         %copy files from cluster to present directory
    179                         issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
    180 
    181                 end %}}}
     150                 end %}}}
    182151        end
    183152end
  • issm/trunk-jpl/src/m/classes/clusters/pfe.m

    r12351 r12363  
    189189                 end
    190190                 %}}}
    191                  function Download(cluster,md)% {{{
    192 
    193                         %some check
    194                         if isempty(md.private.runtimename),
    195                                 if ~cluster.interactive,
    196                                         error('pfe Download error message: supply runtime name for results to be loaded!');
    197                                 end
    198                         end
    199 
    200                         %Figure out the  directory where all the files are in:
    201                         if ~cluster.interactive,
    202                                 directory=[cluster.executionpath '/' md.private.runtimename '/'];
    203                         else
    204                                 directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive) '/'];
    205                         end
    206 
    207                         %What packages are we picking up from remote cluster
    208                         if ~cluster.interactive,
    209                                 packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
    210                         else
    211                                 packages={};
    212                         end
    213                         if md.qmu.isdakota,
    214                                 packages{end+1}=[md.miscellaneous.name '.qmu.err'];
    215                                 packages{end+1}=[md.miscellaneous.name '.qmu.out'];
    216                                 if isfield(md.qmu.params,'tabular_graphics_data'),
    217                                         if md.qmu.params.tabular_graphics_data==true,
    218                                                 packages{end+1}='dakota_tabular.dat';
    219                                         end
    220                                 end
    221                         else
    222                                 packages{end+1}=[md.miscellaneous.name '.outbin'];
    223                         end
    224 
    225                         %copy files from cluster to present directory
    226                         if ~cluster.bbftp,
    227                                 issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
    228                         else
    229                                 issmbbftpin(cluster.name, cluster.login, cluster.port, cluster.numstreams, directory, packages);
    230                         end
    231 
    232                 end %}}}
     191                 function Download(cluster,dirname,filelist)% {{{
     192
     193                         %copy files from cluster to current directory
     194                         if ~cluster.interactive,
     195                                 directory=[cluster.executionpath '/' dirname '/'];
     196                         else
     197                                 directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive) '/'];
     198                         end
     199
     200                         if ~cluster.bbftp,
     201                                 issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
     202                         else
     203                                 issmbbftpin(cluster.name, cluster.login, cluster.port, cluster.numstreams, directory, packages);
     204                         end
     205
     206                 end %}}}
    233207        end
    234208end
  • issm/trunk-jpl/src/m/classes/clusters/pollux.m

    r12351 r12363  
    9898                 end
    9999                 %}}}
    100                  function Download(cluster,md)% {{{
     100                 function Download(cluster,dirname,filelist)% {{{
    101101
    102                         %some check
    103                         if isempty(md.private.runtimename),
    104                                 error('pfe Download error message: supply runtime name for results to be loaded!');
    105                         end
     102                         %copy files from cluster to current directory
     103                         directory=[cluster.executionpath '/' dirname '/'];
     104                         issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
    106105
    107                         %Figure out the  directory where all the files are in:
    108                         directory=[cluster.executionpath '/' md.private.runtimename '/'];
    109 
    110                         %What packages are we picking up from remote cluster
    111                         packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
    112                         if md.qmu.isdakota,
    113                                 packages{end+1}=[md.miscellaneous.name '.qmu.err'];
    114                                 packages{end+1}=[md.miscellaneous.name '.qmu.out'];
    115                                 if isfield(md.qmu.params,'tabular_graphics_data'),
    116                                         if md.qmu.params.tabular_graphics_data==true,
    117                                                 packages{end+1}='dakota_tabular.dat';
    118                                         end
    119                                 end
    120                         else
    121                                 packages{end+1}=[md.miscellaneous.name '.outbin'];
    122                         end
    123 
    124                         %copy files from cluster to present directory
    125                         issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
    126                 end %}}}
     106                 end %}}}
    127107        end
    128108end
  • issm/trunk-jpl/src/m/model/loadresultsfromcluster.m

    r11487 r12363  
    1313
    1414%Download outputs from the cluster
    15 if verLessThan('matlab', '7.6');
    16         Download(cluster,md);
     15filelist={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
     16if md.qmu.isdakota,
     17        filelist{end+1}=[md.miscellaneous.name '.qmu.err'];
     18        filelist{end+1}=[md.miscellaneous.name '.qmu.out'];
     19        if isfield(md.qmu.params,'tabular_graphics_data'),
     20                if md.qmu.params.tabular_graphics_data==true,
     21                        filelist{end+1}='dakota_tabular.dat';
     22                end
     23        end
    1724else
    18         cluster.Download(md);
     25        filelist{end+1}=[md.miscellaneous.name '.outbin'];
    1926end
     27Download(cluster,md.private.runtimename,filelist);
    2028
    2129%If we are here, no errors in the solution sequence, call loadresultsfromdisk.
  • issm/trunk-jpl/src/m/model/loadresultsfromdisk.m

    r11333 r12363  
    5959        md=postqmu(md);
    6060        cd ..
    61 
    6261end
  • issm/trunk-jpl/src/m/model/solve.m

    r12351 r12363  
    3030%recover some fields
    3131md.private.solution=options.solution_type;
     32cluster=md.cluster;
    3233
    3334%check model consistency
     
    4344        ismodelselfconsistent(md),
    4445end
     46
     47%First, build a runtime name that is unique
     48c=clock;
     49md.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'));
    4550
    4651%if running qmu analysis, some preprocessing of dakota files using models
     
    6671marshall(md);                                          % bin file
    6772PetscFile(md.solver,[md.miscellaneous.name '.petsc']); % petsc file
    68 
    69 %Launch job on remote cluster
    70 cluster=md.cluster;
     73BuildQueueScript(cluster,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof); % queue file
    7174
    7275%we need to make sure we have PETSC support, otherwise, we run with only one cpu:
     
    7679end
    7780
    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'));
     81%Stop here if batch mode
     82if strcmpi(options.batch,'yes')
     83        disp('batch mode requested: not launching job interactively');
     84        disp('launch solution sequence on remote cluster by hand');
     85        return;
     86end
    8087
    81 BuildQueueScript(cluster,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof);
    82 LaunchQueueJob(cluster,md,options);
     88%Launch job
     89modelname = md.miscellaneous.name;
     90filelist  = {[modelname '.bin '] [modelname '.petsc '] [modelname '.queue ']};
     91if md.qmu.isdakota,
     92        filelist{end+1} = [modelname '.qmu.in'];
     93end
     94LaunchQueueJob(cluster,md.miscellaneous.name,md.private.runtimename,filelist);
    8395
    84 if ~strcmpi(options.upload,'on'), %did we even try to run? if so, wait on lock
     96%did we even try to run? if so, wait on lock
     97if strcmpi(options.upload,'on'),
     98        disp('solve done uploading test decks');
     99        return;
     100end
    85101
    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
     102%wait on lock
     103if md.settings.waitonlock>0,
     104        %we wait for the done file
     105        islock=waitonlock(md);
     106        if islock==0, %no results to be loaded
     107                disp('The results must be loaded manually with md=loadresultsfromcluster(md).');
     108        else          %load results
     109                disp('loading results from cluster');
     110                md=loadresultsfromcluster(md);
    96111        end
     112end
    97113
    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
     114%post processes qmu results if necessary
     115if md.qmu.isdakota,
     116        if ~strncmpi(options.keep,'y',1)
     117                system(['rm -rf qmu' num2str(feature('GetPid'))]);
    103118        end
    104 else
    105         disp('solve done uploading test decks');
    106119end
Note: See TracChangeset for help on using the changeset viewer.