[9846] | 1 | #!/bin/bash |
---|
| 2 | set -u |
---|
[9851] | 3 | #set -xv |
---|
[9846] | 4 | |
---|
[9851] | 5 | resolution=${1:?"you must provide the resolution: 1 025 or 12"} |
---|
[9857] | 6 | mincore=${2:-1} # minimum number of core to be tested |
---|
[9869] | 7 | maxcore=${3:-0} # maximum number of core to be tested |
---|
[9851] | 8 | |
---|
[9846] | 9 | machine=$( hostname | sed -e "s/[0-9]*//g" ) |
---|
| 10 | case $machine in |
---|
[11536] | 11 | "jean-zay") ncore_node=40 ;; |
---|
[9848] | 12 | "beaufixlogin") ncore_node=40 ;; |
---|
[9851] | 13 | "curie") ncore_node=16 ;; |
---|
| 14 | "irene") ncore_node=48 ;; |
---|
[9857] | 15 | *) echo "you must add your machine \"$machine\" with its number of cores per node" ; exit 1 ;; |
---|
[9846] | 16 | esac |
---|
| 17 | |
---|
[9857] | 18 | [ $mincore -eq 1 ] && targetnb=$ncore_node || targetnb=$mincore |
---|
| 19 | # |
---|
| 20 | # build the list of experiences: |
---|
| 21 | # must be a multiple of ncore_node and as close as possible of the targeted number of core |
---|
| 22 | # |
---|
| 23 | n1=0 |
---|
| 24 | list="" |
---|
[9846] | 25 | |
---|
[9869] | 26 | # Prepare gnuplot data file |
---|
| 27 | dateref=$( date "+%Y%m%d-%Hh%Mm%Ss" ) |
---|
| 28 | echo "# nb_proc jpi jpj" > gnuplot_tbc_${resolution}_${dateref}.dat |
---|
[9857] | 29 | nbl=$( cat best_jpni_jpnj_eorca${resolution} | wc -l ) |
---|
| 30 | for ll in $( seq 1 $nbl ) |
---|
[9846] | 31 | do |
---|
[9857] | 32 | line=$( sed -n ${ll}p best_jpni_jpnj_eorca${resolution} ) # for each line |
---|
| 33 | nn=$( echo $line | sed -e "s/.*nb_cores \([0-9]*\).*/\1/" ) # get the number of core |
---|
[9869] | 34 | [ $maxcore -gt 1 -a $nn -gt $maxcore ] && break # if below $maxcore (if specified) |
---|
| 35 | if [ $(( $nn % $ncore_node )) -eq 0 ] # if it is a multiple of $ncore_node |
---|
| 36 | then |
---|
| 37 | if [ $nn -lt $targetnb ] |
---|
| 38 | then |
---|
| 39 | n1=$nn # store the number of core |
---|
| 40 | line1=$line # store the line |
---|
| 41 | else |
---|
| 42 | [ $(( $targetnb - $n1 )) -le $(( $nn -$targetnb )) ] && line=$line1 # keep the previous line |
---|
| 43 | echo $line |
---|
| 44 | nb=$( echo $line | sed -e "s/[^(]*( \([0-9]*\) x \([0-9]*\) .*/\1*\2/" ) # get jpni*jpnj |
---|
| 45 | list="${list} ${nb}" |
---|
| 46 | targetnb=$(( $targetnb * 2 )) |
---|
| 47 | subsize=$( echo $line | awk {'printf "%d %d", $11, $13'}) |
---|
| 48 | corenb=$( echo $line | awk {'printf "%d", $2'}) |
---|
| 49 | echo "$corenb $subsize" >> gnuplot_tbc_${resolution}.dat |
---|
| 50 | fi |
---|
| 51 | fi |
---|
[9846] | 52 | done |
---|
[9857] | 53 | echo $list |
---|
[9846] | 54 | |
---|
[9851] | 55 | for cores in $list |
---|
[9846] | 56 | do |
---|
[9869] | 57 | ./submit_bench $cores $ncore_node ${resolution} ${dateref} |
---|
[9846] | 58 | done |
---|
| 59 | |
---|