Commit 50e6f7bc authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

making define check if RPC already defined

parent b44612df
......@@ -28,10 +28,15 @@ endpoint engine::self() const {
}
remote_procedure engine::define(const std::string& name) {
hg_id_t id = margo_register_name(m_mid, name.c_str(),
hg_bool_t flag;
hg_id_t id;
margo_registered_name(m_mid, name.c_str(), &id, &flag);
if(flag == HG_FALSE) {
id = margo_register_name(m_mid, name.c_str(),
process_buffer,
process_buffer,
nullptr);
}
return remote_procedure(*this, id);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment