Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pysqa/ext/modular.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ def __init__(self, config, directory="~/.queues", execute_command=execute_comman
}
for v in self._queue_to_cluster_dict.values():
if v not in self._config["cluster"]:
raise ValueError()
raise ValueError(
"The cluster "
+ v
+ " was not found in the list of clusters "
+ str(list(self._config["cluster"].keys()))
)

def submit_job(
self,
Expand Down
12 changes: 10 additions & 2 deletions pysqa/queueadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ def __init__(self, directory="~/.queues", execute_command=execute_command):
}
primary_queue = config["cluster_primary"]
else:
raise ValueError
raise ValueError(
"Neither a queue.yaml file nor a clusters.yaml file were found in "
+ directory
)
self._adapter = self._queue_dict[primary_queue]

def list_clusters(self):
Expand Down Expand Up @@ -321,4 +324,9 @@ def set_queue_adapter(config, directory, execute_command=execute_command):
config=config, directory=directory, execute_command=execute_command
)
else:
raise ValueError
raise ValueError(
"The queue_type "
+ config["queue_type"]
+ " is not found in the list of supported queue types "
+ str(["SGE", "TORQUE", "SLURM", "LSF", "MOAB", "FLUX", "GENT", "REMOTE"])
)
16 changes: 14 additions & 2 deletions pysqa/utils/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ def __init__(self, config, directory="~/.queues", execute_command=execute_comman
class_name = "FluxCommands"
module_name = "pysqa.wrapper.flux"
else:
raise ValueError()
raise ValueError(
"The queue_type "
+ self._config["queue_type"]
+ " is not found in the list of supported queue types "
+ str(
["SGE", "TORQUE", "SLURM", "LSF", "MOAB", "FLUX", "GENT", "REMOTE"]
)
)
if self._config["queue_type"] != "REMOTE":
self._commands = getattr(importlib.import_module(module_name), class_name)()
self._queues = Queues(self.queue_list)
Expand Down Expand Up @@ -391,7 +398,12 @@ def _job_submission_template(
queue = self._config["queue_primary"]
self._value_error_if_none(value=command)
if queue not in self.queue_list:
raise ValueError()
raise ValueError(
"The queue "
+ queue
+ " was not found in the list of queues: "
+ str(self.queue_list)
)
active_queue = self._config["queues"][queue]
cores, run_time_max, memory_max = self.check_queue_parameters(
queue=None,
Expand Down