Changeset 13336


Ignore:
Timestamp:
09/12/12 09:01:36 (13 years ago)
Author:
Mathieu Morlighem
Message:

CHG: removed from MatlabFuncs import *, which was producing the following error message: 'SyntaxWarning: import * only allowed at module level'

Location:
issm/trunk-jpl/test/NightlyRun
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/test/NightlyRun/runme.m

    r13258 r13336  
    3535
    3636%Check inputs
    37 % {{{1
     37% {{{
    3838if nargout>1
    3939        help runme
     
    4646
    4747%Process options
    48 %GET benchmark {{{1
     48%GET benchmark {{{
    4949benchmark=getfieldvalue(options,'benchmark','nightly');
    5050if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc'})
     
    5353end
    5454% }}}
    55 %GET procedure {{{1
     55%GET procedure {{{
    5656procedure=getfieldvalue(options,'procedure','check');
    5757if ~ismember(procedure,{'check','update'})
     
    6060end
    6161% }}}
    62 %GET output {{{1
     62%GET output {{{
    6363output=getfieldvalue(options,'output','none');
    6464if ~ismember(output,{'nightly','daily','none'})
     
    6767end
    6868% }}}
    69 %GET RANK and NUMPROCS for mutlithreaded runs  {{{1
     69%GET RANK and NUMPROCS for mutlithreaded runs  {{{
    7070rank=getfieldvalue(options,'rank',1);
    7171numprocs=getfieldvalue(options,'numprocs',1);
    7272if (numprocs<rank), numprocs=1; end
    7373% }}}
    74 %GET ids  {{{1
     74%GET ids  {{{
    7575flist=dir;%use dir, as it seems to act OS independent
    7676list_ids=[];
     
    8888test_ids=intersect(test_ids,list_ids);
    8989% }}}
    90 %GET exclude {{{1
     90%GET exclude {{{
    9191exclude_ids=getfieldvalue(options,'exclude',[]);
    9292exclude_ids=[exclude_ids];
     
    9494test_ids(pos)=[];
    9595% }}}
    96 %Process Ids according to benchmarks{{{1
     96%Process Ids according to benchmarks{{{
    9797if strcmpi(benchmark,'nightly'),
    9898        test_ids=intersect(test_ids,[1:999]);
  • issm/trunk-jpl/test/NightlyRun/runme.py

    r13108 r13336  
    4242        from parallelrange import parallelrange
    4343        from IdToName import IdToName
    44         from MatlabFuncs import *
     44        from MatlabFuncs import strcmpi
     45        from MatlabFuncs import ismember
    4546
    4647        #Get ISSM_DIR variable
    4748        ISSM_DIR=os.environ['ISSM_DIR']
    48         print 'ISSM_DIR =',ISSM_DIR
    4949
    5050        #Process options
    51         #GET benchmark {{{1
     51        #GET benchmark {{{
    5252        if not ismember(benchmark,['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing']):
    5353                print "runme warning: benchmark '%s' not supported, defaulting to test 'nightly'." % benchmark
    5454                benchmark='nightly'
    5555        # }}}
    56         #GET procedure {{{1
     56        #GET procedure {{{
    5757        if not ismember(procedure,['check','update']):
    5858                print "runme warning: procedure '%s' not supported, defaulting to test 'check'." % procedure
    5959                procedure='check'
    6060        # }}}
    61         #GET output {{{1
     61        #GET output {{{
    6262        if not ismember(output,['nightly','daily','none']):
    6363                print "runme warning: output '%s' not supported, defaulting to test 'none'." % output
    6464                output='none'
    6565        # }}}
    66         #GET RANK and NUMPROCS for multithreaded runs {{{1
     66        #GET RANK and NUMPROCS for multithreaded runs {{{
    6767        if (numprocs<rank):
    6868                numprocs=1
    6969        # }}}
    70 
    71         print 'id =',id
    72         print 'exclude =',exclude
    73         print 'benchmark =',benchmark
    74         print 'procedure =',procedure
    75         print 'output =',output
    76         print 'rank =',rank
    77         print 'numprocs =',numprocs
    78 
    79         #GET ids  {{{1
     70        #GET ids  {{{
    8071        flist=glob.glob('test*.py')    #File name must start with 'test' and must end by '.py' and must be different than 'test.py'
    8172        list_ids=[int(file[4:-3]) for file in flist if not file == 'test.py']    #Keep test id only (skip 'test' and '.py')
    82         print 'list_ids =',list_ids
     73        #print 'list_ids =',list_ids
    8374
    8475        i1,i2=parallelrange(rank,numprocs,len(list_ids))    #Get tests for this cpu only
    8576        list_ids=list_ids[i1:i2+1]
    86         print 'list_ids after parallelrange =',list_ids
     77        #print 'list_ids after parallelrange =',list_ids
    8778
    8879        if id:
     
    9485        else:
    9586                test_ids=set(list_ids)
    96 #       print 'test_ids after list =',test_ids
    97         # }}}
    98 
    99         #GET exclude {{{1
     87        #print 'test_ids after list =',test_ids
     88        # }}}
     89        #GET exclude {{{
    10090        if exclude:
    10191                if isinstance(exclude,list):
     
    10696#       print 'test_ids after exclude =',test_ids
    10797        # }}}
    108 
    109         #Process Ids according to benchmarks {{{1
     98        #Process Ids according to benchmarks {{{
    11099        if   strcmpi(benchmark,'nightly'):
    111100                test_ids=test_ids.intersection(set(range(1,1000)))
     
    122111        elif strcmpi(benchmark,'tranforcing'):
    123112                test_ids=test_ids.intersection(set(range(1501,1503)))
    124 #       print 'test_ids after benchmark =',test_ids
     113        #print 'test_ids after benchmark =',test_ids
    125114        test_ids=list(test_ids)
    126115        test_ids.sort()
    127         print 'test_ids after sort =',test_ids
     116        #print 'test_ids after sort =',test_ids
    128117        # }}}
    129118
     
    248237        return
    249238
     239import argparse
    250240if __name__ == '__main__':
    251241        if 'PYTHONSTARTUP' in os.environ:
    252242                PYTHONSTARTUP=os.environ['PYTHONSTARTUP']
    253                 print 'PYTHONSTARTUP =',PYTHONSTARTUP
     243                #print 'PYTHONSTARTUP =',PYTHONSTARTUP
    254244                if os.path.exists(PYTHONSTARTUP):
    255245                        try:
     
    260250                        print "PYTHONSTARTUP file '%s' does not exist." % PYTHONSTARTUP
    261251
    262         import argparse
    263252        parser = argparse.ArgumentParser(description='RUNME - test deck for ISSM nightly runs')
    264253        parser.add_argument('-i','--id', nargs='*', type=int, help='followed by the list of ids requested', default=[])
Note: See TracChangeset for help on using the changeset viewer.