X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3c3d12f53cae1413d15899def85f47a6b7318795..cc01c6a871dbbfd0cc84e26eb9f94aeb539e613e:/examples/msg/masterslave/masterslave_bypass.c?ds=sidebyside diff --git a/examples/msg/masterslave/masterslave_bypass.c b/examples/msg/masterslave/masterslave_bypass.c index 44cb2bf5c4..f6d3e2892e 100644 --- a/examples/msg/masterslave/masterslave_bypass.c +++ b/examples/msg/masterslave/masterslave_bypass.c @@ -1,6 +1,5 @@ -/* $Id$ */ - -/* Copyright (c) 2002,2003,2004 Arnaud Legrand. All rights reserved. */ +/* Copyright (c) 2007, 2008, 2009, 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. */ @@ -23,42 +22,36 @@ static int surf_parse_bypass_platform(void) /* allocating memory for the buffer, I think 2kB should be enough */ surfxml_bufferstack = xbt_new0(char, surfxml_bufferstack_size); - /* */ + DEBUG0(""); SURFXML_BUFFER_SET(platform_version, "2"); - SURFXML_START_TAG(platform); -/* */ + DEBUG0(""); + SURFXML_BUFFER_SET(AS_id, "AS0"); + SURFXML_BUFFER_SET(AS_routing, "Full"); + SURFXML_START_TAG(AS); + + DEBUG0(""); SURFXML_BUFFER_SET(host_id, "host A"); SURFXML_BUFFER_SET(host_power, "100000000.00"); SURFXML_BUFFER_SET(host_availability, "1.0"); SURFXML_BUFFER_SET(host_availability_file, ""); A_surfxml_host_state = A_surfxml_host_state_ON; SURFXML_BUFFER_SET(host_state_file, ""); - SURFXML_BUFFER_SET(host_interference_send, "1.0"); - SURFXML_BUFFER_SET(host_interference_recv, "1.0"); - SURFXML_BUFFER_SET(host_interference_send_recv, "1.0"); - SURFXML_BUFFER_SET(host_max_outgoing_rate, "-1.0"); - SURFXML_START_TAG(host); SURFXML_END_TAG(host); -/* */ + DEBUG0(""); SURFXML_BUFFER_SET(host_id, "host B"); SURFXML_BUFFER_SET(host_power, "100000000.00"); SURFXML_BUFFER_SET(host_availability, "1.0"); SURFXML_BUFFER_SET(host_availability_file, ""); A_surfxml_host_state = A_surfxml_host_state_ON; SURFXML_BUFFER_SET(host_state_file, ""); - SURFXML_BUFFER_SET(host_interference_send, "1.0"); - SURFXML_BUFFER_SET(host_interference_recv, "1.0"); - SURFXML_BUFFER_SET(host_interference_send_recv, "1.0"); - SURFXML_BUFFER_SET(host_max_outgoing_rate, "-1.0"); - SURFXML_START_TAG(host); SURFXML_END_TAG(host); -/* */ + DEBUG0(""); SURFXML_BUFFER_SET(link_id, "LinkA"); SURFXML_BUFFER_SET(link_bandwidth, "10000000.0"); SURFXML_BUFFER_SET(link_bandwidth_file, ""); @@ -70,38 +63,20 @@ static int surf_parse_bypass_platform(void) SURFXML_START_TAG(link); SURFXML_END_TAG(link); -/* */ + DEBUG0(""); SURFXML_BUFFER_SET(route_src, "host A"); SURFXML_BUFFER_SET(route_dst, "host B"); - SURFXML_BUFFER_SET(route_impact_on_src, "0.0"); - SURFXML_BUFFER_SET(route_impact_on_dst, "0.0"); - SURFXML_BUFFER_SET(route_impact_on_src_with_other_recv, "0.0"); - SURFXML_BUFFER_SET(route_impact_on_dst_with_other_send, "0.0"); - SURFXML_START_TAG(route); - - SURFXML_BUFFER_SET(link_c_ctn_id, "LinkA"); - SURFXML_START_TAG(link_c_ctn); - SURFXML_END_TAG(link_c_ctn); - + DEBUG0(" "); + SURFXML_BUFFER_SET(link_ctn_id, "LinkA"); + SURFXML_START_TAG(link_ctn); + SURFXML_END_TAG(link_ctn); + DEBUG0(""); SURFXML_END_TAG(route); -/* */ - SURFXML_BUFFER_SET(route_src, "host B"); - SURFXML_BUFFER_SET(route_dst, "host A"); - SURFXML_BUFFER_SET(route_impact_on_src, "0.0"); - SURFXML_BUFFER_SET(route_impact_on_dst, "0.0"); - SURFXML_BUFFER_SET(route_impact_on_src_with_other_recv, "0.0"); - SURFXML_BUFFER_SET(route_impact_on_dst_with_other_send, "0.0"); - - SURFXML_START_TAG(route); - - SURFXML_BUFFER_SET(link_c_ctn_id, "LinkA"); - SURFXML_START_TAG(link_c_ctn); - SURFXML_END_TAG(link_c_ctn); - - SURFXML_END_TAG(route); -/* */ + DEBUG0(""); + SURFXML_END_TAG(AS); + DEBUG0(""); SURFXML_END_TAG(platform); free(surfxml_bufferstack); @@ -112,7 +87,8 @@ static int surf_parse_bypass_application(void) { static int AX_ptr; static int surfxml_bufferstack_size = 2048; - + static int surfxml_buffer_stack_stack_ptr = 0; + static int surfxml_buffer_stack_stack[1024]; /* allocating memory to the buffer, I think 2MB should be enough */ surfxml_bufferstack = xbt_new0(char, surfxml_bufferstack_size); @@ -203,7 +179,8 @@ int master(int argc, char *argv[]) for (i = 0; i < number_of_tasks; i++) { sprintf(sprintf_buffer, "Task_%d", i); todo[i] = - MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size, NULL); + MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size, + NULL); } } @@ -240,7 +217,7 @@ int master(int argc, char *argv[]) } INFO0 - ("All tasks have been dispatched. Let's tell everybody the computation is over."); + ("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);