I am totally new to mpi and i installed openMPI on ubuntu... i am having a compilation problem when using mpi_Isend.
CountArray.c:(.text+0x12c): undefined reference to `MPI_ISend'
Here is my code... I know it's far from being perfect.. but im still discovering...
#include <stdio.h>
#include <mpi.h>
int numbers[10000]; //the numbers we need to get their average
int data[5000]; //the aray in which we will send the numbers to the threads.
int count, to, tag, from;
MPI_Request send_request,recv_request;
int main (argc, argv)
int argc;
char *argv[];
{
int rank, size;
//start by filling the numbers array
int i=0;
int j=0; //index to the numbers to be sent
for(i=0; i<10000; i++)
numbers[i] = i;
MPI_Status status;
MPI_Init (&argc, &argv); /* starts MPI */
MPI_Comm_rank (MPI_COMM_WORLD, &rank); /* get current process id */
MPI_Comm_size (MPI_COMM_WORLD, &size); /* get number of processes */
if(rank ==0){
printf( "Hello world from Main process %d of %d\n", rank, size );
//the manager
//put the numbers in the data array:
count = 5000;
to = 1;
tag = 2001;
for(j; j<5000; j++){
data[j] = numbers[j];
}
MPI_ISend(data, count, MPI_INT, to, tag, MPI_COMM_WORLD, &send_request); //HERE IS THE ERROR.. I NEED TO SEND THE DATA ARRAY WHICH CONTAINS 5000 ELEMENTS FROM PROCESS 0 TO PROCESS 1
}else{
printf( "Hello world from process %d of %d\n", rank, size );
from = MPI_ANY_SOURCE;
//MPI_IRecv(data, count, MPI_INT, 0, tag, MPI_COMM_WORLD, &recv_request);
//printf("Received data info\nFrom process: &d, count: &d", from, 1000);
}
MPI_Finalize();
return 0;
}
Question
eliokh
Hello,
I am totally new to mpi and i installed openMPI on ubuntu... i am having a compilation problem when using mpi_Isend.
Here is my code... I know it's far from being perfect.. but im still discovering...
THANKS IN ADVANCE FOR ANY HELP :D
Link to comment
Share on other sites
10 answers to this question
Recommended Posts