Skip to content
Snippets Groups Projects
Commit 16c558b1 authored by Benedikt Hegner's avatar Benedikt Hegner
Browse files

Merge branch 'IntelProfiler' into 'master'

Introduced new Algorithm to help profiling Gaudi with Intel tools

See merge request !329
parents c7c1a663 8bc4b594
No related branches found
No related tags found
1 merge request!329Introduced new Algorithm to help profiling Gaudi with Intel tools
Pipeline #
......@@ -73,9 +73,12 @@ endif()
# Intel VTune profiler
#-----------------------------------
if(INTELAMPLIFIER_FOUND)
gaudi_add_module(IntelProfiler src/component/intel/*.cpp
gaudi_add_module(IntelProfiler src/component/intel/IntelProfilerAuditor.cpp
LINK_LIBRARIES ${INTELAMPLIFIER_LIBITTNOTIFY} GaudiKernel
INCLUDE_DIRS ${INTELAMPLIFIER_INCLUDE_DIRS})
gaudi_add_module(GaudiIntelProfiling src/component/intel/IntelProfile.cpp
LINK_LIBRARIES ${INTELAMPLIFIER_LIBITTNOTIFY} GaudiKernel GaudiAlgLib
INCLUDE_DIRS ${INTELAMPLIFIER_INCLUDE_DIRS})
else()
message(WARNING "VTune libraries not found, the module IntelProfiler is disabled")
endif()
......
// Include files
#include <iostream>
// local
#include "IntelProfile.h"
//-----------------------------------------------------------------------------
// Implementation file for class : IntelProfile
//-----------------------------------------------------------------------------
// Declaration of the Algorithm Factory
DECLARE_ALGORITHM_FACTORY( IntelProfile )
//=============================================================================
// Main execution
//=============================================================================
StatusCode IntelProfile::execute() {
// Increase event number
m_eventNumber += 1;
if (m_eventNumber == m_nStartFromEvent) {
warning() << "Starting Intel profile at event "
<< m_eventNumber << endmsg;
__itt_resume();
}
if (m_eventNumber == m_nStopAtEvent) {
warning() << "Stopping Intel profile at event "
<< m_eventNumber << endmsg;
__itt_pause();
}
return StatusCode::SUCCESS;
}
#ifndef INTEL_INTELPROFILE_H
#define INTEL_INTELPROFILE_H 1
// Include files
// from Gaudi
#include "GaudiAlg/GaudiAlgorithm.h"
#include "ittnotify.h"
/** Algorithm to enable/disable the profiling by Intel at given events.
* Works with vtune and intel advisor. Not working with inspector.
*
* @author Ben Couturier Sebastien Ponce
*/
class IntelProfile : public GaudiAlgorithm
{
public:
using GaudiAlgorithm::GaudiAlgorithm;
StatusCode execute() override; ///< Algorithm execution
private:
Gaudi::Property<int> m_nStartFromEvent{this, "StartFromEventN", 1, "After what event we start profiling."};
Gaudi::Property<int> m_nStopAtEvent{this, "StopAtEventN", 0, "After what event we stop profiling. If 0 than we also profile finalization stage. Default = 0."};
int m_eventNumber = 0; // Current event number
};
#endif // INTEL_INTELPROFILE_H
......@@ -277,13 +277,13 @@ if(NOT GAUDI_FLAGS_SET)
#--- Link shared flags -------------------------------------------------------
if (CMAKE_SYSTEM_NAME MATCHES Linux)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed -Wl,--no-undefined -Wl,-z,max-page-size=0x1000"
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-as-needed -Wl,--no-undefined -Wl,-z,max-page-size=0x1000"
CACHE STRING "Flags used by the linker during the creation of dll's."
FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--as-needed -Wl,--no-undefined -Wl,-z,max-page-size=0x1000"
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-as-needed -Wl,--no-undefined -Wl,-z,max-page-size=0x1000"
CACHE STRING "Flags used by the linker during the creation of modules."
FORCE)
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--no-undefined -Wl,-z,max-page-size=0x1000"
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed -Wl,--no-undefined -Wl,-z,max-page-size=0x1000"
CACHE STRING "Flags used by the linker during the creation of executables."
FORCE)
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment