Skip to content

Commit

Permalink
Adding gasnet parcelport to CI builders
Browse files Browse the repository at this point in the history
- flyby: fixing various inspect, clang-format, etc. errors
  • Loading branch information
hkaiser committed Jul 13, 2023
1 parent 3286869 commit 876fb67
Show file tree
Hide file tree
Showing 20 changed files with 69 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .jenkins/lsu/env-clang-11.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module load boost/1.73.0-${build_type,,}
module load hwloc
module load openmpi
module load pwrapi/1.1.1
module load gasnet/2023.3.0

export HPXRUN_RUNWRAPPER=srun
export CXX_STD="17"
Expand All @@ -23,6 +24,7 @@ configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_MPI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_LCI=ON"
configure_extra_options+=" -DHPX_WITH_FETCH_LCI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_GASNET=ON"
configure_extra_options+=" -DHPX_WITH_LOGGING=OFF"

# The pwrapi library still needs to be set up properly on rostam
Expand Down
2 changes: 2 additions & 0 deletions .jenkins/lsu/env-clang-12.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module load boost/1.75.0-${build_type,,}
module load hwloc
module load openmpi
module load pwrapi/1.1.1
module load gasnet/2023.3.0

export HPXRUN_RUNWRAPPER=srun
export CXX_STD="20"
Expand All @@ -24,6 +25,7 @@ configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_MPI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_LCI=ON"
configure_extra_options+=" -DHPX_WITH_FETCH_LCI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_GASNET=ON"
configure_extra_options+=" -DHPX_WITH_LOGGING=OFF"

# The pwrapi library still needs to be set up properly on rostam
Expand Down
2 changes: 2 additions & 0 deletions .jenkins/lsu/env-clang-13.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module load boost/1.78.0-${build_type,,}
module load hwloc
module load openmpi
module load pwrapi/1.1.1
module load gasnet/2023.3.0

export HPXRUN_RUNWRAPPER=srun
export CXX_STD="17"
Expand All @@ -24,6 +25,7 @@ configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_MPI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_LCI=ON"
configure_extra_options+=" -DHPX_WITH_FETCH_LCI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_GASNET=ON"
configure_extra_options+=" -DHPX_WITH_LOGGING=OFF"

# The pwrapi library still needs to be set up properly on rostam
Expand Down
2 changes: 2 additions & 0 deletions .jenkins/lsu/env-clang-14.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module load boost/1.79.0-${build_type,,}
module load hwloc
module load openmpi
module load pwrapi/1.1.1
module load gasnet/2023.3.0

export HPXRUN_RUNWRAPPER=srun
export CXX_STD="20"
Expand All @@ -24,6 +25,7 @@ configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_MPI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_LCI=ON"
configure_extra_options+=" -DHPX_WITH_FETCH_LCI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_GASNET=ON"
configure_extra_options+=" -DHPX_WITH_LOGGING=OFF"
configure_extra_options+=" -DHPX_WITH_DATAPAR_BACKEND=EVE"
configure_extra_options+=" -DHPX_WITH_FETCH_EVE=ON"
Expand Down
2 changes: 2 additions & 0 deletions .jenkins/lsu/env-clang-15.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module load boost/1.82.0-${build_type,,}
module load hwloc
module load openmpi
module load pwrapi/1.1.1
module load gasnet/2023.3.0

export HPXRUN_RUNWRAPPER=srun
export CXX_STD="20"
Expand All @@ -24,6 +25,7 @@ configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_MPI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_LCI=ON"
configure_extra_options+=" -DHPX_WITH_FETCH_LCI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_GASNET=ON"
configure_extra_options+=" -DHPX_WITH_LOGGING=OFF"
configure_extra_options+=" -DHPX_WITH_DATAPAR_BACKEND=EVE"
configure_extra_options+=" -DHPX_WITH_FETCH_EVE=ON"
Expand Down
2 changes: 2 additions & 0 deletions .jenkins/lsu/env-gcc-10.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module load boost/1.75.0-${build_type,,}
module load hwloc
module load openmpi
module load pwrapi/1.1.1
module load gasnet/2023.3.0

