Changeset 20269
- Timestamp:
- 02/27/16 19:17:57 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/solve/solve.js
r19831 r20269 63 63 //If we are restarting, actually use the provided runtime name: 64 64 restart=options.getfieldvalue('restart',''); 65 65 66 //First, build a runtime name that is unique 66 67 if (restart==1 ){ … … 87 88 } 88 89 89 //flaim analysis (To be removed?)90 if (solutionenum == FlaimSolutionEnum()){91 //fmdir = options.getfieldvalue('fmdir',['fm' num2str(feature('GetPid'))]);92 //overwrite = options.getfieldvalue('overwrite','n');93 //keep = options.getfieldvalue('keep','y');94 //latsgn = options.getfieldvalue('latsgn',0);95 //cmap = options.getfieldvalue('cmap',[]);96 throw Error("solve error message: flaim runs not supported yet!");97 //flaim_sol(md,options);98 //md.priv.solution=EnumToString(solutionenum);99 //return;100 }101 90 102 91 //Do we load results only? … … 106 95 } 107 96 108 //Write all input files 109 fid = marshall(md); // bin file 97 //Marshall into a binary array (fid) all the fields of model. 98 var fid = marshall(md); // bin file 99 100 //deal with toolkits options: 110 101 toolkitsstring= md.toolkits.ToolkitsFile(md.miscellaneous.name + '.toolkits'); // toolkits file 111 102 112 if (cluster.classname() != 'local'){ //{{{113 103 114 throw Error('non local clusters not supported yet!'); 115 116 cluster.BuildQueueScript(md.priv.runtimename,md.miscellaneous.name,md.priv.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof,md.qmu.isdakota); // queue file 117 118 //Stop here if batch mode 119 if (options.getfieldvalue('batch','no') === 'yes'){ 120 if (md.verbose.solution){ 121 console.log('batch mode requested: not launching job interactively'); 122 console.log('launch solution sequence on remote cluster by hand'); 123 } 124 return; 125 } 126 127 //Upload all required files 128 modelname = md.miscellaneous.name; 129 filelist = [modelname + '.bin ',modelname + '.toolkits ']; 130 if (ispc){ 131 filelist.push(modelname + '.bat '); 132 } 133 else{ 134 filelist.push(modelname + '.queue '); 135 } 136 137 if (md.qmu.isdakota){ 138 filelist.push(modelname + '.qmu.in'); 139 } 140 141 if (restart == ''){ 142 cluster.UploadQueueJob(md.miscellaneous.name,md.priv.runtimename,filelist); 143 } 144 145 //launch queue job: 146 cluster.LaunchQueueJob(md.miscellaneous.name,md.priv.runtimename,filelist,restart); 147 148 //wait on lock 149 if (md.settings.waitonlock == 'NaN'){ 150 //load when user enters 'y' 151 console.log('solution launched on remote cluster. log in to detect job completion.'); 152 throw Error("solve error message: user detection of successfull completion of job not support yet!"); 153 /*choice=input('Is the job successfully completed? (y/n)','s'); 154 if ~strcmp(choice,'y'), 155 console.log('Results not loaded... exiting'); 156 else 157 md=loadresultsfromcluster(md); 158 end*/ 159 } 160 else if (md.settings.waitonlock>0){ 161 //we wait for the done file 162 done=waitonlock(md); 163 if (md.verbose.solution){ 164 console.log('loading results from cluster'); 165 } 166 loadresultsfromcluster(md); 167 } 168 else if (md.settings.waitonlock==0){ 169 console.log('Model results must be loaded manually with md=loadresultsfromcluster(md);'); 170 } 171 172 //post processes qmu results if necessary 173 if (md.qmu.isdakota){ 174 /*if ~strncmpi(options.getfieldvalue('keep','y'),'y',1) 175 system(['rm -rf qmu' num2str(feature('GetPid'))]); 176 end*/ 177 } 178 } //}}} 179 else{ //if (cluster.classname() == 'local') 104 if (cluster.classname() == 'local'){ //{{{ 180 105 181 106 /*We are running locally on the machine, using the issm module:*/ … … 189 114 190 115 //Load results: 191 var results = loadresultsfrombuffer(md,outputbuffer,outputbuffersize); //loadresults: [array,solution_type] 116 md.results = loadresultsfrombuffer(md,outputbuffer,outputbuffersize); 117 118 return md; 192 119 193 return results; 120 } //}}} 121 else { //{{{ 194 122 195 } 123 /*We are running somewhere else on a computational server. Send the buffer to that server and retrieve output: */ 124 cluster.UploadAndRun(fid,toolkitsstring,solutionstring,md.miscellaneous.name); 125 126 return md; 127 128 } //}}} 196 129 }
Note:
See TracChangeset
for help on using the changeset viewer.