MPI scrip

contoh scrip MPI menampilkan nama,nim,hobi

#include <mpi.h>
#include <stdio.h>

int main(int argc, char* argv[]) {
int numberOfProcessors;
int rank;
int namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];

MPI_Init(&argc, &argv);
printf("Nama       : muhammad ronggo winoto noto saputro\n");
printf("NIM         : G.211.12.0115\n");
printf("Cita-cita   : HECKER\n\n");
printf("Nama       : Indriani Safitrii\n");
printf("NIM         : G.211.12.0082\n");
printf("Cita-cita : DEVELOPER\n\n");
MPI_Comm_size(MPI_COMM_WORLD,&numberOfProcessors);
printf("Jumlah processor = %d\r\n", numberOfProcessors);
MPI_Get_processor_name(processor_name, &namelen);
printf("Nama Processor = %s\r\n", processor_name);

MPI_Comm_rank(MPI_COMM_WORLD, &rank);
printf("Proses pada %d\r\n", rank);

MPI_Finalize();
return 0;
}

Komentar

Postingan Populer