BatchJob.h
1 #ifndef WRENCH_BATCHJOB_H
2 #define WRENCH_BATCHJOB_H
3 
4 #include "wrench/workflow/job/StandardJob.h"
5 
6 namespace wrench {
7 
8  /***********************/
10  /***********************/
11 
16  class BatchJob {
17  public:
18  //job, jobid, -t, -N, -c, ending s4u_timestamp (-1 as undetermined)
19  BatchJob(WorkflowJob* job, unsigned long job_id, unsigned long time_in_minutes, unsigned long number_nodes,
20  unsigned long cores_per_node, double ending_time_stamp, double arrival_time_stamp);
21 
22 
23  unsigned long getJobID();
24  unsigned long getRequestedTime();
25  void setRequestedTime(unsigned long time);
26  unsigned long getRequestedCoresPerNode();
27  double getMemoryRequirement();
28  double getBeginTimestamp();
29  void setBeginTimestamp(double time_stamp);
30  double getEndingTimestamp();
31  double getArrivalTimestamp();
32  unsigned long getRequestedNumNodes();
34  void setEndingTimestamp(double time_stamp);
35  std::map<std::string, std::tuple<unsigned long, double>> getResourcesAllocated();
36  void setAllocatedResources(std::map<std::string, std::tuple<unsigned long, double>> resources);
37 
38  private:
39 
40  friend class CONSERVATIVEBFBatchScheduler;
41  u_int32_t conservative_bf_start_date; // Field used by CONSERVATIVE_BF
42  u_int32_t conservative_bf_expected_end_date; // Field used by CONSERVATIVE_BF
43 
44  unsigned long job_id;
45  unsigned long requested_num_nodes;
46  unsigned long requested_time;
47  WorkflowJob* job;
48  unsigned long requested_cores_per_node;
49  double begin_time_stamp;
50  double ending_time_stamp;
51  double arrival_time_stamp;
52  std::map<std::string, std::tuple<unsigned long, double>> resources_allocated;
53 
54  public:
55  // Variables below are for the BatSim-style CVS output log file (only ifdef ENABLED_BATSCHED)
57  std::string csv_metadata;
60  };
61 
62  /***********************/
64  /***********************/
65 
66 }
67 
68 
69 
70 
71 #endif //WRENCH_BATCHJOB_H
std::string csv_metadata
The meta-data field for BatSim-style CSV output.
Definition: BatchJob.h:57
void setRequestedTime(unsigned long time)
Set the requested time.
Definition: BatchJob.cpp:73
A batch job, which encapsulates a WorkflowJob and additional information used by a BatchService.
Definition: BatchJob.h:16
unsigned long getRequestedNumNodes()
Get the number of requested compute nodes (or hosts)
Definition: BatchJob.cpp:123
WorkflowJob * getWorkflowJob()
Get the workflow job corresponding to this batch job.
Definition: BatchJob.cpp:107
double getArrivalTimestamp()
Get the arrival time stamp.
Definition: BatchJob.cpp:99
double getMemoryRequirement()
Get the memory requirement.
Definition: BatchJob.cpp:81
Definition: Alarm.cpp:20
double getEndingTimestamp()
Get the batch job's end timestamp.
Definition: BatchJob.cpp:149
std::string csv_allocated_processors
The allocated processors field for BatSim-style CSV output.
Definition: BatchJob.h:59
unsigned long getRequestedTime()
Get the requested time.
Definition: BatchJob.cpp:65
Abstraction of a job used for executing tasks in a Workflow.
Definition: WorkflowJob.h:34
unsigned long getRequestedCoresPerNode()
Get the requested number of cores per node.
Definition: BatchJob.cpp:57
unsigned long getJobID()
Get the id of this batch job.
Definition: BatchJob.cpp:115
BatchJob(WorkflowJob *job, unsigned long job_id, unsigned long time_in_minutes, unsigned long number_nodes, unsigned long cores_per_node, double ending_time_stamp, double arrival_time_stamp)
Constructor.
Definition: BatchJob.cpp:26
void setAllocatedResources(std::map< std::string, std::tuple< unsigned long, double >> resources)
Set the resources allocated to this batch job.
Definition: BatchJob.cpp:178
void setBeginTimestamp(double time_stamp)
Set the batch job's begin timestamp.
Definition: BatchJob.cpp:132
A class that defines a conservative backfilling batch scheduler.
Definition: CONSERVATIVEBFBatchScheduler.h:26
std::map< std::string, std::tuple< unsigned long, double > > getResourcesAllocated()
Get the resources allocated to this batch job.
Definition: BatchJob.cpp:170
void setEndingTimestamp(double time_stamp)
Set the batch job's end timestamp.
Definition: BatchJob.cpp:157
double getBeginTimestamp()
Get the batch job's begin timestamp.
Definition: BatchJob.cpp:141