Changes between Version 5 and Version 6 of AnugaParallel
- Timestamp:
- Dec 7, 2011, 3:46:23 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AnugaParallel
v5 v6 17 17 For instance I have the following line in my .bashrc file 18 18 19 {{{ 19 20 export PYTHONPATH=/home/steve/anuga/anuga_core/source 21 }}} 20 22 21 23 … … 26 28 Make sure mpi works. You should be able to run a program in parallel. Try something as simple as 27 29 30 {{{ 28 31 mpirun -np 4 pwd 32 }}} 29 33 30 34 should produce the output of pwd 4 times. … … 43 47 Install pypar following the instructions in the download. You should be able use the standard command 44 48 49 {{{ 45 50 python setup.py install 51 }}} 46 52 47 53 or maybe 48 54 55 {{{ 49 56 sudo python setup.py install 57 }}} 50 58 51 59 Make sure the pypar examples work … … 61 69 If you have a 64 bit machine run 62 70 71 {{{ 63 72 make COPTIONS="-fPIC" 73 }}} 64 74 65 75 From the pymetis directory, test using test_all.py, ie 66 76 77 {{{ 67 78 python test_all.py 79 }}} 68 80 69 81 … … 87 99 Then try a parallel run using a command like 88 100 101 {{{ 89 102 mpirun -np 4 python run_parallel_sw_merimbula.py 103 }}} 90 104 91 105 That should run on 4 processors … … 96 110 Essentially a fairly standard example, with the extra command 97 111 112 {{{ 98 113 domain = distribute(domain) 114 }}} 99 115 100 116 which sets up all the parallel stuff. … … 105 121 106 122 123 {{{ 107 124 if myid == 0: 108 125 domain = create_domain_from_file(mesh_filename) … … 110 127 else: 111 128 domain = None 112 129 }}} 113 130 114 131 … … 117 134 There is a script anuga/utilities/sww_merge.py which provides a function to merge sww files into one sww file for viewing 118 135 with the anuga viewer. 136 137 138 Suppose your parallel code produced 3 sww files, domain_P0_3.sww domain_P1_3.sww and domain_P2_3.sww 139 140 The 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 {{{ 143 python /dir_to_anuga/utilities/sww_merge.py -f domain -np 3 144 }}} 145 146 or add the following command at the end of your simulation script 147 148 {{{ 149 if myid == 0: 150 import anuga.utilities.sww_merge as merge 151 merge.sww_merge(domain.name,numprocs) 152 }}}