java - MPI Recv data getting corrupted -
i'm trying send number across using mpi, data getting corrupted. can't figure out why. code is:
import mpi.*; public class test { public static void main(string[] args) throws mpiexception{ mpi.init(args); int rank = mpi.comm_world.rank(); int clustersize = mpi.comm_world.size(); int[] send = new int[1]; int[] recv = new int[1]; send[0] = 12387394; if(rank == 0) { mpi.comm_world.send(send[0], 0, 1, mpi.int, 1, 17); } else { mpi.comm_world.recv(recv, 0, 1, mpi.int, 0, 17); system.out.println(recv[0]); } mpi.finalize(); } }
the output 1
. why that?
shouldn't pass whole array buffer instead of first value? mean:
mpi.comm_world.send(send, 0, 1, mpi.int, 1, 17);
Comments
Post a Comment