mirror of
https://github.com/ivabus/pantry
synced 2024-11-14 12:35:10 +03:00
14 lines
362 B
C
14 lines
362 B
C
|
#include <mpi.h>
|
||
|
#include <stdio.h>
|
||
|
|
||
|
int main() {
|
||
|
int size, rank, nameLen;
|
||
|
char name[MPI_MAX_PROCESSOR_NAME];
|
||
|
MPI_Init(NULL, NULL);
|
||
|
MPI_Comm_size(MPI_COMM_WORLD, &size);
|
||
|
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
||
|
MPI_Get_processor_name(name, &nameLen);
|
||
|
printf("[%d/%d] Hello, world! My name is %s.\\n", rank, size, name);
|
||
|
MPI_Finalize();
|
||
|
return 0;
|
||
|
}
|