Changeset 24601


Ignore:
Timestamp:
02/27/20 00:19:59 (5 years ago)
Author:
bdef
Message:

CHG:minor clean up

File:
1 edited

Legend:

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

    r24600 r24601  
    1 import socket
    2 import os
    3 import math
    4 import subprocess
     1from socket import gethostname
     2from subprocess import call
    53from IssmConfig import IssmConfig
    64from issmdir import issmdir
     
    97from issmscpin import issmscpin
    108from issmscpout import issmscpout
    11 import MatlabFuncs as m
     9from MatlabFuncs import ispc
    1210try:
    1311    from generic_settings import generic_settings
     
    4341
    4442        #get name
    45         self.name = socket.gethostname()
     43        self.name = gethostname()
    4644
    4745        #initialize cluster using user settings if provided
     
    7775    def checkconsistency(self, md, solution, analyses):  # {{{
    7876        if self.np < 1:
    79             md = checkmessage(md, 'number of processors should be at least 1')
    80         if math.isnan(self.np):
    81             md = checkmessage(md, 'number of processors should not be NaN!')
     77            md.checkmessage('number of processors should be at least 1')
     78        if np.isnan(self.np):
     79            md.checkmessage('number of processors should not be NaN!')
    8280
    8381        return md
     
    9795
    9896        # Write queueing script
    99         if not m.ispc():
     97        if not ispc():
    10098            fid = open(modelname + '.queue', 'w')
    10199            fid.write('#!/bin/sh\n')
     
    153151    def BuildKrigingQueueScript(self, modelname, solution, io_gather, isvalgrind, isgprof):  # {{{
    154152        #write queuing script
    155         if not m.ispc():
     153        if not ispc():
    156154            fid = open(modelname + '.queue', 'w')
    157155            fid.write('#!/bin/sh\n')
     
    196194        if self.interactive:
    197195            compressstring += ' {}.errlog {}.outlog '.format(modelname, modelname)
    198         subprocess.call(compressstring, shell=True)
     196        call(compressstring, shell=True)
    199197
    200198        print('uploading input file and queueing script')
Note: See TracChangeset for help on using the changeset viewer.