Changeset 3628


Ignore:
Timestamp:
Sep 20, 2006, 11:03:02 AM (18 years ago)
Author:
ole
Message:

Work on parallel abstraction allowing sequential execution

Location:
anuga_core/source/anuga_parallel
Files:
1 added
1 edited

Legend:

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

    r3624 r3628  
    55
    66# Parallelism
    7 import pypar   # The Python-MPI interface
     7# The Python-MPI interface
     8from pypar import size, rank, get_processor_name, finalize, send, receive
     9from anuga_parallel.parallel_abstraction import size, rank, get_processor_name, finalize #,send, receive
    810from anuga_parallel.pmesh_divide  import pmesh_divide_metis
    911from anuga_parallel.build_submesh import build_submesh
     
    1719#------------------------------------------------------------------------------
    1820
    19 numprocs = pypar.size()
    20 myid = pypar.rank()
    21 processor_name = pypar.Get_processor_name()
     21numprocs = size()
     22myid = rank()
     23processor_name = get_processor_name()
    2224print 'I am processor %d of %d on node %s' %(myid, numprocs, processor_name)
    2325
     
    3739
    3840        for p in range(1, numprocs):
    39             pypar.send((domain_name, domain_dir), p)
     41            send((domain_name, domain_dir), p)
    4042    else:
    4143        if verbose: print 'P%d: Receiving domain attributes' %(myid)
    4244
    43         domain_name, domain_dir = pypar.receive(0)
     45        domain_name, domain_dir = receive(0)
    4446
    4547
     
    5153        boundary_map = domain.boundary_map
    5254        for p in range(1, numprocs):
    53             pypar.send(boundary_map, p)
     55            send(boundary_map, p)
    5456    else:
    5557        if verbose: print 'P%d: Receiving boundary map' %(myid)       
    5658
    57         boundary_map = pypar.receive(0)
     59        boundary_map = receive(0)
    5860       
    5961
Note: See TracChangeset for help on using the changeset viewer.