update res/times with running times of -fcoarray=single version
[AGH_fortran_course_solution3.git] / measure_times.sh
blobf3a028f0eeeb4b7bbe9f37ea2c9cb89cd9d075b6
1 #!/bin/bash
3 # Copyright 2019 Wojciech Kosior
5 # This is free and unencumbered software released into the public domain.
7 # Anyone is free to copy, modify, publish, use, compile, sell, or
8 # distribute this software, either in source code form or as a compiled
9 # binary, for any purpose, commercial or non-commercial, and by any
10 # means.
12 # In jurisdictions that recognize copyright laws, the author or authors
13 # of this software dedicate any and all copyright interest in the
14 # software to the public domain. We make this dedication for the benefit
15 # of the public at large and to the detriment of our heirs and
16 # successors. We intend this dedication to be an overt act of
17 # relinquishment in perpetuity of all present and future rights to this
18 # software under copyright law.
20 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 # OTHER DEALINGS IN THE SOFTWARE.
28 # For more information, please refer to <http://unlicense.org/>
30 NIMAGES="1 2 3 5 8"
31 NSUBINTERVALS="200 20000 2000000 20000000 200000000"
33 echo "#SUBINTERVALS IMAGES __________TIME"
36 export TIMEFORMAT='%E'
38 for NSU in $NSUBINTERVALS; do
39 for NIM in $NIMAGES; do
40 printf "%13s %6s " $NSU $NIM
42 # bash is weird... don't ask me...
44 TIME=`bash -c "time cafrun -np $NIM ./integrator \
45 gauss exp -1 1 2 $NSU" 2>&1 > /dev/null`
47 if [ $NIM = 1 ]; then
48 TIME=$TIME\(`bash -c "time ./integrator_single \
49 gauss exp -1 1 2 $NSU" 2>&1 > /dev/null`\)
52 printf "%14s\n" $TIME
53 done
54 done