Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
5 changes: 3 additions & 2 deletions include/oomph/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#pragma once

#include <hwmalloc/config.hpp>
#include <hwmalloc/heap_config.hpp>
#include <hwmalloc/device.hpp>
#include <oomph/config.hpp>
#include <oomph/message_buffer.hpp>
Expand Down Expand Up @@ -41,8 +42,8 @@ class context
std::unique_ptr<schedule> m_schedule;

public:
context(MPI_Comm comm, bool thread_safe = true, bool message_pool_never_free = false,
std::size_t message_pool_reserve = 1);
context(MPI_Comm comm, bool thread_safe = true,
hwmalloc::heap_config const& = hwmalloc::get_default_heap_config());

context(context const&) = delete;

Expand Down
5 changes: 3 additions & 2 deletions src/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <hwmalloc/numa.hpp>
#include <hwmalloc/heap_config.hpp>
#include <oomph/config.hpp>

// paths relative to backend
Expand All @@ -24,9 +25,9 @@ namespace oomph
{

context::context(MPI_Comm comm, bool thread_safe, //unsigned int num_tag_ranges,
bool message_pool_never_free, std::size_t message_pool_reserve)
hwmalloc::heap_config const& heap_config)
: m_mpi_comm{comm}
, m(m_mpi_comm.get(), thread_safe, message_pool_never_free, message_pool_reserve)
, m(m_mpi_comm.get(), thread_safe, heap_config)
, m_schedule{std::make_unique<schedule>()}
//, m_tag_range_factory(num_tag_ranges, m->num_tag_bits())
{
Expand Down
9 changes: 6 additions & 3 deletions src/libfabric/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#include <cstdint>
//
#include <boost/thread.hpp>

#include <hwmalloc/heap_config.hpp>

// paths relative to backend
#include <oomph_libfabric_defines.hpp>
#include <controller.hpp>
Expand All @@ -23,10 +26,10 @@ static NS_DEBUG::enable_print<false> src_deb("__SRC__");

using controller_type = libfabric::controller;

context_impl::context_impl(MPI_Comm comm, bool thread_safe, bool message_pool_never_free,
std::size_t message_pool_reserve)
context_impl::context_impl(MPI_Comm comm, bool thread_safe,
hwmalloc::heap_config const& heap_config)
: context_base(comm, thread_safe)
, m_heap{this, message_pool_never_free, message_pool_reserve}
, m_heap{this, heap_config}
, m_recv_cb_queue(128)
, m_recv_cb_cancel(8)
{
Expand Down
4 changes: 2 additions & 2 deletions src/libfabric/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <stack>

#include <hwmalloc/heap.hpp>
#include <hwmalloc/heap_config.hpp>
#include <hwmalloc/register.hpp>

#include <oomph/config.hpp>
Expand Down Expand Up @@ -59,8 +60,7 @@ class context_impl : public context_base
callback_queue m_recv_cb_cancel;

public:
context_impl(MPI_Comm comm, bool thread_safe, bool message_pool_never_free,
std::size_t message_pool_reserve);
context_impl(MPI_Comm comm, bool thread_safe, hwmalloc::heap_config const& heap_config);
context_impl(context_impl const&) = delete;
context_impl(context_impl&&) = delete;

Expand Down
7 changes: 4 additions & 3 deletions src/mpi/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*/
#pragma once

#include <hwmalloc/heap_config.hpp>

#include <oomph/config.hpp>

// paths relative to backend
Expand All @@ -34,10 +36,9 @@ class context_impl : public context_base
shared_request_queue m_req_queue;

public:
context_impl(MPI_Comm comm, bool thread_safe, bool message_pool_never_free,
std::size_t message_pool_reserve)
context_impl(MPI_Comm comm, bool thread_safe, hwmalloc::heap_config const& heap_config)
: context_base(comm, thread_safe)
, m_heap{this, message_pool_never_free, message_pool_reserve}
, m_heap{this, heap_config}
//, m_rma_context{m_mpi_comm}
{
// get largest allowed tag value
Expand Down
7 changes: 4 additions & 3 deletions src/ucx/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include <boost/lockfree/queue.hpp>

#include <hwmalloc/heap_config.hpp>

#include <oomph/context.hpp>

// paths relative to backend
Expand Down Expand Up @@ -74,15 +76,14 @@ class context_impl : public context_base
friend struct worker_t;

public: // ctors
context_impl(MPI_Comm mpi_c, bool thread_safe, bool message_pool_never_free,
std::size_t message_pool_reserve)
context_impl(MPI_Comm mpi_c, bool thread_safe, hwmalloc::heap_config const& heap_config)
: context_base(mpi_c, thread_safe)
#if defined OOMPH_UCX_USE_PMI
, m_db(address_db_pmi(context_base::m_mpi_comm))
#else
, m_db(address_db_mpi(context_base::m_mpi_comm))
#endif
, m_heap{this, message_pool_never_free, message_pool_reserve}
, m_heap{this, heap_config}
, m_rma_context()
, m_recv_req_queue(128)
, m_cancel_recv_req_queue(128)
Expand Down
Loading