Changeset 25762


Ignore:
Timestamp:
11/16/20 14:11:05 (4 years ago)
Author:
jdquinn
Message:

CHG: Changes in support of binaries Python API; clean up

Location:
issm/trunk-jpl
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/externalpackages/gmsh/install-4-mac-python-static.sh

    r25745 r25762  
    3434
    3535# Copy customized source and config files to 'src' directory
    36 cp configs/4/mac/static/CMakeLists.txt src
     36cp configs/${VER}/mac/static/CMakeLists.txt src
    3737
    3838# Configure
  • issm/trunk-jpl/jenkins/pine_island-mac-binaries-python

    r25749 r25762  
    4646        boost           install-1.7-mac-static.sh
    4747        dakota          install-6.2-mac-static.sh
    48         curl            install-7.67-static.sh
    4948        netcdf          install-4.7-mac-parallel-static.sh
    5049        proj            install-6.2-static.sh
     
    7574#               compilation
    7675#
    77 NUMCPUS_INSTALL=4
     76NUMCPUS_INSTALL=8
    7877
    7978# Number of CPUs used in the nightly runs
  • issm/trunk-jpl/src/m/classes/clusters/local.py

    r25684 r25762  
    4848    #}}}
    4949
    50     def checkconsistency: #{{{
     50    def checkconsistency(self, md, solution, analyses): #{{{
    5151        if cluster.np < 1:
    5252            md.checkmessage('number of processors should be at least 1')
  • issm/trunk-jpl/src/m/classes/spatiallinearbasalforcings.py

    r25688 r25762  
    1616
    1717    def __init__(self, *args): #{{{
    18         nargs = len(args):
     18        nargs = len(args)
    1919        if nargs == 0:
    2020            self.groundedice_melting_rate   = np.nan
     
    8080            raise Exception('not implemented yet!')
    8181            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
    82             md = checkfield(md, x'fieldname', 'basalforcings.deepwater_melting_rate', '>=', 0, 'numel', 1)
     82            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_melting_rate', '>=', 0, 'numel', 1)
    8383            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_elevation', '<', 'basalforcings.upperwater_elevation', 'numel', 1)
    8484            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_elevation', '<=', 0, 'numel', 1)
  • issm/trunk-jpl/src/m/geometry/AboveGround.py

    r25065 r25762  
    11import numpy as np
    22
    3 def function AboveGround(lat, long, r, height): #{{{
     3def AboveGround(lat, long, r, height): #{{{
    44    r = r + height
    55    x = r * np.cos(np.deg2rad(lat)) * np.cos(np.deg2rad(long))
  • issm/trunk-jpl/src/m/plot/plot_coastlines.py

    r25685 r25762  
    1 import matplotlib.patches.Polygon as mpl.Polygon
     1import matplotlib.patches.Polygon as Polygon
    22import numpy as np
    33
     
    99149914            # Plot
    99159915        else:
    9916             p = mpl.Polygon(np.hstack((x, y)))
     9916            p = Polygon(np.hstack((x, y)))
    99179917            # Plot
    99189918            if options.getfieldvalue('coordcent', 'atlantic') == 'pacific':
  • issm/trunk-jpl/src/m/solvers/bcgsasmoptions.py

    r25246 r25762  
    33
    44
    5 from pairoptions import pairoptions
    6     from collections import OrderedDict
     5def bcgsasmoptions(*args):
    76
    8 
    9     def bcgsasmoptions(*args):
    10 
    11         #retrieve options provided in *args
    12         options = pairoptions(*args)
    13         solverOptions = OrderedDict()
    14         solverOptions['toolkit'] = 'petsc'
    15         solverOptions['mat_type'] = options.getfieldvalue('mat_type', 'mpiaij')
    16         solverOptions['ksp_type'] = options.getfieldvalue('ksp_type', 'bcgs')
    17         solverOptions['pc_type'] = options.getfieldvalue('pc_type', 'asm')
    18         return solverOptions
     7    #retrieve options provided in *args
     8    options = pairoptions(*args)
     9    solverOptions = OrderedDict()
     10    solverOptions['toolkit'] = 'petsc'
     11    solverOptions['mat_type'] = options.getfieldvalue('mat_type', 'mpiaij')
     12    solverOptions['ksp_type'] = options.getfieldvalue('ksp_type', 'bcgs')
     13    solverOptions['pc_type'] = options.getfieldvalue('pc_type', 'asm')
    1914    return solverOptions
  • issm/trunk-jpl/src/m/solvers/bcgsjacobioptions.py

    r25246 r25762  
    33
    44
    5 from pairoptions import pairoptions
    6     from collections import OrderedDict
     5def bcgsjacobioptions(*args):
    76
     7    options = pairoptions(*args)
     8    solverOptions = OrderedDict()
     9    solverOptions['toolkit'] = 'petsc'
     10    solverOptions['mat_type'] = options.getfieldvalue('mat_type', 'mpiaij')
     11    solverOptions['ksp_type'] = options.getfieldvalue('ksp_type', 'bcgs')
     12    solverOptions['pc_type'] = options.getfieldvalue('pc_type', 'jacobi')
    813
    9     def bcgsjacobioptions(*args):
    10 
    11         options = pairoptions(*args)
    12         solverOptions = OrderedDict()
    13         solverOptions['toolkit'] = 'petsc'
    14         solverOptions['mat_type'] = options.getfieldvalue('mat_type', 'mpiaij')
    15         solverOptions['ksp_type'] = options.getfieldvalue('ksp_type', 'bcgs')
    16         solverOptions['pc_type'] = options.getfieldvalue('pc_type', 'jacobi')
    17 
    18         return solverOptions
    1914    return solverOptions
  • issm/trunk-jpl/src/m/solvers/cgnejacobioptions.py

    r25246 r25762  
    33
    44
    5 from pairoptions import pairoptions
    6     from collections import OrderedDict
     5def cgnejacobioptions(*args):
    76
     7    #retrieve options provided in *args
     8    options = pairoptions(*args)
     9    solverOptions = OrderedDict()
     10    solverOptions['toolkit'] = 'petsc'
     11    solverOptions['mat_type'] = options.getfieldvalue('mat_type', 'mpiaij')
     12    solverOptions['ksp_type'] = options.getfieldvalue('ksp_type', 'cgne')
     13    solverOptions['pc_type'] = options.getfieldvalue('pc_type', 'jacobi')
    814
    9     def cgnejacobioptions(*args):
    10 
    11         #retrieve options provided in *args
    12         options = pairoptions(*args)
    13         solverOptions = OrderedDict()
    14         solverOptions['toolkit'] = 'petsc'
    15         solverOptions['mat_type'] = options.getfieldvalue('mat_type', 'mpiaij')
    16         solverOptions['ksp_type'] = options.getfieldvalue('ksp_type', 'cgne')
    17         solverOptions['pc_type'] = options.getfieldvalue('pc_type', 'jacobi')
    18 
    19         return solverOptions
    2015    return solverOptions
  • issm/trunk-jpl/src/m/solvers/conditionnumberoptions.py

    r25246 r25762  
    33
    44
    5 function cn = conditionnumberoptions(*args)
    6     #MULTIGRIDOPTIONS - use Multigrid
    7     #
    8     #   Usage:
    9     #      options = mgoptions
     5def conditionnumberoptions(*args):
     6    """MULTIGRIDOPTIONS - use Multigrid
     7
     8    Usage:
     9        options = mgoptions
     10    """
    1011
    1112    #retrieve options provided in *args
  • issm/trunk-jpl/src/m/solvers/mumpsnoneoptions.py

    r25246 r25762  
    33
    44
    5 function mumps = mumpsoptions(*args)
     5def mumpsoptions(*args):
    66    #MUMPSOPTIONS - return MUMPS direct solver  petsc options
    77    #
     
    1616    PETSC_MAJOR = IssmConfig('_PETSC_MAJOR_')
    1717    PETSC_MINOR = IssmConfig('_PETSC_MINOR_')
    18     if PETSC_MAJOR == 2.,
     18    if PETSC_MAJOR == 2:
    1919        mumps.toolkit = 'petsc'
    2020        mumps.mat_type = getfieldvalue(options, 'mat_type', 'aijmumps')
     
    2424    end
    2525
    26     if PETSC_MAJOR == 3.,
     26    if PETSC_MAJOR == 3:
    2727        mumps.toolkit = 'petsc'
    2828        mumps.mat_type = getfieldvalue(options, 'mat_type', 'mpiaij')
    2929        mumps.ksp_type = getfieldvalue(options, 'ksp_type', 'preonly')
    3030        mumps.pc_type = getfieldvalue(options, 'pc_type', 'lu')
    31         if PETSC_MINOR > 8
     31        if PETSC_MINOR > 8:
    3232            mumps.pc_factor_mat_solver_type = getfieldvalue(options, 'pc_factor_mat_solver_type', 'mumps')
    33         else
     33        else:
    3434            mumps.pc_factor_mat_solver_package = getfieldvalue(options, 'pc_factor_mat_solver_package', 'mumps')
    3535        end
  • issm/trunk-jpl/test/NightlyRun/GetIds.py

    r24569 r25762  
    66
    77def GetIds(ids_names):
    8     """
    9      GetIds - output ids from a given array of IDs and test names
     8    """GETIDS - Output ids from a given array of IDs and test names
    109
    11               the test names can be any string or sub - string present
    12               in the test's name (first line of corresponding file)
     10    The test names can be any string or substring present in the test's name
     11    (first line of corresponding file). Test names are case sensitive.
    1312
    14               test names are case sensitive
    15 
    16          Usage:
    17              ids = GetIds(101)
    18              ids = GetIds('Dakota')
    19              ids = GetIds([101, 102...])
    20              ids = GetIds([\'Dakota\', \'Slr\'...])
    21              ids = GetIds([[101, 102...], [\'Dakota\', \'Slr\'...]])
     13    Usage:
     14        ids = GetIds(101)
     15        ids = GetIds('Dakota')
     16        ids = GetIds([101, 102...])
     17        ids = GetIds([\'Dakota\', \'Slr\'...])
     18        ids = GetIds([[101, 102...], [\'Dakota\', \'Slr\'...]])
    2219    """
    2320
    2421    ids = []
    2522
    26     # 1 input, either an id or a test name
     23    # Non-list input: either an ID or a test name
    2724    if type(ids_names) == str:
    2825        ids = IdFromString(ids_names)
     
    3229        #raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive. Test names are in the first line of a given test eg: "Square" would include test101.py: "SquareShelfConstrainedStressSSA2d"')
    3330
     31    # Non-list input: ID
    3432    if type(ids_names) == int:
    3533        ids = [ids_names]
     
    3937        #raise RuntimeError('runme.py: GetIds.py: No tests with ids matching "' + ids_names + '" were found. Check that there is a test file named "test' + str(ids_names) + '.py"')
    4038
    41         # many inputs of either ids or test names
     39    # many inputs of either ids or test names
    4240    if type(ids_names) == list and len(ids_names) > 0:
    4341        # is everything a string or int?
    4442        if np.array([type(i) == int for i in ids_names]).all():
    4543            ids = ids_names
    46         if np.array([type(i) == np.int64 for i in ids_names]).all():
     44        elif np.array([type(i) == np.int64 for i in ids_names]).all():
    4745            ids = ids_names
    4846        elif np.array([type(i) == str for i in ids_names]).all():
     
    5149                raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive.')
    5250
    53             # many inputs of both ids and test names
    54             # ids_names[0] -> ids_names by id
    55             # ids_names[1] -> ids_names by test name
     51    # many inputs of both ids and test names
     52    # ids_names[0] -> ids_names by id
     53    # ids_names[1] -> ids_names by test name
     54    #
     55    # NOTE: ID inclusion/exclusion lists will always hit this condition
     56    #       becasue of the way their respective arguments are gathered at the
     57    #       end of __main__ in the call to function runme.
    5658    if type(ids_names) == list and len(ids_names) == 2:
    57         if type(ids_names[0]) == list and len(ids_names[0]) > 0 and type(ids_names[0][0]) == int:
    58             ids = np.concatenate([ids, ids_names[0]])
     59        if type(ids_names[0]) == list and len(ids_names[0]) > 0:
     60            ids_expanded = []
     61            for i in ids_names[0]:
     62                # Handle case where list element follows MATLAB range syntax
     63                if ':' in i:
     64                    i_range = i.split(':')
     65                    for j in range(int(i_range[0]), int(i_range[1])):
     66                        ids_expanded.append(j)
     67                else:
     68                    ids_expanded.append(int(i))
     69            unique_ids = list(set(ids_expanded))
     70            ids += unique_ids
    5971        if type(ids_names[1]) == list and len(ids_names[1]) > 0 and type(ids_names[1][0]) == str:
    6072            ids = np.concatenate([ids, np.concatenate([IdFromString(i) for i in ids_names[1]])])
     
    6274                raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive.')
    6375
    64             # no recognizable ids or id formats
     76    # no recognizable ids or id formats
    6577    if np.size(ids) == 0 and not np.all(np.equal(ids_names, None)):
    6678        raise RuntimeError('runme.py: GetIds.py: include and exclude options (-i/--id; -in/--include_name; -e/--exclude; -en/--exclude_name) options must follow GetIds usage format:\n' + GetIds.__doc__)
  • issm/trunk-jpl/test/NightlyRun/runme.py

    r25689 r25762  
    2222    """RUNME - test deck for ISSM nightly runs
    2323
    24     In a test deck directory (tests/Vertification / NightlyRun for example) the
    25     following command will launch all the existing tests:
    26 
    27         >> ./runme.py
    28 
    29     To run the tests 101 and 102:
    30 
    31         >> ./runme.py -i [101, 102]
    32 
    33     Available options:
     24    In a test deck directory (test/NightlyRun for example), the following
     25    command will launch all the existing tests,
     26
     27        ./runme.py
     28
     29    To run tests 101 and 102:
     30
     31        ./runme.py -i [101, 102]
     32
     33    Options:
    3434        -i/--id             followed by the list of ids or (parts of) test names requested
    3535                            NOTE: runs all tests by default
     
    144144    erroredtest_list = []
    145145    for id in test_ids:
    146         print(("----------------starting:{}----------------------- ".format(id)))
     146        print(("----------------starting:{}-----------------------".format(id)))
    147147        try:
    148148            #Execute test
     
    218218                            fid = open(os.path.join(ISSM_DIR, 'nightlylog', 'pythonerror.log'), 'a')
    219219                            fid.write('%s' % message)
    220                             fid.write('\n------------------------------------------------------------------    \n')
     220                            fid.write('\n------------------------------------------------------------------\n')
    221221                            fid.close()
    222222                            print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id, id_string, fieldname)))
     
    231231                fid = open(os.path.join(ISSM_DIR, 'nightlylog', 'pythonerror.log'), 'a')
    232232                fid.write('%s' % message)
    233                 fid.write('\n------------------------------------------------------------------ \n')
     233                fid.write('\n------------------------------------------------------------------\n')
    234234                fid.close()
    235235                print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id, id_string, 'N/A')))
     
    238238                raise RuntimeError(message)
    239239
    240         print(("----------------    finished:{}----------------------- ".format(id)))
     240        print(("----------------finished:{}-----------------------".format(id)))
    241241
    242242    if errorcount > 0:
     
    244244    return
    245245
    246 
    247246if __name__ == '__main__':
    248247    if 'PYTHONSTARTUP' in os.environ:
    249248        PYTHONSTARTUP = os.environ['PYTHONSTARTUP']
    250 #print 'PYTHONSTARTUP = ', PYTHONSTARTUP
    251249        if os.path.exists(PYTHONSTARTUP):
    252250            try:
     
    258256
    259257        parser = argparse.ArgumentParser(description='RUNME - test deck for ISSM nightly runs')
    260         parser.add_argument('-i', '--id', nargs='*', type=int, help='followed by the list of ids requested', default=[])
     258        parser.add_argument('-i', '--id', nargs='*', type=str, help='followed by the list of ids requested', default=[])
    261259        parser.add_argument('-in', '--include_name', nargs='*', type=str, help='followed by the list of test names requested', default=[])
    262         parser.add_argument('-e', '--exclude', nargs='+', type=int, help='ids to be excluded from the test', default=[])
     260        parser.add_argument('-e', '--exclude', nargs='+', type=str, help='ids to be excluded from the test', default=[])
    263261        parser.add_argument('-en', '--exclude_name', nargs='+', type=str, help='test names to be excluded from the test', default=[])
    264262        parser.add_argument('-b', '--benchmark', help='nightly/ismip/eismint/thermal/mesh/...', default='nightly')
Note: See TracChangeset for help on using the changeset viewer.