Commit 6b671d61 authored by j.knedlik's avatar j.knedlik
Browse files

Initial commit

parents
mpic++ -o mpitest.exe -x c++ - << EOF
#include <mpi.h>
int main(int argc, char **argv)
{
MPI_Init(NULL,NULL);
MPI_Finalize();
return 0;
}
EOF
srun -n 2 -- $PWD/mpitest.exe
mpic++ -o sendrecv.exe -x c++ - << EOF
#include <mpi.h>
int main(int argc, char **argv)
{
MPI_Init(NULL,NULL);
int rank;
int number=-1;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (rank == 0) {
number = 0;
MPI_Send(&number, 1, MPI_INT, 1, 0, MPI_COMM_WORLD);
} else {
MPI_Recv(&number, 1, MPI_INT, 0, 0, MPI_COMM_WORLD,
MPI_STATUS_IGNORE);
}
MPI_Finalize();
return number;
}
EOF
srun -n 2 -- $PWD/sendrecv.exe
File added
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment