This repository has been archived by the owner on Dec 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjobscript.h
102 lines (77 loc) · 4.49 KB
/
jobscript.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
Copyright 2017 Battelle Energy Alliance, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Description
-----------
JobScript abstract base class.
Date Created: Fri Nov 27 18:57:46 MST 2015
Author: Cormac Garvey
*/
#ifndef JOBSCRIPT_JOBSCRIPT_H_
#define JOBSCRIPT_JOBSCRIPT_H_
#include "modules.h"
#include <string>
#include <unistd.h>
#ifdef SLURM
#define JOBSCRIPT SlurmScript
#else
#define JOBSCRIPT PbsScript
#endif
namespace jobscript {
class JobScript {
public:
JobScript(int t_n_p, int m_n_p_p_n, std::string m_c_n, std::string m_c_a, std::string e_n, std::string e_a, std::string j_s_n, std::string j_n, std::string q_n, std::string w_t, modules::modules_type ms): total_num_procs_(t_n_p),
max_num_procs_per_node_(m_n_p_p_n),
mpi_cmd_name_(m_c_n),
mpi_cmd_args_(m_c_a),
exe_name_(e_n),
exe_args_(e_a),
job_script_name_(j_s_n),
job_name_(j_n),
queue_name_(q_n),
host_name_(setHostName()),
wall_time_(w_t),
modules_(ms) {};
JobScript(const JobScript &);
virtual ~JobScript() {};
// virtual void generate(void) = 0;
int getTotalNumProcs(void) const;
int getMaxNumProcsPerNode(void) const;
void setExeName(std::string);
void setExeArgs(std::string);
std::string getWallTime(void) const;
std::string getHostName(void) const;
std::string getMpiCmdName(void) const;
std::string getMpiCmdArgs(void) const;
std::string getExeName(void) const;
std::string getExeArgs(void) const;
std::string getJobScriptName(void) const;
std::string getJobName(void) const;
std::string getQueueName(void) const;
modules::modules_type getModules(void) const;
virtual void generate(void) = 0;
private:
std::string setHostName(void);
std::string job_script_name_;
std::string job_name_;
int total_num_procs_;
int max_num_procs_per_node_;
std::string host_name_;
std::string queue_name_;
std::string wall_time_;
std::string mpi_cmd_name_;
std::string mpi_cmd_args_;
std::string exe_name_;
std::string exe_args_;
modules::modules_type modules_;
};
} // namespace jobscript
#endif // JOBSCRIPT_JOBSCRIPT_H