X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c882e24932c718fad85c22cb546f30e158f1b31d..4365fa8e81736673eae923310a05cdbf78ec88d8:/examples/msg/masterslave/masterslave_platfgen.c diff --git a/examples/msg/masterslave/masterslave_platfgen.c b/examples/msg/masterslave/masterslave_platfgen.c index d9d8131f44..134fae7ae4 100644 --- a/examples/msg/masterslave/masterslave_platfgen.c +++ b/examples/msg/masterslave/masterslave_platfgen.c @@ -1,7 +1,12 @@ +/* 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" -#include "msg/msg.h" +#include "simgrid/msg.h" #include "xbt/log.h" XBT_LOG_NEW_DEFAULT_CATEGORY(test_generation, @@ -23,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; @@ -210,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);