15 #include "../logging.h" 
   33         std::ofstream wrapper(
".wrapper_" + std::to_string(ID));
 
   34         wrapper << 
"#!/bin/sh" << std::endl;
 
   35         wrapper << 
"ulimit -S -t " << std::chrono::seconds(
settings_benchmarks().limit_time).count() << std::endl;
 
   37         wrapper << 
"date +\"Start: %s%3N\"" << std::endl;
 
   39         wrapper << 
"date +\"End: %s%3N\"" << std::endl;
 
   42         std::ofstream out(
".jobs." + std::to_string(ID));
 
   43         out << 
"executable = .wrapper_" << ID << std::endl;
 
   44         out << 
"output = out/out." << ID << 
".$(cluster).$(process)" << std::endl;
 
   45         out << 
"error = out/err." << ID << 
".$(cluster).$(process)" << std::endl;
 
   46         out << 
"log = out/log." << ID << std::endl;
 
   47         out << 
"periodic_hold = (time() - JobCurrentStartExecutingDate) > " << std::chrono::seconds(
settings_benchmarks().limit_time).count() << std::endl;
 
   49         for (
const auto& file: b) {
 
   51             out << 
"transfer_input_files = " << file.native() << 
", " << tool.
binary().native() << std::endl;
 
   52             out << 
"arguments = " << file.filename().native() << std::endl;
 
   53             out << 
"queue" << std::endl;
 
   56         return ".jobs." + std::to_string(ID);
 
   61         typedef fs::directory_iterator dirIt;
 
   63         for (dirIt it(
"out/"), end; it != end; ++it) {
 
   64             std::string name = it->path().native();
 
   65             if (name.find(
"out/out." + std::to_string(ID)) != std::string::npos) {
 
   72     void runAndWait(std::size_t ID, 
const std::string& submitFile, std::atomic<bool>& it) {
 
   74         std::system((
"condor_submit " + submitFile).c_str());
 
   76         std::system((
"condor_wait out/log." + std::to_string(ID)).c_str());
 
   77         BENCHMAX_LOG_INFO(
"benchmax.condor", 
"Collecting statistics for batch " << ID << 
"...");
 
#define BENCHMAX_LOG_INFO(channel, msg)
Log informational messages.
Base class for all backends.
A set of benchmarks from some common base directory.
Backend for the HTCondor batch system.
void collectResults(std::size_t ID)
Collect job results for the given id.
void run(const Jobs &, bool)
Run all tools on all benchmarks.
virtual void execute(const Tool *, const fs::path &)
No-op version of execute.
void runAndWait(std::size_t ID, const std::string &submitFile, std::atomic< bool > &it)
Run the given job and wait for its results.
std::string generateSubmitFile(std::size_t ID, const Tool &tool, const BenchmarkSet &b)
Generate a submit file for the given job.
std::list< std::atomic< bool > > processes
List of processes that are currently running.
Represents a set of jobs, constructed as the cartesian product of a set of tools and a set of benchma...
const auto & settings_benchmarks()
Return the benchmark settings.