Exemplo n.º 1
0
#         |     |     |
#         |=====|=====|
#         | R0  | R1  |
#         |  x  |  x  |
#         |     |     |
# (-1,-1) |=====|=====| (1,-1)
#

appcomm = mui4py.mpi_split_by_app()

# Configuration for the interfaces
config = mui4py.Config(2, mui4py.FLOAT64)
# Default configuration for every object.
mui4py.set_default_config(config)
URI = "mpi://" + domain + "/ifs1"
uniface = mui4py.Uniface(uri=URI)
uniface.set_data_types({"data": mui4py.STRING})

# Eeach step from 1 to 3 sender uses a different span:
#     s = 1 -> Box intersecting R0 and R2
#     s = 2 -> Sphere intersecting R1 and R3
#     s = 3 -> Point intersecting R3
#     s = 4 -> Smart sending is disabled due to timeout
send_region_t1 = mui4py.geometry.Box([-1, -1], [-0.5, 1.0])
send_region_t2 = mui4py.geometry.Sphere([1.0, 0.0], 0.5)
send_region_t3 = mui4py.geometry.Point([0.5, 0.5])

# Initialisation of smart sending
uniface.announce_send_span(0, 1, send_region_t1)

steps = 4
Exemplo n.º 2
0
import sys
import mui4py
domain = sys.argv[1]

# Get intra communicator
appcomm = mui4py.mpi_split_by_app()
rank = appcomm.Get_rank()

# Configuration for the interface (dimensions, float type, int type)
dims = 2
config = mui4py.Config(dims, mui4py.FLOAT64)

# Default configuration for every object so no need to pass it as an argument 
# to any class constructor.
URI = "mpi://" + domain + "/ifs1"
uniface = mui4py.Uniface(uri=URI, config=config)
uniface.set_data_types({"data": mui4py.FLOAT,
                       "data_assign": mui4py.FLOAT})

# Spatial and temporal samplers
t_sampler_exact = mui4py.ChronoSamplerExact()
s_sampler_exact = mui4py.SamplerExact()

# Push/fetch some data
point = [1.0, 1.0]
t = 0.0

# Wait until commit has completed in 'pusher'
uniface.barrier(0)
fetch_val_assign = uniface.fetch("data_assign")
print("\nFetched spatially independent value '{}' from domain {}.".format(fetch_val_assign, domain))