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

DRAFT - avoid optimization for setuprad.f90 with Intel #533

Closed

Conversation

climbfuji
Copy link

Description

This PR is a suggestion/workaround to address the GSI failures with Intel when compiler optimization is enabled. Please ignore the changes to the Orion LUA module, I needed that to (unsuccessfully) attempt running the regression tests myself.

I got far enough to run into a permissions issue for the global_3dvar test, because I am not in group rstprod. But I couldn't figure out how to run global_T62, at least this test doesn't exist when I do

cmake -DCONTROLPATH=$PWD/../install/bin -DBUILD_REG_TESTING=ON -DCMAKE_INSTALL_PREFIX=$PWD/../install ../GSI-lower-opt-intel 2>&1 | tee log.cmake

This PR may fix #447, but someone needs to test this. @DavidHuber-NOAA?

Type of change

Please delete options that are not relevant.

  • Bug fix/workaround (non-breaking change which fixes an issue)

How Has This Been Tested?

See above

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing tests pass with my changes
  • Any dependent changes have been merged and published

Copy link
Contributor

@aerorahul aerorahul left a comment

Choose a reason for hiding this comment

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

Thanks @climbfuji
Just one TODO placeholder, so this is not forgotten.

Co-authored-by: Rahul Mahajan <[email protected]>
@DavidHuber-NOAA
Copy link
Collaborator

Thanks @climbfuji I will give this a try today.

@DavidHuber-NOAA
Copy link
Collaborator

@climbfuji I gave this a try and the global_3dvar test failed with a crash on gsi/readfiles.f90:724 when compiled with Intel 2022.3.0 on Hera. Here is the stack trace:

0 0x000000000004d455 ucs_debug_print_backtrace() ???:0
1 0x0000000001e7a09c do_deallocate_all() for_alloc_copy.c:0
2 0x00000000012d17c5 read_files_() /scratch1/NESDIS/nesdis-rdo2/David.Huber/gsi_test/src/gsi/read_files.f90:724
3 0x0000000000f9d0ae gesinfo_() /scratch1/NESDIS/nesdis-rdo2/David.Huber/gsi_test/src/gsi/gesinfo.F90:606
4 0x000000000063a02f gsisub_() /scratch1/NESDIS/nesdis-rdo2/David.Huber/gsi_test/src/gsi/gsisub.F90:131
5 0x00000000004164fd gsimod_mp_gsimain_run_() /scratch1/NESDIS/nesdis-rdo2/David.Huber/gsi_test/src/gsi/gsimod.F90:2266
6 0x000000000041643f MAIN__() /scratch1/NESDIS/nesdis-rdo2/David.Huber/gsi_test/src/gsi/gsimain.f90:631
7 0x00000000004163dd main() ???:0
8 0x0000000000022555 __libc_start_main() ???:0
9 0x00000000004162f6 _start() ???:0

I will keep adding the OPTIMIZE:0 directive to the broken modules until we have something working or it fails to fix an issue.

@climbfuji
Copy link
Author

Hmm. Something isn't right with this code. Thanks for testing!

@DavidHuber-NOAA
Copy link
Collaborator

@climbfuji Unfortunately, adding the directive to read_files.F90 did not fix that crash. On inspection, I noticed that this crash occurs on the last line of the module, according to the backtrace, so I went up another level and tried deoptimizing gesinfo.F90, which also didn't work; same crash. This work is in port_2_i2021.

Reading up on the directive itself, setting optimization flags is a 'suggestion' to the compiler and may be ignored without any diagnostic output. So instead, I'm going to modify the CMake file to set -O0 for these three modules.

@climbfuji
Copy link
Author

@climbfuji Unfortunately, adding the directive to read_files.F90 did not fix that crash. On inspection, I noticed that this crash occurs on the last line of the module, according to the backtrace, so I went up another level and tried deoptimizing gesinfo.F90, which also didn't work; same crash. This work is in port_2_i2021.

Reading up on the directive itself, setting optimization flags is a 'suggestion' to the compiler and may be ignored without any diagnostic output. So instead, I'm going to modify the CMake file to set -O0 for these three modules.

Thanks for all the tests, @DavidHuber-NOAA. This is very annoying, but if instead of using directives setting cmake compiler flags works, then that's fine!

@DavidHuber-NOAA
Copy link
Collaborator

@climbfuji Unfortunately, deoptimizing the 3 modules still resulted in a segmentation fault in read_files.f90. I took it another step and deoptimized every module that was called by read_files.f90 and gesinfo.F90, but I am still getting the same seg fault.

@climbfuji
Copy link
Author

Closing this, since we have a better solution in #447

@climbfuji climbfuji closed this Feb 16, 2023
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.

GSI fails to run using newer Intel compilers (i.e, Intel 2022)
3 participants