WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
ComputeThread.h
1 
11 #ifndef WRENCH_COMPUTE_THREAD_H
12 #define WRENCH_COMPUTE_THREAD_H
13 
14 #include "wrench/simgrid_S4U_util/S4U_Mailbox.h"
15 #include "wrench/simgrid_S4U_util/S4U_Simulation.h"
16 
17 
18 namespace wrench {
19 
20  /***********************/
22  /***********************/
23 
24  class Simulation;
25 
31  class ComputeThread : public Service {
32 
33  public:
34 
35  ComputeThread(std::string hostname, double flops, simgrid::s4u::Mailbox *reply_mailbox);
36 
37  int main() override;
38 
39  void cleanup(bool has_returned_from_main, int return_value) override;
40 
41  void kill();
42 
43  private:
44  double flops;
45  simgrid::s4u::Mailbox *reply_mailbox;
46 
47  };
48 
49  /***********************/
51  /***********************/
52 };
53 
54 #endif //WRENCH_COMPUTE_THREAD_H
wrench
Definition: Action.cpp:28
wrench::ComputeThread::main
int main() override
The main method of the compute thread.
Definition: ComputeThread.cpp:38
wrench::ComputeThread::ComputeThread
ComputeThread(std::string hostname, double flops, simgrid::s4u::Mailbox *reply_mailbox)
Constructor.
Definition: ComputeThread.cpp:27
wrench::ComputeThread::cleanup
void cleanup(bool has_returned_from_main, int return_value) override
Cleanup method that overrides the base method and does nothing as a compute thread does not need to i...
Definition: ComputeThread.cpp:72
wrench::S4U_Daemon::hostname
std::string hostname
The name of the host on which the daemon is running.
Definition: S4U_Daemon.h:60
wrench::ComputeThread
A one-shot service that simulates a CPU-bound thread that performs a given number of flops and then r...
Definition: ComputeThread.h:31
wrench::ComputeThread::kill
void kill()
Terminate (brutally) the compute thread.
Definition: ComputeThread.cpp:61
wrench::Service
A service that can be added to the simulation and that can be used by a WMS when executing a workflow...
Definition: Service.h:31