#!/usr/bin/env python # Test a run of the sequential shallow water domain against # a run of the parallel shallow water domain. # WARNING: This assumes that the command to run jobs is mpirun. # Tested with MPICH and LAM (Ole) #mesh_filename = "test-100.tsh" mesh_filename= "merimbula_10785_1.tsh" yieldstep = 1 finaltime = 90 quantity = 'stage' nprocs = 8 import unittest import os import sys import print_stats import pypar from Numeric import array, zeros, Float, take, nonzero from anuga.shallow_water import Domain from anuga.shallow_water import Reflective_boundary as sw_reflective_boundary from anuga.shallow_water import Transmissive_boundary as sw_transmissive_boundary from parallel_shallow_water import Parallel_Domain from parallel_shallow_water import Reflective_boundary as par_reflective_boundary from parallel_shallow_water import Transmissive_boundary as par_transmissive_boundary from anuga.abstract_2d_finite_volumes.pmesh2domain\ import pmesh_to_domain_instance from anuga.utilities.norms import * from anuga.utilities.util_ext import double_precision from print_stats import print_test_stats, build_full_flag from pmesh_divide import pmesh_divide_metis from build_submesh import build_submesh from build_local import build_local_mesh from build_commun import send_submesh, rec_submesh, extract_hostmesh class Set_Stage: """Set an initial condition with constant water height, for xself.x0)&(x 0: # Verify that the quantity is being conserved across iterations. assert_(abs(l1norm_seq[x][y] - l1norm_seq[x-1][y]) < tol) assert_(abs(l2norm_seq[x][y] - l2norm_seq[x-1][y]) < tol) assert_(abs(linfnorm_seq[x][y] - linfnorm_seq[x-1][y]) < tol) assert_(abs(l1norm_par[x][y] - l1norm_par[x-1][y]) < tol) assert_(abs(l2norm_par[x][y] - l2norm_par[x-1][y]) < tol) assert_(abs(linfnorm_par[x][y] - linfnorm_par[x-1][y]) < tol) if pypar.rank() == 0: print 'Parallel test OK' pypar.finalize()