Changeset 2909
- Timestamp:
- May 18, 2006, 1:06:32 PM (19 years ago)
- Location:
- inundation/parallel
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/parallel/build_commun.py
r2625 r2909 313 313 return GAnodes, GAtriangles, boundary, quantities, ghost_rec, full_send 314 314 315 315 ######################################################### 316 # 317 # Extract the submesh that will belong to the 318 # "host processor" (i.e. processor zero) 319 # 320 # *) See the documentation for build_submesh 321 # 322 # ------------------------------------------------------- 323 # 324 # *) A dictionary containing the full_triangles, 325 # full_nodes, full_boundary, ghost_triangles, ghost_nodes, 326 # ghost_boundary, ghost_commun and full_commun belonging 327 # to processor zero are returned. 328 # 329 ######################################################### 330 def extract_hostmesh(submesh, triangles_per_proc): 331 332 submesh_cell = {} 333 submesh_cell["full_nodes"] = submesh["full_nodes"][0] 334 submesh_cell["ghost_nodes"] = submesh["ghost_nodes"][0] 335 submesh_cell["full_triangles"] = submesh["full_triangles"][0] 336 submesh_cell["ghost_triangles"] = submesh["ghost_triangles"][0] 337 submesh_cell["full_boundary"] = submesh["full_boundary"][0] 338 submesh_cell["ghost_boundary"] = submesh["ghost_boundary"][0] 339 submesh_cell["ghost_commun"] = submesh["ghost_commun"][0] 340 submesh_cell["full_commun"] = submesh["full_commun"][0] 341 submesh_cell["full_quan"] ={} 342 submesh_cell["ghost_quan"]={} 343 for k in submesh["full_quan"]: 344 submesh_cell["full_quan"][k] = submesh["full_quan"][k][0] 345 submesh_cell["ghost_quan"][k] = submesh["ghost_quan"][k][0] 346 347 numprocs = pypar.size() 348 points, vertices, boundary, quantities, ghost_recv_dict, full_send_dict = \ 349 build_local_mesh(submesh_cell, 0, triangles_per_proc[0], numprocs) 350 return points, vertices, boundary, quantities, ghost_recv_dict, \ 351 full_send_dict 352 353 354 -
inundation/parallel/build_submesh.py
r2906 r2909 13 13 14 14 import sys 15 import pypar # The Python-MPI interface16 15 17 16 from Numeric import zeros, Float, Int, concatenate, \ … … 540 539 return submesh 541 540 542 #########################################################543 #544 # Extract the submesh that will belong to the545 # "host processor" (i.e. processor zero)546 #547 # *) See the documentation for build_submesh548 #549 # -------------------------------------------------------550 #551 # *) A dictionary containing the full_triangles,552 # full_nodes, full_boundary, ghost_triangles, ghost_nodes,553 # ghost_boundary, ghost_commun and full_commun belonging554 # to processor zero are returned.555 #556 #########################################################557 def extract_hostmesh(submesh, triangles_per_proc):558 559 submesh_cell = {}560 submesh_cell["full_nodes"] = submesh["full_nodes"][0]561 submesh_cell["ghost_nodes"] = submesh["ghost_nodes"][0]562 submesh_cell["full_triangles"] = submesh["full_triangles"][0]563 submesh_cell["ghost_triangles"] = submesh["ghost_triangles"][0]564 submesh_cell["full_boundary"] = submesh["full_boundary"][0]565 submesh_cell["ghost_boundary"] = submesh["ghost_boundary"][0]566 submesh_cell["ghost_commun"] = submesh["ghost_commun"][0]567 submesh_cell["full_commun"] = submesh["full_commun"][0]568 submesh_cell["full_quan"] ={}569 submesh_cell["ghost_quan"]={}570 for k in submesh["full_quan"]:571 submesh_cell["full_quan"][k] = submesh["full_quan"][k][0]572 submesh_cell["ghost_quan"][k] = submesh["ghost_quan"][k][0]573 574 numprocs = pypar.size()575 points, vertices, boundary, quantities, ghost_recv_dict, full_send_dict = \576 build_local_mesh(submesh_cell, 0, triangles_per_proc[0], numprocs)577 return points, vertices, boundary, quantities, ghost_recv_dict, \578 full_send_dict579 -
inundation/parallel/documentation/code/RunParallelAdvection.py
r2906 r2909 17 17 from os import sep 18 18 sys.path.append('..'+sep+'pyvolution') 19 sys.path.append('..'+sep+'parallel') 19 20 20 21 # Parallel communication routines -
inundation/parallel/documentation/code/RunParallelMerimbulaMetis.py
r2906 r2909 32 32 from os import sep 33 33 sys.path.append('..'+sep+'pyvolution') 34 sys.path.append('..'+sep+'parallel') 34 35 35 36 # Numeric arrays … … 48 49 49 50 from pmesh_divide import pmesh_divide_metis 50 from build_submesh import build_submesh , extract_hostmesh51 from build_submesh import build_submesh 51 52 from build_local import build_local_mesh 52 from build_commun import send_submesh, rec_submesh 53 from build_commun import send_submesh, rec_submesh, extract_hostmesh 53 54 54 55 … … 114 115 # Build the local mesh for processor 0 115 116 116 points, vertices, boundary, quantities, ghost_recv_dict, full_send_dict =\117 points, vertices, boundary, quantities, ghost_recv_dict, full_send_dict = \ 117 118 extract_hostmesh(submesh, triangles_per_proc) 118 119 -
inundation/parallel/documentation/code/RunParallelSwMerimbulaMetis.py
r2906 r2909 30 30 from os import sep 31 31 sys.path.append('..'+sep+'pyvolution') 32 sys.path.append('..'+sep+'parallel') 32 33 33 34 # Numeric arrays … … 44 45 45 46 from pmesh_divide import pmesh_divide_metis 46 from build_submesh import build_submesh , extract_hostmesh47 from build_submesh import build_submesh 47 48 from build_local import build_local_mesh 48 from build_commun import send_submesh, rec_submesh 49 from build_commun import send_submesh, rec_submesh, extract_hostmesh 49 50 50 51 ############################### -
inundation/parallel/run_parallel_merimbula_test.py
r2769 r2909 51 51 52 52 from pmesh_divide import pmesh_divide_metis 53 from build_submesh import build_submesh , extract_hostmesh53 from build_submesh import build_submesh 54 54 from build_local import build_local_mesh 55 from build_commun import send_submesh, rec_submesh 55 from build_commun import send_submesh, rec_submesh, extract_hostmesh 56 56 57 57 … … 109 109 send_submesh(submesh, triangles_per_proc, p) 110 110 111 hostmesh = extract_hostmesh(submesh) 112 [points, vertices, boundary, quantities, ghost_recv_dict, full_send_dict] = \ 113 build_local_mesh(hostmesh, 0, triangles_per_proc[0], numprocs) 111 # Build the local mesh for processor 0 112 113 points, vertices, boundary, quantities, ghost_recv_dict, full_send_dict = \ 114 extract_hostmesh(submesh, triangles_per_proc) 114 115 115 116 # read in the mesh partition that belongs to this -
inundation/parallel/run_parallel_sw_merimbula_test.py
r2906 r2909 64 64 65 65 from pmesh_divide import pmesh_divide_metis 66 from build_submesh import build_submesh , extract_hostmesh66 from build_submesh import build_submesh 67 67 from build_local import build_local_mesh 68 from build_commun import send_submesh, rec_submesh 68 from build_commun import send_submesh, rec_submesh, extract_hostmesh 69 69 70 70 ############################### … … 143 143 # Build the local mesh for processor 0 144 144 145 hostmesh = extract_hostmesh(submesh)146 145 points, vertices, boundary, quantities, ghost_recv_dict, full_send_dict = \ 147 build_local_mesh(hostmesh, 0, triangles_per_proc[0], numprocs)146 extract_hostmesh(submesh, triangles_per_proc) 148 147 149 148 # Read in the mesh partition that belongs to this
Note: See TracChangeset
for help on using the changeset viewer.