#endif
XBT_DEBUG("Receiving: %s", name);
- MSG_error_t res = MSG_task_receive(&task, mailbox_name);
+ msg_error_t res = MSG_task_receive(&task, mailbox_name);
// MSG_task_receive(&task, MSG_process_get_name(MSG_process_self()));
XBT_VERB("%s %f", name, MSG_get_clock() - clock);
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
/* Check the given arguments */
MSG_init(&argc, argv);
// a transfer has occured
- MSG_error_t status = MSG_comm_get_status(node.comm_receive);
+ msg_error_t status = MSG_comm_get_status(node.comm_receive);
if (status != MSG_OK) {
XBT_DEBUG("Failed to receive a task. Nevermind.");
// send a "Find Successor" request to ask_to_id
msg_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
XBT_DEBUG("Sending a 'Find Successor' request (task %p) to %d for id %d", task_sent, ask_to, id);
- MSG_error_t res = MSG_task_send_with_timeout(task_sent, mailbox, timeout);
+ msg_error_t res = MSG_task_send_with_timeout(task_sent, mailbox, timeout);
if (res != MSG_OK) {
XBT_DEBUG("Failed to send the 'Find Successor' request (task %p) to %d for id %d",
// send a "Get Predecessor" request to ask_to_id
XBT_DEBUG("Sending a 'Get Predecessor' request to %d", ask_to);
msg_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
- MSG_error_t res = MSG_task_send_with_timeout(task_sent, mailbox, timeout);
+ msg_error_t res = MSG_task_send_with_timeout(task_sent, mailbox, timeout);
if (res != MSG_OK) {
XBT_DEBUG("Failed to send the 'Get Predecessor' request (task %p) to %d",
MSG_function_register("node", node);
MSG_launch_application(application_file);
- MSG_error_t res = MSG_main();
+ msg_error_t res = MSG_main();
XBT_CRITICAL("Messages created: %ld", smx_total_comms);
XBT_INFO("Simulated time: %g", MSG_get_clock());
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
xbt_dynar_t hosts_dynar;
msg_host_t*hosts= xbt_new(msg_host_t,10);
char**hostnames= xbt_new(char*,10);
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
int master(int argc, char *argv[]);
int slave(int argc, char *argv[]);
int timer(int argc, char *argv[]);
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file);
int timer_start = 1;
} /* end_of_slave */
/** Test function */
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
/* MSG_config("workstation/model", "GTNETS"); */
/* MSG_config("workstation/model","KCCFLN05"); */
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
bool_printed = 0;
MSG_init(&argc, argv);
int sender(int argc, char *argv[]);
int receiver(int argc, char *argv[]);
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file);
/** Sender function */
int receiver(int argc, char *argv[])
{
msg_task_t task = NULL;
- _XBT_GNUC_UNUSED MSG_error_t res;
+ _XBT_GNUC_UNUSED msg_error_t res;
int id = -1;
char mailbox[80];
msg_comm_t res_irecv;
} /* end_of_receiver */
/** Test function */
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
/* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
if (argc < 3) {
int sender(int argc, char *argv[]);
int receiver(int argc, char *argv[]);
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file);
/** Sender function */
int receiver(int argc, char *argv[])
{
msg_task_t task = NULL;
- _XBT_GNUC_UNUSED MSG_error_t res;
+ _XBT_GNUC_UNUSED msg_error_t res;
int id = -1;
char mailbox[80];
msg_comm_t res_irecv;
} /* end_of_receiver */
/** Test function */
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
/* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
if (argc < 3) {
int sender(int argc, char *argv[]);
int receiver(int argc, char *argv[]);
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file);
/** Sender function */
sprintf(mailbox, "finalize");
msg_comm_t res_irecv;
- _XBT_GNUC_UNUSED MSG_error_t res_wait;
+ _XBT_GNUC_UNUSED msg_error_t res_wait;
for (i = 0; i < receivers_count; i++) {
task = NULL;
res_irecv = MSG_task_irecv(&(task), mailbox);
/* Here we are waiting for the receiving of all communications */
msg_task_t task_com;
while (!xbt_dynar_is_empty(comms)) {
- _XBT_GNUC_UNUSED MSG_error_t err;
+ _XBT_GNUC_UNUSED msg_error_t err;
xbt_dynar_remove_at(comms, MSG_comm_waitany(comms), &res_irecv);
task_com = MSG_comm_get_task(res_irecv);
MSG_comm_destroy(res_irecv);
} /* end_of_receiver */
/** Test function */
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
/* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
if (argc < 3) {
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
long i;
MSG_init(&argc, argv);
int master(int argc, char *argv[]);
int slave(int argc, char *argv[]);
-MSG_error_t test_all(void);
+msg_error_t test_all(void);
/** Emitter function */
int master(int argc, char *argv[])
} /* end_of_slave */
/** Test function */
-MSG_error_t test_all(void)
+msg_error_t test_all(void)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
/* Simulation setting */
surf_parse = surf_parse_bypass_platform;
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
res = test_all();
#define FINALIZE ((void*)221297) /* a magic number to tell people to stop working */
-MSG_error_t test_all(const char *platform_file);
+msg_error_t test_all(const char *platform_file);
int master(int argc, char *argv[]);
}
/** Test function */
-MSG_error_t test_all(const char *platform_file)
+msg_error_t test_all(const char *platform_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_create_environment(platform_file);
MSG_function_register("master", master);
MSG_function_register("slave", slave);
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
res = test_all(argv[1]);
int master(int argc, char *argv[]);
int slave(int argc, char *argv[]);
-MSG_error_t test_all(const char *);
+msg_error_t test_all(const char *);
/** Emitter function */
int master(int argc, char *argv[])
} /* end_of_slave */
/** Test function */
-MSG_error_t test_all(const char *file) //(void)
+msg_error_t test_all(const char *file) //(void)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
/*start by registering functions before loading script */
MSG_function_register("master", master);
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
if (argc < 2) {
int master(int argc, char *argv[]);
int slave(int argc, char *argv[]);
int forwarder(int argc, char *argv[]);
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file);
#define FINALIZE ((void*)221297) /* a magic number to tell people to stop working */
} /* end_of_slave */
/** Test function */
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
/* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
if (argc < 3) {
int master(int argc, char *argv[]);
int slave(int argc, char *argv[]);
int forwarder(int argc, char *argv[]);
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file);
#define FINALIZE ((void*)221297) /* a magic number to tell people to stop working */
} /* end_of_forwarder */
/** Test function */
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
/* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
if (argc < 3) {
} /* end_of_dram_master */
/** Test function */
-static MSG_error_t test_all(const char *platform_file,
+static msg_error_t test_all(const char *platform_file,
const char *application_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_create_environment(platform_file);
MSG_function_register("master", master);
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
if (argc < 3) {
int master(int argc, char *argv[]);
int slave(int argc, char *argv[]);
int forwarder(int argc, char *argv[]);
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file);
/** Emitter function */
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res;
+ msg_error_t res;
const char *platform_file;
const char *application_file;
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
/* Argument checking */
MSG_init(&argc, argv);
int master(int argc, char *argv[]);
int slave(int argc, char *argv[]);
int timer(int argc, char *argv[]);
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file);
int timer_start; //set as 1 in the master process
} /* end_of_slave */
/** Test function */
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
/* MSG_config("workstation/model", "GTNETS"); */
/* MSG_config("workstation/model","KCCFLN05"); */
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
bool_printed = 0;
MSG_init(&argc, argv);
*/
int test(int argc, char *argv[]);
-MSG_error_t test_all(const char *platform_file);
+msg_error_t test_all(const char *platform_file);
/** Emitter function */
int test(int argc, char *argv[])
}
/** Test function */
-MSG_error_t test_all(const char *platform_file)
+msg_error_t test_all(const char *platform_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
xbt_dynar_t all_hosts;
msg_host_t first_host;
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
if (argc < 2) {
int execute(int argc, char *argv[]);
int redistribute(int argc, char *argv[]);
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file);
}
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_config("workstation/model", "ptask_L07");
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
if (argc < 3) {
#ifdef BENCH_THIS_CODE
xbt_os_timer_start(timer);
#endif
- MSG_error_t res = MSG_main();
+ msg_error_t res = MSG_main();
#ifdef BENCH_THIS_CODE
xbt_os_timer_stop(timer);
#endif
return 0;
}
-static MSG_error_t test_all(const char *platform_file,
+static msg_error_t test_all(const char *platform_file,
const char *application_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
{ /* Simulation setting */
MSG_create_environment(platform_file);
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
#ifdef _MSC_VER
unsigned int prev_exponent_format =
int bob(int argc, char *argv[]);
int carole(int argc, char *argv[]);
int forwarder(int argc, char *argv[]);
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file);
static void test_host(const char*hostname)
}
/** Test function */
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file)
{
MSG_function_register("alice", alice);
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
if (argc < 3) {
int sender(int argc, char *argv[]);
int receiver(int argc, char *argv[]);
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file);
double task_comm_size_lat = 10e0;
/** Test function */
-MSG_error_t test_all(const char *platform_file,
+msg_error_t test_all(const char *platform_file,
const char *application_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
#ifdef _MSC_VER
unsigned int prev_exponent_format =
} /* end_of_dram_master */
/** Test function */
-static MSG_error_t test_all(const char *platform_file,
+static msg_error_t test_all(const char *platform_file,
const char *application_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_create_environment(platform_file);
MSG_function_register("master", master);
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
if (argc < 3) {
} /* end_of_dram_master */
/** Test function */
-static MSG_error_t test_all(const char *platform_file,
+static msg_error_t test_all(const char *platform_file,
const char *application_file)
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
{ /* Simulation setting */
MSG_create_environment(platform_file);
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
if (argc < 3) {
running has just been rebooted. Free your datastructures and
return now !*/
MSG_TASK_CANCELED = 8 /**< @brief Canceled task. This task has been canceled by somebody!*/
-} MSG_error_t;
+} msg_error_t;
/** @} */
+typedef msg_error_t MSG_error_t;
/************************** Global ******************************************/
XBT_PUBLIC(void) MSG_config(const char *name, ...);
}
XBT_PUBLIC(void) MSG_init_nocheck(int *argc, char **argv);
-XBT_PUBLIC(MSG_error_t) MSG_main(void);
-XBT_PUBLIC(MSG_error_t) MSG_clean(void);
+XBT_PUBLIC(msg_error_t) MSG_main(void);
+XBT_PUBLIC(msg_error_t) MSG_clean(void);
XBT_PUBLIC(void) MSG_function_register(const char *name,
xbt_main_func_t code);
XBT_PUBLIC(void) MSG_function_register_default(xbt_main_func_t code);
/************************** Host handling ***********************************/
-XBT_PUBLIC(MSG_error_t) MSG_host_set_data(msg_host_t host, void *data);
+XBT_PUBLIC(msg_error_t) MSG_host_set_data(msg_host_t host, void *data);
XBT_PUBLIC(void *) MSG_host_get_data(msg_host_t host);
XBT_PUBLIC(const char *) MSG_host_get_name(msg_host_t host);
XBT_PUBLIC(msg_host_t) MSG_host_self(void);
XBT_PUBLIC(void) MSG_process_kill(msg_process_t process);
XBT_PUBLIC(int) MSG_process_killall(int reset_PIDs);
-XBT_PUBLIC(MSG_error_t) MSG_process_migrate(msg_process_t process, msg_host_t host);
+XBT_PUBLIC(msg_error_t) MSG_process_migrate(msg_process_t process, msg_host_t host);
XBT_PUBLIC(void *) MSG_process_get_data(msg_process_t process);
-XBT_PUBLIC(MSG_error_t) MSG_process_set_data(msg_process_t process,
+XBT_PUBLIC(msg_error_t) MSG_process_set_data(msg_process_t process,
void *data);
XBT_PUBLIC(void) MSG_process_set_data_cleanup(void_f_pvoid_t data_cleanup);
XBT_PUBLIC(msg_host_t) MSG_process_get_host(msg_process_t process);
XBT_PUBLIC(int) MSG_process_self_PPID(void);
XBT_PUBLIC(msg_process_t) MSG_process_self(void);
XBT_PUBLIC(xbt_dynar_t) MSG_processes_as_dynar(void);
-XBT_PUBLIC(MSG_error_t) MSG_process_set_kill_time(msg_process_t process, double kill_time);
+XBT_PUBLIC(msg_error_t) MSG_process_set_kill_time(msg_process_t process, double kill_time);
/*property handlers*/
XBT_PUBLIC(xbt_dict_t) MSG_process_get_properties(msg_process_t process);
process,
const char *name);
-XBT_PUBLIC(MSG_error_t) MSG_process_suspend(msg_process_t process);
-XBT_PUBLIC(MSG_error_t) MSG_process_resume(msg_process_t process);
+XBT_PUBLIC(msg_error_t) MSG_process_suspend(msg_process_t process);
+XBT_PUBLIC(msg_error_t) MSG_process_resume(msg_process_t process);
XBT_PUBLIC(int) MSG_process_is_suspended(msg_process_t process);
XBT_PUBLIC(void) MSG_process_on_exit(int_f_pvoid_t fun, void *data);
XBT_PUBLIC(void) MSG_process_auto_restart_set(msg_process_t process, int auto_restart);
XBT_PUBLIC(msg_host_t) MSG_task_get_source(msg_task_t task);
XBT_PUBLIC(const char *) MSG_task_get_name(msg_task_t task);
XBT_PUBLIC(void) MSG_task_set_name(msg_task_t task, const char *name);
-XBT_PUBLIC(MSG_error_t) MSG_task_cancel(msg_task_t task);
-XBT_PUBLIC(MSG_error_t) MSG_task_destroy(msg_task_t task);
+XBT_PUBLIC(msg_error_t) MSG_task_cancel(msg_task_t task);
+XBT_PUBLIC(msg_error_t) MSG_task_destroy(msg_task_t task);
-XBT_PUBLIC(MSG_error_t) MSG_task_receive_from_host(msg_task_t * task, const char *alias,
+XBT_PUBLIC(msg_error_t) MSG_task_receive_from_host(msg_task_t * task, const char *alias,
msg_host_t host);
-XBT_PUBLIC(MSG_error_t) MSG_task_execute(msg_task_t task);
-XBT_PUBLIC(MSG_error_t) MSG_parallel_task_execute(msg_task_t task);
+XBT_PUBLIC(msg_error_t) MSG_task_execute(msg_task_t task);
+XBT_PUBLIC(msg_error_t) MSG_parallel_task_execute(msg_task_t task);
XBT_PUBLIC(void) MSG_task_set_priority(msg_task_t task, double priority);
-XBT_PUBLIC(MSG_error_t) MSG_process_sleep(double nb_sec);
+XBT_PUBLIC(msg_error_t) MSG_process_sleep(double nb_sec);
XBT_PUBLIC(double) MSG_task_get_compute_duration(msg_task_t task);
XBT_PUBLIC(void) MSG_task_set_compute_duration(msg_task_t task,
XBT_PUBLIC(double) MSG_task_get_data_size(msg_task_t task);
-XBT_PUBLIC(MSG_error_t)
+XBT_PUBLIC(msg_error_t)
MSG_task_receive_ext(msg_task_t * task, const char *alias, double timeout,
msg_host_t host);
-XBT_PUBLIC(MSG_error_t)
+XBT_PUBLIC(msg_error_t)
MSG_task_receive_with_timeout(msg_task_t * task, const char *alias,
double timeout);
-XBT_PUBLIC(MSG_error_t)
+XBT_PUBLIC(msg_error_t)
MSG_task_receive(msg_task_t * task, const char *alias);
#define MSG_task_recv(t,a) MSG_task_receive(t,a)
XBT_PUBLIC(int) MSG_comm_test(msg_comm_t comm);
XBT_PUBLIC(int) MSG_comm_testany(xbt_dynar_t comms);
XBT_PUBLIC(void) MSG_comm_destroy(msg_comm_t comm);
-XBT_PUBLIC(MSG_error_t) MSG_comm_wait(msg_comm_t comm, double timeout);
+XBT_PUBLIC(msg_error_t) MSG_comm_wait(msg_comm_t comm, double timeout);
XBT_PUBLIC(void) MSG_comm_waitall(msg_comm_t * comm, int nb_elem,
double timeout);
XBT_PUBLIC(int) MSG_comm_waitany(xbt_dynar_t comms);
XBT_PUBLIC(msg_task_t) MSG_comm_get_task(msg_comm_t comm);
-XBT_PUBLIC(MSG_error_t) MSG_comm_get_status(msg_comm_t comm);
+XBT_PUBLIC(msg_error_t) MSG_comm_get_status(msg_comm_t comm);
XBT_PUBLIC(int) MSG_task_listen(const char *alias);
XBT_PUBLIC(int) MSG_task_listen_from_host(const char *alias,
msg_host_t host);
-XBT_PUBLIC(MSG_error_t)
+XBT_PUBLIC(msg_error_t)
MSG_task_send_with_timeout(msg_task_t task, const char *alias,
double timeout);
-XBT_PUBLIC(MSG_error_t)
+XBT_PUBLIC(msg_error_t)
MSG_task_send(msg_task_t task, const char *alias);
-XBT_PUBLIC(MSG_error_t)
+XBT_PUBLIC(msg_error_t)
MSG_task_send_bounded(msg_task_t task, const char *alias, double rate);
XBT_PUBLIC(int) MSG_task_listen_from(const char *alias);
XBT_PUBLIC(const char *) MSG_task_get_category (msg_task_t task);
/************************** Task handling ************************************/
-XBT_PUBLIC(MSG_error_t)
+XBT_PUBLIC(msg_error_t)
MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, msg_task_t * task,
msg_host_t host, double timeout);
-XBT_PUBLIC(MSG_error_t)
+XBT_PUBLIC(msg_error_t)
MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, msg_task_t task,
double timeout);
/************************** Action handling **********************************/
-MSG_error_t MSG_action_trace_run(char *path);
+msg_error_t MSG_action_trace_run(char *path);
#ifdef MSG_USE_DEPRECATED
#define MSG_global_init(argc, argv) MSG_init(argc,argv)
MSG_mailbox_put_with_timeout(mailbox, task, timeout)
#define MSG_process_change_host(h) MSG_process_migrate(MSG_process_self(),h);
-XBT_PUBLIC(MSG_error_t) MSG_get_errno(void);
+XBT_PUBLIC(msg_error_t) MSG_get_errno(void);
-XBT_PUBLIC(MSG_error_t) MSG_task_get(msg_task_t * task, m_channel_t channel);
-XBT_PUBLIC(MSG_error_t) MSG_task_get_with_timeout(msg_task_t * task,
+XBT_PUBLIC(msg_error_t) MSG_task_get(msg_task_t * task, m_channel_t channel);
+XBT_PUBLIC(msg_error_t) MSG_task_get_with_timeout(msg_task_t * task,
m_channel_t channel,
double max_duration);
-XBT_PUBLIC(MSG_error_t) MSG_task_get_from_host(msg_task_t * task,
+XBT_PUBLIC(msg_error_t) MSG_task_get_from_host(msg_task_t * task,
int channel, msg_host_t host);
-XBT_PUBLIC(MSG_error_t) MSG_task_get_ext(msg_task_t * task, int channel,
+XBT_PUBLIC(msg_error_t) MSG_task_get_ext(msg_task_t * task, int channel,
double max_duration,
msg_host_t host);
-XBT_PUBLIC(MSG_error_t) MSG_task_put(msg_task_t task, msg_host_t dest,
+XBT_PUBLIC(msg_error_t) MSG_task_put(msg_task_t task, msg_host_t dest,
m_channel_t channel);
-XBT_PUBLIC(MSG_error_t) MSG_task_put_bounded(msg_task_t task,
+XBT_PUBLIC(msg_error_t) MSG_task_put_bounded(msg_task_t task,
msg_host_t dest,
m_channel_t channel,
double max_rate);
-XBT_PUBLIC(MSG_error_t) MSG_task_put_with_timeout(msg_task_t task,
+XBT_PUBLIC(msg_error_t) MSG_task_put_with_timeout(msg_task_t task,
msg_host_t dest,
m_channel_t channel,
double max_duration);
XBT_PUBLIC(int) MSG_task_probe_from(m_channel_t channel);
XBT_PUBLIC(int) MSG_task_probe_from_host(int channel, msg_host_t host);
-XBT_PUBLIC(MSG_error_t) MSG_set_channel_number(int number);
+XBT_PUBLIC(msg_error_t) MSG_set_channel_number(int number);
XBT_PUBLIC(int) MSG_get_channel_number(void);
#endif
timeout = luaL_checknumber(L, 2);
}
/* comm ... */
- MSG_error_t res = MSG_comm_wait(comm, timeout);
+ msg_error_t res = MSG_comm_wait(comm, timeout);
if (res == MSG_OK) {
msg_task_t task = MSG_comm_get_task(comm);
}
else {
/* finished but may have failed */
- MSG_error_t res = MSG_comm_get_status(comm);
+ msg_error_t res = MSG_comm_get_status(comm);
if (res == MSG_OK) {
msg_task_t task = MSG_comm_get_task(comm);
void sglua_register_platf_functions(lua_State* L);
-const char* sglua_get_msg_error(MSG_error_t err);
+const char* sglua_get_msg_error(msg_error_t err);
static int l_process_sleep(lua_State* L)
{
double duration = luaL_checknumber(L, 1);
- MSG_error_t res = MSG_process_sleep(duration);
+ msg_error_t res = MSG_process_sleep(duration);
switch (res) {
static int l_task_execute(lua_State* L)
{
msg_task_t task = sglua_check_task(L, 1);
- MSG_error_t res = MSG_task_execute(task);
+ msg_error_t res = MSG_task_execute(task);
if (res == MSG_OK) {
return 0;
/* task */
sglua_task_register(L);
/* -- */
- MSG_error_t res = MSG_task_send_with_timeout(task, mailbox, timeout);
+ msg_error_t res = MSG_task_send_with_timeout(task, mailbox, timeout);
if (res == MSG_OK) {
lua_pushboolean(L, 1);
/* no timeout by default */
}
/* mailbox ... */
- MSG_error_t res = MSG_task_receive_with_timeout(&task, mailbox, timeout);
+ msg_error_t res = MSG_task_receive_with_timeout(&task, mailbox, timeout);
if (res == MSG_OK) {
sglua_task_unregister(L, task);
* \param err an MSG error code
* \return a string describing this error
*/
-const char* sglua_get_msg_error(MSG_error_t err) {
+const char* sglua_get_msg_error(msg_error_t err) {
static const char* msg_errors[] = {
NULL,
* If path!=NULL, load a trace file containing actions, and execute them.
* Else, assume that each process gets the path in its deployment file
*/
-MSG_error_t MSG_action_trace_run(char *path)
+msg_error_t MSG_action_trace_run(char *path)
{
- MSG_error_t res;
+ msg_error_t res;
char *name;
xbt_dynar_t todo;
xbt_dict_cursor_t cursor;
parameter.
* \param number the number of channel in the simulation. It has to be >0
*/
-MSG_error_t MSG_set_channel_number(int number)
+msg_error_t MSG_set_channel_number(int number)
{
XBT_WARN("DEPRECATED! Please use aliases instead");
xbt_assert((msg_global)
/** \ingroup msg_simulation
* \brief Launch the MSG simulation
*/
-MSG_error_t MSG_main(void)
+msg_error_t MSG_main(void)
{
/* Clean IO before the run */
fflush(stdout);
/** \ingroup msg_simulation
* \brief Clean the MSG simulation
*/
-MSG_error_t MSG_clean(void)
+msg_error_t MSG_clean(void)
{
XBT_DEBUG("Closing MSG");
* \return #MSG_OK if the task was successfully completed, #MSG_TASK_CANCELED
* or #MSG_HOST_FAILURE otherwise
*/
-MSG_error_t MSG_task_execute(msg_task_t task)
+msg_error_t MSG_task_execute(msg_task_t task)
{
return MSG_parallel_task_execute(task);
}
* \return #MSG_OK if the task was successfully completed, #MSG_TASK_CANCELED
* or #MSG_HOST_FAILURE otherwise
*/
-MSG_error_t MSG_parallel_task_execute(msg_task_t task)
+msg_error_t MSG_parallel_task_execute(msg_task_t task)
{
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);
e_smx_state_t comp_state;
- MSG_error_t status = MSG_OK;
+ msg_error_t status = MSG_OK;
#ifdef HAVE_TRACING
TRACE_msg_task_execute_start(task);
*
* \param nb_sec a number of second
*/
-MSG_error_t MSG_process_sleep(double nb_sec)
+msg_error_t MSG_process_sleep(double nb_sec)
{
- MSG_error_t status = MSG_OK;
+ msg_error_t status = MSG_OK;
/*msg_process_t proc = MSG_process_self();*/
#ifdef HAVE_TRACING
* #MSG_OK if the task was successfully received,
* #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE otherwise.
*/
-MSG_error_t
+msg_error_t
MSG_task_receive_from_host(msg_task_t * task, const char *alias,
msg_host_t host)
{
* #MSG_OK if the task was successfully received,
* #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE otherwise.
*/
-MSG_error_t MSG_task_receive(msg_task_t * task, const char *alias)
+msg_error_t MSG_task_receive(msg_task_t * task, const char *alias)
{
return MSG_task_receive_with_timeout(task, alias, -1);
}
* #MSG_OK if the task was successfully received,
* #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE, or #MSG_TIMEOUT otherwise.
*/
-MSG_error_t
+msg_error_t
MSG_task_receive_with_timeout(msg_task_t * task, const char *alias,
double timeout)
{
* #MSG_OK if the task was successfully received,
* #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE, or #MSG_TIMEOUT otherwise.
*/
-MSG_error_t
+msg_error_t
MSG_task_receive_ext(msg_task_t * task, const char *alias, double timeout,
msg_host_t host)
{
xbt_dynar_push(s_comms, &comm->s_comm);
}
- MSG_error_t status = MSG_OK;
+ msg_error_t status = MSG_OK;
TRY {
finished_index = simcall_comm_testany(s_comms);
}
* \param comm the communication to wait.
* \param timeout Wait until the communication terminates or the timeout
* occurs. You can provide a -1 timeout to obtain an infinite timeout.
- * \return MSG_error_t
+ * \return msg_error_t
*/
-MSG_error_t MSG_comm_wait(msg_comm_t comm, double timeout)
+msg_error_t MSG_comm_wait(msg_comm_t comm, double timeout)
{
xbt_ex_t e;
TRY {
xbt_dynar_push(s_comms, &comm->s_comm);
}
- MSG_error_t status = MSG_OK;
+ msg_error_t status = MSG_OK;
TRY {
finished_index = simcall_comm_waitany(s_comms);
}
* \return the status of the communication, or #MSG_OK if no error occured
* during the communication
*/
-MSG_error_t MSG_comm_get_status(msg_comm_t comm) {
+msg_error_t MSG_comm_get_status(msg_comm_t comm) {
return comm->status;
}
* \return Returns #MSG_OK if the task was successfully sent,
* #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE otherwise.
*/
-MSG_error_t MSG_task_send(msg_task_t task, const char *alias)
+msg_error_t MSG_task_send(msg_task_t task, const char *alias)
{
XBT_DEBUG("MSG_task_send: Trying to send a message on mailbox '%s'", alias);
return MSG_task_send_with_timeout(task, alias, -1);
* \return Returns #MSG_OK if the task was successfully sent,
* #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE otherwise.
*/
-MSG_error_t
+msg_error_t
MSG_task_send_bounded(msg_task_t task, const char *alias, double maxrate)
{
task->simdata->rate = maxrate;
* \return Returns #MSG_OK if the task was successfully sent,
* #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE, or #MSG_TIMEOUT otherwise.
*/
-MSG_error_t
+msg_error_t
MSG_task_send_with_timeout(msg_task_t task, const char *alias,
double timeout)
{
* \brief Return the last value returned by a MSG function (except
* MSG_get_errno...).
*/
-MSG_error_t MSG_get_errno(void)
+msg_error_t MSG_get_errno(void)
{
return PROCESS_GET_ERRNO();
}
* #MSG_TRANSFER_FAILURE if the transfer could not be properly done
* (network failure, dest failure) or #MSG_OK if it succeeded.
*/
-MSG_error_t MSG_task_put(msg_task_t task, msg_host_t dest, m_channel_t channel)
+msg_error_t MSG_task_put(msg_task_t task, msg_host_t dest, m_channel_t channel)
{
XBT_WARN("DEPRECATED! Now use MSG_task_send");
return MSG_task_put_with_timeout(task, dest, channel, -1.0);
*
* \sa MSG_task_put
*/
-MSG_error_t
+msg_error_t
MSG_task_put_bounded(msg_task_t task, msg_host_t dest, m_channel_t channel,
double maxrate)
{
#MSG_TRANSFER_FAILURE if the transfer could not be properly done
(network failure, dest failure, timeout...) or #MSG_OK if the communication succeeded.
*/
-MSG_error_t
+msg_error_t
MSG_task_put_with_timeout(msg_task_t task, msg_host_t dest,
m_channel_t channel, double timeout)
{
listening. This value has to be >=0 and < than the maximal
number of channels fixed with MSG_set_channel_number().
* \param host the host that is to be watched.
- * \return a #MSG_error_t indicating whether the operation was successful (#MSG_OK), or why it failed otherwise.
+ * \return a #msg_error_t indicating whether the operation was successful (#MSG_OK), or why it failed otherwise.
*/
-MSG_error_t
+msg_error_t
MSG_task_get_from_host(msg_task_t * task, m_channel_t channel, msg_host_t host)
{
XBT_WARN("DEPRECATED! Now use MSG_task_receive_from_host");
* \param channel the channel on which the process should be
listening. This value has to be >=0 and < than the maximal
number of channels fixed with MSG_set_channel_number().
- * \return a #MSG_error_t indicating whether the operation was successful (#MSG_OK), or why it failed otherwise.
+ * \return a #msg_error_t indicating whether the operation was successful (#MSG_OK), or why it failed otherwise.
*/
-MSG_error_t MSG_task_get(msg_task_t * task, m_channel_t channel)
+msg_error_t MSG_task_get(msg_task_t * task, m_channel_t channel)
{
XBT_WARN("DEPRECATED! Now use MSG_task_receive");
return MSG_task_get_with_timeout(task, channel, -1);
up. In such a case, #MSG_TRANSFER_FAILURE will be returned, \a task
will not be modified and will still be
equal to \c NULL when returning.
- * \return a #MSG_error_t indicating whether the operation was successful (#MSG_OK), or why it failed otherwise.
+ * \return a #msg_error_t indicating whether the operation was successful (#MSG_OK), or why it failed otherwise.
*/
-MSG_error_t
+msg_error_t
MSG_task_get_with_timeout(msg_task_t * task, m_channel_t channel,
double max_duration)
{
return MSG_task_get_ext(task, channel, max_duration, NULL);
}
-MSG_error_t
+msg_error_t
MSG_task_get_ext(msg_task_t * task, m_channel_t channel, double timeout,
msg_host_t host)
{
* This functions checks whether some data has already been associated to \a host
or not and attach \a data to \a host if it is possible.
*/
-MSG_error_t MSG_host_set_data(msg_host_t host, void *data)
+msg_error_t MSG_host_set_data(msg_host_t host, void *data)
{
SIMIX_host_set_data(host->smx_host,data);
return mailbox;
}
-MSG_error_t
+msg_error_t
MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, msg_task_t * task,
msg_host_t host, double timeout)
{
xbt_ex_t e;
- MSG_error_t ret = MSG_OK;
+ msg_error_t ret = MSG_OK;
/* We no longer support getting a task from a specific host */
if (host)
THROW_UNIMPLEMENTED;
MSG_RETURN(ret);
}
-MSG_error_t
+msg_error_t
MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, msg_task_t task,
double timeout)
{
xbt_ex_t e;
- MSG_error_t ret = MSG_OK;
+ 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);
msg_task_t waiting_task;
char **argv; /* arguments table if any */
int argc; /* arguments number if any */
- MSG_error_t last_errno; /* the last value returned by a MSG_function */
+ msg_error_t last_errno; /* the last value returned by a MSG_function */
msg_vm_t vm; /* virtual machine the process is in */
smx_action_t s_comm; /* SIMIX communication object encapsulated (the same for both processes) */
msg_task_t task_sent; /* task sent (NULL for the receiver) */
msg_task_t *task_received; /* where the task will be received (NULL for the sender) */
- MSG_error_t status; /* status of the communication once finished */
+ msg_error_t status; /* status of the communication once finished */
} s_msg_comm_t;
typedef enum {
* This function checks whether \a process and \a host are valid pointers
and change the value of the #msg_host_t on which \a process is running.
*/
-MSG_error_t MSG_process_migrate(msg_process_t process, msg_host_t host)
+msg_error_t MSG_process_migrate(msg_process_t process, msg_host_t host)
{
simdata_process_t simdata = simcall_process_get_data(process);
simdata->m_host = host;
* This function checks whether \a process is a valid pointer or not
and sets the user data associated to this process.
*/
-MSG_error_t MSG_process_set_data(msg_process_t process, void *data)
+msg_error_t MSG_process_set_data(msg_process_t process, void *data)
{
xbt_assert(process != NULL, "Invalid parameter");
* \param process a process
* \param kill_time the time when the process is killed.
*/
-MSG_error_t MSG_process_set_kill_time(msg_process_t process, double kill_time)
+msg_error_t MSG_process_set_kill_time(msg_process_t process, double kill_time)
{
simcall_process_set_kill_time(process,kill_time);
return MSG_OK;
* This function suspends the process by suspending the task on which
* it was waiting for the completion.
*/
-MSG_error_t MSG_process_suspend(msg_process_t process)
+msg_error_t MSG_process_suspend(msg_process_t process)
{
xbt_assert(process != NULL, "Invalid parameter");
* This function resumes a suspended process by resuming the task on
* which it was waiting for the completion.
*/
-MSG_error_t MSG_process_resume(msg_process_t process)
+msg_error_t MSG_process_resume(msg_process_t process)
{
xbt_assert(process != NULL, "Invalid parameter");
* supposed to destroy it. The sender should not use it anymore.
* If the task failed to be sent, the sender remains the owner of the task.
*/
-MSG_error_t MSG_task_destroy(msg_task_t task)
+msg_error_t MSG_task_destroy(msg_task_t task)
{
smx_action_t action = NULL;
xbt_assert((task != NULL), "Invalid parameter");
* \param task the task to cancel. If it was executed or transfered, it
stops the process that were working on it.
*/
-MSG_error_t MSG_task_cancel(msg_task_t task)
+msg_error_t MSG_task_cancel(msg_task_t task)
{
xbt_assert((task != NULL), "Invalid parameter");
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
MSG_init(&argc, argv);
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ msg_error_t res = MSG_OK;
/* Verify if the platform xml file was passed by command line. */
MSG_init(&argc, argv);