-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqalloc
executable file
·37 lines (27 loc) · 1.04 KB
/
qalloc
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
#!/bin/bash
echo "Welcome to the interactive slurm job submission script"
# Set default values
cores=2
mem="10G"
partition="all"
time="02:59:00"
# Prompting user for options
read -p "Enter the number of cores you need (default is $cores): " user_cores
cores=${user_cores:-$cores}
read -p "Enter the memory required for the job (default is $mem): " user_mem
mem=${user_mem:-$mem}
read -p "Enter the partition to run the job in (default is $partition): " user_partition
partition=${user_partition:-$partition}
read -p "Enter the maximum time needed for the job (format: days-hours:minutes:seconds, default is $time): " user_time
time=${user_time:-$time}
# Constructing the salloc command
salloc_cmd="salloc -c $cores --mem=$mem --partition=$partition --time=$time"
echo "Your salloc command will be: $salloc_cmd"
# Confirming with the user before executing the command
read -p "Do you want to run this command now? (y/n): " confirm
if [ "$confirm" == "y" ]; then
echo "Executing $salloc_cmd"
$salloc_cmd
else
echo "Command execution aborted."
fi