11 #ifndef WRENCH_PILOTJOBMANAGER_H
12 #define WRENCH_PILOTJOBMANAGER_H
17 #include "wrench/services/Service.h"
58 std::shared_ptr<StandardJob> createStandardJob(std::vector<WorkflowTask *> tasks,
59 std::map<
WorkflowFile *, std::shared_ptr<FileLocation> > file_locations,
60 std::vector<std::tuple<
WorkflowFile *, std::shared_ptr<FileLocation>, std::shared_ptr<FileLocation> >> pre_file_copies,
61 std::vector<std::tuple<
WorkflowFile *, std::shared_ptr<FileLocation>, std::shared_ptr<FileLocation> >> post_file_copies,
62 std::vector<std::tuple<
WorkflowFile *, std::shared_ptr<FileLocation> >> cleanup_file_deletions);
64 std::shared_ptr<StandardJob> createStandardJob(std::vector<WorkflowTask *> tasks,
65 std::map<
WorkflowFile *, std::vector<std::shared_ptr<FileLocation>>> file_locations,
66 std::vector<std::tuple<
WorkflowFile *, std::shared_ptr<FileLocation>, std::shared_ptr<FileLocation> >> pre_file_copies,
67 std::vector<std::tuple<
WorkflowFile *, std::shared_ptr<FileLocation>, std::shared_ptr<FileLocation> >> post_file_copies,
68 std::vector<std::tuple<
WorkflowFile *, std::shared_ptr<FileLocation> >> cleanup_file_deletions);
71 std::shared_ptr<StandardJob> createStandardJob(std::vector<WorkflowTask *> tasks,
72 std::map<
WorkflowFile *, std::shared_ptr<FileLocation>> file_locations);
74 std::shared_ptr<StandardJob> createStandardJob(std::vector<WorkflowTask *> tasks,
75 std::map<
WorkflowFile *, std::vector<std::shared_ptr<FileLocation>>> file_locations);
77 std::shared_ptr<StandardJob> createStandardJob(
WorkflowTask *task,
78 std::map<
WorkflowFile *, std::shared_ptr<FileLocation>> file_locations);
80 std::shared_ptr<StandardJob> createStandardJob(
WorkflowTask *task,
81 std::map<
WorkflowFile *, std::vector<std::shared_ptr<FileLocation>>> file_locations);
83 std::shared_ptr<StandardJob> createStandardJob(std::vector<WorkflowTask *> tasks);
85 std::shared_ptr<StandardJob> createStandardJob(
WorkflowTask *task);
89 void submitJob(std::shared_ptr<WorkflowJob> job, std::shared_ptr<ComputeService> compute_service,
90 std::map<std::string, std::string> service_specific_args = {});
110 explicit JobManager(std::shared_ptr<WMS> wms);
120 bool processNextMessage();
123 processStandardJobCompletion(std::shared_ptr<StandardJob> job, std::shared_ptr<ComputeService> compute_service);
126 processStandardJobFailure(std::shared_ptr<StandardJob> job, std::shared_ptr<ComputeService> compute_service,
127 std::shared_ptr<FailureCause> cause);
129 void processPilotJobStart(std::shared_ptr<PilotJob> job, std::shared_ptr<ComputeService> compute_service);
131 void processPilotJobExpiration(std::shared_ptr<PilotJob> job, std::shared_ptr<ComputeService> compute_service);
135 std::shared_ptr<WMS> wms;
138 std::set<std::shared_ptr<StandardJob>> new_standard_jobs;
139 std::set<std::shared_ptr<StandardJob>> pending_standard_jobs;
140 std::set<std::shared_ptr<StandardJob>> running_standard_jobs;
141 std::set<std::shared_ptr<StandardJob>> completed_standard_jobs;
142 std::set<std::shared_ptr<StandardJob>> failed_standard_jobs;
144 std::set<std::shared_ptr<PilotJob>> new_pilot_jobs;
145 std::set<std::shared_ptr<PilotJob>> pending_pilot_jobs;
146 std::set<std::shared_ptr<PilotJob>> running_pilot_jobs;
147 std::set<std::shared_ptr<PilotJob>> completed_pilot_jobs;
157 #endif //WRENCH_PILOTJOBMANAGER_H