Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: [OMPI users] MPI_Send doesn't work if the data >= 2GB
From: ÃÏÏܾü (xjun.meng_at_[hidden])
Date: 2010-12-05 22:13:01


hi,

I met a question recently when I tested the MPI_send and MPI_Recv
functions. When I run the following codes, the processes hanged and I
found there was not data transmission in my network at all.

BTW: I finished this test on two X86-64 computers with 16GB memory and
installed Linux.

 1 #include <stdio.h>
 2 #include <mpi.h>
 3 #include <stdlib.h>
 4 #include <unistd.h>
 5
 6
 7 int main(int argc, char** argv)
 8 {
 9 int localID;
 10 int numOfPros;
 11 size_t Gsize = (size_t)2 * 1024 * 1024 * 1024;
 12
 13 char* g = (char*)malloc(Gsize);
 14
 15 MPI_Init(&argc, &argv);
 16 MPI_Comm_size(MPI_COMM_WORLD, &numOfPros);
 17 MPI_Comm_rank(MPI_COMM_WORLD, &localID);
 18
 19 MPI_Datatype MPI_Type_lkchar;
 20 MPI_Type_contiguous(2048, MPI_BYTE, &MPI_Type_lkchar);
 21 MPI_Type_commit(&MPI_Type_lkchar);
 22
 23 if (localID == 0)
 24 {
 25 MPI_Send(g, 1024*1024, MPI_Type_lkchar, 1, 1, MPI_COMM_WORLD);
 26 }
 27
 28 if (localID != 0)
 29 {
 30 MPI_Status status;
 31 MPI_Recv(g, 1024*1024, MPI_Type_lkchar, 0, 1, \
 32 MPI_COMM_WORLD, &status);
 33 }
 34
 35 MPI_Finalize();
 36
 37 return 0;
 38 }

Thanks
Xianjun