500


mpi-mandelbrot - Stephen's Git Server

Generate mandelbrot images using many clustered computers

main.c 478B

    #include<mpi.h> #include<stdlib.h> #include<stdio.h> #include "master.h" #include "slave.h" int main(char argc, char **argv) { MPI_Init(NULL, NULL); int worldSize, worldRank; MPI_Comm_size(MPI_COMM_WORLD, &worldSize); MPI_Comm_rank(MPI_COMM_WORLD, &worldRank); if(worldSize == 1) { printf("ERROR: You need at least 1 slave!\r\n"); return 1; } worldRank == 0 ? master_main(argc, argv, worldSize) : slave_main(worldSize, worldRank); MPI_Finalize(); return 0; }