getNumPNeeded.sh 576 Bytes
Newer Older
1
2
#!/bin/bash

iker_martin's avatar
iker_martin committed
3
# Obtains for a given file the maximum amount of processes to allocate
4
5
6
7
8
9
10
11
12
13
14
15
# Parameter 1(Optional) - Amount of executions per file. Must be a positive number
#====== Do not modify these values =======
config_file=$1
group_index=$2

resize_info=$(grep "\[resize$group_index\]" -n $config_file | cut -d ":" -f1)
first_line=$(echo $resize_info | cut -d " " -f1)
last_line=$(echo $resize_info | cut -d " " -f2)
range_lines=$(( last_line - first_line ))
numP=$(head -$last_line $config_file | tail -$range_lines | cut -d ';' -f1 | grep Procs | cut -d '=' -f2)

echo $numP