mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-26 06:48:04 +02:00
MPI
This commit is contained in:
parent
c2db4122e7
commit
deea4832fe
7 changed files with 104 additions and 5 deletions
|
@ -0,0 +1,18 @@
|
|||
#include "mpi.h"
|
||||
|
||||
int msglen, again=1;
|
||||
void *buf;
|
||||
MPI_Datatype datatype
|
||||
MPI_Comm comm;
|
||||
MPI_Status status;
|
||||
|
||||
...
|
||||
while (again) {
|
||||
MPI_Probe(ROOT, MPI_ANY_TAG, comm, &status);
|
||||
MPI_Get_count(&status, datatype, &msglen);
|
||||
buf=malloc(msglen*sizeof(int));
|
||||
MPI_Recv(buf, msglen, datatype, status.MPI_SOURCE,
|
||||
status.MPI_TAG, comm, &status);
|
||||
...
|
||||
}
|
||||
...
|
Loading…
Add table
Add a link
Reference in a new issue