diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 366786d..6883c49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,17 +107,12 @@ jobs: os: [ubuntu-latest] mpi: [nompi] socket: [nosocket, socket] - fc: [ifort] + fc: [ifx] cc: [icx] env: FC: ${{ matrix.fc }} CC: ${{ matrix.cc }} WITH_MPI: false - APT_PACKAGES: >- - intel-oneapi-compiler-fortran - intel-oneapi-compiler-dpcpp-cpp - intel-oneapi-mkl - intel-oneapi-mkl-devel CMAKE_OPTIONS: >- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DFYPP_FLAGS='-DTRAVIS' @@ -131,34 +126,28 @@ jobs: with: python-version: 3.x - - name: Add Intel repository - if: contains(matrix.os, 'ubuntu') - run: | - wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null - echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - sudo apt-get update + - name: Setup Intel compiler + uses: rscohn2/setup-oneapi@v0 + with: + components: | + icx@2025.0.0 + ifx@2025.0.0 + mkl@2025.0.0 - - name: Install Intel oneAPI compiler - if: contains(matrix.os, 'ubuntu') + - name: Setup Intel environment run: | - sudo apt-get update - sudo apt-get install ${APT_PACKAGES} source /opt/intel/oneapi/setvars.sh - printenv >> $GITHUB_ENV + printenv >> ${GITHUB_ENV} + echo "FC=ifx" >> ${GITHUB_ENV} + echo "CC=icx" >> ${GITHUB_ENV} - - name: Install HDF5 (gcc) - if: contains(matrix.os, 'ubuntu') - run: | - sudo apt-get update - sudo apt-get install hdf5-tools libhdf5-dev libhdf5-103 - - - name: Install HDF5 (intel) + - name: Install HDF5 if: contains(matrix.os, 'ubuntu') run: | - wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.13/hdf5-1.13.2/src/CMake-hdf5-1.13.2.tar.gz - tar xfz CMake-hdf5-1.13.2.tar.gz - cd CMake-hdf5-1.13.2/hdf5-1.13.2/ - CC=icx CXX=icx FC=ifort F9X=ifort ./configure --prefix=${PWD}/hdf5 --enable-fortran --with-default-api-version=v110 --enable-shared + wget https://support.hdfgroup.org/releases/hdf5/v1_14/v1_14_4/downloads/hdf5-1.14.4-3.tar.gz + tar xfz hdf5-1.14.4-3.tar.gz + cd hdf5-1.14.4-3/ + CC=icx CXX=icx FC=ifx F9X=ifx ./configure --prefix=${PWD}/hdf5 --enable-fortran --enable-shared make -j -l2 make install export HDF5_ROOT=${PWD}/hdf5 @@ -169,7 +158,7 @@ jobs: if: contains(matrix.mpi, 'nompi') run: | echo "WITH_MPI=false" >> $GITHUB_ENV - echo "FC=ifort" >> $GITHUB_ENV + echo "FC=ifx" >> $GITHUB_ENV - name: Enable socket build if: contains(matrix.socket, 'socket') @@ -198,7 +187,7 @@ jobs: - name: Run regression tests run: | pushd ${BUILD_DIR} - ctest -j 2 --output-on-failure + ctest -j2 --output-on-failure popd - name: Install project diff --git a/prog/fortnet/lib_descriptors/acsf.F90 b/prog/fortnet/lib_descriptors/acsf.F90 index 316987f..e45f45e 100644 --- a/prog/fortnet/lib_descriptors/acsf.F90 +++ b/prog/fortnet/lib_descriptors/acsf.F90 @@ -11,7 +11,6 @@ module fnet_acsf use h5lt - use hdf5 use dftbp_accuracy, only : dp use dftbp_message, only : error @@ -1780,9 +1779,6 @@ subroutine TAcsf_toFile(this, fname) !! auxiliary variables integer :: iFunc, iErr, tmp, tExist - ! open the hdf5 interface - call h5open_f(iErr) - ! open the netstat file call h5fopen_f(fname, H5F_ACC_RDWR_F, file_id, iErr) @@ -1905,9 +1901,6 @@ subroutine TAcsf_toFile(this, fname) ! close the netstat file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine TAcsf_toFile @@ -1944,9 +1937,6 @@ subroutine TAcsf_fromFile(this, fname, tReduce, tStandardize, nRadial, nAngular) real(dp), allocatable :: tmpRealArray1d(:) integer :: iFunc, iErr, tExist, tmpInt(1) - ! open the hdf5 interface - call h5open_f(iErr) - ! open the netstat file call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr) @@ -2118,9 +2108,6 @@ subroutine TAcsf_fromFile(this, fname, tReduce, tStandardize, nRadial, nAngular) ! close the netstat file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - nRadial = 0 nAngular = 0 allocate(tmpAtomicNumbers(0)) diff --git a/prog/fortnet/lib_fortnet/initprogram.F90 b/prog/fortnet/lib_fortnet/initprogram.F90 index 3bda955..ef029dc 100644 --- a/prog/fortnet/lib_fortnet/initprogram.F90 +++ b/prog/fortnet/lib_fortnet/initprogram.F90 @@ -594,7 +594,7 @@ subroutine readDriverBlock(driver, analysis, driverNode, parent) type(fnode), pointer :: child, child2, child3, child4, value1, field - type(string) :: buffer, buffer2, modifier + type(string) :: buffer, buffer2 !! string buffer instance type(string) :: strBuffer diff --git a/prog/fortnet/lib_io/fnetdata.F90 b/prog/fortnet/lib_io/fnetdata.F90 index 9dd8e3f..60c75f7 100644 --- a/prog/fortnet/lib_io/fnetdata.F90 +++ b/prog/fortnet/lib_io/fnetdata.F90 @@ -11,7 +11,6 @@ module fnet_fnetdata use h5lt - use hdf5 use dftbp_assert use dftbp_accuracy, only: dp, mc @@ -557,9 +556,6 @@ subroutine inquireStructures(fname, tStructures) !! auxiliary variable integer :: iErr - ! open the hdf5 interface - call h5open_f(iErr) - ! open the dataset file call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr) @@ -573,9 +569,6 @@ subroutine inquireStructures(fname, tStructures) ! close the dataset file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine inquireStructures @@ -606,9 +599,6 @@ subroutine inquireTargets(fname, tGlobalTargets, tAtomicTargets, nGlobalTargets, !! auxiliary variables integer :: iErr - ! open the hdf5 interface - call h5open_f(iErr) - ! open the dataset file call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr) @@ -639,9 +629,6 @@ subroutine inquireTargets(fname, tGlobalTargets, tAtomicTargets, nGlobalTargets, ! close the dataset file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine inquireTargets @@ -666,9 +653,6 @@ subroutine inquireExtFeatures(fname, tFeatures, nFeatures) !! auxiliary variables integer :: iErr - ! open the hdf5 interface - call h5open_f(iErr) - ! open the dataset file call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr) @@ -687,9 +671,6 @@ subroutine inquireExtFeatures(fname, tFeatures, nFeatures) ! close the dataset file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine inquireExtFeatures @@ -1033,9 +1014,6 @@ subroutine readHdfDataset(fname, dataset) !! auxiliary variables integer :: iErr, iDatapoint, tExist - ! open the hdf5 interface - call h5open_f(iErr) - ! open the dataset file call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr) @@ -1232,9 +1210,6 @@ subroutine readHdfDataset(fname, dataset) ! close the dataset file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - ! perform some basic consistency checks call dataset%checkConsistency() diff --git a/prog/fortnet/lib_io/fnetout.F90 b/prog/fortnet/lib_io/fnetout.F90 index 1c2dbba..e18a1e1 100644 --- a/prog/fortnet/lib_io/fnetout.F90 +++ b/prog/fortnet/lib_io/fnetout.F90 @@ -11,7 +11,6 @@ module fnet_fnetout use h5lt - use hdf5 use dftbp_message, only : error use dftbp_accuracy, only: dp @@ -75,9 +74,6 @@ subroutine writeFnetout(fname, mode, globalTargets, atomicTargets, output, force call error('Validation mode only valid in combination with target data.') end if - ! open the hdf5 interface - call h5open_f(iErr) - ! create the fnetout file call h5fcreate_f(fname, H5F_ACC_TRUNC_F, file_id, iErr) @@ -159,9 +155,6 @@ subroutine writeFnetout(fname, mode, globalTargets, atomicTargets, output, force ! close the fnetout file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine writeFnetout end module fnet_fnetout diff --git a/prog/fortnet/lib_io/netstat.F90 b/prog/fortnet/lib_io/netstat.F90 index bd58932..795682d 100644 --- a/prog/fortnet/lib_io/netstat.F90 +++ b/prog/fortnet/lib_io/netstat.F90 @@ -11,7 +11,6 @@ module fnet_netstat use h5lt - use hdf5 use dftbp_message, only : error use dftbp_charmanip, only : i2c, tolower @@ -46,9 +45,6 @@ subroutine createNetstat(fname) !! auxiliary variable integer :: iErr - ! open the hdf5 interface - call h5open_f(iErr) - ! create the netstat file call h5fcreate_f(fname, H5F_ACC_TRUNC_F, file_id, iErr) @@ -61,9 +57,6 @@ subroutine createNetstat(fname) ! close the netstat file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine createNetstat @@ -82,9 +75,6 @@ subroutine inquireExtFeatures(fname, tExtFeatures) !! auxiliary variables integer :: iErr, tExist, tmp(1) - ! open the hdf5 interface - call h5open_f(iErr) - ! open the netstat file call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr) @@ -116,9 +106,6 @@ subroutine inquireExtFeatures(fname, tExtFeatures) ! close the netstat file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine inquireExtFeatures @@ -138,9 +125,6 @@ subroutine inquireAcsf(fname, tAcsf) character(len=100) :: tmpStr integer :: iErr, tExist - ! open the hdf5 interface - call h5open_f(iErr) - ! open the netstat file call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr) @@ -172,9 +156,6 @@ subroutine inquireAcsf(fname, tAcsf) ! close the netstat file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine inquireAcsf @@ -193,9 +174,6 @@ subroutine readExtFeaturesConfig(fname, ext) !! auxiliary variables integer :: iErr, tExist, tmp(1) - ! open the hdf5 interface - call h5open_f(iErr) - ! open the netstat file call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr) @@ -230,9 +208,6 @@ subroutine readExtFeaturesConfig(fname, ext) ! close the netstat file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine readExtFeaturesConfig @@ -273,9 +248,6 @@ subroutine readSubnetArchitecture(fname, type, activation, topology) ! currently only the BPNN topology is supported type = 'bpnn' - ! open the hdf5 interface - call h5open_f(iErr) - ! open the netstat file call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr) @@ -333,9 +305,6 @@ subroutine readSubnetArchitecture(fname, type, activation, topology) ! close the netstat file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine readSubnetArchitecture @@ -364,9 +333,6 @@ subroutine writeBpnnHeader(fname, bpnn, nGlobalTargets, nAtomicTargets) integer(hsize_t) :: dims(1) integer :: iErr, iNet, iLayer - ! open the hdf5 interface - call h5open_f(iErr) - ! open the netstat file call h5fopen_f(fname, H5F_ACC_RDWR_F, file_id, iErr) @@ -433,9 +399,6 @@ subroutine writeBpnnHeader(fname, bpnn, nGlobalTargets, nAtomicTargets) ! close the netstat file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine writeBpnnHeader @@ -455,9 +418,6 @@ subroutine writeExtFeaturesConfig(fname, ext) integer(hsize_t) :: dim integer :: iErr, tExist - ! open the hdf5 interface - call h5open_f(iErr) - ! open the netstat file call h5fopen_f(fname, H5F_ACC_RDWR_F, file_id, iErr) @@ -490,9 +450,6 @@ subroutine writeExtFeaturesConfig(fname, ext) ! close the netstat file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine writeExtFeaturesConfig end module fnet_netstat diff --git a/prog/fortnet/lib_nn/bpnn.F90 b/prog/fortnet/lib_nn/bpnn.F90 index e96b0e8..1e354c6 100644 --- a/prog/fortnet/lib_nn/bpnn.F90 +++ b/prog/fortnet/lib_nn/bpnn.F90 @@ -11,7 +11,6 @@ module fnet_bpnn use h5lt - use hdf5 use dftbp_message, only : error use dftbp_globalenv, only : stdOut @@ -1077,9 +1076,6 @@ subroutine TBpnn_toFile(this, fname) !! auxiliary variables integer :: iErr, iNet, iLayer, tExist - ! open the hdf5 interface - call h5open_f(iErr) - ! open the netstat file call h5fopen_f(fname, H5F_ACC_RDWR_F, file_id, iErr) @@ -1138,9 +1134,6 @@ subroutine TBpnn_toFile(this, fname) ! close the netstat file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine TBpnn_toFile @@ -1181,9 +1174,6 @@ subroutine TBpnn_fromFile(this, fname) !! auxiliary variables integer :: iErr, iNet, iLayer - ! open the hdf5 interface - call h5open_f(iErr) - ! open the netstat file call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr) @@ -1295,9 +1285,6 @@ subroutine TBpnn_fromFile(this, fname) ! close the netstat file call h5fclose_f(file_id, iErr) - ! close the hdf5 interface - call h5close_f(iErr) - end subroutine TBpnn_fromFile end module fnet_bpnn diff --git a/prog/fortnet/prg_fnet/fortnet.F90 b/prog/fortnet/prg_fnet/fortnet.F90 index 0be5d94..b7aaa2a 100644 --- a/prog/fortnet/prg_fnet/fortnet.F90 +++ b/prog/fortnet/prg_fnet/fortnet.F90 @@ -10,6 +10,8 @@ !> Defines the general behavior of Fortnet. program fortnet + use hdf5 + use dftbp_accuracy, only : dp use dftbp_message, only : error use dftbp_charmanip, only : toupper @@ -74,6 +76,9 @@ program fortnet !> file name of generic Fortnet iterout.dat file character(len=*), parameter :: iteroutFile = 'iterout.dat' + !> error status + integer :: iErr + #:if WITH_SOCKETS !> representation of ACSF mappings and derivatives @@ -102,10 +107,13 @@ program fortnet #:endif - !> initialise global environment + ! initialise global environment call initGlobalEnv() - !> initialise program variables + ! open the hdf5 interface + call h5open_f(iErr) + + ! initialise program variables call TEnv_init(prog%env) call TProgramVariables_init(prog) @@ -200,6 +208,9 @@ program fortnet end if + ! close the hdf5 interface + call h5close_f(iErr) + call destructGlobalEnv() @@ -262,9 +273,6 @@ subroutine handleInitialisation(prog, bpnn, trainAcsf) !! true, if current process is the lead logical :: tLead - !! true, if an ACSF configuration is found in the netstat file - logical :: tAcsf - #:if WITH_MPI tLead = prog%env%globalMpiComm%lead #:else @@ -525,9 +533,6 @@ subroutine predictForSocketComm(prog, bpnn, acsf, acsfPrime, geo, globalPredicti !! index mapping local atom --> global species index type(TIntArray1D), allocatable :: localAtToGlobalSp(:) - !! additional external, atomic features of the dataset - real(dp), allocatable :: extFeatures(:,:) - !! true, if current process is the lead logical :: tLead @@ -543,9 +548,6 @@ subroutine predictForSocketComm(prog, bpnn, acsf, acsfPrime, geo, globalPredicti !! total number of atomic input features integer :: nFeatures - !! number of unique elements in geometry - integer :: nElements - #:if WITH_MPI tLead = prog%env%globalMpiComm%lead #:else