11 #ifndef WRENCH_PILOTJOBMANAGER_H
12 #define WRENCH_PILOTJOBMANAGER_H
17 #include "wrench/services/Service.h"
51 std::map<
WorkflowFile *, std::shared_ptr<FileLocation> > file_locations,
52 std::vector<std::tuple<
WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >> pre_file_copies,
53 std::vector<std::tuple<
WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >> post_file_copies,
54 std::vector<std::tuple<
WorkflowFile *, std::shared_ptr<FileLocation> >> cleanup_file_deletions);
59 std::shared_ptr<FileLocation> > file_locations);
63 std::shared_ptr<FileLocation> > file_locations);
67 void submitJob(
WorkflowJob *job, std::shared_ptr<ComputeService> compute_service, std::map<std::string, std::string> service_specific_args = {});
95 bool processNextMessage();
96 void processStandardJobCompletion(
StandardJob *job, std::shared_ptr<ComputeService> compute_service);
97 void processStandardJobFailure(
StandardJob *job, std::shared_ptr<ComputeService> compute_service, std::shared_ptr<FailureCause> cause);
98 void processPilotJobStart(
PilotJob *job, std::shared_ptr<ComputeService> compute_service);
99 void processPilotJobExpiration(
PilotJob *job, std::shared_ptr<ComputeService> compute_service);
104 std::shared_ptr<WMS> wms;
107 std::map<WorkflowJob*, std::unique_ptr<WorkflowJob>> jobs;
110 std::set<StandardJob *> pending_standard_jobs;
111 std::set<StandardJob *> running_standard_jobs;
112 std::set<StandardJob *> completed_standard_jobs;
113 std::set<StandardJob *> failed_standard_jobs;
115 std::set<PilotJob *> pending_pilot_jobs;
116 std::set<PilotJob *> running_pilot_jobs;
117 std::set<PilotJob *> completed_pilot_jobs;
127 #endif //WRENCH_PILOTJOBMANAGER_H
void forgetJob(WorkflowJob *job)
Forget a job (to free memory, only once a job has completed or failed)
Definition: JobManager.cpp:454
~JobManager() override
Destructor, which kills the daemon (and clears all the jobs)
Definition: JobManager.cpp:48
PilotJob * createPilotJob()
Create a pilot job.
Definition: JobManager.cpp:228
void kill()
Kill the job manager (brutally terminate the daemon, clears all jobs)
Definition: JobManager.cpp:55
std::set< PilotJob * > getPendingPilotJobs()
Get the list of currently pending pilot jobs.
Definition: JobManager.cpp:442
void stop() override
Stop the job manager.
Definition: JobManager.cpp:66
A helper daemon (co-located with and explicitly started by a WMS), which is used to handle all job ex...
Definition: JobManager.h:40
void submitJob(WorkflowJob *job, std::shared_ptr< ComputeService > compute_service, std::map< std::string, std::string > service_specific_args={})
Submit a job to compute service.
Definition: JobManager.cpp:258
A standard (i.e., non-pilot) workflow job that can be submitted to a ComputeService by a WMS (via a J...
Definition: StandardJob.h:37
void terminateJob(WorkflowJob *)
Terminate a job (standard or pilot) that hasn't completed/expired/failed yet.
Definition: JobManager.cpp:375
JobManager(std::shared_ptr< WMS > wms)
Constructor.
Definition: JobManager.cpp:38
A computational task in a Workflow.
Definition: WorkflowTask.h:27
Abstraction of a job used for executing tasks in a Workflow.
Definition: WorkflowJob.h:34
std::set< PilotJob * > getRunningPilotJobs()
Get the list of currently running pilot jobs.
Definition: JobManager.cpp:434
A pilot (i.e., non-standard) workflow job that can be submitted to a ComputeService by a WMS (via a J...
Definition: PilotJob.h:29
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 data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26
A workflow management system (WMS)
Definition: WMS.h:42
StandardJob * createStandardJob(std::vector< WorkflowTask * > tasks, std::map< WorkflowFile *, std::shared_ptr< FileLocation > > file_locations, std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation > >> pre_file_copies, std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation > >> post_file_copies, std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation > >> cleanup_file_deletions)
Create a standard job.
Definition: JobManager.cpp:94