Merge branch 'wtsi/13093-crunch-dispatch-slurm-add-mem' refs #13093
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Fri, 23 Feb 2018 18:26:59 +0000 (13:26 -0500)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Fri, 23 Feb 2018 18:27:35 +0000 (13:27 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
services/crunch-dispatch-slurm/usage.go

index 0879de20f9de4b884e38612f428cfe92b37bfe63..f77023697e0f54ccaa12e2e7bc1bf3dd39f71509 100644 (file)
@@ -47,6 +47,10 @@ type Dispatcher struct {
        // Example: []string{"crunch-run", "--cgroup-parent-subsystem=memory"}
        CrunchRunCommand []string
 
+       // Extra RAM to reserve (in Bytes) for SLURM job, in addition
+       // to the amount specified in the container's RuntimeConstraints
+       ReserveExtraRAM int64
+
        // Minimum time between two attempts to run the same container
        MinRetryPeriod arvados.Duration
 }
@@ -206,7 +210,7 @@ func (disp *Dispatcher) niceness(priority int) int {
 }
 
 func (disp *Dispatcher) sbatchArgs(container arvados.Container) ([]string, error) {
-       mem := int64(math.Ceil(float64(container.RuntimeConstraints.RAM+container.RuntimeConstraints.KeepCacheRAM) / float64(1048576)))
+       mem := int64(math.Ceil(float64(container.RuntimeConstraints.RAM+container.RuntimeConstraints.KeepCacheRAM+disp.ReserveExtraRAM) / float64(1048576)))
 
        var disk int64
        for _, m := range container.Mounts {
index f64c5023952b42d9ed7e4483941b6dfd561f98a1..032d86284d5e0a9fc8a3d712a0283597ec29d765 100644 (file)
@@ -20,7 +20,8 @@ var exampleConfigFile = []byte(`
        },
        "CrunchRunCommand": ["crunch-run"],
        "PollPeriod": "10s",
-       "SbatchArguments": ["--partition=foo", "--exclude=node13"]
+       "SbatchArguments": ["--partition=foo", "--exclude=node13"],
+       "ReserveExtraRAM": 268435456,
     }`)
 
 func usage(fs *flag.FlagSet) {