Skip to content

Notes for developers

Eunseo Choi edited this page Aug 11, 2024 · 1 revision

Develop with MFEM in a debug mode

An MFEM debug build provides numerous useful assertions that help us avoid bugs that we might easily overlook when working with the Release version only.

During the development process, please build mfem as

make pdebug -j 8 MFEM_USE_GSLIB=YES or make pcudebug -j 8 MFEM_USE_GSLIB=YES

Laghost build will just import the flags from MFEM. So, Laghost can be still built with just make -j 8.

Debugging the parallel build of Laghost

Using gdb

  1. Start multiple gdb processes, each running laghost and communicating with the others: e.g., mpirun -np 2 xterm -e gdb ./laghost --input defaults.cfg
  2. On one of the xterms, set one or more breakpoints or do any other necessary preparation.
  3. Run run on ALL the xterms to start all the processes.
  4. Inspect the code around the breakpoints.

Using a parallel debugger

  1. Get TotalView or DDT
  2. Follow the respective user manual.