Ignore:
Timestamp:
11/23/15 19:23:20 (9 years ago)
Author:
Eric.Larour
Message:

CHG: finished first prototype of running stressbalance in javascript. Need to now process the output buffers
through loadresultsfromcluster.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/m/solve/solve.js ΒΆ

    r19780 r19793  
    107107
    108108        //Write all input files
    109         marshall(md);                                          // bin file
    110         ToolkitsFile(md.toolkits,md.miscellaneous.name + '.toolkits'); // toolkits file
    111         cluster.BuildQueueScript(md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof,md.qmu.isdakota); // queue file
     109        fid = marshall(md);                                          // bin file
     110        toolkitsstring= md.toolkits.ToolkitsFile(md.miscellaneous.name + '.toolkits'); // toolkits file
    112111
    113         //Stop here if batch mode
    114         if (options.getfieldvalue('batch','no') === 'yes'){
    115                 if (md.verbose.solution){
    116                         console.log('batch mode requested: not launching job interactively');
    117                         console.log('launch solution sequence on remote cluster by hand');
     112        if (cluster.classname() != 'local'){ //{{{
     113
     114                throw Error('non local clusters not supported yet!');
     115
     116                cluster.BuildQueueScript(md.private.runtimename,md.miscellaneous.name,md.private.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;
    118125                }
    119                 return;
    120         }
    121126
    122         //Upload all required files
    123         modelname = md.miscellaneous.name;
    124         filelist  = [modelname + '.bin ',modelname + '.toolkits '];
    125         if (ispc){
    126                 filelist.push(modelname + '.bat ');
    127         }
    128         else{
    129                 filelist.push(modelname + '.queue ');
    130         }
     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                }
    131136
    132         if (md.qmu.isdakota){
    133                 filelist.push(modelname + '.qmu.in');
    134         }
     137                if (md.qmu.isdakota){
     138                        filelist.push(modelname + '.qmu.in');
     139                }
    135140
    136         if (restart == ''){
    137                 cluster.UploadQueueJob(md.miscellaneous.name,md.private.runtimename,filelist);
    138         }
     141                if (restart == ''){
     142                        cluster.UploadQueueJob(md.miscellaneous.name,md.private.runtimename,filelist);
     143                }
    139144
    140         //launch queue job:
    141         cluster.LaunchQueueJob(md.miscellaneous.name,md.private.runtimename,filelist,restart);
     145                //launch queue job:
     146                cluster.LaunchQueueJob(md.miscellaneous.name,md.private.runtimename,filelist,restart);
    142147
    143         //wait on lock
    144         if (md.settings.waitonlock == 'NaN'){
    145                 //load when user enters 'y'
    146                 console.log('solution launched on remote cluster. log in to detect job completion.');
    147                 throw Error("solve error message: user detection of successfull completion of job not support yet!");
    148                 /*choice=input('Is the job successfully completed? (y/n)','s');
    149                 if ~strcmp(choice,'y'),
    150                         console.log('Results not loaded... exiting');
    151                 else
    152                         md=loadresultsfromcluster(md);
    153                 end*/
    154         }
    155         else if (md.settings.waitonlock>0){
    156                 //we wait for the done file
    157                 done=waitonlock(md);
    158                 if (md.verbose.solution){
    159                         console.log('loading results from cluster');
     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*/
    160159                }
    161                 loadresultsfromcluster(md);
    162         }
    163         else if (md.settings.waitonlock==0){
    164                  console.log('Model results must be loaded manually with md=loadresultsfromcluster(md);');
    165         }
     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                }
    166171
    167         //post processes qmu results if necessary
    168         if (md.qmu.isdakota){
    169                 /*if ~strncmpi(options.getfieldvalue('keep','y'),'y',1)
    170                         system(['rm -rf qmu' num2str(feature('GetPid'))]);
    171                 end*/
     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')
     180
     181                /*We are running locally on the machine, using the issm module:*/
     182                console.log('running issm locally');
     183               
     184                //Call issm:
     185                issm(fid, toolkitsstring, solutionstring, md.miscellaneous.name);
    172186        }
    173187}
Note: See TracChangeset for help on using the changeset viewer.