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

Improve the MPI parcelport and change the zero-copy threshold to 8192 #6274

Merged
merged 1 commit into from
Jun 28, 2023
Merged
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
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,8 @@ endif()
hpx_option(
HPX_WITH_ZERO_COPY_SERIALIZATION_THRESHOLD
STRING
"The threshold in bytes to when perform zero copy optimizations (default: 128)"
"128"
"The threshold in bytes to when perform zero copy optimizations (default: 8192)"
"8192"
ADVANCED
)
hpx_add_config_define(
Expand Down
6 changes: 0 additions & 6 deletions cmake/toolchains/Cray.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ set(HPX_PARCELPORT_LIBFABRIC_WITH_LOGGING
OFF
CACHE BOOL "Libfabric parcelport logging on/off flag"
)
set(HPX_WITH_ZERO_COPY_SERIALIZATION_THRESHOLD
"4096"
CACHE
STRING
"The threshold in bytes to when perform zero copy optimizations (default: 128)"
)

# We do a cross compilation here ...
set(CMAKE_CROSSCOMPILING
Expand Down
6 changes: 0 additions & 6 deletions cmake/toolchains/CrayKNL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,6 @@ set(HPX_PARCELPORT_LIBFABRIC_WITH_LOGGING
OFF
CACHE BOOL "Libfabric parcelport logging on/off flag"
)
set(HPX_WITH_ZERO_COPY_SERIALIZATION_THRESHOLD
"4096"
CACHE
STRING
"The threshold in bytes to when perform zero copy optimizations (default: 128)"
)

# Set the TBBMALLOC_PLATFORM correctly so that find_package(TBBMalloc) sets the
# right hints
Expand Down
6 changes: 0 additions & 6 deletions cmake/toolchains/CrayKNLStatic.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ set(HPX_PARCELPORT_LIBFABRIC_WITH_LOGGING
OFF
CACHE BOOL "Libfabric parcelport logging on/off flag"
)
set(HPX_WITH_ZERO_COPY_SERIALIZATION_THRESHOLD
"4096"
CACHE
STRING
"The threshold in bytes to when perform zero copy optimizations (default: 128)"
)

# Set the TBBMALLOC_PLATFORM correctly so that find_package(TBBMalloc) sets the
# right hints
Expand Down
6 changes: 0 additions & 6 deletions cmake/toolchains/CrayStatic.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,3 @@ set(HPX_PARCELPORT_LIBFABRIC_WITH_LOGGING
OFF
CACHE BOOL "Libfabric parcelport logging on/off flag"
)
set(HPX_WITH_ZERO_COPY_SERIALIZATION_THRESHOLD
"4096"
CACHE
STRING
"The threshold in bytes to when perform zero copy optimizations (default: 128)"
)
2 changes: 2 additions & 0 deletions libs/core/mpi_base/include/hpx/mpi_base/mpi_environment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ namespace hpx::util {

using mutex_type = hpx::spinlock;

static int MPI_MAX_TAG;

private:
static mutex_type mtx_;

Expand Down
7 changes: 7 additions & 0 deletions libs/core/mpi_base/src/mpi_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
///////////////////////////////////////////////////////////////////////////////
namespace hpx::util {

int mpi_environment::MPI_MAX_TAG = 32767;

namespace detail {

bool detect_mpi_environment(
Expand Down Expand Up @@ -267,6 +269,11 @@ namespace hpx::util {

rtcfg.add_entry("hpx.parcel.mpi.rank", std::to_string(this_rank));
rtcfg.add_entry("hpx.parcel.mpi.processorname", get_processor_name());
void* max_tag_p;
int flag;
MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_TAG_UB, &max_tag_p, &flag);
if (flag)
MPI_MAX_TAG = *(int*) max_tag_p;
}

std::string mpi_environment::get_processor_name()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,6 @@ namespace hpx::parcelset::policies::lci {
data_ = header_buffer;
}

void reset() noexcept
{
if (data_ != nullptr)
{
free(data_);
}
}

bool valid() const noexcept
{
return data_ != nullptr && signature() == MAGIC_SIGNATURE;
Expand Down
Loading