Skip to content

Instantly share code, notes, and snippets.

@DaisukeMiyamoto
Created December 2, 2018 15:37
Show Gist options
  • Save DaisukeMiyamoto/26f53fa021e15d62cffd1182226e6749 to your computer and use it in GitHub Desktop.
Save DaisukeMiyamoto/26f53fa021e15d62cffd1182226e6749 to your computer and use it in GitHub Desktop.
test mpi job for AWS ParallelCluster
#include <mpi.h>
#include <stdio.h>
int main() {
int size;
int rank;
MPI_Init(NULL, NULL);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
printf("Hello world from rank %d out of %d processors\n", rank, size);
MPI_Finalize();
}
#/bin/bash
#$ -cwd
#$ -pe mpi 4
module load mpi/openmpi-x86_64
mpiexec /shared/hello1/a.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment