Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132944 views
License: OTHER
1
#include <stdio.h>
2
#include <mpi.h>
3
int main (int argc, char** args) {
4
int size;
5
int myrank;
6
MPI_Init(&argc, &args);
7
MPI_Comm_size(MPI_COMM_WORLD, &size);
8
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
9
printf("Hello world, I have rank %d out of %d.\n",
10
myrank, size);
11
MPI_Finalize();
12
return 0;
13
}
14