Skip to content

Commit

Permalink
HPC: Explicitly use HQ from same directory
Browse files Browse the repository at this point in the history
  • Loading branch information
linusseelinger committed May 28, 2024
1 parent fec642b commit 3d999f0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions hpc/LoadBalancer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ void clear_url(std::string directory) {
}

void launch_hq_with_alloc_queue() {
std::system("hq server stop &> /dev/null");
std::system("./hq server stop &> /dev/null");

std::system("hq server start &");
std::system("./hq server start &");
sleep(1); // Workaround: give the HQ server enough time to start.

// Create HQ allocation queue
Expand Down
6 changes: 3 additions & 3 deletions hpc/LoadBalancer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class HyperQueueJob
~HyperQueueJob()
{
// Cancel the SLURM job
std::system(("hq job cancel " + job_id).c_str());
std::system(("./hq job cancel " + job_id).c_str());

// Delete the url text file
std::system(("rm ./urls/url-" + job_id + ".txt").c_str());
Expand All @@ -113,7 +113,7 @@ class HyperQueueJob
const std::filesystem::path submission_script_generic("job.sh");
const std::filesystem::path submission_script_model_specific("job_" + model_name + ".sh");

std::string hq_command = "hq submit --output-mode=quiet ";
std::string hq_command = "./hq submit --output-mode=quiet ";
hq_command += "--priority=" + std::to_string(job_count) + " ";
if (std::filesystem::exists(submission_script_dir / submission_script_model_specific) && !force_default_submission_script)
{
Expand Down Expand Up @@ -154,7 +154,7 @@ class HyperQueueJob
// state = ["WAITING", "RUNNING", "FINISHED", "CANCELED"]
bool waitForHQJobState(const std::string &job_id, const std::string &state)
{
const std::string command = "hq job info " + job_id + " | grep State | awk '{print $4}'";
const std::string command = "./hq job info " + job_id + " | grep State | awk '{print $4}'";
// std::cout << "Checking runtime: " << command << std::endl;
std::string job_status;

Expand Down
6 changes: 3 additions & 3 deletions hpc/hq_scripts/allocation_queue.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#! /bin/bash

# Note: For runs on systems without SLURM, replace the slurm allocator by
# hq worker start &
# ./hq worker start &


hq alloc add slurm --time-limit 10m \
./hq alloc add slurm --time-limit 10m \
--idle-timeout 3m \
--backlog 1 \
--workers-per-alloc 1 \
--max-worker-count 5 \
--cpus=1 \
-- -p "devel" # Add any neccessary SLURM arguments
# Any parameters after -- will be passed directly to sbatch (e.g. credentials, partition, mem, etc.)
# Any parameters after -- will be passed directly to sbatch (e.g. credentials, partition, etc.)

0 comments on commit 3d999f0

Please sign in to comment.