From: Frederic Suter Date: Thu, 27 Jul 2017 12:31:44 +0000 (+0200) Subject: Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid X-Git-Tag: v3_17~316^2~4 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/48eb2f1b9262fc74f527816c348ed2aa6efa9f65?hp=ec09841c5c348a41ad076a0c5beae57448c1923e Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c2ea590b5..40d0e0bd4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -950,11 +950,6 @@ message(" version .............: ${CMAKE_CXX_COMPILER_VERSION}") if(${Java_FOUND}) message(" Compiler: Javac .............: ${Java_JAVAC_EXECUTABLE}") message(" version .............: ${Java_VERSION_STRING}") -if(${SWIG_FOUND}) - message(" SWIG ................: Version ${SWIG_VERSION} found.") -else() - message(" SWIG ................: Missing.") -endif() endif() if(CMAKE_Fortran_COMPILER) message(" Compiler: Fortran ...........: ${SMPI_Fortran_COMPILER} (id: ${CMAKE_Fortran_COMPILER_ID})") diff --git a/examples/msg/app-chainsend/broadcaster.c b/examples/msg/app-chainsend/broadcaster.c index 61a1acaa8a..79612fcce3 100644 --- a/examples/msg/app-chainsend/broadcaster.c +++ b/examples/msg/app-chainsend/broadcaster.c @@ -114,9 +114,9 @@ int broadcaster(int argc, char *argv[]) /* argv[2] is the number of pieces */ if (argc > 2) { piece_count = xbt_str_parse_int(argv[2], "Invalid number of pieces: %s"); - XBT_DEBUG("piece_count set to %d", piece_count); + XBT_DEBUG("piece_count set to %u", piece_count); } else { - XBT_DEBUG("No piece_count specified, defaulting to %d", piece_count); + XBT_DEBUG("No piece_count specified, defaulting to %u", piece_count); } broadcaster_t bc = broadcaster_init(host_list, piece_count); diff --git a/examples/msg/app-chainsend/peer.c b/examples/msg/app-chainsend/peer.c index de72e553c0..1201149f02 100644 --- a/examples/msg/app-chainsend/peer.c +++ b/examples/msg/app-chainsend/peer.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2014. The SimGrid Team. +/* Copyright (c) 2012-2014, 2016-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -29,11 +29,11 @@ int peer_execute_task(peer_t peer, msg_task_t task) int done = 0; message_t msg = MSG_task_get_data(task); - XBT_DEBUG("Peer %s got message of type %d\n", peer->me, msg->type); + XBT_DEBUG("Peer %s got message of type %u\n", peer->me, msg->type); if (msg->type == MESSAGE_BUILD_CHAIN) peer_init_chain(peer, msg); else if (msg->type == MESSAGE_SEND_DATA) { - xbt_assert(peer->init, "peer_execute_task() failed: got msg_type %d before initialization", msg->type); + xbt_assert(peer->init, "peer_execute_task() failed: got msg_type %u before initialization", msg->type); if (peer->next != NULL) peer_forward_msg(peer, msg); peer->pieces++; @@ -63,7 +63,7 @@ msg_error_t peer_wait_for_message(peer_t peer) if (idx != -1) { comm = xbt_dynar_get_as(peer->pending_recvs, idx, msg_comm_t); status = MSG_comm_get_status(comm); - XBT_DEBUG("peer_wait_for_message: error code = %d", status); + XBT_DEBUG("peer_wait_for_message: error code = %u", status); xbt_assert(status == MSG_OK, "peer_wait_for_message() failed"); task = MSG_comm_get_task(comm); diff --git a/examples/msg/cloud-masterworker/cloud-masterworker.c b/examples/msg/cloud-masterworker/cloud-masterworker.c index 17242ba56d..86449a44ee 100644 --- a/examples/msg/cloud-masterworker/cloud-masterworker.c +++ b/examples/msg/cloud-masterworker/cloud-masterworker.c @@ -122,8 +122,8 @@ static int master_fun(int argc, char *argv[]) XBT_INFO("# Add one more process on each VM"); xbt_dynar_foreach(vms, i, vm) { unsigned int index = i + xbt_dynar_length(vms); - char *vm_name = bprintf("VM%02d", i); - char *pr_name = bprintf("WRK%02d", index); + char* vm_name = bprintf("VM%02u", i); + char* pr_name = bprintf("WRK%02u", index); XBT_INFO("put a process (%s) on %s", pr_name, vm_name); MSG_process_create(pr_name, worker_fun, NULL, (msg_host_t)vm); diff --git a/examples/msg/dht-kademlia/answer.c b/examples/msg/dht-kademlia/answer.c index 6fb5f75de2..14b90202de 100644 --- a/examples/msg/dht-kademlia/answer.c +++ b/examples/msg/dht-kademlia/answer.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2014. The SimGrid Team. +/* Copyright (c) 2012-2014, 2016-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -35,9 +35,9 @@ void answer_print(answer_t answer) { unsigned int cpt; node_contact_t contact; - XBT_INFO("Searching %08x, size %d", answer->destination_id, answer->size); + XBT_INFO("Searching %08x, size %u", answer->destination_id, answer->size); xbt_dynar_foreach(answer->nodes, cpt, contact) { - XBT_INFO("Node %08x: %08x is at distance %d", cpt, contact->id, contact->distance); + XBT_INFO("Node %08x: %08x is at distance %u", cpt, contact->id, contact->distance); } } diff --git a/examples/msg/dht-kademlia/dht-kademlia.c b/examples/msg/dht-kademlia/dht-kademlia.c index c0c69997e3..d40ca6c935 100644 --- a/examples/msg/dht-kademlia/dht-kademlia.c +++ b/examples/msg/dht-kademlia/dht-kademlia.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2014-2016. The SimGrid Team. +/* Copyright (c) 2012, 2014-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -96,7 +96,7 @@ static int node(int argc, char *argv[]) XBT_INFO("I couldn't join the network :("); } XBT_DEBUG("I'm leaving the network"); - XBT_INFO("%d/%d FIND_NODE have succeeded", node->find_node_success, node->find_node_success + node->find_node_failed); + XBT_INFO("%u/%u FIND_NODE have succeeded", node->find_node_success, node->find_node_success + node->find_node_failed); node_free(node); return 0; @@ -229,8 +229,8 @@ unsigned int find_node(node_t node, unsigned int id_to_find, unsigned int count_ answers++; nodes_added = answer_merge(node_list, data->answer); - XBT_DEBUG("Received an answer from %s (%s) with %ld nodes on it", - data->answer_to, data->issuer_host_name, xbt_dynar_length(data->answer->nodes)); + XBT_DEBUG("Received an answer from %s (%s) with %lu nodes on it", data->answer_to, data->issuer_host_name, + xbt_dynar_length(data->answer->nodes)); task_free(node->task_received); } else { @@ -254,12 +254,12 @@ unsigned int find_node(node_t node, unsigned int id_to_find, unsigned int count_ if (count_in_stats) node->find_node_success++; if (queries > 4) - XBT_VERB("FIND_NODE on %08x success in %d steps", id_to_find, steps); + XBT_VERB("FIND_NODE on %08x success in %u steps", id_to_find, steps); node_routing_table_update(node, id_to_find); } else { if (count_in_stats) { node->find_node_failed++; - XBT_VERB("%08x not found in %d steps", id_to_find, steps); + XBT_VERB("%08x not found in %u steps", id_to_find, steps); } } answer_free(node_list); diff --git a/examples/msg/dht-kademlia/node.c b/examples/msg/dht-kademlia/node.c index c0741d681c..2d8c22fd54 100644 --- a/examples/msg/dht-kademlia/node.c +++ b/examples/msg/dht-kademlia/node.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2012-2016. The SimGrid Team. +/* Copyright (c) 2010, 2012-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -20,7 +20,7 @@ node_t node_init(unsigned int node_id) node->id = node_id; node->table = routing_table_init(node_id); - snprintf(node->mailbox,MAILBOX_NAME_SIZE-1, "%d", node_id); + snprintf(node->mailbox, MAILBOX_NAME_SIZE - 1, "%u", node_id); node->find_node_failed = 0; node->find_node_success = 0; @@ -139,7 +139,7 @@ unsigned int get_node_prefix(unsigned int id, unsigned int nb_bits) /** @brief Gets the mailbox name of a host given its identifier */ void get_node_mailbox(unsigned int id, char *mailbox) { - snprintf(mailbox,MAILBOX_NAME_SIZE-1, "%d", id); + snprintf(mailbox, MAILBOX_NAME_SIZE - 1, "%u", id); } /** Constructor, build a new contact information. */ diff --git a/examples/msg/dht-kademlia/routing_table.c b/examples/msg/dht-kademlia/routing_table.c index f0d6a6e6e5..a109676157 100644 --- a/examples/msg/dht-kademlia/routing_table.c +++ b/examples/msg/dht-kademlia/routing_table.c @@ -51,9 +51,9 @@ void routing_table_print(routing_table_t table) for (unsigned int i = 0; i <= identifier_size; i++) { if (!xbt_dynar_is_empty(table->buckets[i].nodes)) { - XBT_INFO("Bucket number %d: ", i); + XBT_INFO("Bucket number %u: ", i); xbt_dynar_foreach(table->buckets[i].nodes, j, value) { - XBT_INFO("Element %d: %08x", j, value); + XBT_INFO("Element %u: %08x", j, value); } } } diff --git a/examples/msg/dht-pastry/dht-pastry.c b/examples/msg/dht-pastry/dht-pastry.c index 517797e6d8..1c029d2aca 100644 --- a/examples/msg/dht-pastry/dht-pastry.c +++ b/examples/msg/dht-pastry/dht-pastry.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015. The SimGrid Team. +/* Copyright (c) 2013-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -32,12 +32,12 @@ static int timeout = 50; static int max_simulation_time = 1000; typedef struct s_node { - int id; //128bits generated random(2^128 -1) - int known_id; + unsigned id; // 128bits generated random(2^128 -1) + unsigned known_id; char mailbox[MAILBOX_NAME_SIZE]; // my mailbox name (string representation of the id) - int namespace_set[NAMESPACE_SIZE]; - int neighborhood_set[NEIGHBORHOOD_SIZE]; - int routing_table[LEVELS_COUNT][LEVEL_SIZE]; + unsigned namespace_set[NAMESPACE_SIZE]; + unsigned neighborhood_set[NEIGHBORHOOD_SIZE]; + unsigned routing_table[LEVELS_COUNT][LEVEL_SIZE]; int ready; msg_comm_t comm_receive; // current communication to receive xbt_dynar_t pending_tasks; @@ -45,10 +45,10 @@ typedef struct s_node { typedef s_node_t* node_t; typedef struct s_state { - int id; - int namespace_set[NAMESPACE_SIZE]; - int neighborhood_set[NEIGHBORHOOD_SIZE]; - int routing_table[LEVELS_COUNT][LEVEL_SIZE]; + unsigned id; + unsigned namespace_set[NAMESPACE_SIZE]; + unsigned neighborhood_set[NEIGHBORHOOD_SIZE]; + unsigned routing_table[LEVELS_COUNT][LEVEL_SIZE]; } s_state_t; typedef s_state_t* state_t; @@ -62,9 +62,9 @@ typedef enum { typedef struct s_task_data { e_task_type_t type; // type of task - int sender_id; // id parameter (used by some types of tasks) - //int request_finger; // finger parameter (used by some types of tasks) - int answer_id; // answer (used by some types of tasks) + unsigned sender_id; // id parameter (used by some types of tasks) + // int request_finger; // finger parameter (used by some types of tasks) + unsigned answer_id; // answer (used by some types of tasks) char answer_to[MAILBOX_NAME_SIZE]; // mailbox to send an answer to (if any) //const char* issuer_host_name; // used for logging int steps; @@ -190,7 +190,7 @@ static state_t node_get_state(node_t node) { } static void print_node_id(node_t node) { - XBT_INFO(" Id: %i '%08x' ", node->id, node->id); + XBT_INFO(" Id: %u '%08x' ", node->id, node->id); } static void print_node_neighborood_set(node_t node) { @@ -230,14 +230,14 @@ static void handle_task(node_t node, msg_task_t task) { int j; int min; int max; - int next; + unsigned next; msg_task_t task_sent; task_data_t req_data; task_data_t task_data = (task_data_t) MSG_task_get_data(task); e_task_type_t type = task_data->type; // If the node is not ready keep the task for later if (node->ready != 0 && !(type==TASK_JOIN_LAST_REPLY || type==TASK_JOIN_REPLY)) { - XBT_DEBUG("Task pending %i", type); + XBT_DEBUG("Task pending %u", type); xbt_dynar_push(node->pending_tasks, &task); return; } @@ -259,7 +259,7 @@ static void handle_task(node_t node, msg_task_t task) { task_data->steps++; task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, task_data); if (MSG_task_send_with_timeout(task_sent, mailbox, timeout)== MSG_TIMEOUT) { - XBT_DEBUG("Timeout expired when forwarding join to next %d", next); + XBT_DEBUG("Timeout expired when forwarding join to next %u", next); task_free(task_sent); } type = TASK_JOIN_REPLY; @@ -272,7 +272,7 @@ static void handle_task(node_t node, msg_task_t task) { req_data->state = node_get_state(node); task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data); if (MSG_task_send_with_timeout(task_sent, task_data->answer_to, timeout)== MSG_TIMEOUT) { - XBT_DEBUG("Timeout expired when sending back the current node state to the joining node to %d", node->id); + XBT_DEBUG("Timeout expired when sending back the current node state to the joining node to %u", node->id); task_free(task_sent); } break; @@ -311,7 +311,7 @@ static void handle_task(node_t node, msg_task_t task) { node->ready--; // if the node is ready, do all the pending tasks and send update to known nodes if (node->ready==0) { - XBT_DEBUG("Node %i is ready!!!", node->id); + XBT_DEBUG("Node %u is ready!!!", node->id); while(xbt_dynar_length(node->pending_tasks)){ msg_task_t task; xbt_dynar_shift(node->pending_tasks, &task); @@ -342,10 +342,10 @@ static void handle_task(node_t node, msg_task_t task) { break; /* Received an update of state */ case TASK_UPDATE: - XBT_DEBUG("Task update %i !!!", node->id); + XBT_DEBUG("Task update %u !!!", node->id); /* Update namespace ses */ - XBT_INFO("Task update from %i !!!", task_data->sender_id); + XBT_INFO("Task update from %u !!!", task_data->sender_id); XBT_INFO("Node:"); print_node_id(node); print_node_namespace_set(node); @@ -447,7 +447,7 @@ static int join(node_t node){ msg_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data); XBT_DEBUG("Trying to join Pastry ring... (with node %s)", mailbox); if (MSG_task_send_with_timeout(task_sent, mailbox, timeout)== MSG_TIMEOUT) { - XBT_DEBUG("Timeout expired when joining ring with node %d", node->known_id); + XBT_DEBUG("Timeout expired when joining ring with node %u", node->known_id); task_free(task_sent); } diff --git a/examples/msg/mc/bugged2.c b/examples/msg/mc/bugged2.c index 90dba114cb..fdcc4ecea3 100644 --- a/examples/msg/mc/bugged2.c +++ b/examples/msg/mc/bugged2.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2015. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2017. 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,25 +23,25 @@ static int server(int argc, char *argv[]) long val1 = xbt_str_parse_int(MSG_task_get_name(task1), "Task name is not a numerical ID: %s"); MSG_task_destroy(task1); task1 = NULL; - XBT_INFO("Received %lu", val1); + XBT_INFO("Received %ld", val1); MSG_task_receive(&task2, "mymailbox"); long val2 = xbt_str_parse_int(MSG_task_get_name(task2), "Task name is not a numerical ID: %s"); MSG_task_destroy(task2); task2 = NULL; - XBT_INFO("Received %lu", val2); + XBT_INFO("Received %ld", val2); MC_assert(MIN(val1, val2) == 1); MSG_task_receive(&task1, "mymailbox"); val1 = xbt_str_parse_int(MSG_task_get_name(task1), "Task name is not a numerical ID: %s"); MSG_task_destroy(task1); - XBT_INFO("Received %lu", val1); + XBT_INFO("Received %ld", val1); MSG_task_receive(&task2, "mymailbox"); val2 = xbt_str_parse_int(MSG_task_get_name(task2), "Task name is not a numerical ID: %s"); MSG_task_destroy(task2); - XBT_INFO("Received %lu", val2); + XBT_INFO("Received %ld", val2); XBT_INFO("OK"); return 0; diff --git a/examples/msg/mc/bugged3.c b/examples/msg/mc/bugged3.c index 879c37d9ea..5e805d9f18 100644 --- a/examples/msg/mc/bugged3.c +++ b/examples/msg/mc/bugged3.c @@ -29,7 +29,7 @@ static int server(int argc, char *argv[]) MSG_comm_wait(comm2, -1); long val1 = xbt_str_parse_int(MSG_task_get_name(task1), "Task name is not a numerical ID: %s"); - XBT_INFO("Received %lu", val1); + XBT_INFO("Received %ld", val1); MC_assert(val1 == 2); diff --git a/examples/simdag/dag-dotload/sd_dag-dotload.c b/examples/simdag/dag-dotload/sd_dag-dotload.c index 176bd08ddd..7dfd2f0cd2 100644 --- a/examples/simdag/dag-dotload/sd_dag-dotload.c +++ b/examples/simdag/dag-dotload/sd_dag-dotload.c @@ -1,6 +1,6 @@ /* simple test trying to load a DOT file. */ -/* Copyright (c) 2010-2015. The SimGrid Team. +/* Copyright (c) 2010-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -95,7 +95,7 @@ int main(int argc, char **argv) sg_host_get_name(wsl[0]), sg_host_get_name(wsl[1]), SD_task_get_amount(task), SD_task_get_name(task)); break; default: - xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task)); + xbt_die("Task %s is of unknown kind %u", SD_task_get_name(task), SD_task_get_kind(task)); } SD_task_destroy(task); } diff --git a/examples/simdag/daxload/sd_daxload.c b/examples/simdag/daxload/sd_daxload.c index ef3d029fcf..8276fc92da 100644 --- a/examples/simdag/daxload/sd_daxload.c +++ b/examples/simdag/daxload/sd_daxload.c @@ -1,6 +1,6 @@ /* simple test trying to load a DAX file. */ -/* Copyright (c) 2009-2015. The SimGrid Team. +/* Copyright (c) 2009-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -101,7 +101,7 @@ int main(int argc, char **argv) sg_host_get_name(wsl[0]), SD_task_get_amount(task), SD_task_get_name(task)); break; default: - xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task)); + xbt_die("Task %s is of unknown kind %u", SD_task_get_name(task), SD_task_get_kind(task)); } SD_task_destroy(task); } diff --git a/examples/simdag/schedule-dotload/sd_schedule-dotload.c b/examples/simdag/schedule-dotload/sd_schedule-dotload.c index aa77528c9f..f4f1355ec4 100644 --- a/examples/simdag/schedule-dotload/sd_schedule-dotload.c +++ b/examples/simdag/schedule-dotload/sd_schedule-dotload.c @@ -1,6 +1,6 @@ /* simple test trying to load a DOT file. */ -/* Copyright (c) 2010-2016. The SimGrid Team. +/* Copyright (c) 2010-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -73,7 +73,7 @@ int main(int argc, char **argv) sg_host_get_name(wsl[0]), sg_host_get_name(wsl[1]), SD_task_get_amount(task), SD_task_get_name(task)); break; default: - xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task)); + xbt_die("Task %s is of unknown kind %u", SD_task_get_name(task), SD_task_get_kind(task)); } SD_task_destroy(task); } diff --git a/examples/simdag/test/sd_test.cpp b/examples/simdag/test/sd_test.cpp index 5ba0bc0dd0..3b3de64480 100644 --- a/examples/simdag/test/sd_test.cpp +++ b/examples/simdag/test/sd_test.cpp @@ -1,16 +1,16 @@ -/* Copyright (c) 2006-2015. The SimGrid Team. +/* Copyright (c) 2006-2017. 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/simdag.h" #include "simgrid/s4u.hpp" +#include "simgrid/simdag.h" #include "xbt/ex.h" -#include #include "xbt/log.h" -#include +#include #include +#include XBT_LOG_NEW_DEFAULT_CATEGORY(sd_test, "Logging specific to this SimDag example"); diff --git a/examples/smpi/NAS/dt.c b/examples/smpi/NAS/dt.c index 7dacc29df8..45398c9a87 100644 --- a/examples/smpi/NAS/dt.c +++ b/examples/smpi/NAS/dt.c @@ -180,14 +180,14 @@ static DGraph *buildSH(const char cls){ tmpS>>=1; } for(i=0;i/dev/null) if [ -n "${HAVE_SEQ}" ]; then - SEQ1=$( ${HAVE_SEQ} 0 $(( $NUMPROCSMINE - 1 )) ) + SEQ1=$( ${HAVE_SEQ} 0 $(( NUMPROCSMINE - 1 )) ) else cnt=0 - while (( $cnt < $NUMPROCSMINE )) ; do - SEQ1="$SEQ1 $cnt" - cnt=$((cnt + 1)); + while (( cnt < NUMPROCSMINE )) ; do + SEQ1="$SEQ1 $cnt" + cnt=$((cnt + 1)) done fi - #NUMPROCS=$((${NUMPROCS}+${NUMPROCSMINE})); + #NUMPROCS=$(( NUMPROCS + NUMPROCSMINE )); for i in $SEQ1 ##---------------------------------------------------------- ## generate application.xml with hostnames from hostfile: @@ -166,7 +166,7 @@ if [ -n "${DESCRIPTIONFILE}" ] && [ -f "${DESCRIPTIONFILE}" ]; then ##---- generate tags------------------------------ do if [ -n "${HOSTFILE}" ]; then - j=$(( $NUMPROCS % $NUMHOSTS +1)) + j=$(( NUMPROCS % NUMHOSTS + 1)) fi hostname=$(echo $hostnames|cut -d' ' -f$j) if [ -z "${hostname}" ]; then @@ -178,11 +178,11 @@ if [ -n "${DESCRIPTIONFILE}" ] && [ -f "${DESCRIPTIONFILE}" ]; then echo " " >> ${APPLICATIONTMP} echo " " >> ${APPLICATIONTMP} echo " " >> ${APPLICATIONTMP} - echo " " >> ${APPLICATIONTMP} + echo " " >> ${APPLICATIONTMP} echo " " >> ${APPLICATIONTMP} echo " " >> ${APPLICATIONTMP} - NUMPROCS=$(( $NUMPROCS +1)) + NUMPROCS=$(( NUMPROCS + 1)) done # return IFS back to newline for "for" loop IFS_OLD=$IFS diff --git a/include/msg/datatypes.h b/include/msg/datatypes.h deleted file mode 100644 index 34c965a4d0..0000000000 --- a/include/msg/datatypes.h +++ /dev/null @@ -1,2 +0,0 @@ -#warning You should now include directly simgrid/msg.h instead of msg/datatypes.h -#include "simgrid/msg.h" diff --git a/include/msg/msg.h b/include/msg/msg.h deleted file mode 100644 index e86d89b1b1..0000000000 --- a/include/msg/msg.h +++ /dev/null @@ -1,2 +0,0 @@ -#warning You should now include directly simgrid/msg.h instead of msg/msg.h -#include "simgrid/msg.h" diff --git a/include/simdag/datatypes.h b/include/simdag/datatypes.h deleted file mode 100644 index 571d1aa52f..0000000000 --- a/include/simdag/datatypes.h +++ /dev/null @@ -1,2 +0,0 @@ -#warning You should now include directly simgrid/simdag.h instead of simdag/datatypes.h -#include "simgrid/simdag.h" diff --git a/include/simdag/simdag.h b/include/simdag/simdag.h deleted file mode 100644 index 630662208a..0000000000 --- a/include/simdag/simdag.h +++ /dev/null @@ -1,2 +0,0 @@ -#warning You should now include directly simgrid/simdag.h instead of simdag/simdag.h -#include "simgrid/simdag.h" diff --git a/include/simgrid/jedule/jedule.hpp b/include/simgrid/jedule/jedule.hpp index 43387f2ebb..ebb956ed2e 100644 --- a/include/simgrid/jedule/jedule.hpp +++ b/include/simgrid/jedule/jedule.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2012, 2014-2016. The SimGrid Team. +/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -6,8 +6,8 @@ #ifndef JEDULE_HPP_ #define JEDULE_HPP_ -#include #include "simgrid_config.h" +#include #include "jedule_events.hpp" #include "jedule_platform.hpp" diff --git a/include/xbt/string.hpp b/include/xbt/string.hpp index cafddcb5b8..912fe8dd6a 100644 --- a/include/xbt/string.hpp +++ b/include/xbt/string.hpp @@ -8,15 +8,14 @@ #include -#include #include -#include +#include +#include #if SIMGRID_HAVE_MC #include #include -#include #include #include diff --git a/include/xbt/sysdep.h b/include/xbt/sysdep.h index fac49a749f..f29739eae8 100644 --- a/include/xbt/sysdep.h +++ b/include/xbt/sysdep.h @@ -2,7 +2,7 @@ /* no system header should be loaded out of this file so that we have only */ /* one file to check when porting to another OS */ -/* Copyright (c) 2004-2015. The SimGrid Team. +/* Copyright (c) 2004-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -76,13 +76,7 @@ XBT_PUBLIC(void) xbt_backtrace_display_current(); /** @brief Like malloc, but xbt_die() on error @hideinitializer */ static XBT_ALWAYS_INLINE void *xbt_malloc(size_t n) { - void *res; -/* if (n==0) { - xbt_backtrace_display_current(); - xbt_die("malloc(0) is not portable"); - }*/ - - res = malloc(n); + void* res = malloc(n); if (!res) xbt_die("Memory allocation of %lu bytes failed", (unsigned long)n); return res; @@ -91,9 +85,7 @@ static XBT_ALWAYS_INLINE void *xbt_malloc(size_t n) { /** @brief like malloc, but xbt_die() on error and memset data to 0 @hideinitializer */ static XBT_ALWAYS_INLINE void *xbt_malloc0(size_t n) { - void *res; - //if (n==0) xbt_die("calloc(0) is not portable"); - res = calloc(n, 1); + void* res = calloc(n, 1); if (!res) xbt_die("Memory callocation of %lu bytes failed", (unsigned long)n); return res; @@ -103,7 +95,6 @@ static XBT_ALWAYS_INLINE void *xbt_malloc0(size_t n) { @hideinitializer */ static XBT_ALWAYS_INLINE void *xbt_realloc(void *p, size_t s) { void *res = NULL; - //if (s==0) xbt_die("realloc(0) is not portable"); if (s) { if (p) { res = realloc(p, s); diff --git a/src/bindings/java/jmsg.cpp b/src/bindings/java/jmsg.cpp index 4f766198a6..11342f25b4 100644 --- a/src/bindings/java/jmsg.cpp +++ b/src/bindings/java/jmsg.cpp @@ -5,7 +5,7 @@ /* 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 +#include #include "simgrid/msg.h" #include "simgrid/plugins/energy.h" diff --git a/src/bindings/java/jxbt_utilities.cpp b/src/bindings/java/jxbt_utilities.cpp index 128f0770a5..a5e6ed1ab7 100644 --- a/src/bindings/java/jxbt_utilities.cpp +++ b/src/bindings/java/jxbt_utilities.cpp @@ -8,7 +8,7 @@ #include "xbt/sysdep.h" #include "jxbt_utilities.h" -#include /* abort */ +#include /* abort */ SG_BEGIN_DECL() diff --git a/src/bindings/lua/lua_platf.cpp b/src/bindings/lua/lua_platf.cpp index 6f9f856f35..c0b812cad9 100644 --- a/src/bindings/lua/lua_platf.cpp +++ b/src/bindings/lua/lua_platf.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2012-2015. The SimGrid Team. +/* Copyright (c) 2010, 2012-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -10,8 +10,8 @@ #include "src/kernel/routing/NetPoint.hpp" #include "src/surf/network_interface.hpp" #include "src/surf/xml/platf_private.hpp" -#include -#include +#include +#include extern "C" { #include diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index c93da968dc..792fc4ce5e 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2014-2015. The SimGrid Team. +/* Copyright (c) 2012, 2014-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -142,8 +142,8 @@ type_t PJ_type_variable_new (const char *name, const char *color, type_t father) type_t ret = nullptr; - char white[INSTR_DEFAULT_STR_SIZE] = "1 1 1"; if (not color) { + char white[INSTR_DEFAULT_STR_SIZE] = "1 1 1"; ret = newType (name, name, white, TYPE_VARIABLE, father); }else{ ret = newType (name, name, color, TYPE_VARIABLE, father); diff --git a/src/kernel/context/Context.hpp b/src/kernel/context/Context.hpp index 087b175ef1..e45c097e71 100644 --- a/src/kernel/context/Context.hpp +++ b/src/kernel/context/Context.hpp @@ -30,8 +30,8 @@ #include "xbt/swag.h" #include "xbt/xbt_os_time.h" -#include #include "src/simix/ActorImpl.hpp" +#include #include diff --git a/src/kernel/routing/ClusterZone.cpp b/src/kernel/routing/ClusterZone.cpp index 1a191c8b6a..52f8bb1d8c 100644 --- a/src/kernel/routing/ClusterZone.cpp +++ b/src/kernel/routing/ClusterZone.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2017. 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. */ @@ -22,7 +22,7 @@ ClusterZone::ClusterZone(NetZone* father, const char* name) : NetZoneImpl(father void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat) { - XBT_VERB("cluster getLocalRoute from '%s'[%d] to '%s'[%d]", src->cname(), src->id(), dst->cname(), dst->id()); + XBT_VERB("cluster getLocalRoute from '%s'[%u] to '%s'[%u]", src->cname(), src->id(), dst->cname(), dst->id()); xbt_assert(not privateLinks_.empty(), "Cluster routing: no links attached to the source node - did you use host_link tag?"); diff --git a/src/kernel/routing/DijkstraZone.cpp b/src/kernel/routing/DijkstraZone.cpp index 0efd92e0e4..b5c53135c5 100644 --- a/src/kernel/routing/DijkstraZone.cpp +++ b/src/kernel/routing/DijkstraZone.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2017. 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. */ @@ -7,7 +7,7 @@ #include "src/kernel/routing/NetPoint.hpp" #include "src/surf/network_interface.hpp" -#include +#include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_dijkstra, surf, "Routing part of surf -- dijkstra routing logic"); diff --git a/src/kernel/routing/DragonflyZone.cpp b/src/kernel/routing/DragonflyZone.cpp index a89ff4b87f..4975caf85c 100644 --- a/src/kernel/routing/DragonflyZone.cpp +++ b/src/kernel/routing/DragonflyZone.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2014-2017. 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. */ @@ -286,7 +286,7 @@ void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_c if (dst->isRouter() || src->isRouter()) return; - XBT_VERB("dragonfly getLocalRout from '%s'[%d] to '%s'[%d]", src->name().c_str(), src->id(), dst->name().c_str(), + XBT_VERB("dragonfly getLocalRout from '%s'[%u] to '%s'[%u]", src->name().c_str(), src->id(), dst->name().c_str(), dst->id()); if ((src->id() == dst->id()) && hasLoopback_) { diff --git a/src/kernel/routing/FatTreeZone.cpp b/src/kernel/routing/FatTreeZone.cpp index 9031a4f059..49f8b8bfce 100644 --- a/src/kernel/routing/FatTreeZone.cpp +++ b/src/kernel/routing/FatTreeZone.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2014-2017. 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. */ @@ -64,16 +64,16 @@ void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cba /* Let's find the source and the destination in our internal structure */ auto searchedNode = this->computeNodes_.find(src->id()); - xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the source %s [%d] in the fat tree", + xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the source %s [%u] in the fat tree", src->name().c_str(), src->id()); FatTreeNode* source = searchedNode->second; searchedNode = this->computeNodes_.find(dst->id()); - xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the destination %s [%d] in the fat tree", + xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the destination %s [%u] in the fat tree", dst->name().c_str(), dst->id()); FatTreeNode* destination = searchedNode->second; - XBT_VERB("Get route and latency from '%s' [%d] to '%s' [%d] in a fat tree", src->name().c_str(), src->id(), + XBT_VERB("Get route and latency from '%s' [%u] to '%s' [%u] in a fat tree", src->name().c_str(), src->id(), dst->name().c_str(), dst->id()); /* In case destination is the source, and there is a loopback, let's use it instead of going up to a switch */ @@ -242,7 +242,7 @@ void FatTreeZone::generateSwitches() if (this->nodesByLevel_[0] != this->nodes_.size()) { surf_parse_error("The number of provided nodes does not fit with the wanted topology." - " Please check your platform description (We need %d nodes, we got %zu)", + " Please check your platform description (We need %u nodes, we got %zu)", this->nodesByLevel_[0], this->nodes_.size()); return; } @@ -264,7 +264,7 @@ void FatTreeZone::generateSwitches() for (unsigned int i = 0; i < this->levels_; i++) { for (unsigned int j = 0; j < this->nodesByLevel_[i + 1]; j++) { FatTreeNode* newNode = new FatTreeNode(this->cluster_, --k, i + 1, j); - XBT_DEBUG("We create the switch %d(%d,%d)", newNode->id, newNode->level, newNode->position); + XBT_DEBUG("We create the switch %d(%u,%u)", newNode->id, newNode->level, newNode->position); newNode->children.resize(this->lowerLevelNodesNumber_[i] * this->lowerLevelPortsNumber_[i]); if (i != this->levels_ - 1) { newNode->parents.resize(this->upperLevelNodesNumber_[i + 1] * this->lowerLevelPortsNumber_[i + 1]); @@ -348,7 +348,7 @@ void FatTreeZone::addLink(FatTreeNode* parent, unsigned int parentPort, FatTreeN { FatTreeLink* newLink; newLink = new FatTreeLink(this->cluster_, child, parent); - XBT_DEBUG("Creating a link between the parent (%d,%d,%u) and the child (%d,%d,%u)", parent->level, parent->position, + XBT_DEBUG("Creating a link between the parent (%u,%u,%u) and the child (%u,%u,%u)", parent->level, parent->position, parentPort, child->level, child->position, childPort); parent->children[parentPort] = newLink; child->parents[childPort] = newLink; diff --git a/src/kernel/routing/FloydZone.cpp b/src/kernel/routing/FloydZone.cpp index 457b0e1ad5..863c876583 100644 --- a/src/kernel/routing/FloydZone.cpp +++ b/src/kernel/routing/FloydZone.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2017. 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. */ @@ -8,7 +8,7 @@ #include "src/surf/network_interface.hpp" #include "xbt/log.h" -#include +#include #include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_floyd, surf, "Routing part of surf"); diff --git a/src/kernel/routing/FullZone.cpp b/src/kernel/routing/FullZone.cpp index 7f6a98e169..9bae53937e 100644 --- a/src/kernel/routing/FullZone.cpp +++ b/src/kernel/routing/FullZone.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2017. 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. */ @@ -60,7 +60,7 @@ FullZone::~FullZone() void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t res, double* lat) { - XBT_DEBUG("full getLocalRoute from %s[%d] to %s[%d]", src->cname(), src->id(), dst->cname(), dst->id()); + XBT_DEBUG("full getLocalRoute from %s[%u] to %s[%u]", src->cname(), src->id(), dst->cname(), dst->id()); unsigned int table_size = getTableSize(); sg_platf_route_cbarg_t e_route = TO_ROUTE_FULL(src->id(), dst->id()); diff --git a/src/kernel/routing/NetPoint.hpp b/src/kernel/routing/NetPoint.hpp index 285ef6ac53..fd54a2f75e 100644 --- a/src/kernel/routing/NetPoint.hpp +++ b/src/kernel/routing/NetPoint.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2013-2017. 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. */ @@ -11,10 +11,7 @@ #include #include "src/kernel/routing/NetZoneImpl.hpp" -/* -#include -#include -*/ + namespace simgrid { namespace kernel { namespace routing { diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index 148680148e..30b275062c 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -32,7 +32,7 @@ NetZoneImpl::NetZoneImpl(NetZone* father, const char* name) : NetZone(father, na "Refusing to create a second NetZone called '%s'.", name); netpoint_ = new NetPoint(name, NetPoint::Type::NetZone, static_cast(father)); - XBT_DEBUG("NetZone '%s' created with the id '%d'", name, netpoint_->id()); + XBT_DEBUG("NetZone '%s' created with the id '%u'", name, netpoint_->id()); } NetZoneImpl::~NetZoneImpl() { diff --git a/src/kernel/routing/TorusZone.cpp b/src/kernel/routing/TorusZone.cpp index 7f6b210711..399ac2e4dc 100644 --- a/src/kernel/routing/TorusZone.cpp +++ b/src/kernel/routing/TorusZone.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2014-2017. 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. */ @@ -97,7 +97,7 @@ void TorusZone::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat) { - XBT_VERB("torus getLocalRoute from '%s'[%d] to '%s'[%d]", src->name().c_str(), src->id(), dst->name().c_str(), + XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->name().c_str(), src->id(), dst->name().c_str(), dst->id()); if (dst->isRouter() || src->isRouter()) @@ -175,7 +175,7 @@ void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg assert(linkOffset >= 0); } - XBT_DEBUG("torus_get_route_and_latency - current_node: %i, next_node: %u, linkOffset is %i", current_node, + XBT_DEBUG("torus_get_route_and_latency - current_node: %u, next_node: %u, linkOffset is %i", current_node, next_node, linkOffset); break; } diff --git a/src/kernel/routing/VivaldiZone.cpp b/src/kernel/routing/VivaldiZone.cpp index 97849e0db1..8ebb7fa996 100644 --- a/src/kernel/routing/VivaldiZone.cpp +++ b/src/kernel/routing/VivaldiZone.cpp @@ -76,7 +76,7 @@ void VivaldiZone::setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, s void VivaldiZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat) { - XBT_DEBUG("vivaldi getLocalRoute from '%s'[%d] '%s'[%d]", src->cname(), src->id(), dst->cname(), dst->id()); + XBT_DEBUG("vivaldi getLocalRoute from '%s'[%u] '%s'[%u]", src->cname(), src->id(), dst->cname(), dst->id()); if (src->isNetZone()) { std::string srcName = "router_" + src->name(); diff --git a/src/mc/PageStore.cpp b/src/mc/PageStore.cpp index 29d624c055..20d3e5e190 100644 --- a/src/mc/PageStore.cpp +++ b/src/mc/PageStore.cpp @@ -1,11 +1,11 @@ -/* Copyright (c) 2015. The SimGrid Team. +/* Copyright (c) 2015-2017. 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 // memcpy, memcmp #include -#include // memcpy, memcmp #include #ifdef __FreeBSD__ diff --git a/src/mc/Session.cpp b/src/mc/Session.cpp index d38c528217..810351b139 100644 --- a/src/mc/Session.cpp +++ b/src/mc/Session.cpp @@ -1,11 +1,11 @@ -/* Copyright (c) 2015-2016. The SimGrid Team. +/* Copyright (c) 2015-2017. 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 #include -#include #include diff --git a/src/mc/checker/CommunicationDeterminismChecker.cpp b/src/mc/checker/CommunicationDeterminismChecker.cpp index fad3f3ade6..6e9bd0913f 100644 --- a/src/mc/checker/CommunicationDeterminismChecker.cpp +++ b/src/mc/checker/CommunicationDeterminismChecker.cpp @@ -67,25 +67,25 @@ static char* print_determinism_result(e_mc_comm_pattern_difference_t diff, int p switch(diff) { case TYPE_DIFF: - res = bprintf("%s Different type for communication #%d", type, cursor); + res = bprintf("%s Different type for communication #%u", type, cursor); break; case RDV_DIFF: - res = bprintf("%s Different rdv for communication #%d", type, cursor); + res = bprintf("%s Different rdv for communication #%u", type, cursor); break; case TAG_DIFF: - res = bprintf("%s Different tag for communication #%d", type, cursor); + res = bprintf("%s Different tag for communication #%u", type, cursor); break; case SRC_PROC_DIFF: - res = bprintf("%s Different source for communication #%d", type, cursor); + res = bprintf("%s Different source for communication #%u", type, cursor); break; case DST_PROC_DIFF: - res = bprintf("%s Different destination for communication #%d", type, cursor); + res = bprintf("%s Different destination for communication #%u", type, cursor); break; case DATA_SIZE_DIFF: - res = bprintf("%s\n Different data size for communication #%d", type, cursor); + res = bprintf("%s\n Different data size for communication #%u", type, cursor); break; case DATA_DIFF: - res = bprintf("%s\n Different data for communication #%d", type, cursor); + res = bprintf("%s\n Different data for communication #%u", type, cursor); break; default: res = nullptr; @@ -436,7 +436,7 @@ void CommunicationDeterminismChecker::main() simgrid::mc::State* state = stack_.back().get(); XBT_DEBUG("**************************************************"); - XBT_DEBUG("Exploration depth = %zi (state = %d, interleaved processes = %zd)", stack_.size(), state->num, + XBT_DEBUG("Exploration depth = %zu (state = %d, interleaved processes = %zu)", stack_.size(), state->num, state->interleaveSize()); /* Update statistics */ @@ -508,13 +508,13 @@ void CommunicationDeterminismChecker::main() XBT_DEBUG("State already visited (equal to state %d), exploration stopped on this path.", visited_state->original_num == -1 ? visited_state->num : visited_state->original_num); else - XBT_DEBUG("There are no more processes to interleave. (depth %zi)", stack_.size()); + XBT_DEBUG("There are no more processes to interleave. (depth %zu)", stack_.size()); if (not this->initial_communications_pattern_done) this->initial_communications_pattern_done = 1; /* Trash the current state, no longer needed */ - XBT_DEBUG("Delete state %d at depth %zi", state->num, stack_.size()); + XBT_DEBUG("Delete state %d at depth %zu", state->num, stack_.size()); stack_.pop_back(); visited_state = nullptr; @@ -530,16 +530,16 @@ void CommunicationDeterminismChecker::main() stack_.pop_back(); if (state->interleaveSize() && stack_.size() < (std::size_t)_sg_mc_max_depth) { /* We found a back-tracking point, let's loop */ - XBT_DEBUG("Back-tracking to state %d at depth %zi", state->num, stack_.size() + 1); + XBT_DEBUG("Back-tracking to state %d at depth %zu", state->num, stack_.size() + 1); stack_.push_back(std::move(state)); this->restoreState(); - XBT_DEBUG("Back-tracking to state %d at depth %zi done", stack_.back()->num, stack_.size()); + XBT_DEBUG("Back-tracking to state %d at depth %zu done", stack_.back()->num, stack_.size()); break; } else { - XBT_DEBUG("Delete state %d at depth %zi", state->num, stack_.size() + 1); + XBT_DEBUG("Delete state %d at depth %zu", state->num, stack_.size() + 1); } } } diff --git a/src/mc/checker/LivenessChecker.cpp b/src/mc/checker/LivenessChecker.cpp index 7cc2f8b683..4f3a21a431 100644 --- a/src/mc/checker/LivenessChecker.cpp +++ b/src/mc/checker/LivenessChecker.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015. The SimGrid Team. +/* Copyright (c) 2011-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -282,7 +282,7 @@ void LivenessChecker::showAcceptanceCycle(std::size_t depth) for (auto& s : this->getTextualTrace()) XBT_INFO("%s", s.c_str()); simgrid::mc::session->logState(); - XBT_INFO("Counter-example depth : %zd", depth); + XBT_INFO("Counter-example depth : %zu", depth); } std::vector LivenessChecker::getTextualTrace() // override @@ -372,11 +372,10 @@ void LivenessChecker::run() /* Update current state in buchi automaton */ simgrid::mc::property_automaton->current_state = current_pair->automaton_state; - XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d, interleave size = %zd, pair_num = %d, requests = %d)", - current_pair->depth, current_pair->search_cycle, - current_pair->graph_state->interleaveSize(), - current_pair->num, - current_pair->requests); + XBT_DEBUG( + "********************* ( Depth = %d, search_cycle = %d, interleave size = %zu, pair_num = %d, requests = %d)", + current_pair->depth, current_pair->search_cycle, current_pair->graph_state->interleaveSize(), current_pair->num, + current_pair->requests); if (current_pair->requests == 0) { this->backtrack(); diff --git a/src/mc/checker/SafetyChecker.cpp b/src/mc/checker/SafetyChecker.cpp index 790626567a..a48780f646 100644 --- a/src/mc/checker/SafetyChecker.cpp +++ b/src/mc/checker/SafetyChecker.cpp @@ -97,8 +97,8 @@ void SafetyChecker::run() simgrid::mc::State* state = stack_.back().get(); XBT_DEBUG("**************************************************"); - XBT_DEBUG("Exploration depth=%zi (state=%p, num %d)(%zu interleave)", - stack_.size(), state, state->num, state->interleaveSize()); + XBT_DEBUG("Exploration depth=%zu (state=%p, num %d)(%zu interleave)", stack_.size(), state, state->num, + state->interleaveSize()); mc_model_checker->visited_states++; @@ -125,7 +125,7 @@ void SafetyChecker::run() // req is now the transition of the process that was selected to be executed if (req == nullptr) { - XBT_DEBUG("There are no more processes to interleave. (depth %zi)", stack_.size() + 1); + XBT_DEBUG("There are no more processes to interleave. (depth %zu)", stack_.size() + 1); this->backtrack(); continue; @@ -259,15 +259,13 @@ void SafetyChecker::backtrack() if (state->interleaveSize() && stack_.size() < (std::size_t) _sg_mc_max_depth) { /* We found a back-tracking point, let's loop */ - XBT_DEBUG("Back-tracking to state %d at depth %zi", state->num, stack_.size() + 1); + XBT_DEBUG("Back-tracking to state %d at depth %zu", state->num, stack_.size() + 1); stack_.push_back(std::move(state)); this->restoreState(); - XBT_DEBUG("Back-tracking to state %d at depth %zi done", - stack_.back()->num, stack_.size()); + XBT_DEBUG("Back-tracking to state %d at depth %zu done", stack_.back()->num, stack_.size()); break; } else { - XBT_DEBUG("Delete state %d at depth %zi", - state->num, stack_.size() + 1); + XBT_DEBUG("Delete state %d at depth %zu", state->num, stack_.size() + 1); } } } diff --git a/src/mc/compare.cpp b/src/mc/compare.cpp index fabd66bd2f..5a342c6a6c 100644 --- a/src/mc/compare.cpp +++ b/src/mc/compare.cpp @@ -1638,8 +1638,7 @@ int snapshot_compare(int num1, simgrid::mc::Snapshot* s1, int num2, simgrid::mc: #else #ifdef MC_VERBOSE - XBT_VERB("(%d - %d) Different local variables between stacks %d", num1, - num2, cursor + 1); + XBT_VERB("(%d - %d) Different local variables between stacks %u", num1, num2, cursor + 1); #endif return 1; diff --git a/src/mc/mc_checkpoint.cpp b/src/mc/mc_checkpoint.cpp index 9f7775c812..daf52a4856 100644 --- a/src/mc/mc_checkpoint.cpp +++ b/src/mc/mc_checkpoint.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2015. The SimGrid Team. +/* Copyright (c) 2008-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -6,10 +6,10 @@ #include +#include +#include #include -#include #include -#include #ifndef WIN32 #include diff --git a/src/mc/mc_comm_pattern.cpp b/src/mc/mc_comm_pattern.cpp index 3f3d1bdaa1..cb7029cfb8 100644 --- a/src/mc/mc_comm_pattern.cpp +++ b/src/mc/mc_comm_pattern.cpp @@ -3,7 +3,7 @@ /* 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 +#include #include "xbt/dynar.h" #include "xbt/sysdep.h" diff --git a/src/mc/mc_dwarf.cpp b/src/mc/mc_dwarf.cpp index 47b5771e50..e05b6283a8 100644 --- a/src/mc/mc_dwarf.cpp +++ b/src/mc/mc_dwarf.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2015. The SimGrid Team. +/* Copyright (c) 2008-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -539,8 +539,7 @@ static void MC_dwarf_fill_member_location( // It's supposed to be possible in DWARF2 but I couldn't find its semantic // in the spec. default: - xbt_die("Can't handle form class (%i) / form 0x%x as DW_AT_member_location", - (int) form_class, form); + xbt_die("Can't handle form class (%d) / form 0x%x as DW_AT_member_location", (int)form_class, (unsigned)form); } } @@ -790,11 +789,8 @@ static std::unique_ptr MC_die_to_variable( break; default: - xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location " - "in <%" PRIx64 ">%s", - form, form, (int) form_class, (int) form_class, - (uint64_t) variable->id, - variable->name.c_str()); + xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location in <%" PRIx64 ">%s", (unsigned)form, form, + (unsigned)form_class, (int)form_class, (uint64_t)variable->id, variable->name.c_str()); } // Handle start_scope: @@ -814,9 +810,8 @@ static std::unique_ptr MC_die_to_variable( case simgrid::dwarf::FormClass::RangeListPtr: // TODO default: - xbt_die - ("Unhandled form 0x%x, class 0x%X for DW_AT_start_scope of variable %s", - form, (int) form_class, name == nullptr ? "?" : name); + xbt_die("Unhandled form 0x%x, class 0x%X for DW_AT_start_scope of variable %s", (unsigned)form, + (unsigned)form_class, name == nullptr ? "?" : name); } } diff --git a/src/mc/mc_record.cpp b/src/mc/mc_record.cpp index ce2bfa2cba..a8dfdb11da 100644 --- a/src/mc/mc_record.cpp +++ b/src/mc/mc_record.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015. The SimGrid Team. +/* Copyright (c) 2014-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -86,7 +86,7 @@ RecordTrace parseRecordTrace(const char* data) while (*current) { simgrid::mc::Transition item; - int count = sscanf(current, "%u/%u", &item.pid, &item.argument); + int count = sscanf(current, "%d/%d", &item.pid, &item.argument); if(count != 2 && count != 1) throw std::runtime_error("Could not parse record path"); res.push_back(item); diff --git a/src/mc/mc_snapshot.cpp b/src/mc/mc_snapshot.cpp index e365f98543..11dba265f6 100644 --- a/src/mc/mc_snapshot.cpp +++ b/src/mc/mc_snapshot.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015. The SimGrid Team. +/* Copyright (c) 2014-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -196,8 +196,8 @@ const void* Snapshot::read_bytes(void* buffer, std::size_t size, #ifdef SIMGRID_TEST -#include -#include +#include +#include #include diff --git a/src/mc/mc_state.cpp b/src/mc/mc_state.cpp index 1a36d31dd4..0bce019d43 100644 --- a/src/mc/mc_state.cpp +++ b/src/mc/mc_state.cpp @@ -3,7 +3,7 @@ /* 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 +#include #include diff --git a/src/mc/mc_unw.cpp b/src/mc/mc_unw.cpp index 6b2d206517..ebe8c8ec89 100644 --- a/src/mc/mc_unw.cpp +++ b/src/mc/mc_unw.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2015. The SimGrid Team. +/* Copyright (c) 2015-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -11,7 +11,7 @@ // We need this for the register indices: // #define _GNU_SOURCE -#include +#include // On x86_64, libunwind unw_context_t has the same layout as ucontext_t: #include diff --git a/src/mc/mc_xbt.cpp b/src/mc/mc_xbt.cpp index 257ebb47f6..1cd7efb35c 100644 --- a/src/mc/mc_xbt.cpp +++ b/src/mc/mc_xbt.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015. The SimGrid Team. +/* Copyright (c) 2014-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ void read_element(AddressSpace const& as, s_xbt_dynar_t d; as.read_bytes(&d, sizeof(d), addr); if (i >= d.used) - xbt_die("Out of bound index %zi/%lu", i, d.used); + xbt_die("Out of bound index %zu/%lu", i, d.used); if (len != d.elmsize) xbt_die("Bad size in simgrid::mc::read_element"); as.read_bytes(local, len, remote(xbt_dynar_get_ptr(&d, i))); diff --git a/src/mc/remote/Channel.cpp b/src/mc/remote/Channel.cpp index 6c4000dae3..1fee675094 100644 --- a/src/mc/remote/Channel.cpp +++ b/src/mc/remote/Channel.cpp @@ -1,10 +1,10 @@ -/* Copyright (c) 2015-2016. The SimGrid Team. +/* Copyright (c) 2015-2017. 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 +#include #include #include diff --git a/src/mc/remote/Client.cpp b/src/mc/remote/Client.cpp index 9bfc523a19..d6a72a12a2 100644 --- a/src/mc/remote/Client.cpp +++ b/src/mc/remote/Client.cpp @@ -140,33 +140,33 @@ void Client::handleMessages() switch (message->type) { case MC_MESSAGE_DEADLOCK_CHECK: - xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for DEADLOCK_CHECK (%zu != %zu)", + xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for DEADLOCK_CHECK (%zd != %zu)", received_size, sizeof(mc_message_t)); handleDeadlockCheck(message); break; case MC_MESSAGE_CONTINUE: - xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_CONTINUE (%zu != %zu)", + xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_CONTINUE (%zd != %zu)", received_size, sizeof(mc_message_t)); handleContinue(message); return; case MC_MESSAGE_SIMCALL_HANDLE: xbt_assert(received_size == sizeof(s_mc_message_simcall_handle_t), - "Unexpected size for SIMCALL_HANDLE (%zu != %zu)", received_size, + "Unexpected size for SIMCALL_HANDLE (%zd != %zu)", received_size, sizeof(s_mc_message_simcall_handle_t)); handleSimcall((s_mc_message_simcall_handle_t*)message_buffer); break; case MC_MESSAGE_RESTORE: - xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_RESTORE (%zu != %zu)", + xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_RESTORE (%zd != %zu)", received_size, sizeof(mc_message_t)); handleRestore((s_mc_message_restore_t*)message_buffer); break; case MC_MESSAGE_ACTOR_ENABLED: xbt_assert(received_size == sizeof(s_mc_message_actor_enabled_t), - "Unexpected size for ACTOR_ENABLED (%zu != %zu)", received_size, + "Unexpected size for ACTOR_ENABLED (%zd != %zu)", received_size, sizeof(s_mc_message_actor_enabled_t)); handleActorEnabled((s_mc_message_actor_enabled_t*)message_buffer); break; diff --git a/src/mc/remote/RemoteClient.cpp b/src/mc/remote/RemoteClient.cpp index f96e1e5ab9..3811904027 100644 --- a/src/mc/remote/RemoteClient.cpp +++ b/src/mc/remote/RemoteClient.cpp @@ -5,10 +5,10 @@ #define _FILE_OFFSET_BITS 64 /* needed for pread_whole to work as expected on 32bits */ -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -427,7 +427,7 @@ void RemoteClient::read_variable(const char* name, void* target, size_t size) co simgrid::mc::Variable* var = this->find_variable(name); xbt_assert(var->address, "No simple location for this variable"); xbt_assert(var->type->full_type, "Partial type for %s, cannot check size", name); - xbt_assert((size_t)var->type->full_type->byte_size == size, "Unexpected size for %s (expected %zi, was %zi)", name, + xbt_assert((size_t)var->type->full_type->byte_size == size, "Unexpected size for %s (expected %zu, was %zu)", name, size, (size_t)var->type->full_type->byte_size); this->read_bytes(target, size, remote(var->address)); } diff --git a/src/mc/remote/mc_protocol.cpp b/src/mc/remote/mc_protocol.cpp index 74bec4e710..65673779d8 100644 --- a/src/mc/remote/mc_protocol.cpp +++ b/src/mc/remote/mc_protocol.cpp @@ -1,13 +1,13 @@ -/* Copyright (c) 2015. The SimGrid Team. +/* Copyright (c) 2015-2017. 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 #include // std::size_t -#include -#include // perror -#include +#include // perror +#include #include #include diff --git a/src/msg/msg_actions.cpp b/src/msg/msg_actions.cpp index b5d171a0d7..9557caac23 100644 --- a/src/msg/msg_actions.cpp +++ b/src/msg/msg_actions.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2015. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2017. 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. */ @@ -6,7 +6,7 @@ #include "src/msg/msg_private.h" #include "xbt/replay.hpp" -#include +#include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_action, msg, "MSG actions for trace driven simulation"); diff --git a/src/msg/msg_synchro.cpp b/src/msg/msg_synchro.cpp index 827c481489..5cf06a06d7 100644 --- a/src/msg/msg_synchro.cpp +++ b/src/msg/msg_synchro.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014. The SimGrid Team. +/* Copyright (c) 2013-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -91,7 +91,7 @@ void MSG_barrier_destroy(msg_bar_t bar) { int MSG_barrier_wait(msg_bar_t bar) { xbt_mutex_acquire(bar->mutex); bar->arrived_processes++; - XBT_DEBUG("waiting %p %d/%d", bar, bar->arrived_processes, bar->expected_processes); + XBT_DEBUG("waiting %p %u/%u", bar, bar->arrived_processes, bar->expected_processes); if (bar->arrived_processes == bar->expected_processes) { xbt_cond_broadcast(bar->cond); xbt_mutex_release(bar->mutex); diff --git a/src/simdag/sd_dotloader.cpp b/src/simdag/sd_dotloader.cpp index 619fcb13f4..7c82c61e3d 100644 --- a/src/simdag/sd_dotloader.cpp +++ b/src/simdag/sd_dotloader.cpp @@ -8,7 +8,7 @@ #include "simgrid/simdag.h" #include "src/internal_config.h" #include "xbt/file.h" -#include +#include #include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_dotparse, sd, "Parsing DOT files"); diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index f0f826872f..d00955b753 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -6,9 +6,9 @@ #include #include -#include /* Signal handling */ -#include #include "src/internal_config.h" +#include /* Signal handling */ +#include #include @@ -37,7 +37,6 @@ #include "src/mc/mc_private.h" #include "src/mc/remote/Client.hpp" #include "src/mc/remote/mc_protocol.h" -#include #endif #include "src/mc/mc_record.h" @@ -128,8 +127,8 @@ static void install_segvhandler() return; } if (not(old_stack.ss_flags & SS_DISABLE)) { - XBT_DEBUG("An alternate stack was already installed (sp=%p, size=%zd, flags=%x). Restore it.", - old_stack.ss_sp, old_stack.ss_size, old_stack.ss_flags); + XBT_DEBUG("An alternate stack was already installed (sp=%p, size=%zu, flags=%x). Restore it.", old_stack.ss_sp, + old_stack.ss_size, (unsigned)old_stack.ss_flags); sigaltstack(&old_stack, nullptr); } diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index bad673a5e0..66f332c15e 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -1,5 +1,4 @@ - -/* Copyright (c) 2007-2015. The SimGrid Team. +/* Copyright (c) 2007-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -169,7 +168,7 @@ void MutexImpl::unlock(smx_actor_t issuer) /* If the mutex is not owned by the issuer, that's not good */ if (issuer != this->owner) - THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%ld), not by you.", + THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%lu), not by you.", this->owner->cname(), this->owner->pid); if (xbt_swag_size(this->sleeping) > 0) { diff --git a/src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp b/src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp index 3874163fcc..8ae33f0983 100644 --- a/src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp @@ -98,8 +98,7 @@ int Coll_allgatherv_ompi_bruck::allgatherv(void *sbuf, int scount, unsigned int size = comm->size(); unsigned int rank = comm->rank(); - XBT_DEBUG( - "coll:tuned:allgather_ompi_bruck rank %d", rank); + XBT_DEBUG("coll:tuned:allgather_ompi_bruck rank %u", rank); sdtype->extent(&slb, &sext); diff --git a/src/smpi/colls/alltoall/alltoall-2dmesh.cpp b/src/smpi/colls/alltoall/alltoall-2dmesh.cpp index 062d5cbe3c..e75003a81c 100644 --- a/src/smpi/colls/alltoall/alltoall-2dmesh.cpp +++ b/src/smpi/colls/alltoall/alltoall-2dmesh.cpp @@ -5,7 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "../colls_private.h" -#include +#include /***************************************************************************** diff --git a/src/smpi/colls/alltoall/alltoall-3dmesh.cpp b/src/smpi/colls/alltoall/alltoall-3dmesh.cpp index bb8ca3debe..85baad3b65 100644 --- a/src/smpi/colls/alltoall/alltoall-3dmesh.cpp +++ b/src/smpi/colls/alltoall/alltoall-3dmesh.cpp @@ -5,7 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "../colls_private.h" -#include +#include /***************************************************************************** diff --git a/src/smpi/colls/bcast/bcast-ompi-split-bintree.cpp b/src/smpi/colls/bcast/bcast-ompi-split-bintree.cpp index e2a095851c..52ad605112 100644 --- a/src/smpi/colls/bcast/bcast-ompi-split-bintree.cpp +++ b/src/smpi/colls/bcast/bcast-ompi-split-bintree.cpp @@ -98,7 +98,7 @@ Coll_bcast_ompi_split_bintree::bcast ( void* buffer, else segsize = 1024 << 3; - XBT_DEBUG("ompi_coll_tuned_bcast_intra_split_bintree rank %d root %d ss %5d", rank, root, segsize); + XBT_DEBUG("ompi_coll_tuned_bcast_intra_split_bintree rank %d root %d ss %5u", rank, root, segsize); if (size == 1) { return MPI_SUCCESS; diff --git a/src/smpi/colls/reduce/reduce-ompi.cpp b/src/smpi/colls/reduce/reduce-ompi.cpp index 25d1cb85f1..f5d593d1af 100644 --- a/src/smpi/colls/reduce/reduce-ompi.cpp +++ b/src/smpi/colls/reduce/reduce-ompi.cpp @@ -68,7 +68,9 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi sendtmpbuf = (char *)recvbuf; } - XBT_DEBUG( "coll:tuned:reduce_generic count %d, msg size %ld, segsize %ld, max_requests %d", original_count, (unsigned long)(num_segments * segment_increment), (unsigned long)segment_increment, max_outstanding_reqs); + XBT_DEBUG("coll:tuned:reduce_generic count %d, msg size %lu, segsize %lu, max_requests %d", original_count, + (unsigned long)(num_segments * segment_increment), (unsigned long)segment_increment, + max_outstanding_reqs); rank = comm->rank(); @@ -335,7 +337,7 @@ int Coll_reduce_ompi_chain::reduce( void *sendbuf, void *recvbuf, int count, size_t typelng; int fanout = comm->size()/2; - XBT_DEBUG("coll:tuned:reduce_intra_chain rank %d fo %d ss %5d", comm->rank(), fanout, segsize); + XBT_DEBUG("coll:tuned:reduce_intra_chain rank %d fo %d ss %5u", comm->rank(), fanout, segsize); /** * Determine number of segments and number of elements @@ -386,8 +388,7 @@ int Coll_reduce_ompi_pipeline::reduce( void *sendbuf, void *recvbuf, segsize = 64*1024; } - XBT_DEBUG("coll:tuned:reduce_intra_pipeline rank %d ss %5d", - comm->rank(), segsize); + XBT_DEBUG("coll:tuned:reduce_intra_pipeline rank %d ss %5u", comm->rank(), segsize); COLL_TUNED_COMPUTED_SEGCOUNT( segsize, typelng, segcount ); @@ -417,8 +418,7 @@ int Coll_reduce_ompi_binary::reduce( void *sendbuf, void *recvbuf, // Binary_32K segsize = 32*1024; - XBT_DEBUG("coll:tuned:reduce_intra_binary rank %d ss %5d", - comm->rank(), segsize); + XBT_DEBUG("coll:tuned:reduce_intra_binary rank %d ss %5u", comm->rank(), segsize); COLL_TUNED_COMPUTED_SEGCOUNT( segsize, typelng, segcount ); @@ -459,8 +459,7 @@ int Coll_reduce_ompi_binomial::reduce( void *sendbuf, void *recvbuf, segsize = 1024; } - XBT_DEBUG("coll:tuned:reduce_intra_binomial rank %d ss %5d", - comm->rank(), segsize); + XBT_DEBUG("coll:tuned:reduce_intra_binomial rank %d ss %5u", comm->rank(), segsize); COLL_TUNED_COMPUTED_SEGCOUNT( segsize, typelng, segcount ); return smpi_coll_tuned_ompi_reduce_generic( sendbuf, recvbuf, count, datatype, @@ -491,8 +490,7 @@ int Coll_reduce_ompi_in_order_binary::reduce( void *sendbuf, void *recvbuf, rank = comm->rank(); size = comm->size(); - XBT_DEBUG("coll:tuned:reduce_intra_in_order_binary rank %d ss %5d", - rank, segsize); + XBT_DEBUG("coll:tuned:reduce_intra_in_order_binary rank %d ss %5u", rank, segsize); /** * Determine number of segments and number of elements diff --git a/src/smpi/colls/reduce/reduce-rab.cpp b/src/smpi/colls/reduce/reduce-rab.cpp index ac19cd515d..b2c90e06b0 100644 --- a/src/smpi/colls/reduce/reduce-rab.cpp +++ b/src/smpi/colls/reduce/reduce-rab.cpp @@ -10,8 +10,8 @@ */ #include "../colls_private.h" -#include -#include +#include +#include #define REDUCE_NEW_ALWAYS 1 diff --git a/src/smpi/colls/smpi_automatic_selector.cpp b/src/smpi/colls/smpi_automatic_selector.cpp index 017e61e077..3ffffa0278 100644 --- a/src/smpi/colls/smpi_automatic_selector.cpp +++ b/src/smpi/colls/smpi_automatic_selector.cpp @@ -4,7 +4,7 @@ /* 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 +#include #include diff --git a/src/smpi/internals/instr_smpi.cpp b/src/smpi/internals/instr_smpi.cpp index 52e6e4bb15..ec33a27bc8 100644 --- a/src/smpi/internals/instr_smpi.cpp +++ b/src/smpi/internals/instr_smpi.cpp @@ -6,10 +6,10 @@ #include "private.h" #include "private.hpp" -#include +#include +#include +#include #include -#include -#include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_smpi, instr, "Tracing SMPI"); diff --git a/src/smpi/internals/smpi_bench.cpp b/src/smpi/internals/smpi_bench.cpp index 6342bd93aa..44fdedfcfa 100644 --- a/src/smpi/internals/smpi_bench.cpp +++ b/src/smpi/internals/smpi_bench.cpp @@ -14,7 +14,7 @@ #ifndef WIN32 #include #endif -#include // sqrt +#include #if HAVE_PAPI #include diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 47fa986abe..e864e819a1 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -19,11 +19,11 @@ #include "smpi_info.hpp" #include "smpi_process.hpp" +#include /* DBL_MAX */ #include #include -#include -#include /* DBL_MAX */ #include +#include #if HAVE_SENDFILE #include diff --git a/src/smpi/internals/smpi_memory.cpp b/src/smpi/internals/smpi_memory.cpp index 719b28b63b..9a1147f73d 100644 --- a/src/smpi/internals/smpi_memory.cpp +++ b/src/smpi/internals/smpi_memory.cpp @@ -9,13 +9,13 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include +#include #ifndef WIN32 #include @@ -135,7 +135,7 @@ void smpi_initialize_global_memory_segments() int status; do { - snprintf(path, sizeof(path), "/smpi-buffer-%06x", rand() % 0xffffff); + snprintf(path, sizeof(path), "/smpi-buffer-%06x", rand() % 0xffffffU); file_descriptor = shm_open(path, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); } while (file_descriptor == -1 && errno == EEXIST); if (file_descriptor < 0) { diff --git a/src/smpi/internals/smpi_process.cpp b/src/smpi/internals/smpi_process.cpp index 4ffaea82d5..742af85a32 100644 --- a/src/smpi/internals/smpi_process.cpp +++ b/src/smpi/internals/smpi_process.cpp @@ -24,13 +24,13 @@ extern int* index_to_process_data; static char *get_mailbox_name(char *str, int index) { - snprintf(str, MAILBOX_NAME_MAXLEN, "SMPI-%0*x", static_cast (sizeof(int) * 2), index); + snprintf(str, MAILBOX_NAME_MAXLEN, "SMPI-%0*x", static_cast(sizeof(int) * 2), static_cast(index)); return str; } static char *get_mailbox_name_small(char *str, int index) { - snprintf(str, MAILBOX_NAME_MAXLEN, "small%0*x", static_cast (sizeof(int) * 2), index); + snprintf(str, MAILBOX_NAME_MAXLEN, "small%0*x", static_cast(sizeof(int) * 2), static_cast(index)); return str; } diff --git a/src/smpi/internals/smpi_shared.cpp b/src/smpi/internals/smpi_shared.cpp index cd4b82093e..a213733c8f 100644 --- a/src/smpi/internals/smpi_shared.cpp +++ b/src/smpi/internals/smpi_shared.cpp @@ -40,16 +40,15 @@ #include "private.hpp" #include "xbt/dict.h" #include "xbt/ex.hpp" -#include +#include #include #ifndef WIN32 #include #endif -#include +#include #include -#include -#include +#include #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON @@ -307,7 +306,7 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int size_t start_block_offset = ALIGN_UP(start_offset, smpi_shared_malloc_blocksize); size_t stop_block_offset = ALIGN_DOWN(stop_offset, smpi_shared_malloc_blocksize); for (unsigned block_id=0, i = start_block_offset / smpi_shared_malloc_blocksize; i < stop_block_offset / smpi_shared_malloc_blocksize; block_id++, i++) { - XBT_DEBUG("\t\tglobal shared allocation, mmap block offset %d", block_id); + XBT_DEBUG("\t\tglobal shared allocation, mmap block offset %u", block_id); void* pos = (void*)((unsigned long)mem + i * smpi_shared_malloc_blocksize); void* res = mmap(pos, smpi_shared_malloc_blocksize, PROT_READ | PROT_WRITE, mmap_flag, huge_fd, 0); diff --git a/src/smpi/internals/smpi_utils.cpp b/src/smpi/internals/smpi_utils.cpp index e0ef96f79c..b1a9e096f9 100644 --- a/src/smpi/internals/smpi_utils.cpp +++ b/src/smpi/internals/smpi_utils.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2016. The SimGrid Team. +/* Copyright (c) 2016-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it diff --git a/src/smpi/mpi/smpi_f2c.cpp b/src/smpi/mpi/smpi_f2c.cpp index e5a5706bcc..fc2a5c677b 100644 --- a/src/smpi/mpi/smpi_f2c.cpp +++ b/src/smpi/mpi/smpi_f2c.cpp @@ -32,12 +32,12 @@ int F2C::f2c_id(){ }; char* F2C::get_key(char* key, int id) { - std::snprintf(key, KEY_SIZE, "%x",id); + std::snprintf(key, KEY_SIZE, "%x", (unsigned)id); return key; } char* F2C::get_key_id(char* key, int id) { - std::snprintf(key, KEY_SIZE, "%x_%d",id, smpi_process()->index()); + std::snprintf(key, KEY_SIZE, "%x_%d", (unsigned)id, smpi_process()->index()); return key; } diff --git a/src/smpi/mpi/smpi_topo.cpp b/src/smpi/mpi/smpi_topo.cpp index fa3701d3b8..b55b0e313f 100644 --- a/src/smpi/mpi/smpi_topo.cpp +++ b/src/smpi/mpi/smpi_topo.cpp @@ -3,13 +3,13 @@ /* 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 "xbt/sysdep.h" #include "smpi/smpi.h" #include "private.h" -#include -#include #include "smpi_comm.hpp" #include "smpi_topo.hpp" +#include "xbt/sysdep.h" +#include +#include /* static functions */ static int assignnodes(int ndim, int nfactor, int *pfacts,int **pdims); diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index a8c75e1290..750e28f0a0 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -75,6 +75,11 @@ unset pid trapped_signals="HUP INT QUIT ILL ABRT SEGV FPE ALRM TERM USR1 USR2 BUS" +die () { + printf '[%s] ** error: %s. Aborting.\n' "$(basename $0)" "$*" >&2 + exit 1 +} + smpirun_cleanup() { if [ -z "${KEEP}" ] ; then @@ -138,24 +143,21 @@ while true; do "-platform") PLATFORM="$2" if [ ! -f "${PLATFORM}" ]; then - echo "[`basename $0`] ** error: the file '${PLATFORM}' does not exist. Aborting." - exit 1 + die "the file '${PLATFORM}' does not exist" fi shift 2 ;; "-hostfile") HOSTFILE="$2" if [ ! -f "${HOSTFILE}" ]; then - echo "[`basename $0`] ** error: the file '${HOSTFILE}' does not exist. Aborting." - exit 1 + die "the file '${HOSTFILE}' does not exist" fi shift 2 ;; "-machinefile") HOSTFILE="$2" if [ ! -f "${HOSTFILE}" ]; then - echo "[`basename $0`] ** error: the file '${HOSTFILE}' does not exist. Aborting." - exit 1 + die "the file '${HOSTFILE}' does not exist" fi shift 2 ;; @@ -298,7 +300,7 @@ fi UNROLLEDHOSTFILETMP=0 #parse if our lines are terminated by :num_process -multiple_processes=`grep -c ":" $HOSTFILE` +multiple_processes=$(grep -c ":" $HOSTFILE) if [ "${multiple_processes}" -gt 0 ] ; then UNROLLEDHOSTFILETMP=1 UNROLLEDHOSTFILE="$(mktemp smpitmp-hostfXXXXXX)" @@ -311,10 +313,9 @@ if [ "${multiple_processes}" -gt 0 ] ; then fi # Don't use wc -l to compute it to avoid issues with trailing \n at EOF -hostfile_procs=`grep -c "[a-zA-Z0-9]" $HOSTFILE` +hostfile_procs=$(grep -c "[a-zA-Z0-9]" $HOSTFILE) if [ ${hostfile_procs} = 0 ] ; then - echo "[`basename $0`] ** error: the hostfile '${HOSTFILE}' is empty. Aborting." >&2 - exit 1 + die "the hostfile '${HOSTFILE}' is empty" fi if [ -z "${NUMPROCS}" ] ; then @@ -401,10 +402,10 @@ fi ## hostfile has less than i lines. ##---------------------------------------------------------- -HAVE_SEQ="`which seq 2>/dev/null`" +HAVE_SEQ="$(which seq 2>/dev/null)" if [ -n "${HAVE_SEQ}" ]; then - SEQ=`${HAVE_SEQ} 0 $((${NUMPROCS}-1))` + SEQ=$(${HAVE_SEQ} 0 $(( NUMPROCS - 1))) else cnt=0 while [ $cnt -lt ${NUMPROCS} ] ; do @@ -424,7 +425,7 @@ done for i in ${SEQ} do - j=$(( $i % ${hostfile_procs} + 1 )) + j=$(( i % hostfile_procs + 1 )) host=$(eval "echo \${$j}") ##---- optional display of ranks to actor mapping diff --git a/src/surf/fair_bottleneck.cpp b/src/surf/fair_bottleneck.cpp index 2f44bdb53e..2a0fcb7c8f 100644 --- a/src/surf/fair_bottleneck.cpp +++ b/src/surf/fair_bottleneck.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2011, 2013-2014. The SimGrid Team. +/* Copyright (c) 2007-2011, 2013-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -7,9 +7,9 @@ #include "maxmin_private.hpp" #include "xbt/log.h" #include "xbt/sysdep.h" -#include -#include -#include +#include +#include +#include XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_maxmin); #define SHOW_EXPR_G(expr) XBT_DEBUG(#expr " = %g",expr); diff --git a/src/surf/lagrange.cpp b/src/surf/lagrange.cpp index dc52269d89..7e70a86b1f 100644 --- a/src/surf/lagrange.cpp +++ b/src/surf/lagrange.cpp @@ -11,9 +11,9 @@ #include "xbt/sysdep.h" #include "maxmin_private.hpp" -#include +#include #ifndef MATH -#include +#include #endif XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_lagrange, surf, "Logging specific to SURF (lagrange)"); diff --git a/src/surf/maxmin.cpp b/src/surf/maxmin.cpp index 0fafd622f9..02c65df32b 100644 --- a/src/surf/maxmin.cpp +++ b/src/surf/maxmin.cpp @@ -9,10 +9,10 @@ #include "xbt/log.h" #include "xbt/mallocator.h" #include "xbt/sysdep.h" +#include +#include #include #include -#include -#include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_maxmin, surf, "Logging specific to SURF (maxmin)"); diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 236c577704..632c8b9e2c 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -115,7 +115,7 @@ simgrid::kernel::routing::NetPoint* sg_platf_new_router(const char* name, const simgrid::kernel::routing::NetPoint* netpoint = new simgrid::kernel::routing::NetPoint(name, simgrid::kernel::routing::NetPoint::Type::Router, current_routing); - XBT_DEBUG("Router '%s' has the id %d", name, netpoint->id()); + XBT_DEBUG("Router '%s' has the id %u", name, netpoint->id()); if (coords && strcmp(coords, "")) new simgrid::kernel::routing::vivaldi::Coords(netpoint, coords); @@ -702,7 +702,7 @@ void sg_platf_new_hostlink(sg_platf_host_link_cbarg_t hostlink) if (as_cluster->privateLinks_.find(netpoint->id()) != as_cluster->privateLinks_.end()) surf_parse_error("Host_link for '%s' is already defined!",hostlink->id); - XBT_DEBUG("Push Host_link for host '%s' to position %d", netpoint->cname(), netpoint->id()); + XBT_DEBUG("Push Host_link for host '%s' to position %u", netpoint->cname(), netpoint->id()); as_cluster->privateLinks_.insert({netpoint->id(), {linkUp, linkDown}}); } diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index 5131db9a76..c05e8a5c33 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -6,7 +6,7 @@ #include "storage_n11.hpp" #include "simgrid/s4u/Engine.hpp" #include "src/kernel/routing/NetPoint.hpp" -#include /*ceil*/ +#include /*ceil*/ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_storage); diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 249ee2314d..07493f0dbb 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -445,9 +445,9 @@ double Model::nextOccuringEvent(double now) double Model::nextOccuringEventLazy(double now) { - XBT_DEBUG("Before share resources, the size of modified actions set is %zd", modifiedSet_->size()); + XBT_DEBUG("Before share resources, the size of modified actions set is %zu", modifiedSet_->size()); lmm_solve(maxminSystem_); - XBT_DEBUG("After share resources, The size of modified actions set is %zd", modifiedSet_->size()); + XBT_DEBUG("After share resources, The size of modified actions set is %zu", modifiedSet_->size()); while (not modifiedSet_->empty()) { Action *action = &(modifiedSet_->front()); diff --git a/src/surf/trace_mgr.cpp b/src/surf/trace_mgr.cpp index 7771715793..16eb4f8abf 100644 --- a/src/surf/trace_mgr.cpp +++ b/src/surf/trace_mgr.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2004-2005, 2007, 2009-2014. The SimGrid Team. +/* Copyright (c) 2004-2005, 2007, 2009-2014, 2016-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -16,8 +16,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/src/surf/trace_mgr_test.cpp b/src/surf/trace_mgr_test.cpp index bc2d47cf96..24e202c513 100644 --- a/src/surf/trace_mgr_test.cpp +++ b/src/surf/trace_mgr_test.cpp @@ -15,7 +15,7 @@ bool init_unit_test(); // boost forget to give this prototype on NetBSD, which d #include "xbt/log.h" #include "xbt/misc.h" -#include +#include namespace utf = boost::unit_test; namespace tmgr = simgrid::trace_mgr; @@ -28,7 +28,7 @@ public: explicit MockedResource() : simgrid::surf::Resource(nullptr, "fake", nullptr) {} void apply_event(tmgr_trace_event_t event, double value) { - XBT_VERB("t=%.1f: Change value to %lg (idx: %d)", thedate, value, event->idx); + XBT_VERB("t=%.1f: Change value to %lg (idx: %u)", thedate, value, event->idx); tmgr_trace_event_unref(&event); } bool isUsed() { return true; } @@ -59,7 +59,7 @@ static void trace2vector(const char* str, std::vector* whereto res->apply_event(it, value); whereto->push_back(tmgr::DatedValue(thedate, value)); } else { - XBT_DEBUG("%.1f: ignore an event (idx: %d)\n", thedate, it->idx); + XBT_DEBUG("%.1f: ignore an event (idx: %u)\n", thedate, it->idx); } } tmgr_finalize(); diff --git a/src/xbt/backtrace_linux.cpp b/src/xbt/backtrace_linux.cpp index 8760a893d3..7fa8051de7 100644 --- a/src/xbt/backtrace_linux.cpp +++ b/src/xbt/backtrace_linux.cpp @@ -166,7 +166,7 @@ std::vector resolveBacktrace( std::vector addrs(count); for (std::size_t i = 0; i < count; i++) { /* retrieve this address */ - XBT_DEBUG("Retrieving address number %zd from '%s'", i, backtrace_syms[i]); + XBT_DEBUG("Retrieving address number %zu from '%s'", i, backtrace_syms[i]); char buff[256]; snprintf(buff, 256, "%s", strchr(backtrace_syms[i], '[') + 1); char* p = strchr(buff, ']'); @@ -175,7 +175,7 @@ std::vector resolveBacktrace( addrs[i] = buff; else addrs[i] = "0x0"; - XBT_DEBUG("Set up a new address: %zd, '%s'", i, addrs[i].c_str()); + XBT_DEBUG("Set up a new address: %zu, '%s'", i, addrs[i].c_str()); /* Add it to the command line args */ stream << addrs[i] << ' '; } @@ -194,17 +194,17 @@ std::vector resolveBacktrace( char line_func[1024]; char line_pos[1024]; for (std::size_t i = 0; i < count; i++) { - XBT_DEBUG("Looking for symbol %zd, addr = '%s'", i, addrs[i].c_str()); + XBT_DEBUG("Looking for symbol %zu, addr = '%s'", i, addrs[i].c_str()); if (fgets(line_func, 1024, pipe)) { line_func[strlen(line_func) - 1] = '\0'; } else { - XBT_VERB("Cannot run fgets to look for symbol %zd, addr %s", i, addrs[i].c_str()); + XBT_VERB("Cannot run fgets to look for symbol %zu, addr %s", i, addrs[i].c_str()); strncpy(line_func, "???",3); } if (fgets(line_pos, 1024, pipe)) { line_pos[strlen(line_pos) - 1] = '\0'; } else { - XBT_VERB("Cannot run fgets to look for symbol %zd, addr %s", i, addrs[i].c_str()); + XBT_VERB("Cannot run fgets to look for symbol %zu, addr %s", i, addrs[i].c_str()); strncpy(line_pos, backtrace_syms[i],1024); } @@ -218,7 +218,7 @@ std::vector resolveBacktrace( /* Damn. The symbol is in a dynamic library. Let's get wild */ char maps_buff[512]; - long int offset = 0; + unsigned long int offset = 0; char* p; int found = 0; @@ -226,17 +226,15 @@ std::vector resolveBacktrace( char* maps_name = bprintf("/proc/%d/maps", (int) getpid()); FILE* maps = fopen(maps_name, "r"); - long int addr = strtol(addrs[i].c_str(), &p, 16); + unsigned long int addr = strtoul(addrs[i].c_str(), &p, 16); if (*p != '\0') { - XBT_CRITICAL("Cannot parse backtrace address '%s' (addr=%#lx)", - addrs[i].c_str(), addr); + XBT_CRITICAL("Cannot parse backtrace address '%s' (addr=%#lx)", addrs[i].c_str(), addr); } - XBT_DEBUG("addr=%s (as string) =%#lx (as number)", - addrs[i].c_str(), addr); + XBT_DEBUG("addr=%s (as string) =%#lx (as number)", addrs[i].c_str(), addr); while (not found) { - long int first; - long int last; + unsigned long int first; + unsigned long int last; if (fgets(maps_buff, 512, maps) == nullptr) break; diff --git a/src/xbt/config.cpp b/src/xbt/config.cpp index 37c41b2076..977bad1502 100644 --- a/src/xbt/config.cpp +++ b/src/xbt/config.cpp @@ -1,9 +1,9 @@ -/* Copyright (c) 2004-2014,2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2004-2017. 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 +#include #include #include @@ -11,11 +11,11 @@ #include #include +#include #include #include #include #include -#include #include #include @@ -260,9 +260,10 @@ const char* TypedConfigurationElement::getTypeName() // override class Config { private: // name -> ConfigElement: - std::unordered_map options; + std::map options; // alias -> xbt_dict_elm_t from options: - std::unordered_map aliases; + std::map aliases; + bool warn_for_aliases = true; public: Config() = default; @@ -313,7 +314,8 @@ inline ConfigurationElement* Config::getDictElement(const char* name) } catch (std::out_of_range& unfound) { try { ConfigurationElement* res = aliases.at(name); - XBT_INFO("Option %s has been renamed to %s. Consider switching.", name, res->getKey().c_str()); + if (warn_for_aliases) + XBT_INFO("Option %s has been renamed to %s. Consider switching.", name, res->getKey().c_str()); return res; } catch (std::out_of_range& missing_key) { throw simgrid::config::missing_key_error(std::string("Bad config key: ") + name); @@ -356,28 +358,19 @@ void Config::dump(const char *name, const char *indent) /** @brief Displays the declared aliases and their description */ void Config::showAliases() { - std::vector names; - + bool old_warn_for_aliases = false; + std::swap(warn_for_aliases, old_warn_for_aliases); for (auto elm : aliases) - names.push_back(elm.first); - std::sort(names.begin(), names.end()); - - for (auto name : names) - printf(" %s: %s\n", name.c_str(), (*this)[name.c_str()].getDescription().c_str()); + printf(" %s: %s\n", elm.first.c_str(), (*this)[elm.first.c_str()].getDescription().c_str()); + std::swap(warn_for_aliases, old_warn_for_aliases); } /** @brief Displays the declared options and their description */ void Config::help() { - std::vector names; - - for (auto elm : options) - names.push_back(elm.first); - std::sort(names.begin(), names.end()); - - for (auto name : names) { - simgrid::config::ConfigurationElement* variable = this->options.at(name); - printf(" %s: %s\n", name.c_str(), variable->getDescription().c_str()); + for (auto elm : options) { + simgrid::config::ConfigurationElement* variable = this->options.at(elm.first); + printf(" %s: %s\n", elm.first.c_str(), variable->getDescription().c_str()); printf(" Type: %s; ", variable->getTypeName()); printf("Current value: %s\n", variable->getStringValue().c_str()); } diff --git a/src/xbt/cunit.cpp b/src/xbt/cunit.cpp index eac5f1abcb..1bf81768e8 100644 --- a/src/xbt/cunit.cpp +++ b/src/xbt/cunit.cpp @@ -9,7 +9,7 @@ /* At some point we should use https://github.com/google/googletest instead */ #include "src/internal_config.h" -#include +#include #include #include "xbt/sysdep.h" /* bvprintf */ diff --git a/src/xbt/dict.cpp b/src/xbt/dict.cpp index 7436c33f31..6a94aae7e3 100644 --- a/src/xbt/dict.cpp +++ b/src/xbt/dict.cpp @@ -6,8 +6,8 @@ /* 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 -#include +#include +#include #include "xbt/dict.h" #include "xbt/ex.h" @@ -103,7 +103,7 @@ static void xbt_dict_rehash(xbt_dict_t dict) newsize--; dict->table_size = newsize; dict->table = currcell; - XBT_DEBUG("REHASH (%d->%d)", oldsize, newsize); + XBT_DEBUG("REHASH (%u->%u)", oldsize, newsize); for (unsigned i = 0; i < oldsize; i++, currcell++) { if (*currcell == nullptr) /* empty cell */ @@ -554,11 +554,11 @@ void xbt_dict_postexit() } #ifdef SIMGRID_TEST -#include +#include "src/internal_config.h" #include "xbt.h" #include "xbt/ex.h" +#include #include -#include "src/internal_config.h" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_dict); diff --git a/src/xbt/ex.cpp b/src/xbt/ex.cpp index 9115b407e0..50a97f1666 100644 --- a/src/xbt/ex.cpp +++ b/src/xbt/ex.cpp @@ -41,8 +41,8 @@ /* The extensions made for the SimGrid project can either be distributed */ /* under the same license, or under the LGPL v2.1 */ -#include -#include +#include +#include #include #include "src/internal_config.h" /* execinfo when available */ @@ -113,8 +113,8 @@ const char *xbt_ex_catname(xbt_errcat_t cat) } #ifdef SIMGRID_TEST -#include #include "xbt/ex.h" +#include #include XBT_TEST_SUITE("xbt_ex", "Exception Handling"); diff --git a/src/xbt/parmap.cpp b/src/xbt/parmap.cpp index df47a7adee..935149f0ab 100644 --- a/src/xbt/parmap.cpp +++ b/src/xbt/parmap.cpp @@ -16,8 +16,8 @@ #endif #if HAVE_FUTEX_H +#include #include -#include #endif #include "xbt/parmap.h" diff --git a/src/xbt/xbt_main.cpp b/src/xbt/xbt_main.cpp index f4ba9ab2c8..ffd97cd274 100644 --- a/src/xbt/xbt_main.cpp +++ b/src/xbt/xbt_main.cpp @@ -7,14 +7,14 @@ #define XBT_LOG_LOCALLY_DEFINE_XBT_CHANNEL /* MSVC don't want it to be declared extern in headers and local here */ -#include -#include "xbt/misc.h" #include "simgrid_config.h" -#include "xbt/sysdep.h" +#include "xbt/config.h" +#include "xbt/dynar.h" #include "xbt/log.h" #include "xbt/log.hpp" -#include "xbt/dynar.h" -#include "xbt/config.h" +#include "xbt/misc.h" +#include "xbt/sysdep.h" +#include #include "xbt/module.h" /* this module */ @@ -23,9 +23,9 @@ #include "simgrid/sg_config.h" #include "src/internal_config.h" -#include +#include #ifdef _WIN32 -#include /* To silence MSVC on abort() */ +#include /* To silence MSVC on abort() */ #endif #if HAVE_UNISTD_H # include diff --git a/src/xbt/xbt_os_thread.c b/src/xbt/xbt_os_thread.c index af1dc12778..04a497835f 100644 --- a/src/xbt/xbt_os_thread.c +++ b/src/xbt/xbt_os_thread.c @@ -2,7 +2,7 @@ /* Used in RL to get win/lin portability, and in SG when CONTEXT_THREAD */ /* in SG, when using HAVE_UCONTEXT_CONTEXTS, xbt_os_thread_stub is used instead */ -/* Copyright (c) 2007-2015. The SimGrid Team. +/* Copyright (c) 2007-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -208,16 +208,16 @@ void xbt_os_thread_setstacksize(int stack_size) size_t rem = sz % alignment[i]; if (rem != 0 || sz == 0) { size_t sz2 = sz - rem + alignment[i]; - XBT_DEBUG("pthread_attr_setstacksize failed for %zd, try again with %zd", sz, sz2); + XBT_DEBUG("pthread_attr_setstacksize failed for %zu, try again with %zu", sz, sz2); sz = sz2; res = pthread_attr_setstacksize(&thread_attr, sz); } } if (res == EINVAL) - XBT_WARN("invalid stack size (maybe too big): %zd", sz); + XBT_WARN("invalid stack size (maybe too big): %zu", sz); else if (res != 0) - XBT_WARN("unknown error %d in pthread stacksize setting: %zd", res, sz); + XBT_WARN("unknown error %d in pthread stacksize setting: %zu", res, sz); } void xbt_os_thread_setguardsize(int guard_size) @@ -228,7 +228,7 @@ void xbt_os_thread_setguardsize(int guard_size) size_t sz = guard_size; int res = pthread_attr_setguardsize(&thread_attr, sz); if (res) - XBT_WARN("pthread_attr_setguardsize failed (%d) for size: %zd", res, sz); + XBT_WARN("pthread_attr_setguardsize failed (%d) for size: %zu", res, sz); #endif } diff --git a/teshsuite/mc/dwarf-expression/dwarf-expression.cpp b/teshsuite/mc/dwarf-expression/dwarf-expression.cpp index afc7d12c9a..5cd9b4620f 100644 --- a/teshsuite/mc/dwarf-expression/dwarf-expression.cpp +++ b/teshsuite/mc/dwarf-expression/dwarf-expression.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015. The SimGrid Team. +/* Copyright (c) 2014-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -8,9 +8,9 @@ #undef NDEBUG #endif -#include -#include -#include +#include +#include +#include #include "src/mc/mc_private.h" diff --git a/teshsuite/mc/dwarf/dwarf.cpp b/teshsuite/mc/dwarf/dwarf.cpp index 20e0645030..886d410750 100644 --- a/teshsuite/mc/dwarf/dwarf.cpp +++ b/teshsuite/mc/dwarf/dwarf.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015. The SimGrid Team. +/* Copyright (c) 2014-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -8,8 +8,8 @@ #undef NDEBUG #endif -#include -#include +#include +#include #include diff --git a/teshsuite/msg/host_on_off_processes/host_on_off_processes.c b/teshsuite/msg/host_on_off_processes/host_on_off_processes.c index a06400025c..9b5bcd2722 100644 --- a/teshsuite/msg/host_on_off_processes/host_on_off_processes.c +++ b/teshsuite/msg/host_on_off_processes/host_on_off_processes.c @@ -59,7 +59,7 @@ static int commRX(int argc, char *argv[]) } else if (error==MSG_TRANSFER_FAILURE) { XBT_INFO(" Receive message: TRANSFERT_FAILURE"); } else { - XBT_INFO(" Receive message: %d", error); + XBT_INFO(" Receive message: %u", error); } XBT_INFO(" RX Done"); return 0; diff --git a/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp b/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp index 6827ed4e46..430bb73a21 100644 --- a/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp +++ b/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp @@ -55,38 +55,38 @@ static void sender(std::vector args) switch (args[0][test - 1]) { case 'r': - XBT_INFO("Test %d: r (regular send)", test); + XBT_INFO("Test %u: r (regular send)", test); mbox->put((void*)mboxName, 42.0); break; case 'R': - XBT_INFO("Test %d: R (sleep + regular send)", test); + XBT_INFO("Test %u: R (sleep + regular send)", test); simgrid::s4u::this_actor::sleep_for(0.5); mbox->put((void*)mboxName, 42.0); break; case 'i': - XBT_INFO("Test %d: i (asynchronous isend)", test); + XBT_INFO("Test %u: i (asynchronous isend)", test); mbox->put_async((void*)mboxName, 42.0)->wait(); break; case 'I': - XBT_INFO("Test %d: I (sleep + isend)", test); + XBT_INFO("Test %u: I (sleep + isend)", test); simgrid::s4u::this_actor::sleep_for(0.5); mbox->put_async((void*)mboxName, 42.0)->wait(); break; case 'd': - XBT_INFO("Test %d: d (detached send)", test); + XBT_INFO("Test %u: d (detached send)", test); mbox->put_init((void*)mboxName, 42.0)->detach(); break; case 'D': - XBT_INFO("Test %d: D (sleep + detached send)", test); + XBT_INFO("Test %u: D (sleep + detached send)", test); simgrid::s4u::this_actor::sleep_for(0.5); mbox->put_init((void*)mboxName, 42.0)->detach(); break; default: - xbt_die("Unknown sender spec for test %d: '%c'", test, args[0][test - 1]); + xbt_die("Unknown sender spec for test %u: '%c'", test, args[0][test - 1]); } - XBT_INFO("Test %d OK", test); + XBT_INFO("Test %u OK", test); } simgrid::s4u::this_actor::sleep_for(0.5); // FIXME: we should test what happens when the process ends before the end of remote comm instead of hiding it @@ -103,54 +103,54 @@ static void receiver(std::vector args) switch (args[0][test - 1]) { case 'r': - XBT_INFO("Test %d: r (regular receive)", test); + XBT_INFO("Test %u: r (regular receive)", test); received = mbox->get(); break; case 'R': - XBT_INFO("Test %d: R (sleep + regular receive)", test); + XBT_INFO("Test %u: R (sleep + regular receive)", test); simgrid::s4u::this_actor::sleep_for(0.5); received = mbox->get(); break; case 'i': - XBT_INFO("Test %d: i (asynchronous irecv)", test); + XBT_INFO("Test %u: i (asynchronous irecv)", test); mbox->get_async(&received)->wait(); break; case 'I': - XBT_INFO("Test %d: I (sleep + asynchronous irecv)", test); + XBT_INFO("Test %u: I (sleep + asynchronous irecv)", test); simgrid::s4u::this_actor::sleep_for(0.5); mbox->get_async(&received)->wait(); break; case 'p': - XBT_INFO("Test %d: p (regular receive on permanent mailbox)", test); + XBT_INFO("Test %u: p (regular receive on permanent mailbox)", test); mbox->setReceiver(Actor::self()); received = mbox->get(); break; case 'P': - XBT_INFO("Test %d: P (sleep + regular receive on permanent mailbox)", test); + XBT_INFO("Test %u: P (sleep + regular receive on permanent mailbox)", test); simgrid::s4u::this_actor::sleep_for(0.5); mbox->setReceiver(Actor::self()); received = mbox->get(); break; case 'j': - XBT_INFO("Test %d: j (irecv on permanent mailbox)", test); + XBT_INFO("Test %u: j (irecv on permanent mailbox)", test); mbox->setReceiver(Actor::self()); mbox->get_async(&received)->wait(); break; case 'J': - XBT_INFO("Test %d: J (sleep + irecv on permanent mailbox)", test); + XBT_INFO("Test %u: J (sleep + irecv on permanent mailbox)", test); simgrid::s4u::this_actor::sleep_for(0.5); mbox->setReceiver(Actor::self()); mbox->get_async(&received)->wait(); break; default: - xbt_die("Unknown receiver spec for test %d: '%c'", test, args[0][test - 1]); + xbt_die("Unknown receiver spec for test %u: '%c'", test, args[0][test - 1]); } xbt_assert(strcmp(static_cast(received), mboxName) == 0); xbt_free(received); xbt_free(mboxName); - XBT_INFO("Test %d OK", test); + XBT_INFO("Test %u OK", test); } simgrid::s4u::this_actor::sleep_for(0.5); } diff --git a/teshsuite/s4u/comm-waitany/comm-waitany.cpp b/teshsuite/s4u/comm-waitany/comm-waitany.cpp index 6b9658317b..ce34e61671 100644 --- a/teshsuite/s4u/comm-waitany/comm-waitany.cpp +++ b/teshsuite/s4u/comm-waitany/comm-waitany.cpp @@ -3,9 +3,9 @@ /* 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 #include #include -#include #include #define NUM_COMMS 1 diff --git a/teshsuite/simdag/is-router/is-router.cpp b/teshsuite/simdag/is-router/is-router.cpp index 0b09725c98..a45915ed96 100644 --- a/teshsuite/simdag/is-router/is-router.cpp +++ b/teshsuite/simdag/is-router/is-router.cpp @@ -8,7 +8,7 @@ #include "simgrid/simdag.h" #include "src/kernel/routing/NetPoint.hpp" #include -#include +#include int main(int argc, char **argv) { diff --git a/teshsuite/smpi/coll-alltoallv/coll-alltoallv.c b/teshsuite/smpi/coll-alltoallv/coll-alltoallv.c index 780ee6354f..fced26e395 100644 --- a/teshsuite/smpi/coll-alltoallv/coll-alltoallv.c +++ b/teshsuite/smpi/coll-alltoallv/coll-alltoallv.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014. The SimGrid Team. +/* Copyright (c) 2013-2014, 2016-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -46,10 +46,9 @@ static void print_buffer_int(void *buf, int len, char *msg, int rank) { - int* v; printf("[%d] %s (#%d): ", rank, msg, len); for (int tmp = 0; tmp < len; tmp++) { - v = buf; + int* v = buf; printf("[%d]", v[tmp]); } printf("\n"); diff --git a/teshsuite/smpi/coll-scatter/coll-scatter.c b/teshsuite/smpi/coll-scatter/coll-scatter.c index 08c2aaf6ea..9f18ddbcfc 100644 --- a/teshsuite/smpi/coll-scatter/coll-scatter.c +++ b/teshsuite/smpi/coll-scatter/coll-scatter.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2014. The SimGrid Team. +/* Copyright (c) 2012-2014, 2016-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -15,7 +15,6 @@ int main(int argc, char **argv) int retval; int sendcount = 1; // one double to each process int recvcount = 1; - int i; double *sndbuf = NULL; double rcvd; int root = 0; // arbitrary choice @@ -27,7 +26,7 @@ int main(int argc, char **argv) // on root, initialize sendbuf if (root == rank) { sndbuf = malloc(size * sizeof(double)); - for (i = 0; i < size; i++) { + for (int i = 0; i < size; i++) { sndbuf[i] = (double) i; } } diff --git a/teshsuite/smpi/mpich3-test/coll/allgatherv4.c b/teshsuite/smpi/mpich3-test/coll/allgatherv4.c index 39ad8560ee..4c4cde6ded 100644 --- a/teshsuite/smpi/mpich3-test/coll/allgatherv4.c +++ b/teshsuite/smpi/mpich3-test/coll/allgatherv4.c @@ -60,9 +60,9 @@ int main(int argc, char **argv) if (!rbuf) fprintf(stderr, "\trbuf of %d bytes\n", MAX_BUF); if (!recvcounts) - fprintf(stderr, "\trecvcounts of %zd bytes\n", comm_size * sizeof(int)); + fprintf(stderr, "\trecvcounts of %zu bytes\n", comm_size * sizeof(int)); if (!displs) - fprintf(stderr, "\tdispls of %zd bytes\n", comm_size * sizeof(int)); + fprintf(stderr, "\tdispls of %zu bytes\n", comm_size * sizeof(int)); fflush(stderr); MPI_Abort(MPI_COMM_WORLD, -1); } diff --git a/teshsuite/smpi/mpich3-test/datatype/dataalign.c b/teshsuite/smpi/mpich3-test/datatype/dataalign.c index 9539b952ec..1754cd9fed 100644 --- a/teshsuite/smpi/mpich3-test/datatype/dataalign.c +++ b/teshsuite/smpi/mpich3-test/datatype/dataalign.c @@ -85,12 +85,10 @@ int main(int argc, char *argv[]) * this can generate a file that diff, for example, * believes is a binary file */ if (isprint((int) (s1[j].c))) { - fprintf(stderr, "Got s[%d].c = %c; expected %c\n", - j, s1[j].c, j + status.MPI_SOURCE + 'a'); + fprintf(stderr, "Got s[%d].c = %c; expected %c\n", j, s1[j].c, j + status.MPI_SOURCE + 'a'); } else { - fprintf(stderr, "Got s[%d].c = %x; expected %c\n", - j, (int) s1[j].c, j + status.MPI_SOURCE + 'a'); + fprintf(stderr, "Got s[%d].c = %hhx; expected %c\n", j, s1[j].c, j + status.MPI_SOURCE + 'a'); } } } diff --git a/teshsuite/smpi/mpich3-test/datatype/longdouble.c b/teshsuite/smpi/mpich3-test/datatype/longdouble.c index 9275ef1707..d9f9ca55c1 100644 --- a/teshsuite/smpi/mpich3-test/datatype/longdouble.c +++ b/teshsuite/smpi/mpich3-test/datatype/longdouble.c @@ -35,9 +35,8 @@ int main(int argc, char *argv[]) if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) { MPI_Type_size(MPI_LONG_DOUBLE, &type_size); if (type_size != sizeof(long double)) { - printf("type_size != sizeof(long double) : (%d != %zd)\n", - type_size, sizeof(long double)); - ++errs; + printf("type_size != sizeof(long double) : (%d != %zu)\n", type_size, sizeof(long double)); + ++errs; } } #endif @@ -45,9 +44,9 @@ int main(int argc, char *argv[]) if (MPI_C_LONG_DOUBLE_COMPLEX != MPI_DATATYPE_NULL) { MPI_Type_size(MPI_C_LONG_DOUBLE_COMPLEX, &type_size); if (type_size != sizeof(long double _Complex)) { - printf("type_size != sizeof(long double _Complex) : (%d != %zd)\n", - type_size, sizeof(long double _Complex)); - ++errs; + printf("type_size != sizeof(long double _Complex) : (%d != %zu)\n", type_size, + sizeof(long double _Complex)); + ++errs; } } #endif diff --git a/teshsuite/smpi/mpich3-test/datatype/sendrecvt2.c b/teshsuite/smpi/mpich3-test/datatype/sendrecvt2.c index 14c57253af..6ff46d23f0 100644 --- a/teshsuite/smpi/mpich3-test/datatype/sendrecvt2.c +++ b/teshsuite/smpi/mpich3-test/datatype/sendrecvt2.c @@ -93,7 +93,7 @@ int main(int argc, char **argv) myname, j, world_rank, errloc - 1); p1 = (char *) inbufs[j]; p2 = (char *) outbufs[j]; - fprintf(stderr, "Got %x expected %x\n", p1[errloc - 1], p2[errloc - 1]); + fprintf(stderr, "Got %hhx expected %hhx\n", p1[errloc - 1], p2[errloc - 1]); err++; } } diff --git a/teshsuite/smpi/mpich3-test/generate_report b/teshsuite/smpi/mpich3-test/generate_report index ac33562311..1b3c55efa3 100755 --- a/teshsuite/smpi/mpich3-test/generate_report +++ b/teshsuite/smpi/mpich3-test/generate_report @@ -2,8 +2,8 @@ explore_files() { - for cmake in `find -name CMakeLists.txt` ; do - d=`dirname $cmake` + for cmake in $(find -name CMakeLists.txt) ; do + d=$(dirname $cmake) echo;echo "Directory $d" diff --git a/teshsuite/smpi/mpich3-test/util/dtypes.c b/teshsuite/smpi/mpich3-test/util/dtypes.c index 7191e15c74..8e60c201b6 100644 --- a/teshsuite/smpi/mpich3-test/util/dtypes.c +++ b/teshsuite/smpi/mpich3-test/util/dtypes.c @@ -361,7 +361,7 @@ static int MtestDatatype2CheckAndPrint(void *inbuf, void *outbuf, int size_bytes typename, typenum, world_rank, errloc - 1, size_bytes); p1 = (char *) inbuf; p2 = (char *) outbuf; - fprintf(stderr, "Got %x expected %x\n", p2[errloc - 1], p1[errloc - 1]); + fprintf(stderr, "Got %hhx expected %hhx\n", p2[errloc - 1], p1[errloc - 1]); } return errloc; } diff --git a/teshsuite/surf/lmm_usage/lmm_usage.cpp b/teshsuite/surf/lmm_usage/lmm_usage.cpp index ce8eac5e71..c35f43779c 100644 --- a/teshsuite/surf/lmm_usage/lmm_usage.cpp +++ b/teshsuite/surf/lmm_usage/lmm_usage.cpp @@ -1,6 +1,6 @@ /* A few tests for the maxmin library */ -/* Copyright (c) 2007-2015. The SimGrid Team. +/* Copyright (c) 2007-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -12,7 +12,7 @@ #include "xbt/log.h" #include "xbt/module.h" #include "xbt/sysdep.h" -#include +#include XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example"); diff --git a/teshsuite/surf/maxmin_bench/maxmin_bench.cpp b/teshsuite/surf/maxmin_bench/maxmin_bench.cpp index aed2abb2a9..a002dc066c 100644 --- a/teshsuite/surf/maxmin_bench/maxmin_bench.cpp +++ b/teshsuite/surf/maxmin_bench/maxmin_bench.cpp @@ -1,6 +1,6 @@ /* A crash few tests for the maxmin library */ -/* Copyright (c) 2004-2015. The SimGrid Team. +/* Copyright (c) 2004-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -14,9 +14,9 @@ #define MYRANDMAX 1000 -#include -#include -#include +#include +#include +#include double date; int64_t seedx = 0; @@ -185,10 +185,10 @@ int main(int argc, char **argv) float mean_date= acc_date/(float)testcount; float stdev_date= sqrt(acc_date2/(float)testcount-mean_date*mean_date); - fprintf(stderr, - "%ix One shot execution time for a total of %d constraints, " - "%d variables with %d active constraint each, concurrency in [%i,%i] and max concurrency share %i\n", - testcount,nb_cnst, nb_var, nb_elem, (1< -#include +#include +#include +#include +#include #include #include -#include -#include #include #include @@ -45,7 +45,7 @@ int main(int argc, char**argv) for (i = 0; i < TESTSIZE; i++) { size = size_of_block(i); pointers[i] = mmalloc(heapA, size); - XBT_INFO("%d bytes allocated with offset %tx", size, ((char*)pointers[i])-((char*)heapA)); + XBT_INFO("%d bytes allocated with offset %zx", size, (size_t)((char*)pointers[i] - (char*)heapA)); } XBT_INFO("All blocks were correctly allocated. Free every second block"); for (i = 0; i < TESTSIZE; i+=2) { diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 2807095478..958684d51b 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -659,10 +659,6 @@ set(MC_SRC set(MC_SIMGRID_MC_SRC src/mc/checker/simgrid_mc.cpp) set(headers_to_install - include/msg/msg.h - include/msg/datatypes.h - include/simdag/simdag.h - include/simdag/datatypes.h include/simgrid/chrono.hpp include/simgrid/plugins/energy.h include/simgrid/plugins/load.h diff --git a/tools/cmake/Distrib.cmake b/tools/cmake/Distrib.cmake index 64a67004a5..aacd81fc33 100644 --- a/tools/cmake/Distrib.cmake +++ b/tools/cmake/Distrib.cmake @@ -142,9 +142,6 @@ set(source_to_pack ${JEDULE_SRC} ${JMSG_C_SRC} ${JMSG_JAVA_SRC} - ${JSURF_SWIG_SRC} - ${JSURF_SWIG_SRC_EXTRA} - ${JSURF_C_SRC} ${LUA_SRC} ${MC_SRC_BASE} ${MC_SRC} diff --git a/tools/cmake/GCCFlags.cmake b/tools/cmake/GCCFlags.cmake index 5731bdac15..309a69a472 100644 --- a/tools/cmake/GCCFlags.cmake +++ b/tools/cmake/GCCFlags.cmake @@ -15,6 +15,9 @@ set(warnCXXFLAGS "") if(enable_compile_warnings) set(warnCFLAGS "-fno-common -Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing") + if(CMAKE_COMPILER_IS_GNUCC AND (NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS "5.0"))) + set(warnCFLAGS "${warnCFLAGS} -Wformat-signedness") + endif() if(CMAKE_C_COMPILER_ID MATCHES "Clang|GCC") set(warnCFLAGS "${warnCFLAGS} -Wno-format-nonliteral") endif() @@ -22,7 +25,10 @@ if(enable_compile_warnings) set(warnCFLAGS "${warnCFLAGS} -Wclobbered -Wno-error=clobbered -Wno-unused-local-typedefs -Wno-error=attributes") endif() - set(warnCXXFLAGS "${warnCFLAGS} -Wall -Wextra -Wunused -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing") + set(warnCXXFLAGS "${warnCFLAGS} -Wall -Wextra -Wunused -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing") + if(CMAKE_COMPILER_IS_GNUCXX AND (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0"))) + set(warnCFLAGS "${warnCFLAGS} -Wformat-signedness") + endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GCC") set(warnCXXFLAGS "${warnCXXFLAGS} -Wno-format-nonliteral") endif() diff --git a/tools/cmake/Java.cmake b/tools/cmake/Java.cmake index ebc2e3da1d..3d5a70d6b4 100644 --- a/tools/cmake/Java.cmake +++ b/tools/cmake/Java.cmake @@ -22,15 +22,6 @@ if(WIN32) endif() endif() -# find_package(SWIG) -# if(${SWIG_FOUND}) -# include(UseSWIG) -# message("-- [Java] Swig found: version ${SWIG_VERSION}") -# else() -# message("-- [Java] Swig NOT FOUND. That's fine unless you work on this part yourself.") -# endif() -#mark_as_advanced(SWIG_EXECUTABLE) - # Rules to build libsimgrid-java ################################ diff --git a/tools/doxygen/xbt_log_extract_hierarchy.pl b/tools/doxygen/xbt_log_extract_hierarchy.pl index adc5dfe4dc..01447433f5 100755 --- a/tools/doxygen/xbt_log_extract_hierarchy.pl +++ b/tools/doxygen/xbt_log_extract_hierarchy.pl @@ -116,9 +116,7 @@ sub display_subtree { display_subtree("XBT_LOG_ROOT_CAT",""); map { - if ($_ ne "mc_main") { # This one is not in libsimgrid - warn "Category $_ does not seem to be connected. Use XBT_LOG_CONNECT($_).\n"; - } + warn "Category $_ does not seem to be connected. Use XBT_LOG_CONNECT($_).\n"; } grep {!defined $connected{$_}} sort keys %ancestor; map { warn "Category $_ does not seem to be connected to the root (anc=$ancestor{$_})\n"; diff --git a/tools/git-hooks/clang-format.pre-commit b/tools/git-hooks/clang-format.pre-commit index db2e47aad2..8d1bd55ce4 100755 --- a/tools/git-hooks/clang-format.pre-commit +++ b/tools/git-hooks/clang-format.pre-commit @@ -43,7 +43,7 @@ CLANG_FORMAT=$(which clang-format-3.8) for name in git-clang-format-3.9 git-clang-format-3.8 git-clang-format ; do where=$(which $name) if [ x != "x$where" ] ; then - GIT_SUBCOMMAND=`echo $name|sed 's/git-//'` + GIT_SUBCOMMAND=$(echo $name|sed 's/git-//') break fi done @@ -74,10 +74,10 @@ canonicalize_filename () { local result="" # Need to restore the working directory after work. - pushd `pwd` > /dev/null + pushd $(pwd) > /dev/null cd "$(dirname "$target_file")" - target_file=`basename $target_file` + target_file=$(basename $target_file) # Iterate down a (possible) chain of symlinks while [ -L "$target_file" ] @@ -89,7 +89,7 @@ canonicalize_filename () { # Compute the canonicalized name by finding the physical path # for the directory we're in and appending the target file. - physical_directory=`pwd -P` + physical_directory=$(pwd -P) result="$physical_directory"/"$target_file" # restore the working directory after work. diff --git a/tools/jenkins/Coverage.sh b/tools/jenkins/Coverage.sh index b2ed44aa99..a8503ca934 100755 --- a/tools/jenkins/Coverage.sh +++ b/tools/jenkins/Coverage.sh @@ -75,7 +75,7 @@ if [ -f Testing/TAG ] ; then ant -f $WORKSPACE/tools/jenkins/jacoco.xml -Dexamplesrcdir=$WORKSPACE -Dbuilddir=$BUILDFOLDER/${sourcepath} -Djarfile=$BUILDFOLDER/simgrid.jar -Djacocodir=${JACOCO_PATH}/lib #convert jacoco xml reports in cobertura xml reports cover2cover.py $BUILDFOLDER/${sourcepath}/report.xml .. ../src/bindings/java src/bindings/java > $WORKSPACE/java_coverage_${i}.xml - i=$(($i + 1)) + i=$((i + 1)) done #convert all gcov reports to xml cobertura reports