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 jobid, 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  double getAllocatedTime();
25  void setAllocatedTime(double);
26  unsigned long getAllocatedCoresPerNode();
27  double getMemoryRequirement();
28  double getBeginTimeStamp();
29  void setBeginTimeStamp(double);
30  double getEndingTimeStamp();
31  double getArrivalTimeStamp();
32  unsigned long getNumNodes();
34  void setEndingTimeStamp(double);
35  std::map<std::string, std::tuple<unsigned long, double>> getResourcesAllocated();
36  void setAllocatedResources(std::map<std::string, std::tuple<unsigned long, double>>);
37 
38  private:
39  unsigned long jobid;
40  double allocated_time;
41  WorkflowJob* job;
42  unsigned long num_nodes;
43  unsigned long cores_per_node;
44  double begin_time_stamp;
45  double ending_time_stamp;
46  double arrival_time_stamp;
47  std::map<std::string, std::tuple<unsigned long, double>> resources_allocated;
48 
49  public:
50  // Variables below are for the BatSim-style CVS output log file (only ifdef ENABLED_BATSCHED)
51  std::string csv_metadata; // "metadata" field
52  std::string csv_allocated_processors; // "allocated_processors" field
53  };
54 
55  /***********************/
57  /***********************/
58 
59 }
60 
61 
62 
63 
64 #endif //WRENCH_BATCHJOB_H
void setEndingTimeStamp(double)
Set the batch job&#39;s end timestamp.
Definition: BatchJob.cpp:154
unsigned long getAllocatedCoresPerNode()
Get the number of cores per node.
Definition: BatchJob.cpp:54
double getEndingTimeStamp()
Get the batch job&#39;s end timestamp.
Definition: BatchJob.cpp:146
void setBeginTimeStamp(double)
Set the batch job&#39;s begin timestamp.
Definition: BatchJob.cpp:129
double getBeginTimeStamp()
Get the batch job&#39;s begin timestamp.
Definition: BatchJob.cpp:138
Abstraction of a job used for executing tasks in a Workflow.
Definition: WorkflowJob.h:31
unsigned long getNumNodes()
Get the number of allocated compute nodes (or hosts)
Definition: BatchJob.cpp:120
std::map< std::string, std::tuple< unsigned long, double > > getResourcesAllocated()
Get the resources allocated to this batch job.
Definition: BatchJob.cpp:167
BatchJob(WorkflowJob *job, unsigned long jobid, 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
double getArrivalTimeStamp()
Get the arrival time stamp.
Definition: BatchJob.cpp:96
unsigned long getJobID()
Get the id of this batch job.
Definition: BatchJob.cpp:112
void setAllocatedTime(double)
Set the allocated time.
Definition: BatchJob.cpp:70
A batch job, which encapsulates a WorkflowJob and additional information used by a BatchService...
Definition: BatchJob.h:16
void setAllocatedResources(std::map< std::string, std::tuple< unsigned long, double >>)
Set the resources allocated to this batch job.
Definition: BatchJob.cpp:175
double getAllocatedTime()
Get the allocated time.
Definition: BatchJob.cpp:62
WorkflowJob * getWorkflowJob()
Get the workflow job corresponding to this batch job.
Definition: BatchJob.cpp:104
double getMemoryRequirement()
Get the memory requirement.
Definition: BatchJob.cpp:78
Definition: TerminalOutput.cpp:15