Changeset 26994


Ignore:
Timestamp:
05/06/22 11:51:47 (3 years ago)
Author:
Mathieu Morlighem
Message:

CHG: updating discovery

File:
1 edited

Legend:

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

    r26756 r26994  
    1111                name          = 'discovery'
    1212                login         = '';
    13                 numnodes      = 20;
    14                 cpuspernode   = 8;
    15                 port          = 8000;
     13                numnodes      = 1;
     14                cpuspernode   = 16;
     15                port          = 0;
    1616                codepath      = '';
    1717                executionpath = '';
    1818                interactive   = 0;
    19                 time          = 10; % hours
    20                 memory        = 2;
     19                time          = 10; %in hours
     20                memory        = 2;  %in Gb
     21                email         = 'END,FAIL';
    2122
    2223        end
     
    3940                        disp(sprintf('    numnodes: %i',cluster.numnodes));
    4041                        disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
    41                         disp(sprintf('    np: %i',cluster.nprocs()));
    4242                        disp(sprintf('    port: %i',cluster.port));
    4343                        disp(sprintf('    codepath: %s',cluster.codepath));
     
    4545                        disp(sprintf('    interactive: %i',cluster.interactive));
    4646                        disp(sprintf('    time: %i hours',cluster.time));
    47                         disp(sprintf('    memory: %i',cluster.memory));
     47                        disp(sprintf('    memory: %i Gb',cluster.memory));
    4848                end
    4949                %}}}
     
    5858                        if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
    5959                        if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
    60 
    6160                end
    6261                %}}}
     
    7574                        fprintf(fid,'#SBATCH --ntasks-per-node=%i\n',cluster.cpuspernode);
    7675                        fprintf(fid,'#SBATCH --time=%s\n',datestr(cluster.time/24,'HH:MM:SS')); %walltime is in HH:MM:SS format. cluster.time is in hour
    77                         fprintf(fid,'#SBATCH --mem=%iG\n\n',cluster.memory);
     76                        fprintf(fid,'#SBATCH --mem=%iG\n',cluster.memory);
     77                        if ~isempty(cluster.email)
     78                                fprintf(fid,'#SBATCH --mail-type=%s\n',cluster.email);
     79                        end
     80                        fprintf(fid,'\n');
     81
    7882                        fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath);
    7983                        fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');     
     
    8791                %}}}
    8892                function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
    89 
    90                         if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
    91                         if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
    92 
    93                         %write queuing script
    94                         fid=fopen([modelname '.queue'],'w');
    95                         fprintf(fid,'#!/bin/bash\n');
    96                         fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
    97                         fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
    98                         fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
    99                         fprintf(fid,'#SBATCH --nodes=%i\n',cluster.numnodes);
    100                         fprintf(fid,'#SBATCH --ntasks-per-node=%i\n',cluster.cpuspernode);
    101                         fprintf(fid,'#SBATCH --time=%s\n',datestr(cluster.time/24,'HH:MM:SS')); %walltime is in HH:MM:SS format. cluster.time is in hour
    102                         fprintf(fid,'#SBATCH --mem=%iG\n\n',cluster.memory);
    103                         fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath);
    104                         fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       
    105                         fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
    106                         fprintf(fid,'mpirun -n %i %s/issm.exe %s %s %s\n',cluster.nprocs(), cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
    107                         if ~io_gather, %concatenate the output files:
    108                                 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
    109                         end
    110                         fclose(fid);
    111 
    112                         %in interactive mode, create a run file, and errlog and outlog file
    113                         if cluster.interactive,
    114                                 fid=fopen([modelname '.run'],'w');
    115                                 fprintf(fid,'mpirun -n %i %s/issm.exe %s %s %s\n',cluster.nprocs(), cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
    116                                 if ~io_gather, %concatenate the output files:
    117                                         fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
    118                                 end
    119                                 fclose(fid);
    120                                 fid=fopen([modelname '.errlog'],'w');
    121                                 fclose(fid);
    122                                 fid=fopen([modelname '.outlog'],'w');
    123                                 fclose(fid);
    124                         end
     93                        error('not implemented yet');
    12594                end %}}}
    12695                function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
Note: See TracChangeset for help on using the changeset viewer.