Skip to content
Snippets Groups Projects
Commit d447d10a authored by Matthias Schnepf's avatar Matthias Schnepf
Browse files

Get resources from environment variables

parent b615b7e4
Branches
No related tags found
No related merge requests found
......@@ -43,11 +43,16 @@ TCP_KEEPALIVE_INTERVAL = 4 * $(MINUTE)
# Wall-time
WalltimeDefault = 86400
# Read/set MachineMaxWalltime & MachineStarttime (set by cloud-init)
include command into $(ETC)/walltime.cfg : python3 $(ETC)/meta_walltime_generic.py
MachineWalltime = $(MachineMaxWalltime:$(WalltimeDefault))
MaxShutdownTime = $(MachineStarttime) + $(MachineWalltime)
MachineWalltimeDefault = 86400
MachineWalltime = \
ifThenElse( IsUndefined($ENV(SLURM_Walltime)), \
$(MachineWalltimeDefault) , \
($ENV(SLURM_Walltime) * $(MINUTE)) \
)
MaxShutdownTime = $ENV(SLURM_Starttime) + $(MachineWalltime)
MachineWalltime = $(MachineWalltime:$(WalltimeDefault))
STARTD.MaxJobRetirementTime = $(MaxShutdownTime) - $(JobStart:0) - 3 * $(MINUTE)
TimeToLive = $(MaxShutdownTime) - time()
# Auto Shutdown
# Shutting down MASTER will trigger shutdown to all other daemons
......@@ -57,7 +62,20 @@ MASTER.DAEMON_SHUTDOWN = ( TimeToLive <= 10 * $(MINUTE) )
MASTER.DAEMON_SHUTDOWN_FAST = ( TimeToLive <= 3 * $(MINUTE) )
# Set number of CPUs
NUM_CPUS = 1
DEFAULT_NUM_CPUS = 20
ifThenElse( IsUndefined($ENV(SLURM_CPUS_ON_NODE)), \
NUM_CPUS = $ENV(SLURM_CPUS_ON_NODE), \
NUM_CPUS = $(DEFAULT_NUM_CPUS) \
)
DEFAULT_Memory = 12000
ifThenElse( IsUndefined($ENV(SLURM_MEM_ON_NODE)), \
MEMORY = $ENV(SLURM_MEM_ON_NODE), \
MEMORY = $(DEFAULT_Memory) \
)
TardisDroneUuid = "$ENV(TardisDroneUuid)"
STARTD_NAME = $ENV(TardisDroneUuid)
# Machine/Job environment
......@@ -72,6 +90,7 @@ include command into $(ETC)/environment.cfg : $(ETC)/get_machine_env.sh
# Cut off by (START = FALSE) if RequestWalltime > TimeToLive.
# Thus we can safely set it to maximum in this case to prevent preemption
###
RankJobWtime = \
ifThenElse( isUndefined(TARGET.RequestWalltime), \
0, \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment