e167f50803
* relax MPI dependency from code
This commit (series) removes the strict dependency on MPI in code base.
rocSHMEM will still be compiled with MPI, but the goal is to make the
code work even if MPI_Init_thread has not been invoked, at least for
certain, well-defined scenarios. Hence, the goal is not remove any
mentioning of MPI from rocSHMEM, but to ensure correct execution of the
ipc conduit even if the library has been initialized using other means.
Details:
- add non-MPI version of remote_heap and WindowInfo classes
- host interfaces work on WindowInfoMPI, they will not work with the
non-MPI code path. Since it is unclear whether we plan to support the
host interfaces at all, this is probably not a major limitation.
* update symmetric_heap structures and backend
* first cut on initialization
and enabling non-MPI initialization of the IPCBackend
* add non-MPI hostInterface methods
at the moment, only barrier_all and sync_all are explicitely supported.
* add non-mpi version of ipc_policy
and a number of smaller fixes required in other files.
A small init/finalize test already passes now with the branch.
* add non-mpi team_split_strided code
* minor fixes for non-MPI use-case
* disable symmetric-heap-window-ionfo test
disable this test for now just to make the compilation pass. Will have
to rework it.
* make no-mpi great again
after rebasing on top of the MPI singleton changes.
* enable running functional tests with uuid init
to run the functional tests using rocshmem_init_attr and the uuid
mechanism requires
a) a PMIx installation on the system
b) setting the environment variable ROCSHMEM_TEST_UUID=1
* fix multi-team creation bug
fix a bug occuring when creating many teams, which was the result of
incorrectly applying two indices in our own implementation of Allreduce.
* make unit tests pass again
* reverse offload was impacted by code change
fix the RO conduit to cope wioth the non-MPI path introduced for the IPC
conduit.
* update to cmake logic to find pmix
* Update src/memory/window_info.hpp
Co-authored-by: Yiltan <ytemucin@amd.com>
* Update CMakeLists.txt
Co-authored-by: Yiltan <ytemucin@amd.com>
* document ROCSHMEM_UNIQUEID_NO_MPI
* rename env. variable to UNIQUEID_WITH_MPI
* update host.cpp to use USE_HDP_FLUSH macro
instead of the deprecated USE_COHERENT_HEAP.
* add note for running example with RO conduit
add a note clarifying that running init_attr_test from the example
directory requires setting an additional environment variable with the
RO conduit.
* Find PMIx in more cases, only apply pmix build options to the test that
needs it, if OMPI_COMM_WORLD_LOCA_RANK is not setenv, abort
---------
Co-authored-by: Yiltan <ytemucin@amd.com>
Co-authored-by: Aurelien Bouteiller <abouteil@amd.com>
[ROCm/rocshmem commit: 6ea5edc951]
105 строки
3.6 KiB
C++
105 строки
3.6 KiB
C++
/******************************************************************************
|
|
* Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
* of this software and associated documentation files (the "Software"), to
|
|
* deal in the Software without restriction, including without limitation the
|
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
* sell copies of the Software, and to permit persons to whom the Software is
|
|
* furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
* IN THE SOFTWARE.
|
|
*****************************************************************************/
|
|
|
|
#include "context_ro_host.hpp"
|
|
|
|
#include <mpi.h>
|
|
|
|
#include "rocshmem_config.h" // NOLINT(build/include_subdir)
|
|
#include "../backend_type.hpp"
|
|
#include "../context_incl.hpp"
|
|
#include "../host/host.hpp"
|
|
#include "backend_ro.hpp"
|
|
|
|
namespace rocshmem {
|
|
|
|
__host__ ROHostContext::ROHostContext(Backend *backend, long options)
|
|
: Context(backend, true) {
|
|
ROBackend *b{static_cast<ROBackend *>(backend)};
|
|
|
|
host_interface = b->host_interface;
|
|
|
|
context_window_info = dynamic_cast<WindowInfoMPI*>(host_interface->acquire_window_context());
|
|
}
|
|
|
|
__host__ ROHostContext::~ROHostContext() {
|
|
// host_interface->release_window_context(context_window_info);
|
|
}
|
|
|
|
__host__ void ROHostContext::putmem_nbi(void *dest, const void *source,
|
|
size_t nelems, int pe) {
|
|
DPRINTF("Function: ro_net_host_putmem_nbi\n");
|
|
|
|
host_interface->putmem_nbi(dest, source, nelems, pe, context_window_info);
|
|
}
|
|
|
|
__host__ void ROHostContext::getmem_nbi(void *dest, const void *source,
|
|
size_t nelems, int pe) {
|
|
DPRINTF("Function: ro_net_host_getmem_nbi\n");
|
|
|
|
host_interface->getmem_nbi(dest, source, nelems, pe, context_window_info);
|
|
}
|
|
|
|
__host__ void ROHostContext::putmem(void *dest, const void *source,
|
|
size_t nelems, int pe) {
|
|
DPRINTF("Function: ro_net_host_putmem\n");
|
|
|
|
host_interface->putmem(dest, source, nelems, pe, context_window_info);
|
|
}
|
|
|
|
__host__ void ROHostContext::getmem(void *dest, const void *source,
|
|
size_t nelems, int pe) {
|
|
DPRINTF("Function: ro_net_host_getmem\n");
|
|
|
|
host_interface->getmem(dest, source, nelems, pe, context_window_info);
|
|
}
|
|
|
|
__host__ void ROHostContext::fence() {
|
|
DPRINTF("Function: ro_net_host_fence\n");
|
|
|
|
host_interface->fence(context_window_info);
|
|
}
|
|
|
|
__host__ void ROHostContext::quiet() {
|
|
DPRINTF("Function: ro_net_host_quiet\n");
|
|
|
|
host_interface->quiet(context_window_info);
|
|
}
|
|
|
|
__host__ void ROHostContext::sync_all() {
|
|
DPRINTF("Function: ro_net_host_sync_all\n");
|
|
|
|
host_interface->sync_all(context_window_info);
|
|
}
|
|
|
|
__host__ void ROHostContext::barrier_all() {
|
|
DPRINTF("Function: ro_net_host_barrier_all\n");
|
|
|
|
host_interface->fence(context_window_info);
|
|
|
|
host_interface->barrier_for_sync();
|
|
}
|
|
|
|
} // namespace rocshmem
|