forked from draskot/Vini
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetermine_SLURM_environment
executable file
·41 lines (35 loc) · 1.89 KB
/
determine_SLURM_environment
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
if [[ -e $WORKDIR/cpu_partition ]] && [[ -e $WORKDIR/gpu_partition ]] && [[ -e $WORKDIR/largemem_partition ]]
then
cpu_partition_name=`cat $WORKDIR/cpu_partition`
echo "Vini will use ${cpu_partition_name} partition for CPU jobs."
gpu_partition_name=`cat $WORKDIR/gpu_partition`
echo "Vini will use ${gpu_partition_name} partition for GPU jobs."
largemem_partition_name=`cat $WORKDIR/largemem_partition`
echo "Vini will use ${largemem_partition_name} partition for large memory (>512GB) jobs."
read -p "accept this partition setup (y/n)?" accept
if [ $accept != y ]
then
echo "You will need to setup partitions now."
echo "Available queues are:"
sinfo -s
read -p "Enter the name of partition with CPU nodes:" cpu_partition_name
read -p "Enter the name of partition with GPU nodes:" gpu_partition_name
read -p "Enter the name of partition with large memory nodes:" largemem_partition_name
echo ${cpu_partition_name} > $WORKDIR/cpu_partition
echo ${gpu_partition_name} > $WORKDIR/gpu_partition
echo ${largemem_partition_name} > $WORKDIR/largemem_partition
fi
else
echo "You will need to setup partitions now."
echo "Available queues are:"
sinfo -s
read -p "Enter the name of partition with CPU nodes:" cpu_partition_name
read -p "Enter the name of partition with GPU nodes:" gpu_partition_name
read -p "Enter the name of partition with large memory nodes:" largemem_partition_name
echo ${cpu_partition_name} > $WORKDIR/cpu_partition
echo ${gpu_partition_name} > $WORKDIR/gpu_partition
echo ${largemem_partition_name} > $WORKDIR/largemem_partition
fi
echo ${cpu_partition_name} > $WORKDIR/${cpu_partition_name}_partition
echo ${gpu_partition_name} > $WORKDIR/${gpu_partition_name}_partition
echo ${largemem_partition_name} > $WORKDIR/${largemem_partition_name}_partition