diff --git a/Ray.jl/src/runtime.jl b/Ray.jl/src/runtime.jl index f045a371..e05b6f78 100644 --- a/Ray.jl/src/runtime.jl +++ b/Ray.jl/src/runtime.jl @@ -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}}() diff --git a/deps/wrapper.cc b/deps/wrapper.cc index 4c4dbcee..c4f10425 100644 --- a/deps/wrapper.cc +++ b/deps/wrapper.cc @@ -353,10 +353,7 @@ std::unordered_map 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 &vector, TaskArg &el) { vector.push_back(&el); } @@ -499,9 +496,6 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& mod) return std::make_shared(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("Address") @@ -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("ObjectReference");