2#ifndef STORMM_NML_NICE_H
3#define STORMM_NML_NICE_H
7#include "Parsing/textfile.h"
8#include "namelist_emulator.h"
9#include "namelist_enumerators.h"
15using parse::WrapTextSearch;
19constexpr int default_workday_start_hour = 9;
20constexpr int default_workday_end_hour = 17;
21constexpr int default_workday_start_minute = 0;
22constexpr int default_workday_end_minute = 0;
28constexpr char default_workweek_start[] =
"MON";
29constexpr char default_workweek_end[] =
"FRI";
33constexpr double default_workday_gpu_effort = 0.50;
38constexpr double default_nice_running_check_interval = 10.0;
39constexpr double minimum_running_check_interval = 0.1;
40constexpr double maximum_running_check_interval = 60.0;
46constexpr double default_nice_resume_check_interval = 60.0;
47constexpr double maximum_resume_check_interval = 3600.0;
48constexpr double minimum_resume_check_interval = 60.0;
70 NiceControls(ExceptionResponse policy_in = ExceptionResponse::DIE);
73 ExceptionResponse policy_in = ExceptionResponse::DIE,
74 WrapTextSearch wrap = WrapTextSearch::NO);
127 ExceptionResponse policy;
128 double workday_effort_level;
130 double running_check_interval;
133 double resume_check_interval;
144 std::vector<DayOfTheWeek> work_days;
145 std::vector<bool> working_day_mask;
153 bool validateGpuEffortLevel(
const double workday_effort_level_in)
const;
159 bool validateRunningCheckInterval(
const double running_check_interval_in)
const;
165 bool validateResumeCheckInterval(
const double resume_check_interval_in)
const;
171 int translateTimeString(
const std::string &time_statement)
const;
177 std::string translateTimeInteger(
int time_value)
const;
195 ExceptionResponse policy = ExceptionResponse::DIE,
196 WrapTextSearch wrap = WrapTextSearch::NO);
Collection of variables to transcribe information contained within a namelist.
Definition namelist_emulator.h:30
void setWorkTimeStart(const std::string &work_time_start_in)
Set the start of the workday. The string will be interpreted first as an hour, or as an hour and a mi...
Definition nml_nice.cpp:127
void setWorkTimeEnd(const std::string &work_time_end_in)
Set the end of the workday. The string will be interpreted as it is in the function setWorkTimeStart(...
Definition nml_nice.cpp:132
NiceControls(const NiceControls &original)=default
As with other control objects, copy and move constructors, plus copy and move assignment operators,...
void setRunningCheckInterval(double running_check_interval_in)
Set the interval at which to check for competing processes while the STORMM process is in operation.
Definition nml_nice.cpp:113
std::string getWorkdayEnd() const
Get the workday end time as a real value in seconds after midnight.
Definition nml_nice.cpp:79
std::string getWorkdayStart() const
Get the workday start time as string recording hours:minutes:00 (workdays are rounded.
Definition nml_nice.cpp:74
bool isWorkTimeNow() const
Get a verdict on whether the workday is happening now.
Definition nml_nice.cpp:97
std::string getWorkWeek() const
Get a list of the working days of the week, codified into a string.
Definition nml_nice.cpp:84
void setResumeCheckInterval(double resume_check_interval_in)
Set the interval at which to check for competing processes after pausing the STORMM process....
Definition nml_nice.cpp:120
void setGpuEffortLevel(double workday_effort_level_in)
Set the GPU effort level to undertake during working hours.
Definition nml_nice.cpp:106
NiceControls(ExceptionResponse policy_in=ExceptionResponse::DIE)
The constructor can prepare an object with default settings or read the corresponding namelist to acc...
Definition nml_nice.cpp:17
Structure for translating a text file into a compact, rapidly parsable vector of characters in CPU RA...
Definition textfile.h:45