Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill an unused layer of code
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 10 Apr 2016 10:08:38 +0000 (12:08 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 10 Apr 2016 10:08:38 +0000 (12:08 +0200)
13 files changed:
src/include/simgrid/sg_config.h
src/instr/instr_config.cpp
src/mc/Session.cpp
src/msg/msg_global.cpp
src/simgrid/sg_config.cpp
src/simix/smx_global.cpp
src/smpi/smpi_base.cpp
src/smpi/smpi_bench.cpp
src/smpi/smpi_coll.cpp
src/smpi/smpi_global.cpp
src/surf/network_ib.cpp
src/surf/network_smpi.cpp
src/xbt/ex.c

index 70007cc..96a46ec 100644 (file)
@@ -12,11 +12,6 @@ SG_BEGIN_DECL()
 XBT_PUBLIC_DATA(xbt_cfg_t) simgrid_config;
 XBT_PUBLIC_DATA(int) _sg_cfg_init_status;
 XBT_PUBLIC_DATA(int) _sg_cfg_exit_asap;
-XBT_PUBLIC(int) sg_cfg_is_default_value(const char* name);
-XBT_PUBLIC(int) sg_cfg_get_int(const char* name);
-XBT_PUBLIC(double) sg_cfg_get_double(const char* name);
-XBT_PUBLIC(char*) sg_cfg_get_string(const char* name);
-XBT_PUBLIC(int) sg_cfg_get_boolean(const char* name);
 
 XBT_PUBLIC(void) sg_config_init(int *argc, char **argv);
 XBT_PUBLIC(void) sg_config_finalize(void);
index 8555cfa..3d844af 100644 (file)
@@ -111,7 +111,7 @@ int TRACE_start()
     TRACE_init();
 
     /* open the trace file(s) */
-    const char* format = sg_cfg_get_string(OPT_TRACING_FORMAT);
+    const char* format = xbt_cfg_get_string(OPT_TRACING_FORMAT);
     XBT_DEBUG("Tracing format %s\n", format);
     if(!strcmp(format, "Paje")){
       TRACE_paje_init();
@@ -193,7 +193,7 @@ int TRACE_end()
     xbt_dict_free(&created_categories);
 
     /* close the trace files */
-    const char* format = sg_cfg_get_string(OPT_TRACING_FORMAT);
+    const char* format = xbt_cfg_get_string(OPT_TRACING_FORMAT);
     XBT_DEBUG("Tracing format %s\n", format);
     if(!strcmp(format, "Paje")){
       TRACE_paje_end();
index 223bfc0..63c0c74 100644 (file)
@@ -81,7 +81,7 @@ Session::Session(pid_t pid, int socket)
   std::unique_ptr<simgrid::mc::Process> process(new simgrid::mc::Process(pid, socket));
   // TODO, automatic detection of the config from the process
   process->privatized(
-    sg_cfg_get_boolean("smpi/privatize_global_variables"));
+    xbt_cfg_get_boolean("smpi/privatize_global_variables"));
   modelChecker_ = std::unique_ptr<ModelChecker>(
     new simgrid::mc::ModelChecker(std::move(process)));
   xbt_assert(mc_model_checker == nullptr);
@@ -147,4 +147,4 @@ void Session::close()
 simgrid::mc::Session* session;
 
 }
-}
\ No newline at end of file
+}
index 9723905..19abf3d 100644 (file)
@@ -75,7 +75,7 @@ void MSG_init_nocheck(int *argc, char **argv) {
   XBT_DEBUG("ADD MSG LEVELS");
   MSG_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, (void_f_pvoid_t) __MSG_storage_destroy);
   MSG_FILE_LEVEL = xbt_lib_add_level(file_lib, (void_f_pvoid_t) __MSG_file_destroy);
-  if(sg_cfg_get_boolean("clean_atexit")) atexit(MSG_exit);
+  if(xbt_cfg_get_boolean("clean_atexit")) atexit(MSG_exit);
 }
 
 /** \ingroup msg_simulation
index 4b2253d..3b7519c 100644 (file)
@@ -430,9 +430,7 @@ static void describe_model(char *result,
             model_description[0].name ? model_description[0].name : "n/a");
   for (int i = 1; model_description[i].name; i++)
     p += sprintf(p, ", %s", model_description[i].name);
-  sprintf(p,
-      ".\n       (use 'help' as a value to see the long description of each %s)",
-          name);
+  sprintf(p, ".\n       (use 'help' as a value to see the long description of each %s)", name);
 }
 
 /* create the config set, register what should be and parse the command line*/
