Commit 64d9aa89 authored by Jens Korinth's avatar Jens Korinth

Closes #16 - Rename Composition Directories

* changed dir pattern, example: arraysum__12___counter__1--90.0
* much better readability, also works for names ending in a number
* may be too long; but tests were so far successful
parent 40ec9b94
......@@ -22,6 +22,7 @@
* @authors J. Korinth, TU Darmstadt (jk@esa.cs.tu-darmstadt.de)
**/
package de.tu_darmstadt.cs.esa.tapasco.base
import de.tu_darmstadt.cs.esa.tapasco.dse._
import de.tu_darmstadt.cs.esa.tapasco.jobs._
import java.nio.file._
import builder._
......@@ -46,13 +47,27 @@ trait Configuration {
def slurm: Boolean
def slurm(enabled: Boolean): Configuration
/** Returns the default output directory for the given kernel and target. */
def outputDir(kernel: Kernel, target: Target): Path =
coreDir.resolve(kernel.name.toString).resolve(target.ad.name).resolve(target.pd.name)
def outputDir(composition: Composition, target: Target, freq: Double): Path =
compositionDir.resolve(composition.id + "--" + ("%2.3f" format freq))
.resolve(target.ad.name).resolve(target.pd.name)
/** Returns the default output directory for the given composition, target and frequency.
*
* Pattern is currently: `[KERNELNAME]_[COUNT] (___[KERNELNAME]_[COUNT])*--[FREQ]`
* where `[KERNELNAME]` is the kernel name with all spaces replaced by '_'.
* _Example_: `arrayinit_12__12___counter_3--90.0`
*/
def outputDir(composition: Composition, target: Target, freq: Heuristics.Frequency): Path =
compositionDir.resolve("%s--%3.1f".format(
(composition.composition map (ce => "%s__%d".format(ce.kernel, ce.count))) mkString "___",
freq).replaceAll(" ", "_")
).resolve(target.ad.name).resolve(target.pd.name)
/** Returns the default output directory for the given core and target. */
def outputDir(core: Core, target: Target): Path =
coreDir.resolve(core.name.toString).resolve(target.ad.name).resolve(target.pd.name)
/** Returns the default output directory for the given core/kernel name and target. */
def outputDir(name: String, target: Target): Path =
coreDir.resolve(name).resolve(target.ad.name).resolve(target.pd.name)
}
......
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