Hey there I have an assignment next week benchmark using compiler and the professor wants us to write an script actually the command lines. I am new on python and writing scripts on UNIX. How do you write a script on Python? I need tutorials or any advice
Thanks
We have to write these steps
For each experiment, follow these steps:
For each benchmark directory, change to that directory and compile the code with one of the optimization levels. For example:
cd adpcm
gcc -O0 -o adpcm-O0 adpcm.c
Time the runtime of the executable:
time ./adpcm-O0
Record the “real” time displayed. You might take an average of 3-5 runs to get a stable result.
Use the performance measurement tools
On the Pis:
run rpistat on the executable
e.g. rpistat ./adpcm-O0
that generates a textfile rpistat.txt in the same directory. Record the Cycles and Instructions (use the value in [brackets] for the instruction count).
On the lab workstations:
run perf on the executable
e.g. perf stat ./adpcm-O0
that prints to stdout (you can redirect if you wish). Record the Cycles and Instructions.
Repeat this procedure for all 12 benchmarks and all 4 optimization levels on both machines.
For the fastest version of each benchmark (use lowest cycle count in the case of a tie), profile the application:
gcc -pg -O2 -o adpcm-prof adpcm.c
./adpcm-prof (This is needed to profile the executable, but you don’t need to record the runtime)
gprof ./adpcm-prof | less
Record the function for which the most execution time is spent.