Changeset 3635


Ignore:
Timestamp:
Sep 20, 2006, 4:15:53 PM (18 years ago)
Author:
ole
Message:

Work on parallel api and Karratha study

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga_parallel/parallel_api.py

    r3628 r3635  
    77# The Python-MPI interface
    88from pypar import size, rank, get_processor_name, finalize, send, receive
    9 from anuga_parallel.parallel_abstraction import size, rank, get_processor_name, finalize #,send, receive
     9#from anuga_parallel.parallel_abstraction import size, rank, get_processor_name, finalize #,send, receive
    1010from anuga_parallel.pmesh_divide  import pmesh_divide_metis
    1111from anuga_parallel.build_submesh import build_submesh
     
    123123def distribute_mesh(domain):
    124124
    125     numprocs = pypar.size()
     125    numprocs = size()
    126126
    127127   
  • anuga_work/production/karratha_2006/run_karratha.py

    r3631 r3635  
    3636import project                 # Definition of file names and polygons
    3737
    38 from anuga_parallel.parallel_api import distribute, myid
     38from anuga_parallel.parallel_api import distribute, myid, numprocs
    3939
    4040#------------------------------------------------------------------------------
     
    4646meshname = project.meshname+'.msh'
    4747source_dir = project.boundarydir
    48 
    49 
    5048
    5149if myid == 0:
     
    105103
    106104    print 'Available boundary tags', domain.get_boundary_tags()
    107     Bf = File_boundary(source_dir + project.boundary_basename + '.sww',
    108                        domain, verbose = True)
     105    #Bf = File_boundary(source_dir + project.boundary_basename + '.sww',
     106    #                   domain, verbose = True)
    109107    Br = Reflective_boundary(domain)
    110108    Bd = Dirichlet_boundary([tide,0,0])
     
    119117# Create the parallel domain
    120118#--------------------------------------------------------------------------
    121 domain = distribute(domain, verbose=True)
     119if numprocs > 1:
     120    domain = distribute(domain, verbose=True)
    122121
    123122# Set those boundaries that can't be communicated automatically
     123# FIXME: There is a problem with the parallel domain.
     124# It seems that boundaries are outside coverage.
     125#
     126# We get
     127#
     128#------------------------------------------------
     129#Interpolation_function (spatio-temporal) statistics:
     130#  Extent:
     131#    x in [-60494.651593, 149593.652382], len(x) == 56
     132#    y in [-74198.017534, 184623.446077], len(y) == 56
     133#    t in [0.000000, 28610.000000], len(t) == 145
     134#  Quantities:
     135#    stage in [-1.797799, 1.644574]
     136#    xmomentum in [-33.219473, 21.571094]
     137#    ymomentum in [-32.775090, 73.761256]
     138#  Interpolation points (xi, eta): number of points == 411
     139#    xi in [-420467.297166, -368252.119852]
     140#    eta in [-7652664.149808, -7605199.504709]
     141#  Interpolated quantities (over all timesteps):
     142#    stage at interpolation points in [inf, inf]
     143#    xmomentum at interpolation points in [inf, inf]
     144#    ymomentum at interpolation points in [inf, inf]
     145#------------------------------------------------
     146#
     147#Instead of
     148#
     149#------------------------------------------------
     150#Interpolation_function (spatio-temporal) statistics:
     151#  Extent:
     152#    x in [-60494.651593, 149593.652382], len(x) == 56
     153#    y in [-74198.017534, 184623.446077], len(y) == 56
     154#    t in [0.000000, 28610.000000], len(t) == 145
     155#  Quantities:
     156#    stage in [-1.797799, 1.644574]
     157#    xmomentum in [-33.219473, 21.571094]
     158#    ymomentum in [-32.775090, 73.761256]
     159#  Interpolation points (xi, eta): number of points == 503
     160#    xi in [4747.280215, 96909.729282]
     161#    eta in [9240.613414, 83183.465791]
     162#  Interpolated quantities (over all timesteps):
     163#    stage at interpolation points in [-0.909515, 1.331521]
     164#    xmomentum at interpolation points in [-17.054914, 17.110528]
     165#    ymomentum at interpolation points in [-24.691402, 16.625063]
     166#------------------------------------------------
     167
     168
    124169Bf = File_boundary(source_dir + project.boundary_basename + '.sww',
    125                    domain, verbose = True)                   
    126 boundary_map = domain.boundary_map
    127 boundary_map['ocean'] = Bf
    128 domain.set_boundary(boundary_map)
     170                   domain, verbose = True)
     171domain.modify_boundary({'ocean': Bf})
    129172
    130173
Note: See TracChangeset for help on using the changeset viewer.