Skip to content
Snippets Groups Projects
Commit c53a7c34 authored by David Goz's avatar David Goz :sleeping:
Browse files

mpi/miscellaneous/cartesian.cpp bugfix

parent 39c018b4
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ int main(int argc, char **argv)
MPI_Comm_size(MPI_COMM_WORLD, &ntasks);
MPI_Comm_rank(MPI_COMM_WORLD, &task);
if (argc < 1)
if (argc <= 1)
{
if (!task)
{
......@@ -23,7 +23,7 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}
}
const int cartesian_grid_x = (int)strtol(argv[1], NULL, 10);
const int cartesian_grid_y = ((ntasks % cartesian_grid_x == 0) ? (ntasks / cartesian_grid_x) : -1);
if (cartesian_grid_y == -1)
......@@ -63,7 +63,7 @@ int main(int argc, char **argv)
cout << endl;
}
}
MPI_Comm_free(&comm2d);
MPI_Finalize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment