11 #ifndef WRENCH_WORKUNITMULTICOREEXECUTOR_H
12 #define WRENCH_WORKUNITMULTICOREEXECUTOR_H
15 #include "wrench/services/Service.h"
17 #include "wrench/services/compute/workunit_executor/Workunit.h"
27 class WorkerThreadWork;
31 class SimulationTimestampTaskFailure;
46 unsigned long num_cores,
47 double ram_utilization,
48 std::string callback_mailbox,
50 std::shared_ptr<StorageService> scratch_space,
51 std::shared_ptr<StandardJob> job,
52 double thread_startup_overhead,
53 bool simulate_computation_as_sleep);
55 void kill(
bool job_termination);
58 std::shared_ptr<StandardJob>
getJob();
67 bool failure_timestamp_should_be_generated =
false;
68 bool task_completion_timestamp_should_be_generated =
false;
69 bool terminated_due_job_being_forcefully_terminated =
false;
70 bool task_start_timestamp_has_been_inserted =
false;
71 bool task_failure_time_stamp_has_already_been_generated =
false;
75 void cleanup(
bool has_returned_from_main,
int return_value)
override;
79 void runMulticoreComputationForTask(
WorkflowTask *task,
bool simulate_computation_as_sleep);
81 std::string callback_mailbox;
82 unsigned long num_cores;
83 double ram_utilization;
84 double thread_startup_overhead;
85 bool simulate_computation_as_sleep;
87 std::shared_ptr<StorageService> scratch_space;
89 std::set<WorkflowFile* > files_stored_in_scratch;
90 std::vector<std::shared_ptr<ComputeThread>> compute_threads;
93 std::shared_ptr<StandardJob> job;
104 #endif //WRENCH_WORKUNITEXECUTOR_H
std::set< WorkflowFile * > getFilesStoredInScratch()
Retrieve the list of files stored in scratch space storage.
Definition: WorkunitExecutor.cpp:650
unsigned long getNumCores()
Returns the number of cores the service has been allocated.
Definition: WorkunitExecutor.cpp:634
std::shared_ptr< Workunit > workunit
The Workunit this WorkunitExecutor is supposed to perform.
Definition: WorkunitExecutor.h:63
A class to describe a unit of work that's a sub-component of a StandardJob.
Definition: Workunit.h:35
An service that performs a WorkUnit.
Definition: WorkunitExecutor.h:40
double getMemoryUtilization()
Returns the RAM the service has been allocated.
Definition: WorkunitExecutor.cpp:642
A computational task in a Workflow.
Definition: WorkflowTask.h:31
std::shared_ptr< StandardJob > getJob()
Retrieve the job the WorkunitExecutor is working for.
Definition: WorkunitExecutor.cpp:658
std::string hostname
The name of the host on which the daemon is running.
Definition: S4U_Daemon.h:51
void kill(bool job_termination)
Kill the worker thread.
Definition: WorkunitExecutor.cpp:135
A service that can be added to the simulation and that can be used by a WMS when executing a workflow...
Definition: Service.h:26
A simulation timestamp class for WorkflowTask failure times.
Definition: SimulationTimestampTypes.h:136
WorkunitExecutor(std::string hostname, unsigned long num_cores, double ram_utilization, std::string callback_mailbox, std::shared_ptr< Workunit > workunit, std::shared_ptr< StorageService > scratch_space, std::shared_ptr< StandardJob > job, double thread_startup_overhead, bool simulate_computation_as_sleep)
Constructor.
Definition: WorkunitExecutor.cpp:58