Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of github.com:simgrid/simgrid
authorEhsan Azimi <eazimi@ehsan.irisa.fr>
Wed, 18 Nov 2020 18:04:10 +0000 (19:04 +0100)
committerEhsan Azimi <eazimi@ehsan.irisa.fr>
Wed, 18 Nov 2020 18:04:10 +0000 (19:04 +0100)
71 files changed:
docs/source/app_s4u.rst
examples/c/actor-join/actor-join.c
include/simgrid/Exception.hpp
include/simgrid/actor.h
include/simgrid/forward.h
include/simgrid/jedule/jedule.hpp
include/simgrid/jedule/jedule_events.hpp
include/simgrid/jedule/jedule_platform.hpp
include/simgrid/kernel/future.hpp
include/simgrid/kernel/resource/Action.hpp
include/simgrid/msg.h
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Host.hpp
include/simgrid/s4u/Semaphore.hpp
include/simgrid/s4u/VirtualMachine.hpp
include/simgrid/semaphore.h
include/simgrid/simix.hpp
include/simgrid/simix/blocking_simcall.hpp
include/smpi/forward.hpp
include/xbt/config.h
include/xbt/functional.hpp
include/xbt/replay.hpp
include/xbt/signal.hpp
include/xbt/string.hpp
src/bindings/java/jmsg_vm.cpp
src/bindings/python/simgrid_python.cpp
src/include/xbt/parmap.hpp
src/kernel/actor/ActorImpl.cpp
src/kernel/actor/ActorImpl.hpp
src/kernel/context/Context.hpp
src/kernel/context/ContextBoost.hpp
src/kernel/context/ContextRaw.cpp
src/kernel/lmm/maxmin.cpp
src/kernel/lmm/maxmin.hpp
src/kernel/resource/profile/FutureEvtSet.hpp
src/kernel/routing/DijkstraZone.cpp
src/mc/ModelChecker.cpp
src/mc/compare.cpp
src/mc/inspect/DwarfExpression.hpp
src/mc/inspect/LocationList.hpp
src/mc/inspect/ObjectInformation.cpp
src/mc/inspect/Type.hpp
src/mc/mc_hash.hpp
src/mc/mc_record.hpp
src/mc/remote/RemoteSimulation.cpp
src/mc/sosp/PageStore.hpp
src/mc/sosp/Snapshot.hpp
src/msg/msg_legacy.cpp
src/plugins/file_system/s4u_FileSystem.cpp
src/plugins/vm/s4u_VirtualMachine.cpp
src/s4u/s4u_Actor.cpp
src/s4u/s4u_Host.cpp
src/s4u/s4u_Semaphore.cpp
src/simix/popping_private.hpp
src/smpi/include/private.hpp
src/smpi/include/smpi_keyvals.hpp
src/smpi/include/smpi_request.hpp
src/smpi/include/smpi_topo.hpp
src/smpi/internals/smpi_config.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/internals/smpi_replay.cpp
src/smpi/internals/smpi_shared.cpp
src/smpi/internals/smpi_utils.cpp
src/smpi/mpi/smpi_request.cpp
src/smpi/plugins/load_balancer/LoadBalancer.cpp
src/smpi/plugins/load_balancer/load_balancer.hpp
src/smpi/smpirun.in
src/surf/HostImpl.hpp
src/surf/cpu_ti.hpp
src/xbt/config.cpp
src/xbt/xbt_log_appender_file.cpp

index ec9dc5a..be046e3 100644 (file)
@@ -579,8 +579,8 @@ Reacting to the end of actors
    .. group-tab:: C++
 
       .. autodoxymethod:: simgrid::s4u::Actor::on_exit
-      .. autodoxymethod:: simgrid::s4u::Actor::join()
-      .. autodoxymethod:: simgrid::s4u::Actor::join(double timeout)
+      .. autodoxymethod:: simgrid::s4u::Actor::join() const
+      .. autodoxymethod:: simgrid::s4u::Actor::join(double timeout) const
       .. autodoxymethod:: simgrid::s4u::Actor::set_auto_restart(bool autorestart)
 
    .. group-tab:: Python
@@ -589,7 +589,7 @@ Reacting to the end of actors
 
    .. group-tab:: C
 
-      .. autodoxymethod:: sg_actor_join(sg_actor_t actor, double timeout)
+      .. autodoxymethod:: sg_actor_join(const_sg_actor_t actor, double timeout)
       .. autodoxymethod:: sg_actor_set_auto_restart(sg_actor_t actor, int auto_restart)
 
 Signals
@@ -1187,7 +1187,7 @@ Retrieving components
 
    .. group-tab:: C++
 
-      .. autodoxymethod:: simgrid::s4u::Host::add_disk(Disk *disk)
+      .. autodoxymethod:: simgrid::s4u::Host::add_disk(const Disk* disk)
       .. autodoxymethod:: simgrid::s4u::Host::get_actor_count() const
       .. autodoxymethod:: simgrid::s4u::Host::get_all_actors() const
       .. autodoxymethod:: simgrid::s4u::Host::get_disks() const
@@ -1625,7 +1625,7 @@ Querying info
 
       .. autodoxymethod:: simgrid::s4u::VirtualMachine::get_pm() const
       .. autodoxymethod:: simgrid::s4u::VirtualMachine::get_ramsize() const
-      .. autodoxymethod:: simgrid::s4u::VirtualMachine::get_state()
+      .. autodoxymethod:: simgrid::s4u::VirtualMachine::get_state() const
 
       .. autodoxymethod:: simgrid::s4u::VirtualMachine::set_bound(double bound)
       .. autodoxymethod:: simgrid::s4u::VirtualMachine::set_pm(Host *pm)
@@ -2168,17 +2168,17 @@ Locking
 
          .. autodoxymethod:: simgrid::s4u::Semaphore::acquire()
          .. autodoxymethod:: simgrid::s4u::Semaphore::acquire_timeout(double timeout)
-         .. autodoxymethod:: simgrid::s4u::Semaphore::get_capacity()
+         .. autodoxymethod:: simgrid::s4u::Semaphore::get_capacity() const
          .. autodoxymethod:: simgrid::s4u::Semaphore::release()
-         .. autodoxymethod:: simgrid::s4u::Semaphore::would_block()
+         .. autodoxymethod:: simgrid::s4u::Semaphore::would_block() const
 
       .. group-tab:: C
 
          .. autodoxymethod:: sg_sem_acquire(sg_sem_t sem)
          .. autodoxymethod:: sg_sem_acquire_timeout(sg_sem_t sem, double timeout)
-         .. autodoxymethod:: sg_sem_get_capacity(sg_sem_t sem)
+         .. autodoxymethod:: sg_sem_get_capacity(const_sg_sem_t sem)
          .. autodoxymethod:: sg_sem_release(sg_sem_t sem)
-         .. autodoxymethod:: sg_sem_would_block(sg_sem_t sem)
+         .. autodoxymethod:: sg_sem_would_block(const_sg_sem_t sem)
 
 .. |hr| raw:: html
 
index fdbd215..efdaa19 100644 (file)
@@ -22,7 +22,7 @@ static void sleeper(int argc, char* argv[])
 
 static void master(int argc, char* argv[])
 {
-  sg_actor_t actor;
+  const_sg_actor_t actor;
 
   XBT_INFO("Start sleeper");
   actor = sg_actor_create("sleeper from master", sg_host_self(), sleeper, 0, NULL);
index a030f0b..2369503 100644 (file)
@@ -113,7 +113,7 @@ public:
   ~TimeoutException() override;
 };
 
-XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::TimeoutException") typedef TimeoutException TimeoutError;
+using TimeoutError XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::TimeoutException") = TimeoutException;
 
 /** Exception raised when a host fails */
 class HostFailureException : public Exception {
@@ -239,6 +239,6 @@ private:
 
 } // namespace simgrid
 
-XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::Exception") typedef simgrid::Exception xbt_ex;
+using xbt_ex XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::Exception") = simgrid::Exception;
 
 #endif
index 3278ef6..6fb3693 100644 (file)
@@ -56,7 +56,7 @@ XBT_ATTRIB_DEPRECATED_v329("Please use sg_actor_set_host() instead") XBT_PUBLIC
 #endif
 
 XBT_PUBLIC void sg_actor_set_host(sg_actor_t actor, sg_host_t host);
-XBT_PUBLIC void sg_actor_join(sg_actor_t actor, double timeout);
+XBT_PUBLIC void sg_actor_join(const_sg_actor_t actor, double timeout);
 XBT_PUBLIC void sg_actor_kill(sg_actor_t actor);
 XBT_PUBLIC void sg_actor_kill_all();
 XBT_PUBLIC void sg_actor_set_kill_time(sg_actor_t actor, double kill_time);
