Hey guys,
Does anyone happen to know the maximum amount of data that can be send in one MPI_Send and received in one MPI_Recv transfer?
I think that I had read once that the amount was not limited by MPI itself, but by other factors. That does make sense, but I'm having an annoying issue:
I have a variable length array that takes a message size that the user specifies on the command line. This array is then filled up with a bunch of 'a' characters.
After that, the character message is sent to another process. The receiving process then simply prints the specified amount of 'a' characters.
When I run the program, if I specify any message size from 1-64, it receives and prints fine.
If I try, say, 100 the program receives the message but only prints out 64 characters.
A rough idea of my sending process code is:
Code:
long long double TEST;
printf("How large should the message be?\n");
scanf("%lld", &TEST);
char test_string[TEST];
for(long long double i = 0; i <= TEST; i++){
test_string[i] = 'a';
}
MPI_Status status;
//MPI_Request req;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
if (my_rank == 0){
// Send the string
MPI_Send(test_string, /*4*/TEST, MPI_CHAR, 1, 99, MPI_COMM_WORLD);
And the receiving process is:
Code:
long long double TEST;
char test_str[TEST];
MPI_Status status;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
// Send the string
MPI_Recv(test_str, /*4*/UPPER_LIMIT, MPI_CHAR, 0, 99, MPI_COMM_WORLD, &status);
// Print received string
printf("\n%s\n",test_str);
Where UPPER_LIMIT is a #define of 50000000. I will eventually write this code so that the size of TEST is send first, and then the message is sent.
A sample output is:
How large should the message be?
2
aa
And if I put 100:
How large should the message be?
100
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaa
Any ideas?
Edit - By the way, I am on a 64-bit architecture.