export HPXRUN_RUNWRAPPER=srun
export CXX_STD="17"
Expand All @@ -24,6 +25,7 @@ configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_MPI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_LCI=ON"
configure_extra_options+=" -DHPX_WITH_FETCH_LCI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_GASNET=ON"

# The pwrapi library still needs to be set up properly on rostam
# configure_extra_options+=" -DHPX_WITH_POWER_COUNTER=ON"
2 changes: 2 additions & 0 deletions .jenkins/lsu/env-gcc-12.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module load boost/1.80.0-${build_type,,}
module load hwloc
module load openmpi
module load pwrapi/1.1.1
module load gasnet/2023.3.0

export HPXRUN_RUNWRAPPER=srun
export CXX_STD="20"
Expand All @@ -23,6 +24,7 @@ configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_MPI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_LCI=ON"
configure_extra_options+=" -DHPX_WITH_FETCH_LCI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_GASNET=ON"
configure_extra_options+=" -DHPX_WITH_DATAPAR_BACKEND=EVE"
configure_extra_options+=" -DHPX_WITH_FETCH_EVE=ON"
configure_extra_options+=" -DHPX_WITH_EVE_TAG=main"
Expand Down
2 changes: 2 additions & 0 deletions .jenkins/lsu/env-gcc-13.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module load boost/1.82.0-${build_type,,}
module load hwloc
module load openmpi
module load pwrapi/1.1.1
module load gasnet/2023.3.0

export HPXRUN_RUNWRAPPER=srun
export CXX_STD="20"
Expand All @@ -23,6 +24,7 @@ configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_MPI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_LCI=ON"
configure_extra_options+=" -DHPX_WITH_FETCH_LCI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_GASNET=ON"
configure_extra_options+=" -DHPX_WITH_DATAPAR_BACKEND=EVE"
configure_extra_options+=" -DHPX_WITH_FETCH_EVE=ON"
configure_extra_options+=" -DHPX_WITH_EVE_TAG=main"
Expand Down
2 changes: 2 additions & 0 deletions .jenkins/lsu/env-gcc-9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module load boost/1.73.0-${build_type,,}
module load hwloc
module load openmpi
module load pwrapi/1.1.1
module load gasnet/2023.3.0

export HPXRUN_RUNWRAPPER=srun
export CXX_STD="17"
Expand All @@ -23,6 +24,7 @@ configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_MPI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_LCI=ON"
configure_extra_options+=" -DHPX_WITH_FETCH_LCI=ON"
configure_extra_options+=" -DHPX_WITH_PARCELPORT_GASNET=ON"

# The pwrapi library still needs to be set up properly on rostam
# configure_extra_options+=" -DHPX_WITH_POWER_COUNTER=ON"
5 changes: 2 additions & 3 deletions cmake/HPX_SetupGasnet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ macro(hpx_setup_gasnet)
hpx_setup_mpi()
endif()

target_link_directories(hpx_core PUBLIC ${GASNET_LIBRARY_DIRS})

if(GASNET_CFLAGS)
set(IS_PARAM "0")
set(PARAM_FOUND "0")
Expand Down Expand Up @@ -542,7 +540,8 @@ macro(hpx_setup_gasnet)
PkgConfig::GASNET PROPERTIES INTERFACE_LINK_OPTIONS "${GASNET_LDFLAGS}"
)
set_target_properties(
PkgConfig::GASNET PROPERTIES INTERFACE_LINK_DIRECTORIES "${GASNET_LIBRARY_DIRS}"
PkgConfig::GASNET PROPERTIES INTERFACE_LINK_DIRECTORIES
"${GASNET_LIBRARY_DIRS}"
)

endif()
Expand Down
4 changes: 4 additions & 0 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ if(HPX_WITH_ITTNOTIFY)
target_link_libraries(hpx_core PUBLIC Amplifier::amplifier)
endif()

if(HPX_WITH_PARCELPORT_GASNET AND GASNET_LIBRARY_DIRS)
target_link_directories(hpx_core PUBLIC ${GASNET_LIBRARY_DIRS})
endif()