@@ -539,9 +537,7 @@ void sg_config_init(int *argc, char **argv)
     const char *dflt_ctx_fact = "thread";
     {
       char *p = description +
-        sprintf(description,
-                "Context factory to use in SIMIX. Possible values: %s",
-                dflt_ctx_fact);
+        sprintf(description, "Context factory to use in SIMIX. Possible values: %s", dflt_ctx_fact);
 #if HAVE_UCONTEXT_CONTEXTS
       dflt_ctx_fact = "ucontext";
       p += sprintf(p, ", %s", dflt_ctx_fact);
@@ -671,29 +667,3 @@ void sg_config_finalize(void)
   xbt_cfg_free(&simgrid_config);
   _sg_cfg_init_status = 0;
 }
-
-int sg_cfg_is_default_value(const char *name)
-{
-  return xbt_cfg_is_default_value(name);
-}
-
-int sg_cfg_get_int(const char* name)
-{
-  return xbt_cfg_get_int(name);
-}
-
-double sg_cfg_get_double(const char* name)
-{
-  return xbt_cfg_get_double(name);
-}
-
-char* sg_cfg_get_string(const char* name)
-{
-  return xbt_cfg_get_string(name);
-}
-
-int sg_cfg_get_boolean(const char* name)
-{
-  return xbt_cfg_get_boolean(name);
-}
-
index d84905a..d039e8c 100644 (file)
@@ -260,7 +260,7 @@ void SIMIX_global_init(int *argc, char **argv)
     simix_timers = xbt_heap_new(8, &free);
   }
 
-  if (sg_cfg_get_boolean("clean_atexit"))
+  if (xbt_cfg_get_boolean("clean_atexit"))
     atexit(SIMIX_clean);
 
 #if HAVE_MC
