Skip to content

Commit

Permalink
cmake tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
MartynF committed Nov 23, 2023
1 parent 6510dd9 commit ed3a97c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ ecbuild_add_option( FEATURE MPI

ecbuild_add_option( FEATURE PAPI
DESCRIPTION "Support for HW counters in drhook via PAPI"
)

REQUIRED_PACKAGES "OpenMP"
)

ecbuild_add_option( FEATURE FCKIT
DESCRIPTION "Support for fckit"
REQUIRED_PACKAGES "fckit QUIET" )
Expand Down
6 changes: 5 additions & 1 deletion src/fiat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,16 @@ else()
endif()

if( HAVE_OMP )

target_link_libraries( fiat PRIVATE OpenMP::OpenMP_Fortran )
if( CMAKE_C_COMPILER_ID MATCHES Intel )
target_link_libraries( fiat PRIVATE OpenMP::OpenMP_C )

if( ${CMAKE_C_COMPILER_ID} MATCHES Intel )
ecbuild_add_c_flags("-qopenmp" NO_FAIL)
else()
ecbuild_add_c_flags("-fopenmp" NO_FAIL)
endif()

endif()

fiat_target_ignore_missing_symbols( TARGET fiat SYMBOLS
Expand Down
2 changes: 1 addition & 1 deletion src/fiat/drhook/drhook.c
Original file line number Diff line number Diff line change
Expand Up @@ -4592,7 +4592,7 @@ c_drhook_print_(const int *ftnunitno,
first_counter_is_cyc=1;
{
len =
fprintf(fpcsv,"Routine,MPI Rank,ThreadId,Rank,%% Self Time,Cumul,Excl Time,Incl. Time,#Calls");
fprintf(fpcsv,"Routine,MPI Rank,ThreadId,SelfRank,%% Self Time,Cumul,Excl Time,Incl. Time,#Calls");
for (int c=0;c<drhook_papi_num_counters();c++)
fprintf(fpcsv,",%s(excl)",drhook_papi_counter_name(c,1));
for (int c=0;c<drhook_papi_num_counters();c++)
Expand Down
7 changes: 0 additions & 7 deletions src/fiat/drhook/drhook_papi.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ int drhook_papi_rank=0; /* C style! */
size_t drhook_max_counter_name=0;

/* hardwired for now */
/* const char * hookCounters[ NPAPICNTRS ][2]= */
/* { */
/* {"PAPI_TOT_CYC","Cycles"}, */
/* {"PAPI_FP_OPS","FP Operations"}, */
/* {"PAPI_L2_DCM","L2 Miss"} */
/* }; */

const char * hookCounters[ NPAPICNTRS ][2]=
{
{"PAPI_TOT_CYC","Cycles"},
Expand Down

0 comments on commit ed3a97c

Please sign in to comment.