[ARVADOS] updated: 1.1.4-264-gd778005

Git user git at public.curoverse.com
Fri May 11 15:39:23 EDT 2018


Summary of changes:
 .../crunch-dispatch-slurm/crunch-dispatch-slurm.go | 25 +++++++++++-----------
 1 file changed, 13 insertions(+), 12 deletions(-)

       via  d77800531696ce64a2d83c7203f3ba0334328572 (commit)
      from  8fc8aa8179f88694ccbab9a23fdc7d2e8988ce64 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit d77800531696ce64a2d83c7203f3ba0334328572
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Fri May 11 15:38:51 2018 -0400

    13473: Tidy up slurmConstraintArgs func.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
index e3801df..9e3baab 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
@@ -202,7 +202,7 @@ func (disp *Dispatcher) checkSqueueForOrphans() {
 	}
 }
 
-func (disp *Dispatcher) sbatchArgs(container arvados.Container) ([]string, error) {
+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
@@ -212,32 +212,33 @@ func (disp *Dispatcher) sbatchArgs(container arvados.Container) ([]string, error
 		}
 	}
 	disk = int64(math.Ceil(float64(disk) / float64(1048576)))
-
-	var args []string
-	args = append(args, disp.SbatchArguments...)
-	args = append(args,
-		fmt.Sprintf("--job-name=%s", container.UUID),
-		fmt.Sprintf("--nice=%d", initialNiceValue))
-
-	constraintArgs := []string{
+	return []string{
 		fmt.Sprintf("--mem=%d", mem),
 		fmt.Sprintf("--cpus-per-task=%d", container.RuntimeConstraints.VCPUs),
 		fmt.Sprintf("--tmp=%d", disk),
 	}
+}
+
+func (disp *Dispatcher) sbatchArgs(container arvados.Container) ([]string, error) {
+	var args []string
+	args = append(args, disp.SbatchArguments...)
+	args = append(args, "--job-name="+container.UUID, fmt.Sprintf("--nice=%d", initialNiceValue))
+
 	if disp.cluster == nil {
 		// no instance types configured
+		args = append(args, disp.slurmConstraintArgs(container)...)
 	} else if it, err := dispatchcloud.ChooseInstanceType(disp.cluster, &container); err == dispatchcloud.ErrInstanceTypesNotConfigured {
 		// ditto
+		args = append(args, disp.slurmConstraintArgs(container)...)
 	} else if err != nil {
 		return nil, err
 	} else {
 		// use instancetype constraint instead of slurm mem/cpu/tmp specs
-		constraintArgs = []string{"--constraint=instancetype=" + it.Name}
+		args = append(args, "--constraint=instancetype="+it.Name)
 	}
-	args = append(args, constraintArgs...)
 
 	if len(container.SchedulingParameters.Partitions) > 0 {
-		args = append(args, fmt.Sprintf("--partition=%s", strings.Join(container.SchedulingParameters.Partitions, ",")))
+		args = append(args, "--partition="+strings.Join(container.SchedulingParameters.Partitions, ","))
 	}
 
 	return args, nil

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list