Changeset 19674


Ignore:
Timestamp:
10/21/15 17:33:16 (9 years ago)
Author:
schlegel
Message:

CHG: update python cluster classes to deal with issm_dakota

Location:
issm/trunk-jpl/src/m/classes/clusters
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/clusters/generic.py

    r19638 r19674  
    7171        def BuildQueueScript(self,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota):    # {{{
    7272
     73                executable='issm.exe';
     74                if isdakota:
     75                        version=IssmConfig('_DAKOTA_VERSION_')[0:2]
     76                        version=float(version)
     77                        if version>=6:
     78                                executable='issm_dakota.exe'
     79
    7380                #write queuing script
    7481                if not m.ispc():
     
    7986                                if self.interactive:
    8087                                        if IssmConfig('_HAVE_MPI_')[0]:
    81                                                 fid.write('mpiexec -np %i %s/issm.exe %s %s/%s %s ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname))
     88                                                fid.write('mpiexec -np %i %s/%s %s %s/%s %s ' % (self.np,self.codepath,executable,EnumToString(solution)[0],self.executionpath,dirname,modelname))
    8289                                        else:
    83                                                 fid.write('%s/issm.exe %s %s/%s %s ' % (self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname))
     90                                                fid.write('%s/%s %s %s/%s %s ' % (self.codepath,executable,EnumToString(solution)[0],self.executionpath,dirname,modelname))
    8491                                else:
    8592                                        if IssmConfig('_HAVE_MPI_')[0]:
    86                                                 fid.write('mpiexec -np %i %s/issm.exe %s %s/%s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
     93                                                fid.write('mpiexec -np %i %s/%s %s %s/%s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,executable,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
    8794                                        else:
    88                                                 fid.write('%s/issm.exe %s %s/%s %s 2> %s.errlog >%s.outlog ' % (self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
     95                                                fid.write('%s/%s %s %s/%s %s 2> %s.errlog >%s.outlog ' % (self.codepath,executable,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
    8996                        elif isgprof:
    90                                 fid.write('\n gprof %s/issm.exe gmon.out > %s.performance' % (self.codepath,modelname))
     97                                fid.write('\n gprof %s/%s gmon.out > %s.performance' % (self.codepath,executable,modelname))
    9198                        else:
    9299                                #Add --gen-suppressions=all to get suppression lines
    93100                                fid.write('LD_PRELOAD=%s \\\n' % self.valgrindlib)
    94101                                if IssmConfig('_HAVE_MPI_')[0]:
    95                                         fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s/%s %s 2> %s.errlog >%s.outlog ' % \
    96                                                         (self.np,self.valgrind,self.valgrindsup,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
     102                                        fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/%s %s %s/%s %s 2> %s.errlog >%s.outlog ' % \
     103                                                        (self.np,self.valgrind,self.valgrindsup,self.codepath,executable,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
    97104                                else:   
    98                                         fid.write('%s --leak-check=full --suppressions=%s %s/issm.exe %s %s/%s %s 2> %s.errlog >%s.outlog ' % \
    99                                                         (self.valgrind,self.valgrindsup,self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
     105                                        fid.write('%s --leak-check=full --suppressions=%s %s/%s %s %s/%s %s 2> %s.errlog >%s.outlog ' % \
     106                                                        (self.valgrind,self.valgrindsup,self.codepath,executable,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
    100107
    101108                        if not io_gather:    #concatenate the output files:
     
    108115                        fid.write('@echo off\n')
    109116                        if self.interactive:
    110                                 fid.write('"%s/issm.exe" %s "%s/%s" %s ' % (self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname))
    111                         else:
    112                                 fid.write('"%s/issm.exe" %s "%s/%s" %s 2> %s.errlog >%s.outlog' % \
    113                                         (self.codepath,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
     117                                fid.write('"%s/%s" %s "%s/%s" %s ' % (self.codepath,executable,EnumToString(solution)[0],self.executionpath,dirname,modelname))
     118                        else:
     119                                fid.write('"%s/%s" %s "%s/%s" %s 2> %s.errlog >%s.outlog' % \
     120                                        (self.codepath,executable,EnumToString(solution)[0],self.executionpath,dirname,modelname,modelname,modelname))
    114121                        fid.close()
    115122
  • issm/trunk-jpl/src/m/classes/clusters/pfe.py

    r19638 r19674  
    4949                #initialize cluster using user settings if provided
    5050                self=pfe_settings(self)
    51                 self.np=20*8
     51                self.np=self.nprocs()
    5252                #OK get other fields
    5353                self=options.AssignObjectFields(self)
     
    7878        # }}}
    7979
     80        def nprocs(self):
     81                # {{{
     82                self.np=self.numnodes*self.cpuspernode
     83                return self.np
     84                # }}}
    8085        def checkconsistency(self,md,solution,analyses):
    8186                # {{{
     
    8691                                                                 'debug':[2*60,150],
    8792                                                                 'devel':[2*60,150]}
    88                 QueueRequirements(queuedict,self.queue,self.np,self.time)
     93                QueueRequirements(queuedict,self.queue,self.nprocs(),self.time)
    8994
    9095                #now, check cluster.cpuspernode according to processor type
     
    132137                # {{{
    133138
    134                 self.np=self.numnodes*self.cpuspernode;
     139                executable='issm.exe'
     140                if isdakota:
     141                        version=IssmConfig('_DAKOTA_VERSION_')[0:2]
     142                        version=float(version)
     143                        if version>=6:
     144                                executable='issm_dakota.exe'
     145
    135146                #write queuing script
    136147                fid=open(modelname+'.queue','w')
     
    151162                fid.write('source $ISSM_DIR/etc/environment.sh\n')
    152163                fid.write('cd %s/%s/\n\n' % (self.executionpath,dirname))
    153                 fid.write('mpiexec -np %i %s/issm.exe %s %s/%s %s\n' % (self.np,self.codepath,str(EnumToString(solution)[0]),self.executionpath,dirname,modelname))
     164                fid.write('mpiexec -np %i %s/%s %s %s/%s %s\n' % (self.nprocs(),self.codepath,executable,str(EnumToString(solution)[0]),self.executionpath,dirname,modelname))
    154165               
    155166                fid.close()
Note: See TracChangeset for help on using the changeset viewer.