#!/usr/bin/env python ### ######################################################### # # Main file for parallel mesh testing. Runs a shallow # water simulation using the merimbula mesh # # # # *) The (new) files that have been added to manage the # grid partitioning are # +) pmesh_divide_metis.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 # # Authors: Linda Stals, Steve Roberts and Matthew Hardy, # June 2005 # # # ######################################################### import sys from pypar_dist import pypar # The Python-MPI interface import time from os import sep # ADD directory ..../anuga/inundation to PYTHONPATH instead #sys.path.append('..'+sep+'pyvolution') #sys.path.append('..'+sep+'parallel') # Numeric arrays from Numeric import array, zeros, Float # pmesh from pyvolution.shallow_water import Domain from parallel.parallel_shallow_water import Parallel_Domain from pyvolution.pmesh2domain import pmesh_to_domain_instance # Mesh partition routines from parallel.pmesh_divide import pmesh_divide_metis from parallel.build_submesh import build_submesh from parallel.build_local import build_local_mesh from parallel.build_commun import send_submesh, rec_submesh, extract_hostmesh ############################### # 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