Functional tests without MPI support (#343)
* Let functional tests build without external MPI * Fix error conditions when using uuid startup with internal MPI * Do not abort if libibverbs is not found but not using GDA * Enabled RO functional test initialized with TEST_UUID * Reduce load time for ro backend_can_run and prevent mpilib_dlclose crashing * Fix case TEST_UUID=1, ROCSHMEM_BACKEND='' (autoloading gda)
This commit is contained in:
committed by
GitHub
parent
baaf8091b5
commit
c99bc21e10
@@ -33,6 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
#include <thread> // NOLINT
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "rocshmem/rocshmem.hpp"
|
||||
#include "atomic_return.hpp"
|
||||
@@ -131,6 +132,19 @@ ROBackend::ROBackend(MPI_Comm comm)
|
||||
*done_init = 1;
|
||||
}
|
||||
|
||||
/* Currently we only check whether we can dlopen an MPI library.
|
||||
*/
|
||||
int ROBackend::backend_can_run() {
|
||||
auto handle = dlopen("libmpi.so", RTLD_LAZY);
|
||||
if (!handle) {
|
||||
printf("Could not open libmpi.so. Returning\n");
|
||||
return ROCSHMEM_ERROR;
|
||||
}
|
||||
//TODO dlsym MPI_Get_library_version and verify compat when HAVE_EXTERNAL_MPI is undef
|
||||
dlclose(handle);
|
||||
return ROCSHMEM_SUCCESS;
|
||||
}
|
||||
|
||||
void ROBackend::setup_ctxs() {
|
||||
CHECK_HIP(hipMalloc(&ctx_array, sizeof(ROContext) * envvar::max_num_contexts));
|
||||
for (size_t i = 0; i < envvar::max_num_contexts; i++) {
|
||||
|
||||
Reference in New Issue
Block a user