Skip to content

Instantly share code, notes, and snippets.

@NielsMinssen
Created June 2, 2023 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NielsMinssen/36230588bf22d6dbe3ce123d08f8cb4a to your computer and use it in GitHub Desktop.
Save NielsMinssen/36230588bf22d6dbe3ce123d08f8cb4a to your computer and use it in GitHub Desktop.
#include <mpi.h>
#include <stdio.h>
int main(int argc, char** argv) {
MPI_Init(NULL, NULL);
// Récupération du nombre de processus
int world_size;
MPI_Comm_size(MPI_COMM_WORLD, &world_size);
// Récupération de l'identifiant du processus
int world_rank;
MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
printf("Hello from process %d of %d\n", world_rank, world_size);
MPI_Finalize();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment