A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleaner patch for issue 15.
[simgrid.git]
/
examples
/
msg
/
masterslave
/
masterslave_platfgen.c
diff --git
a/examples/msg/masterslave/masterslave_platfgen.c
b/examples/msg/masterslave/masterslave_platfgen.c
index
e26fb1d
..
e2496d9
100644
(file)
--- a/
examples/msg/masterslave/masterslave_platfgen.c
+++ b/
examples/msg/masterslave/masterslave_platfgen.c
@@
-1,7
+1,12
@@
+/* Copyright (c) 2012-2015. 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 "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,
#include "xbt/log.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(test_generation,
@@
-15,7
+20,6
@@
void labeler_1(context_edge_t edge);
int master(int argc, char *argv[]);
int slave(int argc, char *argv[]);
int master(int argc, char *argv[]);
int slave(int argc, char *argv[]);
-
/** Promoter function
* Just promote each node into a host, with fixed power
*/
/** Promoter function
* Just promote each node into a host, with fixed power
*/
@@
-24,12
+28,12
@@
void promoter_1(context_node_t node) {
s_sg_platf_host_cbarg_t host_parameters;
host_parameters.id = NULL;
s_sg_platf_host_cbarg_t host_parameters;
host_parameters.id = NULL;
- host_parameters.
power_peak = 1000000
;
-
+ host_parameters.
speed_peak = xbt_dynar_new(sizeof(double), NULL)
;
+ xbt_dynar_push_as(host_parameters.speed_peak, double, 1000000.0);
host_parameters.core_amount = 1;
host_parameters.core_amount = 1;
- host_parameters.
power
_scale = 1;
- host_parameters.
power
_trace = NULL;
- host_parameters.initial
_state = SURF_RESOURCE_ON
;
+ host_parameters.
speed
_scale = 1;
+ host_parameters.
speed
_trace = NULL;
+ host_parameters.initial
lyOn = 1
;
host_parameters.state_trace = NULL;
host_parameters.coord = NULL;
host_parameters.properties = NULL;
host_parameters.state_trace = NULL;
host_parameters.coord = NULL;
host_parameters.properties = NULL;
@@
-48,7
+52,7
@@
void labeler_1(context_edge_t edge) {
link_parameters.bandwidth_trace = NULL;
link_parameters.latency = 0.01;
link_parameters.latency_trace = NULL;
link_parameters.bandwidth_trace = NULL;
link_parameters.latency = 0.01;
link_parameters.latency_trace = NULL;
- link_parameters.
state = SURF_RESOURCE_ON
;
+ link_parameters.
initiallyOn = 1
;
link_parameters.state_trace = NULL;
link_parameters.policy = SURF_LINK_SHARED;
link_parameters.properties = NULL;
link_parameters.state_trace = NULL;
link_parameters.policy = SURF_LINK_SHARED;
link_parameters.properties = NULL;
@@
-70,12
+74,12
@@
int master(int argc, char *argv[])
task_comp_size = 2400000*argc;
task_comm_size = 1000000;
task_comp_size = 2400000*argc;
task_comm_size = 1000000;
- { /* Process organi
s
ation */
+ { /* Process organi
z
ation */
slaves_count = argc;
slaves = xbt_new0(msg_host_t, slaves_count);
for (i = 0; i < argc; i++) {
slaves_count = argc;
slaves = xbt_new0(msg_host_t, slaves_count);
for (i = 0; i < argc; i++) {
- slaves[i] = MSG_
get_
host_by_name(argv[i]);
+ slaves[i] = MSG_host_by_name(argv[i]);
if (slaves[i] == NULL) {
XBT_INFO("Unknown host %s. Stopping Now! ", argv[i]);
abort();
if (slaves[i] == NULL) {
XBT_INFO("Unknown host %s. Stopping Now! ", argv[i]);
abort();
@@
-170,7
+174,7
@@
int main(int argc, char **argv) {
int connected;
int max_tries = 10;
int connected;
int max_tries = 10;
- //MSG initiali
s
ation
+ //MSG initiali
z
ation
MSG_init(&argc, argv);
//Set up the seed for the platform generation
MSG_init(&argc, argv);
//Set up the seed for the platform generation
@@
-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();
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);
xbt_dynar_foreach(host_dynar, i, host) {
MSG_process_create("slave", slave, NULL, host);