Changeset 20320


Ignore:
Timestamp:
03/16/16 19:09:34 (9 years ago)
Author:
schlegel
Message:

CHG: update discover class for SLURM

File:
1 edited

Legend:

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

    r19673 r20320  
    1111                 name=oshostname();
    1212                 login='';
     13                 modules        = {};
    1314                 numnodes=20;
    1415                 cpuspernode=8;
    1516                 port=0;
    1617                 queue='general';
    17                  time=12*60;
     18                 time=12*60*60;
    1819                 processor='west';
    1920                 codepath='';
     
    2324                 numstreams=8;
    2425                 hyperthreading=0;
     26                 email='';
    2527         end
    2628         %}}}
     
    4042                         disp(sprintf('    name: %s',cluster.name));
    4143                         disp(sprintf('    login: %s',cluster.login));
     44                         disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
    4245                         disp(sprintf('    port: %i',cluster.port));
    4346                         disp(sprintf('    numnodes: %i',cluster.numnodes));
     
    5154                         disp(sprintf('    interactive: %i',cluster.interactive));
    5255                         disp(sprintf('    hyperthreading: %i',cluster.hyperthreading));
     56                         disp(sprintf('    email: %s',cluster.email));
    5357                 end
    5458                 %}}}
     
    6064                 function md = checkconsistency(cluster,md,solution,analyses) % {{{
    6165
    62                          available_queues={'general_long','general','debug'};
    63                          queue_requirements_time=[24*60 12*60 60];
    64                          queue_requirements_np=[516 1024 32];
     66                         available_queues={'long','general','debug'};
     67                         queue_requirements_time=[24*60*60 12*60*60 60];
     68                         queue_requirements_np=[4116 532 532];
    6569
    6670                         QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
     
    7175                                         md = checkmessage(md,'cpuspernode should be between 1 and 16 for ''sand'' processors');
    7276                                 end
    73                          elseif strcmpi(cluster.processor,'west'),
    74                                  if ((cluster.cpuspernode>12 ) | (cluster.cpuspernode<1)),
    75                                          md = checkmessage(md,'cpuspernode should be between 1 and 12 for ''west'' processors');
    76                                  end
    77                          else
    78                                  md = checkmessage(md,'unknown processor type, should be ''sand'' or ''west'' ');
     77                         elseif strcmpi(cluster.processor,'hasw'),
     78                                 if ((cluster.cpuspernode>28 ) | (cluster.cpuspernode<1)),
     79                                         md = checkmessage(md,'cpuspernode should be between 1 and 28 for ''hasw'' processors');
     80                                 end
     81                         else
     82                                 md = checkmessage(md,'unknown processor type, should be ''sand'' or ''hasw'' ');
    7983                         end
    8084
     
    9094                         if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
    9195
    92                          %write queuing script 
     96                         %write queuing script
    9397                         fid=fopen([modelname '.queue'],'w');
     98
    9499                         fprintf(fid,'#!/bin/bash\n');
    95 %                        fprintf(fid,'#PBS -N %s\n',modelname);
    96                          fprintf(fid,'#PBS -l select=%i:mpiprocs=%i:proc=%s\n',cluster.numnodes,cluster.cpuspernode,cluster.processor);
    97                          fprintf(fid,'#PBS -l walltime=%i:00\n',cluster.time); %SLURM walltime is in minutes:
    98                          if ~strcmp(cluster.queue,'general'),
    99                                  fprintf(fid,'#PBS -q %s \n',cluster.queue);
    100                          end
    101                          fprintf(fid,'#PBS -W group_list=s1010\n');
    102                          fprintf(fid,'#PBS -m e\n');
    103                          fprintf(fid,'#PBS -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
    104                          fprintf(fid,'#PBS -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
     100                         fprintf(fid,'#SBATCH -J %s \n',modelname);
     101                         fprintf(fid,'#SBATCH --qos=%s \n',cluster.queue);
     102                         fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
     103                         fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
     104                         fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*cluster.cpuspernode);
     105                         fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
     106                         fprintf(fid,'#SBATCH -t %02i:%02i:00 \n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
     107                         fprintf(fid,'#SBATCH -A s1010 \n\n');
     108                         for i=1:numel(cluster.modules),
     109                                 fprintf(fid,['module load ' cluster.modules{i} '\n']);
     110                         end
     111                         if length(find(cluster.email=='@'))>0
     112                                 fprintf(fid,'#SBATCH --mail-user=%s \n',cluster.email);
     113                                 fprintf(fid,'#SBATCH --mail-type=end \n\n');
     114                         end
    105115                         fprintf(fid,'. /usr/share/modules/init/bash\n\n');
    106                          fprintf(fid,'module purge\n');
    107                          fprintf(fid,'module load comp/intel-11.1.038\n');
     116                         fprintf(fid,'module load comp/intel-15.0.0.090\n');
    108117                         fprintf(fid,'module load mpi/impi-4.0.3.008\n');
    109                          fprintf(fid,'module load lib/mkl-10.1.2.024\n\n');
    110118                         fprintf(fid,'export PATH="$PATH:."\n\n');
    111                          fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
    112                          fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
     119                         fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
     120                         fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
     121                         fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
     122
    113123                         fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
    114124                         if ~io_gather, %concatenate the output files:
     
    162172                 end
    163173                 %}}}
    164                  function LaunchQueueJob(cluster,modelname,dirname,filelist,restart)% {{{
     174                 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
    165175
    166176                         if ~cluster.interactive,
Note: See TracChangeset for help on using the changeset viewer.