Changeset 3595
- Timestamp:
- Sep 14, 2006, 3:59:27 PM (19 years ago)
- Location:
- anuga_core/source/anuga_parallel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga_parallel/parallel_api.py
r3593 r3595 25 25 26 26 27 def distribute(domain): 27 def distribute(domain, verbose=False): 28 """ Distribute the domain to all processes 29 """ 30 31 # For some obscure reason this communication must happen prior to 32 # the more complex mesh distribution - Oh Well! 33 if myid == 0: 34 domain_name = domain.get_name() 35 for p in range(1, numprocs): 36 print 'p', p 37 pypar.send(domain_name, p) 38 else: 39 if verbose: print 'Receiving' 40 41 domain_name = pypar.receive(0) 42 28 43 29 44 if myid == 0: 30 #------------------------------------------------------------------- 31 # Distribute the domain 32 #------------------------------------------------------------------- 45 # Partition and distribute mesh. 46 # Structures returned is in the 47 # correct form for the ANUGA data structure 48 33 49 34 50 points, vertices, boundary, quantities,\ 35 51 ghost_recv_dict, full_send_dict,\ 36 52 = distribute_mesh(domain) 37 print 'Communication done' 53 54 if verbose: print 'Communication done' 38 55 39 56 else: 40 57 # Read in the mesh partition that belongs to this 41 # processor (note that the information is in the 42 # correct form for the GA data structure) 43 58 # processor 44 59 points, vertices, boundary, quantities,\ 45 60 ghost_recv_dict, full_send_dict,\ 46 61 = rec_submesh(0) 47 62 63 64 48 65 #------------------------------------------------------------------------ 49 # Start the computations on each subpartion66 # Build the domain for this processor using partion structures 50 67 #------------------------------------------------------------------------ 51 52 # Build the domain for this processor53 68 domain = Parallel_Domain(points, vertices, boundary, 54 69 full_send_dict = full_send_dict, … … 56 71 57 72 #------------------------------------------------------------------------ 58 # Setup initial conditions73 # Transfer initial conditions to each subdomain 59 74 #------------------------------------------------------------------------ 60 75 for q in quantities: 61 domain.set_quantity(q, quantities[q]) # Distribute all quantities76 domain.set_quantity(q, quantities[q]) 62 77 78 79 #------------------------------------------------------------------------ 80 # Transfer other attributes to each subdomain 81 #------------------------------------------------------------------------ 82 83 # FIXME Do them all 84 domain.set_name(domain_name) 63 85 64 86 #------------------------------------------------------------------------ -
anuga_core/source/anuga_parallel/test_parallel_sw_runup.py
r3593 r3595 49 49 # Create the parallel domain 50 50 #-------------------------------------------------------------------------- 51 domain = distribute(domain )51 domain = distribute(domain, verbose=True) 52 52 53 print 'P%d: name = %s' %(myid, domain.get_name()) 53 54 54 55 … … 57 58 # Name and dir, etc currently has to be set here as they are not 58 59 # transferred from the original domain 59 domain.set_name('runup') # Set sww filename60 #domain.set_name('runup') # Set sww filename 60 61 61 62 … … 79 80 80 81 for t in domain.evolve(yieldstep = 0.1, finaltime = 10.0): 81 domain.write_time() 82 pass 83 #domain.write_time() 82 84 83 85
Note: See TracChangeset
for help on using the changeset viewer.