Skip to content
Snippets Groups Projects
Commit 38e2fcaf authored by Christian Godenschwager's avatar Christian Godenschwager
Browse files

Merge branch 'LikwidWrapper' into 'master'

Wrap likwid header

See merge request walberla/walberla!53
parents 69d7175d 8d15671b
Branches
Tags
No related merge requests found
......@@ -70,7 +70,7 @@ option ( WALBERLA_BUILD_TUTORIALS "Build Tutorials"
option ( WALBERLA_BUILD_WITH_MPI "Build with MPI" ON )
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_GCOV "Enables gcov" )
......@@ -867,14 +867,14 @@ if ( WALBERLA_BUILD_WITH_PARMETIS )
${PARMETIS_ROOT}/include
$ENV{PARMETIS_ROOT}/include
)
find_library(PARMETIS_LIBRARY parmetis
/usr/local/lib
/usr/lib
${PARMETIS_ROOT}/lib
$ENV{PARMETIS_ROOT}/lib
)
if( PARMETIS_INCLUDE_DIR AND PARMETIS_LIBRARY AND METIS_LIBRARY )
include_directories( ${PARMETIS_INCLUDE_DIR} )
list ( APPEND SERVICE_LIBS ${PARMETIS_LIBRARY} ${METIS_LIBRARY} )
......@@ -1046,7 +1046,7 @@ if ( WALBERLA_BUILD_WITH_CUDA )
# set ( BUILD_SHARED_LIBS ON )
set ( CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE ON )
if( NOT WALBERLA_CXX_COMPILER_IS_MSVC )
set ( CUDA_PROPAGATE_HOST_FLAGS OFF CACHE BOOL "" )
endif()
......@@ -1131,12 +1131,14 @@ endif()
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)
list ( APPEND SERVICE_LIBS ${LIKWID_LIB} )
include_directories( ${LIKWID_INCLUDE_DIR})
add_definitions ( "-DLIKWID_PERFMON" )
list ( APPEND SERVICE_LIBS ${LIKWID_LIB} )
else()
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 )
......
/*
* =======================================================================================
*
* Filename: likwid.h
*
* Description: Header File of likwid marker API
*
* Version: 3.0
* Released: 29.11.2012
*
* Author: Jan Treibig (jt), jan.treibig@gmail.com
* Project: likwid
*
* Copyright (C) 2012 Jan Treibig
*
* This program is free software: you can 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 the License, or (at your option) any later
* version.
*
* 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/>.
*
* =======================================================================================
*/
//======================================================================================================================
//
// This file is part of waLBerla. waLBerla is free software: you can
// 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
// the License, or (at your option) any later version.
//
// waLBerla 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 waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file likwid.h
//! \ingroup core
//! \author Dominik Thoennes <dominik.thoennes@fau.de>
//! \brief Wrapper for the Likwid tools
//
//======================================================================================================================
#ifndef LIKWID_H
#define LIKWID_H
#pragma once
#ifdef LIKWID_PERFMON
#define LIKWID_MARKER_INIT likwid_markerInit();
#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();
#include <likwid.h>
#else
#define LIKWID_MARKER_INIT
#define LIKWID_MARKER_THREADINIT
#define LIKWID_MARKER_START(reg)
#define LIKWID_MARKER_STOP(reg)
#define LIKWID_MARKER_SWITCH
#define LIKWID_MARKER_REGISTER(regionTag)
#define LIKWID_MARKER_START(regionTag)
#define LIKWID_MARKER_STOP(regionTag)
#define LIKWID_MARKER_CLOSE
#endif
#ifdef __cplusplus
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*/
#define LIKWID_MARKER_GET(regionTag, nevents, events, time, count)
#endif // LIKWID_PERFMON
\ No newline at end of file
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