Ignore:
Timestamp:
08/02/12 17:13:12 (13 years ago)
Author:
cborstad
Message:

merged trunk-jpl into trunk-jpl-damage through revision 12877

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

Legend:

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

  • issm/branches/trunk-jpl-damage/src/m/classes/clusters/castor.m

    r12004 r12878  
    88classdef castor
    99    properties (SetAccess=public)
    10                  % {{{1
     10                 % {{{
    1111                 name='castor'
    1212                 login='username';
     
    2020         end
    2121         methods
    22                  function cluster=castor(varargin) % {{{1
     22                 function cluster=castor(varargin) % {{{
    2323                         cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
    2424                 end
    2525                 %}}}
    26                  function disp(cluster) % {{{1
     26                 function disp(cluster) % {{{
    2727                         %  display the object
    2828                         disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
     
    3737                 end
    3838                 %}}}
    39                  function checkconsistency(cluster,md,solution,analyses) % {{{1
     39                 function md = checkconsistency(cluster,md,solution,analyses) % {{{
    4040
    4141                         available_queues={'shortc','longc'};
     
    4646                 end
    4747                 %}}}
    48                  function BuildQueueScript(cluster,md) % {{{1
     48                 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
    4949
    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
    5352
    54                          %open file for writing:
     53                         %write queuing script
    5554                         fid=fopen([modelname '.queue'],'w');
    56 
    5755                         fprintf(fid,'#!/bin/sh\n');
    5856                         fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
     
    6462                         fprintf(fid,'#PBS -o %s.outlog \n',modelname);
    6563                         fprintf(fid,'#PBS -e %s.errlog \n',modelname);
    66 
    6764                         fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
    6865                         fprintf(fid,'cd $PBS_O_WORKDIR\n');
    6966                         fprintf(fid,'export OMP_NUM_THREADS=1\n');
    7067                         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 file
    7368                         fclose(fid);
    7469
    7570                 end
    7671                 %}}}
    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)% {{{
    8273
    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);
    9783
    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']});
    10286
    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)% {{{
    10693
    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);
    11197
    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 %}}}
    13299        end
    133100end
Note: See TracChangeset for help on using the changeset viewer.