Skip to content

Commit

Permalink
Compiling with NVHPC (plumed#1076)
Browse files Browse the repository at this point in the history
* now nvhpc24.3 compiles

* upgrade to the workflow

* changed the position of the define near to where it is needed

* Update MergeVectorTools.h on GH

* Update MergeVectorTools.h: adding a more explanatory comment

* small modification to the CI

* changing again linuxWF for nvhpc

---------

Co-authored-by: Daniele Rapetti <[email protected]>
  • Loading branch information
Iximiel and Iximiel authored Oct 10, 2024
1 parent b1839ab commit c28e2d0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/linuxWF.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
# see https://github.com/plumed/plumed2/issues/976
- -intel-
- -pycv-mpi-
#this does not install mpi but uses the internal one
- -nvhpc-mpi-
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
Expand Down Expand Up @@ -136,6 +138,18 @@ jobs:
echo "CXX=icpx" >> $GITHUB_ENV
echo "CC=icx" >> $GITHUB_ENV
echo "FC=ifx" >> $GITHUB_ENV
- name: Install NVHPC compiler
if: contains( matrix.variant, '-nvhpc-' )
# use this if it does not work
# wget https://developer.download.nvidia.com/hpc-sdk/24.3/nvhpc_2024_243_Linux_x86_64_cuda_12.3.tar.gz
# tar xpzf nvhpc_2024_243_Linux_x86_64_cuda_12.3.tar.gz
# nvhpc_2024_243_Linux_x86_64_cuda_12.3/install
run: |
curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg
echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list
sudo apt-get update -y
sudo apt-get install -y nvhpc-24-3
# nvhpcinstalls his own mpi compilers
- name: Install MPI
# install MPI at last since it modifies CC and CXX
if: contains( matrix.variant, '-mpi-' )
Expand Down
3 changes: 2 additions & 1 deletion src/tools/MergeVectorTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ static void mergeSortedVectors(const C* const* vecs, std::size_t size, std::vect
/// to allow using a priority_queu, which selects the highest element.
/// we here (counterintuitively) define < as >
bool operator< (Entry const& rhs) const { return top() > rhs.top(); }
const auto & top() const { return *fwdIt; }
// TODO: revert "typename C::value_type" to "auto": nvc++ and icpc seems to do not deduce automatically the return type
const typename C::value_type & top() const { return *fwdIt; }
void next() { ++fwdIt;};
};

Expand Down

0 comments on commit c28e2d0

Please sign in to comment.