You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
583 B
C
24 lines
583 B
C
#include <stdio.h>
|
|
#include <mpi.h>
|
|
|
|
int receiveRoutine(double * y, int recvtype, int procSender,
|
|
int tag, int comm, int *handle){
|
|
|
|
MPI_Comm co = MPI_Comm_f2c(comm);
|
|
MPI_Datatype dt = MPI_Type_f2c(recvtype);
|
|
MPI_Request req;// = MPI_Request_f2c(*handle);
|
|
MPI_Irecv(y, 1, dt, procSender,tag, co, &req);
|
|
*handle = MPI_Request_c2f(req);
|
|
return 0;
|
|
|
|
}
|
|
|
|
int sendRoutine(double * y, int sendtype, int procToSend,int tag, int comm){
|
|
|
|
MPI_Comm co = MPI_Comm_f2c(comm);
|
|
MPI_Datatype dt = MPI_Type_f2c(sendtype);
|
|
MPI_Send(y, 1, dt, procToSend,tag,co);
|
|
return 0;
|
|
}
|
|
|