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
RevLine 
[24684]1Index: ../trunk-jpl/src/m/classes/clusters/generic.py
2===================================================================
3--- ../trunk-jpl/src/m/classes/clusters/generic.py (revision 24599)
4+++ ../trunk-jpl/src/m/classes/clusters/generic.py (revision 24600)
5@@ -9,6 +9,10 @@
6 from issmscpin import issmscpin
7 from issmscpout import issmscpout
8 import MatlabFuncs as m
9+try:
10+ from generic_settings import generic_settings
11+except ImportError:
12+ print('Warning generic_settings.py not found, default will be used')
13
14
15 class generic(object):
16@@ -29,7 +33,7 @@
17 self.codepath = IssmConfig('ISSM_PREFIX')[0] + '/bin'
18 self.executionpath = issmdir() + '/execution'
19 self.valgrind = issmdir() + '/externalpackages/valgrind/install/bin/valgrind'
20- self.valgrindlib = '/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1'
21+ self.valgrindlib = issmdir() + '/externalpackages/valgrind/install/lib/libmpidebug.so'
22 self.valgrindsup = [issmdir() + '/externalpackages/valgrind/issm.supp'] # add any .supp in list form as needed
23 self.verbose = 1
24 self.shell = '/bin/sh'
25@@ -41,17 +45,18 @@
26 self.name = socket.gethostname()
27
28 #initialize cluster using user settings if provided
29+
30 try:
31 self = generic_settings(self)
32 except NameError:
33 print("generic_settings.py not found, using default settings")
34- else:
35- raise
36+ # else:
37+ # raise
38
39-
40 #OK get other fields
41 self = options.AssignObjectFields(self)
42 # }}}
43+
44 def __repr__(self): # {{{
45 # display the object
46 s = "class '%s' object '%s' = \n" % (type(self), 'self')
47@@ -68,6 +73,7 @@
48 s += " shell: %s\n" % self.shell
49 return s
50 # }}}
51+
52 def checkconsistency(self, md, solution, analyses): # {{{
53 if self.np < 1:
54 md = checkmessage(md, 'number of processors should be at least 1')
55@@ -76,9 +82,10 @@
56
57 return md
58 # }}}
59+
60 def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling): # {{{
61 # Which executable are we calling?
62- executable = 'issm.exe' # default
63+ executable = 'issm.exe' # default
64
65 if isdakota:
66 version = IssmConfig('_DAKOTA_VERSION_')
67@@ -142,6 +149,7 @@
68 fid = open(modelname + '.outlog', 'w')
69 fid.close()
70 # }}}
71+
72 def BuildKrigingQueueScript(self, modelname, solution, io_gather, isvalgrind, isgprof): # {{{
73 #write queuing script
74 if not m.ispc():
75@@ -179,6 +187,7 @@
76 fid = open(modelname + '.outlog', 'w')
77 fid.close()
78 # }}}
79+
80 def UploadQueueJob(self, modelname, dirname, filelist): # {{{
81 #compress the files into one zip.
82 compressstring = 'tar -zcf {}.tar.gz '.format(dirname)
83@@ -192,6 +201,7 @@
84 issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
85
86 # }}}
87+
88 def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch): # {{{
89 print('launching solution sequence on remote cluster')
90 if restart:
91@@ -203,6 +213,7 @@
92 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)
93 issmssh(self.name, self.login, self.port, launchcommand)
94 # }}}
95+
96 def Download(self, dirname, filelist): # {{{
97 if m.ispc():
98 #do nothing
Note: See TracBrowser for help on using the repository browser.