X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/77bbf3027c4240a2e833209a3a3f186589da8577..be4186e3689b74b38253d5425cbd6d08b2854a2b:/include/simgrid/s4u/Actor.hpp diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 92fc4852ce..147f538aa3 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -130,6 +131,7 @@ namespace s4u { /** @brief Simulation Agent */ XBT_PUBLIC_CLASS Actor : public simgrid::xbt::Extendable { + friend Exec; friend Mailbox; friend simgrid::simix::ActorImpl; friend simgrid::kernel::activity::MailboxImpl; @@ -154,13 +156,18 @@ public: Actor& operator=(Actor const&) = delete; // ***** Reference count ***** - friend void intrusive_ptr_add_ref(Actor * actor); - friend void intrusive_ptr_release(Actor * actor); + friend XBT_PUBLIC(void) intrusive_ptr_add_ref(Actor * actor); + friend XBT_PUBLIC(void) intrusive_ptr_release(Actor * actor); // ***** Actor creation ***** /** Retrieve a reference to myself */ static ActorPtr self(); + /** Signal to others that a new actor has been created **/ + static simgrid::xbt::signal onCreation; + /** Signal indicating that the given actor is about to disappear */ + static simgrid::xbt::signal onDestruction; + /** Create an actor using a function * * If the actor is restarted, the actor has a fresh copy of the function. @@ -258,6 +265,7 @@ public: * This blocks the calling actor until the actor on which we call join() is terminated */ void join(); + void join(double timeout); // Static methods on all actors: @@ -269,6 +277,7 @@ public: simix::ActorImpl* getImpl(); /** Retrieve the property value (or nullptr if not set) */ + std::map* getProperties(); const char* getProperty(const char* key); void setProperty(const char* key, const char* value); Actor* restart(); @@ -304,10 +313,18 @@ XBT_ATTRIB_DEPRECATED_v320("Use sleep_for(): v3.20 will turn this warning into a /** Block the actor, computing the given amount of flops */ XBT_PUBLIC(void) execute(double flop); + /** Block the actor, computing the given amount of flops at the given priority. * An execution of priority 2 computes twice as fast as an execution at priority 1. */ XBT_PUBLIC(void) execute(double flop, double priority); +XBT_PUBLIC(void) parallel_execute(int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount); +XBT_PUBLIC(void) +parallel_execute(int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double timeout); + +XBT_PUBLIC(ExecPtr) exec_init(double flops_amounts); +XBT_PUBLIC(ExecPtr) exec_async(double flops_amounts); + /** Block the actor until it gets a message from the given mailbox. * * See \ref Comm for the full communication API (including non blocking communications).