Changeset 8586


Ignore:
Timestamp:
06/09/11 10:04:11 (14 years ago)
Author:
Mathieu Morlighem
Message:

use generic cluster instead of larsen, astrid, wilkes, ogive and other local machines

Location:
issm/trunk/src/m/classes/clusters
Files:
7 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/clusters/README

    r5956 r8586  
    99
    1010How to add your cluster?
    11 use an existing cluster script, such as pleiades.m, and rename it to your cluster name.
     11use an existing cluster script, such as pfe.m, and rename it to your cluster name.
    1212update the methods.
  • issm/trunk/src/m/classes/clusters/astrid.m

    r8246 r8586  
    2525                 function cluster=astrid(varargin) % {{{1
    2626                 
    27                          %initialize cluster using user settings if provided
    28                          if (exist('astrid_settings')==2), astrid_settings; end
    29 
    30                          %use provided options to change fields
    31                          options=pairoptions(varargin{:});
    32                          for i=1:size(options.list,1),
    33                                  fieldname=options.list{i,1};
    34                                  fieldvalue=options.list{i,2};
    35                                  if ismember(fieldname,properties(astrid)),
    36                                          cluster.(fieldname)=fieldvalue;
    37                                  else
    38                                          disp(['''' fieldname ''' is not a property of cluster astrid']);
    39                                  end
    40                          end
     27                         disp( '!!! ');
     28                         disp( '!!! WARNING');
     29                         disp(['!!! ''astrid'' is now deprecated. Please use the generic cluster instead']);
     30                         disp(['!!! ''generic'' uses the same properties as ''astrid'' but the option ''name'' is now mandatory:']);
     31                         disp(['!!!    Ex:  md.cluster=generic(''name'',oshostname,''np'',3);']);
     32                         disp( '!!! ');
     33                         error('''astrid'' not supported anymore');
    4134                 end
    4235                 %}}}
    43                  function disp(cluster) % {{{1
    44                          %  display the object
    45                          disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
    46                          disp(sprintf('    name: %s',cluster.name));
    47                          disp(sprintf('    login: %s',cluster.login));
    48                          disp(sprintf('    np: %i',cluster.np));
    49                          disp(sprintf('    port: %i',cluster.port));
    50                          disp(sprintf('    codepath: %s',cluster.codepath));
    51                          disp(sprintf('    executionpath: %s',cluster.executionpath));
    52                          disp(sprintf('    valgrind: %s',cluster.valgrind));
    53                          disp(sprintf('    valgrindlib: %s',cluster.valgrindlib));
    54                          disp(sprintf('    valgrindsup: %s',cluster.valgrindsup));
    55                  end
    56                  %}}}
    57                  function IsConsistent(cluster) % {{{1
    58                          if cluster.np>16,
    59                                  error('IsConsistent error message: number of processors should be less than 16!');
    60                          end
    61                          if isnan(cluster.np),
    62                                  error('IsConsistent error message: number of processors should not be NaN!');
    63                          end
    64                  end
    65                  %}}}
    66                  function BuildQueueScript(cluster,md) % {{{1
    67                  
    68                          %retrieve parameters
    69                          modelname=md.name;
    70                          solution_type=md.solution_type;
    71                          mem_debug=md.mem_debug;
    72 
    73                          %open file for writing:
    74                          fid=fopen([modelname '.queue'],'w');
    75 
    76                          %write instructions for launching a job on the cluster
    77                          fprintf(fid,'#!/bin/sh\n');
    78                          if mem_debug==0,
    79                                  if cluster.interactive
    80                                          fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock ',...
    81                                                  cluster.np,cluster.codepath,EnumToString(solution_type),cluster.executionpath,modelname,modelname,modelname,modelname);
    82                                  else
    83                                          fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog ',...
    84                                                  cluster.np,cluster.codepath,EnumToString(solution_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    85                                  end
    86                          else
    87                                  %fprintf(fid,'LD_PRELOAD=%s mpiexec -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    88                                  fprintf(fid,'LD_PRELOAD=%s mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog ',...
    89                                          cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(solution_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    90                          end
    91 
    92                          if md.gprof,
    93                                  fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
    94                          end
    95 
    96                          if ~md.io_gather,
    97                                  %concatenate the output files:
    98                                  fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
    99                          end
    100 
    101                          %in interactive mode, create a run file, and errlog and outlog file
    102                          if cluster.interactive,
    103                                  fid=fopen([modelname '.errlog'],'w'); fclose(fid);
    104                                  fid=fopen([modelname '.outlog'],'w'); fclose(fid);
    105                          end
    106 
    107                  end
    108                  %}}}
    109                  function LaunchQueueJob(cluster,md,options)% {{{1
    110                          
    111                          %lauch command, to be executed via ssh
    112                          launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.runtimename ' && mkdir ' md.runtimename ...
    113                                         ' && cd ' md.runtimename ' && mv ../' md.runtimename '.tar.gz ./ && tar -zxf ' md.runtimename '.tar.gz  && source  ' md.name '.queue '];
    114 
    115                         if ~strcmpi(options.batch,'yes'),
    116                                
    117                                 %compress the files into one zip.
    118                                 compressstring=['tar -zcf ' md.runtimename '.tar.gz ' md.name '.bin ' md.name '.queue '  md.name '.petsc '];
    119                                 if md.qmu_analysis,
    120                                         compressstring=[compressstring md.name '.qmu.in'];
    121                                 end
    122                                 if cluster.interactive,
    123                                         compressstring=[compressstring ' ' md.name '.errlog ' md.name '.outlog '];
    124                                 end
    125                                 system(compressstring);
    126                                
    127                                 disp('uploading input file and queueing script');
    128                                 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[md.runtimename '.tar.gz']});
    129 
    130                                 disp('launching solution sequence on remote cluster');
    131                                 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
    132                         else
    133                                 disp('batch mode requested: not launching job interactively');
    134                                 disp('launch solution sequence on remote cluster by hand');
    135                         end
    136 
    137                  end %}}}
    138                  function Download(cluster,md)% {{{1
    139 
    140                         %some check
    141                         if isempty(md.runtimename),
    142                                 error('pfe Download error message: supply runtime name for results to be loaded!');
    143                         end
    144 
    145                         %Figure out the  directory where all the files are in:
    146                         directory=[cluster.executionpath '/' md.runtimename '/'];
    147 
    148                         %What packages are we picking up from remote cluster
    149                         packages={[md.name '.outlog'],[md.name '.errlog']};
    150                         if md.qmu_analysis,
    151                                 packages{end+1}=[md.name '.qmu.err'];
    152                                 packages{end+1}=[md.name '.qmu.out'];
    153                                 if isfield(md.qmu_params,'tabular_graphics_data'),
    154                                         if md.qmu_params.tabular_graphics_data==true,
    155                                                 packages{end+1}='dakota_tabular.dat';
    156                                         end
    157                                 end
    158                         else
    159                                 packages{end+1}=[md.name '.outbin'];
    160                         end
    161 
    162                         %copy files from cluster to present directory
    163                         issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
    164                 end %}}}
    16536        end
    16637end
  • issm/trunk/src/m/classes/clusters/generic.m

    r8583 r8586  
    1 %ASTRID class definition
     1%GENERIC cluster class definition
    22%
    33%   Usage:
    4 %      cluster=generic();
    5 %      cluster=generic('np',3);
    6 %      cluster=generic('np',3,'name','astrid','login','username');
     4%      cluster=generic('name','astrid',);
     5%      cluster=generic('name','astrid','np',3);
     6%      cluster=generic('name',oshostname(),'np',3,'login','username');
    77
    88classdef generic
    99    properties (SetAccess=public)
    1010                 % {{{1
    11                  name=oshostname();
     11                 name='';
    1212                 login='';
    13                  np=feature('numcores');
     13                 np=1;
    1414                 port=0;
    1515                 interactive=1;
     
    2323         methods
    2424                 function cluster=generic(varargin) % {{{1
    25                  
     25
     26                         %use provided options to change fields
     27                         options=pairoptions(varargin{:});
     28
     29                         %get name
     30                         if ~exist(options,'name'), error('option ''name'' has not been provided'); end
     31                         cluster.name=getfieldvalue(options,'name');
     32
    2633                         %initialize cluster using user settings if provided
    2734                         if (exist([cluster.name '_settings'])==2), eval([cluster.name '_settings']); end
    2835
    29                          %use provided options to change fields
    30                          options=pairoptions(varargin{:});
     36                         %OK get other fields
    3137                         for i=1:size(options.list,1),
    3238                                 fieldname=options.list{i,1};
     
    5561                 %}}}
    5662                 function IsConsistent(cluster) % {{{1
    57                          if cluster.np>feature('numcores'),
    58                                  error(['number of processors exceeds number of cores seen by matlab ' num2str(feature('numcores'))]);
     63                         if cluster.np<1
     64                                 error(['number of processors should be at least 1']);
    5965                         end
    6066                         if isnan(cluster.np),
Note: See TracChangeset for help on using the changeset viewer.