Hi,
I'm testing an array reduction routine with drd and got some surprising
errors reported. I'm compiling with g++-4.4.2 (built locally following
directions on the valgrind website regarding futex and using valgrind-3.5.0
This test case illustrates the problem:
#include <stdio.h>
#include <omp.h>
int main(){
#pragma omp parallel
{
#pragma omp barrier
}//end of parallel section
return 0;
}
[bmil...@alastor5 CriticalSectionTest]$ valgrind --tool=drd ./test3
==24220== drd, a thread error detector
==24220== Copyright (C) 2006-2009, and GNU GPL'd, by Bart Van Assche.
==24220== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==24220== Command: ./test3
==24220==
==24220== Conflicting store by thread 1 at 0x05f5c11c size 4
==24220== at 0x53C93FD: gomp_team_barrier_wait (bar.h:66)
==24220== by 0x53C80FE: gomp_team_end (team.c:464)
==24220== by 0x4006E8: main (test3.cc:7)
==24220== Address 0x5f5c11c is at offset 236 from 0x5f5c030. Allocation
context:
==24220== at 0x4C230D7: malloc (vg_replace_malloc.c:195)
==24220== by 0x53C38D8: gomp_malloc (alloc.c:36)
==24220== by 0x53C87CC: gomp_new_team (team.c:144)
==24220== by 0x53C72DB: GOMP_parallel_start (parallel.c:108)
==24220== by 0x4006D9: main (test3.cc:7)
==24220== Other segment start (thread 2)
==24220== at 0x4C2A7CD: sem_wait (drd_pthread_intercepts.c:1003)
==24220== by 0x53C909B: gomp_sem_wait (sem.c:120)
==24220== by 0x53C935C: gomp_team_barrier_wait_end (bar.c:146)
==24220== by 0x4006BC: main.omp_fn.0 (test3.cc:15)
==24220== by 0x53C8037: gomp_thread_start (team.c:115)
==24220== by 0x4C2E3B4: vgDrd_thread_wrapper
(drd_pthread_intercepts.c:272)
==24220== by 0x57E8366: start_thread (pthread_create.c:297)
==24220== by 0x5AD00AC: clone (in /lib64/libc-2.5.so)
==24220== Other segment end (thread 2)
==24220== at 0x57EEE74: __lll_lock_wait (in /lib64/libpthread-2.5.so)
==24220== by 0x57EA873: _L_lock_106 (pthread_mutex_lock.c:251)
==24220== by 0x57EA2DE: pthread_mutex_lock (pthread_mutex_lock.c:86)
==24220== by 0x4C24F51: pthread_mutex_lock (drd_pthread_intercepts.c:579)
==24220== by 0x53C93E8: gomp_team_barrier_wait (mutex.h:44)
==24220== by 0x53C8043: gomp_thread_start (team.c:116)
==24220== by 0x4C2E3B4: vgDrd_thread_wrapper
(drd_pthread_intercepts.c:272)
==24220== by 0x57E8366: start_thread (pthread_create.c:297)
==24220== by 0x5AD00AC: clone (in /lib64/libc-2.5.so)
==24220==
==24220==
==24220== For counts of detected and suppressed errors, rerun with: -v
==24220== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 19 from 18)
[bmil...@alastor5 CriticalSectionTest]$ echo $OMP_NUM_THREADS
3
--
________________________________________________________________________
Brian Miller, L-556
Center for Applied Scientific Computing (CASC)
Lawrence Livermore National Lab (LLNL) Email: [email protected]
P.O. Box 808, 7000 East Ave. Phone: (925)424-4773
Livermore, CA 94551 Fax: (925)422-9429
________________________________________________________________________
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users