nextsimhub / nextsimdg

neXtSIM_DG : next generation sea-ice model with DG
https://nextsim-dg.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
10 stars 13 forks source link

Compiling on Intel compiler #594

Open einola opened 4 months ago

einola commented 4 months ago

@andreapiacentini is having problems compiling the code using the intel suite of compilers. Andrea reports

In the meantime, the simple sequence of commands

mkdir build
cd build
cmake -DBoost_INCLUDE_DIR=${BOOST_INC_DIR} -DEigen3_DIR=${EIGEN_DIR}/share/eigen3/cmake ..
make VERBOSE=1

miserably ended very soon (much sooner than what happened with Eric's old branch even if ConfigMap.hpp is unchanged) I definitely need a little push toward c++ and cmake misteries (both far more modern than I am)

In file included from /home/ext/cf/cglo/piacentinia/SASIP/nextsimdg/core/src/include/Configured.hpp(11),
                 from /home/ext/cf/cglo/piacentinia/SASIP/nextsimdg/core/src/Logged.cpp(9):
/home/ext/cf/cglo/piacentinia/SASIP/nextsimdg/core/src/include/ConfigMap.hpp(17): error: qualified name is not allowed
  typedef std::variant<double, unsigned, int, std::string> Fusi;
          ^

In file included from /home/ext/cf/cglo/piacentinia/SASIP/nextsimdg/core/src/include/Configured.hpp(11),
                 from /home/ext/cf/cglo/piacentinia/SASIP/nextsimdg/core/src/Logged.cpp(9):
/home/ext/cf/cglo/piacentinia/SASIP/nextsimdg/core/src/include/ConfigMap.hpp(17): error: expected a ";"
  typedef std::variant<double, unsigned, int, std::string> Fusi;
                      ^

In file included from /home/ext/cf/cglo/piacentinia/SASIP/nextsimdg/core/src/include/Configured.hpp(11),
                 from /home/ext/cf/cglo/piacentinia/SASIP/nextsimdg/core/src/Logged.cpp(9):
/home/ext/cf/cglo/piacentinia/SASIP/nextsimdg/core/src/include/ConfigMap.hpp(18): error: identifier "Fusi" is undefined
  typedef std::map<std::string, Fusi> ConfigMap;
                                ^

In file included from /opt/softs/gcc/9.2.0/include/c++/9.2.0/bits/ios_base.h(46),
                 from /opt/softs/gcc/9.2.0/include/c++/9.2.0/ios(42),
                 from /opt/softs/gcc/9.2.0/include/c++/9.2.0/ostream(38),
                 from /opt/softs/gcc/9.2.0/include/c++/9.2.0/iterator(64),
                 from /opt/softs/libraries/ICC_2018.5.274/boost-1.81.0/include/boost/iterator/iterator_traits.hpp(10),
                 from /opt/softs/libraries/ICC_2018.5.274/boost-1.81.0/include/boost/range/iterator_range_core.hpp(26),
                 from /opt/softs/libraries/ICC_2018.5.274/boost-1.81.0/include/boost/lexical_cast.hpp(30),
                 from /opt/softs/libraries/ICC_2018.5.274/boost-1.81.0/include/boost/program_options/value_semantic.hpp(14),
                 from /opt/softs/libraries/ICC_2018.5.274/boost-1.81.0/include/boost/program_options/options_description.hpp(13),
                 from /opt/softs/libraries/ICC_2018.5.274/boost-1.81.0/include/boost/program_options.hpp(15),
                 from /home/ext/cf/cglo/piacentinia/SASIP/nextsimdg/core/src/include/Configurator.hpp(13),
                 from /home/ext/cf/cglo/piacentinia/SASIP/nextsimdg/core/src/include/Configured.hpp(13),
                 from /home/ext/cf/cglo/piacentinia/SASIP/nextsimdg/core/src/Logged.cpp(9):
/opt/softs/gcc/9.2.0/include/c++/9.2.0/bits/stl_function.h(437): error: identifier "__builtin_is_constant_evaluated" is undefined
        if (__builtin_is_constant_evaluated())
einola commented 4 months ago

My own attempt at compiling develop with intel also fail.

[einola@login-2.FRAM ~/src/nextsimdg/intel]$ icpc --version
icpc (ICC) 2021.6.0 20220226
Copyright (C) 1985-2022 Intel Corporation.  All rights reserved.
[ 67%] Building CXX object CMakeFiles/nextsimlib.dir/physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp.o
/cluster/home/einola/src/nextsimdg/dynamics/src/include/CGDynamicsKernel.hpp(38): error: the default constructor of "Nextsim::DynamicsKernel<6, 8>" cannot be referenced -- it is a deleted function
      {
      ^
          detected during:
            instantiation of "Nextsim::CGDynamicsKernel<DGadvection>::CGDynamicsKernel() [with DGadvection=6]" at line 37 of "/cluster/home/einola/src/nextsimdg/dynamics/src/include/FreeDriftDynamicsKernel.hpp"
            instantiation of "Nextsim::FreeDriftDynamicsKernel<DGadvection>::FreeDriftDynamicsKernel(const Nextsim::DynamicsParameters &) [with DGadvection=6]" at line 26 of "/cluster/home/einola/src/nextsimdg/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp"

[ 68%] Building CXX object CMakeFiles/nextsimlib.dir/physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp.o
[ 69%] Building CXX object CMakeFiles/nextsimlib.dir/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp.o
[ 70%] Building CXX object CMakeFiles/nextsimlib.dir/physics/src/modules/OceanBoundaryModule/UniformOcean.cpp.o
[ 71%] Building CXX object CMakeFiles/nextsimlib.dir/physics/src/modules/OceanBoundaryModule/module.cpp.o
compilation aborted for /cluster/home/einola/src/nextsimdg/core/src/modules/DynamicsModule/module.cpp (code 2)
make[2]: *** [CMakeFiles/nextsimlib.dir/build.make:510: CMakeFiles/nextsimlib.dir/core/src/modules/DynamicsModule/module.cpp.o] Error 2
make[2]: *** Waiting for unfinished jobs....
/cluster/home/einola/src/nextsimdg/dynamics/src/include/CGDynamicsKernel.hpp(38): error: the default constructor of "Nextsim::DynamicsKernel<6, 8>" cannot be referenced -- it is a deleted function
      {
      ^
          detected during:
            instantiation of "Nextsim::CGDynamicsKernel<DGadvection>::CGDynamicsKernel() [with DGadvection=6]" at line 55 of "/cluster/home/einola/src/nextsimdg/dynamics/src/include/VPCGDynamicsKernel.hpp"
            instantiation of "Nextsim::VPCGDynamicsKernel<DGadvection>::VPCGDynamicsKernel(Nextsim::StressUpdateStep<DGadvection, 8> &, const Nextsim::DynamicsParameters &) [with DGadvection=6]" at line 25 of "/cluster/home/einola/src/nextsimdg/dynamics/src/include/MEVPDynamicsKernel.hpp"
            instantiation of "Nextsim::MEVPDynamicsKernel<DGadvection>::MEVPDynamicsKernel(const Nextsim::DynamicsParameters &) [with DGadvection=6]" at line 25 of "/cluster/home/einola/src/nextsimdg/core/src/modules/DynamicsModule/MEVPDynamics.cpp"

compilation aborted for /cluster/home/einola/src/nextsimdg/core/src/modules/DynamicsModule/MEVPDynamics.cpp (code 2)
make[2]: *** [CMakeFiles/nextsimlib.dir/build.make:496: CMakeFiles/nextsimlib.dir/core/src/modules/DynamicsModule/MEVPDynamics.cpp.o] Error 2
/cluster/home/einola/src/nextsimdg/dynamics/src/include/CGDynamicsKernel.hpp(38): error: the default constructor of "Nextsim::DynamicsKernel<6, 8>" cannot be referenced -- it is a deleted function
      {
      ^
          detected during:
            instantiation of "Nextsim::CGDynamicsKernel<DGadvection>::CGDynamicsKernel() [with DGadvection=6]" at line 60 of "/cluster/home/einola/src/nextsimdg/dynamics/src/include/BrittleCGDynamicsKernel.hpp"
            instantiation of "Nextsim::BrittleCGDynamicsKernel<DGadvection>::BrittleCGDynamicsKernel(Nextsim::StressUpdateStep<DGadvection, 8> &, const Nextsim::DynamicsParameters &) [with DGadvection=6]" at line 30 of "/cluster/home/einola/src/nextsimdg/dynamics/src/include/BBMDynamicsKernel.hpp"
            instantiation of "Nextsim::BBMDynamicsKernel<DGadvection>::BBMDynamicsKernel(const Nextsim::DynamicsParameters &) [with DGadvection=6]" at line 17 of "/cluster/home/einola/src/nextsimdg/core/src/modules/DynamicsModule/BBMDynamics.cpp"

compilation aborted for /cluster/home/einola/src/nextsimdg/core/src/modules/DynamicsModule/BBMDynamics.cpp (code 2)
make[2]: *** [CMakeFiles/nextsimlib.dir/build.make:482: CMakeFiles/nextsimlib.dir/core/src/modules/DynamicsModule/BBMDynamics.cpp.o] Error 2
make[1]: *** [CMakeFiles/Makefile2:279: CMakeFiles/nextsimlib.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

However, simply changing DynamicsKernel() = default to DynamicsKernel() {} in DynamicsKernel.hpp lets the code compile (but with some warnings for CGModelArray_test.cpp).

diff --git a/dynamics/src/include/DynamicsKernel.hpp b/dynamics/src/include/DynamicsKernel.hpp
index 63ba93e4..36fe7dee 100644
--- a/dynamics/src/include/DynamicsKernel.hpp
+++ b/dynamics/src/include/DynamicsKernel.hpp
@@ -41,7 +41,7 @@ public:
     typedef std::pair<const std::string, const DGVector<DGadvection>&> DataMapping;
     typedef std::map<typename DataMapping::first_type, typename DataMapping::second_type> DataMap;

-    DynamicsKernel() = default;
+    DynamicsKernel() {};
     virtual ~DynamicsKernel() = default;
     virtual void initialise(const ModelArray& coords, bool isSpherical, const ModelArray& mask)
     {

@timspainNERSC: Shouldn't the two be equivalent, or is there a subtle difference?

timspainNERSC commented 4 months ago

@timspainNERSC: Shouldn't the two be equivalent, or is there a subtle difference? 😬🤷

I'll have a quick investigate, but as I understand it, the two should be equivalent.

timspainNERSC commented 4 months ago

They are so not equivalent. The default constructor = default will initialize everything with its default value (zeroes, default constructors). An empty constructor {} explicitly says: We initialize nothing! Nothing! Good day, sir!

I did manage to remove a warning in Eclipse by initializing all the fields in DynamicsKernel.

diff --git a/dynamics/src/include/DynamicsKernel.hpp b/dynamics/src/include/DynamicsKernel.hpp
index 63ba93e..2f68eef 100644
--- a/dynamics/src/include/DynamicsKernel.hpp
+++ b/dynamics/src/include/DynamicsKernel.hpp
@@ -168,7 +168,7 @@
     }

 protected:
-    Nextsim::DGTransport<DGadvection>* dgtransport;
+    Nextsim::DGTransport<DGadvection>* dgtransport = nullptr;

     DGVector<DGadvection> hice;
     DGVector<DGadvection> cice;
@@ -181,9 +181,9 @@

     size_t stepNumber = 0;

-    double deltaT;
+    double deltaT = 0.;

-    Nextsim::ParametricMesh* smesh;
+    Nextsim::ParametricMesh* smesh = nullptr;

     virtual void updateMomentum(const TimestepTime& tst) = 0;

Does that allow ICC to build DynamicsKernel? (With the = default constructor)

einola commented 4 months ago

Ah, good to know about = default!

But it still doesn't compile. It's strange because the compiler says, "You deleted the constructor, so I can't call it" if we use = default but not if we use an empty constructor. But both are valid constructors and not deleted, right?!

I did find something potentially relevant on stackoverflow. It's about a bug in Visual Studio 2015, which seems to have been fixed*, but the accepted answer lists conditions under which a default constructor is deleted. Unfortunately, I can't tell if any of these are true for us.

*I verified that the MWE on stackoverflow compiles with my setup.

einola commented 4 months ago

@TomMelt or @jwallwork23 - Can you have a look at this one?

TomMelt commented 4 months ago

I compiled using icpc (ICC) 2021.10.0 20230609 from the intel oneapi compiler tools ( intel-oneapi-compilers@2023.2.1 and intel-oneapi-mpi@2021.10.0) and I didn't have any issues compiling.

I used:

cmake .. -DENABLE_MPI=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=$(which mpiicc) -DCMAKE_CXX_COMPILER=$(which mpiicpc)

I get some warnings but no errors. The warnings can be resolved simply but don't relate to the issues mentioned above.

Could you please provide more information on the compilers used? Also could you provide the output from cmake

e.g., mine was:

-- The C compiler identification is Intel 2021.10.0.20230609                                                                                                                                                       
-- The CXX compiler identification is Intel 2021.10.0.20230609                                                                                                                                                     
-- Detecting C compiler ABI info                                                                                                                                                                                   
-- Detecting C compiler ABI info - done                                                                                                                                                                            
-- Check for working C compiler: /software/spack/var/spack/environments/nextsim-intel/.spack-env/view/bin/mpiicc - skipped                                                                                         
-- Detecting C compile features                                                                                                                                                                                    
-- Detecting C compile features - done                                                                                                                                                                             
-- Detecting CXX compiler ABI info                                                                                                                                                                                 
-- Detecting CXX compiler ABI info - done                                                                                                                                                                          
-- Check for working CXX compiler: /software/spack/var/spack/environments/nextsim-intel/.spack-env/view/bin/mpiicpc - skipped                                                                                      
-- Detecting CXX compile features                                                                                                                                                                                  
-- Detecting CXX compile features - done                                                                                                                                                                           
-- Found PkgConfig: /software/spack/var/spack/environments/nextsim-intel/.spack-env/view/bin/pkg-config (found version "1.9.5")                                                                                    
-- Found OpenMP_C: -qopenmp (found version "5.0")                                                                                                                                                                  
-- Found OpenMP_CXX: -qopenmp (found version "5.0")                                                                                                                                                                
-- Found OpenMP: TRUE (found version "5.0")                                                                                                                                                                        
-- Found Boost: /software/spack/var/spack/environments/nextsim-intel/.spack-env/view/lib/cmake/Boost-1.80.0/BoostConfig.cmake (found version "1.80.0") found components: program_options log                       
-- Found MPI_C: /software/spack/var/spack/environments/nextsim-intel/.spack-env/view/bin/mpiicc (found version "3.1")                                                                                              
-- Found MPI_CXX: /software/spack/var/spack/environments/nextsim-intel/.spack-env/view/bin/mpiicpc (found version "3.1")                                                                                           
-- Found MPI: TRUE (found version "3.1") found components: C CXX                                                                                                                                                   
-- Found Python: /home/melt/miniconda3/envs/nextsim/bin/python3.10 (found version "3.10.13") found components: Interpreter

I managed to compile and run all the tests (MPI=ON and MPI=OFF)

Only one test fails on a floating point comparison, but again not relevant to this discussion.

$ ./testTOPAZOcn 
[doctest] doctest version is "2.4.11"
[doctest] run with "--help" for options
===============================================================================
/home/melt/sync/cambridge/projects/current/sasip/nextsimdg/physics/test/TOPAZOcn_test.cpp:28:
TEST SUITE: TOPAZOcean
TEST CASE:  TOPAZOcean test

/home/melt/sync/cambridge/projects/current/sasip/nextsimdg/physics/test/TOPAZOcn_test.cpp:76: FATAL ERROR: REQUIRE( sst(45, 35) == -(0 + targetFrac) ) is NOT correct!
  values: REQUIRE( -0.035045 == -0.035045 )

===============================================================================
[doctest] test cases: 1 | 0 passed | 1 failed | 0 skipped
[doctest] assertions: 3 | 2 passed | 1 failed |
[doctest] Status: FAILURE!
einola commented 4 months ago
cmake .. -DENABLE_MPI=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=$(which mpiicc) -DCMAKE_CXX_COMPILER=$(which mpiicpc)
-- The C compiler identification is Intel 2021.6.0.20220226
-- The CXX compiler identification is Intel 2021.6.0.20220226
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /cluster/software/impi/2021.6.0-intel-compilers-2022.1.0/mpi/2021.6.0/bin/mpiicc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /cluster/software/impi/2021.6.0-intel-compilers-2022.1.0/mpi/2021.6.0/bin/mpiicpc - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.7.3")
-- Checking for one of the modules 'netcdf-cxx4'
-- Found OpenMP_C: -qopenmp (found version "5.0")
-- Found OpenMP_CXX: -qopenmp (found version "5.0")
-- Found OpenMP: TRUE (found version "5.0")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found Boost: /usr/include (found version "1.75.0") found components: program_options log date_time log_setup filesystem thread regex chrono atomic
-- Found MPI_C: /cluster/software/impi/2021.6.0-intel-compilers-2022.1.0/mpi/2021.6.0/bin/mpiicc (found version "3.1")
-- Found MPI_CXX: /cluster/software/impi/2021.6.0-intel-compilers-2022.1.0/mpi/2021.6.0/bin/mpiicpc (found version "3.1")
-- Found MPI: TRUE (found version "3.1") found components: C CXX
-- Found Python: /usr/bin/python3.9 (found version "3.9.16") found components: Interpreter

... and then there's a bunch of errors because I'm having problems with the python environment, but this shouldn't be a problem.

The compiler version is slightly older than yours, but that seems to make a difference. So then my error is perhaps not very interesting.

[einola@login-2.FRAM ~/src/nextsimdg/intel]$ mpiicc --version
icc (ICC) 2021.6.0 20220226
Copyright (C) 1985-2022 Intel Corporation.  All rights reserved.

[einola@login-2.FRAM ~/src/nextsimdg/intel]$ mpiicpc --version
icpc (ICC) 2021.6.0 20220226
Copyright (C) 1985-2022 Intel Corporation.  All rights reserved.

@andreapiacentini: What version are you using?

Let's also see what happens when @auraoupa tries to get Intel working with the CI.

andreapiacentini commented 4 months ago

Hi, I had problems (and different ones) bot on my laptop with

(PyO) (davinci)~:1002>mpiicc --version
icc (ICC) 2021.1 Beta 20201112
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.

(PyO) (davinci)~:1003>mpiicpc --version
icpc (ICC) 2021.1 Beta 20201112
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.

and on the Météo-France mainframe with

(belenoslogin3)~:1002>mpiicc --version
icc (ICC) 18.0.5 20180823
Copyright (C) 1985-2018 Intel Corporation.  All rights reserved.

(belenoslogin3)~:1003>mpiicpc --version
icpc (ICC) 18.0.5 20180823
Copyright (C) 1985-2018 Intel Corporation.  All rights reserved.
auraoupa commented 3 months ago

Hi @TomMelt and @einola ! I started building a docker image with intel compilers to add to the CI but I must be missing something because it does not compile, the cmake command gives this :

# cmake ..
-- The C compiler identification is IntelLLVM 2023.2.0
-- The CXX compiler identification is IntelLLVM 2023.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /opt/views/view/compiler/2023.2.1/linux/bin/icx
-- Check for working C compiler: /opt/views/view/compiler/2023.2.1/linux/bin/icx - broken
CMake Error at /opt/software/linux-ubuntu22.04-zen2/gcc-11.4.0/cmake-3.27.7-kf673ma62g4gmlnduycnqluovk6knhzd/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "/opt/views/view/compiler/2023.2.1/linux/bin/icx"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/nextsimdg/build/CMakeFiles/CMakeScratch/TryCompile-0AkUEE'

    Run Build Command(s): /opt/software/linux-ubuntu22.04-zen2/gcc-11.4.0/cmake-3.27.7-kf673ma62g4gmlnduycnqluovk6knhzd/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_15bfe/fast
    /usr/bin/gmake  -f CMakeFiles/cmTC_15bfe.dir/build.make CMakeFiles/cmTC_15bfe.dir/build
    gmake[1]: Entering directory '/nextsimdg/build/CMakeFiles/CMakeScratch/TryCompile-0AkUEE'
    Building C object CMakeFiles/cmTC_15bfe.dir/testCCompiler.c.o
    /opt/views/view/compiler/2023.2.1/linux/bin/icx    -MD -MT CMakeFiles/cmTC_15bfe.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_15bfe.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_15bfe.dir/testCCompiler.c.o -c /nextsimdg/build/CMakeFiles/CMakeScratch/TryCompile-0AkUEE/testCCompiler.c
    Linking C executable cmTC_15bfe
    /opt/software/linux-ubuntu22.04-zen2/gcc-11.4.0/cmake-3.27.7-kf673ma62g4gmlnduycnqluovk6knhzd/bin/cmake -E cmake_link_script CMakeFiles/cmTC_15bfe.dir/link.txt --verbose=1
    /opt/views/view/compiler/2023.2.1/linux/bin/icx CMakeFiles/cmTC_15bfe.dir/testCCompiler.c.o -o cmTC_15bfe
    /usr/bin/ld: /opt/software/linux-ubuntu22.04-zen2/gcc-11.4.0/intel-oneapi-compilers-2023.2.1-2rozt3ehbzwbex7texurn33kticj4qdn/compiler/2023.2.1/linux/compiler/lib/intel64_lin/libsvml.a: error adding symbols: archive has no index; run ranlib to add one
    icx: error: linker command failed with exit code 1 (use -v to see invocation)
    gmake[1]: *** [CMakeFiles/cmTC_15bfe.dir/build.make:100: cmTC_15bfe] Error 1
    gmake[1]: Leaving directory '/nextsimdg/build/CMakeFiles/CMakeScratch/TryCompile-0AkUEE'
    gmake: *** [Makefile:127: cmTC_15bfe/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:5 (project)

I built the image from this dockerfile, @TomMelt can you spot what is wrong ? I guess the intel compiler is quite recent (IntelLLVM 2023.2.0) maybe too recent ? What spack commands did you use to make it work with Intel 2021.10.0.20230609 ?

andreapiacentini commented 3 months ago

Hi again, in the meantime I've double checked the current compiler and intel mpi versions used for the NEMO compilation in the coupled runs at Météo-France

They use some oldish yet well tested and stable releases:

intel/2018.5.274 intelmpi/2018.5.274 phdf5/1.8.18 netcdf_par/4.7.1_V2 N.B. no C++ interfaces xios-2.5_rev1903

(cf /home/gmgec/mrgi/voldoire/SAVE/nemo/NEMO-forge/arch/CNRM/arch-xios-trunk-r2253-oasis5.fcm on belenos M.F. mainframe)

I hope we'll get to a NextSIM-DG compiling with all possible intel flavours, but this one is the one to be granted.

timspainNERSC commented 3 months ago

We target C++17, and do use a handful of C++17 features. I found a matrix of Intel's C++17 support. Do you know what version 2018.5.274 corresponds to on the linked chart?

andreapiacentini commented 3 months ago

Hi, when loading the intel/2018.5.274 module we get this answer:

(belenoslogin1)~:1001>icpc --version
icpc (ICC) 18.0.5 20180823
Copyright (C) 1985-2018 Intel Corporation.  All rights reserved.

Cheers

andreapiacentini commented 1 month ago

After discussion with @TomMelt, @einola and @timspainNERSC, I've installed on my PC (no spack, direct compilation, mostly autotools or b2)

Choosing a recent NetCDF-C solves the issue about the | NC_MPIIO bit. Yet I still need to fix ConfigOutput.cpp as in PR #679
It is now possible to compile NextSIM-DG either choosing the gnu wrappers mpicc, mpicxx or the intel wrappers mpiicc, mpiicpc.
In the second case, when compiling the main programs a warning about functions simultaneously being inline and not appears. Does it mean somthing to you?
With the gnu compiler I can run tests, with the intel compiler I can run the examples in run, but not the tests. Any idea why?

einola commented 1 month ago

I also got a warning about being simultaneously in-line and not. I have no idea what it means. It's worth checking out, but it's not a very high priority (at least not yet).

Which tests don't run, and what are the errors?

andreapiacentini commented 1 month ago

I've tried to run our beloved simple coupling test. And the executable crashes on a sygsev violation at loading. No other messages. Trying to run under totalview is useless: the crash happens before the executable is entirely loaded.
Since the nextsimdg executable runs fine, my hypothesis is that doctest_mpi - or the way we use it - could be incompatible with my intel run time. Does it run ok for you?

andreapiacentini commented 1 month ago

Moving up from

(PyO) (davinci)~:1001>which mpirun
/scratch/root/opt/intel/oneapi/mpi/2021.1.1/bin/mpirun
(PyO) (davinci)~:1002>mpiicpc --version
icpc (ICC) 2021.1 Beta 20201112

to

(PyO) (davinci)~/SASIP/nextsimdg/run_coupled_test:1032>which mpirun
/scratch/root/opt/intel/oneapi/mpi/2021.5.0/bin/mpirun
(PyO) (davinci)~/SASIP/nextsimdg/run_coupled_test:1033>mpiicpc --version
icpc (ICC) 2021.5.0 20211109

the test passes.

NextSIM-DG is really a young and modern guy.
Notice that this version of OneAPI (distributed as oneAPI 2022.2.1, their numbering is pretty misleading) is the last one I can install with the glibc versions of the CERFACS workstations.

About the strange warning, I've noticed that the in eigen/3.4.0/include/eigen3/Eigen/src/Core/util/DisableStupidWarnings.h we read

#elif defined __INTEL_COMPILER
  // 2196 - routine is both "inline" and "noinline" ("noinline" assumed)
  //        ICC 12 generates this warning even without any inline keyword, when defining class methods 'inline' i.e. inside of class body
  //        typedef that may be a reference type.
  // 279  - controlling expression is constant
  //        ICC 12 generates this warning on assert(constant_expression_depending_on_template_params) and frankly this is a legitimate use case.
  // 1684 - conversion from pointer to same-sized integral type (potential portability problem)
  // 2259 - non-pointer conversion from "Eigen::Index={ptrdiff_t={long}}" to "int" may lose significant bits
  #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
    #pragma warning push
  #endif
  #pragma warning disable 2196 279 1684 2259

2196 is considered a stupid warning. I don't think you've to worry.