Skip to content
Snippets Groups Projects
Commit 266e10cf authored by Sergey Kosukhin's avatar Sergey Kosukhin Committed by Moritz Hanke
Browse files

adds configure-time check for the MPI reduce problem

parent 60a20dbb
No related branches found
No related tags found
No related merge requests found
Your MPI library does not correctly perform the reduce operations for unsigned
integers (see https://github.com/pmodels/mpich/issues/6083). It is strongly
recommended to switch to a version of MPI that is not affected with the issue.
Alternatively, you can disable this test with the configure argument
"--disable-mpi-checks" but this might result into a non-working YAC build.
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <inttypes.h>
#include <mpi.h>
// acx_mpi_job_count=2
int main(int argc, char **argv) {
// init mpi
......@@ -29,7 +32,7 @@ int main(int argc, char **argv) {
if ((recv_data[0] != 0) || (recv_data[1] != 0)) {
fprintf(
stderr, "ERROR in MPI_Reduce (MPI_UNSIGNED_LONG): "
"recv_data = [%zu; %zu] (expected [0,0])\n",
"recv_data = [%lu; %lu] (expected [0,0])\n",
recv_data[0], recv_data[1]);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
}
......@@ -43,7 +46,7 @@ int main(int argc, char **argv) {
if ((recv_data[0] != 0) || (recv_data[1] != 0)) {
fprintf(
stderr, "ERROR in MPI_Reduce (MPI_UINT8_T): "
"recv_data = [%zu; %zu] (expected [0,0])\n",
"recv_data = [%"PRIu8"; %"PRIu8"] (expected [0,0])\n",
recv_data[0], recv_data[1]);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
}
......@@ -57,7 +60,7 @@ int main(int argc, char **argv) {
if ((recv_data[0] != 0) || (recv_data[1] != 0)) {
fprintf(
stderr, "ERROR in MPI_Reduce (MPI_UINT32_T): "
"recv_data = [%zu; %zu] (expected [0,0])\n",
"recv_data = [%"PRIu32"; %"PRIu32"] (expected [0,0])\n",
recv_data[0], recv_data[1]);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
}
......@@ -71,7 +74,7 @@ int main(int argc, char **argv) {
if ((recv_data[0] != 0) || (recv_data[1] != 0)) {
fprintf(
stderr, "ERROR in MPI_Reduce (MPI_UINT64_T): "
"recv_data = [%zu; %zu] (expected [0,0])\n",
"recv_data = [%"PRIu64"; %"PRIu64"] (expected [0,0])\n",
recv_data[0], recv_data[1]);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
}
......
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