#include #include int main(int argc, char** argv) { // Initialize the MPI environment MPI_Init(NULL, NULL); // Get the number of processes int world_size; MPI_Comm_size(MPI_COMM_WORLD, &world_size); // Get the rank of the process int world_rank; MPI_Comm_rank(MPI_COMM_WORLD, &world_rank); // Check if the current process is the master process if (world_rank == 0) { // Master process prints this message printf("Hello world from master\n"); } else { // All other processes print this message printf("Hello world from processor %d out of %d processors\n", world_rank, world_size); } // Finalize the MPI environment. MPI_Finalize(); }