Hello,

I am using Memcheck tool for a program including OpenMP directives. it
seems some memory is allocated but not deallocated. It corresponds to
variables declared as reduction in OpenMP directive:
#pragma omp parallel for reduction(+:nt, S)

valgrind --tool=memcheck --leak-check=full --show-reachable=yes ./test
==10928== 20 bytes in 1 blocks are still reachable in loss record 317 of 596
==10928==    at 0x4026864: malloc (vg_replace_malloc.c:236)
==10928==    by 0x40268EE: realloc (vg_replace_malloc.c:525)
==10928==    by 0x5A30BE8: gomp_realloc (alloc.c:54)
==10928==    by 0x5A367AB: gomp_team_start (team.c:360)
==10928==    by 0x5A3521D: GOMP_parallel_start (parallel.c:108)
==10928==    by 0x456C462: OBundle::RMSGlobal(bool) (OBundle.cc:369)

Same issue with the next code:
#pragma omp parallel for
for (i = 0 ; i < nX ; i++)
{
  a->val[i] = first + i;
}
==11790== 20 bytes in 1 blocks are still reachable in loss record 1 of 4
==11790==    at 0x4026864: malloc (vg_replace_malloc.c:236)
==11790==    by 0x40268EE: realloc (vg_replace_malloc.c:525)
==11790==    by 0x4075BE8: gomp_realloc (alloc.c:54)
==11790==    by 0x407B7AB: gomp_team_start (team.c:360)
==11790==    by 0x407A21D: GOMP_parallel_start (parallel.c:108)
==11790==    by 0x804C39C: xxxxxx
==11790==    by 0x8048BEF: main (in yyyyy)
==11790==
==11790== 192 bytes in 1 blocks are still reachable in loss record 2 of 4
==11790==    at 0x4026864: malloc (vg_replace_malloc.c:236)
==11790==    by 0x4075B41: gomp_malloc (alloc.c:36)
==11790==    by 0x407B7DE: gomp_team_start (team.c:191)
==11790==    by 0x407A21D: GOMP_parallel_start (parallel.c:108)
==11790==    by 0x804C39C: xxxxxx
==11790==    by 0x8048BEF: main (in yyyyyy)
==11790==
==11790== 432 bytes in 3 blocks are possibly lost in loss record 3 of 4
==11790==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==11790==    by 0x4010CB7: allocate_dtv (dl-tls.c:300)
==11790==    by 0x401144B: _dl_allocate_tls (dl-tls.c:464)
==11790==    by 0x41F05C6: pthread_create@@GLIBC_2.1 (allocatestack.c:570)
==11790==    by 0x407B5A9: gomp_team_start (team.c:422)
==11790==    by 0x407A21D: GOMP_parallel_start (parallel.c:108)
==11790==    by 0x804C39C: xxxxxx
==11790==    by 0x8048BEF: main (in yyyyy)

Is it a coherent behaviour ?

Best regards.

Mathieu
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to