*/
XBT_PUBLIC double sg_host_speed(sg_host_t host);
#define MSG_host_get_speed(host) sg_host_speed(host)
+XBT_PUBLIC double sg_host_get_pstate_speed(sg_host_t host, int pstate_index);
+#define MSG_host_get_power_peak_at(host, pstate_index) sg_host_get_pstate_speed(host, pstate_index)
+
XBT_PUBLIC double sg_host_get_available_speed(sg_host_t host);
XBT_PUBLIC int sg_host_core_count(sg_host_t host);
XBT_PUBLIC double sg_host_route_latency(sg_host_t from, sg_host_t to);
XBT_PUBLIC double sg_host_route_bandwidth(sg_host_t from, sg_host_t to);
XBT_PUBLIC void sg_host_dump(sg_host_t ws);
+
+XBT_PUBLIC void sg_host_get_actor_list(sg_host_t host, xbt_dynar_t whereto);
+#define MSG_host_get_process_list(host, whereto) sg_host_get_actor_list(host, whereto)
SG_END_DECL()
#endif /* SIMGRID_HOST_H_ */
#define MSG_storage_write(storage, size) sg_storage_write(storage, size)
/************************** Host handling ***********************************/
-XBT_PUBLIC void MSG_host_get_process_list(msg_host_t h, xbt_dynar_t whereto);
-
XBT_ATTRIB_DEPRECATED_v320("Use MSG_host_get_speed(): v3.20 will drop MSG_host_get_current_power_peak() "
"completely.") static inline double MSG_host_get_current_power_peak(msg_host_t host)
{
return MSG_host_get_speed(host);
}
-XBT_PUBLIC double MSG_host_get_power_peak_at(msg_host_t h, int pstate);
-
XBT_PUBLIC void MSG_create_environment(const char* file);
/************************** Process handling *********************************/
+++ /dev/null
-/* Copyright (c) 2004-2017. 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 "simgrid/s4u/Host.hpp"
-#include "simgrid/s4u/Storage.hpp"
-#include "src/msg/msg_private.hpp"
-#include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_host_private.hpp"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(msg);
-
-extern "C" {
-
-/** @addtogroup m_host_management
- * (#msg_host_t) and the functions for managing it.
- *
- * A <em>location</em> (or <em>host</em>) is any possible place where a process may run. Thus it may be represented
- * as a <em>physical resource with computing capabilities</em>, some <em>mailboxes</em> to enable running process to
- * communicate with remote ones, and some <em>private data</em> that can be only accessed by local process.
- * \see msg_host_t
- */
-
-/********************************* Host **************************************/
-
-/** \ingroup m_host_management
- * \brief Return the list of processes attached to an host.
- *
- * \param host a host
- * \param whereto a dynar in which we should push processes living on that host
- */
-void MSG_host_get_process_list(msg_host_t host, xbt_dynar_t whereto)
-{
- xbt_assert((host != nullptr), "Invalid parameters");
- for (auto& actor : host->extension<simgrid::simix::Host>()->process_list) {
- msg_process_t p = actor.ciface();
- xbt_dynar_push(whereto, &p);
- }
-}
-
-/** \ingroup m_host_management
- * \brief Return the speed of the processor (in flop/s) at a given pstate. See also @ref plugin_energy.
- *
- * \param host host to test
- * \param pstate_index pstate to test
- * \return Returns the processor speed associated with pstate_index
- */
-double MSG_host_get_power_peak_at(msg_host_t host, int pstate_index) {
- xbt_assert((host != nullptr), "Invalid parameters (host is nullptr)");
- return host->getPstateSpeed(pstate_index);
-}
-
-}
return host->getSpeed();
}
+/** \brief Return the speed of the processor (in flop/s) at a given pstate. See also @ref plugin_energy.
+ *
+ * \param host host to test
+ * \param pstate_index pstate to test
+ * \return Returns the processor speed associated with pstate_index
+ */
+double sg_host_get_pstate_speed(sg_host_t host, int pstate_index)
+{
+ return host->getPstateSpeed(pstate_index);
+}
+
/** \ingroup m_host_management
* \brief Return the number of cores.
*
}
}
+/** \brief Return the list of actors attached to an host.
+ *
+ * \param host a host
+ * \param whereto a dynar in which we should push actors living on that host
+ */
+void sg_host_get_actor_list(sg_host_t host, xbt_dynar_t whereto)
+{
+ for (auto& actor : host->extension<simgrid::simix::Host>()->process_list) {
+ s4u_Actor* p = actor.ciface();
+ xbt_dynar_push(whereto, &p);
+ }
+}
+
} // extern "C"
src/msg/msg_environment.cpp
src/msg/msg_global.cpp
src/msg/msg_gos.cpp
- src/msg/msg_host.cpp
src/msg/msg_mailbox.cpp
src/msg/msg_process.cpp
src/msg/msg_synchro.cpp