Skip to content

Commit

Permalink
Re added the batch size argument
Browse files Browse the repository at this point in the history
In preparation for the use of the set generation tactic I mentioned
for better load balancing in the children
  • Loading branch information
Sir-NoChill committed Sep 9, 2024
1 parent 6594a08 commit 2e44d29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/config/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Config {
// Config int getters.
int64_t getTimeout() const { return timeout; }
int64_t getNumThreads() const { return numThreads; }
int8_t getBatchSize() const { return batchSize; }

// Initialisation verification.
bool isInitialised() const { return initialised; }
Expand Down Expand Up @@ -88,6 +89,7 @@ class Config {
// Number of threads on which to run tests
int64_t numThreads;
// Number of tests for each thread to grab on each run
int8_t batchSize;

// Is the config initialised or not and an appropriate error code. This
// could be due to asking for help or a missing config file.
Expand Down
3 changes: 2 additions & 1 deletion src/config/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using JSON = nlohmann::json;

namespace tester {

Config::Config(int argc, char** argv) : timeout(2l), numThreads(1) {
Config::Config(int argc, char** argv) : timeout(2l), numThreads(1), batchSize(5) {

CLI::App app{"CMPUT 415 testing utility"};

Expand All @@ -40,6 +40,7 @@ Config::Config(int argc, char** argv) : timeout(2l), numThreads(1) {

// multithreading options
app.add_option("-j", numThreads, "The number of threads on which to execute tests.");
app.add_option("--batch-size", batchSize, "(ADVANCED) the number of tests for each thread to grab per iteration. (default = 5)");

// Enforce that if a grade path is supplied, then a log file should be as well and vice versa
gradeOpt->needs(solutionFailureLogOpt);
Expand Down

0 comments on commit 2e44d29

Please sign in to comment.