Page History

Turn Off History

How to match only Multicore jobs in recently drained slots

Since the purpose of the defrag daemon is to drain jobs on a p-slot so multi-core jobs can begin to match, it would be best to implement a policy where recently drained p-slots can insist on matching only multicore jobs for a period of time.

Unfortunately, there is no attribute that uniquely identifies a recently drained slot - but there are two candidate attributes that come close with some caveats.

So a policy that won't match non-multicore jobs for 2 negotiation cycles on recently drained slots could be:

NEGOTIATOR_INFORM_STARTD = false
IsntUnmatchedPSlot = PartitionableSlot=!=true || State=="Matched"
IsMulticore = RequestCpus >= IfThenElse(Cpus<4,1,4)
OnlyMulticoreInterval = $(NEGOTIATOR_INTERVAL:60)*2
StateTimer = (time() - EnteredCurrentState)

OnlyMulticoreJobsAfterDrain = $(IsntUnmatchedPSlot) || $(IsMulticore) || $(StateTimer) > $INT(OnlyMulticoreInterval)

START = $(START) && ( $(OnlyMulticoreJobsAfterDrain) )

The policy says that for 2 negotiation cycles after the STARTD starts up or leaves draining state, the slot should only match jobs that want at least 4 cores. Once the slot has less than 4 available Cpus remaining, it will match single-core jobs. We only want this portion of the START expression to be evaluated by the Negotiator, which is what the $(IsntUnmatchedPSlot) sub-expression does.

An alternate policy using ExpectedMachineGracefulDrainingCompletion would be:

IsMulticore = RequestCpus >= IfThenElse(Cpus<4,1,4)
OnlyMulticoreInterval = $(NEGOTIATOR_INTERVAL:60)*2
DrainStateTimer = (time() - ExpectedMachineGracefulDrainingCompletion)

OnlyMulticoreJobsAfterDrain = PartitionableSlot=!=true || $(IsMulticore) || $(DrainStateTimer) > $INT(OnlyMulticoreInterval) || $(DrainStateTimer) < 0

START = $(START) && ( $(OnlyMulticoreJobsAfterDrain) )

This policy will match single-core jobs only very slowly once the supply of multi-core jobs runs out, and it requires that the p-slot be fully drained in order to trigger the preference for multicore jobs. The first policy only requires that the drain state be canceled before the preference triggers.