Cilk BZIP2 problems

Cilk BZIP2 problems

Using the Cilk SDK from Intel, Testing the Bzip2 example. It compiles fine but the runtime is
strange. Testing on a 8-core (dual quad-core) Intel Xeon Linux
machine, and a 1GB input file.

$ bzip2-cilkstatic -z -f -k -p /vg00/lv00/tmp/bzip.in

CILK_NPROC=1 results in 35 seconds runtime.
CILK_NPROC=2 results in 1 minute 5 seconds runtime.
CILK_NPROC=4 results in 1 minute 5 seconds runtime.
CILK_NPROC=8 results in 1 minute 5 seconds runtime.

Using top, 2 cpus used 200% of the cpu, 4 cpus used 400% and 8 cpus
used 800%, but the runtimes are all the same and 2x worse than running
on 1 CPU.

If I use the '-P' instead of '-p' I get good results and good speed up (almost linear). Which is what I expect since the docs says -P is better, but the 3 running times that are the same regardless of CPU usage are weird and do not make a lot of sense.

Whywould this be happening? A bug in theBZIP example?

$ cilk++ --version
cilk++ (GCC) 4.2.4 (Cilk Arts build 8503)

Thanks

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi.

Thanks for your interest in Cilk++. Despite my best efforts, I cannot reproduce your bug report. Can we agree on the file to be compressed, so that we are in the same situation? I tried compressing the cilk_8503-x86_64.release.tar
tarball (after gunzipping it). I get the following runtimes (look at elapsed time, not user):

$ CILK_NPROC=1 time ./bzip2-cilkstatic -z -f -k -p ~/Download/cilk_8503-x86_64.release.tar
25.56user 0.50system 0:26.90elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+265121minor)pagefaults 0swaps
$ CILK_NPROC=2 time ./bzip2-cilkstatic -z -f -k -p ~/Download/cilk_8503-x86_64.release.tar
27.04user 0.63system 0:13.97elapsed 198%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+126883minor)pagefaults 0swaps
$ CILK_NPROC=4 time ./bzip2-cilkstatic -z -f -k -p ~/Download/cilk_8503-x86_64.release.tar
28.74user 1.82system 0:07.79elapsed 392%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+74756minor)pagefaults 0swaps
$ CILK_NPROC=8 time ./bzip2-cilkstatic -z -f -k -p ~/Download/cilk_8503-x86_64.release.tar
32.85user 12.39system 0:05.76elapsed 784%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+8outputs (0major+63430minor)pagefaults 0swaps
$ cilk++ --version
cilk++ (GCC) 4.2.4 (Cilk Arts build 8503)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ uname -a
Linux matteo 2.6.31-1-amd64 #1 SMP Mon Nov 16 04:44:38 UTC 2009 x86_64 GNU/Linux

Would you mind posting the results of the same experiment on your machine?

Thanks,
Matteo Frigo

Leave a Comment

Please sign in to add a comment. Not a member? Join today