bsc-performance-tools / extrae

Instrumentation framework to generate execution traces of the most used parallel runtimes.
https://tools.bsc.es/extrae
GNU Lesser General Public License v2.1
58 stars 35 forks source link

Internal Error: insert(): Duplicate key found! - using Extrae_event #109

Open stefandesouza opened 2 weeks ago

stefandesouza commented 2 weeks ago

Hello. I'm currently trying to add timestamped events into my trace file using the Extrae API. The application is an OpenFOAM11 solver that uses foamRun. This is the error I get Internal Error: insert(): Duplicate key found! repeated for as many MPI processors I have running. This is what my instrumentation looks like

  #include "extrae.h"
  #include "extrae_user_events.h"
  ...
  extrae_type_t type = 1000;
  unsigned int nvalues = 4;
  extrae_value_t values[4] = {0, 1, 2, 3};
  char * description_values[4] = {"End", "Begin", "After Presolve", "Before Postsolve"};

  Extrae_define_event_type (&type, "Kernel execution", &nvalues, values, description_values);

  while (pimple.run(runTime))
  {
      Extrae_event (1000,1);
      solver.preSolve();
      Extrae_event (1000,2);
      // Adjust the time-step according to the solver maxDeltaT
      adjustDeltaT(runTime, solver);

      runTime++;

      while (pimple.loop())
      {
          solver.moveMesh();
          solver.fvModels().correct();
          solver.prePredictor();
          solver.momentumPredictor();
          solver.thermophysicalPredictor();
          solver.pressureCorrector();
          solver.postCorrector();
      }
      Extrae_event (1000,3);
      solver.postSolve();
      Extrae_event (1000,0);

      runTime.write();
  }

  Info<< "End\n" << endl;

  return 0;

And my linking commands

EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude -I$(EXTRAE_HOME)/include

EXE_LIBS = \
    -lfiniteVolume -Wl,-rpath -Wl,$(EXTRAE_HOME)/lib -L$(EXTRAE_HOME)/lib -lmpitrace

Edit: Seems to run fine while omitting the LD_PRELOAD in my job script.