Ignore:
Timestamp:
Jun 16, 2014, 8:08:34 PM (11 years ago)
Author:
steve
Message:

Changes to validation scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/validation_utilities/run_validation.py

    r9148 r9164  
    55__date__ ="$20/08/2012 11:20:00 PM$"
    66
     7   
    78
    8 def run_validation_script(script):
     9def run_validation_script(script, np=1, cfl=None, alg=None, verbose=False):
     10    """ For backwards compatiblity wrap new run_anuga_script as run_validation_script
     11    """
     12   
     13    from anuga import run_anuga_script
     14
     15    run_anuga_script(script, np=np, cfl=cfl, alg=alg, verbose=verbose)
     16
     17   
     18def run_validation_script_old(script,np=1, cfl=None, alg=None, verbose=False):
    919    #from anuga.validation_utilities.fabricate import run
    10     from anuga.validation_utilities.parameters import alg,cfl
    1120   
     21    if cfl is None:
     22        from anuga.validation_utilities.parameters import cfl
     23    if alg is None:
     24        from anuga.validation_utilities.parameters import alg
     25       
    1226    import subprocess
    13     cmd = 'python %s -cfl %s -alg %s' % (script, str(cfl), str(alg))
    14     print 50*'='
    15     print 'Run '+cmd
    16     print 50*'='
    17     subprocess.call([cmd], shell=True)
    18     #run('python', script,  '-alg', alg, '-cfl', cfl)
     27   
     28    if np>1:
     29        if verbose:
     30            cmd = 'mpirun -np %s python %s -cfl %s -alg %s -v ' % (str(np), script, str(cfl), str(alg))
     31        else:
     32            cmd = 'mpirun -np %s python %s -cfl %s -alg %s' % (str(np), script, str(cfl), str(alg))
     33        print 50*'='
     34        print 'Run '+cmd
     35        print 50*'='
     36        subprocess.call([cmd], shell=True)
     37
     38    else:
     39        if verbose:
     40            cmd = 'python %s -cfl %s -alg %s -v ' % (script, str(cfl), str(alg))
     41        else:
     42            cmd = 'python %s -cfl %s -alg %s' % (script, str(cfl), str(alg))
     43        print 50*'='
     44        print 'Run '+cmd
     45        print 50*'='
     46        subprocess.call([cmd], shell=True)
     47
    1948
    2049   
Note: See TracChangeset for help on using the changeset viewer.