index 4d450ab..73212dc 100644 (file)
@@ -101,37 +101,37 @@ namespace kernel {
 class EngineImpl;
 namespace actor {
 class ActorImpl;
-typedef boost::intrusive_ptr<ActorImpl> ActorImplPtr;
+using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
 
 // What's executed as an actor code:
-typedef std::function<void()> ActorCode;
+using ActorCode = std::function<void()>;
 // Create an ActorCode from the parameters parsed in the XML file (or elsewhere)
-typedef std::function<ActorCode(std::vector<std::string> args)> ActorCodeFactory;
+using ActorCodeFactory = std::function<ActorCode(std::vector<std::string> args)>;
 } // namespace actor
 
 namespace activity {
   class ActivityImpl;
   enum class State;
-  typedef boost::intrusive_ptr<ActivityImpl> ActivityImplPtr;
+  using ActivityImplPtr = boost::intrusive_ptr<ActivityImpl>;
   XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
   XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
 
   class ConditionVariableImpl;
 
   class CommImpl;
-  typedef boost::intrusive_ptr<CommImpl> CommImplPtr;
+  using CommImplPtr = boost::intrusive_ptr<CommImpl>;
   class ExecImpl;
-  typedef boost::intrusive_ptr<ExecImpl> ExecImplPtr;
+  using ExecImplPtr = boost::intrusive_ptr<ExecImpl>;
   class IoImpl;
-  typedef boost::intrusive_ptr<IoImpl> IoImplPtr;
+  using IoImplPtr = boost::intrusive_ptr<IoImpl>;
   class MutexImpl;
-  typedef boost::intrusive_ptr<MutexImpl> MutexImplPtr;
+  using MutexImplPtr = boost::intrusive_ptr<MutexImpl>;
   class RawImpl;
-  typedef boost::intrusive_ptr<RawImpl> RawImplPtr;
+  using RawImplPtr = boost::intrusive_ptr<RawImpl>;
   class SemaphoreImpl;
-  typedef boost::intrusive_ptr<SemaphoreImpl> SemaphoreImplPtr;
+  using SemaphoreImplPtr = boost::intrusive_ptr<SemaphoreImpl>;
   class SleepImpl;
-  typedef boost::intrusive_ptr<SleepImpl> SleepImplPtr;
+  using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
 
   class MailboxImpl;
 }
@@ -192,30 +192,30 @@ class VirtualMachineImpl;
 } // namespace vm
 } // namespace simgrid
 
-typedef simgrid::s4u::Actor s4u_Actor;
-typedef simgrid::s4u::Barrier s4u_Barrier;
-typedef simgrid::s4u::Comm s4u_Comm;
-typedef simgrid::s4u::Exec s4u_Exec;
-typedef simgrid::s4u::Host s4u_Host;
-typedef simgrid::s4u::Link s4u_Link;
-typedef simgrid::s4u::File s4u_File;
-typedef simgrid::s4u::ConditionVariable s4u_ConditionVariable;
-typedef simgrid::s4u::Mailbox s4u_Mailbox;
-typedef simgrid::s4u::Mutex s4u_Mutex;
-typedef simgrid::s4u::Semaphore s4u_Semaphore;
-typedef simgrid::s4u::Disk s4u_Disk;
-typedef simgrid::s4u::Storage s4u_Storage;
-typedef simgrid::s4u::NetZone s4u_NetZone;
-typedef simgrid::s4u::VirtualMachine s4u_VM;
-
-typedef simgrid::simix::Timer* smx_timer_t;
-typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
-typedef simgrid::kernel::activity::ActivityImpl* smx_activity_t;
-typedef simgrid::kernel::activity::ConditionVariableImpl* smx_cond_t;
-typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
-typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
-typedef simgrid::kernel::activity::SemaphoreImpl* smx_sem_t;
-XBT_ATTRIB_DEPRECATED_v330("Please use kernel::activity::State") typedef simgrid::kernel::activity::State e_smx_state_t;
+using s4u_Actor             = simgrid::s4u::Actor;
+using s4u_Barrier           = simgrid::s4u::Barrier;
+using s4u_Comm              = simgrid::s4u::Comm;
+using s4u_Exec              = simgrid::s4u::Exec;
+using s4u_Host              = simgrid::s4u::Host;
+using s4u_Link              = simgrid::s4u::Link;
+using s4u_File              = simgrid::s4u::File;
+using s4u_ConditionVariable = simgrid::s4u::ConditionVariable;
+using s4u_Mailbox           = simgrid::s4u::Mailbox;
+using s4u_Mutex             = simgrid::s4u::Mutex;
+using s4u_Semaphore         = simgrid::s4u::Semaphore;
+using s4u_Disk              = simgrid::s4u::Disk;
+using s4u_Storage           = simgrid::s4u::Storage;
+using s4u_NetZone           = simgrid::s4u::NetZone;
+using s4u_VM                = simgrid::s4u::VirtualMachine;
+
+using smx_timer_t    = simgrid::simix::Timer*;
+using smx_actor_t    = simgrid::kernel::actor::ActorImpl*;
+using smx_activity_t = simgrid::kernel::activity::ActivityImpl*;
+using smx_cond_t     = simgrid::kernel::activity::ConditionVariableImpl*;
+using smx_mailbox_t  = simgrid::kernel::activity::MailboxImpl*;
+using smx_mutex_t    = simgrid::kernel::activity::MutexImpl*;
+using smx_sem_t      = simgrid::kernel::activity::SemaphoreImpl*;
+using e_smx_state_t XBT_ATTRIB_DEPRECATED_v330("Please use kernel::activity::State") = simgrid::kernel::activity::State;
 #else
 
 typedef struct s4u_Actor s4u_Actor;
index 55b84eb..06893ce 100644 (file)
@@ -34,6 +34,6 @@ public:
 } // namespace jedule
 } // namespace simgrid
 
-typedef simgrid::jedule::Jedule *jedule_t;
+using jedule_t = simgrid::jedule::Jedule*;
 
 #endif /* JEDULE_HPP_ */
index e7987cb..e6992e5 100644 (file)
@@ -40,6 +40,6 @@ private:
 }
 }
 
-typedef simgrid::jedule::Event* jed_event_t;
+using jed_event_t = simgrid::jedule::Event*;
 
 #endif /* JEDULE_EVENTS_H_ */
index 8097776..a63279e 100644 (file)
@@ -53,7 +53,7 @@ public:
 
 } // namespace jedule
 } // namespace simgrid
-typedef simgrid::jedule::Container * jed_container_t;
+using jed_container_t = simgrid::jedule::Container*;
 void get_resource_selection_by_hosts(std::vector<simgrid::jedule::Subset>& subset_list,
                                      const std::vector<sg_host_t>& host_list);
 
