Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/m/classes/clusters/discovery.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
time = 10; %in hours
memory = 2; %in Gb
email = 'END,FAIL';
deleteckptdata= 0;
preemptable = 0;
end
%}}}
methods
Expand All @@ -43,6 +45,7 @@ function disp(cluster) % {{{
disp(sprintf(' codepath: %s',cluster.codepath));
disp(sprintf(' executionpath: %s',cluster.executionpath));
disp(sprintf(' interactive: %i',cluster.interactive));
disp(sprintf(' preemptable: %i',cluster.preemptable));
end
%}}}
function numprocs=nprocs(cluster) % {{{
Expand Down Expand Up @@ -107,14 +110,21 @@ function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrin
if ~isempty(cluster.email)
fprintf(fid,'#SBATCH --mail-type=%s\n',cluster.email);
end
fprintf(fid,'\n');
if (cluster.preemptable)
fprintf(fid,'#SBATCH --partition preemptable\n');
end
fprintf(fid,'\n');
fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath);
fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');
fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
fprintf(fid,'mpirun -n %i %s/issm.exe %s %s %s\n',cluster.nprocs(), cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
if ~io_gather, %concatenate the output files:
fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
end

if (cluster.deleteckptdata)
fprintf(fid,'rm -rf *.rst *.ckpt\n');
end
fclose(fid);

%in interactive mode, create a run file, and errlog and outlog file
Expand Down