Skip to content

Commit

Permalink
fixup! Merge branch 'cv/global-core-worker' into cv/task-arg-by-value
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Sep 1, 2023
1 parent b73ec24 commit ebb2ab4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Ray.jl/src/runtime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function prepare_task_args(args)
rpc_inline_threshold = ray_jll.task_rpc_inlined_bytes_limit(ray_config)
record_call_site = ray_jll.record_ref_creation_sites(ray_config)

rpc_address = ray_jll.GetRpcAddress(CORE_WORKER[])
rpc_address = ray_jll.GetRpcAddress(GetCoreWorker())

total_inlined = 0
task_args = StdVector{CxxPtr{ray_jll.TaskArg}}()
Expand Down
11 changes: 4 additions & 7 deletions deps/wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,7 @@ std::unordered_map<std::string, double> get_task_required_resources() {
return worker_context.GetCurrentTask()->GetRequiredResources().GetResourceUnorderedMap();
}

ray::core::CoreWorker &GetCoreWorker() {
return CoreWorkerProcess::GetCoreWorker();
}

// Work around CxxWrap's `push!` always dereferencing our value via `@cxxdereference`
void _push_back(std::vector<TaskArg *> &vector, TaskArg &el) {
vector.push_back(&el);
}
Expand Down Expand Up @@ -499,9 +496,6 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& mod)
return std::make_shared<LocalMemoryBuffer>(data, size, copy_data);
});

mod.method("put", &put);
mod.method("get", &get);

// message Address
// https://github.com/ray-project/ray/blob/ray-2.5.1/src/ray/protobuf/common.proto#L86
mod.add_type<rpc::Address>("Address")
Expand All @@ -524,6 +518,9 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& mod)
.method("GetRpcAddress", &ray::core::CoreWorker::GetRpcAddress);
mod.method("GetCoreWorker", &GetCoreWorker);

mod.method("put", &put);
mod.method("get", &get);

// message ObjectReference
// https://github.com/ray-project/ray/blob/ray-2.5.1/src/ray/protobuf/common.proto#L500
mod.add_type<rpc::ObjectReference>("ObjectReference");
Expand Down

0 comments on commit ebb2ab4

Please sign in to comment.