Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
get access to Exec thread count
authorSUTER Frederic <frederic.suter@cc.in2p3.fr>
Wed, 13 Jul 2022 15:35:50 +0000 (17:35 +0200)
committerSUTER Frederic <frederic.suter@cc.in2p3.fr>
Wed, 13 Jul 2022 15:37:45 +0000 (17:37 +0200)
include/simgrid/s4u/Exec.hpp
src/kernel/activity/ExecImpl.hpp
src/s4u/s4u_Exec.cpp

index b0cdbf2..aa97e9f 100644 (file)
@@ -82,6 +82,7 @@ public:
 
   Host* get_host() const;
   unsigned int get_host_number() const;
+  int get_thread_count() const;
   double get_cost() const;
   bool is_parallel() const { return parallel_; }
   bool is_assigned() const override;
index 22dfb5c..ed936f2 100644 (file)
@@ -42,6 +42,7 @@ public:
   ExecImpl& set_hosts(const std::vector<s4u::Host*>& hosts);
 
   unsigned int get_host_number() const { return static_cast<unsigned>(get_hosts().size()); }
+  int get_thread_count() const { return thread_count_; }
   double get_seq_remaining_ratio();
   double get_par_remaining_ratio();
   double get_remaining() const override;
index 259ed33..a0e9182 100644 (file)
@@ -158,6 +158,11 @@ unsigned int Exec::get_host_number() const
   return static_cast<kernel::activity::ExecImpl*>(pimpl_.get())->get_host_number();
 }
 
+int Exec::get_thread_count() const
+{
+  return static_cast<kernel::activity::ExecImpl*>(pimpl_.get())->get_thread_count();
+}
+
 /** @brief Change the host on which this activity takes place.
  *
  * The activity cannot be terminated already (but it may be started). */