Previously, it was only in some of the subclasses
(also, hide some deprecated symbols from Doxygen)
virtual ~Activity() = default;
public:
virtual ~Activity() = default;
public:
Activity(Activity const&) = delete;
Activity& operator=(Activity const&) = delete;
Activity(Activity const&) = delete;
Activity& operator=(Activity const&) = delete;
enum class State { INITED = 0, STARTED, CANCELED, ERRORED, FINISHED };
enum class State { INITED = 0, STARTED, CANCELED, ERRORED, FINISHED };
virtual Activity* cancel() = 0;
/** Retrieve the current state of the activity */
Activity::State get_state() { return state_; }
virtual Activity* cancel() = 0;
/** Retrieve the current state of the activity */
Activity::State get_state() { return state_; }
+ /** Returns whether this activity is completed */
+ virtual bool test() = 0;
/** Get the remaining amount of work that this Activity entails. When it's 0, it's done. */
virtual double get_remaining();
/** Get the remaining amount of work that this Activity entails. When it's 0, it's done. */
virtual double get_remaining();
/** Retrieve the user data of the Activity */
void* get_user_data() { return user_data_; }
/** Retrieve the user data of the Activity */
void* get_user_data() { return user_data_; }
/** @deprecated See Activity::get_state()*/
XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_state()") Activity::State getState() { return state_; }
/** @deprecated See Activity::get_remaining() */
/** @deprecated See Activity::get_state()*/
XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_state()") Activity::State getState() { return state_; }
/** @deprecated See Activity::get_remaining() */
}
/** @deprecated See Activity::get_user_data() */
XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_user_data()") void* getUserData() { return user_data_; }
}
/** @deprecated See Activity::get_user_data() */
XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_user_data()") void* getUserData() { return user_data_; }
private:
simgrid::kernel::activity::ActivityImplPtr pimpl_ = nullptr;
private:
simgrid::kernel::activity::ActivityImplPtr pimpl_ = nullptr;
Activity* start() override;
Activity* wait() override;
Activity* wait(double timeout) override;
Activity* start() override;
Activity* wait() override;
Activity* wait(double timeout) override;
/** Start the comm, and ignore its result. It can be completely forgotten after that. */
Activity* detach();
/** Start the comm, and ignore its result. It can be completely forgotten after that. */
Activity* detach();
/** Retrieve the size of the received data */
size_t get_dst_data_size();
/** Retrieve the size of the received data */
size_t get_dst_data_size();
Activity* cancel() override;
/** Retrieve the mailbox on which this comm acts */
MailboxPtr get_mailbox();
Activity* cancel() override;
/** Retrieve the mailbox on which this comm acts */
MailboxPtr get_mailbox();
/** @deprecated See Comm::set_rate() */
XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_rate()") Activity* setRate(double rate) { return set_rate(rate); }
/** @deprecated See Comm::set_src_data() */
/** @deprecated See Comm::set_rate() */
XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_rate()") Activity* setRate(double rate) { return set_rate(rate); }
/** @deprecated See Comm::set_src_data() */
}
/** @deprecated See Comm::get_mailbox() */
XBT_ATTRIB_DEPRECATED_v323("Please use Comm::get_mailbox()") MailboxPtr getMailbox() { return get_mailbox(); }
}
/** @deprecated See Comm::get_mailbox() */
XBT_ATTRIB_DEPRECATED_v323("Please use Comm::get_mailbox()") MailboxPtr getMailbox() { return get_mailbox(); }
private:
double rate_ = -1;
private:
double rate_ = -1;
Activity* wait() override;
Activity* wait(double timeout) override;
Activity* cancel() override;
Activity* wait() override;
Activity* wait(double timeout) override;
Activity* cancel() override;
ExecPtr set_priority(double priority);
ExecPtr set_bound(double bound);
ExecPtr set_priority(double priority);
ExecPtr set_bound(double bound);
Activity* wait() override;
Activity* wait(double timeout) override;
Activity* cancel() override;
Activity* wait() override;
Activity* wait(double timeout) override;
Activity* cancel() override;
double get_remaining() override;
sg_size_t get_performed_ioops();
double get_remaining() override;
sg_size_t get_performed_ioops();
{
// TODO: this should be a simcall or something
// TODO: we are missing a version with timeout
{
// TODO: this should be a simcall or something
// TODO: we are missing a version with timeout
- for (CommPtr comm : *comms) {
+ for (CommPtr comm : *comms)
}
Activity* Comm::set_rate(double rate)
}
Activity* Comm::set_rate(double rate)
+bool Io::test()
+{
+ xbt_assert(state_ == State::INITED || state_ == State::STARTED || state_ == State::FINISHED);
+
+ if (state_ == State::FINISHED)
+ return true;
+
+ if (state_ == State::INITED)
+ this->start();
+
+ THROW_UNIMPLEMENTED;
+
+ return false;
+}
+
/** @brief Returns the amount of flops that remain to be done */
double Io::get_remaining()
{
/** @brief Returns the amount of flops that remain to be done */
double Io::get_remaining()
{