X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3c3d12f53cae1413d15899def85f47a6b7318795..1a042c3771c14fdc9ec1a98ca60fc70ed933dc17:/examples/msg/masterslave/masterslave_mailbox.c diff --git a/examples/msg/masterslave/masterslave_mailbox.c b/examples/msg/masterslave/masterslave_mailbox.c index 4bdd10f9d3..80497e5aba 100644 --- a/examples/msg/masterslave/masterslave_mailbox.c +++ b/examples/msg/masterslave/masterslave_mailbox.c @@ -1,6 +1,5 @@ -/* $Id$ */ - -/* Copyright (c) 2002,2003,2004 Arnaud Legrand. All rights reserved. */ +/* Copyright (c) 2010. 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. */ @@ -29,8 +28,7 @@ int master(int argc, char *argv[]) int i; - printf("Got %ld slaves and %ld tasks to process\n", slaves_count,number_of_tasks); -// INFO2("Got %ld slaves and %ld tasks to process", slaves_count,number_of_tasks); + INFO2("Got %ld slaves and %ld tasks to process", slaves_count,number_of_tasks); for (i = 0; i < number_of_tasks; i++) { char mailbox[256]; @@ -40,13 +38,10 @@ int master(int argc, char *argv[]) sprintf(mailbox,"slave-%ld",i % slaves_count); sprintf(sprintf_buffer, "Task_%d", i); task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size, NULL); - if (number_of_tasks<10000 || i%10000 == 0) { - printf("Sending \"%s\" (of %ld) to mailbox \"%s\"\n", task->name, number_of_tasks, mailbox); - fflush(stdout); - } + if (number_of_tasks<10000 || i%10000 == 0) + INFO3("Sending \"%s\" (of %ld) to mailbox \"%s\"", task->name, number_of_tasks, mailbox); MSG_task_send(task, mailbox); - // INFO0("Sent"); } INFO0("All tasks have been dispatched. Let's tell everybody the computation is over."); @@ -54,11 +49,12 @@ int master(int argc, char *argv[]) char mailbox[80]; sprintf(mailbox,"slave-%ld",i % slaves_count); - MSG_task_send(MSG_task_create("finalize", 0, 0, 0), mailbox); + m_task_t finalize = MSG_task_create ("finalize", 0, 0, 0); + MSG_task_send(finalize, mailbox); } // INFO0("Goodbye now!"); - exit(0); + return 0; } /* end_of_master */ /** Receiver function */ @@ -100,7 +96,7 @@ MSG_error_t test_all(const char *platform_file, { MSG_error_t res = MSG_OK; - /* MSG_config("surf_workstation_model","KCCFLN05"); */ + /* MSG_config("workstation/model","KCCFLN05"); */ { /* Simulation setting */ MSG_set_channel_number(0); MSG_create_environment(platform_file); @@ -129,6 +125,7 @@ int main(int argc, char *argv[]) exit(1); } res = test_all(argv[1],argv[2]); + SIMIX_message_sizes_output("toto.txt"); MSG_clean(); if(res==MSG_OK)