0001 function BuildQueueingScriptgemini(md,solutiontype,executionpath,codepath)
0002
0003
0004
0005
0006
0007 scriptname=[md.name '.queue'];
0008
0009 fid=fopen(scriptname,'w');
0010 if fid==-1,
0011 error(['BuildQueueingScriptgeminierror message: could not open ' scriptname ' file for ascii writing']);
0012 end
0013
0014 fprintf(fid,'#!/bin/sh\n');
0015 fprintf(fid,'#BSUB -n %i -W %i\n',md.np,md.time);
0016 fprintf(fid,'#BSUB -J %s\n',md.name);
0017 if ~isempty(md.queue),
0018 fprintf(fid,'#BSUB -q %s\n',md.queue);
0019 end
0020 fprintf(fid,'#BSUB -o %s.outlog -e %s.errlog\n',md.name,md.name);
0021 fprintf(fid,'cd %s\n',executionpath);
0022 fprintf(fid,'rm -rf %s.outlog %s.errlog %s.lock\n',md.name,md.name,md.name);
0023
0024 if strcmpi(solutiontype,'diagnostic_horiz') | strcmpi(solutiontype,'diagnostic'),
0025 fprintf(fid,'mpirun -np %i %s/cielodiagnostic.exe %s %s.bin %s.outbin %s.lock',md.np,codepath,executionpath,md.name,md.name,md.name);
0026 elseif strcmpi(solutiontype,'control') ,
0027 fprintf(fid,'mpirun -np %i %s/cielocontrol.exe %s %s.bin %s.outbin %s.lock',md.np,codepath,executionpath,md.name,md.name,md.name);
0028 elseif strcmpi(solutiontype,'thermalsteady') ,
0029 fprintf(fid,'mpirun -np %i %s/cielothermalsteady.exe %s %s.bin %s.outbin %s.lock',md.np,codepath,executionpath,md.name,md.name,md.name);
0030 else
0031 error('BuildQueueingScriptgemini error message: unsupported solution type!');
0032 end
0033 fclose(fid);