[parsec-users] Dedup Segmentation Fault with 128 threads
jlgreath at umich.edu
Fri Feb 11 14:55:20 EST 2011
On 2/11/2011 6:39 AM, Sudhanshu Shukla wrote:
> Hi PARSEC users,
> I am facing a segmentation fault while executing dedup kernel with 128
> threads. The kernel work fine with smaller number of threads (tested with 64
> & 32 threads). I do not have more information, than the console output (that
> can be found at the end of the mail).
> I would like to know if any of you have also found the same issue or this is
> a problem in my environment.
> Sudhanshu Shukla
I just tested out dedup with 128 threads on a x64 Linux box and saw the
same problem. I hunted it down to encoder.c line 1203 for me (a
pthread_join on the members of the threads_anchor array). The code
tries to join 128 (or however many you try to launch) threads at this point.
The reason for the segfault is dedupdef.h line 14. MAX_THREADS is set to
100 by default, and this makes thread_anchor a 100-member array. At 128
threads, you overflow this array on thread creation, leading to weird
results at the join.
Increasing MAX_THREADS will allow you to run 128+ threads. I've tested
it with 128 and 256 threads and did not run into any further problems.
Additionally, MAX_THREADS is only used for three statically-sized
pthread_t arrays, so this shouldn't affect the output of the program.
However, it may lead to slightly different performance numbers for the
cases of 1-100 processors.
Joseph Lee Greathouse
Electrical Engineering and Computer Science, University of Michigan
More information about the parsec-users