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
s/free/xbt_free/ and hope to hide bogus report from codacy.
[simgrid.git]
/
examples
/
msg
/
trace-masterworker
/
trace-masterworker.c
diff --git
a/examples/msg/trace-masterworker/trace-masterworker.c
b/examples/msg/trace-masterworker/trace-masterworker.c
index abe6badfa0bce24afa805932f5422c5d028dfa8d..8d69fb5963483405e7f63ef678a4d1ead3a2acdd 100644
(file)
--- a/
examples/msg/trace-masterworker/trace-masterworker.c
+++ b/
examples/msg/trace-masterworker/trace-masterworker.c
@@
-1,4
+1,4
@@
-/* Copyright (c) 2010-201
6
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-201
8
. 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. */
/* 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. */
@@
-19,8
+19,7
@@
static int master(int argc, char *argv[])
TRACE_mark("msmark", "start_send_tasks");
for (int i = 0; i < number_of_tasks; i++) {
TRACE_mark("msmark", "start_send_tasks");
for (int i = 0; i < number_of_tasks; i++) {
- msg_task_t task = NULL;
- task = MSG_task_create("task", task_comp_size, task_comm_size, NULL);
+ msg_task_t task = MSG_task_create("task", task_comp_size, task_comm_size, NULL);
//setting the variable "task_creation" to value i
TRACE_host_variable_set(MSG_host_get_name(MSG_host_self()), "task_creation", i);
//setting the variable "task_creation" to value i
TRACE_host_variable_set(MSG_host_get_name(MSG_host_self()), "task_creation", i);
@@
-50,12
+49,11
@@
static int worker(int argc, char *argv[])
while (1) {
MSG_task_receive(&(task), "master_mailbox");
while (1) {
MSG_task_receive(&(task), "master_mailbox");
- if (
!strcmp(MSG_task_get_name(task), "finalize")
) {
+ if (
strcmp(MSG_task_get_name(task), "finalize") == 0
) {
MSG_task_destroy(task);
break;
}
MSG_task_destroy(task);
break;
}
- //adding the value returned by MSG_task_get_compute_duration(task)
- //to the variable "task_computation"
+ // adding the value returned by MSG_task_get_compute_duration(task) to the variable "task_computation"
TRACE_host_variable_add(MSG_host_get_name(MSG_host_self()), "task_computation", MSG_task_get_flops_amount(task));
MSG_task_execute(task);
MSG_task_destroy(task);
TRACE_host_variable_add(MSG_host_get_name(MSG_host_self()), "task_computation", MSG_task_get_flops_amount(task));
MSG_task_execute(task);
MSG_task_destroy(task);