Changeset 8268


Ignore:
Timestamp:
Dec 6, 2011, 9:05:55 PM (11 years ago)
Author:
steve
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga_parallel/run_sww_merge.py

    r8267 r8268  
    1212if __name__ == "__main__":
    1313
    14     filename = '100y'
    15     np = 4;
    16     verbose = True
     14    import argparse
     15    from anuga.anuga_exceptions import ANUGAError
    1716
    1817
    19     output = filename+".sww"
    20     swwfiles = [filename+"_P"+str(v)+"_"+str(np)+".sww" for v in range(np)]
     18    parser = argparse.ArgumentParser(description='Merge sww files created from parallel run')
     19    parser.add_argument('-np', type=int, default = 4,
     20                   help='number of processors used to produce sww files')
     21    parser.add_argument('-f', type=str, default="domain",
     22                   help='base sww file name')
     23    parser.add_argument('-v', type=bool, default=False,
     24                   help='verbosity')
    2125
    22     print swwfiles
     26    args = parser.parse_args()
     27
     28    np = args.np
     29    filebase = args.f
     30    verbose = args.v
     31
     32    #print np
     33    #print filebase
     34    #print verbose
    2335   
    24     sww_merge(swwfiles, output, verbose)
     36
     37
     38    output = filebase+".sww"
     39    swwfiles = [ filebase+"P_"+str(np)+"_"+str(v)+".sww" for v in range(np)]
     40
     41    try:
     42        sww_merge(swwfiles, output, verbose)
     43    except:
     44        msg = 'ERROR: When merging sww files '+" ".join(swwfiles)
     45        print msg
     46        raise
Note: See TracChangeset for help on using the changeset viewer.