Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92954387
ping_correct.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Nov 25, 03:03
Size
438 B
Mime Type
text/x-c
Expires
Wed, Nov 27, 03:03 (2 d)
Engine
blob
Format
Raw Data
Handle
22544193
Attached To
R11821 phys-743-lecture
ping_correct.c
View Options
#include <mpi.h>
#include <stdio.h>
int main(int argc, char * argv[]) {
int myrank, mysize;
int buf[100];
MPI_Status status;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
MPI_Comm_size(MPI_COMM_WORLD, &mysize);
if (myrank == 0) {
MPI_Send(buf, 100, MPI_INT, 1, 0, MPI_COMM_WORLD);
} else if (myrank == 1) {
MPI_Recv(buf, 100, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
}
MPI_Finalize();
}
Event Timeline
Log In to Comment