Changeset 24601
- Timestamp:
- 02/27/20 00:19:59 (5 years ago)
- 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 1 from socket import gethostname 2 from subprocess import call 5 3 from IssmConfig import IssmConfig 6 4 from issmdir import issmdir … … 9 7 from issmscpin import issmscpin 10 8 from issmscpout import issmscpout 11 import MatlabFuncs as m 9 from MatlabFuncs import ispc 12 10 try: 13 11 from generic_settings import generic_settings … … 43 41 44 42 #get name 45 self.name = socket.gethostname()43 self.name = gethostname() 46 44 47 45 #initialize cluster using user settings if provided … … 77 75 def checkconsistency(self, md, solution, analyses): # {{{ 78 76 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!') 82 80 83 81 return md … … 97 95 98 96 # Write queueing script 99 if not m.ispc():97 if not ispc(): 100 98 fid = open(modelname + '.queue', 'w') 101 99 fid.write('#!/bin/sh\n') … … 153 151 def BuildKrigingQueueScript(self, modelname, solution, io_gather, isvalgrind, isgprof): # {{{ 154 152 #write queuing script 155 if not m.ispc():153 if not ispc(): 156 154 fid = open(modelname + '.queue', 'w') 157 155 fid.write('#!/bin/sh\n') … … 196 194 if self.interactive: 197 195 compressstring += ' {}.errlog {}.outlog '.format(modelname, modelname) 198 subprocess.call(compressstring, shell=True)196 call(compressstring, shell=True) 199 197 200 198 print('uploading input file and queueing script')
Note:
See TracChangeset
for help on using the changeset viewer.