source: trunk/anuga_core/anuga/validation_utilities/run_validation.py @ 9679

Last change on this file since 9679 was 9164, checked in by steve, 11 years ago

Changes to validation scripts

File size: 1.4 KB
Line 
1#! /usr/bin/python
2
3
4__author__="stephen"
5__date__ ="$20/08/2012 11:20:00 PM$"
6
7   
8
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):
19    #from anuga.validation_utilities.fabricate import run
20   
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       
26    import subprocess
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
48
49   
50
51
Note: See TracBrowser for help on using the repository browser.