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

Implement rocshmem_g API and optimize memory usage #31

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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: 0 additions & 19 deletions src/ipc/backend_ipc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ IPCBackend::IPCBackend(MPI_Comm comm)
*/
assert(num_pes == ipcImpl.shm_size);

auto *bp{ipc_backend_proxy.get()};

bp->heap_ptr = &heap;

/* Initialize the host interface */
host_interface = std::make_shared<HostInterface>(hdp_proxy_.get(),
thread_comm,
Expand All @@ -85,10 +81,6 @@ IPCBackend::IPCBackend(MPI_Comm comm)

ROCSHMEM_HOST_CTX_DEFAULT.ctx_opaque = default_host_ctx.get();

init_g_ret(&heap, thread_comm, MAX_NUM_BLOCKS, &bp->g_ret);

allocate_atomic_region(&bp->atomic_ret, MAX_NUM_BLOCKS);

setup_team_world();

init_wrk_sync_buffer();
Expand All @@ -107,17 +99,6 @@ IPCBackend::IPCBackend(MPI_Comm comm)
}

IPCBackend::~IPCBackend() {
/*
* Validate that a handle was passed that is not a nullptr.
*/
auto *bp{ipc_backend_proxy.get()};
assert(bp);

/*
* Free the atomic_ret array.
*/
CHECK_HIP(hipFree(bp->atomic_ret->atomic_base_ptr));

/**
* Destroy teams infrastructure
* and team world
Expand Down
6 changes: 0 additions & 6 deletions src/ipc/backend_ipc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "../containers/free_list_impl.hpp"
#include "../hdp_proxy.hpp"
#include "../memory/hip_allocator.hpp"
#include "ipc_backend_proxy.hpp"
#include "../context_incl.hpp"
#include "ipc_context_proxy.hpp"
#include "../ipc_policy.hpp"
Expand Down Expand Up @@ -117,11 +116,6 @@ class IPCBackend : public Backend {
*/
char** get_wrk_sync_bases() { return Wrk_Sync_buffer_bases_; }

/**
* @brief Handle to device memory fields.
*/
IPCBackendProxyT ipc_backend_proxy{};

/**
* @brief The host-facing interface that will be used
* by all contexts of the IPCBackend
Expand Down
4 changes: 0 additions & 4 deletions src/ipc/context_ipc_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ __host__ IPCContext::IPCContext(Backend *b)
ipcImpl_.ipc_bases = b->ipcImpl.ipc_bases;
ipcImpl_.shm_size = b->ipcImpl.shm_size;

auto *bp{backend->ipc_backend_proxy.get()};

barrier_sync = backend->barrier_sync;
g_ret = bp->g_ret;
atomic_base_ptr = bp->atomic_ret->atomic_base_ptr;
fence_pool = backend->fence_pool;
Wrk_Sync_buffer_bases_ = backend->get_wrk_sync_bases();

Expand Down
4 changes: 0 additions & 4 deletions src/ipc/context_ipc_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,6 @@ class IPCContext : public Context {
//context class has IpcImpl object (ipcImpl_)
IpcImpl *ipcImpl{nullptr};

uint64_t* atomic_base_ptr{nullptr};

char* g_ret;

//internal functions used by collective operations
template <typename T>
__device__ void internal_broadcast(T *dest, const T *source, int nelems, int pe_root,
Expand Down
1 change: 1 addition & 0 deletions src/ipc/context_ipc_tmpl_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ __device__ void IPCContext::put_nbi(T *dest, const T *source, size_t nelems,
template <typename T>
__device__ T IPCContext::g(const T *source, int pe) {
T ret;
getmem(&ret, source, sizeof(T), pe);
return ret;
}

Expand Down
69 changes: 0 additions & 69 deletions src/ipc/ipc_backend_proxy.hpp

This file was deleted.