OpenCilk image with OpenCilk Tools
221
NOTES: 1 This image can be downloaded from https://hub.docker.com/r/robgiorgi/opencilk-211130 The original Docker image can be downloaded also from https://github.com/OpenCilk/infrastructure.git 2 Other software and information about the Opencilk project can be found here: https://github.com/OpenCilk/opencilk-project.git
DEPLOYMENT: STEP-1) Load the Docker image. In our lab the docker image is available locally, so all that is needed is to load it into memory (note that the first time will take almost 2 minutes, so wait until the image successfully loaded): $ docker load -i /opt/docker/docker-opencilk-211130.tgz
STEP-2) Create a working directory and get to work inside the Docker container (don’t worry if you see an error in Windows): $ mkdir WORK; chmod 777 WORK $ docker run -it -v $PWD/WORK:/productivity-tools/Cilkscale_vis/WORK cilk:latest
Now that you are inside the Opencilk container, let’s focus on how to carry one some simple measurement of the parallelism. STEP-3) Change to directory /productivity tools/Cilkscale_vis: $ cd /productivity-tools/Cilkscale_vis; ls Please note that you are ‘ root’ user inside the container and the name of the container is “xxxxxxxxxxxx” (this may be useful at later steps).
STEP-4) Generating the binary files for the parallelism measurements. Cilkscales required that two binaries are generated: i) one which contains the “ instrumented code” and ii) one with the reference benchmark (no instrumentation): clang fib.c -o fib -fopencilk -fcilktool=cilkscale -O3 and clang fib.c -o fib-bench -fopencilk -fcilktool=cilkscale-benchmark -O3 After this step you should see the two binary files fib and fib-bench in the current directory.
STEP-5) Generate the parallelism data and a graphical visualization of them. To perform this step, execute the following command ( -c refers the directory of the Cilkscale binary and -b refers to Cilkscale-benchmark binary. –args 35 specifies that the benchmark takes “ 35” as argument (to calculate fib(35)) -rplot 0 will plot the line 0 of the csv file (which might be the same based on how you dump the csv file) and you could optionally save the output into the PDF file by using -oplot test.pdf ): python3 cilkscale.py -c ./fib -b ./fib-bench --args 35 -rplot 0 -oplot fib.pdf A good practice is to organize the code in 3 parts: i) a preliminary part for initializations (if any)→ “prepare()” ; ii) a central part, which is performing the main computation or ROI → “compute()” and iii) a final part for validations (if any) and presentation of the results → “report()”.
Visualization of the measured data After the previous steps, two output files should be produced: out.csv and fib.pdf. STEP-6) Expected maximum parallelism. You can issue the following command to visualize the content of the out.csv file. $ cat out.csv In particular, the maximum parallelism that is resulting for the recursive Fibonacci benchmark (fib(35)) is 2434.88 (=T1/TS= 3.80363/ 0.00156215).
The fib.pdf file contains the plot of 3 lines (in green, the “perfect linear speedup” or S=P (TP=T1/P) – in yellow the “span bound” or S=T1/TS+O(T1) (TP=TS) – in blue, the “burdened DAG bound” a lower bound to the actual time and speedup) and some “pink dots” indicating the actual speedup S=T1/TP for P=1,2,3,4,5,6. To visualize that file, the simplest way is to copy back the fib.pdf file on your host machine: $ cp out.csv fib.pdf WORK STEP-7) Visualizing the speedup. First of all you should now exit from the container. This is done by pressing CTRL+D (the key “CTRL” and simultaneously “D”): $ ^D Now the fib.pdf has been transferred into the host machine, so you can issue (assuming you have the graphical interface active): $ xpdf WORK/fib.pdf (of course instead of xpdf you can use your favourite pdf visualizer)
Content type
Image
Digest
sha256:550c06458…
Size
1 GB
Last updated
almost 2 years ago
docker pull robgiorgi/opencilk-211130