#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#*                                                                           *
#*                  This file is part of the program and library             *
#*         SCIP --- Solving Constraint Integer Programs                      *
#*                                                                           *
#*    Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB)                    *
#*                                                                           *
#*  SCIP is distributed under the terms of the ZIB Academic License.         *
#*                                                                           *
#*  You should have received a copy of the ZIB Academic License              *
#*  along with SCIP; see the file COPYING. If not email to scip@zib.de.      *
#*                                                                           *
#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

#@file   wakeup-slurm

# Makefile to wake up slurm nodes and queues.
# Usage: make --makefile=wakeup-slurm wake_M640

Nodes-M640v2=\
optc-10-1\
optc-10-2\
optc-10-3\
optc-10-4\
optc-11-1\
optc-11-2\
optc-11-3\
optc-11-4

Nodes-M640=\
optc-01-01\
optc-01-02\
optc-01-03\
optc-01-04\
optc-01-05\
optc-01-06\
optc-01-07\
optc-01-08\
optc-01-09\
optc-01-10\
optc-01-11\
optc-01-12\
optc-01-13\
optc-01-14\
optc-01-15\
optc-01-16\
optc-02-01\
optc-02-02\
optc-02-03\
optc-02-04\
optc-02-05\
optc-02-06\
optc-02-07\
optc-02-08\
optc-02-09\
optc-02-10\
optc-02-11\
optc-02-12\
optc-02-13\
optc-02-14\
optc-02-15\
optc-02-16

Nodes-M620=\
optc-03-01\
optc-03-02\
optc-03-03\
optc-03-04\
optc-03-05\
optc-03-06\
optc-03-07\
optc-03-08\
optc-03-09\
optc-03-10\
optc-03-11\
optc-03-12\
optc-03-13\
optc-03-14\
optc-03-15

Nodes-M620v2=\
optc-04-01\
optc-04-02\
optc-04-03\
optc-04-04\
optc-04-05\
optc-04-06\
optc-04-07\
optc-04-08\
optc-04-09\
optc-04-10\
optc-04-11\
optc-04-12\
optc-04-13\
optc-04-14\
optc-04-15\
optc-04-16

Nodes-M620v3=\
optc-05-01\
optc-05-02\
optc-05-03\
optc-05-04\
optc-05-05\
optc-05-06\
optc-05-07\
optc-05-08\
optc-05-09\
optc-05-10\
optc-05-11\
optc-05-12\
optc-05-13\
optc-05-14\
optc-05-15\
optc-05-16\
optc-06-01\
optc-06-02\
optc-06-03\
optc-06-04\
optc-06-05\
optc-06-06\
optc-06-07\
optc-06-08\
optc-06-09\
optc-06-10\
optc-06-11\
optc-06-12\
optc-06-13\
optc-06-14\
optc-06-15\
optc-06-16

Nodes-M630=\
optc-07-01\
optc-07-02\
optc-07-03\
optc-07-04\
optc-07-05\
optc-07-06\
optc-07-07\
optc-07-08\
optc-07-09\
optc-07-10\
optc-07-11\
optc-07-12\
optc-07-13\
optc-07-14\
optc-07-15\
optc-07-16

Nodes-M630v2=\
optc-08-01\
optc-08-02\
optc-08-03\
optc-08-04\
optc-08-05\
optc-08-06\
optc-08-07\
optc-08-08\
optc-08-09\
optc-08-10\
optc-08-11\
optc-08-12\
optc-08-13\
optc-08-14\
optc-08-15\
optc-08-16

all = $(Nodes-M620) $(Nodes-M620v2) $(Nodes-M620v3) $(Nodes-M630) $(Nodes-M630v2) $(Nodes-M640) $(Nodes-M640v2)


$(all):
	@SINFO=`/usr/bin/sinfo -h -o "%n %T" -n $@ | grep '~' | wc -l`; \
	if [ $$SINFO -eq 1 ]; then \
		echo wake up $@; \
		srun -p opt -w $@ --exclusive sleep 1 & \
	else \
		/usr/bin/sinfo -h -o "%n %T" -n $@; \
        fi


wake_M620: $(Nodes-M620)
wake_M620v2: $(Nodes-M620v2)
wake_M620v3: $(Nodes-M620v3)
wake_M620v4: $(Nodes-M620v4)
wake_M630: $(Nodes-M630)
wake_M630v2: $(Nodes-M630v2)
wake_M640: $(Nodes-M640)
wake_M640v2: $(Nodes-M640v2)

wake_opt: $(Nodes-M620) $(Nodes-M620v2) $(Nodes-M620v3) $(Nodes-M630) $(Nodes-M630v2) $(Nodes-M640) $(Nodes-M640v2)
