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

Intel compiler support #499

Merged
merged 3 commits into from
Mar 22, 2023
Merged

Conversation

mattw-nws
Copy link
Contributor

@mattw-nws mattw-nws commented Mar 20, 2023

A few build system changes and fixes to make it possible to compile with Intel OneAPI (v2022.3.0 tested). This is with the newer, non-legacy LLVM compilers.

Additions

  • Added calls to IntelDPCPP cmake module to enable the compilers when -DINTEL_DPCPP=On is an argument.

Removals

  • One Hymod test was causing a segfault with no meaningful backtrace--since this is legacy code that probably needs refactor (or will in the next few months) the offending test is just skipped for the time being.
  • A non-std version of unique_ptr for C++<14 was getting compiled in because the GNU version macros aren't defined by Intel--again this is legacy code that will probably never be used, so it was commented out and should probably be permanently removed.

Changes

Testing

  1. built and ran all tests in parallel and serial with Intel OneAPI 2022.3.0, with Python, routing, and netcdf enabled.

Screenshots

Notes

Todos

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist (automated report can be put here)

Target Environment support

  • Linux

@@ -52,6 +52,7 @@ void HymodKernelTest::setupArbitraryExampleCase() {
//! Test that Hymod executes its 'run' function fully when passed arbitrary valid arguments.
TEST_F(HymodKernelTest, TestRun0)
{
GTEST_SKIP() << "Skipping HymodKernelTest_TestRun0 - causes unexplained segfault in some builds (Intel compilers?)";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test case was causing a segfault and this was all I could get for the backtrace:

Running main() from /home/Matthew.Williamson/ohd/ngen/test/googletest/googletest/src/gtest_main.cc
[==========] Running 128 tests from 18 test suites.
[----------] Global test environment set-up.
[----------] 2 tests from HymodKernelTest
[ RUN      ] HymodKernelTest.TestRun0

Program received signal SIGSEGV, Segmentation fault.
0x0000000000a63cc4 in ?? ()
(gdb) bt
#0  0x0000000000a63cc4 in ?? ()
#1  0x00007fffffff9a20 in ?? ()
#2  0x000000000081b1dc in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb) 

Copy link
Contributor

Choose a reason for hiding this comment

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

Clearly something is call a null address probably needs to be looked into

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally... but this is zombie code--I'm not sure it's even possible to call it outside of the unit tests (e.g. in a realization config). So super-low priority. Thought process is also that any of these non-BMI models--if we keep them--will have to be refactored substantially as we continue to change the formulation interface over the next few months (mainly to handle gridded data)... I'd rather come back to these (inc. tshirt, simple_lumped, lstm) after the API stabilizes again.

Copy link
Contributor

Choose a reason for hiding this comment

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

Did not realize that this was one of the old non bmi models. Yes we dont need to support them right now.

@mattw-nws mattw-nws changed the title Intel compilers: minimal code changes necessary for compiling non-ext… Intel compiler support Mar 21, 2023
@mattw-nws mattw-nws marked this pull request as ready for review March 21, 2023 18:09
@mattw-nws mattw-nws merged commit dc7d687 into NOAA-OWP:master Mar 22, 2023
Copy link
Contributor

@donaldwj donaldwj left a comment

Choose a reason for hiding this comment

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

Looks fine, other than the one crashing test which seems to be having a null value called as a function, judging by the stack trace

@@ -52,6 +52,7 @@ void HymodKernelTest::setupArbitraryExampleCase() {
//! Test that Hymod executes its 'run' function fully when passed arbitrary valid arguments.
TEST_F(HymodKernelTest, TestRun0)
{
GTEST_SKIP() << "Skipping HymodKernelTest_TestRun0 - causes unexplained segfault in some builds (Intel compilers?)";
Copy link
Contributor

Choose a reason for hiding this comment

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

Clearly something is call a null address probably needs to be looked into

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.

3 participants