Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPI: add timeout for conf test for MPI DataPlane #3848

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions cmake/DetectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,11 @@ if(ADIOS2_USE_SST AND NOT WIN32)
endif()
endif()
if(ADIOS2_HAVE_MPI)
set(CMAKE_REQUIRED_LIBRARIES MPI::MPI_C)
include(CheckCSourceRuns)
check_c_source_runs([=[
set(CMAKE_REQUIRED_LIBRARIES "MPI::MPI_C;Threads::Threads")
include(CheckCXXSourceRuns)
check_cxx_source_runs([=[
#include <chrono>
#include <future>
#include <mpi.h>
#include <stdlib.h>

Expand All @@ -457,9 +459,18 @@ if(ADIOS2_USE_SST AND NOT WIN32)

int main()
{
// Timeout after 5 second
auto task = std::async(std::launch::async, []() {
std::this_thread::sleep_for(std::chrono::seconds(5));
exit(EXIT_FAILURE);
});

char* port_name = new char[MPI_MAX_PORT_NAME];
MPI_Init_thread(NULL, NULL, MPI_THREAD_MULTIPLE, NULL);
MPI_Open_port(MPI_INFO_NULL, malloc(sizeof(char) * MPI_MAX_PORT_NAME));
MPI_Open_port(MPI_INFO_NULL, port_name);
MPI_Close_port(port_name);
MPI_Finalize();
exit(EXIT_SUCCESS);
}]=]
ADIOS2_HAVE_MPI_CLIENT_SERVER)
unset(CMAKE_REQUIRED_LIBRARIES)
Expand Down
Loading