const char *MSG_environment_as_get_property_value(msg_as_t as, const char *name)
{
- xbt_dict_t dict = xbt_lib_get_or_null(as_router_lib, MSG_environment_as_get_name(as), ROUTING_PROP_ASR_LEVEL);
+ xbt_dict_t dict = (xbt_dict_t) xbt_lib_get_or_null(as_router_lib, MSG_environment_as_get_name(as), ROUTING_PROP_ASR_LEVEL);
if (dict==NULL)
return NULL;
- return xbt_dict_get_or_null(dict, name);
+ return (char*) xbt_dict_get_or_null(dict, name);
}
const char *MSG_environment_as_get_model(msg_as_t as) {
/* 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/msg.h"
#include "instr/instr_interface.h"
#include "msg_private.h"
#include "msg_mailbox.h"
/** \ingroup msg_simulation
* \brief A clock (in second).
*/
-XBT_INLINE double MSG_get_clock(void)
+double MSG_get_clock(void)
{
return SIMIX_get_clock();
}
xbt_ex_t e;
simdata_task_t simdata = task->simdata;
msg_process_t self = SIMIX_process_self();
- simdata_process_t p_simdata = SIMIX_process_self_get_data(self);
+ simdata_process_t p_simdata = (simdata_process_t) SIMIX_process_self_get_data(self);
e_smx_state_t comp_state;
msg_error_t status = MSG_OK;
if (t_simdata->isused != 0) {
if (msg_global->debug_multiple_use){
XBT_ERROR("This task is already used in there:");
- xbt_backtrace_display(t_simdata->isused);
+ xbt_backtrace_display((xbt_ex_t*) t_simdata->isused);
XBT_ERROR("And you try to reuse it from here:");
xbt_backtrace_display_current();
} else {
// notify the user callback if any
if (msg_global->task_copy_callback) {
- msg_task_t task = buff;
+ msg_task_t task = (msg_task_t) buff;
msg_global->task_copy_callback(task,
simcall_comm_get_src_proc(comm), simcall_comm_get_dst_proc(comm));
}
*/
const char *MSG_as_router_get_property_value(const char* asr, const char *name)
{
- return xbt_dict_get_or_null(MSG_as_router_get_properties(asr), name);
+ return (char*) xbt_dict_get_or_null(
+ MSG_as_router_get_properties(asr), name);
}
/**
*/
const char *MSG_host_get_property_value(msg_host_t host, const char *name)
{
- return xbt_dict_get_or_null(MSG_host_get_properties(host), name);
+ return (const char*) xbt_dict_get_or_null(MSG_host_get_properties(host), name);
}
/** \ingroup m_host_management
/* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", storage_priv_src->hostname, read_size);
msg_host_t *m_host_list = NULL;
- m_host_list = calloc(2, sizeof(msg_host_t));
+ m_host_list = (msg_host_t*) calloc(2, sizeof(msg_host_t));
m_host_list[0] = MSG_host_self();
m_host_list[1] = attached_host;
/* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", storage_priv_src->hostname, size);
msg_host_t *m_host_list = NULL;
- m_host_list = calloc(2, sizeof(msg_host_t));
+ m_host_list = (msg_host_t*) calloc(2, sizeof(msg_host_t));
m_host_list[0] = MSG_host_self();
m_host_list[1] = attached_host;
msg_storage_priv_t storage_priv_src = MSG_storage_priv(storage_src);
msg_host_t attached_host = MSG_host_by_name(storage_priv_src->hostname);
int res = simcall_file_unlink(file_priv->simdata->smx_file, attached_host);
- return res;
+ return (msg_error_t) res;
}
/** \ingroup msg_file_management
msg_error_t MSG_file_seek(msg_file_t fd, sg_offset_t offset, int origin)
{
msg_file_priv_t priv = MSG_file_priv(fd);
- return simcall_file_seek(priv->simdata->smx_file, offset, origin);
+ return (msg_error_t) simcall_file_seek(priv->simdata->smx_file, offset, origin);
}
/**
msg_error_t MSG_file_move (msg_file_t fd, const char* fullpath)
{
msg_file_priv_t priv = MSG_file_priv(fd);
- return simcall_file_move(priv->simdata->smx_file, fullpath);
+ return (msg_error_t) simcall_file_move(priv->simdata->smx_file, fullpath);
}
/**
XBT_DEBUG("Initiate data transfer of %llu bytes between %s and %s.", read_size, storage_priv_src->hostname, host_name_dest);
msg_host_t *m_host_list = NULL;
- m_host_list = calloc(2, sizeof(msg_host_t));
+ m_host_list = (msg_host_t*) calloc(2, sizeof(msg_host_t));
m_host_list[0] = attached_host;
m_host_list[1] = host_dest;
if (transfer == MSG_TASK_CANCELED)
XBT_WARN("Transfer error, task has been canceled!");
- return -1;
+ return (msg_error_t) -1;
}
/* Create file on remote host, write it and close it */
*/
const char *MSG_storage_get_property_value(msg_storage_t storage, const char *name)
{
- return xbt_dict_get_or_null(MSG_storage_get_properties(storage), name);
+ return (char*) xbt_dict_get_or_null(MSG_storage_get_properties(storage), name);
}
msg_error_t ret = MSG_OK;
simdata_task_t t_simdata = NULL;
msg_process_t process = MSG_process_self();
- simdata_process_t p_simdata = SIMIX_process_self_get_data(process);
+ simdata_process_t p_simdata = (simdata_process_t) SIMIX_process_self_get_data(process);
int call_end = TRACE_msg_task_put_start(task); //must be after CHECK_HOST()
if (t_simdata->isused != 0) {
if (msg_global->debug_multiple_use){
XBT_ERROR("This task is already used in there:");
- xbt_backtrace_display(t_simdata->isused);
+ xbt_backtrace_display((xbt_ex_t*) t_simdata->isused);
XBT_ERROR("And you try to reuse it from here:");
xbt_backtrace_display_current();
} else {
// get the MSG process from the SIMIX process
if (smx_proc == SIMIX_process_self()) {
/* avoid a SIMIX request if this function is called by the process itself */
- msg_proc = SIMIX_process_self_get_data(smx_proc);
+ msg_proc = (simdata_process_t) SIMIX_process_self_get_data(smx_proc);
SIMIX_process_self_set_data(smx_proc, NULL);
}
else {
- msg_proc = simcall_process_get_data(smx_proc);
+ msg_proc = (simdata_process_t) simcall_process_get_data(smx_proc);
simcall_process_set_data(smx_proc, NULL);
}
*/
msg_error_t MSG_process_migrate(msg_process_t process, msg_host_t host)
{
- simdata_process_t simdata = simcall_process_get_data(process);
+ simdata_process_t simdata = (simdata_process_t) simcall_process_get_data(process);
simdata->m_host = host;
msg_host_t now = simdata->m_host;
TRACE_msg_process_change_host(process, now, host);
xbt_assert(process != NULL, "Invalid parameter: first parameter must not be NULL!");
/* get from SIMIX the MSG process data, and then the user data */
- simdata_process_t simdata = simcall_process_get_data(process);
+ simdata_process_t simdata = (simdata_process_t) simcall_process_get_data(process);
if (simdata)
return simdata->data;
else
{
xbt_assert(process != NULL, "Invalid parameter: first parameter must not be NULL!");
- simdata_process_t simdata = simcall_process_get_data(process);
+ simdata_process_t simdata =
+ (simdata_process_t) simcall_process_get_data(process);
simdata->data = data;
return MSG_OK;
{
simdata_process_t simdata;
if (process == NULL) {
- simdata = SIMIX_process_self_get_data(SIMIX_process_self());
+ simdata = (simdata_process_t) SIMIX_process_self_get_data(SIMIX_process_self());
}
else {
- simdata = simcall_process_get_data(process);
+ simdata = (simdata_process_t) simcall_process_get_data(process);
}
return simdata ? simdata->m_host : NULL;
}
const char *MSG_process_get_property_value(msg_process_t process,
const char *name)
{
- return xbt_dict_get_or_null(MSG_process_get_properties(process), name);
+ return (char*) xbt_dict_get_or_null(MSG_process_get_properties(process), name);
}
/** \ingroup m_process_management
}
/* Note: ind_vm and vm_workstation point to the same elm object. */
- msg_vm_t ind_vm = NULL;
- void *ind_vm_workstation = NULL;
-
+
/* Ask the SIMIX layer to create the surf vm resource */
- ind_vm_workstation = simcall_vm_create(name, ind_pm);
- ind_vm = (msg_vm_t) __MSG_host_create(ind_vm_workstation);
+ sg_host_t ind_vm_workstation = (sg_host_t) simcall_vm_create(name, ind_pm);
+
+ msg_vm_t ind_vm = (msg_vm_t) __MSG_host_create(ind_vm_workstation);
XBT_DEBUG("A new VM (%s) has been created", name);
XBT_DEBUG("mig: rx_start");
// The structure has been created in the do_migration function and should only be freed in the same place ;)
- struct migration_session *ms = MSG_process_get_data(MSG_process_self());
+ struct migration_session *ms = (migration_session *) MSG_process_get_data(MSG_process_self());
s_vm_params_t params;
simcall_host_get_params(ms->vm, ¶ms);
char *key = bprintf("%s-%p", task->name, task);
- dirty_page_t dp = xbt_dict_get_or_null(priv->dp_objs, key);
+ dirty_page_t dp = (dirty_page_t) xbt_dict_get_or_null(priv->dp_objs, key);
xbt_assert(dp->task == task);
/* If we are in the middle of dirty page tracking, we record how much
XBT_DEBUG("mig: tx_start");
// Note that the ms structure has been allocated in do_migration and hence should be freed in the same function ;)
- struct migration_session *ms = MSG_process_get_data(MSG_process_self());
+ migration_session *ms =
+ (migration_session *) MSG_process_get_data(MSG_process_self());
s_vm_params_t params;
simcall_host_get_params(ms->vm, ¶ms);
/* Stage2: send update pages iteratively until the size of remaining states
* becomes smaller than the threshold value. */
- if (skip_stage2)
- goto stage3;
-
+ if (! skip_stage2) {
int stage2_round = 0;
for (;;) {
} else
XBT_CRITICAL("bug");
}
-
+ }
stage3:
/* Stage3: stop the VM and copy the rest of states. */
*
*/
- msg_host_t old_pm = simcall_vm_get_pm(vm);
+ msg_host_t old_pm = (msg_host_t) simcall_vm_get_pm(vm);
if(MSG_host_is_off(old_pm))
THROWF(vm_error, 0, "SRC host(%s) seems off, cannot start a migration", sg_host_get_name(old_pm));
*/
msg_host_t MSG_vm_get_pm(msg_vm_t vm)
{
- return simcall_vm_get_pm(vm);
+ return (msg_host_t) simcall_vm_get_pm(vm);
}
)
set(MSG_SRC
- src/msg/instr_msg_process.c
- src/msg/instr_msg_task.c
- src/msg/instr_msg_vm.c
- src/msg/msg_actions.c
- src/msg/msg_deployment.c
- src/msg/msg_environment.c
- src/msg/msg_global.c
- src/msg/msg_gos.c
- src/msg/msg_host.c
- src/msg/msg_io.c
- src/msg/msg_mailbox.c
- src/msg/msg_process.c
- src/msg/msg_synchro.c
- src/msg/msg_task.c
- src/msg/msg_vm.c
+ src/msg/instr_msg_process.cpp
+ src/msg/instr_msg_task.cpp
+ src/msg/instr_msg_vm.cpp
+ src/msg/msg_actions.cpp
+ src/msg/msg_deployment.cpp
+ src/msg/msg_environment.cpp
+ src/msg/msg_global.cpp
+ src/msg/msg_gos.cpp
+ src/msg/msg_host.cpp
+ src/msg/msg_io.cpp
+ src/msg/msg_mailbox.cpp
+ src/msg/msg_process.cpp
+ src/msg/msg_synchro.cpp
+ src/msg/msg_task.cpp
+ src/msg/msg_vm.cpp
)
set(SIMDAG_SRC