index b41008e..4428b6e 100644 (file)
@@ -329,7 +329,7 @@ public:
    */
   template <class F> auto then_no_unwrap(F continuation) -> Future<decltype(continuation(std::move(*this)))>
   {
-    typedef decltype(continuation(std::move(*this))) R;
+    using R = decltype(continuation(std::move(*this)));
     if (state_ == nullptr)
       throw std::future_error(std::future_errc::no_state);
     auto state = std::move(state_);
index a74f944..7d1db42 100644 (file)
@@ -20,12 +20,11 @@ namespace simgrid {
 namespace kernel {
 namespace resource {
 
-typedef std::pair<double, Action*> heap_element_type;
-typedef boost::heap::pairing_heap<heap_element_type, boost::heap::constant_time_size<false>, boost::heap::stable<true>,
-                                  boost::heap::compare<simgrid::xbt::HeapComparator<heap_element_type>>>
-    heap_type;
+using heap_element_type = std::pair<double, Action*>;
+using heap_type =
+    boost::heap::pairing_heap<heap_element_type, boost::heap::constant_time_size<false>, boost::heap::stable<true>,
+                              boost::heap::compare<simgrid::xbt::HeapComparator<heap_element_type>>>;
 
-typedef std::pair<double, Action*> heap_element_type;
 class XBT_PUBLIC ActionHeap : public heap_type {
   friend Action;
 
@@ -63,14 +62,12 @@ public:
   /* Lazy update needs this Set hook to maintain a list of the tracked actions */
   boost::intrusive::list_member_hook<> modified_set_hook_;
   bool is_within_modified_set() const { return modified_set_hook_.is_linked(); }
-  typedef boost::intrusive::list<
-      Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::modified_set_hook_>>
-      ModifiedSet;
+  using ModifiedSet = boost::intrusive::list<
+      Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::modified_set_hook_>>;
 
   boost::intrusive::list_member_hook<> state_set_hook_;
-  typedef boost::intrusive::list<
-      Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::state_set_hook_>>
-      StateSet;
+  using StateSet = boost::intrusive::list<
+      Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::state_set_hook_>>;
 
   enum class State {
     INITED,   /**< Created, but not started yet */
index 33ab45c..a0e5a84 100644 (file)
@@ -38,8 +38,8 @@ class Comm;
 class Task;
 }
 }
-typedef simgrid::msg::Comm sg_msg_Comm;
-typedef simgrid::msg::Task sg_msg_Task;
+using sg_msg_Comm = simgrid::msg::Comm;
+using sg_msg_Task = simgrid::msg::Task;
 #else
 typedef struct msg_Comm sg_msg_Comm;
 typedef struct msg_Task sg_msg_Task;
@@ -223,7 +223,7 @@ XBT_PUBLIC void MSG_process_migrate(msg_process_t process, msg_host_t host);
  * @param process the process to wait for
  * @param timeout wait until the process is over, or the timeout occurs
  */
-XBT_PUBLIC void MSG_process_join(msg_process_t process, double timeout);
+XBT_PUBLIC void MSG_process_join(const_sg_actor_t process, double timeout);
 /** @brief Kills a process */
 XBT_PUBLIC void MSG_process_kill(msg_process_t process);
 /** @brief Kill all running process */
@@ -435,9 +435,9 @@ XBT_PUBLIC msg_sem_t MSG_sem_init(int initial_value);
 XBT_PUBLIC void MSG_sem_acquire(msg_sem_t sem);
 XBT_PUBLIC int MSG_sem_acquire_timeout(msg_sem_t sem, double timeout);
 XBT_PUBLIC void MSG_sem_release(msg_sem_t sem);
-XBT_PUBLIC int MSG_sem_get_capacity(msg_sem_t sem);
+XBT_PUBLIC int MSG_sem_get_capacity(const_sg_sem_t sem);
 XBT_PUBLIC void MSG_sem_destroy(const_sg_sem_t sem);
-XBT_PUBLIC int MSG_sem_would_block(msg_sem_t sem);
+XBT_PUBLIC int MSG_sem_would_block(const_sg_sem_t sem);
 
 /** @brief Opaque type representing a barrier identifier */
 typedef sg_bar_t msg_bar_t;
index a4b6438..0f8b058 100644 (file)
@@ -207,14 +207,14 @@ public:
    * Blocks the calling actor until the joined actor is terminated. If actor alice executes bob.join(), then alice is
    * blocked until bob terminates.
    */
-  void join();
+  void join() const;
 
   /** Wait for the actor to finish, or for the timeout to elapse.
    *
    * Blocks the calling actor until the joined actor is terminated. If actor alice executes bob.join(), then alice is
    * blocked until bob terminates.
    */
-  void join(double timeout);
+  void join(double timeout) const;
   /** Kill that actor and restart it from start. */
   Actor* restart();
 
index d904493..9f8ffd9 100644 (file)
@@ -146,7 +146,7 @@ public:
   int get_pstate() const;
 
   std::vector<Disk*> get_disks() const;
-  void add_disk(Disk* disk);
+  void add_disk(const Disk* disk);
   void remove_disk(const std::string& disk_name);
 
   std::vector<const char*> get_attached_storages() const;
index 602553d..c3296bf 100644 (file)
@@ -50,8 +50,8 @@ public:
   void acquire();
   int acquire_timeout(double timeout);
   void release();
-  int get_capacity();
-  int would_block();
+  int get_capacity() const;
+  int would_block() const;
 };
 
 } // namespace s4u
index 1ef5069..f228203 100644 (file)
@@ -54,7 +54,7 @@ public:
   VirtualMachine* set_ramsize(size_t ramsize);
   VirtualMachine* set_bound(double bound);
 
-  VirtualMachine::state get_state();
+  VirtualMachine::state get_state() const;
   static xbt::signal<void(VirtualMachine const&)> on_start;
   static xbt::signal<void(VirtualMachine const&)> on_started;
   static xbt::signal<void(VirtualMachine const&)> on_shutdown;
index 730a089..ad11cac 100644 (file)
@@ -16,9 +16,9 @@ XBT_PUBLIC sg_sem_t sg_sem_init(int initial_value);
 XBT_PUBLIC void sg_sem_acquire(sg_sem_t sem);
 XBT_PUBLIC int sg_sem_acquire_timeout(sg_sem_t sem, double timeout);
 XBT_PUBLIC void sg_sem_release(sg_sem_t sem);
-XBT_PUBLIC int sg_sem_get_capacity(sg_sem_t sem);
+XBT_PUBLIC int sg_sem_get_capacity(const_sg_sem_t sem);
 XBT_PUBLIC void sg_sem_destroy(const_sg_sem_t sem);
-XBT_PUBLIC int sg_sem_would_block(sg_sem_t sem);
+XBT_PUBLIC int sg_sem_would_block(const_sg_sem_t sem);
 
 SG_END_DECL
 
index db2d157..5f61cb1 100644 (file)
@@ -53,7 +53,7 @@ template <class F> typename std::result_of<F()>::type simcall(F&& code, mc::Simc
   // If we are in the application, pass the code to the maestro which
   // executes it for us and reports the result. We use a std::future which
   // conveniently handles the success/failure value for us.
-  typedef typename std::result_of<F()>::type R;
+  using R = typename std::result_of<F()>::type;
   simgrid::xbt::Result<R> result;
   simcall_run_kernel([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward<F>(code)); }, t);
   return result.get();
@@ -96,8 +96,7 @@ template <class R, class F> R simcall_blocking(F&& code, mc::SimcallInspector* t
 namespace simgrid {
 namespace simix {
 
-
-typedef std::pair<double, Timer*> TimerQelt;
+using TimerQelt = std::pair<double, Timer*>;
 static boost::heap::fibonacci_heap<TimerQelt, boost::heap::compare<xbt::HeapComparator<TimerQelt>>> simix_timers;
 
 /** @brief Timer datatype */
index 28f33ef..fd9797f 100644 (file)
@@ -45,7 +45,7 @@ XBT_PUBLIC void unblock(smx_actor_t process);
  */
 template <class F> auto kernel_sync(F code) -> decltype(code().get())
 {
-  typedef decltype(code().get()) T;
+  using T = decltype(code().get());
   if (SIMIX_is_maestro())
     xbt_die("Can't execute blocking call in kernel mode");
 
@@ -78,7 +78,7 @@ template <class F> auto kernel_sync(F code) -> decltype(code().get())
 template <class T>
 class Future {
 public:
-  Future() { /* Nothing to do*/}
+  Future() = default;
   explicit Future(simgrid::kernel::Future<T> future) : future_(std::move(future)) {}
   Future(Future&&) noexcept = default;
   Future& operator=(Future&&) noexcept = default;
@@ -150,7 +150,7 @@ private:
  */
 template <class F> auto kernel_async(F code) -> Future<decltype(code().get())>
 {
-  typedef decltype(code().get()) T;
+  using T = decltype(code().get());
 
   // Execute the code in the kernel and get the kernel future:
   simgrid::kernel::Future<T> future = simgrid::kernel::actor::simcall(std::move(code));
index 515b34f..69c26ee 100644 (file)
@@ -34,19 +34,19 @@ class Win;
 }
 }
 
-typedef simgrid::smpi::Comm SMPI_Comm;
-typedef simgrid::smpi::Datatype SMPI_Datatype;
-typedef simgrid::smpi::Errhandler SMPI_Errhandler;
-typedef simgrid::smpi::File SMPI_File;
-typedef simgrid::smpi::Group SMPI_Group;
-typedef simgrid::smpi::Info SMPI_Info;
-typedef simgrid::smpi::Op SMPI_Op;
-typedef simgrid::smpi::Request SMPI_Request;
-typedef simgrid::smpi::Topo SMPI_Topology;
-typedef simgrid::smpi::Topo_Cart SMPI_Cart_topology;
-typedef simgrid::smpi::Topo_Dist_Graph SMPI_Dist_Graph_topology;
-typedef simgrid::smpi::Topo_Graph SMPI_Graph_topology;
-typedef simgrid::smpi::Win SMPI_Win;
+using SMPI_Comm                = simgrid::smpi::Comm;
+using SMPI_Datatype            = simgrid::smpi::Datatype;
+using SMPI_Errhandler          = simgrid::smpi::Errhandler;
+using SMPI_File                = simgrid::smpi::File;
+using SMPI_Group               = simgrid::smpi::Group;
+using SMPI_Info                = simgrid::smpi::Info;
+using SMPI_Op                  = simgrid::smpi::Op;
+using SMPI_Request             = simgrid::smpi::Request;
+using SMPI_Topology            = simgrid::smpi::Topo;
+using SMPI_Cart_topology       = simgrid::smpi::Topo_Cart;
+using SMPI_Dist_Graph_topology = simgrid::smpi::Topo_Dist_Graph;
+using SMPI_Graph_topology      = simgrid::smpi::Topo_Graph;
+using SMPI_Win                 = simgrid::smpi::Win;
 
 #else
 
index 2fde39a..e9cb3ad 100644 (file)
@@ -56,7 +56,7 @@
 /** @brief Configuration set's data type is opaque. */
 #ifdef __cplusplus
 #include <xbt/config.hpp>
-typedef simgrid::config::Config* xbt_cfg_t;
+using xbt_cfg_t = simgrid::config::Config*;
 #else
 typedef void* xbt_cfg_t;
 #endif
index cc053a5..b869563 100644 (file)
@@ -99,11 +99,8 @@ class Task<R(Args...)> {
   struct whatever {};
 
   // Union used for storage:
-  typedef typename std::aligned_union<0,
-    void*,
-    std::pair<void(*)(),void*>,
-    std::pair<void(whatever::*)(), whatever*>
-  >::type TaskUnion;
+  using TaskUnion = typename std::aligned_union<0, void*, std::pair<void (*)(), void*>,
+                                                std::pair<void (whatever::*)(), whatever*>>::type;
 
   // Is F suitable for small buffer optimization?
   template<class F>
@@ -117,11 +114,11 @@ class Task<R(Args...)> {
     "SBO not working for reference_wrapper");
 
   // Call (and possibly destroy) the function:
-  typedef R (*call_function)(TaskUnion&, Args...);
+  using call_function = R (*)(TaskUnion&, Args...);
   // Destroy the function (of needed):
-  typedef void (*destroy_function)(TaskUnion&);
+  using destroy_function = void (*)(TaskUnion&);
   // Move the function (otherwise memcpy):
-  typedef void (*move_function)(TaskUnion& dest, TaskUnion& src);
+  using move_function = void (*)(TaskUnion& dest, TaskUnion& src);
 
   // Vtable of functions for manipulating whatever is in the TaskUnion:
   struct TaskVtable {
@@ -248,7 +245,8 @@ template<class F, class... Args>
 class TaskImpl {
   F code_;
   std::tuple<Args...> args_;
-  typedef decltype(simgrid::xbt::apply(std::move(code_), std::move(args_))) result_type;
+  using result_type = decltype(simgrid::xbt::apply(std::move(code_), std::move(args_)));
+
 public:
   TaskImpl(F code, std::tuple<Args...> args) :
     code_(std::move(code)),
index bb8c27e..d1596e5 100644 (file)
 namespace simgrid {
 namespace xbt {
 /* To split the file if a unique one is given (specific variable for the other case live in runner()) */
-typedef std::vector<std::string> ReplayAction;
+using ReplayAction = std::vector<std::string>;
 
 XBT_PUBLIC_DATA std::ifstream* action_fs;
 XBT_PUBLIC int replay_runner(const char* actor_name, const char* trace_filename);
 }
 }
 
-typedef std::function<void(simgrid::xbt::ReplayAction&)> action_fun;
+using action_fun = std::function<void(simgrid::xbt::ReplayAction&)>;
 XBT_PUBLIC void xbt_replay_action_register(const char* action_name, const action_fun& function);
 XBT_PUBLIC action_fun xbt_replay_action_get(const char* action_name);
 
index 4289edd..36bd87f 100644 (file)
@@ -23,7 +23,7 @@ namespace xbt {
   */
   template<class R, class... P>
   class signal<R(P...)> {
-    typedef std::function<R(P...)> callback_type;
+    using callback_type = std::function<R(P...)>;
     std::map<unsigned int, callback_type> handlers_;
     unsigned int callback_sequence_id = 0;
 
index 5278929..8ae6756 100644 (file)
@@ -72,11 +72,11 @@ class XBT_PUBLIC string {
 
 public:
   // Types
-  typedef std::size_t size_type;
-  typedef char& reference;
-  typedef const char& const_reference;
-  typedef char* iterator;
-  typedef const char* const_iterator;
+  using size_type       = std::size_t;
+  using reference       = char&;
+  using const_reference = const char&;
+  using iterator        = char*;
+  using const_iterator  = const char*;
 
   // Dtor
   ~string()
index 8e3193b..639c15d 100644 (file)
@@ -89,7 +89,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_VM_all(JNIEnv* env, jclass c
   std::vector<jobject> vms;
 
   for (size_t i = 0; i < host_count; i++) {
-    auto* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(hosts[i]);
+    const auto* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(hosts[i]);
     if (vm != nullptr && vm->get_state() != simgrid::s4u::VirtualMachine::state::DESTROYED) {
       auto jvm = static_cast<jobject>(vm->extension(JAVA_HOST_LEVEL));
       vms.push_back(jvm);
index ce10be9..fc492d5 100644 (file)
@@ -47,7 +47,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(python, "python");
 
 namespace {
 
-static std::string get_simgrid_version()
+std::string get_simgrid_version()
 {
   int major;
   int minor;
@@ -344,7 +344,7 @@ PYBIND11_MODULE(simgrid, m)
       .def("is_daemon", &Actor::is_daemon,
            "Returns True if that actor is a daemon and will be terminated automatically when the last non-daemon actor "
            "terminates.")
-      .def("join", py::overload_cast<double>(&Actor::join), py::call_guard<GilScopedRelease>(),
+      .def("join", py::overload_cast<double>(&Actor::join, py::const_), py::call_guard<GilScopedRelease>(),
            "Wait for the actor to finish (more info in the C++ documentation).", py::arg("timeout"))
       .def("kill", &Actor::kill, py::call_guard<GilScopedRelease>(), "Kill that actor")
       .def("kill_all", &Actor::kill_all, py::call_guard<GilScopedRelease>(), "Kill all actors but the caller.")
index ac909e7..bc3b9f6 100644 (file)
@@ -322,10 +322,8 @@ template <typename T> void Parmap<T>::PosixSynchro::master_signal()
 template <typename T> void Parmap<T>::PosixSynchro::master_wait()
 {
   std::unique_lock<std::mutex> lk(done_mutex);
-  while (this->parmap.thread_counter < this->parmap.num_workers) {
-    /* wait for all workers to be ready */
-    done_cond.wait(lk);
-  }
+  /* wait for all workers to be ready */
+  done_cond.wait(lk, [this]() { return this->parmap.thread_counter >= this->parmap.num_workers; });
 }
 
 template <typename T> void Parmap<T>::PosixSynchro::worker_signal()
@@ -342,9 +340,7 @@ template <typename T> void Parmap<T>::PosixSynchro::worker_wait(unsigned round)
 {
   std::unique_lock<std::mutex> lk(ready_mutex);
   /* wait for more work */
-  while (this->parmap.work_round != round) {
-    ready_cond.wait(lk);
-  }
+  ready_cond.wait(lk, [this, round]() { return this->parmap.work_round == round; });
 }
 
 #if HAVE_FUTEX_H
index 935fa6d..e631755 100644 (file)
@@ -591,30 +591,6 @@ void SIMIX_process_on_exit(smx_actor_t actor,
   actor->on_exit->emplace_back(fun);
 }
 
-/** @brief Restart a process, starting it again from the beginning. */
-/**
- * @ingroup simix_process_management
- * @brief Creates and runs a new SIMIX process.
- *
- * The structure and the corresponding thread are created and put in the list of ready processes.
- *
- * @param name a name for the process. It is for user-level information and can be nullptr.
- * @param code the main function of the process
- * @param data a pointer to any data one may want to attach to the new object. It is for user-level information and can
- * be nullptr.
- * It can be retrieved with the method ActorImpl::getUserData().
- * @param host where the new agent is executed.
- * @param properties the properties of the process
- */
-smx_actor_t simcall_process_create(const std::string& name, const simgrid::kernel::actor::ActorCode& code, void* data,
-                                   sg_host_t host, std::unordered_map<std::string, std::string>* properties)
-{
-  smx_actor_t self = simgrid::kernel::actor::ActorImpl::self();
-  return simgrid::kernel::actor::simcall([&name, &code, data, host, properties, self] {
-    return simgrid::kernel::actor::ActorImpl::create(name, code, data, host, properties, self).get();
-  });
-}
-
 void simcall_process_set_data(smx_actor_t process, void* data) // XBT_ATTRIB_DEPRECATED_v329
 {
   simgrid::kernel::actor::simcall([process, data] { process->set_user_data(data); });
index f5191e8..7123018 100644 (file)
@@ -189,9 +189,9 @@ public:
 };
 
 /* Used to keep the list of actors blocked on a synchro  */
-typedef boost::intrusive::list<ActorImpl, boost::intrusive::member_hook<ActorImpl, boost::intrusive::list_member_hook<>,
-                                                                        &ActorImpl::smx_synchro_hook>>
-    SynchroList;
+using SynchroList =
+    boost::intrusive::list<ActorImpl, boost::intrusive::member_hook<ActorImpl, boost::intrusive::list_member_hook<>,
+                                                                    &ActorImpl::smx_synchro_hook>>;
 
 XBT_PUBLIC void create_maestro(const std::function<void()>& code);
 XBT_PUBLIC int get_maxpid();
@@ -201,8 +201,4 @@ XBT_PUBLIC int get_maxpid();
 
 extern void (*SMPI_switch_data_segment)(simgrid::s4u::ActorPtr actor);
 
-XBT_PUBLIC smx_actor_t simcall_process_create(const std::string& name, const simgrid::kernel::actor::ActorCode& code,
-                                              void* data, sg_host_t host,
-                                              std::unordered_map<std::string, std::string>* properties);
-
 #endif
index e9bea4b..dc747a1 100644 (file)
@@ -95,7 +95,7 @@ public:
 
 
 /* This allows Java to hijack the context factory (Java induces factories of factory :) */
-typedef ContextFactory* (*ContextFactoryInitializer)();
+using ContextFactoryInitializer = ContextFactory* (*)();
 XBT_PUBLIC_DATA ContextFactoryInitializer factory_initializer;
 
 XBT_PRIVATE ContextFactory* thread_factory();
index 8284fc9..0eaf6c4 100644 (file)
@@ -37,10 +37,10 @@ public:
 private:
 #if BOOST_VERSION < 106100
   boost::context::fcontext_t fc_;
-  typedef intptr_t arg_type;
+  using arg_type = intptr_t;
 #else
   boost::context::detail::fcontext_t fc_;
-  typedef boost::context::detail::transfer_t arg_type;
+  using arg_type = boost::context::detail::transfer_t;
 #endif
 
   XBT_ATTRIB_NORETURN static void wrapper(arg_type arg);
index 3b36ada..443c37f 100644 (file)
@@ -12,9 +12,9 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
 
 // Raw context routines
 
-typedef void (*rawctx_entry_point_t)(simgrid::kernel::context::SwappedContext*);
+using rawctx_entry_point_t = void (*)(simgrid::kernel::context::SwappedContext*);
 
-typedef void* raw_stack_t;
+using raw_stack_t = void*;
 extern "C" raw_stack_t raw_makecontext(void* malloced_stack, int stack_size, rawctx_entry_point_t entry_point,
                                        simgrid::kernel::context::SwappedContext* arg);
 extern "C" void raw_swapcontext(raw_stack_t* old, raw_stack_t new_context);
index 88c40cf..b780131 100644 (file)
@@ -16,7 +16,7 @@ namespace simgrid {
 namespace kernel {
 namespace lmm {
 
-typedef std::vector<int> dyn_light_t;
+using dyn_light_t = std::vector<int>;
 
 int Variable::next_rank_   = 1;
 int Constraint::next_rank_ = 1;
index 5aef06a..f525dfa 100644 (file)
@@ -532,8 +532,8 @@ public:
   resource::Action::ModifiedSet* modified_set_ = nullptr;
 
 private:
-  typedef std::vector<int> dyn_light_t;
-  
+  using dyn_light_t = std::vector<int>;
+
   //Data used in lmm::solve
   std::vector<ConstraintLight> cnst_light_vec;
   dyn_light_t saturated_constraints;
index 96d0008..9ef271e 100644 (file)
@@ -26,7 +26,7 @@ public:
   void add_event(double date, Event* evt);
 
 private:
-  typedef std::pair<double, Event*> Qelt;
+  using Qelt = std::pair<double, Event*>;
   std::priority_queue<Qelt, std::vector<Qelt>, std::greater<>> heap_;
 };
 
index cebdab7..5c80268 100644 (file)
@@ -129,7 +129,7 @@ void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationAr
     int nr_nodes      = xbt_dynar_length(nodes);
     std::vector<double> cost_arr(nr_nodes); /* link cost from src to other hosts */
     pred_arr.resize(nr_nodes);              /* predecessors in path from src */
-    typedef std::pair<double, int> Qelt;
+    using Qelt = std::pair<double, int>;
     std::priority_queue<Qelt, std::vector<Qelt>, std::greater<>> pqueue;
 
     /* initialize */
index 884444c..4ae8982 100644 (file)
@@ -219,7 +219,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
     if (property_automaton == nullptr)
       property_automaton = xbt_automaton_new();
 
-    RemoteSimulation* process = &this->get_remote_simulation();
+    const RemoteSimulation* process = &this->get_remote_simulation();
     RemotePtr<int> address = remote((int*)message.data);
     xbt::add_proposition(property_automaton, message.name, [process, address]() { return process->read(address); });
 
index 6baf980..4a0f419 100644 (file)
@@ -38,8 +38,8 @@ public:
   }
 };
 
-typedef std::array<HeapLocation, 2> HeapLocationPair;
-typedef std::set<HeapLocationPair> HeapLocationPairs;
+using HeapLocationPair  = std::array<HeapLocation, 2>;
+using HeapLocationPairs = std::set<HeapLocationPair>;
 
 class HeapArea : public HeapLocation {
 public:
index 797f661..c6258b3 100644 (file)
@@ -34,7 +34,7 @@ namespace dwarf {
  *  just a sequence of dwarf instructions. We currently directly use
  *  `Dwarf_Op` from `dwarf.h` for dwarf instructions.
  */
-typedef std::vector<Dwarf_Op> DwarfExpression;
+using DwarfExpression = std::vector<Dwarf_Op>;
 
 /** Context of evaluation of a DWARF expression
  *
@@ -62,7 +62,7 @@ public:
  */
 class ExpressionStack {
 public:
-  typedef std::uintptr_t value_type;
+  using value_type                  = std::uintptr_t;
   static const std::size_t max_size = 64;
 
 private:
index ea30d90..461a499 100644 (file)
@@ -22,7 +22,7 @@ namespace dwarf {
 /** A DWARF expression with optional validity constraints */
 class LocationListEntry {
 public:
-  typedef simgrid::xbt::Range<std::uint64_t> range_type;
+  using range_type = simgrid::xbt::Range<std::uint64_t>;
 
 private:
   DwarfExpression expression_;
@@ -41,7 +41,7 @@ public:
   bool valid_for_ip(unw_word_t ip) const { return range_.contain(ip); }
 };
 
-typedef std::vector<LocationListEntry> LocationList;
+using LocationList = std::vector<LocationListEntry>;
 
 /** Location of some variable in memory
  *
index c18536f..a1c090c 100644 (file)
@@ -89,7 +89,7 @@ const Variable* ObjectInformation::find_variable(const char* name) const
 
 void ObjectInformation::remove_global_variable(const char* name)
 {
-  typedef std::vector<Variable>::size_type size_type;
+  using size_type = std::vector<Variable>::size_type;
 
   if (this->global_variables.empty())
     return;
@@ -139,7 +139,7 @@ void ObjectInformation::remove_global_variable(const char* name)
 static void remove_local_variable(Frame& scope, const char* var_name, const char* subprogram_name,
                                   Frame const& subprogram)
 {
-  typedef std::vector<Variable>::size_type size_type;
+  using size_type = std::vector<Variable>::size_type;
 
   // If the current subprogram matches the given name:
   if ((subprogram_name == nullptr || (not subprogram.name.empty() && subprogram.name == subprogram_name)) &&
index e7d4cac..14454d4 100644 (file)
@@ -29,7 +29,7 @@ namespace mc {
  */
 class Member {
 public:
-  typedef int flags_type;
+  using flags_type                                 = int;
   static constexpr flags_type INHERITANCE_FLAG     = 1;
   static constexpr flags_type VIRTUAL_POINTER_FLAG = 2;
 
index 7e4e97d..9fb828f 100644 (file)
@@ -12,7 +12,7 @@
 namespace simgrid {
 namespace mc {
 
-typedef std::uint64_t hash_type;
+using hash_type = std::uint64_t;
 
 XBT_PRIVATE hash_type hash(simgrid::mc::Snapshot const& snapshot);
 
index b52aee4..39d960e 100644 (file)
@@ -25,7 +25,7 @@
 namespace simgrid {
 namespace mc {
 
-typedef std::vector<Transition> RecordTrace;
+using RecordTrace = std::vector<Transition>;
 
 /** Convert a string representation of the path into an array of `simgrid::mc::Transition`
  */
index b9abdbe..294d641 100644 (file)
@@ -60,6 +60,7 @@ static const std::vector<std::string> filtered_libraries = {
     "libcrypt",
     "libcrypto",
     "libcurl",
+    "libcurl-gnutls",
     "libcxxrt",
     "libdebuginfod",
     "libdl",
@@ -67,11 +68,17 @@ static const std::vector<std::string> filtered_libraries = {
     "libelf",
     "libevent",
     "libexecinfo",
+    "libffi",
     "libflang",
     "libflangrti",
     "libgcc_s",
+    "libgmp",
+    "libgnutls",
+    "libgcrypt",
     "libgfortran",
+    "libgpg-error",
     "libgssapi_krb5",
+    "libhogweed",
     "libidn2",
     "libimf",
     "libintlc",
@@ -82,13 +89,16 @@ static const std::vector<std::string> filtered_libraries = {
     "libkrb5support", /*odd behaviour on fedora rawhide ... remove these when fixed*/
     "liblber",
     "libldap",
+    "libldap_r",
     "liblua5.1",
     "liblua5.3",
     "liblzma",
     "libm",
     "libmd",
+    "libnettle",
     "libnghttp2",
     "libomp",
+    "libp11-kit",
     "libpapi",
     "libpcre2",
     "libpfm",
@@ -98,6 +108,7 @@ static const std::vector<std::string> filtered_libraries = {
     "libquadmath",
     "libresolv",
     "librt",
+    "librtmp",
     "libsasl2",
     "libselinux",
     "libssh",
@@ -105,6 +116,7 @@ static const std::vector<std::string> filtered_libraries = {
     "libssl",
     "libstdc++",
     "libsvml",
+    "libtasn1",
     "libtsan",  /* gcc sanitizers */
     "libubsan", /* gcc sanitizers */
     "libunistring",
@@ -527,7 +539,7 @@ void RemoteSimulation::ignore_heap(IgnoredHeapRegion const& region)
     return;
   }
 
-  typedef std::vector<IgnoredHeapRegion>::size_type size_type;
+  using size_type = std::vector<IgnoredHeapRegion>::size_type;
 
   size_type start = 0;
   size_type end   = ignored_heap_.size() - 1;
@@ -556,7 +568,7 @@ void RemoteSimulation::ignore_heap(IgnoredHeapRegion const& region)
 
 void RemoteSimulation::unignore_heap(void* address, size_t size)
 {
-  typedef std::vector<IgnoredHeapRegion>::size_type size_type;
+  using size_type = std::vector<IgnoredHeapRegion>::size_type;
 
   size_type start = 0;
   size_type end   = ignored_heap_.size() - 1;
index 702fc15..e43be42 100644 (file)
@@ -73,15 +73,15 @@ namespace mc {
  */
 class PageStore {
 public: // Types
-  typedef std::uint64_t hash_type;
+  using hash_type = std::uint64_t;
 
 private:
   // Types
   // We are using a cheap hash to index a page.
   // We should expect collision and we need to associate multiple page indices
   // to the same hash.
-  typedef std::unordered_set<std::size_t> page_set_type;
-  typedef std::unordered_map<hash_type, page_set_type> pages_map_type;
+  using page_set_type  = std::unordered_set<std::size_t>;
+  using pages_map_type = std::unordered_map<hash_type, page_set_type>;
 
   // Fields:
   /** First page */
index c0531b5..11bc6d2 100644 (file)
@@ -34,7 +34,7 @@ struct s_mc_stack_frame_t {
   std::string frame_name;
   unw_cursor_t unw_cursor;
 };
-typedef s_mc_stack_frame_t* mc_stack_frame_t;
+using mc_stack_frame_t = s_mc_stack_frame_t*;
 
 struct s_local_variable_t {
   simgrid::mc::Frame* subprogram;
@@ -43,16 +43,16 @@ struct s_local_variable_t {
   simgrid::mc::Type* type;
   void* address;
 };
-typedef s_local_variable_t* local_variable_t;
-typedef const s_local_variable_t* const_local_variable_t;
+using local_variable_t       = s_local_variable_t*;
+using const_local_variable_t = const s_local_variable_t*;
 
 struct XBT_PRIVATE s_mc_snapshot_stack_t {
   std::vector<s_local_variable_t> local_variables;
   simgrid::mc::UnwindContext context;
   std::vector<s_mc_stack_frame_t> stack_frames;
 };
-typedef s_mc_snapshot_stack_t* mc_snapshot_stack_t;
-typedef const s_mc_snapshot_stack_t* const_mc_snapshot_stack_t;
+using mc_snapshot_stack_t       = s_mc_snapshot_stack_t*;
+using const_mc_snapshot_stack_t = const s_mc_snapshot_stack_t*;
 
 namespace simgrid {
 namespace mc {
index 4d0d80a..4adb631 100644 (file)
@@ -117,7 +117,7 @@ void MSG_process_migrate(sg_actor_t actor, sg_host_t host)
 {
   sg_actor_set_host(actor, host);
 }
-void MSG_process_join(sg_actor_t actor, double timeout)
+void MSG_process_join(const_sg_actor_t actor, double timeout)
 {
   sg_actor_join(actor, timeout);
 }
@@ -499,7 +499,7 @@ void MSG_sem_release(sg_sem_t sem)
 {
   sg_sem_release(sem);
 }
-int MSG_sem_get_capacity(sg_sem_t sem)
+int MSG_sem_get_capacity(const_sg_sem_t sem)
 {
   return sg_sem_get_capacity(sem);
 }
@@ -507,7 +507,7 @@ void MSG_sem_destroy(const_sg_sem_t sem)
 {
   sg_sem_destroy(sem);
 }
-int MSG_sem_would_block(sg_sem_t sem)
+int MSG_sem_would_block(const_sg_sem_t sem)
 {
   return sg_sem_would_block(sem);
 }
index 46b3e48..32cf623 100644 (file)
@@ -614,7 +614,7 @@ static void on_platform_created()
       simgrid::s4u::Host* remote_host = simgrid::s4u::Host::by_name_or_null(tokens[2]);
       xbt_assert(remote_host, "You're trying to access a host that does not exist. Please check your platform file");
 
-      simgrid::s4u::Disk* disk = nullptr;
+      const simgrid::s4u::Disk* disk = nullptr;
       for (auto const& d : remote_host->get_disks())
         if (d->get_name() == tokens[1]) {
           disk = d;
index 8c3963a..6813e18 100644 (file)
@@ -137,7 +137,7 @@ VirtualMachine* VirtualMachine::set_pm(simgrid::s4u::Host* pm)
   return this;
 }
 
-VirtualMachine::state VirtualMachine::get_state()
+VirtualMachine::state VirtualMachine::get_state() const
 {
   return kernel::actor::simcall([this]() { return pimpl_vm_->get_state(); });
 }
index 300204b..5588ce9 100644 (file)
@@ -50,7 +50,7 @@ Actor* Actor::self()
 
 ActorPtr Actor::init(const std::string& name, s4u::Host* host)
 {
-  kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
+  const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
   kernel::actor::ActorImpl* actor =
       kernel::actor::simcall([self, &name, host] { return self->init(name, host).get(); });
   return actor->get_iface();
@@ -73,7 +73,7 @@ ActorPtr Actor::start(const std::function<void()>& code)
 
 ActorPtr Actor::create(const std::string& name, s4u::Host* host, const std::function<void()>& code)
 {
-  kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
+  const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
   kernel::actor::ActorImpl* actor =
       kernel::actor::simcall([self, &name, host, &code] { return self->init(name, host)->start(code); });
 
@@ -103,15 +103,15 @@ int Actor::get_refcount() const
 
 // ***** Actor methods *****
 
-void Actor::join()
+void Actor::join() const
 {
   join(-1);
 }
 
-void Actor::join(double timeout)
+void Actor::join(double timeout) const
 {
   kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
-  kernel::actor::ActorImpl* target = pimpl_;
+  const kernel::actor::ActorImpl* target = pimpl_;
   kernel::actor::simcall_blocking<void>([issuer, target, timeout] {
     if (target->finished_) {
       // The joined process is already finished, just wake up the issuer right away
@@ -252,7 +252,7 @@ double Actor::get_kill_time() const
 
 void Actor::kill()
 {
-  kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
+  const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
   kernel::actor::simcall([this, self] { self->kill(pimpl_); });
 }
 
@@ -269,7 +269,7 @@ ActorPtr Actor::by_pid(aid_t pid)
 
 void Actor::kill_all()
 {
-  kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
+  const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
   kernel::actor::simcall([self] { self->kill_all(); });
 }
 
@@ -676,7 +676,7 @@ void sg_actor_migrate(sg_actor_t process, sg_host_t host) // XBT_ATTRIB_DEPRECAT
  * @param actor the actor to wait for
  * @param timeout wait until the actor is over, or the timeout expires
  */
-void sg_actor_join(sg_actor_t actor, double timeout)
+void sg_actor_join(const_sg_actor_t actor, double timeout)
 {
   actor->join(timeout);
 }
index fa9d46c..68d6efb 100644 (file)
@@ -96,7 +96,7 @@ void Host::turn_on()
 void Host::turn_off()
 {
   if (is_on()) {
-    kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
+    const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
     kernel::actor::simcall([this, self] {
       for (VirtualMachine* const& vm : vm::VirtualMachineImpl::allVms_)
         if (vm->get_pm() == this) {
@@ -267,7 +267,7 @@ std::vector<Disk*> Host::get_disks() const
   return kernel::actor::simcall([this] { return this->pimpl_->get_disks(); });
 }
 
-void Host::add_disk(Disk* disk)
+void Host::add_disk(const Disk* disk)
 {
   kernel::actor::simcall([this, disk] { this->pimpl_->add_disk(disk); });
 }
index b4a5ed7..3d8d8c0 100644 (file)
@@ -46,12 +46,12 @@ void Semaphore::release()
   kernel::actor::simcall([this] { sem_->release(); });
 }
 
-int Semaphore::get_capacity()
+int Semaphore::get_capacity() const
 {
   return kernel::actor::simcall([this] { return sem_->get_capacity(); });
 }
 
-int Semaphore::would_block()
+int Semaphore::would_block() const
 {
   return kernel::actor::simcall([this] { return sem_->would_block(); });
 }
@@ -99,7 +99,7 @@ void sg_sem_release(sg_sem_t sem)
   sem->release();
 }
 
-int sg_sem_get_capacity(sg_sem_t sem)
+int sg_sem_get_capacity(const_sg_sem_t sem)
 {
   return sem->get_capacity();
 }
@@ -114,7 +114,7 @@ void sg_sem_destroy(const_sg_sem_t sem)
  * Note that the returned value may be wrong right after the function call, when you try to use it...
  * But that's a classical semaphore issue, and SimGrid's semaphore are not different to usual ones here.
  */
-int sg_sem_would_block(sg_sem_t sem)
+int sg_sem_would_block(const_sg_sem_t sem)
 {
   return sem->would_block();
 }
index d5e918a..d0079a6 100644 (file)
 
 XBT_PUBLIC_DATA const std::array<const char*, NUM_SIMCALLS> simcall_names; /* Name of each simcall */
 
-typedef bool (*simix_match_func_t)(void*, void*, simgrid::kernel::activity::CommImpl*);
-typedef void (*simix_copy_data_func_t)(simgrid::kernel::activity::CommImpl*, void*, size_t);
-typedef void (*simix_clean_func_t)(void*);
-typedef void (*FPtr)(); // Hide the ugliness
+using simix_match_func_t     = bool (*)(void*, void*, simgrid::kernel::activity::CommImpl*);
+using simix_copy_data_func_t = void (*)(simgrid::kernel::activity::CommImpl*, void*, size_t);
+using simix_clean_func_t     = void (*)(void*);
+using FPtr                   = void (*)(); // Hide the ugliness
 
 /* Pack all possible scalar types in an union */
 union u_smx_scalar {
index ceb544f..c2bc108 100644 (file)
@@ -67,11 +67,9 @@ extern XBT_PUBLIC int mpi_statuses_ignore_;
 
 extern XBT_PRIVATE MPI_Comm MPI_COMM_UNINITIALIZED;
 
-typedef SMPI_Cart_topology* MPIR_Cart_Topology;
-
-typedef SMPI_Graph_topology* MPIR_Graph_Topology;
-
-typedef SMPI_Dist_Graph_topology* MPIR_Dist_Graph_Topology;
+using MPIR_Cart_Topology       = SMPI_Cart_topology*;
+using MPIR_Graph_Topology      = SMPI_Graph_topology*;
+using MPIR_Dist_Graph_Topology = SMPI_Dist_Graph_topology*;
 
 XBT_PRIVATE simgrid::smpi::ActorExt* smpi_process();
 XBT_PRIVATE simgrid::smpi::ActorExt* smpi_process_remote(simgrid::s4u::ActorPtr actor);
@@ -489,7 +487,7 @@ struct s_smpi_privatization_region_t {
   void* address;
   int file_descriptor;
 };
-typedef s_smpi_privatization_region_t* smpi_privatization_region_t;
+using smpi_privatization_region_t = s_smpi_privatization_region_t*;
 
 extern XBT_PRIVATE int smpi_loaded_page;
 XBT_PRIVATE smpi_privatization_region_t smpi_init_global_memory_segment_process();
@@ -503,7 +501,7 @@ XBT_PRIVATE smpi_privatization_region_t smpi_init_global_memory_segment_process(
 #define TOPAGE(addr) (void*)(((unsigned long)(addr) / xbt_pagesize) * xbt_pagesize)
 
 /** Used only if PAPI is compiled in, but integrated anyway so that this file does not depend on internal_config.h (to speed builds) */
-typedef std::vector<std::pair</* counter name */ std::string, /* counter value */ long long>> papi_counter_t;
+using papi_counter_t = std::vector<std::pair</* counter name */ std::string, /* counter value */ long long>>;
 struct papi_process_data {
   papi_counter_t counter_data;
   int event_set;
index 4526b03..5352b42 100644 (file)
@@ -35,7 +35,7 @@ struct s_smpi_key_elem_t {
   int refcount;
 };
 
-typedef s_smpi_key_elem_t* smpi_key_elem;
+using smpi_key_elem = s_smpi_key_elem_t*;
 
 namespace simgrid{
 namespace smpi{
index 091219e..9e6bb45 100644 (file)
 namespace simgrid{
 namespace smpi{
 
-typedef struct s_smpi_mpi_generalized_request_funcs {
+struct smpi_mpi_generalized_request_funcs_t {
   MPI_Grequest_query_function *query_fn;
   MPI_Grequest_free_function *free_fn;
   MPI_Grequest_cancel_function *cancel_fn;
   void* extra_state;
   s4u::ConditionVariablePtr cond;
   s4u::MutexPtr mutex;
-} s_smpi_mpi_generalized_request_funcs_t; 
-typedef struct s_smpi_mpi_generalized_request_funcs *smpi_mpi_generalized_request_funcs;
+};
 
 class Request : public F2C {
   void* buf_;
@@ -48,7 +47,7 @@ class Request : public F2C {
   int refcount_;
   MPI_Op op_;
   int cancelled_; // tri-state
-  smpi_mpi_generalized_request_funcs generalized_funcs;
+  smpi_mpi_generalized_request_funcs_t* generalized_funcs;
   MPI_Request* nbc_requests_;
   int nbc_requests_size_;
   static bool match_common(MPI_Request req, MPI_Request sender, MPI_Request receiver);
index e7354c6..88d27c9 100644 (file)
@@ -10,7 +10,7 @@
 #include "smpi_status.hpp"
 #include <memory>
 
-typedef std::shared_ptr<SMPI_Topology> MPI_Topology;
+using MPI_Topology = std::shared_ptr<SMPI_Topology>;
 
 namespace simgrid{
 namespace smpi{
index f24680c..5aa6b92 100644 (file)
@@ -99,7 +99,7 @@ simgrid::config::Flag<std::string> _smpi_cfg_comp_adjustment_file{"smpi/comp-adj
         std::ifstream fstream(filename);
         xbt_assert(fstream.is_open(), "Could not open file %s. Does it exist?", filename.c_str());
         std::string line;
-        typedef boost::tokenizer<boost::escaped_list_separator<char>> Tokenizer;
+        using Tokenizer = boost::tokenizer<boost::escaped_list_separator<char>>;
         std::getline(fstream, line); // Skip the header line
         while (std::getline(fstream, line)) {
           Tokenizer tok(line);
@@ -183,6 +183,7 @@ void smpi_init_options(){
     return;
   simgrid::config::declare_flag<bool>("smpi/display-timing", "Whether we should display the timing after simulation.", false);
   simgrid::config::declare_flag<bool>("smpi/keep-temps", "Whether we should keep the generated temporary files.", false);
+  simgrid::config::declare_flag<std::string>("smpi/tmpdir", "tmp dir for dlopen files", "/tmp");
 
   simgrid::config::declare_flag<std::string>("smpi/coll-selector", "Which collective selector to use", "default");
   simgrid::config::declare_flag<std::string>("smpi/gather", "Which collective to use for gather", "");
index 6008469..590aada 100644 (file)
@@ -14,6 +14,7 @@
 #include "src/simix/smx_private.hpp"
 #include "src/smpi/include/smpi_actor.hpp"
 #include "xbt/config.hpp"
+#include "xbt/file.hpp"
 
 #include <algorithm>
 #include <boost/algorithm/string.hpp> /* split */
@@ -235,7 +236,7 @@ static void smpi_init_papi()
       XBT_ERROR("Could not initialize PAPI library; is it correctly installed and linked?"
                 " Expected version is %u", PAPI_VER_CURRENT);
 
-    typedef boost::tokenizer<boost::char_separator<char>> Tokenizer;
+    using Tokenizer = boost::tokenizer<boost::char_separator<char>>;
     boost::char_separator<char> separator_units(";");
     std::string str = smpi_cfg_papi_events_file();
     Tokenizer tokens(str, separator_units);
@@ -287,11 +288,9 @@ static void smpi_init_papi()
 #endif
 }
 
-
-
-typedef std::function<int(int argc, char *argv[])> smpi_entry_point_type;
-typedef int (* smpi_c_entry_point_type)(int argc, char **argv);
-typedef void (*smpi_fortran_entry_point_type)();
+using smpi_entry_point_type         = std::function<int(int argc, char* argv[])>;
+using smpi_c_entry_point_type       = int (*)(int argc, char** argv);
+using smpi_fortran_entry_point_type = void (*)();
 
 template <typename F>
 static int smpi_run_entry_point(const F& entry_point, const std::string& executable_path, std::vector<std::string> args)
@@ -430,6 +429,8 @@ static void smpi_init_privatization_dlopen(const std::string& executable)
     for (auto const& libname : privatize_libs) {
       // load the library once to add it to the local libs, to get the absolute path
       void* libhandle = dlopen(libname.c_str(), RTLD_LAZY);
+      xbt_assert(libhandle != nullptr, 
+                "Cannot dlopen %s - check your settings in smpi/privatize-libs", libname.c_str());
       // get library name from path
       std::string fullpath = libname;
 #if not defined(__APPLE__) && not defined(__HAIKU__)
@@ -448,8 +449,9 @@ static void smpi_init_privatization_dlopen(const std::string& executable)
     return std::function<void()>([executable, fdin_size, args] {
       static std::size_t rank = 0;
       // Copy the dynamic library:
-      std::string target_executable =
-          executable + "_" + std::to_string(getpid()) + "_" + std::to_string(rank) + ".so";
+      simgrid::xbt::Path path(executable);
+      std::string target_executable = simgrid::config::get_value<std::string>("smpi/tmpdir") + "/" +
+          path.get_base_name() + "_" + std::to_string(getpid()) + "_" + std::to_string(rank) + ".so";
 
       smpi_copy_file(executable, target_executable, fdin_size);
       // if smpi/privatize-libs is set, duplicate pointed lib and link each executable copy to a different one.
@@ -472,15 +474,14 @@ static void smpi_init_privatization_dlopen(const std::string& executable)
           unsigned int pad = 7;
           if (libname.length() < pad)
             pad = libname.length();
-          std::string target_lib =
+          std::string target_lib = simgrid::config::get_value<std::string>("smpi/tmpdir") + "/" +
               std::string(pad - std::to_string(rank).length(), '0') + std::to_string(rank) + libname.substr(pad);
           target_libs.push_back(target_lib);
           XBT_DEBUG("copy lib %s to %s, with size %lld", libpath.c_str(), target_lib.c_str(), (long long)fdin_size2);
           smpi_copy_file(libpath, target_lib, fdin_size2);
-
-          std::string sedcommand = "sed -i -e 's/" + libname + "/" + target_lib + "/g' " + target_executable;
-          int status             = system(sedcommand.c_str());
-          xbt_assert(status == 0, "error while applying sed command %s \n", sedcommand.c_str());
+          void* handle = dlopen(target_lib.c_str(), RTLD_LAZY | RTLD_LOCAL | WANT_RTLD_DEEPBIND);
+          xbt_assert(handle != nullptr, "dlopen of library %s failed: %s (errno: %d -- %s)", target_lib.c_str(), 
+                         dlerror(), errno, strerror(errno));
         }
       }
 
index 9bdb30a..749fed9 100644 (file)
@@ -61,8 +61,8 @@ public:
 };
 }
 
-typedef std::tuple</*sender*/ int, /* receiver */ int, /* tag */ int> req_key_t;
-typedef std::unordered_map<req_key_t, MPI_Request, hash_tuple::hash<std::tuple<int,int,int>>> req_storage_t;
+using req_key_t     = std::tuple</*sender*/ int, /* receiver */ int, /* tag */ int>;
+using req_storage_t = std::unordered_map<req_key_t, MPI_Request, hash_tuple::hash<std::tuple<int, int, int>>>;
 
 void log_timed_action(const simgrid::xbt::ReplayAction& action, double clock)
 {
index bf23ea2..766ee46 100644 (file)
@@ -79,7 +79,7 @@ struct shared_data_t {
 };
 
 std::unordered_map<smpi_source_location, shared_data_t, std::hash<std::string>> allocs;
-typedef decltype(allocs)::value_type shared_data_key_type;
+using shared_data_key_type = decltype(allocs)::value_type;
 
 struct shared_metadata_t {
   size_t size;
@@ -93,9 +93,9 @@ std::map<const void*, shared_metadata_t> allocs_metadata;
 std::map<std::string, void*> calls;
 
 #ifndef WIN32
-static int smpi_shared_malloc_bogusfile           = -1;
-static int smpi_shared_malloc_bogusfile_huge_page  = -1;
-static unsigned long smpi_shared_malloc_blocksize = 1UL << 20;
+int smpi_shared_malloc_bogusfile           = -1;
+int smpi_shared_malloc_bogusfile_huge_page = -1;
+unsigned long smpi_shared_malloc_blocksize = 1UL << 20;
 #endif
 }
 
index c5bf7ff..f15557a 100644 (file)
@@ -22,7 +22,7 @@ std::vector<s_smpi_factor_t> parse_factor(const std::string& smpi_coef_string)
   std::vector<s_smpi_factor_t> smpi_factor;
 
   /** Setup the tokenizer that parses the string **/
-  typedef boost::tokenizer<boost::char_separator<char>> Tokenizer;
+  using Tokenizer = boost::tokenizer<boost::char_separator<char>>;
   boost::char_separator<char> sep(";");
   boost::char_separator<char> factor_separator(":");
   Tokenizer tokens(smpi_coef_string, sep);
index 31fe56f..5dd26dc 100644 (file)
@@ -1164,7 +1164,7 @@ int Request::grequest_start(MPI_Grequest_query_function* query_fn, MPI_Grequest_
   (*request)->flags_ |= MPI_REQ_GENERALIZED;
   (*request)->flags_ |= MPI_REQ_PERSISTENT;
   (*request)->refcount_ = 1;
-  ((*request)->generalized_funcs) = new s_smpi_mpi_generalized_request_funcs_t;
+  ((*request)->generalized_funcs)             = new smpi_mpi_generalized_request_funcs_t;
   ((*request)->generalized_funcs)->query_fn=query_fn;
   ((*request)->generalized_funcs)->free_fn=free_fn;
   ((*request)->generalized_funcs)->cancel_fn=cancel_fn;
index 1e9866c..23d4587 100644 (file)
@@ -23,7 +23,7 @@ public:
   bool operator()(s4u::Host* const a, s4u::Host* const b) const;
 };
 
-typedef boost::heap::fibonacci_heap<s4u::Host*, boost::heap::compare<compare_hosts>>::handle_type heap_handle;
+using heap_handle = boost::heap::fibonacci_heap<s4u::Host*, boost::heap::compare<compare_hosts>>::handle_type;
 
 /** Structure that imitates a std::pair, but it allows us to use meaningful names instead of .first and .second */
 struct XBT_PRIVATE pair_handle_load
index 50e03b4..9d457b4 100644 (file)
@@ -15,7 +15,7 @@ namespace loadbalancer {
 class XBT_PRIVATE Mapping {
 public:
   /** Each host can have an arbitrary number of actors -> multimap **/
-  typedef std::unordered_multimap<s4u::Host*, s4u::ActorPtr> host_to_actors_map_t;
+  using host_to_actors_map_t = std::unordered_multimap<s4u::Host*, s4u::ActorPtr>;
   host_to_actors_map_t host_to_actors;
 
   /** Each actor gets assigned to exactly one host -> map **/
index 74523e1..7946b34 100755 (executable)
@@ -26,6 +26,8 @@ PRIVATIZE="--cfg=smpi/privatization:${SMPI_PRIVATIZATION:-@HAVE_PRIVATIZATION@}"
 
 SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI"
 
+SMPITMPDIR="$(dirname $(mktemp -u))"
+
 #usage to print the way this script should be called
 usage () {
     cat <<EOF
@@ -41,6 +43,7 @@ Options:
   -np <numprocs>             # use that amount of processes from the hostfile.
                              # By default, all processes of the hostfile are used.
   -no-privatize              # Disable the globals privatization, that is activated by default
+  -tmpdir                    # Directory used to store temporary files. Defaults to system's. 
   -trace-ti                  # activate time independent tracing (for replay, default in smpi_simgrid.txt)
   -trace                     # activate tracing (Paje, default in smpi_simgrid.trace)
   -trace-comment <comment>   # put a comment on the top of the trace file
@@ -168,6 +171,10 @@ while true; do
            MAPOPT=1
             shift 1
             ;;
+       "-tmpdir")
+           SMPITMPDIR="$2"
+           shift 1
+           ;;
         "-trace")
             TRACE_ACTIVE="true"
             shift 1
@@ -257,6 +264,10 @@ while true; do
     esac
 done
 
+#setup tmp dir
+SIMOPTS="$SIMOPTS --cfg=smpi/tmpdir:$SMPITMPDIR"
+export LD_LIBRARY_PATH="$SMPITMPDIR:$LD_LIBRARY_PATH"
+
 if [ -n "${APP_TRACES}" ] ; then
     if [ $# -eq 0 ] ; then
         EXEC="@SMPIREPLAYMAIN@"
index 1106b4c..08ae367 100644 (file)
@@ -73,11 +73,10 @@ public:
   void remove_actor(kernel::actor::ActorImpl* actor) { xbt::intrusive_erase(actor_list_, *actor); }
   void add_actor_at_boot(kernel::actor::ProcessArg* arg) { actors_at_boot_.emplace_back(arg); }
 
-  typedef boost::intrusive::list<
+  using ActorList = boost::intrusive::list<
       kernel::actor::ActorImpl,
       boost::intrusive::member_hook<kernel::actor::ActorImpl, boost::intrusive::list_member_hook<>,
-                                    &kernel::actor::ActorImpl::host_actor_list_hook>>
-      ActorList;
+                                    &kernel::actor::ActorImpl::host_actor_list_hook>>;
 
   // FIXME: make these private
   ActorList actor_list_;
index 860b5a9..34c1b9b 100644 (file)
@@ -91,8 +91,9 @@ public:
   boost::intrusive::list_member_hook<> action_ti_hook;
 };
 
-typedef boost::intrusive::member_hook<CpuTiAction, boost::intrusive::list_member_hook<>, &CpuTiAction::action_ti_hook> ActionTiListOptions;
-typedef boost::intrusive::list<CpuTiAction, ActionTiListOptions > ActionTiList;
+using ActionTiListOptions =
+    boost::intrusive::member_hook<CpuTiAction, boost::intrusive::list_member_hook<>, &CpuTiAction::action_ti_hook>;
+using ActionTiList = boost::intrusive::list<CpuTiAction, ActionTiListOptions>;
 
 /************
  * Resource *
@@ -130,8 +131,9 @@ public:
   boost::intrusive::list_member_hook<> cpu_ti_hook;
 };
 
-typedef boost::intrusive::member_hook<CpuTi, boost::intrusive::list_member_hook<>, &CpuTi::cpu_ti_hook> CpuTiListOptions;
-typedef boost::intrusive::list<CpuTi, CpuTiListOptions> CpuTiList;
+using CpuTiListOptions =
+    boost::intrusive::member_hook<CpuTi, boost::intrusive::list_member_hook<>, &CpuTi::cpu_ti_hook>;
+using CpuTiList = boost::intrusive::list<CpuTi, CpuTiListOptions>;
 
 /*********
  * Model *
index 25feb08..416dfbb 100644 (file)
@@ -38,7 +38,7 @@ namespace config {
 
 namespace {
 
-static bool parse_bool(const char* value)
+bool parse_bool(const char* value)
 {
   for (const char* true_value : {"yes", "on", "true", "1"})
     if (std::strcmp(true_value, value) == 0)
@@ -49,7 +49,7 @@ static bool parse_bool(const char* value)
   throw std::range_error("not a boolean");
 }
 
-static double parse_double(const char* value)
+double parse_double(const char* value)
 {
   char* end;
   errno = 0;
@@ -64,7 +64,7 @@ static double parse_double(const char* value)
     return res;
 }
 
-static long int parse_long(const char* value)
+long int parse_long(const char* value)
 {
   char* end;
   errno = 0;
index 577e934..adcd1c1 100644 (file)
@@ -51,7 +51,7 @@ struct xbt_log_append2_file_s {
   int count; //negative for roll
   long  int limit;
 };
-typedef struct xbt_log_append2_file_s* xbt_log_append2_file_t;
+using xbt_log_append2_file_t = xbt_log_append2_file_s*;
 
 static constexpr const char* APPEND2_END_TOKEN       = "\n[End of log]\n";
 static constexpr const char* APPEND2_END_TOKEN_CLEAR = "\n                   ";