Skip to content

Commit

Permalink
feat(compiler): upgrade HPX library version to 1.9.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniupop committed Feb 23, 2024
1 parent 2f7d3ff commit da1f300
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 27 deletions.
4 changes: 2 additions & 2 deletions compilers/concrete-compiler/compiler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ KEYSETCACHEDEV=/tmp/KeySetCache
KEYSETCACHECI ?= ../KeySetCache
KEYSETCACHENAME ?= KeySetCacheV4

HPX_VERSION?=1.7.1
HPX_URL=https://github.com/STEllAR-GROUP/hpx/archive/refs/tags/$(HPX_VERSION).tar.gz
HPX_VERSION?=1.9.1
HPX_URL=https://github.com/STEllAR-GROUP/hpx/archive/refs/tags/v$(HPX_VERSION).tar.gz
HPX_TARBALL=$(shell pwd)/hpx-$(HPX_VERSION).tar.gz
HPX_LOCAL_DIR=$(shell pwd)/hpx-$(HPX_VERSION)
HPX_INSTALL_DIR?=$(HPX_LOCAL_DIR)/build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void dfr_create_async_task_impl(wfnptr wfn, void *ctx,
#include "concretelang/Runtime/generated/dfr_dataflow_inputs_cases.h"

default:
HPX_THROW_EXCEPTION(hpx::no_success, "_dfr_create_async_task",
HPX_THROW_EXCEPTION(hpx::error::no_success, "_dfr_create_async_task",
"Error: number of task parameters not supported.");
}

Expand Down Expand Up @@ -126,7 +126,7 @@ void dfr_create_async_task_impl(wfnptr wfn, void *ctx,
}

default:
HPX_THROW_EXCEPTION(hpx::no_success, "_dfr_create_async_task",
HPX_THROW_EXCEPTION(hpx::error::no_success, "_dfr_create_async_task",
"Error: number of task outputs not supported.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "concretelang/Runtime/runtime_api.h"
#include "concretelang/Runtime/workfunction_registry.hpp"

using namespace hpx::naming;
using namespace hpx::components;
using namespace hpx::collectives;

Expand All @@ -54,10 +53,10 @@ static inline void _dfr_checked_aligned_alloc(void **out, size_t align,
size_t size) {
int res = posix_memalign(out, align, size);
if (res == ENOMEM)
HPX_THROW_EXCEPTION(hpx::no_success, "DFR: memory allocation failed",
HPX_THROW_EXCEPTION(hpx::error::no_success, "DFR: memory allocation failed",
"Error: insufficient memory available.");
if (res == EINVAL)
HPX_THROW_EXCEPTION(hpx::no_success, "DFR: memory allocation failed",
HPX_THROW_EXCEPTION(hpx::error::no_success, "DFR: memory allocation failed",
"Error: invalid memory alignment.");
}

Expand Down Expand Up @@ -118,7 +117,7 @@ struct OpaqueInputData {
static_cast<StridedMemRefType<char, 1> *>(params[p])->data = data;
} break;
default:
HPX_THROW_EXCEPTION(hpx::no_success, "DFR: OpaqueInputData save",
HPX_THROW_EXCEPTION(hpx::error::no_success, "DFR: OpaqueInputData save",
"Error: invalid task argument type.");
}
}
Expand Down Expand Up @@ -151,7 +150,7 @@ struct OpaqueInputData {
mref.data + mref.offset * elementSize, size * elementSize);
} break;
default:
HPX_THROW_EXCEPTION(hpx::no_success, "DFR: OpaqueInputData save",
HPX_THROW_EXCEPTION(hpx::error::no_success, "DFR: OpaqueInputData save",
"Error: invalid task argument type.");
}
}
Expand Down Expand Up @@ -211,7 +210,7 @@ struct OpaqueOutputData {
static_cast<StridedMemRefType<char, 1> *>(outputs[p])->data = data;
} break;
default:
HPX_THROW_EXCEPTION(hpx::no_success, "DFR: OpaqueInputData save",
HPX_THROW_EXCEPTION(hpx::error::no_success, "DFR: OpaqueInputData save",
"Error: invalid task argument type.");
}
}
Expand All @@ -237,7 +236,7 @@ struct OpaqueOutputData {
mref.data + mref.offset * elementSize, size * elementSize);
} break;
default:
HPX_THROW_EXCEPTION(hpx::no_success, "DFR: OpaqueInputData save",
HPX_THROW_EXCEPTION(hpx::error::no_success, "DFR: OpaqueInputData save",
"Error: invalid task argument type.");
}
}
Expand All @@ -263,7 +262,8 @@ struct GenericComputeServer : component_base<GenericComputeServer> {
#include "concretelang/Runtime/generated/dfr_task_work_function_calls.h"

default:
HPX_THROW_EXCEPTION(hpx::no_success, "GenericComputeServer::execute_task",
HPX_THROW_EXCEPTION(hpx::error::no_success,
"GenericComputeServer::execute_task",
"Error: number of task outputs not supported.");
}

Expand All @@ -281,7 +281,7 @@ struct GenericComputeServer : component_base<GenericComputeServer> {
std::move(inputs.output_types));
}

