* smpi/cpu-threshold:-1 should become smpi/simulate-computation:no
smpi/running-power is renamed to smpi/host-speed
- Dropped functions and features
+ Dropped / renamed functions and features
* msg_mailbox_t and associated functions. Use s4u::Mailbox instead.
- MSG_mailbox_is_empty() -> Mailbox::empty()
- MSG_mailbox_front() -> Mailbox::front()
- MSG_mailbox_get_by_alias() -> simgrid::s4u::Mailbox::byName(name)
- MSG_mailbox_get_task_ext() -> MSG_task_receive_ext()
- MSG_mailbox_get_task_ext_bounded -> MSG_task_receive_ext_bounded
+ - MSG_host_(get/set)_params -> MSG_vm_(get/set)_params
+
* Task affinity. Its intended behavior (that was very badly tested
and probably not really working) was deceiving what most users
would have hoped here.
s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes
- MSG_host_set_params(vm0, ¶ms);
+ MSG_vm_set_params(vm0, ¶ms);
MSG_vm_start(vm0);
cpu_speed = MSG_host_get_speed(pm0);
s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes
- MSG_host_set_params(vm, ¶ms);
+ MSG_vm_set_params(vm, ¶ms);
MSG_vm_start(vm);
xbt_dynar_push(vms, &vm);
vm0 = MSG_vm_create_core(pm0, "VM0");
params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes
- MSG_host_set_params(vm0, ¶ms);
+ MSG_vm_set_params(vm0, ¶ms);
MSG_vm_start(vm0);
XBT_INFO("Test: Migrate a VM with %llu Mbytes RAM", params.ramsize / 1000 / 1000);
vm0 = MSG_vm_create_core(pm0, "VM0");
params.ramsize = 1L * 1000 * 1000 * 100; // 100Mbytes
- MSG_host_set_params(vm0, ¶ms);
+ MSG_vm_set_params(vm0, ¶ms);
MSG_vm_start(vm0);
XBT_INFO("Test: Migrate a VM with %llu Mbytes RAM", params.ramsize / 1000 / 1000);
vm1 = MSG_vm_create_core(pm0, "VM1");
params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes
- MSG_host_set_params(vm0, ¶ms);
- MSG_host_set_params(vm1, ¶ms);
+ MSG_vm_set_params(vm0, ¶ms);
+ MSG_vm_set_params(vm1, ¶ms);
MSG_vm_start(vm0);
MSG_vm_start(vm1);
vm1 = MSG_vm_create_core(pm0, "VM1");
params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes
- MSG_host_set_params(vm0, ¶ms);
- MSG_host_set_params(vm1, ¶ms);
+ MSG_vm_set_params(vm0, ¶ms);
+ MSG_vm_set_params(vm1, ¶ms);
MSG_vm_start(vm0);
MSG_vm_start(vm1);
s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes
- MSG_host_set_params(vm0, ¶ms);
+ MSG_vm_set_params(vm0, ¶ms);
MSG_vm_start(vm0);
launch_communication_worker(vm0, pm2);
#define MSG_host_set_pstate(h, pstate) sg_host_set_pstate(h, pstate)
XBT_PUBLIC(xbt_dynar_t) MSG_hosts_as_dynar();
XBT_PUBLIC(int) MSG_get_host_number();
-XBT_PUBLIC(void) MSG_host_get_params(msg_host_t ind_pm, vm_params_t params);
-XBT_PUBLIC(void) MSG_host_set_params(msg_host_t ind_pm, vm_params_t params);
XBT_PUBLIC(xbt_dict_t) MSG_host_get_mounted_storage_list(msg_host_t host);
XBT_PUBLIC(xbt_dynar_t) MSG_host_get_attached_storage_list(msg_host_t host);
XBT_PUBLIC(xbt_dict_t) MSG_host_get_storage_content(msg_host_t host);
XBT_PUBLIC(const char*) MSG_vm_get_name(msg_vm_t vm);
+XBT_PUBLIC(void) MSG_vm_get_params(msg_vm_t vm, vm_params_t params);
+XBT_PUBLIC(void) MSG_vm_set_params(msg_vm_t vm, vm_params_t params);
+
// TODO add VDI later
XBT_PUBLIC(msg_vm_t) MSG_vm_create_core(msg_host_t location, const char *name);
XBT_PUBLIC(msg_vm_t) MSG_vm_create(msg_host_t ind_pm, const char *name,
virtual ~VirtualMachine();
public:
- void parameters(vm_params_t params) override;
- void setParameters(vm_params_t params) override;
+ void parameters(vm_params_t params);
+ void setParameters(vm_params_t params);
};
}
} // namespace simgrid::s4u
int pstatesCount() const;
void setPstate(int pstate_index);
int pstate();
- virtual void parameters(vm_params_t params);
- virtual void setParameters(vm_params_t params);
xbt_dict_t mountedStoragesAsDict(); // HACK
xbt_dynar_t attachedStorages();
return host->isOff();
}
-/** \ingroup m_host_management
- * \brief Set the parameters of a given host
- *
- * \param host a host
- * \param params a prameter object
- */
-void MSG_host_set_params(msg_host_t host, vm_params_t params)
-{
- host->setParameters(params);
-}
-
-/** \ingroup m_host_management
- * \brief Get the parameters of a given host
- *
- * \param host a host
- * \param params a prameter object
- */
-void MSG_host_get_params(msg_host_t host, vm_params_t params)
-{
- host->parameters(params);
-}
-
/** \ingroup m_host_management
* \brief Return the speed of the processor (in flop/s) at a given pstate. See also @ref SURF_plugin_energy.
*
#include <xbt/ex.hpp>
+#include <simgrid/s4u/VirtualMachine.hpp>
#include <simgrid/s4u/host.hpp>
#include "msg_private.h"
{
xbt_dict_set(MSG_host_get_properties(vm), name, value, free_ctn);
}
+/** \ingroup m_vm_management
+ * \brief Set the parameters of a given host
+ *
+ * \param vm a vm
+ * \param params a parameter object
+ */
+void MSG_vm_set_params(msg_vm_t vm, vm_params_t params)
+{
+ static_cast<simgrid::s4u::VirtualMachine*>(vm)->setParameters(params);
+}
+
+/** \ingroup m_vm_management
+ * \brief Get the parameters of a given host
+ *
+ * \param host a host
+ * \param params a prameter object
+ */
+void MSG_vm_get_params(msg_vm_t vm, vm_params_t params)
+{
+ static_cast<simgrid::s4u::VirtualMachine*>(vm)->parameters(params);
+}
/** \ingroup msg_vm_management
* \brief Finds a msg_vm_t using its name.
//XBT_INFO("dp rate %f migspeed : %f intensity mem : %d, updatespeed %f, hostspeed %f",params.dp_rate,
// params.mig_speed, dp_intensity, update_speed, host_speed);
- vm->setParameters(¶ms);
+ static_cast<simgrid::s4u::VirtualMachine*>(vm)->setParameters(¶ms);
return vm;
}
struct migration_session *ms = (migration_session *) MSG_process_get_data(MSG_process_self());
s_vm_params_t params;
- ms->vm->parameters(¶ms);
+ static_cast<simgrid::s4u::VirtualMachine*>(ms->vm)->parameters(¶ms);
int need_exit = 0;
migration_session *ms = (migration_session *) MSG_process_get_data(MSG_process_self());
s_vm_params_t params;
- ms->vm->parameters(¶ms);
+ static_cast<simgrid::s4u::VirtualMachine*>(ms->vm)->parameters(¶ms);
const sg_size_t ramsize = params.ramsize;
const sg_size_t devsize = params.devsize;
const int skip_stage1 = params.skip_stage1;
return pimpl_cpu->getPState();
}
-void Host::parameters(vm_params_t params)
-{
- THROW_IMPOSSIBLE; // This should only be used on VMs
-}
-
-void Host::setParameters(vm_params_t params)
-{
- THROW_IMPOSSIBLE; // This should only be used on VMs
-}
-
/**
* \ingroup simix_storage_management
* \brief Returns the list of storages mounted on an host.