Skip to content
Snippets Groups Projects
Commit 8d15671b authored by Dominik Thoennes's avatar Dominik Thoennes
Browse files

Added likwid.h to wrap the likwid header

parent 73ad594b
No related merge requests found
...@@ -70,7 +70,7 @@ option ( WALBERLA_BUILD_TUTORIALS "Build Tutorials" ...@@ -70,7 +70,7 @@ option ( WALBERLA_BUILD_TUTORIALS "Build Tutorials"
option ( WALBERLA_BUILD_WITH_MPI "Build with MPI" ON ) option ( WALBERLA_BUILD_WITH_MPI "Build with MPI" ON )
option ( WALBERLA_BUILD_WITH_METIS "Build with metis graph partitioner" OFF ) option ( WALBERLA_BUILD_WITH_METIS "Build with metis graph partitioner" OFF )
option ( WALBERLA_BUILD_WITH_PARMETIS "Build with ParMetis graph partitioner" OFF ) option ( WALBERLA_BUILD_WITH_PARMETIS "Build with ParMetis graph partitioner" OFF )
option ( WALBERLA_BUILD_WITH_GPROF "Enables gprof" ) option ( WALBERLA_BUILD_WITH_GPROF "Enables gprof" )
option ( WALBERLA_BUILD_WITH_GCOV "Enables gcov" ) option ( WALBERLA_BUILD_WITH_GCOV "Enables gcov" )
...@@ -867,14 +867,14 @@ if ( WALBERLA_BUILD_WITH_PARMETIS ) ...@@ -867,14 +867,14 @@ if ( WALBERLA_BUILD_WITH_PARMETIS )
${PARMETIS_ROOT}/include ${PARMETIS_ROOT}/include
$ENV{PARMETIS_ROOT}/include $ENV{PARMETIS_ROOT}/include
) )
find_library(PARMETIS_LIBRARY parmetis find_library(PARMETIS_LIBRARY parmetis
/usr/local/lib /usr/local/lib
/usr/lib /usr/lib
${PARMETIS_ROOT}/lib ${PARMETIS_ROOT}/lib
$ENV{PARMETIS_ROOT}/lib $ENV{PARMETIS_ROOT}/lib
) )
if( PARMETIS_INCLUDE_DIR AND PARMETIS_LIBRARY AND METIS_LIBRARY ) if( PARMETIS_INCLUDE_DIR AND PARMETIS_LIBRARY AND METIS_LIBRARY )
include_directories( ${PARMETIS_INCLUDE_DIR} ) include_directories( ${PARMETIS_INCLUDE_DIR} )
list ( APPEND SERVICE_LIBS ${PARMETIS_LIBRARY} ${METIS_LIBRARY} ) list ( APPEND SERVICE_LIBS ${PARMETIS_LIBRARY} ${METIS_LIBRARY} )
...@@ -1046,7 +1046,7 @@ if ( WALBERLA_BUILD_WITH_CUDA ) ...@@ -1046,7 +1046,7 @@ if ( WALBERLA_BUILD_WITH_CUDA )
# set ( BUILD_SHARED_LIBS ON ) # set ( BUILD_SHARED_LIBS ON )
set ( CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE ON ) set ( CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE ON )
if( NOT WALBERLA_CXX_COMPILER_IS_MSVC ) if( NOT WALBERLA_CXX_COMPILER_IS_MSVC )
set ( CUDA_PROPAGATE_HOST_FLAGS OFF CACHE BOOL "" ) set ( CUDA_PROPAGATE_HOST_FLAGS OFF CACHE BOOL "" )
endif() endif()
...@@ -1131,12 +1131,14 @@ endif() ...@@ -1131,12 +1131,14 @@ endif()
if ( WALBERLA_BUILD_WITH_LIKWID_MARKERS ) if ( WALBERLA_BUILD_WITH_LIKWID_MARKERS )
find_library( LIKWID_LIB likwid HINTS $ENV{LIKWID_ROOT} ) find_library( LIKWID_LIB likwid HINTS $ENV{LIKWID_LIBDIR} $ENV{LIKWID_ROOT}/lib )
find_path( LIKWID_INCLUDE_DIR likwid.h HINTS $ENV{LIKWID_INCDIR} $ENV{LIKWID_ROOT}/include )
if ( LIKWID_LIB ) if ( LIKWID_LIB AND LIKWID_INCLUDE_DIR)
set( LIKWID_FOUND 1) set( LIKWID_FOUND 1)
list ( APPEND SERVICE_LIBS ${LIKWID_LIB} ) include_directories( ${LIKWID_INCLUDE_DIR})
add_definitions ( "-DLIKWID_PERFMON" ) add_definitions ( "-DLIKWID_PERFMON" )
list ( APPEND SERVICE_LIBS ${LIKWID_LIB} )
else() else()
message(WARNING "likwid marker library not found. Set environment variable LIKWID_ROOT") message(WARNING "likwid marker library not found. Set environment variable LIKWID_ROOT")
set ( WALBERLA_BUILD_WITH_LIKWID_MARKERS OFF CACHE BOOL "Compile in markers for likwid-perfctr" FORCE ) set ( WALBERLA_BUILD_WITH_LIKWID_MARKERS OFF CACHE BOOL "Compile in markers for likwid-perfctr" FORCE )
......
/* //======================================================================================================================
* ======================================================================================= //
* // This file is part of waLBerla. waLBerla is free software: you can
* Filename: likwid.h // redistribute it and/or modify it under the terms of the GNU General Public
* // License as published by the Free Software Foundation, either version 3 of
* Description: Header File of likwid marker API // the License, or (at your option) any later version.
* //
* Version: 3.0 // waLBerla is distributed in the hope that it will be useful, but WITHOUT
* Released: 29.11.2012 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* Author: Jan Treibig (jt), jan.treibig@gmail.com // for more details.
* Project: likwid //
* // You should have received a copy of the GNU General Public License along
* Copyright (C) 2012 Jan Treibig // with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
* //
* This program is free software: you can redistribute it and/or modify it under //! \file likwid.h
* the terms of the GNU General Public License as published by the Free Software //! \ingroup core
* Foundation, either version 3 of the License, or (at your option) any later //! \author Dominik Thoennes <dominik.thoennes@fau.de>
* version. //! \brief Wrapper for the Likwid tools
* //
* This program is distributed in the hope that it will be useful, but WITHOUT ANY //======================================================================================================================
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* =======================================================================================
*/
#ifndef LIKWID_H
#define LIKWID_H #pragma once
#ifdef LIKWID_PERFMON #ifdef LIKWID_PERFMON
#define LIKWID_MARKER_INIT likwid_markerInit(); #include <likwid.h>
#define LIKWID_MARKER_THREADINIT likwid_markerThreadInit();
#define LIKWID_MARKER_START(reg) likwid_markerStartRegion(reg);
#define LIKWID_MARKER_STOP(reg) likwid_markerStopRegion(reg);
#define LIKWID_MARKER_CLOSE likwid_markerClose();
#else #else
#define LIKWID_MARKER_INIT #define LIKWID_MARKER_INIT
#define LIKWID_MARKER_THREADINIT #define LIKWID_MARKER_THREADINIT
#define LIKWID_MARKER_START(reg) #define LIKWID_MARKER_SWITCH
#define LIKWID_MARKER_STOP(reg) #define LIKWID_MARKER_REGISTER(regionTag)
#define LIKWID_MARKER_START(regionTag)
#define LIKWID_MARKER_STOP(regionTag)
#define LIKWID_MARKER_CLOSE #define LIKWID_MARKER_CLOSE
#endif #define LIKWID_MARKER_GET(regionTag, nevents, events, time, count)
#endif // LIKWID_PERFMON
#ifdef __cplusplus \ No newline at end of file
extern "C" {
#endif
/* marker API routines */
extern void likwid_markerInit(void);
extern void likwid_markerThreadInit(void);
extern void likwid_markerClose(void);
extern void likwid_markerStartRegion(const char* regionTag);
extern void likwid_markerStopRegion(const char* regionTag);
/* utility routines */
extern int likwid_getProcessorId();
extern int likwid_pinProcess(int processorId);
extern int likwid_pinThread(int processorId);
#ifdef __cplusplus
}
#endif
#endif /*LIKWID_H*/
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment