Skip to content

compiler flags for AMD EPIC ZEN CPUs #395

Description

@mandresm

This issue is related to the merged PR #338

For AMD EPIC ZEN processors, using intel compilers one needs to use the compiler flags -march=core-avx2 -mtune=core-avx2 to get a good performance during runtime. This was solved in #338 for Levante, however, this was not a very general solution as you can see below, and now Albedo needs a similar implementation.

if(${CMAKE_C_COMPILER_ID} STREQUAL "Intel")
target_compile_options(${PROJECT_NAME} PRIVATE -no-prec-div -no-prec-sqrt -fast-transcendentals -fp-model precise)
if(${FESOM_PLATFORM_STRATEGY} STREQUAL levante.dkrz.de )
target_compile_options(${PROJECT_NAME} PRIVATE -march=core-avx2 -mtune=core-avx2)
endif()

I would suggest, that instead of checking for FESOM_PLATFORM_STRATEGY, we look at CPU_MODEL:

export CPU_MODEL=AMD_EPYC_ZEN3

and if it has AMD_EPYC_ZEN we add the -march and -mtune flags. That should be more general.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions