Merge branch '14596-no-requeue'
[arvados.git] / services / crunch-dispatch-slurm / crunch-dispatch-slurm.go
index 1151bc2a6b47d1e4690dd324e703460f3c90c65b..29fad32bd150749d1e1bcb1df696359adbde0a0f 100644 (file)
@@ -229,12 +229,7 @@ func (disp *Dispatcher) checkSqueueForOrphans() {
 func (disp *Dispatcher) slurmConstraintArgs(container arvados.Container) []string {
        mem := int64(math.Ceil(float64(container.RuntimeConstraints.RAM+container.RuntimeConstraints.KeepCacheRAM+disp.ReserveExtraRAM) / float64(1048576)))
 
-       var disk int64
-       for _, m := range container.Mounts {
-               if m.Kind == "tmp" {
-                       disk += m.Capacity
-               }
-       }
+       disk := dispatchcloud.EstimateScratchSpace(&container)
        disk = int64(math.Ceil(float64(disk) / float64(1048576)))
        return []string{
                fmt.Sprintf("--mem=%d", mem),