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

relaxes mpi checks for basic unsigned integers

parent 2a917404
No related branches found
No related tags found
No related merge requests found
Your MPI library does not correctly perform the reduce operations for the basic
unsigned integers (see https://github.com/pmodels/mpich/issues/6083). It is
recommended to switch to a version of MPI that is not affected with the issue.
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.
Your MPI library does not correctly perform the reduce operations for the fixed
width 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 <mpi.h>
// acx_mpi_job_count=2
int main(int argc, char **argv) {
// init mpi
MPI_Init(&argc, &argv);
int comm_rank, comm_size;
MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank);
MPI_Comm_size(MPI_COMM_WORLD, &comm_size);
if (comm_size != 2) {
fputs("wrong number of processes\n", stderr);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
}
if (comm_rank == 0) {
{
unsigned char send_data[2] = {0, UCHAR_MAX};
unsigned char recv_data[2] = {13, 13};
MPI_Reduce(
send_data, recv_data, 2, MPI_UNSIGNED_CHAR, MPI_MIN, 0, MPI_COMM_WORLD);
if ((recv_data[0] != 0) || (recv_data[1] != 0)) {
fprintf(
stderr, "ERROR in MPI_Reduce (MPI_UNSIGNED_CHAR): "
"recv_data = [%lu; %lu] (expected [0,0])\n",
recv_data[0], recv_data[1]);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
}
}
{
unsigned int send_data[2] = {0, UINT_MAX};
unsigned int recv_data[2] = {13, 13};
MPI_Reduce(
send_data, recv_data, 2, MPI_UNSIGNED, MPI_MIN, 0, MPI_COMM_WORLD);
if ((recv_data[0] != 0) || (recv_data[1] != 0)) {
fprintf(
stderr, "ERROR in MPI_Reduce (MPI_UNSIGNED): "
"recv_data = [%lu; %lu] (expected [0,0])\n",
recv_data[0], recv_data[1]);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
}
}
{
unsigned long send_data[2] = {0, ULONG_MAX};
unsigned long recv_data[2] = {13, 13};
MPI_Reduce(
send_data, recv_data, 2, MPI_UNSIGNED_LONG, MPI_MIN, 0, MPI_COMM_WORLD);
if ((recv_data[0] != 0) || (recv_data[1] != 0)) {
fprintf(
stderr, "ERROR in MPI_Reduce (MPI_UNSIGNED_LONG): "
"recv_data = [%lu; %lu] (expected [0,0])\n",
recv_data[0], recv_data[1]);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
}
}
} else {
{
unsigned char send_data[2] = {UCHAR_MAX, 0};
unsigned char recv_data[2] = {13, 13};
MPI_Reduce(
send_data, recv_data, 2, MPI_UNSIGNED_CHAR, MPI_MIN, 0, MPI_COMM_WORLD);
}
{
unsigned int send_data[2] = {UINT_MAX, 0};
unsigned int recv_data[2] = {13, 13};
MPI_Reduce(
send_data, recv_data, 2, MPI_UNSIGNED, MPI_MIN, 0, MPI_COMM_WORLD);
}
{
unsigned long send_data[2] = {ULONG_MAX, 0};
unsigned long recv_data[2] = {13, 13};
MPI_Reduce(
send_data, recv_data, 2, MPI_UNSIGNED_LONG, MPI_MIN, 0, MPI_COMM_WORLD);
}
}
// finalise mpi
MPI_Barrier(MPI_COMM_WORLD);
MPI_Finalize();
return EXIT_SUCCESS;
}
......@@ -23,20 +23,6 @@ int main(int argc, char **argv) {
if (comm_rank == 0) {
{
unsigned long send_data[2] = {0, ULONG_MAX};
unsigned long recv_data[2] = {13, 13};
MPI_Reduce(
send_data, recv_data, 2, MPI_UNSIGNED_LONG, MPI_MIN, 0, MPI_COMM_WORLD);
if ((recv_data[0] != 0) || (recv_data[1] != 0)) {
fprintf(
stderr, "ERROR in MPI_Reduce (MPI_UNSIGNED_LONG): "
"recv_data = [%lu; %lu] (expected [0,0])\n",
recv_data[0], recv_data[1]);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
}
}
{
uint8_t send_data[2] = {0, UINT8_MAX};
uint8_t recv_data[2] = {13, 13};
......@@ -82,12 +68,6 @@ int main(int argc, char **argv) {
} else {
{
unsigned long send_data[2] = {ULONG_MAX, 0};
unsigned long recv_data[2] = {13, 13};
MPI_Reduce(
send_data, recv_data, 2, MPI_UNSIGNED_LONG, MPI_MIN, 0, MPI_COMM_WORLD);
}
{
uint8_t send_data[2] = {UINT8_MAX, 0};
uint8_t recv_data[2] = {13, 13};
......@@ -106,6 +86,7 @@ int main(int argc, char **argv) {
MPI_Reduce(
send_data, recv_data, 2, MPI_UINT64_T, MPI_MIN, 0, MPI_COMM_WORLD);
}
}
// finalise mpi
......
......@@ -320,7 +320,13 @@ AS_VAR_IF([enable_mpi_checks], [yes],
[config/checksrc], [],
[ACX_LANG_MPI_CHECK_FAIL_MSG([yac_mpi_error],
[$acx_prog_mpi_test_file], [config/checkdoc])
AC_MSG_FAILURE([$yac_mpi_error])])],
AS_CASE([$acx_prog_mpi_test_file],
[*test_mpi_reduce_basic_unsigned*],
[AC_MSG_WARN([$yac_mpi_error
])
sleep 1],
[AC_MSG_FAILURE([$yac_mpi_error
])])])],
[AC_MSG_NOTICE([skipping MPI checks])])
TJ_FIND_TYPE([MPI_Fint], [], [[#include <mpi.h>]], [int long 'long long' short],
......
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