コード例 #1
0
ファイル: point_to_point_2.py プロジェクト: noushi/pyccel
from pyccel.stdlib.internal.mpi import mpi_send
from pyccel.stdlib.internal.mpi import mpi_recv
from pyccel.stdlib.internal.mpi import MPI_REAL8

import numpy as np

# we need to declare these variables somehow,
# since we are calling mpi subroutines
ierr = np.int32(-1)
size = np.int32(-1)
rank = np.int32(-1)

mpi_init(ierr)

comm = mpi_comm_world
mpi_comm_size(comm, size, ierr)
mpi_comm_rank(comm, rank, ierr)

nx = np.int32(4)
ny = np.int32(3 * 2)
x = np.zeros(nx)
y = np.zeros((3, 2))

if rank == 0:
    x[:] = 1.0
    y[:, :] = 1.0

source = np.int32(0)
dest = np.int32(1)
status = np.zeros(mpi_status_size, 'int32')
コード例 #2
0
ファイル: mpiext.py プロジェクト: noushi/pyccel
def mpiext_get_size(comm):
    size = int32(-1)
    ierr = int32(-1)
    mpi_comm_size(comm, size, ierr)
    return int(size)