Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

write python script for UNIX command lines

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. 

Answer*

Draft saved
Draft discarded
Cancel

lang-py

AltStyle によって変換されたページ (->オリジナル) /