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, std::string username, 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  std::string getUsername();
28  double getMemoryRequirement();
29  double getBeginTimestamp();
30  void setBeginTimestamp(double time_stamp);
31  double getEndingTimestamp();
32  double getArrivalTimestamp();
33  unsigned long getRequestedNumNodes();
35  void setEndingTimestamp(double time_stamp);
36  std::map<std::string, std::tuple<unsigned long, double>> getResourcesAllocated();
37  void setAllocatedResources(std::map<std::string, std::tuple<unsigned long, double>> resources);
38 
39  private:
40 
41  friend class CONSERVATIVEBFBatchScheduler;
42  u_int32_t conservative_bf_start_date; // Field used by CONSERVATIVE_BF
43  u_int32_t conservative_bf_expected_end_date; // Field used by CONSERVATIVE_BF
44 
45  unsigned long job_id;
46  unsigned long requested_num_nodes;
47  unsigned long requested_time;
48  WorkflowJob* job;
49  unsigned long requested_cores_per_node;
50  std::string username;
51  double begin_time_stamp;
52  double ending_time_stamp;
53  double arrival_time_stamp;
54  std::map<std::string, std::tuple<unsigned long, double>> resources_allocated;
55 
56  public:
57  // Variables below are for the BatSim-style CVS output log file (only ifdef ENABLED_BATSCHED)
59  std::string csv_metadata;
62  };
63 
64  /***********************/
66  /***********************/
67 
68 }
69 
70 
71 
72 
73 #endif //WRENCH_BATCHJOB_H
std::string csv_metadata
The meta-data field for BatSim-style CSV output.
Definition: BatchJob.h:59
void setRequestedTime(unsigned long time)
Set the requested time.
Definition: BatchJob.cpp:83
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:133
WorkflowJob * getWorkflowJob()
Get the workflow job corresponding to this batch job.
Definition: BatchJob.cpp:117
double getArrivalTimestamp()
Get the arrival time stamp.
Definition: BatchJob.cpp:109
double getMemoryRequirement()
Get the memory requirement.
Definition: BatchJob.cpp:91
std::string getUsername()
Get the username.
Definition: BatchJob.cpp:67
Definition: Alarm.cpp:20
double getEndingTimestamp()
Get the batch job's end timestamp.
Definition: BatchJob.cpp:159
std::string csv_allocated_processors
The allocated processors field for BatSim-style CSV output.
Definition: BatchJob.h:61
unsigned long getRequestedTime()
Get the requested time.
Definition: BatchJob.cpp:75
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:59
unsigned long getJobID()
Get the id of this batch job.
Definition: BatchJob.cpp:125
BatchJob(WorkflowJob *job, unsigned long job_id, unsigned long time_in_minutes, unsigned long number_nodes, unsigned long cores_per_node, std::string username, double ending_time_stamp, double arrival_time_stamp)
Constructor.
Definition: BatchJob.cpp:27
void setAllocatedResources(std::map< std::string, std::tuple< unsigned long, double >> resources)
Set the resources allocated to this batch job.
Definition: BatchJob.cpp:188
void setBeginTimestamp(double time_stamp)
Set the batch job's begin timestamp.
Definition: BatchJob.cpp:142
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:180
void setEndingTimestamp(double time_stamp)
Set the batch job's end timestamp.
Definition: BatchJob.cpp:167
double getBeginTimestamp()
Get the batch job's begin timestamp.
Definition: BatchJob.cpp:151