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  unsigned long getAllocatedTime();
25  void setAllocatedTime(unsigned long time);
26  unsigned long getAllocatedCoresPerNode();
27  double getMemoryRequirement();
28  double getBeginTimeStamp();
29  void setBeginTimeStamp(double time_stamp);
30  double getEndingTimeStamp();
31  double getArrivalTimeStamp();
32  unsigned long getNumNodes();
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  unsigned long jobid;
40  unsigned long 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)
52  std::string csv_metadata;
55  };
56 
57  /***********************/
59  /***********************/
60 
61 }
62 
63 
64 
65 
66 #endif //WRENCH_BATCHJOB_H
void setEndingTimeStamp(double time_stamp)
Set the batch job&#39;s end timestamp.
Definition: BatchJob.cpp:157
void setAllocatedResources(std::map< std::string, std::tuple< unsigned long, double >> resources)
Set the resources allocated to this batch job.
Definition: BatchJob.cpp:178
std::string csv_metadata
The meta-data field for BatSim-style CSV output.
Definition: BatchJob.h:52
unsigned long getAllocatedTime()
Get the allocated time.
Definition: BatchJob.cpp:65
unsigned long getAllocatedCoresPerNode()
Get the number of cores per node.
Definition: BatchJob.cpp:57
double getEndingTimeStamp()
Get the batch job&#39;s end timestamp.
Definition: BatchJob.cpp:149
double getBeginTimeStamp()
Get the batch job&#39;s begin timestamp.
Definition: BatchJob.cpp:141
Abstraction of a job used for executing tasks in a Workflow.
Definition: WorkflowJob.h:34
unsigned long getNumNodes()
Get the number of allocated compute nodes (or hosts)
Definition: BatchJob.cpp:123
std::map< std::string, std::tuple< unsigned long, double > > getResourcesAllocated()
Get the resources allocated to this batch job.
Definition: BatchJob.cpp:170
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:99
unsigned long getJobID()
Get the id of this batch job.
Definition: BatchJob.cpp:115
A batch job, which encapsulates a WorkflowJob and additional information used by a BatchService...
Definition: BatchJob.h:16
void setBeginTimeStamp(double time_stamp)
Set the batch job&#39;s begin timestamp.
Definition: BatchJob.cpp:132
WorkflowJob * getWorkflowJob()
Get the workflow job corresponding to this batch job.
Definition: BatchJob.cpp:107
std::string csv_allocated_processors
The allocated processors field for BatSim-style CSV output.
Definition: BatchJob.h:54
double getMemoryRequirement()
Get the memory requirement.
Definition: BatchJob.cpp:81
Definition: Alarm.cpp:19
void setAllocatedTime(unsigned long time)
Set the allocated time.
Definition: BatchJob.cpp:73