#!/usr/bin/env python ######################################################### # # Main file for parallel mesh testing. # # This is a modification of the run_parallel_advection.py # file. # # # *) The (new) files that have been added to manage the # grid partitioning are # +) pmesh_divide.py: subdivide a pmesh # +) build_submesh.py: build the submeshes on the host # processor. # +) build_local.py: build the GA mesh datastructure # on each processor. # +) build_commun.py: handle the communication between # the host and processors # # *) Things still to do: # +) Overlap the communication and computation: The # communication routines in build_commun.py should be # interdispersed in the build_submesh.py and build_local.py # files. This will overlap the communication and # computation and will be far more efficient. This should # be done after more testing and there more confidence in # the subpartioning. # +) Much more testing especially with large numbers of # processors. # Authors: Linda Stals, Steve Roberts and Matthew Hardy, # June 2005 # # # ######################################################### import sys import pypar # The Python-MPI interface import time from os import sep sys.path.append('..'+sep+'pyvolution') # Numeric arrays from Numeric import array, zeros, Float # pmesh from shallow_water import Domain from parallel_shallow_water import Parallel_Domain from pmesh2domain import pmesh_to_domain_instance # Reuse previous mesh import from caching import cache # Mesh partition routines from pmesh_divide import pmesh_divide, pmesh_divide_steve from build_submesh import build_submesh, extract_hostmesh from build_local import build_local_mesh from build_commun import send_submesh, rec_submesh ############################### # Read in processor information ############################### numprocs = pypar.size() myid = pypar.rank() processor_name = pypar.Get_processor_name() ############################ # Set the initial conditions ############################ rect = zeros( 4, Float) # Buffer for results class Set_Stage: """Set an initial condition with constant water height, for xself.x0)&(x