Transfer data in MPI
Hi, guys: I try to parallelize a big code using MPI. I have some questions and need your help.
1> beside MPI_PACK and MPI_UNPACK, is there only other simple way to transfer different type of data? like to transfer one integer and one real together? 2> for a simple example, node 0, a = 0.3 node 1, a = 0.1 by use MPI_ALLREDUCE(a, c, 1, MPI_REAL ...) we suppose to get c = 0.4 by compiling with mpif77, it is true, I can get the right solution but when I compile with mpif77 - r8, I can't get the correct solution since the size of r8 is twice of the real number, so I tried MPI_ALLREDUCE(a, c, 2, MPI_REAL ...), but still can't get the right solution when I try MPI_ALLREDUCE(a, c, 1, MPI_DOUBLE_PRECISION ...), I got a run-time error said the communicator is NULL ...... anyone knows how to transfer a r8 real number in MPI? Thank you very much! I appreciate your help! |
All times are GMT -4. The time now is 19:19. |