Skip to content

Commit

Permalink
fix(compiler): [DFR] initialize work function registry and runtime co…
Browse files Browse the repository at this point in the history
…ntext manager pointers outside of constructors.
  • Loading branch information
antoniupop committed Jun 21, 2024
1 parent 1879f9c commit f93611e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ struct RuntimeContextManager {
bool allocated = false;
bool lazy_key_transfer = false;

RuntimeContextManager(bool lazy = false) : lazy_key_transfer(lazy) {
context = nullptr;
_dfr_node_level_runtime_context_manager = this;
}
RuntimeContextManager(bool lazy = false)
: context(nullptr), lazy_key_transfer(lazy) {}

void setContext(void *ctx) {
assert(context == nullptr &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern WorkFunctionRegistry *_dfr_node_level_work_function_registry;
extern void *dl_handle;

struct WorkFunctionRegistry {
WorkFunctionRegistry() { _dfr_node_level_work_function_registry = this; }
WorkFunctionRegistry() = default;

wfnptr getWorkFunctionPointer(const std::string &name) {
std::lock_guard<std::mutex> guard(registry_guard);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ static inline void _dfr_start_impl(int argc, char *argv[]) {
is_root_node_p = (hpx::find_here() == hpx::find_root_locality());
num_nodes = hpx::get_num_localities().get();

new WorkFunctionRegistry();
_dfr_node_level_work_function_registry = new WorkFunctionRegistry();

char *env = getenv("DFR_LAZY_KEY_TRANSFER");
bool lazy = false;
Expand All @@ -329,7 +329,7 @@ static inline void _dfr_start_impl(int argc, char *argv[]) {
!strncmp(env, "On", 2) || !strncmp(env, "on", 2) ||
!strncmp(env, "1", 1))
lazy = true;
new RuntimeContextManager(lazy);
_dfr_node_level_runtime_context_manager = new RuntimeContextManager(lazy);

_dfr_jit_phase_barrier = new hpx::distributed::barrier(
"phase_barrier", num_nodes, hpx::get_locality_id());
Expand Down

0 comments on commit f93611e

Please sign in to comment.