Multicore Computing
CS 5966 / 6966
Software Updates
Table of Contents
1 Updates on running Cilk (what worked for many) - 32-bit compilation
I would suggest you try the following.
1. set path = ($path /usr/local/stow/cilk/cilk-5.4.6/bin/)
For some reason, cilkc is recognized only if set $path and not $PATH.
2. Once we have the path set cilkc command is recognized and we can compile and run any *.cilk programs.
3 Copy cilksort.cilk along with getoptions.h and getoptions.c to a different folder.
Since there was a Makefile in the examples directory, it was able to associate getoptions.h with getoptions.c.
4. Please make following changes to the code.
Open cilksort.cilk
change #include<getoptions.h> to #include "getoptions.c"
Open getoptions.c
change #include<getoptions.h> to #include "getoptions.h"
After this, cilkc -cilk-profile -cilk-span -o cilksort.cilk
and then, ./cilksort --nproc 2 --stats 1
2 Steps for Running 32/64-bit Compilation
Here are the steps with the most basic compile options
for obtaining a 32-bit or 64-bit binary.
You may add other compiler flags as necessary
1) Create the symbolic links cilkc32 and cilkc64 with the following commands:
ln -s /usr/local/stow/cilk/amd64/cilk-5.4.6/bin/cilkc cilkc64
ln -s /usr/local/stow/cilk/cilk-5.4.6/bin/cilkc cilkc32
2) Compile getoptions.c:
32bit on buckley:
gcc -B/usr/local/stow/glibc/glibc-2.4/lib -I. -c getoptions.c -o getoptions32.o
32bit on nabokov:
gcc -I. -c getoptions.c -o getoptions32.o
64bit on buckley and nabokov:
env PATH=/usr/bin gcc -I. -c getoptions.c -o getoptions64.o
3) Compile cilksort.cilk:
32bit on buckley:
./cilkc32 -Wc,-B/usr/local/stow/glibc/glibc-2.4/lib -I. getoptions32.o
cilksort.cilk -o cilksort32
32bit on nabokov:
./cilkc32 -I. getoptions32.o cilksort.cilk -o cilksort32
64bit on buckley and nabokov:
env PATH=/usr/bin ./cilkc64 -I. getoptions64.o cilksort.cilk -o cilksort64
3 Running Inspect on nabokov (may work on other machines..)
- Add these paths to your environment (tcsh) by typing:
set path = (/home/szubzda/inspect/bin /home/szubzda/local/bin $path)
Now if you type set, it should print
path (/home/szubzda/inspect/bin /home/szubzda/local/bin ..rest of path..)
- Now which instrument should print
/home/szubzda/inspect/bin/instrument
- Instrument a source file <example.c>
to produce the file <example>.instr.c
by typing instrument <example>.c
- Now, which compile must print
/home/szubzda/inspect/bin/compile
- Now compile the instrumented file to produce the binary "target" by typing
compile <example>.instr.c
- Now run inspect by typing
inspect --save-trace ./target
The relative path to target is necessary. The "--save-trace" option
produces a trace of the test in the file "trace".
- Examine the trace with emacs:
emacs -l /home/szubzda/inspect/inspect-mode.el <example>.c
Make sure the emacs used is /home/szubzda/local/bin/emacs (which emacs
will help you).
This is
version 22 which is required.
The "-l" option loads the lisp code in
inspect-mode.el. The file to be viewed is the original source
<example>.c. From the <example>.c buffer execute the command
"inspect-trace" and locate the "trace" file. Command execution is done
with M-x where M is Meta and is either alt or escape. Two resulting
buffers of interest are *inspect-error-trace*, the default which
displays the trace leading to the error condition, and
*inspect-first-run-trace*, which is the trace of the first execution
of the target. By selecting a line and pressing enter, emacs will
direct the cursor in the source buffer the corresponding line.
This document was translated from LATEX by
HEVEA.