chord_initialize();
- MSG_set_channel_number(0);
MSG_create_environment(platform_file);
MSG_function_register("node", node);
chord_initialize();
- MSG_set_channel_number(0);
MSG_create_environment(platform_file);
MSG_function_register("node", node);
int timer_start = 1;
-typedef enum {
- PORT_22 = 0,
- MAX_CHANNEL
-} channel_t;
-
//keep a pointer to all surf running tasks.
#define NTASKS 1500
int bool_printed = 0;
/* MSG_config("workstation/model", "GTNETS"); */
/* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
- MSG_set_channel_number(MAX_CHANNEL);
MSG_create_environment(platform_file);
}
/* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
- MSG_set_channel_number(0);
MSG_create_environment(platform_file);
}
{ /* Application deployment */
/* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
- MSG_set_channel_number(0);
MSG_create_environment(platform_file);
}
{ /* Application deployment */
/* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
- MSG_set_channel_number(0);
MSG_create_environment(platform_file);
}
{ /* Application deployment */
int slave(int argc, char *argv[]);
MSG_error_t test_all(void);
-typedef enum {
- PORT_22 = 0,
- MAX_CHANNEL
-} channel_t;
-
/** Emitter function */
int master(int argc, char *argv[])
{
if (MSG_host_self() == slaves[i % slaves_count]) {
XBT_INFO("Hey ! It's me ! :)");
}
- MSG_task_put(todo[i], slaves[i % slaves_count], PORT_22);
+ MSG_task_send(todo[i], MSG_host_get_name(slaves[i % slaves_count]));
XBT_INFO("Send completed");
}
XBT_INFO
("All tasks have been dispatched. Let's tell everybody the computation is over.");
for (i = 0; i < slaves_count; i++)
- MSG_task_put(MSG_task_create("finalize", 0, 0, FINALIZE),
- slaves[i], PORT_22);
+ MSG_task_send(MSG_task_create("finalize", 0, 0, FINALIZE),
+ MSG_host_get_name(slaves[i]));
XBT_INFO("Goodbye now!");
free(slaves);
while (1) {
m_task_t task = NULL;
int a;
- a = MSG_task_get(&(task), PORT_22);
+ a = MSG_task_receive(&task, MSG_host_get_name(MSG_host_self()));
if (a == MSG_OK) {
XBT_INFO("Received \"%s\" ", MSG_task_get_name(task));
if (MSG_task_get_data(task) == FINALIZE) {
MSG_error_t res = MSG_OK;
/* Simulation setting */
- MSG_set_channel_number(MAX_CHANNEL);
surf_parse = surf_parse_bypass_platform;
MSG_create_environment(NULL);
int master(int argc, char *argv[]);
int slave(int argc, char *argv[]);
-typedef enum {
- PORT_22 = 0,
- MAX_CHANNEL
-} channel_t;
-
/** Emitter function */
int master(int argc, char *argv[])
{
if (MSG_host_self() == slaves[i % slaves_count]) {
XBT_INFO("Hey ! It's me ! :)");
}
- MSG_task_put(todo[i], slaves[i % slaves_count], PORT_22);
+ MSG_task_send(todo[i], MSG_host_get_name(slaves[i % slaves_count]));
XBT_INFO("Send completed");
}
XBT_INFO
("All tasks have been dispatched. Let's tell everybody the computation is over.");
for (i = 0; i < slaves_count; i++)
- MSG_task_put(MSG_task_create("finalize", 0, 0, FINALIZE),
- slaves[i], PORT_22);
+ MSG_task_send(MSG_task_create("finalize", 0, 0, FINALIZE),
+ MSG_host_get_name(slaves[i]));
XBT_INFO("Goodbye now!");
free(slaves);
while (1) {
m_task_t task = NULL;
int a;
- a = MSG_task_get(&(task), PORT_22);
+ a = MSG_task_receive(&(task), MSG_host_get_name(MSG_host_self()));
if (a == MSG_OK) {
XBT_INFO("Received \"%s\" ", MSG_task_get_name(task));
if (MSG_task_get_data(task) == FINALIZE) {
MSG_error_t test_all(const char *platform_file)
{
MSG_error_t res = MSG_OK;
- MSG_set_channel_number(MAX_CHANNEL);
MSG_create_environment(platform_file);
MSG_function_register("master", master);
MSG_function_register("slave", slave);
int slave(int argc, char *argv[]);
MSG_error_t test_all(const char *);
-typedef enum {
- PORT_22 = 0,
- MAX_CHANNEL
-} channel_t;
-
/** Emitter function */
int master(int argc, char *argv[])
{
MSG_error_t test_all(const char *file) //(void)
{
MSG_error_t res = MSG_OK;
- /* Simulation setting */
- MSG_set_channel_number(MAX_CHANNEL);
+
/*start by registering functions before loading script */
MSG_function_register("master", master);
MSG_function_register("slave", slave);
MSG_error_t test_all(const char *platform_file,
const char *application_file);
-typedef enum {
- PORT_22 = 0,
- MAX_CHANNEL
-} channel_t;
-
#define FINALIZE ((void*)221297) /* a magic number to tell people to stop working */
/** Emitter function */
int a;
*((double *) task->data) = MSG_get_clock();
- a = MSG_task_put_with_timeout(task, slaves[i % slaves_count], PORT_22,
- 10.0);
+ a = MSG_task_send_with_timeout(task,MSG_host_get_name(slaves[i % slaves_count]),10.0);
+
if (a == MSG_OK) {
XBT_INFO("Send completed");
} else if (a == MSG_HOST_FAILURE) {
("All tasks have been dispatched. Let's tell everybody the computation is over.");
for (i = 0; i < slaves_count; i++) {
m_task_t task = MSG_task_create("finalize", 0, 0, FINALIZE);
- int a = MSG_task_put_with_timeout(task, slaves[i], PORT_22, 1.0);
+ int a = MSG_task_send_with_timeout(task,MSG_host_get_name(slaves[i]),1.0);
if (a == MSG_OK)
continue;
if (a == MSG_HOST_FAILURE) {
double time1, time2;
time1 = MSG_get_clock();
- a = MSG_task_get(&(task), PORT_22);
+ a = MSG_task_receive( &(task), MSG_host_get_name(MSG_host_self()) );
time2 = MSG_get_clock();
if (a == MSG_OK) {
XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
/* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
- MSG_set_channel_number(MAX_CHANNEL);
MSG_create_environment(platform_file);
}
{ /* Application deployment */
MSG_error_t test_all(const char *platform_file,
const char *application_file);
-typedef enum {
- PORT_22 = 0,
- MAX_CHANNEL
-} channel_t;
-
#define FINALIZE ((void*)221297) /* a magic number to tell people to stop working */
/** Emitter function */
XBT_INFO("Hey ! It's me ! :)");
}
- MSG_task_put(todo[i], slaves[i % slaves_count], PORT_22);
+ MSG_task_send(todo[i], MSG_host_get_name(slaves[i % slaves_count]));
XBT_INFO("Sent");
}
("All tasks have been dispatched. Let's tell everybody the computation is over.");
for (i = 0; i < slaves_count; i++) {
m_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE);
- MSG_task_put(finalize, slaves[i], PORT_22);
+ MSG_task_send(finalize, MSG_host_get_name(slaves[i]));
}
XBT_INFO("Goodbye now!");
m_task_t task = NULL;
_XBT_GNUC_UNUSED int res;
while (1) {
- res = MSG_task_get(&(task), PORT_22);
+ res = MSG_task_receive(&(task),MSG_host_get_name(MSG_host_self()));
xbt_assert(res == MSG_OK, "MSG_task_get failed");
XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
while (1) {
m_task_t task = NULL;
int a;
- a = MSG_task_get(&(task), PORT_22);
+ a = MSG_task_receive(&(task),MSG_host_get_name(MSG_host_self()));
if (a == MSG_OK) {
XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
if (MSG_task_get_data(task) == FINALIZE) {
XBT_INFO
("All tasks have been dispatched. Let's tell everybody the computation is over.");
for (i = 0; i < slaves_count; i++)
- MSG_task_put(MSG_task_create("finalize", 0, 0, FINALIZE),
- slaves[i], PORT_22);
+ MSG_task_send(MSG_task_create("finalize", 0, 0, FINALIZE),
+ MSG_host_get_name(slaves[i]));
MSG_task_destroy(task);
break;
}
XBT_INFO("Sending \"%s\" to \"%s\"",
MSG_task_get_name(task), slaves[i % slaves_count]->name);
- MSG_task_put(task, slaves[i % slaves_count], PORT_22);
+ MSG_task_send(task, MSG_host_get_name(slaves[i % slaves_count]));
i++;
} else {
XBT_INFO("Hey ?! What's up ? ");
/* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
- MSG_set_channel_number(MAX_CHANNEL);
MSG_create_environment(platform_file);
}
{ /* Application deployment */
/* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
- MSG_set_channel_number(0);
MSG_create_environment(platform_file);
}
{ /* Application deployment */
m_host_t *hosts;
MSG_config("workstation/model", "ptask_L07");
- MSG_set_channel_number(1);
MSG_create_environment(platform_file);
hosts = MSG_get_host_table();
MSG_error_t test_all(const char *platform_file,
const char *application_file);
-typedef enum {
- PORT_22 = 0,
- MAX_CHANNEL
-} channel_t;
-
int execute(int argc, char *argv[])
{
MSG_config("workstation/model", "ptask_L07");
/* Simulation setting */
- MSG_set_channel_number(MAX_CHANNEL);
MSG_create_environment(platform_file);
/* Application deployment */
MSG_error_t res = MSG_OK;
{ /* Simulation setting */
- MSG_set_channel_number(1);
MSG_create_environment(platform_file);
}
{ /* Application deployment */
MSG_error_t test_all(const char *platform_file,
const char *application_file);
-typedef enum {
- PORT_22 = 0,
- MAX_CHANNEL
-} channel_t;
-
double task_comm_size_lat = 10e0;
double task_comm_size_bw = 10e8;
task_la->data = xbt_new(double, 1);
*(double *) task_la->data = time;
XBT_INFO("task_la->data = %le", *((double *) task_la->data));
- MSG_task_put(task_la, host, PORT_22);
+ MSG_task_send(task_la, argv[1]);
/* Bandwidth */
time = MSG_get_clock();
task_bw->data = xbt_new(double, 1);
*(double *) task_bw->data = time;
XBT_INFO("task_bw->data = %le", *((double *) task_bw->data));
- MSG_task_put(task_bw, host, PORT_22);
+ MSG_task_send(task_bw, argv[1]);
return 0;
} /* end_of_client */
time = MSG_get_clock();
/* Get Latency */
- a = MSG_task_get(&task_la, PORT_22);
+ a = MSG_task_receive(&task_la,MSG_host_get_name(MSG_host_self()));
if (a == MSG_OK) {
time1 = MSG_get_clock();
sender_time = *((double *) (task_la->data));
/* Get Bandwidth */
- a = MSG_task_get(&task_bw, PORT_22);
+ a = MSG_task_receive(&task_bw,MSG_host_get_name(MSG_host_self()));
if (a == MSG_OK) {
time1 = MSG_get_clock();
sender_time = *((double *) (task_bw->data));
XBT_INFO("test_all");
/* Simulation setting */
- MSG_set_channel_number(MAX_CHANNEL);
MSG_create_environment(platform_file);
/* Application deployment */
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
"Messages specific for this msg example");
-typedef enum {
- PORT_22 = 0,
- MAX_CHANNEL
-} channel_t;
-
/** Lazy guy function. This process suspends itself asap. */
static int lazy_guy(int argc, char *argv[])
MSG_error_t res = MSG_OK;
{ /* Simulation setting */
- MSG_set_channel_number(MAX_CHANNEL);
MSG_create_environment(platform_file);
}
{ /* Application deployment */
return 0;
}
-typedef enum {
- PORT_22 = 20,
- MAX_CHANNEL
-} channel_t;
-
int main(int argc, char **argv)
{
int i,res;
MSG_global_init(&argc, argv);
- MSG_set_channel_number(MAX_CHANNEL);
MSG_create_environment(argv[1]);
m_host_t *host_table = MSG_get_host_table();
number_of_hosts = MSG_get_host_number();
static int send(int argc, char *argv[])
{
XBT_INFO("Sending");
- MSG_task_put(MSG_task_create("Blah", 0.0, 0.0, NULL), MSG_host_self(),
- 0);
+ MSG_task_send(MSG_task_create("Blah", 0.0, 0.0, NULL), MSG_host_get_name(MSG_host_self()));
MSG_process_sleep(1.); /* FIXME: if the sender exits before the receiver calls get_sender(), bad thing happens */
XBT_INFO("Exiting");
return 0;
{
XBT_INFO("Receiving");
m_task_t task = NULL;
- MSG_task_get_with_timeout(&task, 0, DBL_MAX);
+ MSG_task_receive_with_timeout(&task, MSG_host_get_name(MSG_host_self()), DBL_MAX);
xbt_assert(MSG_task_get_sender(task), "No sender received");
XBT_INFO("Got a message sent by '%s'",
MSG_process_get_name(MSG_task_get_sender(task)));
MSG_error_t res = MSG_OK;
MSG_global_init(&argc, argv);
- MSG_set_channel_number(100);
/* Application deployment */
MSG_function_register("send", &send);