Commit d727986d authored by Iker Martín Álvarez's avatar Iker Martín Álvarez
Browse files

Update BaseCode.c

parent f612e0f0
......@@ -2,9 +2,6 @@
#include <stdlib.h>
#include <mpi.h>
#define FIRST 0
#define SECOND 1
int main(int argc, char* argv[]) {
MPI_Init(&argc, &argv);
......@@ -13,10 +10,10 @@ int main(int argc, char* argv[]) {
if(spawn == MPI_COMM_NULL) {
int num_c = atoi(argv[1]);
MPI_Comm_spawn(argv[0], MPI_ARGV_NULL, num_c, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &spawn, MPI_ERRCODES_IGNORE);
MPI_Intercomm_merge(spawn, FIRST, &new_comm);
MPI_Intercomm_merge(spawn, 0, &new_comm);
} else {
MPI_Intercomm_merge(spawn, SECOND, &new_comm);
MPI_Intercomm_merge(spawn, 1, &new_comm);
MPI_Barrier(MPI_COMM_WORLD);
}
......
Supports Markdown
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