if(HPX_WITH_MODULES_AS_STATIC_LIBRARIES OR HPX_WITH_STATIC_LINKING)
target_link_libraries(hpx_core PUBLIC hpx_public_flags)
target_link_libraries(hpx_core PUBLIC hpx_base_libraries)
Expand Down
3 changes: 2 additions & 1 deletion libs/core/gasnet_base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ add_hpx_module(
SOURCES ${gasnet_base_sources}
HEADERS ${gasnet_base_headers}
DEPENDENCIES PkgConfig::GASNET ${gasnet_additional_dependencies}
MODULE_DEPENDENCIES hpx_logging hpx_runtime_configuration hpx_util
MODULE_DEPENDENCIES hpx_logging hpx_runtime_configuration hpx_string_util
hpx_util
CMAKE_SUBDIRS examples tests
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <hpx/synchronization/mutex.hpp>
#include <hpx/synchronization/spinlock.hpp>

#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <string>

Expand Down
54 changes: 28 additions & 26 deletions libs/core/gasnet_base/src/gasnet_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <hpx/config.hpp>

#include <hpx/assert.hpp>
#include <hpx/modules/gasnet_base.hpp>
#include <hpx/modules/logging.hpp>
#include <hpx/modules/runtime_configuration.hpp>
#include <hpx/modules/string_util.hpp>
#include <hpx/modules/util.hpp>
#include <hpx/thread.hpp>

#include <boost/tokenizer.hpp>

#include <atomic>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <string>
Expand Down Expand Up @@ -48,18 +49,24 @@ typedef struct
static inline gasnet_handlerarg_t get_arg_from_ptr0(uintptr_t addr)
{
// This one returns the bottom 32 bits.
return ((gasnet_handlerarg_t)((((uint64_t)(addr)) << 32UL) >> 32UL));
// clang-format off
return ((gasnet_handlerarg_t) ((((uint64_t) (addr)) << 32UL) >> 32UL));
// clang-format on
}
static inline gasnet_handlerarg_t get_arg_from_ptr1(uintptr_t addr)
{
// this one returns the top 32 bits.
return ((gasnet_handlerarg_t)(((uint64_t)(addr)) >> 32UL));
// clang-format off
return ((gasnet_handlerarg_t) (((uint64_t) (addr)) >> 32UL));
// clang-format on
}
static inline uintptr_t get_uintptr_from_args(
gasnet_handlerarg_t a0, gasnet_handlerarg_t a1)
{
return (uintptr_t)(
((uint64_t)(uint32_t) a0) | (((uint64_t)(uint32_t) a1) << 32UL));
// clang-format off
return (uintptr_t) (((uint64_t) (uint32_t) a0) |
(((uint64_t) (uint32_t) a1) << 32UL));
// clang-format on
}
static inline void* get_ptr_from_args(
gasnet_handlerarg_t a0, gasnet_handlerarg_t a1)
Expand Down Expand Up @@ -136,7 +143,7 @@ static void AM_reply_put(gasnet_token_t token, void* buf, size_t nbytes)
{
xfer_info_t* x = static_cast<xfer_info_t*>(buf);

assert(nbytes == sizeof(xfer_info_t));
HPX_ASSERT(nbytes == sizeof(xfer_info_t));

GASNET_Safe(gasnet_AMReplyLong2(token, SIGNAL_LONG, x->src, x->size, x->tgt,
Arg0(x->ack), Arg1(x->ack)));
Expand Down Expand Up @@ -203,7 +210,7 @@ static inline void wait_done_obj(done_t* done, bool do_yield)
}

///////////////////////////////////////////////////////////////////////////////
namespace hpx { namespace util {
namespace hpx::util {

namespace detail {

Expand All @@ -213,9 +220,8 @@ namespace hpx { namespace util {
std::string gasnet_environment_strings =
cfg.get_entry("hpx.parcel.gasnet.env", default_env);

boost::char_separator<char> sep(";,: ");
boost::tokenizer<boost::char_separator<char>> tokens(
gasnet_environment_strings, sep);
hpx::string_util::char_separator<char> sep(";,: ");
hpx::string_util::tokenizer tokens(gasnet_environment_strings, sep);
for (auto const& tok : tokens)
{
char* env = std::getenv(tok.c_str());
Expand All @@ -238,7 +244,7 @@ namespace hpx { namespace util {
bool gasnet_environment::check_gasnet_environment(
util::runtime_configuration const& cfg)
{
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_MODULE_GASNET_BASE))
#if defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_MODULE_GASNET_BASE)
// We disable the GASNET parcelport if any of these hold:
//
// - The parcelport is explicitly disabled
Expand All @@ -259,13 +265,15 @@ namespace hpx { namespace util {
}

return true;
#else
return false;
#endif
}
}} // namespace hpx::util
} // namespace hpx::util

#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_MODULE_GASNET_BASE))

namespace hpx { namespace util {
namespace hpx::util {

hpx::spinlock gasnet_environment::pollingLock{};
hpx::mutex gasnet_environment::dshm_mut{};
Expand Down Expand Up @@ -379,10 +387,8 @@ namespace hpx { namespace util {

enabled_ = false;

int msglen = 0;
char message[1024 + 1];
std::snprintf(message, 1024 + 1, "%s\n", gasnet_ErrorDesc(retval));
msglen = strnlen(message, 1025 + 1);

std::string msg("gasnet_environment::init: gasnet_init failed: ");
msg = msg + message + ".";
Expand Down Expand Up @@ -477,8 +483,6 @@ namespace hpx { namespace util {
for (start = 0; start < size; start += max_chunk)
{
size_t this_size;
void* addr_chunk;
void* raddr_chunk;
done_t done;

this_size = size - start;
Expand All @@ -487,8 +491,8 @@ namespace hpx { namespace util {
this_size = max_chunk;
}

addr_chunk = ((char*) addr) + start;
raddr_chunk = ((char*) raddr) + start;
void* addr_chunk = addr + start;
void* raddr_chunk = raddr + start;

init_done_obj(&done, 1);

Expand All @@ -507,8 +511,6 @@ namespace hpx { namespace util {
void gasnet_environment::get(std::uint8_t* addr, const int node,
std::uint8_t* raddr, const std::size_t size)
{
bool remote_in_segment = false;

if (rank() == node)
{
std::memmove(addr, raddr, size);
Expand All @@ -525,7 +527,7 @@ namespace hpx { namespace util {
// In other words, it is OK if the local side of a GET or PUT
// is not in the registered memory region.
//
remote_in_segment = gettable(node, raddr, size);
bool remote_in_segment = gettable(node, raddr, size);

if (remote_in_segment)
{
Expand Down Expand Up @@ -585,7 +587,7 @@ namespace hpx { namespace util {

info.ack = &done;
info.tgt = local_buf ? local_buf : addr_chunk;
info.src = ((char*) raddr) + start;
info.src = raddr + start;
info.size = this_size;

// Send an AM over to ask for a PUT back to us
Expand Down Expand Up @@ -691,6 +693,6 @@ namespace hpx { namespace util {
mtx_.unlock();
}
}
}} // namespace hpx::util
} // namespace hpx::util

#endif
6 changes: 3 additions & 3 deletions libs/core/version/src/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ namespace hpx {
}
#endif

#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_GASNET)) || \
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_GASNET)) || \
defined(HPX_HAVE_MODULE_GASNET_BASE)
std::string gasnet_version()
{
Expand Down Expand Up @@ -304,7 +304,7 @@ namespace hpx {
defined(HPX_HAVE_MODULE_LCI_BASE)
" LCI: {}\n"
#endif
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_GASNET)) || \
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_GASNET)) || \
defined(HPX_HAVE_MODULE_GASNET_BASE)
" GASNET: {}\n"
#endif
Expand All @@ -324,7 +324,7 @@ namespace hpx {
defined(HPX_HAVE_MODULE_LCI_BASE)
lci_version(),
#endif
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_GASNET)) || \
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_GASNET)) || \
defined(HPX_HAVE_MODULE_GASNET_BASE)
gasnet_version(),
#endif
Expand Down
Loading

0 comments on commit 876fb67

Please sign in to comment.