Changeset 26353
- Timestamp:
- 07/18/21 16:19:07 (4 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/clusters/generic.py
r26342 r26353 6 6 from generic_settings import generic_settings 7 7 except ImportError: 8 print('Warning generic_settings.py not found, default will be used') 8 #print('Warning: generic.py: generic_settings.py not found, default will be used') 9 pass 9 10 from MatlabFuncs import * 10 11 from IssmConfig import IssmConfig … … 48 49 self = generic_settings(self) 49 50 except NameError: 50 print('generic_settings.py not found, using default settings') 51 # print('generic_settings.py not found, using default settings') 52 pass 51 53 52 54 # OK get other fields -
issm/trunk-jpl/src/m/classes/clusters/pfe.py
r26344 r26353 12 12 from pfe_settings import pfe_settings 13 13 except ImportError: 14 print('You need pfe_settings.py to proceed, check presence and sys.path') 14 # print('You need pfe_settings.py to proceed, check presence and sys.path') 15 pass 15 16 from QueueRequirements import QueueRequirements 16 17 … … 25 26 26 27 def __init__(self, *args): # {{{ 27 self.name = ' pfe'28 self.name = '' 28 29 self.login = '' 29 30 self.modules = ['comp-intel/2016.2.181', 'mpi-sgi/mpt'] … … 50 51 self = pfe_settings(self) 51 52 except NameError: 52 print('pfe_settings.py not found, using default settings') 53 #print('pfe_settings.py not found, using default settings') 54 pass 53 55 54 56 # OK get other fields -
issm/trunk-jpl/src/m/classes/issmsettings.py
r25685 r26353 21 21 self.solver_residue_threshold = 0 22 22 23 #set defaults23 # Set defaults 24 24 self.setdefaultparameters() 25 26 25 #}}} 27 26 28 27 def __repr__(self): # {{{ 29 string = " general issmsettings parameters:" 30 31 string = "%s\n%s" % (string, fielddisplay(self, "results_on_nodes", "list of output for which results will be output for all the nodes of each element, Use 'all' for all output on nodes.")) 32 string = "%s\n%s" % (string, fielddisplay(self, "io_gather", "I / O gathering strategy for result outputs (default 1)")) 33 string = "%s\n%s" % (string, fielddisplay(self, "lowmem", "is the memory limited ? (0 or 1)")) 34 string = "%s\n%s" % (string, fielddisplay(self, "output_frequency", "frequency at which results are saved in all solutions with multiple time_steps")) 35 string = "%s\n%s" % (string, fielddisplay(self, "sb_coupling_frequency", "frequency at which StressBalance solver is coupled (default 1)")) 36 string = "%s\n%s" % (string, fielddisplay(self, "checkpoint_frequency", "frequency at which the runs are being recorded, allowing for a restart")) 37 string = "%s\n%s" % (string, fielddisplay(self, "waitonlock", "maximum number of minutes to wait for batch results, or return 0")) 38 string = "%s\n%s" % (string, fielddisplay(self, "solver_residue_threshold", "throw an error if solver residue exceeds this value (NaN to deactivate)")) 39 return string 28 s = " general issmsettings parameters:\n" 29 s += '{}\n'.format(fielddisplay(self, "results_on_nodes", "list of output for which results will be output for all the nodes of each element, Use 'all' for all output on nodes.")) 30 s += '{}\n'.format(fielddisplay(self, "io_gather", "I / O gathering strategy for result outputs (default 1)")) 31 s += '{}\n'.format(fielddisplay(self, "lowmem", "is the memory limited ? (0 or 1)")) 32 s += '{}\n'.format(fielddisplay(self, "output_frequency", "frequency at which results are saved in all solutions with multiple time_steps")) 33 s += '{}\n'.format(fielddisplay(self, "sb_coupling_frequency", "frequency at which StressBalance solver is coupled (default 1)")) 34 s += '{}\n'.format(fielddisplay(self, "checkpoint_frequency", "frequency at which the runs are being recorded, allowing for a restart")) 35 s += '{}\n'.format(fielddisplay(self, "waitonlock", "maximum number of minutes to wait for batch results, or return 0")) 36 s += '{}\n'.format(fielddisplay(self, "solver_residue_threshold", "throw an error if solver residue exceeds this value (NaN to deactivate)")) 37 return s 40 38 #}}} 41 39 -
issm/trunk-jpl/src/m/classes/model.py
r26301 r26353 37 37 from toolkits import toolkits 38 38 from generic import generic 39 from pfe import pfe40 from cyclone import cyclone41 from saga import saga42 39 from balancethickness import balancethickness 43 40 from stressbalance import stressbalance -
issm/trunk-jpl/src/m/classes/solidearthsettings.py
r26317 r26353 118 118 # A GRD computation has been requested, make some checks on the nature of the meshes provided 119 119 if self.isgrd: 120 if md.mesh.__class__.__name__ is'mesh3dsurface':120 if md.mesh.__class__.__name__ == 'mesh3dsurface': 121 121 if self.grdmodel == 2: 122 122 raise RuntimeException('model requires a 2D mesh to run gia Ivins computations (change mesh from mesh3dsurface to mesh2d)') -
issm/trunk-jpl/src/m/coordsystems/gdaltransform.m
r25455 r26353 20 20 % +proj=stere +lat_0=90 +lat_ts=71 +lon_0=-39 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.448564109 +units=m +no_defs 21 21 % 22 % To get proj.4 string from EPSG, use gdalsrsinfo. Example:22 % To get PROJ.4 string from EPSG, use gdalsrsinfo. Example: 23 23 % gdalsrsinfo epsg:4326 | grep "PROJ.4" | sed "s/PROJ.4 : //" 24 24 -
issm/trunk-jpl/src/m/dev/devpath.py
r26352 r26353 15 15 dirs.remove('.svn') 16 16 for file in files: 17 if file.find( ".py") != -1:18 if file.find( ".pyc") == -1:17 if file.find('.py') != -1: 18 if file.find('.pyc') == -1: 19 19 if root not in sys.path: 20 20 sys.path.append(root) … … 46 46 #c.InteractiveShellApp.exec_lines.append('print "Warning: disable autoreload in startup.py to improve performance." ') 47 47 48 print("\n ISSM development path correctly loaded")49 print("Current path is {}\n\n".format(ISSM_DIR))48 # print("\n ISSM development path correctly loaded") 49 # print("Current path is {}\n\n".format(ISSM_DIR)) -
issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py
r26344 r26353 104 104 #}}} 105 105 106 def isa(A, dataType): #{{{ 107 """FUNCTION ISA 108 109 NOTE: 110 - Takes a type as its second argument (in contrast to the MATLAB function 111 that it replicates, which takes a string representing the name of a type) 112 """ 113 return type(A) == dataType 114 #}}} 115 106 116 def isfile(fileName): #{{{ 107 117 import os -
issm/trunk-jpl/src/m/plot/googlemaps.m
r25189 r26353 175 175 delete('temp.png'); 176 176 177 %If not gdal, exit177 %If not GDAL, exit 178 178 if status~=0, 179 179 disp(result); 180 disp('googlemaps info: gdalnot found or not working properly, the Google image will not be transformed');180 disp('googlemaps info: GDAL not found or not working properly, the Google image will not be transformed'); 181 181 [gX gY]=meshgrid(ulx:ulx+size(final,2)-1,uly:-1:uly-size(final,1)+1); 182 182 [LAT LON]=pixelstolatlon(gX,gY, zoom); … … 204 204 if ~isempty(strfind(result,'ERROR')), 205 205 disp(result); 206 disp(' ');disp('googlemaps info: gdal not working properly (missing proj.4 library?), Google image will not be transformed');206 disp(' ');disp('googlemaps info: GDAL not working properly (missing PROJ.4 library?), Google image will not be transformed'); 207 207 disp(result); 208 208 [gX gY]=meshgrid(ulx:ulx+size(final,2)-1,uly:-1:uly-size(final,1)+1); -
issm/trunk-jpl/src/m/plot/plot_manager.py
r25065 r26353 3 3 overlaysupport = True 4 4 except ImportError: 5 print(' osgeo/gdal for python not installed, overlay plots are not enabled')5 print('OSGeo/GDAL for Python not installed, overlay plots are not enabled') 6 6 overlaysupport = False 7 7 … … 20 20 21 21 def plot_manager(md, options, fig, axgrid, gridindex): 22 ''' 23 PLOT_MANAGER - distribute the plots called by plotmodel 22 """PLOT_MANAGER - distribute the plots called by plotmodel 24 23 25 24 'fig' is a handle to the figure instance created by plotmodel. … … 35 34 36 35 See also: PLOTMODEL, PLOT_UNIT 37 '''36 """ 38 37 #parse options and get a structure of options 39 38 options = checkplotoptions(md, options) … … 46 45 # TODO: Check why we are doing this and if it is absolutely necessary (see 47 46 # also src/m/plot/plot_mesh.py, src/m/plot/applyoptions.py) 47 # 48 48 options.addfielddefault('ticklabels', 'on') 49 49 -
issm/trunk-jpl/src/m/plot/plot_overlay.py
r25065 r26353 11 11 from osgeo import gdal 12 12 except ImportError: 13 print(' osgeo/gdalfor python not installed, plot_overlay is disabled')13 print('OSGeo/GDAL for python not installed, plot_overlay is disabled') 14 14 15 15 from processdata import processdata … … 19 19 20 20 def plot_overlay(md, data, options, ax): 21 ''' 22 Function for plotting a georeferenced image. Called from plot_manager by 21 """Function for plotting a georeferenced image. Called from plot_manager by 23 22 call to plotmodel. 24 23 … … 27 26 28 27 See also: PLOTMODEL 29 '''28 """ 30 29 31 30 x, y, z, elements, is2d, isplanet = processmesh(md, [], options) -
issm/trunk-jpl/src/m/plot/radarpower.m
r26047 r26353 29 29 d = getfieldvalue(options,'overlay_adjust_d',1); 30 30 31 %find gdalcoordinates31 %find GDAL coordinates 32 32 x0=min(xlim); x1=max(xlim); 33 33 y0=min(ylim); y1=max(ylim); -
issm/trunk-jpl/src/m/solve/solve.m
r26307 r26353 173 173 end 174 174 elseif md.settings.waitonlock>0, 175 %w e wait for thedone file175 %wait for done file 176 176 done=waitonlock(md); 177 177 if md.verbose.solution, -
issm/trunk-jpl/src/m/solve/solve.py
r26344 r26353 141 141 if md.qmu.isdakota: 142 142 filelist.append(modelname + '.qmu.in') 143 143 144 144 if not restart: 145 145 cluster.UploadQueueJob(md.miscellaneous.name, md.private.runtimename, filelist) … … 150 150 # Wait on lock 151 151 if md.settings.waitonlock > 0: 152 islock = waitonlock(md)153 if islock == 0: # no results to be loaded154 print('The results must be loaded manually with md = loadresultsfromcluster(md).')155 else: # load results156 if md.verbose.solution:157 print('loading results from cluster')158 md = loadresultsfromcluster(md)152 # Wait for done file 153 done = waitonlock(md) 154 if md.verbose.solution: 155 print('loading results from cluster') 156 md = loadresultsfromcluster(md) 157 elif md.settings.waitonlock == 0: 158 print('Model results must be loaded manually with md = loadresultsfromcluster(md).') 159 159 160 160 return md -
issm/trunk-jpl/src/m/solve/waitonlock.m
r26344 r26353 5 5 % disk. Also check for outlog file be cause it might be written several 6 6 % seconds after the lock file. 7 % 7 8 % If the time limit given in input is exceeded, return 0 8 9 % -
issm/trunk-jpl/src/m/solve/waitonlock.py
r26347 r26353 2 2 import sys 3 3 import time 4 from generic import * 5 from generic_static import * 6 # from localpfe import * 4 7 from MatlabFuncs import * 8 from pfe import * 5 9 6 10 def waitonlock(md): … … 15 19 Usage: 16 20 flag = waitonlock(md) 21 22 TODO: 23 - Uncomment import of localpfe and check on cluster type once localpfe.py 24 has been translated from localpfe.m. 17 25 """ 18 26 … … 22 30 cluster = md.cluster 23 31 24 """ 25 NOTE: We check cluster.name against string as cluster classes are not 26 defined globally and we do not have to import them all 27 """ 28 if cluster.name == 'pfe' and cluster.interactive > 1: 32 if isa(cluster, pfe) and cluster.interactive > 1: 29 33 lockfilename = '{}/Interactive{}/{}.lock'.format(executionpath, cluster.interactive, md.miscellaneous.name) 30 34 logfilename = '{}/Interactive{}/{}.outlog'.format(executionpath, cluster.interactive, md.miscellaneous.name) 31 elif cluster.name == 'localpfe':32 lockfilename = '{}/{}.lock'.format(executionpath, md.miscellaneous.name)33 logfilename = '{}/{}.outlog'.format(executionpath, md.miscellaneous.name)35 # elif isa(cluster, localpfe): 36 # lockfilename = '{}/{}.lock'.format(executionpath, md.miscellaneous.name) 37 # logfilename = '{}/{}.outlog'.format(executionpath, md.miscellaneous.name) 34 38 else: 35 39 lockfilename = '{}/{}/{}.lock'.format(executionpath, md.private.runtimename, md.miscellaneous.name) … … 37 41 38 42 # If we are using the generic cluster in interactive mode, job is already complete 39 if ( cluster.name == 'generic' and cluster.interactive) or (cluster.name == 'generic_static'):43 if (isa(cluster, generic) and cluster.interactive) or (isa(cluster, generic_static)): 40 44 # We are in interactive mode, no need to check for job completion 41 45 return 1 … … 73 77 subproc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 74 78 outs, errs = subproc.communicate() # NOTE: Need to consume output before checking return code 79 75 80 # TODO: Debug the following check under Linux (exits after first iteration with errs = "b") 76 81 # UPDATE: Works in testing under Debian Linux system. Leaving comment for now so that it is easier to backtrace this issue if someone else encounters it. 77 82 # 78 83 if errs != '': 79 raise Exception( "waitonlock: check for existence of files failed: {}".format(errs))84 raise Exception('waitonlock: check for existence of files failed: {}'.format(errs)) 80 85 ispresent = not subproc.returncode 81 86 if ispresent: -
issm/trunk-jpl/test/NightlyRun/runme.py
r26350 r26353 10 10 11 11 try: 12 from parallelrange import parallelrange13 except ImportError: #we don't have issm code in path, just get it12 from arch import archread 13 except: # ISSM_DIR is not on path 14 14 import devpath 15 from parallelrange import parallelrange 15 16 16 from arch import archread 17 17 from arch import archwrite 18 18 from GetIds import * 19 19 from IdToName import IdToName 20 from parallelrange import parallelrange 20 21 21 22 … … 33 34 34 35 Options: 35 -i/--id followed by the list of ids or (parts of) test names requested 36 NOTE: runs all tests by default 37 -e/--exclude ids or (parts of) test names to be excluded (same format as id) 38 NOTE: exclude does nothing if 'id' is specified with different values 39 -b/--benchmark 'all' : (all of the tests) 40 'nightly' : (nightly run/daily run) 41 'validation' : (validation) 42 'adolc' : validation of adolc tests 43 'eismint' : validation of eismint tests 44 'ismip' : validation of ismip-hom tests 45 'mesh' : validation of mesh tests 46 'qmu' : validation of qmu tests 47 'referential' : validation of referential tests 48 'slc' : validation of slc tests 49 'thermal' : validation of thermal tests 50 'tranforcing' : validation of transient forcing tests 51 -p/--procedure 'check' : run the test (default) 52 'update' : update the archive 36 -i/--id Followed by the list of ids or (parts of) test names 37 requested 38 -e/--exclude Ids or (parts of) test names to be excluded (same 39 format as id). Does nothing if 'id' is specified with 40 different values. 41 -b/--benchmark 'all' : (all of the tests) 42 'nightly' : (nightly run/daily run) 43 'validation' : (validation) 44 'adolc' : validation of adolc tests 45 'eismint' : validation of eismint tests 46 'ismip' : validation of ismip-hom tests 47 'mesh' : validation of mesh tests 48 'qmu' : validation of qmu tests 49 'referential' : validation of referential tests 50 'slc' : validation of slc tests 51 'thermal' : validation of thermal tests 52 'tranforcing' : validation of transient forcing tests 53 -p/--procedure 'check' : run the test (default) 54 'update' : update the archive 53 55 54 56 Usage: … … 103 105 #GET ids {{{ 104 106 flist = glob('test*.py') #File name must start with 'test' and must end by '.py' and must be different than 'test.py' 105 list_ids = [int(re.search(r'\d+',file.split('.')[0]).group()) for file in flist if not file == 'test.py'] # Keep test id only (skip 'test' and '.py')107 list_ids = [int(re.search(r'\d+',file.split('.')[0]).group()) for file in flist if not file == 'test.py'] # Keep test id only (skip 'test' and '.py') 106 108 107 109 i1, i2 = parallelrange(rank, numprocs, len(list_ids)) #Get tests for this cpu only
Note:
See TracChangeset
for help on using the changeset viewer.