sjef
sjef.h
Go to the documentation of this file.
1 #ifndef SJEF_SJEF_H
2 #define SJEF_SJEF_H
3 #include <filesystem>
4 #include <map>
5 #include <memory>
6 #include <mutex>
7 #include <set>
8 #include <string>
9 #include <thread>
10 #include <vector>
11 #include <ostream>
12 #include <iostream>
13 #include <atomic>
14 
15 namespace pugi {
16 class xpath_node_set;
17 }
18 namespace sjef {
19 class Backend;
20 class Locker;
21 struct remote_server;
22 struct pugi_xml_document;
23 static constexpr int recentMax = 128;
24 enum status : int { unknown = 0, running = 1, waiting = 2, completed = 3, unevaluated = 4, killed = 5 };
25 using mapstringstring_t = std::map<std::string, std::string>;
26 
27 class Logger {
28  std::ostream* m_stream;
29  int m_level;
30 
31  class NullBuffer : public std::streambuf {
32  public:
33  int overflow(int c) override { return c; }
34  };
35  NullBuffer m_null_buffer;
36  mutable std::ostream m_null{&m_null_buffer};
37  std::vector<std::string> m_preambles;
38 
39 public:
40  enum class Levels : int { QUIET = -1, ERROR = 0, WARNING = 1, NOTIFICATION = 2, DETAIL = 3 };
41  explicit Logger(std::ostream& stream, int level) : m_stream(&stream), m_level(level) {}
42  explicit Logger(std::ostream& stream = std::cout, const Levels level = Levels::ERROR,
43  std::vector<std::string> preambles = {})
44  : m_stream(&stream), m_level(static_cast<int>(level)), m_preambles(std::move(preambles)) {}
45  explicit Logger(const Logger& source)
46  : m_stream(source.m_stream), m_level(source.m_level), m_preambles(source.m_preambles) {}
47  explicit Logger(Logger&& source) noexcept
48  : m_stream(std::move(source.m_stream)), m_level(std::move(source.m_level)),
49  m_preambles(std::move(source.m_preambles)) {}
50  Logger& operator=(const Logger& source) {
51  m_stream = source.m_stream;
52  m_level = source.m_level;
53  m_preambles = source.m_preambles;
54  return *this;
55  }
56  Logger& operator=(Logger&& source) noexcept {
57  m_stream = source.m_stream;
58  m_level = source.m_level;
59  m_preambles = std::move(source.m_preambles);
60  return *this;
61  }
62  ~Logger() = default;
63  std::ostream& stream() const { return *m_stream; }
64  std::ostream& operator()(int level, const std::string& message = "") const {
65  auto& stream = level > m_level ? m_null : *m_stream;
66  if (level >= 0 && level < decltype(level)(m_preambles.size()))
67  stream << m_preambles[level];
68  if (!message.empty())
69  stream << message << std::endl;
70  return stream;
71  }
72  std::ostream& operator()(const Levels level, const std::string& message = "") const {
73  return ((*this)(static_cast<int>(level), message));
74  }
75  std::ostream& detail(const std::string& message = "") const { return ((*this)(Levels::DETAIL, message)); }
76  std::ostream& notify(const std::string& message = "") const { return ((*this)(Levels::NOTIFICATION, message)); }
77  std::ostream& warn(const std::string& message = "") const { return ((*this)(Levels::WARNING, message)); }
78  std::ostream& error(const std::string& message = "") const { return ((*this)(Levels::ERROR, message)); }
79  int level() const { return m_level; }
80  void set_level(int level) { Logger::m_level = level; }
81  void set_level(Levels level) { Logger::m_level = static_cast<int>(level); }
82  void set_stream(std::ostream& stream) { m_stream = &stream; }
83 };
84 
85 template <typename Arg>
86 std::ostream& operator<<(const Logger& l, Arg arg) {
87  l.stream() << arg;
88  return l.stream();
89 }
90 
91 class Project {
92 private:
93  std::string m_project_suffix;
94  std::filesystem::path m_filename;
95  std::vector<std::filesystem::path> m_reserved_files =
97  std::vector<std::filesystem::path>{sjef::Project::s_propertyFile};
98  std::unique_ptr<pugi_xml_document> m_properties;
99  mapstringstring_t m_suffixes;
100  std::map<std::string, Backend> m_backends;
101 
102  std::unique_ptr<pugi_xml_document> m_backend_doc;
103  mutable std::shared_ptr<remote_server> m_remote_server;
104  mutable std::chrono::milliseconds m_status_lifetime = std::chrono::milliseconds(0);
105  mutable std::chrono::time_point<std::chrono::steady_clock> m_status_last = std::chrono::steady_clock::now();
106  mutable std::thread m_backend_watcher;
107  // put the flag into a container to deal conveniently with std:atomic_flag's
108  // lack of move constructor
109  struct backend_watcher_flag_container {
110  std::atomic_flag shutdown_flag;
111  std::mutex m_property_set_mutex;
112  };
113  mutable backend_watcher_flag_container m_unmovables;
114  std::unique_ptr<Project> m_backend_watcher_instance;
115  const Project* m_master_instance;
116  bool m_master_of_slave;
117  bool m_monitor;
118  bool m_sync;
119  mutable std::mutex m_status_mutex;
120  mutable std::mutex m_remote_server_mutex;
121  mutable std::mutex m_synchronize_mutex;
122  mutable std::string m_backend;
123  mutable std::string m_xml_cached;
124  std::string remote_server_run(const std::string& command, int verbosity = 0, bool wait = true) const;
126  static const std::string s_propertyFile;
128  std::shared_ptr<Locker> m_locker;
129  Logger m_warn{std::cerr, Logger::Levels::WARNING, {"sjef:: Error: ", "sjef:: Warning: ", "sjef:: Note:"}};
130  Logger m_trace{std::cout, Logger::Levels::QUIET};
131 
132 public:
148  explicit Project(const std::filesystem::path& filename, bool construct = true, const std::string& default_suffix = "",
149  const mapstringstring_t& suffixes = {{"inp", "inp"}, {"out", "out"}, {"xml", "xml"}},
150  bool monitor = true, bool sync = true, const Project* masterProject = nullptr);
151  // explicit Project(const std::string& filename, bool construct = true, const std::string& default_suffix = "",
152 // const mapstringstring_t& suffixes = {{"inp", "inp"}, {"out", "out"}, {"xml", "xml"}}) : Project(std::filesystem::path(filename),construct,default_suffix,suffixes) {}
153  Project(const Project& source) = delete;
154  Project(const Project&& source) = delete;
155  virtual ~Project();
168  bool copy(const std::filesystem::path& destination_filename, bool force = false, bool keep_hash = false, bool slave = false, int keep_run_directories=std::numeric_limits<int>::max());
176  bool move(const std::filesystem::path& destination_filename, bool force = false);
181  static void erase(const std::filesystem::path& filename, const std::string& default_suffix = "");
189  bool import_file(const std::filesystem::path& file, bool overwrite = false);
190  bool import_file(const std::vector<std::string>& files, bool overwrite = false) {
191  bool result = true;
192  for (const auto& file : files)
193  result &= import_file(file, overwrite);
194  return result;
195  }
202  bool export_file(const std::filesystem::path& file, bool overwrite = false);
203  bool export_file(const std::vector<std::string>& files, bool overwrite = false) {
204  bool result = true;
205  for (const auto& file : files)
206  result &= export_file(file, overwrite);
207  return result;
208  }
218  bool synchronize(int verbosity = 0, bool nostatus = false, bool force = false) const;
225  void set_warnings(const Logger::Levels level = Logger::Levels::WARNING, std::ostream& stream = std::cerr,
226  std::vector<std::string> preambles = {"sjef:: Error: ", "sjef:: Warning: ", "sjef:: Note:"}) {
227  m_warn = Logger{stream, level, std::move(preambles)};
228  }
229  void set_verbosity(int verbosity, std::ostream& stream = std::cout) { m_trace = Logger(stream, verbosity); }
230 
240  bool run(int verbosity = 0, bool force = false, bool wait = false);
241  bool run(const std::string& name, int verbosity = 0, bool force = false, bool wait = false) {
243  return run(verbosity, force, wait);
244  }
245 
262  sjef::status status(int verbosity = 0, bool cached = true) const;
267  std::string status_message(int verbosity = 0) const;
274  void wait(unsigned int maximum_microseconds = 10000) const;
278  void kill();
286  bool run_needed(int verbosity = 0) const;
294  std::string input_from_output(bool sync = true) const;
295  void rewrite_input_file(const std::string& input_file_name, const std::string& old_name);
299  void custom_initialisation();
304  void custom_run_preface();
314  std::string xml(int run = 0, bool sync = true) const;
328  std::string file_contents(const std::string& suffix = "", const std::string& name = "", int run = 0,
329  bool sync = true) const;
330 
338  void clean(bool oldOutput = true, bool output = false, bool unused = false, int keep_run_directories=0);
344  void property_set(const std::string& property, const std::string& value);
349  void property_set(const mapstringstring_t& properties);
355  std::string property_get(const std::string& property) const;
361  mapstringstring_t property_get(const std::vector<std::string>& properties) const;
366  void property_delete(const std::string& property);
367  void property_delete(const std::vector<std::string>& properties);
372  std::vector<std::string> property_names() const;
385  std::filesystem::path filename(std::string suffix = "", const std::string& name = "", int run = -1) const;
393  std::filesystem::path run_directory(int run = 0) const;
400  int run_verify(int run) const;
406  using run_list_t = std::set<int, std::greater<int>>;
407  run_list_t run_list() const;
413  int run_directory_new();
418  void run_delete(int run);
423  int run_directory_next() const;
429  std::string name() const;
436  static int recent_find(const std::string& suffix, const std::filesystem::path& filename);
437  int recent_find(const std::filesystem::path& filename) const;
444  static std::string recent(const std::string& suffix, int number = 1);
445  std::string recent(int number = 1) const;
446  void ensure_remote_server() const;
454  void change_backend(std::string backend = std::string{""}, bool force = false);
455 
456  std::map<std::string, Backend>& backends() { return m_backends; }
457 
458 private:
459  Backend default_backend();
460  sjef::status cached_status() const;
461  void cached_status(sjef::status status) const;
462  void throw_if_backend_invalid(std::string backend = "") const;
463  std::string get_project_suffix(const std::filesystem::path& filename, const std::string& default_suffix) const;
464  static void recent_edit(const std::filesystem::path& add, const std::filesystem::path& remove = "");
465  mutable std::filesystem::file_time_type m_property_file_modification_time;
466  mutable std::map<std::string, std::filesystem::file_time_type, std::less<>> m_input_file_modification_time;
467  std::set<std::string, std::less<>> m_run_directory_ignore;
468  void property_delete_locked(const std::string& property);
469  void check_property_file_locked() const;
470  void check_property_file() const;
471  void save_property_file_locked() const;
472  void save_property_file() const;
473  void load_property_file_locked() const;
474  bool properties_last_written_by_me(bool removeFile = false) const;
475 
476 public:
477  std::filesystem::path propertyFile() const;
482  const std::string backend_cache() const;
483 
484 private:
485  std::string cache(const Backend& backend) const;
486  void force_file_names(const std::string& oldname);
487  static void backend_watcher(sjef::Project& project_, int min_wait_milliseconds, int max_wait_milliseconds = 0,
488  int poll_milliseconds = 1);
489  void shutdown_backend_watcher();
497  std::string referenced_file_contents(const std::string& line) const;
498 
499 public:
500  static const std::vector<std::string> suffix_keys;
501  /*
502  */
511  size_t project_hash();
517  size_t input_hash() const;
518 
525  std::string backend_get(const std::string& backend, const std::string& key) const;
526 
541  std::string backend_parameter_expand(const std::string& backend, std::string templ = "") const;
542 
550  mapstringstring_t backend_parameters(const std::string& backend, bool doc = false) const;
551 
552  void backend_parameter_set(const std::string& backend, const std::string& name, const std::string& value) {
553  property_set("Backend/" + backend + "/" + name, value);
554  }
555 
556  void backend_parameter_delete(const std::string& backend, const std::string& name) {
557  property_delete("Backend/" + backend + "/" + name);
558  }
559 
560  std::string backend_parameter_get(const std::string& backend, const std::string& name) const {
561  auto p = property_get("Backend/" + backend + "/" + name);
562  if (p.find("!") == std::string::npos)
563  return p;
564  return p.substr(0, p.find("!"));
565  }
566 
573  std::string backend_parameter_documentation(const std::string& backend, const std::string& name) const {
574  auto ps = backend_parameters(backend, true);
575  if (ps.count(name) == 0)
576  return "";
577  return ps.at(name);
578  }
579 
586  std::string backend_parameter_default(const std::string& backend, const std::string& name) const {
587  auto ps = backend_parameters(backend, false);
588  if (ps.count(name) == 0)
589  return "";
590  return ps.at(name);
591  }
592 
597  std::vector<std::string> backend_names() const;
598 
606  void add_backend(const std::string& name, const mapstringstring_t& fields);
607 
613  void delete_backend(const std::string& name);
614 
620  bool check_backend(const std::string& name) const;
621 
626  bool check_all_backends() const;
627 
635  void take_run_files(int run = 0, const std::string& fromname = "", const std::string& toname = "") const;
636 
642  void set_current_run(unsigned int run = 0);
643 
648  unsigned int current_run() const;
649 
656  pugi::xpath_node_set select_nodes(const std::string& xpath_query, int run = 0) const;
665  std::vector<std::string> xpath_search(const std::string& xpath_query, const std::string& attribute = "",
666  int run = 0) const;
667 };
668 
677 bool check_backends(const std::string& suffix);
678 
693 std::filesystem::path expand_path(const std::filesystem::path& path, const std::string& suffix = "");
694 
703 std::string xmlRepair(const std::string& source, const mapstringstring_t& injections = {});
704 
709 std::string version() noexcept;
710 
711 class runtime_error : public std::runtime_error {
712  using std::runtime_error::runtime_error;
713 };
714 
715 } // namespace sjef
716 
717 #endif // SJEF_SJEF_H
sjef::Project::propertyFile
std::filesystem::path propertyFile() const
sjef::mapstringstring_t
std::map< std::string, std::string > mapstringstring_t
Definition: sjef.h:25
sjef::xmlRepair
std::string xmlRepair(const std::string &source, const mapstringstring_t &injections={})
Repair an xml dataset by completing any open tags.
sjef::Project::property_delete
void property_delete(const std::string &property)
Remove a variable.
sjef::Project::project_hash
size_t project_hash()
Return a globally-unique hash to identify the project. The hash is generated on first call to this fu...
sjef::Project::take_run_files
void take_run_files(int run=0, const std::string &fromname="", const std::string &toname="") const
Copy files from a run directory to the main project.
sjef::Project::~Project
virtual ~Project()
sjef::Logger::warn
std::ostream & warn(const std::string &message="") const
Definition: sjef.h:77
sjef::running
@ running
Definition: sjef.h:24
sjef::Project::run_list
run_list_t run_list() const
sjef::Logger::Logger
Logger(std::ostream &stream=std::cout, const Levels level=Levels::ERROR, std::vector< std::string > preambles={})
Definition: sjef.h:42
sjef::Logger::Logger
Logger(Logger &&source) noexcept
Definition: sjef.h:47
sjef::Logger::Logger
Logger(const Logger &source)
Definition: sjef.h:45
sjef::Project::input_hash
size_t input_hash() const
Construct a hash that is unique to the contents of the input file and anything it references.
sjef::Logger::Levels::DETAIL
@ DETAIL
sjef::Project::filename
std::filesystem::path filename(std::string suffix="", const std::string &name="", int run=-1) const
Get the file name of the bundle, or a primary file of particular type, or a general file in the bundl...
sjef::waiting
@ waiting
Definition: sjef.h:24
sjef::Logger::Levels
Levels
Definition: sjef.h:40
sjef::Logger::set_level
void set_level(Levels level)
Definition: sjef.h:81
sjef::Project::property_names
std::vector< std::string > property_names() const
Get the names of all assigned properties.
sjef::Project::erase
static void erase(const std::filesystem::path &filename, const std::string &default_suffix="")
Erase a project from the file system, and remove it from the recent projects file.
sjef::expand_path
std::filesystem::path expand_path(const std::filesystem::path &path, const std::string &suffix="")
Edit a file path name.
sjef::Project::backend_parameter_default
std::string backend_parameter_default(const std::string &backend, const std::string &name) const
Return the default value associated with a backend run parameter.
Definition: sjef.h:586
sjef::Project::rewrite_input_file
void rewrite_input_file(const std::string &input_file_name, const std::string &old_name)
sjef::Logger::set_stream
void set_stream(std::ostream &stream)
Definition: sjef.h:82
sjef::Project::status
sjef::status status(int verbosity=0, bool cached=true) const
Obtain the status of the job started by run()
sjef::Project::import_file
bool import_file(const std::vector< std::string > &files, bool overwrite=false)
Definition: sjef.h:190
sjef::Logger::stream
std::ostream & stream() const
Definition: sjef.h:63
sjef::Project::set_current_run
void set_current_run(unsigned int run=0)
Set the focussed run directory.
sjef::Project::change_backend
void change_backend(std::string backend=std::string{""}, bool force=false)
Change the active backend.
sjef::Project::backend_get
std::string backend_get(const std::string &backend, const std::string &key) const
Obtain the value of a field in a backend.
sjef::Project::check_backend
bool check_backend(const std::string &name) const
Check whether the specification of a backend is valid.
sjef::Project::clean
void clean(bool oldOutput=true, bool output=false, bool unused=false, int keep_run_directories=0)
Remove potentially unwanted files from the project.
sjef::Project::xpath_search
std::vector< std::string > xpath_search(const std::string &xpath_query, const std::string &attribute="", int run=0) const
Simple XPath search on the xml document. For each matching node found, return a string that contains ...
sjef::Project::add_backend
void add_backend(const std::string &name, const mapstringstring_t &fields)
Introduce a new backend to the project and to the user's global backend configuration for all project...
sjef
Definition: sjef.h:18
sjef::status
status
Definition: sjef.h:24
sjef::Logger::detail
std::ostream & detail(const std::string &message="") const
Definition: sjef.h:75
sjef::Locker
A thread-safe class for an inter-thread/inter-process lock. The lock mechanism is based on a locked f...
Definition: Locker.h:28
sjef::Logger::Levels::NOTIFICATION
@ NOTIFICATION
sjef::Project::export_file
bool export_file(const std::filesystem::path &file, bool overwrite=false)
Export one or more files from the project.
sjef::Logger
Definition: sjef.h:27
sjef::Project::custom_initialisation
void custom_initialisation()
Perform any project initialisation specific to the project suffix.
sjef::Project::property_set
void property_set(const std::string &property, const std::string &value)
Set a property.
sjef::Project::input_from_output
std::string input_from_output(bool sync=true) const
If possible, construct the input embedded in the output file.
sjef::Project::backend_parameter_expand
std::string backend_parameter_expand(const std::string &backend, std::string templ="") const
Perform parameter substitution for a backend run_command template.
sjef::Project::move
bool move(const std::filesystem::path &destination_filename, bool force=false)
Move the project to another location.
sjef::Project::kill
void kill()
Kill the job started by run()
sjef::Project::wait
void wait(unsigned int maximum_microseconds=10000) const
Wait unconditionally for status() to return neither 'waiting' nor 'running'.
sjef::Logger::operator()
std::ostream & operator()(int level, const std::string &message="") const
Definition: sjef.h:64
sjef::Logger::operator()
std::ostream & operator()(const Levels level, const std::string &message="") const
Definition: sjef.h:72
sjef::Project::backend_names
std::vector< std::string > backend_names() const
Get the names of all the backend objects associated with the object.
sjef::Project::check_all_backends
bool check_all_backends() const
Check the specification of all backends for validity.
sjef::completed
@ completed
Definition: sjef.h:24
sjef::Project::name
std::string name() const
sjef::Project::set_warnings
void set_warnings(const Logger::Levels level=Logger::Levels::WARNING, std::ostream &stream=std::cerr, std::vector< std::string > preambles={"sjef:: Error: ", "sjef:: Warning: ", "sjef:: Note:"})
Set the warning/error diagnostic level and destination.
Definition: sjef.h:225
sjef::Logger::Levels::ERROR
@ ERROR
sjef::Project::run_verify
int run_verify(int run) const
Check a run exists, and resolve most recent.
sjef::unknown
@ unknown
Definition: sjef.h:24
sjef::Project::run
bool run(int verbosity=0, bool force=false, bool wait=false)
Start a sjef job.
sjef::unevaluated
@ unevaluated
Definition: sjef.h:24
sjef::Project::export_file
bool export_file(const std::vector< std::string > &files, bool overwrite=false)
Definition: sjef.h:203
sjef::Project::file_contents
std::string file_contents(const std::string &suffix="", const std::string &name="", int run=0, bool sync=true) const
Obtain the contents of a project file.
sjef::Logger::Levels::QUIET
@ QUIET
sjef::Project::run_directory_next
int run_directory_next() const
Obtain the sequence number of the next run directory to be created.
sjef::Logger::Levels::WARNING
@ WARNING
sjef::operator<<
std::ostream & operator<<(const Logger &l, Arg arg)
Definition: sjef.h:86
sjef::killed
@ killed
Definition: sjef.h:24
sjef::Logger::~Logger
~Logger()=default
sjef::Project::status_message
std::string status_message(int verbosity=0) const
sjef::Project::set_verbosity
void set_verbosity(int verbosity, std::ostream &stream=std::cout)
Definition: sjef.h:229
sjef::Project::recent
static std::string recent(const std::string &suffix, int number=1)
Look for a project by rank in the user-global recent project list.
sjef::Project::import_file
bool import_file(const std::filesystem::path &file, bool overwrite=false)
Import one or more files into the project. In the case of a .xml output file, if the corresponding in...
sjef::Project::backend_parameters
mapstringstring_t backend_parameters(const std::string &backend, bool doc=false) const
Get all of the parameters referenced in the run_command of a backend.
sjef::Project::copy
bool copy(const std::filesystem::path &destination_filename, bool force=false, bool keep_hash=false, bool slave=false, int keep_run_directories=std::numeric_limits< int >::max())
Copy the project to another location.
sjef::Project::Project
Project(const std::filesystem::path &filename, bool construct=true, const std::string &default_suffix="", const mapstringstring_t &suffixes={{"inp", "inp"}, {"out", "out"}, {"xml", "xml"}}, bool monitor=true, bool sync=true, const Project *masterProject=nullptr)
Construct, or attach to, a Molpro project bundle.
sjef::Project::property_get
std::string property_get(const std::string &property) const
Get the value of a property.
sjef::Project::run_needed
bool run_needed(int verbosity=0) const
Check whether the job output is believed to be out of date with respect to the input and any other fi...
sjef::Logger::set_level
void set_level(int level)
Definition: sjef.h:80
sjef::Project::run_directory_new
int run_directory_new()
Create a new run directory. Also copy into it the input file, and any of its dependencies.
sjef::Project::current_run
unsigned int current_run() const
Get the focussed run directory.
sjef::Project::select_nodes
pugi::xpath_node_set select_nodes(const std::string &xpath_query, int run=0) const
General XPath search on the xml document. Needs the pugixml library to parse the result.
sjef::version
std::string version() noexcept
Report the software version.
sjef::Project
Definition: sjef.h:91
sjef::Project::suffix_keys
static const std::vector< std::string > suffix_keys
Definition: sjef.h:500
sjef::Logger::operator=
Logger & operator=(const Logger &source)
Definition: sjef.h:50
sjef::Logger::notify
std::ostream & notify(const std::string &message="") const
Definition: sjef.h:76
sjef::Project::run_list_t
std::set< int, std::greater< int > > run_list_t
Obtain the list of run numbers in reverse order, ie the most recent first.
Definition: sjef.h:406
sjef::Project::backends
std::map< std::string, Backend > & backends()
Definition: sjef.h:456
sjef::Project::run_directory
std::filesystem::path run_directory(int run=0) const
Obtain the path of a run directory.
sjef::Project::backend_parameter_set
void backend_parameter_set(const std::string &backend, const std::string &name, const std::string &value)
Definition: sjef.h:552
sjef::runtime_error
Definition: sjef.h:711
sjef::Logger::error
std::ostream & error(const std::string &message="") const
Definition: sjef.h:78
sjef::Project::synchronize
bool synchronize(int verbosity=0, bool nostatus=false, bool force=false) const
Synchronize the project with a cached copy belonging to a backend. name.inp, name....
sjef::Logger::Logger
Logger(std::ostream &stream, int level)
Definition: sjef.h:41
sjef::Project::backend_parameter_documentation
std::string backend_parameter_documentation(const std::string &backend, const std::string &name) const
Return the documentation associated with a backend run parameter.
Definition: sjef.h:573
sjef::Logger::operator=
Logger & operator=(Logger &&source) noexcept
Definition: sjef.h:56
pugi
Definition: sjef.h:15
sjef::Project::backend_parameter_delete
void backend_parameter_delete(const std::string &backend, const std::string &name)
Definition: sjef.h:556
sjef::check_backends
bool check_backends(const std::string &suffix)
Check whether a backend specification file is valid. Only the top-level structure of the file is chec...
sjef::Project::ensure_remote_server
void ensure_remote_server() const
sjef::Project::run
bool run(const std::string &name, int verbosity=0, bool force=false, bool wait=false)
Definition: sjef.h:241
sjef::Project::delete_backend
void delete_backend(const std::string &name)
Remove a backend from the project and from the user's global backend configuration for all projects o...
sjef::Project::backend_cache
const std::string backend_cache() const
Get the location of the backend cache.
sjef::Project::backend_parameter_get
std::string backend_parameter_get(const std::string &backend, const std::string &name) const
Definition: sjef.h:560
sjef::Project::run_delete
void run_delete(int run)
Delete a run directory.
sjef::Project::custom_run_preface
void custom_run_preface()
Before launching a job, perform any required actions specific to the project suffix.
sjef::Project::recent_find
static int recent_find(const std::string &suffix, const std::filesystem::path &filename)
Look for a project by name in the user-global recent project list.
sjef::Logger::level
int level() const
Definition: sjef.h:79
sjef::Project::xml
std::string xml(int run=0, bool sync=true) const
Get the xml output, completing any open tags if necessary.