Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 5 Jul 2017 12:16:29 +0000 (14:16 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 5 Jul 2017 12:16:29 +0000 (14:16 +0200)
src/instr/instr_paje_trace.cpp
src/smpi/smpi_f2c.cpp
src/smpi/smpi_group.cpp
src/smpi/smpi_request.cpp
src/surf/instr_routing.cpp
src/xbt/dict.cpp
teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp
teshsuite/s4u/comm-waitany/comm-waitany.cpp

index 6513685..8c1aa94 100644 (file)
@@ -387,8 +387,8 @@ if (instr_fmt_type == instr_fmt_paje) {
   /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
     if (timestamp < 1e-12)
         stream << 0;
-    else 
-        stream << timestamp;
+    else
+      stream << timestamp;
     stream << " " << container->type->id << " " << container->id;
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
index 978722d..df584b4 100644 (file)
@@ -80,8 +80,8 @@ F2C* F2C::f2c(int id){
   if(f2c_lookup_==nullptr){
     f2c_lookup_=xbt_dict_new_homogeneous(nullptr);
   }
-  char key[KEY_SIZE];
   if(id >= 0){
+    char key[KEY_SIZE];
     return static_cast<F2C*>(xbt_dict_get_or_null(f2c_lookup_, get_key(key, id)));
   }else
     return NULL;
index 4c4cd35..a7e56ba 100644 (file)
@@ -64,12 +64,10 @@ Group::~Group()
 
 void Group::set_mapping(int index, int rank)
 {
-  int * val_rank;
-
   if (rank < size_) {
     rank_to_index_map_[rank] = index;
     if (index!=MPI_UNDEFINED ) {
-      val_rank = static_cast<int *>(xbt_malloc(sizeof(int)));
+      int* val_rank = static_cast<int*>(xbt_malloc(sizeof(int)));
       *val_rank = rank;
 
       char * key = bprintf("%d", index);
@@ -124,16 +122,14 @@ int Group::size()
 int Group::compare(MPI_Group group2)
 {
   int result;
-  int i;
-  int index;
 
   result = MPI_IDENT;
   if (size_ != group2->size()) {
     result = MPI_UNEQUAL;
   } else {
     int sz = group2->size();
-    for (i = 0; i < sz; i++) {
-      index = this->index(i);
+    for (int i = 0; i < sz; i++) {
+      int index = this->index(i);
       int rank = group2->rank(index);
       if (rank == MPI_UNDEFINED) {
         result = MPI_UNEQUAL;
index 7080784..0e8c01b 100644 (file)
@@ -874,15 +874,12 @@ int Request::waitall(int count, MPI_Request requests[], MPI_Status status[])
 
 int Request::waitsome(int incount, MPI_Request requests[], int *indices, MPI_Status status[])
 {
-  int i;
   int count = 0;
-  int index;
   MPI_Status stat;
   MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat;
 
-  for(i = 0; i < incount; i++)
-  {
-    index=waitany(incount, requests, pstat);
+  for (int i = 0; i < incount; i++) {
+    int index = waitany(incount, requests, pstat);
     if(index!=MPI_UNDEFINED){
       indices[count] = index;
       count++;
index b14c04d..1dd0268 100644 (file)
@@ -298,7 +298,7 @@ static void sg_instr_new_host(simgrid::s4u::Host& host)
 static void sg_instr_new_router(simgrid::kernel::routing::NetPoint * netpoint)
 {
   if (not netpoint->isRouter())
-    return; 
+    return;
   if (TRACE_is_enabled() && TRACE_needs_platform()) {
     container_t father = currentContainer.back();
     PJ_container_new(netpoint->cname(), INSTR_ROUTER, father);
index ccc2d35..5f53f43 100644 (file)
@@ -439,11 +439,10 @@ int xbt_dict_is_empty(xbt_dict_t dict)
  */
 void xbt_dict_dump(xbt_dict_t dict, void_f_pvoid_t output)
 {
-  int i;
   xbt_dictelm_t element;
   printf("Dict %p:\n", dict);
   if (dict != nullptr) {
-    for (i = 0; i < dict->table_size; i++) {
+    for (int i = 0; i < dict->table_size; i++) {
       element = dict->table[i];
       if (element) {
         printf("[\n");
index 0eebb04..ac41a68 100644 (file)
@@ -191,5 +191,6 @@ int main(int argc, char* argv[])
   e->run();
   XBT_INFO("Simulation time %g", e->getClock());
 
+  delete e;
   return 0;
 }
index 1dd41e1..75784b9 100644 (file)
@@ -69,7 +69,8 @@ int main(int argc, char** argv)
   simgrid::s4u::Actor::createActor("Sender", hosts[1], sender);
   xbt_free(hosts);
 
-  simgrid::s4u::Engine::instance()->run();
+  engine->run();
 
+  delete engine;
   return 0;
 }