Ignore:
Timestamp:
02/29/12 13:35:30 (13 years ago)
Author:
cborstad
Message:

merged changes up to r11576 from trunk-jpl into branch

Location:
issm/branches/trunk-jpl-damage
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-jpl-damage

  • issm/branches/trunk-jpl-damage/src/m

    • Property svn:ignore set to
      Makefile.in
      Makefile
  • issm/branches/trunk-jpl-damage/src/m/classes

    • Property svn:ignore set to
      Makefile.in
      Makefile
  • issm/branches/trunk-jpl-damage/src/m/classes/clusters

    • Property svn:ignore set to
      Makefile.in
      Makefile
  • issm/branches/trunk-jpl-damage/src/m/classes/clusters/generic.m

    r11218 r11577  
    7878
    7979                         %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
    8185
    8286                         %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                         
    8493                         if ~isvalgrind,
    8594                                 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
    91106                                 end
    92107                         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 ',...
    96112                                         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
    97116                         end
    98117
    99118                         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
    101125                         end
    102126
    103127                         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);
    107139
    108140                         %in interactive mode, create a run file, and errlog and outlog file
     
    112144                         end
    113145
     146
    114147                 end
    115148                 %}}}
    116149                 function LaunchQueueJob(cluster,md,options)% {{{1
    117150                         
    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'];
    163162                                        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');
    164176                                end
    165177                        else
    166                                 packages{end+1}=[md.miscellaneous.name '.outbin'];
     178                                %launch right here, do not compress or archive.
     179                                system([md.miscellaneous.name '.bat']);
    167180                        end
    168181
    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
    171213                end %}}}
    172214        end
Note: See TracChangeset for help on using the changeset viewer.