Skip to content

Commit

Permalink
Remove redundant submitHQJob function
Browse files Browse the repository at this point in the history
and debug
  • Loading branch information
LennoxLiu committed Apr 7, 2024
1 parent 2276373 commit 775373c
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions hpc/LoadBalancer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <memory>
#include <filesystem>
#include "../lib/umbridge.h"
#include <unistd.h>

// run and get the result of command
std::string getCommandOutput(const std::string command)
Expand Down Expand Up @@ -111,29 +112,6 @@ bool waitForHQJobState(const std::string &job_id, const std::string &state = "CO
std::mutex job_submission_mutex;
int hq_submit_delay_ms = 0;

std::string submitHQJob()
{
std::string hq_command = "hq submit --output-mode=quiet hq_scripts/job.sh";

std::string job_id = getCommandOutput(hq_command);

// Delete the line break
if (!job_id.empty())
job_id.pop_back();

std::cout << "Waiting for job " << job_id << " to start." << std::endl;

// Wait for the HQ Job to start
waitForHQJobState(job_id, "RUNNING");

// Also wait until job is running and url file is written
waitForFile("./urls/url-" + job_id + ".txt", job_id);

std::cout << "Job " << job_id << " started." << std::endl;

return job_id;
}

class HyperQueueJob
{
public:
Expand Down Expand Up @@ -210,7 +188,7 @@ class HyperQueueJob
waitForHQJobState(job_id, "RUNNING");

// Also wait until job is running and url file is written
waitForFile("./urls/url-" + job_id + ".txt");
waitForFile("./urls/url-" + job_id + ".txt", job_id);

std::cout << "Job " << job_id << " started." << std::endl;

Expand Down

0 comments on commit 775373c

Please sign in to comment.