GEOS-DEV / GEOS

GEOS Simulation Framework
GNU Lesser General Public License v2.1
207 stars 83 forks source link

Move forward to C++20 #3223

Open untereiner opened 2 months ago

untereiner commented 2 months ago

What is the requested feature? I want to open discussions to move forward to c++20

Is your request related to a specific problem? Below is a list of desirable features that are standardized in C++20. I also put the min (compiler/stdlib) versions where they are implemented

clang gcc
standardized text format (in replacement of fmt) 17 13
range library 15 10
concepts library 13 10
span 7 10
litterals as template params 12 9

I would like to discuss the feasibility of this change on the different architectures that geos is compiled on..

Describe the solution you'd like n.a.

Describe alternatives you've considered n.a.

Additional context n.a.

CusiniM commented 2 months ago

We are mostly ready for this. It's part of the reason why we started compiling with cuda12. The only oustanding issues/questions are:

untereiner commented 2 months ago

Thanks @CusiniM ! The question raised today in the team while implementing with string literals and templates.

For TTE maybe @Bubusch can also answer ?

paveltomin commented 2 months ago
  • do all target platforms have cuda12 and compilers that are new enough for novel c++20 features?
    • Chevron @paveltomin ?

CC @drmichaeltcvx I think we do, I've been compiling with gcc 13 recently and it works fine but there are tons of warnings which would be nice to fix

Bubusch commented 2 months ago

@CusiniM @untereiner

Not yet on Pangea 3, I just asked to install cuda12 and gcc12 so we can make the switch. Pangea 4 is OK.

FYI @sframba @herve-gross

wrtobin commented 2 months ago

@CusiniM

BLT and its ability to set the C++ standard for HIP compilation have been updated to include C++20 support. The HIP/ROCM compilers we use are all clang-based and the intent is that they support the same standards the underlying clang compiler does. Naturally we might encounter issues/failures on that end, but if we do we can report them as bugs to AMD and they should be resolved eventually.

rrsettgast commented 2 months ago

@untereiner @wrtobin @CusiniM Other than Pangea3 and El Capitan, I don't see any potential problems. Perhaps we make a c++20 branch, and start testing some of the features we want to use in the code so that we can ensure portability.

CusiniM commented 2 months ago

@untereiner @wrtobin @CusiniM Other than Pangea3 and El Capitan, I don't see any potential problems. Perhaps we make a c++20 branch, and start testing some of the features we want to use in the code so that we can ensure portability.

sounds like a plan. I think we should do it once https://github.com/GEOS-DEV/GEOS/pull/3218 is merged.

drmichaeltcvx commented 2 months ago

For CPU GEOS, we have been compiling using GCC 13.2.0 and running it w/o any issues on Zen4 and Zen4 AMD platforms. For GPU GEOS, we have been successfully building with CUDA 12.2 and 11.8 using GCC 11.4.0.

I believe that CUDA 12.4 started supporting GCC 13.X (https://developer.nvidia.com/blog/cuda-toolkit-12-4-enhances-support-for-nvidia-grace-hopper-and-confidential-computing/#:~:text=A100%20performance%20improvements-,Compiler%20updates,objects%20supporting%20multiple%20GPU%20architectures.)

I need to report that we have started getting some run-time errors with the CUDA 12.2 builds. I believe that @victorapm will be looking into this issues.

Bubusch commented 1 month ago

@CusiniM @untereiner

We received feedback from IBM that Pangea3 current drivers are not compatible with cuda12.
 They plan to update the driver in January 2025 during a maintenance operation. I'll keep you updated on the progress.

FYI @sframba @herve-gross