From: Martin Quinson Date: Thu, 6 Jul 2017 14:36:42 +0000 (+0200) Subject: please sonar: remove an unused parameters down below X-Git-Tag: v3_17~433 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a784ea0b57101613a92e9fe1403d224e7ea4d501 please sonar: remove an unused parameters down below Also: fix jedule build (sorry for mixing) --- diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 9f51fd57fd..287817dea3 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -250,8 +250,8 @@ simcall_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, siz void (*copy_data_fun)(smx_activity_t, void*, size_t), void* data, double rate); XBT_PUBLIC(smx_activity_t) -simcall_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, - int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*), void* data); +simcall_comm_iprobe(smx_mailbox_t mbox, int type, int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*), + void* data); XBT_PUBLIC(void) simcall_comm_cancel(smx_activity_t comm); /* FIXME: waitany is going to be a vararg function, and should take a timeout */ diff --git a/src/instr/jedule/jedule_platform.cpp b/src/instr/jedule/jedule_platform.cpp index c5e6b32dd3..5109fd7dc5 100644 --- a/src/instr/jedule/jedule_platform.cpp +++ b/src/instr/jedule/jedule_platform.cpp @@ -59,15 +59,15 @@ void Container::addResources(std::vector hosts) void Container::createHierarchy(sg_netzone_t from_as) { - if (from_as->children()->empty()) { + if (from_as->getChildren()->empty()) { // I am no AS // add hosts to jedule platform std::vector table; - from_as->hosts(&table); + from_as->getHosts(&table); this->addResources(table); } else { - for (auto nz : *from_as->children()) { - jed_container_t child_container = new simgrid::jedule::Container(std::string(nz->name())); + for (auto nz : *from_as->getChildren()) { + jed_container_t child_container = new simgrid::jedule::Container(std::string(nz->getCname())); this->addChild(child_container); child_container->createHierarchy(nz); } diff --git a/src/instr/jedule/jedule_sd_binding.cpp b/src/instr/jedule/jedule_sd_binding.cpp index 7bd6543ad5..c157f2bc06 100644 --- a/src/instr/jedule/jedule_sd_binding.cpp +++ b/src/instr/jedule/jedule_sd_binding.cpp @@ -28,12 +28,12 @@ void jedule_log_sd_event(SD_task_t task) void jedule_sd_init() { - sg_netzone_t root_comp = simgrid::s4u::Engine::instance()->netRoot(); - XBT_DEBUG("root name %s\n", root_comp->name()); + sg_netzone_t root_comp = simgrid::s4u::Engine::getInstance()->getNetRoot(); + XBT_DEBUG("root name %s\n", root_comp->getCname()); my_jedule = new simgrid::jedule::Jedule(); - jed_container_t root_container = new simgrid::jedule::Container(std::string(root_comp->name())); + jed_container_t root_container = new simgrid::jedule::Container(std::string(root_comp->getCname())); root_container->createHierarchy(root_comp); my_jedule->root_container = root_container; } diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index fa7ef5b3ca..c05655a657 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -391,12 +391,12 @@ smx_activity_t simcall_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void /** * \ingroup simix_comm_management */ -smx_activity_t simcall_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, +smx_activity_t simcall_comm_iprobe(smx_mailbox_t mbox, int type, int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*), void* data) { xbt_assert(mbox, "No rendez-vous point defined for iprobe"); - return simcall_BODY_comm_iprobe(mbox, type, src, tag, match_fun, data); + return simcall_BODY_comm_iprobe(mbox, type, match_fun, data); } /** diff --git a/src/simix/popping_accessors.h b/src/simix/popping_accessors.h index 76cf97b3e6..541c4712f5 100644 --- a/src/simix/popping_accessors.h +++ b/src/simix/popping_accessors.h @@ -516,53 +516,29 @@ static inline void simcall_comm_iprobe__set__type(smx_simcall_t simcall, int arg { simgrid::simix::marshal(simcall->args[1], arg); } -static inline int simcall_comm_iprobe__get__src(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args[2]); -} -static inline int simcall_comm_iprobe__getraw__src(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args[2]); -} -static inline void simcall_comm_iprobe__set__src(smx_simcall_t simcall, int arg) -{ - simgrid::simix::marshal(simcall->args[2], arg); -} -static inline int simcall_comm_iprobe__get__tag(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args[3]); -} -static inline int simcall_comm_iprobe__getraw__tag(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args[3]); -} -static inline void simcall_comm_iprobe__set__tag(smx_simcall_t simcall, int arg) -{ - simgrid::simix::marshal(simcall->args[3], arg); -} static inline simix_match_func_t simcall_comm_iprobe__get__match_fun(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[4]); + return simgrid::simix::unmarshal(simcall->args[2]); } static inline simix_match_func_t simcall_comm_iprobe__getraw__match_fun(smx_simcall_t simcall) { - return simgrid::simix::unmarshal_raw(simcall->args[4]); + return simgrid::simix::unmarshal_raw(simcall->args[2]); } static inline void simcall_comm_iprobe__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) { - simgrid::simix::marshal(simcall->args[4], arg); + simgrid::simix::marshal(simcall->args[2], arg); } static inline void* simcall_comm_iprobe__get__data(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[5]); + return simgrid::simix::unmarshal(simcall->args[3]); } static inline void* simcall_comm_iprobe__getraw__data(smx_simcall_t simcall) { - return simgrid::simix::unmarshal_raw(simcall->args[5]); + return simgrid::simix::unmarshal_raw(simcall->args[3]); } static inline void simcall_comm_iprobe__set__data(smx_simcall_t simcall, void* arg) { - simgrid::simix::marshal(simcall->args[5], arg); + simgrid::simix::marshal(simcall->args[3], arg); } static inline boost::intrusive_ptr simcall_comm_iprobe__get__result(smx_simcall_t simcall) @@ -1765,8 +1741,8 @@ simcall_HANDLER_execution_wait(smx_simcall_t simcall, boost::intrusive_ptr execution); XBT_PRIVATE smx_actor_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_actor_t process); XBT_PRIVATE boost::intrusive_ptr -simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, int src, int tag, - simix_match_func_t match_fun, void* data); +simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, simix_match_func_t match_fun, + void* data); XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout); XBT_PRIVATE boost::intrusive_ptr simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, diff --git a/src/simix/popping_bodies.cpp b/src/simix/popping_bodies.cpp index e1fb759745..fb5b80dcdc 100644 --- a/src/simix/popping_bodies.cpp +++ b/src/simix/popping_bodies.cpp @@ -148,12 +148,13 @@ inline static smx_actor_t simcall_BODY_process_restart(smx_actor_t process) { } inline static boost::intrusive_ptr - simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data) + simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data) { /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_comm_iprobe(&SIMIX_process_self()->simcall, mbox, type, src, tag, match_fun, data); - return simcall, smx_mailbox_t, int, int, int, - simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, src, tag, match_fun, data); + if (0) + simcall_HANDLER_comm_iprobe(&SIMIX_process_self()->simcall, mbox, type, match_fun, data); + return simcall, smx_mailbox_t, int, + simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, match_fun, data); } inline static void simcall_BODY_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) { diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index 654a8c46d0..da1b8b47c7 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -178,10 +178,8 @@ case SIMCALL_COMM_IPROBE: simgrid::simix::marshal>( simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), - simgrid::simix::unmarshal(simcall->args[2]), - simgrid::simix::unmarshal(simcall->args[3]), - simgrid::simix::unmarshal(simcall->args[4]), - simgrid::simix::unmarshal(simcall->args[5]))); + simgrid::simix::unmarshal(simcall->args[2]), + simgrid::simix::unmarshal(simcall->args[3]))); SIMIX_simcall_answer(simcall); break; diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index cdf2d15664..f015038774 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -53,7 +53,7 @@ void process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void void process_auto_restart_set(smx_actor_t process, int auto_restart) [[nohandler]]; smx_actor_t process_restart(smx_actor_t process); -boost::intrusive_ptr comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data); +boost::intrusive_ptr comm_iprobe(smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data); void comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) [[block]]; boost::intrusive_ptr comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached); void comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) [[block]]; diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index 2d5a76a944..7975425ad0 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -247,14 +247,14 @@ SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void* dst_buff, size_ return other_comm; } -smx_activity_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, int src, int tag, +smx_activity_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data) { - return SIMIX_comm_iprobe(simcall->issuer, mbox, type, src, tag, match_fun, data); + return SIMIX_comm_iprobe(simcall->issuer, mbox, type, match_fun, data); } -smx_activity_t SIMIX_comm_iprobe(smx_actor_t dst_proc, smx_mailbox_t mbox, int type, int src, int tag, - simix_match_func_t match_fun, void* data) +smx_activity_t SIMIX_comm_iprobe(smx_actor_t dst_proc, smx_mailbox_t mbox, int type, simix_match_func_t match_fun, + void* data) { XBT_DEBUG("iprobe from %p %p", mbox, &mbox->comm_queue); simgrid::kernel::activity::CommImplPtr this_comm; diff --git a/src/simix/smx_network_private.h b/src/simix/smx_network_private.h index 80924c330e..0ed901f3dc 100644 --- a/src/simix/smx_network_private.h +++ b/src/simix/smx_network_private.h @@ -15,7 +15,7 @@ XBT_PRIVATE smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*), void (*copy_data_fun)(smx_activity_t, void*, size_t), void* data, double rate); -XBT_PRIVATE smx_activity_t SIMIX_comm_iprobe(smx_actor_t dst_proc, smx_mailbox_t mbox, int type, int src, int tag, +XBT_PRIVATE smx_activity_t SIMIX_comm_iprobe(smx_actor_t dst_proc, smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data); #endif diff --git a/src/smpi/smpi_request.cpp b/src/smpi/smpi_request.cpp index 41fe4bd82c..e3d477bee1 100644 --- a/src/smpi/smpi_request.cpp +++ b/src/smpi/smpi_request.cpp @@ -347,13 +347,12 @@ void Request::start() //begin with the more appropriate one : the small one. mailbox = process->mailbox_small(); XBT_DEBUG("Is there a corresponding send already posted in the small mailbox %p (in case of SSEND)?", mailbox); - smx_activity_t action = simcall_comm_iprobe(mailbox, 0, src_,tag_, &match_recv, - static_cast(this)); + smx_activity_t action = simcall_comm_iprobe(mailbox, 0, &match_recv, static_cast(this)); if (action == nullptr) { mailbox = process->mailbox(); XBT_DEBUG("No, nothing in the small mailbox test the other one : %p", mailbox); - action = simcall_comm_iprobe(mailbox, 0, src_,tag_, &match_recv, static_cast(this)); + action = simcall_comm_iprobe(mailbox, 0, &match_recv, static_cast(this)); if (action == nullptr) { XBT_DEBUG("Still nothing, switch back to the small mailbox : %p", mailbox); mailbox = process->mailbox_small(); @@ -364,7 +363,7 @@ void Request::start() } else { mailbox = process->mailbox_small(); XBT_DEBUG("Is there a corresponding send already posted the small mailbox?"); - smx_activity_t action = simcall_comm_iprobe(mailbox, 0, src_,tag_, &match_recv, static_cast(this)); + smx_activity_t action = simcall_comm_iprobe(mailbox, 0, &match_recv, static_cast(this)); if (action == nullptr) { XBT_DEBUG("No, nothing in the permanent receive mailbox"); @@ -440,8 +439,7 @@ void Request::start() } else if (((flags_ & RMA) != 0) || static_cast(size_) < async_small_thresh) { // eager mode mailbox = process->mailbox(); XBT_DEBUG("Is there a corresponding recv already posted in the large mailbox %p?", mailbox); - smx_activity_t action = simcall_comm_iprobe(mailbox, 1,dst_, tag_, &match_send, - static_cast(this)); + smx_activity_t action = simcall_comm_iprobe(mailbox, 1, &match_send, static_cast(this)); if (action == nullptr) { if ((flags_ & SSEND) == 0){ mailbox = process->mailbox_small(); @@ -449,7 +447,7 @@ void Request::start() } else { mailbox = process->mailbox_small(); XBT_DEBUG("SSEND : Is there a corresponding recv already posted in the small mailbox %p?", mailbox); - action = simcall_comm_iprobe(mailbox, 1,dst_, tag_, &match_send, static_cast(this)); + action = simcall_comm_iprobe(mailbox, 1, &match_send, static_cast(this)); if (action == nullptr) { XBT_DEBUG("No, we are first, send to large mailbox"); mailbox = process->mailbox(); @@ -642,15 +640,13 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* if (xbt_cfg_get_int("smpi/async-small-thresh") > 0){ mailbox = smpi_process()->mailbox_small(); XBT_DEBUG("Trying to probe the perm recv mailbox"); - request->action_ = simcall_comm_iprobe(mailbox, 0, request->src_, request->tag_, &match_recv, - static_cast(request)); + request->action_ = simcall_comm_iprobe(mailbox, 0, &match_recv, static_cast(request)); } if (request->action_ == nullptr){ mailbox = smpi_process()->mailbox(); XBT_DEBUG("trying to probe the other mailbox"); - request->action_ = simcall_comm_iprobe(mailbox, 0, request->src_,request->tag_, &match_recv, - static_cast(request)); + request->action_ = simcall_comm_iprobe(mailbox, 0, &match_recv, static_cast(request)); } if (request->action_ != nullptr){