HPX_DEFINE_COMPONENT_ACTION(GenericComputeServer, execute_task);
HPX_DEFINE_COMPONENT_ACTION(GenericComputeServer, execute_task)
};

} // namespace dfr
Expand Down Expand Up @@ -310,7 +310,7 @@ struct GenericComputeClient
typedef client_base<GenericComputeClient, GenericComputeServer> base_type;

GenericComputeClient() = default;
GenericComputeClient(id_type id) : base_type(std::move(id)) {}
GenericComputeClient(hpx::id_type id) : base_type(std::move(id)) {}

hpx::future<OpaqueOutputData> execute_task(const OpaqueInputData &inputs) {
typedef GenericComputeServer::execute_task_action action_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,8 @@ case 1: {
inputs.params[47], inputs.params[48], inputs.params[49]);
break;
default:
HPX_THROW_EXCEPTION(hpx::no_success, "GenericComputeServer::execute_task",
HPX_THROW_EXCEPTION(hpx::error::no_success,
"GenericComputeServer::execute_task",
"Error: number of task parameters not supported.");
}
outputs = {output1};
Expand Down Expand Up @@ -1050,7 +1051,8 @@ case 2: {
inputs.params[47], inputs.params[48], inputs.params[49]);
break;
default:
HPX_THROW_EXCEPTION(hpx::no_success, "GenericComputeServer::execute_task",
HPX_THROW_EXCEPTION(hpx::error::no_success,
"GenericComputeServer::execute_task",
"Error: number of task parameters not supported.");
}
outputs = {output1, output2};
Expand Down Expand Up @@ -1597,7 +1599,8 @@ case 3: {
inputs.params[49]);
break;
default:
HPX_THROW_EXCEPTION(hpx::no_success, "GenericComputeServer::execute_task",
HPX_THROW_EXCEPTION(hpx::error::no_success,
"GenericComputeServer::execute_task",
"Error: number of task parameters not supported.");
}
outputs = {output1, output2, output3};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ for i in $(eval echo {$1..$2}); do
wfn($outs$ins); break;"
done
echo " default:
HPX_THROW_EXCEPTION(hpx::no_success,
HPX_THROW_EXCEPTION(hpx::error::no_success,
\"GenericComputeServer::execute_task\",
\"Error: number of task parameters not supported.\");
}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct WorkFunctionRegistry {

auto ptr = dlsym(dl_handle, name.c_str());
if (ptr == nullptr) {
HPX_THROW_EXCEPTION(hpx::no_success,
HPX_THROW_EXCEPTION(hpx::error::no_success,
"WorkFunctionRegistry::getWorkFunctionPointer",
"Error recovering work function pointer from name.");
}
Expand Down
14 changes: 7 additions & 7 deletions compilers/concrete-compiler/compiler/lib/Runtime/DFRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ namespace concretelang {
namespace dfr {
namespace {
static std::vector<GenericComputeClient> gcc;
static hpx::lcos::barrier *_dfr_jit_phase_barrier;
static hpx::lcos::barrier *_dfr_startup_barrier;
static hpx::distributed::barrier *_dfr_jit_phase_barrier;
static hpx::distributed::barrier *_dfr_startup_barrier;
static size_t num_nodes = 0;
#if CONCRETELANG_TIMING_ENABLED
static struct timespec init_timer, broadcast_timer, compute_timer, whole_timer;
Expand Down Expand Up @@ -204,7 +204,7 @@ static uint64_t terminated = 2;
} // namespace mlir
static inline void _dfr_stop_impl() {
if (_dfr_is_root_node())
hpx::apply([]() { hpx::finalize(); });
hpx::post([]() { hpx::finalize(); });
hpx::stop();
exit(EXIT_SUCCESS);
}
Expand Down Expand Up @@ -317,10 +317,10 @@ static inline void _dfr_start_impl(int argc, char *argv[]) {

new WorkFunctionRegistry();
new RuntimeContextManager();
_dfr_jit_phase_barrier = new hpx::lcos::barrier("phase_barrier", num_nodes,
hpx::get_locality_id());
_dfr_startup_barrier = new hpx::lcos::barrier("startup_barrier", num_nodes,
hpx::get_locality_id());
_dfr_jit_phase_barrier = new hpx::distributed::barrier(
"phase_barrier", num_nodes, hpx::get_locality_id());
_dfr_startup_barrier = new hpx::distributed::barrier(
"startup_barrier", num_nodes, hpx::get_locality_id());

if (_dfr_is_root_node()) {
// Create compute server components on each node - from the root
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.hpx-env
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN ./bootstrap.sh && ./b2 --with-filesystem install
# Build HPX
RUN git clone https://github.com/STEllAR-GROUP/hpx.git /hpx
WORKDIR /hpx
RUN git checkout 1.7.1
RUN git checkout 1.9.1
RUN mkdir build
# empty HPX_WITH_MAX_CPU_COUNT = dynamic
# ref https://github.com/STEllAR-GROUP/hpx/blob/1.7.1/CMakeLists.txt#L759
Expand Down

0 comments on commit da1f300

Please sign in to comment.