index d9ae5ee..a41febc 100644 (file)
@@ -126,7 +126,7 @@ static xbt_dynar_t parse_factor(const char *smpi_coef_string)
 static double smpi_os(double size)
 {
   if (!smpi_os_values) {
-    smpi_os_values = parse_factor(sg_cfg_get_string("smpi/os"));
+    smpi_os_values = parse_factor(xbt_cfg_get_string("smpi/os"));
     smpi_register_static(smpi_os_values, xbt_dynar_free_voidp);
   }
   unsigned int iter = 0;
@@ -155,7 +155,7 @@ static double smpi_os(double size)
 static double smpi_ois(double size)
 {
   if (!smpi_ois_values) {
-    smpi_ois_values = parse_factor(sg_cfg_get_string("smpi/ois"));
+    smpi_ois_values = parse_factor(xbt_cfg_get_string("smpi/ois"));
     smpi_register_static(smpi_ois_values, xbt_dynar_free_voidp);
   }
   unsigned int iter = 0;
@@ -182,7 +182,7 @@ static double smpi_ois(double size)
 static double smpi_or(double size)
 {
   if (!smpi_or_values) {
-    smpi_or_values = parse_factor(sg_cfg_get_string("smpi/or"));
+    smpi_or_values = parse_factor(xbt_cfg_get_string("smpi/or"));
     smpi_register_static(smpi_or_values, xbt_dynar_free_voidp);
   }
   unsigned int iter = 0;
@@ -334,7 +334,7 @@ void smpi_mpi_start(MPI_Request request)
   if (request->flags & RECV) {
     print_request("New recv", request);
 
-    int async_small_thresh = sg_cfg_get_int("smpi/async_small_thresh");
+    int async_small_thresh = xbt_cfg_get_int("smpi/async_small_thresh");
 
     xbt_mutex_t mut = smpi_process_mailboxes_mutex();
     if (async_small_thresh != 0 ||request->flags & RMA)
@@ -412,7 +412,7 @@ void smpi_mpi_start(MPI_Request request)
         XBT_DEBUG("sending size of %zu : sleep %f ", request->size, smpi_os(request->size));
     }
 
-    int async_small_thresh = sg_cfg_get_int("smpi/async_small_thresh");
+    int async_small_thresh = xbt_cfg_get_int("smpi/async_small_thresh");
 
     xbt_mutex_t mut=smpi_process_remote_mailboxes_mutex(receiver);
 
@@ -449,7 +449,7 @@ void smpi_mpi_start(MPI_Request request)
 
     void* buf = request->buf;
     if ( (! (request->flags & SSEND)) &&
-         (static_cast<int>(request->size) < sg_cfg_get_int("smpi/send_is_detached_thresh"))) {
+         (static_cast<int>(request->size) < xbt_cfg_get_int("smpi/send_is_detached_thresh"))) {
       void *oldbuf = NULL;
       request->detached = 1;
       XBT_DEBUG("Send request %p is detached", request);
@@ -836,7 +836,7 @@ void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
 
   print_request("New iprobe", request);
   // We have to test both mailboxes as we don't know if we will receive one one or another
-  if (sg_cfg_get_int("smpi/async_small_thresh")>0){
+  if (xbt_cfg_get_int("smpi/async_small_thresh")>0){
       mailbox = smpi_process_mailbox_small();
       XBT_DEBUG("trying to probe the perm recv mailbox");
       request->action = simcall_comm_iprobe(mailbox, 0, request->src, request->tag, &match_recv, (void*)request);
index 00ded92..21abd61 100644 (file)
@@ -261,7 +261,7 @@ void smpi_bench_end(void)
     xbt_die("Aborting.");
   }
   // Simulate the benchmarked computation unless disabled via command-line argument
-  if (sg_cfg_get_boolean("smpi/simulate_computation")) {
+  if (xbt_cfg_get_boolean("smpi/simulate_computation")) {
     smpi_execute(xbt_os_timer_elapsed(timer));
   }
 
@@ -481,7 +481,7 @@ void smpi_sample_3(int global, const char *file, int line)
 void *smpi_shared_malloc(size_t size, const char *file, int line)
 {
   void* mem;
-  if (sg_cfg_get_boolean("smpi/use_shared_malloc")){
+  if (xbt_cfg_get_boolean("smpi/use_shared_malloc")){
     int fd;
     smpi_source_location loc(file, line);
     auto res = allocs.insert(std::make_pair(loc, shared_data_t()));
@@ -524,7 +524,7 @@ void smpi_shared_free(void *ptr)
 {
   char loc[PTR_STRLEN];
 
-  if (sg_cfg_get_boolean("smpi/use_shared_malloc")){
+  if (xbt_cfg_get_boolean("smpi/use_shared_malloc")){
     snprintf(loc, PTR_STRLEN, "%p", ptr);
     auto meta = allocs_metadata.find(ptr);
     if (meta == allocs_metadata.end()) {
index fc01931..4a8806f 100644 (file)
@@ -125,7 +125,7 @@ int find_coll_description(s_mpi_coll_description_t * table,
   char *name_list = NULL;
   int selector_on=0;
   if(name==NULL){//no argument provided, use active selector's algorithm
-    name=(char*)sg_cfg_get_string("smpi/coll_selector");
+    name=(char*)xbt_cfg_get_string("smpi/coll_selector");
     selector_on=1;
   }
   for (int i = 0; table[i].name; i++)
index caacb69..cf08616 100644 (file)
@@ -376,9 +376,9 @@ void smpi_comm_null_copy_buffer_callback(smx_synchro_t comm, void *buff, size_t
 static void smpi_check_options(){
   //check correctness of MPI parameters
 
-   xbt_assert(sg_cfg_get_int("smpi/async_small_thresh") <= sg_cfg_get_int("smpi/send_is_detached_thresh"));
+   xbt_assert(xbt_cfg_get_int("smpi/async_small_thresh") <= xbt_cfg_get_int("smpi/send_is_detached_thresh"));
 
-   if (sg_cfg_is_default_value("smpi/running_power")) {
+   if (xbt_cfg_is_default_value("smpi/running_power")) {
      XBT_INFO("You did not set the power of the host running the simulation.  "
               "The timings will certainly not be accurate.  "
               "Use the option \"--cfg=smpi/running_power:<flops>\" to set its value."
@@ -524,60 +524,60 @@ static void smpi_init_logs(){
 }
 
 static void smpi_init_options(){
-  int gather_id = find_coll_description(mpi_coll_gather_description, sg_cfg_get_string("smpi/gather"),"gather");
+  int gather_id = find_coll_description(mpi_coll_gather_description, xbt_cfg_get_string("smpi/gather"),"gather");
     mpi_coll_gather_fun = (int (*)(void *, int, MPI_Datatype, void *, int, MPI_Datatype, int, MPI_Comm))
         mpi_coll_gather_description[gather_id].coll;
 
     int allgather_id = find_coll_description(mpi_coll_allgather_description,
-                                             sg_cfg_get_string("smpi/allgather"),"allgather");
+                                             xbt_cfg_get_string("smpi/allgather"),"allgather");
     mpi_coll_allgather_fun = (int (*)(void *, int, MPI_Datatype, void *, int, MPI_Datatype, MPI_Comm))
         mpi_coll_allgather_description[allgather_id].coll;
 
     int allgatherv_id = find_coll_description(mpi_coll_allgatherv_description,
-                                              sg_cfg_get_string("smpi/allgatherv"),"allgatherv");
+                                              xbt_cfg_get_string("smpi/allgatherv"),"allgatherv");
     mpi_coll_allgatherv_fun = (int (*)(void *, int, MPI_Datatype, void *, int *, int *, MPI_Datatype, MPI_Comm))
         mpi_coll_allgatherv_description[allgatherv_id].coll;
 
     int allreduce_id = find_coll_description(mpi_coll_allreduce_description,
-                                             sg_cfg_get_string("smpi/allreduce"),"allreduce");
+                                             xbt_cfg_get_string("smpi/allreduce"),"allreduce");
     mpi_coll_allreduce_fun = (int (*)(void *sbuf, void *rbuf, int rcount, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm))
         mpi_coll_allreduce_description[allreduce_id].coll;
 
     int alltoall_id = find_coll_description(mpi_coll_alltoall_description,
-                                            sg_cfg_get_string("smpi/alltoall"),"alltoall");
+                                            xbt_cfg_get_string("smpi/alltoall"),"alltoall");
     mpi_coll_alltoall_fun = (int (*)(void *, int, MPI_Datatype, void *, int, MPI_Datatype, MPI_Comm))
         mpi_coll_alltoall_description[alltoall_id].coll;
 
     int alltoallv_id = find_coll_description(mpi_coll_alltoallv_description,
-                                             sg_cfg_get_string("smpi/alltoallv"),"alltoallv");
+                                             xbt_cfg_get_string("smpi/alltoallv"),"alltoallv");
     mpi_coll_alltoallv_fun = (int (*)(void *, int *, int *, MPI_Datatype, void *, int *, int *, MPI_Datatype, MPI_Comm))
         mpi_coll_alltoallv_description[alltoallv_id].coll;
 
-    int bcast_id = find_coll_description(mpi_coll_bcast_description, sg_cfg_get_string("smpi/bcast"),"bcast");
+    int bcast_id = find_coll_description(mpi_coll_bcast_description, xbt_cfg_get_string("smpi/bcast"),"bcast");
     mpi_coll_bcast_fun = (int (*)(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm com))
         mpi_coll_bcast_description[bcast_id].coll;
 
-    int reduce_id = find_coll_description(mpi_coll_reduce_description, sg_cfg_get_string("smpi/reduce"),"reduce");
+    int reduce_id = find_coll_description(mpi_coll_reduce_description, xbt_cfg_get_string("smpi/reduce"),"reduce");
     mpi_coll_reduce_fun = (int (*)(void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root,
                                     MPI_Comm comm)) mpi_coll_reduce_description[reduce_id].coll;
 
     int reduce_scatter_id =
         find_coll_description(mpi_coll_reduce_scatter_description,
-                              sg_cfg_get_string("smpi/reduce_scatter"),"reduce_scatter");
+                              xbt_cfg_get_string("smpi/reduce_scatter"),"reduce_scatter");
     mpi_coll_reduce_scatter_fun = (int (*)(void *sbuf, void *rbuf, int *rcounts,MPI_Datatype dtype, MPI_Op op,
                                            MPI_Comm comm)) mpi_coll_reduce_scatter_description[reduce_scatter_id].coll;
 
-    int scatter_id = find_coll_description(mpi_coll_scatter_description, sg_cfg_get_string("smpi/scatter"),"scatter");
+    int scatter_id = find_coll_description(mpi_coll_scatter_description, xbt_cfg_get_string("smpi/scatter"),"scatter");
     mpi_coll_scatter_fun = (int (*)(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
                                     int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm))
         mpi_coll_scatter_description[scatter_id].coll;
 
-    int barrier_id = find_coll_description(mpi_coll_barrier_description, sg_cfg_get_string("smpi/barrier"),"barrier");
+    int barrier_id = find_coll_description(mpi_coll_barrier_description, xbt_cfg_get_string("smpi/barrier"),"barrier");
     mpi_coll_barrier_fun = (int (*)(MPI_Comm comm)) mpi_coll_barrier_description[barrier_id].coll;
 
-    smpi_cpu_threshold = sg_cfg_get_double("smpi/cpu_threshold");
-    smpi_running_power = sg_cfg_get_double("smpi/running_power");
-    smpi_privatize_global_variables = sg_cfg_get_boolean("smpi/privatize_global_variables");
+    smpi_cpu_threshold = xbt_cfg_get_double("smpi/cpu_threshold");
+    smpi_running_power = xbt_cfg_get_double("smpi/running_power");
+    smpi_privatize_global_variables = xbt_cfg_get_boolean("smpi/privatize_global_variables");
     if (smpi_cpu_threshold < 0)
       smpi_cpu_threshold = DBL_MAX;
 }
@@ -628,7 +628,7 @@ int smpi_main(int (*realmain) (int argc, char *argv[]), int argc, char *argv[])
     SIMIX_run();
 
     xbt_os_walltimer_stop(global_timer);
-    if (sg_cfg_get_boolean("smpi/display_timing")){
+    if (xbt_cfg_get_boolean("smpi/display_timing")){
       double global_time = xbt_os_timer_elapsed(global_timer);
       XBT_INFO("Simulated time: %g seconds. \n\n"
           "The simulation took %g seconds (after parsing and platform setup)\n"
index b39302c..ebc4483 100644 (file)
@@ -104,7 +104,7 @@ namespace simgrid {
       haveGap_=false;
       active_nodes=NULL;
 
-      const char* IB_factors_string=sg_cfg_get_string("smpi/IB_penalty_factors");
+      const char* IB_factors_string=xbt_cfg_get_string("smpi/IB_penalty_factors");
       xbt_dynar_t radical_elements = xbt_str_split(IB_factors_string, ";");
 
       surf_parse_assert(xbt_dynar_length(radical_elements)==3,
index 7899183..ed9ece9 100644 (file)
@@ -172,8 +172,7 @@ namespace simgrid {
     double NetworkSmpiModel::bandwidthFactor(double size)
     {
       if (!smpi_bw_factor)
-        smpi_bw_factor =
-            parse_factor(sg_cfg_get_string("smpi/bw_factor"));
+        smpi_bw_factor = parse_factor(xbt_cfg_get_string("smpi/bw_factor"));
 
       unsigned int iter = 0;
       s_smpi_factor_t fact;
@@ -193,8 +192,7 @@ namespace simgrid {
     double NetworkSmpiModel::latencyFactor(double size)
     {
       if (!smpi_lat_factor)
-        smpi_lat_factor =
-            parse_factor(sg_cfg_get_string("smpi/lat_factor"));
+        smpi_lat_factor = parse_factor(xbt_cfg_get_string("smpi/lat_factor"));
 
       unsigned int iter = 0;
       s_smpi_factor_t fact;
index 37f1768..a0127e5 100644 (file)
@@ -154,7 +154,7 @@ void xbt_ex_display(xbt_ex_t * e)
     int i;
     int cutpath = 0;
     TRY { // We don't want to have an exception while checking how to deal with the one we already have, do we?
-      cutpath = sg_cfg_get_boolean("exception/cutpath");
+      cutpath = xbt_cfg_get_boolean("exception/cutpath");
     } CATCH_ANONYMOUS { }
 
     fprintf(stderr, "\n");