From 4ee768b7c404f66fb8b45e919a2ad9f7dc795bdc Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Wed, 6 Mar 2019 09:08:18 +0100 Subject: [PATCH 1/1] remove or deprecate now useless code --- include/simgrid/simix.h | 8 ++- src/kernel/activity/ExecImpl.cpp | 1 - src/plugins/vm/VirtualMachineImpl.cpp | 1 - src/plugins/vm/s4u_VirtualMachine.cpp | 1 - src/s4u/s4u_Actor.cpp | 1 - src/simix/ActorImpl.cpp | 1 - src/simix/libsmx.cpp | 88 +++++++++++++-------------- src/simix/popping_generated.cpp | 1 - src/simix/simcalls.py | 1 - src/simix/smx_global.cpp | 1 - src/simix/smx_host.cpp | 38 ------------ src/simix/smx_host_private.hpp | 17 ------ src/surf/sg_platf.cpp | 1 - tools/cmake/DefinePackages.cmake | 2 - 14 files changed, 47 insertions(+), 115 deletions(-) delete mode 100644 src/simix/smx_host.cpp delete mode 100644 src/simix/smx_host_private.hpp diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 05f0e262eb..4bdd8e86e0 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -175,9 +175,6 @@ XBT_ATTRIB_DEPRECATED_v325("Please use CommImpl::finish") XBT_PUBLIC void SIMIX_ /******************************* Host simcalls ********************************/ #ifdef __cplusplus -XBT_PUBLIC smx_activity_t simcall_execution_parallel_start(const std::string& name, int host_nb, - const sg_host_t* host_list, const double* flops_amount, - const double* bytes_amount, double rate, double timeout); XBT_PUBLIC e_smx_state_t simcall_execution_wait(const smx_activity_t& execution); XBT_PUBLIC e_smx_state_t simcall_execution_test(const smx_activity_t& execution); #endif @@ -280,6 +277,11 @@ SG_END_DECL() XBT_ATTRIB_DEPRECATED_v325("Please use Exec::start()") XBT_PUBLIC smx_activity_t simcall_execution_start(const std::string& name, const std::string& category, double flops_amount, double priority, double bound, sg_host_t host); + +// Should be deprecated in v325 too but is still used in other deprecated calls +XBT_PUBLIC smx_activity_t simcall_execution_parallel_start(const std::string& name, int host_nb, + const sg_host_t* host_list, const double* flops_amount, + const double* bytes_amount, double rate, double timeout); #endif #endif diff --git a/src/kernel/activity/ExecImpl.cpp b/src/kernel/activity/ExecImpl.cpp index b33bd1cf3e..d0ff6ae6df 100644 --- a/src/kernel/activity/ExecImpl.cpp +++ b/src/kernel/activity/ExecImpl.cpp @@ -7,7 +7,6 @@ #include "simgrid/Exception.hpp" #include "simgrid/modelchecker.h" #include "src/mc/mc_replay.hpp" -#include "src/simix/smx_host_private.hpp" #include "src/surf/HostImpl.hpp" #include "src/surf/cpu_interface.hpp" #include "src/surf/surf_interface.hpp" diff --git a/src/plugins/vm/VirtualMachineImpl.cpp b/src/plugins/vm/VirtualMachineImpl.cpp index a921bcf846..803ec9fbfc 100644 --- a/src/plugins/vm/VirtualMachineImpl.cpp +++ b/src/plugins/vm/VirtualMachineImpl.cpp @@ -6,7 +6,6 @@ #include "src/plugins/vm/VirtualMachineImpl.hpp" #include "src/include/surf/surf.hpp" #include "src/simix/ActorImpl.hpp" -#include "src/simix/smx_host_private.hpp" #include "src/kernel/activity/ExecImpl.hpp" #include "xbt/asserts.h" // xbt_log_no_loc diff --git a/src/plugins/vm/s4u_VirtualMachine.cpp b/src/plugins/vm/s4u_VirtualMachine.cpp index 45a9899da6..d2c56bea13 100644 --- a/src/plugins/vm/s4u_VirtualMachine.cpp +++ b/src/plugins/vm/s4u_VirtualMachine.cpp @@ -8,7 +8,6 @@ #include "src/include/surf/surf.hpp" #include "src/plugins/vm/VirtualMachineImpl.hpp" #include "src/plugins/vm/VmHostExt.hpp" -#include "src/simix/smx_host_private.hpp" #include "src/surf/cpu_cas01.hpp" XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_vm, "S4U virtual machines"); diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index 21398a2f2c..ed619e0e0d 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -10,7 +10,6 @@ #include "simgrid/s4u/Host.hpp" #include "simgrid/s4u/VirtualMachine.hpp" #include "src/kernel/activity/ExecImpl.hpp" -#include "src/simix/smx_host_private.hpp" #include "src/simix/smx_private.hpp" #include "src/surf/HostImpl.hpp" diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index b5d78bb57c..e0328fd36e 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -15,7 +15,6 @@ #include "src/kernel/activity/SynchroRaw.hpp" #include "src/mc/mc_replay.hpp" #include "src/mc/remote/Client.hpp" -#include "src/simix/smx_host_private.hpp" #include "src/surf/HostImpl.hpp" #include "src/surf/cpu_interface.hpp" diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index a71478001b..16347e9a52 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -20,57 +20,11 @@ #include "src/kernel/activity/MutexImpl.hpp" #include "src/mc/mc_replay.hpp" #include "src/plugins/vm/VirtualMachineImpl.hpp" -#include "src/simix/smx_host_private.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix); #include "popping_bodies.cpp" -/** - * @ingroup simix_process_management - * @brief Creates a synchro that may involve parallel computation on - * several hosts and communication between them. - * - * @param name Name of the execution synchro to create - * @param host_nb Number of hosts where the synchro will be executed - * @param host_list Array (of size host_nb) of hosts where the synchro will be executed - * @param flops_amount Array (of size host_nb) of computation amount of hosts (in bytes) - * @param bytes_amount Array (of size host_nb * host_nb) representing the communication - * amount between each pair of hosts - * @param rate the SURF action rate - * @param timeout timeout - * @return A new SIMIX execution synchronization - */ -smx_activity_t simcall_execution_parallel_start(const std::string& name, int host_nb, const sg_host_t* host_list, - const double* flops_amount, const double* bytes_amount, double rate, - double timeout) -{ - /* Check that we are not mixing VMs and PMs in the parallel task */ - bool is_a_vm = (nullptr != dynamic_cast(host_list[0])); - for (int i = 1; i < host_nb; i++) { - bool tmp_is_a_vm = (nullptr != dynamic_cast(host_list[i])); - xbt_assert(is_a_vm == tmp_is_a_vm, "parallel_execute: mixing VMs and PMs is not supported (yet)."); - } - - /* checking for infinite values */ - for (int i = 0 ; i < host_nb ; ++i) { - if (flops_amount != nullptr) - xbt_assert(std::isfinite(flops_amount[i]), "flops_amount[%d] is not finite!", i); - if (bytes_amount != nullptr) { - for (int j = 0 ; j < host_nb ; ++j) { - xbt_assert(std::isfinite(bytes_amount[i + host_nb * j]), - "bytes_amount[%d+%d*%d] is not finite!", i, host_nb, j); - } - } - } - - xbt_assert(std::isfinite(rate), "rate is not finite!"); - return simgrid::simix::simcall([name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout] { - return SIMIX_execution_parallel_start(std::move(name), host_nb, host_list, flops_amount, bytes_amount, rate, - timeout); - }); -} - /** * @ingroup simix_host_management * @brief Waits for the completion of an execution synchro and destroy it. @@ -425,6 +379,7 @@ void simcall_execution_set_bound(smx_activity_t exec, double bound) [exec, bound] { boost::static_pointer_cast(exec)->set_bound(bound); }); } +// deprecated smx_activity_t simcall_execution_start(const std::string& name, const std::string& category, double flops_amount, double priority, double bound, sg_host_t host) { @@ -436,6 +391,47 @@ smx_activity_t simcall_execution_start(const std::string& name, const std::strin }); } +// deprecated +smx_activity_t simcall_execution_parallel_start(const std::string& name, int host_nb, const sg_host_t* host_list, + const double* flops_amount, const double* bytes_amount, double rate, + double timeout) +{ + /* Check that we are not mixing VMs and PMs in the parallel task */ + bool is_a_vm = (nullptr != dynamic_cast(host_list[0])); + for (int i = 1; i < host_nb; i++) { + bool tmp_is_a_vm = (nullptr != dynamic_cast(host_list[i])); + xbt_assert(is_a_vm == tmp_is_a_vm, "parallel_execute: mixing VMs and PMs is not supported (yet)."); + } + + /* checking for infinite values */ + for (int i = 0; i < host_nb; ++i) { + if (flops_amount != nullptr) + xbt_assert(std::isfinite(flops_amount[i]), "flops_amount[%d] is not finite!", i); + if (bytes_amount != nullptr) { + for (int j = 0; j < host_nb; ++j) { + xbt_assert(std::isfinite(bytes_amount[i + host_nb * j]), "bytes_amount[%d+%d*%d] is not finite!", i, host_nb, + j); + } + } + } + xbt_assert(std::isfinite(rate), "rate is not finite!"); + + std::vector hosts; + std::vector flops_parallel_amount; + std::vector bytes_parallel_amount; + for (int i = 0; i < host_nb; i++) { + hosts.push_back(host_list[i]); + flops_parallel_amount.push_back(flops_amount[i]); + for (int j = 0; j < host_nb; j++) + bytes_parallel_amount.push_back(bytes_amount[i]); + } + return simgrid::simix::simcall([name, hosts, flops_parallel_amount, bytes_parallel_amount, timeout] { + return simgrid::kernel::activity::ExecImplPtr(new simgrid::kernel::activity::ExecImpl(std::move(name), "")) + ->set_timeout(timeout) + ->start(hosts, flops_parallel_amount, bytes_parallel_amount); + }); +} + // deprecated void SIMIX_comm_finish(smx_activity_t synchro) { diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index 222730111a..9306f6c5ce 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -20,7 +20,6 @@ #include "src/mc/mc_forward.hpp" #endif #include "src/kernel/activity/ConditionVariableImpl.hpp" -#include "src/simix/smx_host_private.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping); diff --git a/src/simix/simcalls.py b/src/simix/simcalls.py index d214ff1f4e..3d71623a0b 100755 --- a/src/simix/simcalls.py +++ b/src/simix/simcalls.py @@ -313,7 +313,6 @@ if __name__ == '__main__': fd.write('#include "src/mc/mc_forward.hpp"\n') fd.write('#endif\n') fd.write('#include "src/kernel/activity/ConditionVariableImpl.hpp"\n') - fd.write('#include "src/simix/smx_host_private.hpp"\n') fd.write('\n') fd.write('XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);\n\n') diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 6e72b4393a..82d46abb4f 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -16,7 +16,6 @@ #include "src/kernel/activity/SynchroRaw.hpp" #include "src/mc/mc_record.hpp" #include "src/mc/mc_replay.hpp" -#include "src/simix/smx_host_private.hpp" #include "src/simix/smx_private.hpp" #include "src/surf/StorageImpl.hpp" #include "src/surf/xml/platf.hpp" diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp deleted file mode 100644 index 7b69ef0e81..0000000000 --- a/src/simix/smx_host.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */ - -/* This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. */ - -#include "mc/mc.h" -#include "smx_private.hpp" -#include "src/kernel/activity/CommImpl.hpp" -#include "src/kernel/activity/ExecImpl.hpp" -#include "src/mc/mc_replay.hpp" -#include "src/plugins/vm/VirtualMachineImpl.hpp" -#include "src/simix/smx_host_private.hpp" - -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix, "SIMIX hosts"); - -simgrid::kernel::activity::ExecImplPtr -SIMIX_execution_parallel_start(std::string name, int host_nb, const sg_host_t* host_list, const double* flops_amount, - const double* bytes_amount, double rate, double timeout) -{ - simgrid::kernel::activity::ExecImplPtr exec = - simgrid::kernel::activity::ExecImplPtr(new simgrid::kernel::activity::ExecImpl(std::move(name), "")); - - std::vector hosts; - for (int i = 0; i < host_nb; i++) - hosts.push_back(host_list[i]); - /* set surf's synchro */ - if (not MC_is_active() && not MC_record_replay_is_active()) { - exec->surf_action_ = surf_host_model->execute_parallel(hosts, flops_amount, bytes_amount, rate); - if (exec->surf_action_ != nullptr) { - exec->surf_action_->set_data(exec.get()); - } - } - - XBT_DEBUG("Create parallel execute synchro %p", exec.get()); - - return exec; -} - diff --git a/src/simix/smx_host_private.hpp b/src/simix/smx_host_private.hpp deleted file mode 100644 index 84c484062a..0000000000 --- a/src/simix/smx_host_private.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */ - -/* This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. */ - -#ifndef SIMIX_HOST_PRIVATE_HPP -#define SIMIX_HOST_PRIVATE_HPP - -#include "src/simix/ActorImpl.hpp" - -#include - -XBT_PRIVATE simgrid::kernel::activity::ExecImplPtr -SIMIX_execution_parallel_start(std::string name, int host_nb, const sg_host_t* host_list, const double* flops_amount, - const double* bytes_amount, double rate, double timeout); - -#endif diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 1abeb1494f..c67c9e6abe 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -19,7 +19,6 @@ #include "src/include/simgrid/sg_config.hpp" #include "src/include/surf/surf.hpp" #include "src/kernel/EngineImpl.hpp" -#include "src/simix/smx_host_private.hpp" #include "src/simix/smx_private.hpp" #include "src/surf/HostImpl.hpp" #include "src/surf/xml/platf_private.hpp" diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index d629a2482d..b7ef956ece 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -25,7 +25,6 @@ set(EXTRA_DIST src/simix/popping_generated.cpp src/simix/popping_enum.h src/simix/popping_accessors.hpp - src/simix/smx_host_private.hpp src/simix/smx_private.hpp src/smpi/colls/coll_tuned_topo.hpp src/smpi/colls/colls_private.hpp @@ -384,7 +383,6 @@ set(SIMIX_SRC src/simix/smx_deployment.cpp src/simix/smx_environment.cpp src/simix/smx_global.cpp - src/simix/smx_host.cpp src/simix/ActorImpl.cpp src/simix/ActorImpl.hpp src/simix/popping.cpp -- 2.20.1