Commit fead6df4 authored by Jens Korinth's avatar Jens Korinth
Browse files

SLURM: add comment to jobs containing the composition

parent cd1ac9ed
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#SBATCH --mem-per-cpu=@@MEM_PER_CPU@@ #SBATCH --mem-per-cpu=@@MEM_PER_CPU@@
#SBATCH -n @@CPUS@@ #SBATCH -n @@CPUS@@
#SBATCH -t @@TIMELIMIT@@ #SBATCH -t @@TIMELIMIT@@
#SBATCh --comment="@@COMMENT@@"
export TAPASCO_HOME=@@TAPASCO_HOME@@ export TAPASCO_HOME=@@TAPASCO_HOME@@
source ~/vivado.sh source ~/vivado.sh
......
...@@ -29,7 +29,9 @@ final object Slurm extends Publisher { ...@@ -29,7 +29,9 @@ final object Slurm extends Publisher {
/** Time limit (in hours). */ /** Time limit (in hours). */
maxHours: Int, maxHours: Int,
/** Sequence of commands to execute (bash). */ /** Sequence of commands to execute (bash). */
commands: Seq[String] commands: Seq[String],
/** Optional comment. */
comment: Option[String] = None
) )
/** Exception class for negative SLURM responses. */ /** Exception class for negative SLURM responses. */
...@@ -91,6 +93,7 @@ final object Slurm extends Publisher { ...@@ -91,6 +93,7 @@ final object Slurm extends Publisher {
jobScript("TIMELIMIT") = "%02d:00:00".format(job.maxHours) jobScript("TIMELIMIT") = "%02d:00:00".format(job.maxHours)
jobScript("TAPASCO_HOME") = FileAssetManager.TAPASCO_HOME.toString jobScript("TAPASCO_HOME") = FileAssetManager.TAPASCO_HOME.toString
jobScript("COMMANDS") = job.commands mkString "\n" jobScript("COMMANDS") = job.commands mkString "\n"
jobScript("COMMENT") = job.comment getOrElse ""
// create parent directory // create parent directory
Files.createDirectories(file.getParent()) Files.createDirectories(file.getParent())
// write file // write file
......
...@@ -89,7 +89,8 @@ class ComposeTask(composition: Composition, ...@@ -89,7 +89,8 @@ class ComposeTask(composition: Composition,
errorLog = _errorLogFile.toString, errorLog = _errorLogFile.toString,
consumer = this, consumer = this,
maxHours = ComposeTask.MAX_COMPOSE_HOURS, maxHours = ComposeTask.MAX_COMPOSE_HOURS,
commands = Seq("tapasco --configFile %s".format(cfgFile.toString)) commands = Seq("tapasco --configFile %s".format(cfgFile.toString)),
comment = Some("%s".format(composition.composition map (ce => "%s % d".format(ce.kernel, ce.count)) mkString ", "))
) )
// generate non-SLURM config with single job // generate non-SLURM config with single job
val newCfg = cfg val newCfg = cfg
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment