0

I have a code that I parallelized using OpenMP. I want to make sure that the threads deployed follow the same sequence diagram that I have in mind. In order to do that, I looked for an efficient tool (library, software,..) and found the lib OMPTrace which is a simple tool for tracing and visualizing OpenMP program execution. it's shown here how to install and use it. The file I want to compile is called hecese_OpenMP.f90 (Fortran). I executed the following block of commands in order to vizualize the behaviour of the threads.

flang -g -mp hecese_OpenMP.f90 -L/home/hakim/llvm-openmp-install/lib -o heceseflang
14 h 40
objdump -d heceseflang >heceseflang.objdump
14 h 40
LD_PRELOAD=/home/hakim/llvm-openmp-install/lib/libomp.so:/home/hakim/llvm-openmp/BUILD/omptrace/build/libomptrace.so ./heceseflang

and it shows:

140557273808912: ompt_event_release_nest_lock_last: wait_id=140558880879816, codeptr_ra=0x411abe 
140557273808912: ompt_event_wait_nest_lock: wait_id=140558880879816, hint=0, impl=2, codeptr_ra=0x41199f 
140557273808912: ompt_event_acquired_nest_lock_first: wait_id=140558880879816, codeptr_ra=0x41199f 
140557273808912: ompt_event_release_nest_lock_last: wait_id=140558880879816, codeptr_ra=0x411abe 
Erreur de segmentation (core dumped)

I tested the library on a hello_world program and it worked perfectly. I tried to reproduce the sequence diagram I have in mind and it gave me: enter image description here

The problem is that if I compile my code with gfortran and execute it, I don't get a segmentation fault (everything works fine) but when I try with OMPTrace I get a segmentation fault.

My question is very simple. Does the problem come from the library itself (knowing that it worked for the hello_world code) or it can come from my code (knowing that it works without the lib) ? I doubt that this library does not support large codes. My code contains 1200 lines.

hakim
  • 139
  • 15
  • 2
    1200 lines is a very small code. – Vladimir F Героям слава Jun 16 '21 at 13:26
  • @VladimirF yes, it's true but maybe 1200 is larger than what OMPTrace is waiting for. – hakim Jun 16 '21 at 13:28
  • 1
    That is extremely unlikely. – Vladimir F Героям слава Jun 16 '21 at 13:48
  • 3
    You write: "My question is very simple. Does the problem come from the library itself (knowing that it worked for the hello_world code) or it can come from my code (knowing that it works without the lib) ? " Like in your previous question: please share a MWE showing the problem, we need more to work with. – albert Jun 16 '21 at 13:59
  • Why do you tag gfortran when clearly using flang? – Vladimir F Героям слава Jun 16 '21 at 14:13
  • 1
    @VladimirF I tag gfortran because as I said in my question, I succeded to compile my code with gfortran. – hakim Jun 16 '21 at 16:07
  • On the web page you link to it says "Prerequisite OpenMP implementation that supports OMPT interface, which is the LLVM OpenMP runtime". Is this the case for gfortran? I have no idea. gfortran is not referenced on the page at all. – Ian Bush Jun 16 '21 at 16:09
  • @IanBush The OP is using flang for that, not gfortran. Hence my comment. The code also happens to work when compiled with gfortran, but that is only tangential. – Vladimir F Героям слава Jun 16 '21 at 17:26
  • @VladimirF The OP says "The problem is that if I compile my code with gfortran and execute it, I don't get a segmentation fault (everything works fine) but when I try with OMPTrace I get a segmentation fault." I read that as when it is compiled with gfortran without omptrace it works, but when it is compiled with gfortran *and* omptrace it segfaults. But yes, on rereading, it is ambiguous. – Ian Bush Jun 16 '21 at 18:04

0 Answers0