CFD-GO / TCLB

TCLB - Templated MPI+CUDA/CPU Lattice Boltzmann code
https://tclb.io
GNU General Public License v3.0
181 stars 71 forks source link

C++11 future #405

Open llaniewski opened 2 years ago

llaniewski commented 2 years ago

Before TCLB progresses into a future, some decisions will have to be made.

One such decision is the version of C++ the base code will use. Problem with this is that once we start using some features of C++11 (for example) it will not be possible anymore to compile the code without said version. That why it's crucial to check to select the lowest possible version of C++ we think is needed and check if the code works everywhere we want it to work.

I see value in C++11 as some of it's features can improve code readability. It also seems to be the most used version. If there are some comments about the version choice, add them here.

@mdzik @ggruszczynski @TravisMitchell @shkodm @ndivaira Can we start to check if compilation with ./configure --enable-cpp11 works with the setups we target. By the setups I mean the combinations of: architecture/cluster, compilation options, features like HDF5 or RInside, with/without DEM, etc. Please comment here where you tested and if it worked or not.

ggruszczynski commented 2 years ago

C++11 is more than 10yrs here. IMHO there is no reason to wait.

I used the following config on the Rysy cluster at ICM

def MODULES_BASE "common/libs/libpng/1.6.37 common/R/4.0.3 common/compilers/gcc/9.3.1 common/mpi/openmpi/4.0.4_gnu-9.3 gpu/cuda/11.1"

def CONFOPT "--enable-cpp11 --enable-rinside --with-cuda-arch=sm_60

https://github.com/ggruszczynski/TCLB_cluster/blob/rysy/cluster/rysy.bash

As far as I remember, it also used to work with HDF5.


BTW, others have succesfully implemented more modern C++ standard.

https://developer.nvidia.com/blog/developing-accelerated-code-with-standard-language-parallelism/ https://developer.nvidia.com/blog/multi-gpu-programming-with-standard-parallel-c-part-1/

https://gitlab.com/unigehpfs/stlbm https://gitlab.com/unigehpfs/eurohack21/-/blob/main/heatEquation2D/heatEquation.cpp

shkodm commented 2 years ago

Can we move right away to C++14, instead of C++11? As I remember, C+14 mainly does some fixes and improvement for C+11 but otherwise the same