Changeset 25684


Ignore:
Timestamp:
10/13/20 12:04:18 (4 years ago)
Author:
jdquinn
Message:

CHG: MATLAB -> Python; clean up

Location:
issm/trunk-jpl/src/m
Files:
1 added
5 edited

Legend:

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

    r24593 r25684  
    9595                                        if cluster.interactive
    9696                                                if IssmConfig('_HAVE_MPI_'),
    97                                                         fprintf(fid,'mpiexec -np %i %s/%s %s %s %s \n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
     97                                                        fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
    9898                                                else
    99                                                         fprintf(fid,'%s/%s %s %s %s ',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
     99                                                        fprintf(fid,'%s/%s %s %s %s',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
    100100                                                end
    101101                                        else
    102102                                                if IssmConfig('_HAVE_MPI_'),
    103                                                         fprintf(fid,'mpiexec -np %i %s/%s %s %s %s 2> %s.errlog >%s.outlog &',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname);
     103                                                        fprintf(fid,'mpiexec -np %i %s/%s %s %s %s 2> %s.errlog > %s.outlog &',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname);
    104104                                                else
    105                                                         fprintf(fid,'%s/%s %s %s %s 2> %s.errlog >%s.outlog &',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname);
     105                                                        fprintf(fid,'%s/%s %s %s %s 2> %s.errlog > %s.outlog &',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname);
    106106                                                end
    107107                                        end
     
    113113                                        if ismac,
    114114                                                if IssmConfig('_HAVE_MPI_'),
    115                                                         fprintf(fid,'mpiexec -np %i %s --leak-check=full --error-limit=no --dsymutil=yes --suppressions=%s %s/%s %s %s %s 2> %s.errlog >%s.outlog ',...
     115                                                        fprintf(fid,'mpiexec -np %i %s --leak-check=full --error-limit=no --dsymutil=yes --suppressions=%s %s/%s %s %s %s 2> %s.errlog > %s.outlog ',...
    116116                                                        cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname], modelname,modelname,modelname);
    117117                                                else
    118                                                         fprintf(fid,'%s --leak-check=full --dsymutil=yes --error-limit=no --suppressions=%s %s/%s %s %s %s 2> %s.errlog >%s.outlog ',...
     118                                                        fprintf(fid,'%s --leak-check=full --dsymutil=yes --error-limit=no --suppressions=%s %s/%s %s %s %s 2> %s.errlog > %s.outlog',...
    119119                                                        cluster.valgrind,cluster.valgrindsup,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname], modelname,modelname,modelname);
    120120                                                end
    121121                                        else
    122122                                                if IssmConfig('_HAVE_MPI_'),
    123                                                         fprintf(fid,'mpiexec -np %i %s --leak-check=full --error-limit=no --suppressions=%s %s/%s %s %s %s 2> %s.errlog >%s.outlog ',...
     123                                                        fprintf(fid,'mpiexec -np %i %s --leak-check=full --error-limit=no --suppressions=%s %s/%s %s %s %s 2> %s.errlog > %s.outlog',...
    124124                                                        cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname);
    125125                                                else
    126                                                         fprintf(fid,'%s --leak-check=full --error-limit=no --suppressions=%s %s/%s %s %s %s 2> %s.errlog >%s.outlog ',...
     126                                                        fprintf(fid,'%s --leak-check=full --error-limit=no --suppressions=%s %s/%s %s %s %s 2> %s.errlog > %s.outlog',...
    127127                                                        cluster.valgrind,cluster.valgrindsup,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname);
    128128                                                end
  • issm/trunk-jpl/src/m/classes/clusters/generic.py

    r25154 r25684  
    104104                        fid.write('mpiexec -np {} {}/{} {} {}/{} {}'.format(self.np, self.codepath, executable, solution, self.executionpath, dirname, modelname))
    105105                    else:
    106                         fid.write('{}/{} {} {}/{} {} '.format(self.codepath, executable, solution, self.executionpath, dirname, modelname))
     106                        fid.write('{}/{} {} {}/{} {}'.format(self.codepath, executable, solution, self.executionpath, dirname, modelname))
    107107                else:
    108108                    if IssmConfig('_HAVE_MPI_')[0]:
    109                         fid.write('mpiexec -np {} {}/{} {} {}/{} {} 2>{}.errlog>{}.outlog'.
     109                        fid.write('mpiexec -np {} {}/{} {} {}/{} {} 2> {}.errlog > {}.outlog'.
    110110                                  format(self.np, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
    111111                    else:
    112                         fid.write('{}/{} {} {}/{} {} 2>{}.errlog>{}.outlog '.
     112                        fid.write('{}/{} {} {}/{} {} 2> {}.errlog > {}.outlog '.
    113113                                  format(self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
    114114            elif isgprof:
     
    122122
    123123                if IssmConfig('_HAVE_MPI_')[0]:
    124                     fid.write('mpiexec -np {} {} --leak-check=full {} {}/{} {} {}/{} {} 2>{}.errlog>{}.outlog '.
     124                    fid.write('mpiexec -np {} {} --leak-check=full {} {}/{} {} {}/{} {} 2> {}.errlog > {}.outlog '.
    125125                              format(self.np, self.valgrind, supstring, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
    126126                else:
    127                     fid.write('{} --leak-check=full {} {}/{} {} {}/{} {} 2>{}.errlog>{}.outlog '.
     127                    fid.write('{} --leak-check=full {} {}/{} {} {}/{} {} 2> {}.errlog > {}.outlog '.
    128128                              format(self.valgrind, supstring, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
    129129
  • issm/trunk-jpl/src/m/classes/clusters/generic_static.py

    r24603 r25684  
     1import math
     2import os
     3import socket
     4import subprocess
     5
    16import numpy as np
    2 import socket
    3 import os
    4 import math
    5 import subprocess
     7
    68from IssmConfig import IssmConfig
    79from issmdir import issmdir
    8 from pairoptions import pairoptions
    910from issmssh import issmssh
    1011from issmscpin import issmscpin
    1112from issmscpout import issmscpout
    1213import MatlabFuncs as m
     14from pairoptions import pairoptions
    1315
    1416
     
    5860    def checkconsistency(self, md, solution, analyses):  # {{{
    5961        if self.np < 1:
    60             md = checkmessage(md, 'number of processors should be at least 1')
    61         if math.isnan(self.np):
    62             md = checkmessage(md, 'number of processors should not be NaN!')
     62            md.checkmessage('number of processors should be at least 1')
     63        if np.isnan(self.np):
     64            md.checkmessage('number of processors should not be NaN!')
    6365
    6466        return md
  • issm/trunk-jpl/src/m/dev/devpath.py

    r25198 r25684  
    1010if ISSM_DIR is None:
    1111    raise NameError('"ISSM_DIR" environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!')
    12 
    13 # NOTE: Now having user install netcdf4 via pip
    14 #
    15 # #Get paths to locally installed Python libraries
    16 # tpls = [
    17 #     'cftime', # Needed for netCDF4
    18 #     'netCDF4'
    19 # ]
    20 # for tpl in os.listdir(ISSM_DIR + '/externalpackages'):
    21 #     tpl_path = ISSM_DIR + '/externalpackages/' + tpl
    22 #     for dirpath, dirnames, filenames in os.walk(tpl_path):
    23 #         install_lib_path = dirpath + '/install/lib'
    24 #         for dirpath, dirnames, filenames in os.walk(install_lib_path):
    25 #             for dirname in dirnames:
    26 #                 if dirname in tpls:
    27 #                     dir = dirpath + '/' + dirname
    28 #                     for file in os.listdir(dir):
    29 #                         if file.find(".py") != -1:
    30 #                             if file.find(".pyc") == -1:
    31 #                                 if dirpath not in sys.path:
    32 #                                     sys.path.append(dirpath)
    3312
    3413#Go through src/m and append any directory that contains a *.py file to PATH
  • issm/trunk-jpl/src/m/mesh/meshintersect3d.py

    r25499 r25684  
    6363        raise RuntimeError('issue with transition vector having one empty slot')
    6464
    65     # Convert results to type 'int' to avoid modifying structures to which they are assigned
     65    # Convert results to type 'int' to avoid modifying structures to which
     66    # results are assigned
    6667    indices = indices.astype(int)
    6768
Note: See TracChangeset for help on using the changeset viewer.