Hi,

(a) DRD tool: in Sec. 8.1 (Overview) of the Valgrind User Manual 
(release 3.13.0 15 June 2017), it is indicated that the DRD Valgrind 
tool "is a Valgrind tool for detecting errors in multithreaded C and 
C++ programs". Then, Fortran programs are excluded? If so, why? 

(b) Helgrind tool: in Sec. 7.5 (Hints and Tips for Effective Use of Helgrind) 
of the same manual, lists 9 tips and suggestions. The false positives 
explained in point 8 due to standard I/O are (almost) not shown in simple 
programs, but they tend to appear in rather large programs. For example, 
the following (reduced) simple test:

program simple_test
  use omp_lib
  implicit none
  integer :: ih, im, nh, np
  im = 0
  !$omp parallel private (ih) shared (nh,np) reduction (max: im) 
  ih = omp_get_thread_num()
  nh = omp_get_num_threads()
  np = omp_get_num_procs()
  im = max (im,ih)
  !$omp end parallel
  write (*,*) np, nh, im
end program simple_test

compiled with: 

$ gfortran --version
GNU Fortran (GCC) 8.0.1 20180122 (experimental)

on an Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz machine (6 cores) 
with Fedora 27:

$ cat /proc/version                                
Linux version 4.14.13-300.fc27.x86_64 
(mockbu...@bkernel01.phx2.fedoraproject.org) 
(gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)) 
#1 SMP Thu Jan 11 04:00:01 UTC 2018

using valgrind-3.13.0 and:

$ export OMP_NUM_THREADS=2

three tests are performed:

Test 1/3: 
  $ valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all ... 
  it gives:
  Conditional jump or move depends on uninitialised value(s)
  at 0x505EA5B: write_decimal.constprop.10 (write.c:808)
  by 0x505EE13: write_integer (write.c:1351)
  by 0x505FCBD: list_formatted_write_scalar (write.c:1865)
  by 0x5060994: _gfortrani_list_formatted_write (write.c:1943)
  by 0x4009D6: MAIN__ (valtest-002.F90:19)
    definitely lost: 0 bytes in 0 blocks
    indirectly lost: 0 bytes in 0 blocks
      possibly lost: 288 bytes in 1 blocks
    still reachable: 2,000 bytes in 4 blocks
         suppressed: 0 bytes in 0 blocks

Test 2/3):
  $ valgrind --tool=helgrind --free-is-write=yes --track-lockorders=no 
    --check-stack-refs=no --read-var-info=yes 
    --sim-hints=no-nptl-pthread-stackcache --fair-sched=try ...
  it gives:
    Possible data race with a previous ...
    This conflicts with a previous ... 
    ERROR SUMMARY: 9 errors from 9 contexts (suppressed: 1 from 1)

Test 3/3 (forgetting comment (a)): 
  $ valgrind --tool=drd --read-var-info=yes --first-race-only=yes ...
  it gives:
  Conflicting store by thread ...
  ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 3 from 2)

Then, 

(i)  It would be interesting to avoid (bogus?) messages like as:  
     "Conditional jump or move depends on uninitialised value(s)" 
     in Fortran programs that use "free-format" read/write, e.g. 
     line (valtest-002.F90:19) of Test 1, or "Possible data race" 
     (Test 2) and "Conflicting store by thread" (Test 3) in 
     OpenMP programs compiled/linked with the gcc/fortran flag 
     "-fopenmp" (which implies "-pthread"); 

(ii) In addition to the tips and suggestions given in the user 
     manual, could there be other means to mitigate these (bogus?) 
     messages?


Thanks in advance.

Regards.
Jorge D'Elia.
-- 
CIMEC (UNL-CONICET), http://www.cimec.org.ar/
Predio CONICET-Santa Fe, Colec. Ruta Nac. 168, 
Paraje El Pozo, 3000, Santa Fe, ARGENTINA. 
Tel +54-342-4511594/95 ext 7062, fax: +54-342-4511169

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to