X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c3cf07ae109e48e0a652017cfa5298faba688ccd..45c3f1cfee86fb48c96d53f8267f99b6db6e3d7a:/examples/msg/masterslave/masterslave_platfgen.c diff --git a/examples/msg/masterslave/masterslave_platfgen.c b/examples/msg/masterslave/masterslave_platfgen.c index f3a932cc0f..11d3c2fec7 100644 --- a/examples/msg/masterslave/masterslave_platfgen.c +++ b/examples/msg/masterslave/masterslave_platfgen.c @@ -1,3 +1,8 @@ +/* Copyright (c) 2012-2014. 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. */ #include "simgrid/platf_generator.h" #include "xbt.h" @@ -15,7 +20,6 @@ void labeler_1(context_edge_t edge); int master(int argc, char *argv[]); int slave(int argc, char *argv[]); - /** Promoter function * Just promote each node into a host, with fixed power */ @@ -24,8 +28,8 @@ void promoter_1(context_node_t node) { s_sg_platf_host_cbarg_t host_parameters; host_parameters.id = NULL; - host_parameters.power_peak = 1000000; - + host_parameters.power_peak = xbt_dynar_new(sizeof(double), NULL); + xbt_dynar_push_as(host_parameters.power_peak, double, 1000000.0); host_parameters.core_amount = 1; host_parameters.power_scale = 1; host_parameters.power_trace = NULL; @@ -182,8 +186,8 @@ int main(int argc, char **argv) { max_tries--; XBT_INFO("creating links..."); platf_graph_clear_links(); - platf_graph_interconnect_uniform(0.15); //Unrealistic, but simple - XBT_INFO("done. Check connectivity..."); + platf_graph_interconnect_uniform(0.07); //Unrealistic, but simple + XBT_INFO("done. Check connectedness..."); connected = platf_graph_is_connected(); XBT_INFO("Is it connected : %s", connected ? "yes" : (max_tries ? "no, retrying" : "no")); } while(!connected && max_tries); @@ -211,7 +215,7 @@ int main(int argc, char **argv) { msg_host_t host = NULL; msg_host_t host_master = NULL; xbt_dynar_t host_dynar = MSG_hosts_as_dynar(); - char** hostname_list = malloc(sizeof(char*) * xbt_dynar_length(host_dynar)); + char** hostname_list = xbt_malloc(sizeof(char*) * xbt_dynar_length(host_dynar)); xbt_dynar_foreach(host_dynar, i, host) { MSG_process_create("slave", slave, NULL, host);