write python script for UNIX command lines -
O HTTP = "text">
Hey, I have been using a regular compiler in the next week and the professor wants us to write a script, actually command lines. I'm new to writing Python and script on Unix How do you write scripts on Python?
We must write these steps
For each experiment, follow these steps:
For each benchmark directory, in that directory Make changes and compile the code with one of the customization levels. For example: cd adpcm gcc -O0 -o adpcm-O0 adpcm.c Time of the executable: time ./adpcm-O0 Record a record. You can take 3-5 runs by average to get the time shown for stable results. Use the display measurement tool on the grind: Run rpistat on executables eg Rpistat ./adpcm-O0 generates a text file rpistat.txt in the same directory. Record the chakras and instructions (for the number of instructions [Use the values in the brackets]). On laboratory workstations: Proofs like Perf stat ./adpcm-O0 to run on executables that print on stdout (if you wish, you can redirect). Record cycles and instructions Repeat this procedure for all 12 criteria and all 4 customization levels on both machines. For the fastest version of each benchmark (use the lowest cycle count in terms of tie), make the application profile: GCC-PG-O2-A, ADPCM-Professor, APCPMM. / ADPCM-prof (This is required for executable profiles, but you do not need to record runtime) gprof ./adpcm-prof | Record fewer functions for which the highest execution time is spent.
subprocess.open, os.listdir, os.chdir, and time.time () should help. All these dragon commands are
To create a Python script, just edit a text file (named "the-script", for this "import subprocess" for this example) * your favorite on ix With a text editor, with content such as:
#! / usr / bin / python3 # or you can use Python 2 with print / usr / bin / python ('hello world') ... and make it executable :
chmod 755 the-script ... then you can run it:
./ the-script hh
Comments
Post a Comment