Changeset 26994
- Timestamp:
- 05/06/22 11:51:47 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/clusters/discovery.m
r26756 r26994 11 11 name = 'discovery' 12 12 login = ''; 13 numnodes = 20;14 cpuspernode = 8;15 port = 8000;13 numnodes = 1; 14 cpuspernode = 16; 15 port = 0; 16 16 codepath = ''; 17 17 executionpath = ''; 18 18 interactive = 0; 19 time = 10; % hours 20 memory = 2; 19 time = 10; %in hours 20 memory = 2; %in Gb 21 email = 'END,FAIL'; 21 22 22 23 end … … 39 40 disp(sprintf(' numnodes: %i',cluster.numnodes)); 40 41 disp(sprintf(' cpuspernode: %i',cluster.cpuspernode)); 41 disp(sprintf(' np: %i',cluster.nprocs()));42 42 disp(sprintf(' port: %i',cluster.port)); 43 43 disp(sprintf(' codepath: %s',cluster.codepath)); … … 45 45 disp(sprintf(' interactive: %i',cluster.interactive)); 46 46 disp(sprintf(' time: %i hours',cluster.time)); 47 disp(sprintf(' memory: %i ',cluster.memory));47 disp(sprintf(' memory: %i Gb',cluster.memory)); 48 48 end 49 49 %}}} … … 58 58 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end 59 59 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end 60 61 60 end 62 61 %}}} … … 75 74 fprintf(fid,'#SBATCH --ntasks-per-node=%i\n',cluster.cpuspernode); 76 75 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 78 82 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); 79 83 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n'); … … 87 91 %}}} 88 92 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'); 125 94 end %}}} 126 95 function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
Note:
See TracChangeset
for help on using the changeset viewer.