Commit 18160e81 authored by 61sima1bif@hft-stuttgart.de's avatar 61sima1bif@hft-stuttgart.de
Browse files

added helloworld.c

parent 42df4d3e
#include <stdio.h>
#include <mpi.h>
int main(int argc, char *argv[])
{
int rank, size;
MPI_Init(&argc, &argv); /* starts MPI */
MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* get current process id */
MPI_Comm_size (MPI_COMM_WORLD, &size); /* get processor count*/
if (rank == 0)
printf( "Hello world from process %d of %d\n", rank, size );
else
printf( "Hello world from process %d of %d\n", rank, size );
sleep(1);
MPI_Finalize();
return 0;
}
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