Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please sonar
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 19 Apr 2019 08:41:01 +0000 (10:41 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 19 Apr 2019 08:41:11 +0000 (10:41 +0200)
include/simgrid/jedule/jedule.hpp
src/smpi/bindings/smpi_pmpi_file.cpp
src/smpi/include/smpi_file.hpp
src/smpi/mpi/smpi_file.cpp
src/surf/cpu_ti.cpp

index d742137..007c970 100644 (file)
@@ -16,7 +16,7 @@ namespace jedule{
 
 class XBT_PUBLIC Jedule {
 public:
-  Jedule(const std::string& name) : root_container_(name) {}
+  explicit Jedule(const std::string& name) : root_container_(name) {}
   std::vector<Event> event_set_;
   Container root_container_;
   void add_meta_info(char* key, char* value);
index cdb35bd..ee7493d 100644 (file)
@@ -4,12 +4,10 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "private.hpp"
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
 
 #include "smpi_file.hpp"
 #include "smpi_datatype.hpp"
 
-
 int PMPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh){
   if (comm == MPI_COMM_NULL)
     return MPI_ERR_COMM;
@@ -324,4 +322,4 @@ int PMPI_File_set_info(MPI_File  fh, MPI_Info info)
   CHECK_FILE(fh)
   fh->set_info(info);
   return MPI_SUCCESS;
-}
\ No newline at end of file
+}
index 5570830..e90b48b 100644 (file)
@@ -13,6 +13,7 @@
 #include "smpi_info.hpp"
 #include  <algorithm>
 
+XBT_LOG_EXTERNAL_CATEGORY(smpi_pmpi);
 
 namespace simgrid{
 namespace smpi{
@@ -83,7 +84,7 @@ class File{
         max=max_offsets[i];
     }
     
-    XBT_DEBUG("my offsets to read : %lld:%lld, global min and max %lld:%lld", min_offset, max_offset, min, max);
+    XBT_CDEBUG(smpi_pmpi, "my offsets to read : %lld:%lld, global min and max %lld:%lld", min_offset, max_offset, min, max);
     if(empty==1){
       status->count=0;
       return MPI_SUCCESS;
@@ -98,7 +99,7 @@ class File{
     //Interleaved case : How much do I need to read, and whom to send it ?
     MPI_Offset my_chunk_start=(max-min+1)/size*rank;
     MPI_Offset my_chunk_end=((max-min+1)/size*(rank+1));
-    XBT_DEBUG("my chunks to read : %lld:%lld", my_chunk_start, my_chunk_end);
+    XBT_CDEBUG(smpi_pmpi, "my chunks to read : %lld:%lld", my_chunk_start, my_chunk_end);
     int* send_sizes = xbt_new0(int, size);
     int* recv_sizes = xbt_new(int, size);
     int* send_disps = xbt_new(int, size);
@@ -112,7 +113,7 @@ class File{
         min_offset=std::min(min_offset, min_offsets[i]);
         send_disps[i]=0;//send_sizes[i]; cheat to avoid issues when send>recv as we use recv buffer
         total_sent+=send_sizes[i];
-        XBT_DEBUG("will have to send %d bytes to %d", send_sizes[i], i);
+        XBT_CDEBUG(smpi_pmpi, "will have to send %d bytes to %d", send_sizes[i], i);
       }
     }
     min_offset=std::max(min_offset, my_chunk_start);
@@ -151,7 +152,7 @@ class File{
       else
         totreads += (std::min(chunks[i].second, my_chunk_end-1)-std::max(chunks[i].first, my_chunk_start));
     }
-    XBT_DEBUG("will have to access %lld from my chunk", totreads);
+    XBT_CDEBUG(smpi_pmpi, "will have to access %lld from my chunk", totreads);
 
     char* sendbuf= static_cast<char *>(smpi_get_tmp_sendbuffer(total_sent));
 
index abf21aa..25f2e52 100644 (file)
 #include "smpi_win.hpp"
 #include "smpi_request.hpp"
 
-//setup here, because we have templates in smpi_file we want to log
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_io, smpi, "Logging specific to SMPI (RMA operations)");
-
 #include "smpi_file.hpp"
 #include "smpi_status.hpp"
 #include "simgrid/plugins/file_system.h"
 
 #define FP_SIZE sizeof(MPI_Offset)
 
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_io, smpi, "Logging specific to SMPI (RMA operations)");
 
 namespace simgrid{
 namespace smpi{
index 1232dbe..b38323e 100644 (file)
@@ -207,7 +207,7 @@ double CpuTiProfile::solve_simple(double a, double amount)
 double CpuTiTmgr::get_power_scale(double a)
 {
   double reduced_a          = a - floor(a / last_time_) * last_time_;
-  int point                       = profile_->binary_search(profile_->time_points_, reduced_a);
+  int point                       = CpuTiProfile::binary_search(profile_->time_points_, reduced_a);
   kernel::profile::DatedValue val = speed_profile_->event_list.at(point);
   return val.value_;
 }