source: issm/oecreview/Archive/24307-24683/ISSM-24599-24600.diff@ 24684

Last change on this file since 24684 was 24684, checked in by Mathieu Morlighem, 5 years ago

CHG: added new review

File size: 3.6 KB
  • ../trunk-jpl/src/m/classes/clusters/generic.py

     
    99from issmscpin import issmscpin
    1010from issmscpout import issmscpout
    1111import MatlabFuncs as m
     12try:
     13    from generic_settings import generic_settings
     14except ImportError:
     15    print('Warning generic_settings.py not found, default will be used')
    1216
    1317
    1418class generic(object):
     
    2933        self.codepath = IssmConfig('ISSM_PREFIX')[0] + '/bin'
    3034        self.executionpath = issmdir() + '/execution'
    3135        self.valgrind = issmdir() + '/externalpackages/valgrind/install/bin/valgrind'
    32         self.valgrindlib = '/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1'
     36        self.valgrindlib = issmdir() + '/externalpackages/valgrind/install/lib/libmpidebug.so'
    3337        self.valgrindsup = [issmdir() + '/externalpackages/valgrind/issm.supp']  # add any .supp in list form as needed
    3438        self.verbose = 1
    3539        self.shell = '/bin/sh'
     
    4145        self.name = socket.gethostname()
    4246
    4347        #initialize cluster using user settings if provided
     48
    4449        try:
    4550            self = generic_settings(self)
    4651        except NameError:
    4752            print("generic_settings.py not found, using default settings")
    48         else:
    49             raise
     53        # else:
     54        #     raise
    5055
    51 
    5256        #OK get other fields
    5357        self = options.AssignObjectFields(self)
    5458    # }}}
     59
    5560    def __repr__(self):  # {{{
    5661        #  display the object
    5762        s = "class '%s' object '%s' = \n" % (type(self), 'self')
     
    6873        s += "    shell: %s\n" % self.shell
    6974        return s
    7075    # }}}
     76
    7177    def checkconsistency(self, md, solution, analyses):  # {{{
    7278        if self.np < 1:
    7379            md = checkmessage(md, 'number of processors should be at least 1')
     
    7682
    7783        return md
    7884    # }}}
     85
    7986    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
    8087        # Which executable are we calling?
    81         executable = 'issm.exe' # default
     88        executable = 'issm.exe'  # default
    8289
    8390        if isdakota:
    8491            version = IssmConfig('_DAKOTA_VERSION_')
     
    142149            fid = open(modelname + '.outlog', 'w')
    143150            fid.close()
    144151    # }}}
     152
    145153    def BuildKrigingQueueScript(self, modelname, solution, io_gather, isvalgrind, isgprof):  # {{{
    146154        #write queuing script
    147155        if not m.ispc():
     
    179187            fid = open(modelname + '.outlog', 'w')
    180188            fid.close()
    181189    # }}}
     190
    182191    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
    183192        #compress the files into one zip.
    184193        compressstring = 'tar -zcf {}.tar.gz '.format(dirname)
     
    192201        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
    193202
    194203    # }}}
     204
    195205    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
    196206        print('launching solution sequence on remote cluster')
    197207        if restart:
     
    203213                launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./&& tar -zxf {}.tar.gz  && chmod 755 {}.queue && ./{}.queue'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname, modelname)
    204214        issmssh(self.name, self.login, self.port, launchcommand)
    205215    # }}}
     216
    206217    def Download(self, dirname, filelist):  # {{{
    207218        if m.ispc():
    208219            #do nothing
Note: See TracBrowser for help on using the repository browser.