Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak code to avoid NVHPC 21.7 ICE #1385

Merged
merged 1 commit into from
Jul 28, 2021
Merged

Conversation

olupton
Copy link
Collaborator

@olupton olupton commented Jul 27, 2021

Without this change then NEURON fails to compile with the latest NVIDIA HPC compiler release, 21.7. There is an internal compiler error in znorm.c, see https://forums.developer.nvidia.com/t/nvc-21-7-regression-internal-compiler-error-can-only-coerce-indirect-args/184847 for more information.

This change disables vectorisation optimisations for that file to sidestep the error, as suggested on the NVIDIA forums.

@olupton
Copy link
Collaborator Author

olupton commented Jul 27, 2021

Please don't merge yet, I might have an alternative fix.

Replaced a code change with a more targeted CMake change. Should be good to go.

AND "${CMAKE_C_COMPILER_VERSION}" VERSION_GREATER_EQUAL 21.7)
set_source_files_properties(${PROJECT_SOURCE_DIR}/src/mesch/znorm.c PROPERTIES COMPILE_OPTIONS
-Mnovect)
endif()
Copy link
Member

@pramodk pramodk Jul 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for reference, see #901 : here intel compiled was causing deadlock with AVX-512.

Just an idea : as this issue is with the loop vectoriser, if writing loop in different form would avoid compiler internal error then that could be an option. Then we won't need to maintain cmake patches around.

@ferdonline
Copy link
Member

Just as a side note, I also found out about
#pragma loop novect
which could be applied only to affected loops. Anyway current fix is good and specific to Pgi.

@alexsavulescu alexsavulescu merged commit b59f592 into master Jul 28, 2021
@alexsavulescu alexsavulescu deleted the olupton/nvhpc-21.7 branch July 28, 2021 07:23
@alexsavulescu alexsavulescu mentioned this pull request Mar 22, 2022
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants