Changes between Version 5 and Version 6 of AnugaParallel


Ignore:
Timestamp:
Dec 7, 2011, 3:46:23 PM (12 years ago)
Author:
steve
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AnugaParallel

    v5 v6  
    1717For instance I have the following line in my .bashrc file
    1818
     19{{{
    1920export PYTHONPATH=/home/steve/anuga/anuga_core/source
     21}}}
    2022
    2123
     
    2628Make sure mpi works. You should be able to run a program in parallel. Try something as simple as
    2729
     30{{{
    2831mpirun -np 4 pwd
     32}}}
    2933
    3034should produce the output of pwd 4 times.
     
    4347Install pypar following the instructions in the download. You should be able use the standard command
    4448
     49{{{
    4550python setup.py install
     51}}}
    4652
    4753or maybe
    4854
     55{{{
    4956sudo python setup.py install
     57}}}
    5058
    5159Make sure the pypar examples work
     
    6169If you have a 64 bit machine run
    6270
     71{{{
    6372make COPTIONS="-fPIC"
     73}}}
    6474
    6575From the pymetis directory, test using test_all.py, ie
    6676
     77{{{
    6778python test_all.py
     79}}}
    6880
    6981
     
    8799Then try a parallel run using a command like
    88100
     101{{{
    89102mpirun -np 4 python run_parallel_sw_merimbula.py
     103}}}
    90104
    91105That should run on 4 processors
     
    96110Essentially a fairly standard example, with the extra command
    97111
     112{{{
    98113domain = distribute(domain)
     114}}}
    99115
    100116which sets up all the parallel stuff.
     
    105121
    106122
     123{{{
    107124if myid == 0:
    108125     domain = create_domain_from_file(mesh_filename)
     
    110127else:
    111128     domain = None
    112 
     129}}}
    113130
    114131
     
    117134There is a script anuga/utilities/sww_merge.py which provides a function to merge sww files into one sww file for viewing
    118135with the anuga viewer.
     136
     137
     138Suppose your parallel code produced 3 sww files, domain_P0_3.sww domain_P1_3.sww and domain_P2_3.sww
     139
     140The base name would be "domain" and the number of processors would be 3. To stitch these 3 files together either run the sww_merge.py as a script with the command
     141
     142{{{
     143python /dir_to_anuga/utilities/sww_merge.py -f domain -np 3
     144}}}
     145
     146or add the following command at the end of your simulation script
     147
     148{{{
     149if myid == 0:
     150   import anuga.utilities.sww_merge as merge
     151   merge.sww_merge(domain.name,numprocs)
     152}}}