WRENCH  1.10
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
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(std::shared_ptr<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();
34  std::shared_ptr<WorkflowJob> getWorkflowJob();
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 
43  void setAllocatedNodeIndices(std::vector<int> indices) {
44  this->allocated_node_indices = indices;
45  }
46 
51  std::vector<int> getAllocatedNodeIndices() {
52  return this->allocated_node_indices;
53  }
54 
55  private:
56 
57  friend class CONSERVATIVEBFBatchScheduler;
59 
60  u_int32_t conservative_bf_start_date; // Field used by CONSERVATIVE_BF
61  u_int32_t conservative_bf_expected_end_date; // Field used by CONSERVATIVE_BF
62 
63  unsigned long job_id;
64  unsigned long requested_num_nodes;
65  unsigned long requested_time;
66  std::shared_ptr<WorkflowJob> job;
67  unsigned long requested_cores_per_node;
68  std::string username;
69  double begin_time_stamp;
70  double ending_time_stamp;
71  double arrival_time_stamp;
72  std::map<std::string, std::tuple<unsigned long, double>> resources_allocated;
73 
74  std::vector<int> allocated_node_indices;
75 
76  public:
77  // Variables below are for the BatSim-style CSV output log file (only ifdef ENABLED_BATSCHED)
79  std::string csv_metadata;
82  };
83 
84  /***********************/
86  /***********************/
87 
88 }
89 
90 
91 
92 
93 #endif //WRENCH_BATCHJOB_H
wrench::BatchJob::csv_metadata
std::string csv_metadata
The meta-data field for BatSim-style CSV output.
Definition: BatchJob.h:79
wrench::BatchJob::setRequestedTime
void setRequestedTime(unsigned long time)
Set the requested time.
Definition: BatchJob.cpp:82
wrench::BatchJob
A batch job, which encapsulates a WorkflowJob and additional information used by a batch.
Definition: BatchJob.h:16
wrench::BatchJob::getRequestedNumNodes
unsigned long getRequestedNumNodes()
Get the number of requested compute nodes (or hosts)
Definition: BatchJob.cpp:131
wrench::BatchJob::BatchJob
BatchJob(std::shared_ptr< 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
wrench::BatchJob::getAllocatedNodeIndices
std::vector< int > getAllocatedNodeIndices()
Get the indices of allocated nodes.
Definition: BatchJob.h:51
wrench::BatchJob::getArrivalTimestamp
double getArrivalTimestamp()
Get the arrival time stamp.
Definition: BatchJob.cpp:107
wrench::BatchJob::getMemoryRequirement
double getMemoryRequirement()
Get the memory_manager_service requirement.
Definition: BatchJob.cpp:90
wrench::BatchJob::getUsername
std::string getUsername()
Get the username.
Definition: BatchJob.cpp:66
wrench::CONSERVATIVEBFBatchSchedulerCoreLevel
A class that defines a conservative backfilling batch scheduler.
Definition: CONSERVATIVEBFBatchSchedulerCoreLevel.h:26
wrench
Definition: Alarm.cpp:20
wrench::BatchJob::getEndingTimestamp
double getEndingTimestamp()
Get the batch job's end timestamp.
Definition: BatchJob.cpp:157
wrench::BatchJob::csv_allocated_processors
std::string csv_allocated_processors
The allocated processors field for BatSim-style CSV output.
Definition: BatchJob.h:81
wrench::BatchJob::getRequestedTime
unsigned long getRequestedTime()
Get the requested time.
Definition: BatchJob.cpp:74
wrench::BatchJob::getWorkflowJob
std::shared_ptr< WorkflowJob > getWorkflowJob()
Get the workflow job corresponding to this batch job.
Definition: BatchJob.cpp:115
wrench::BatchJob::getRequestedCoresPerNode
unsigned long getRequestedCoresPerNode()
Get the requested number of cores per node.
Definition: BatchJob.cpp:58
wrench::BatchJob::getJobID
unsigned long getJobID()
Get the id of this batch job.
Definition: BatchJob.cpp:123
wrench::BatchJob::setAllocatedResources
void setAllocatedResources(std::map< std::string, std::tuple< unsigned long, double >> resources)
Set the resources allocated to this batch job.
Definition: BatchJob.cpp:186
wrench::BatchJob::setBeginTimestamp
void setBeginTimestamp(double time_stamp)
Set the batch job's begin timestamp.
Definition: BatchJob.cpp:140
wrench::CONSERVATIVEBFBatchScheduler
A class that defines a conservative backfilling batch scheduler.
Definition: CONSERVATIVEBFBatchScheduler.h:26
wrench::BatchJob::setAllocatedNodeIndices
void setAllocatedNodeIndices(std::vector< int > indices)
Set the indices of the allocated nodes.
Definition: BatchJob.h:43
wrench::BatchJob::getResourcesAllocated
std::map< std::string, std::tuple< unsigned long, double > > getResourcesAllocated()
Get the resources allocated to this batch job.
Definition: BatchJob.cpp:178
wrench::BatchJob::setEndingTimestamp
void setEndingTimestamp(double time_stamp)
Set the batch job's end timestamp.
Definition: BatchJob.cpp:165
wrench::BatchJob::getBeginTimestamp
double getBeginTimestamp()
Get the batch job's begin timestamp.
Definition: BatchJob.cpp:149