From e643bbcf9eb69566613f7dc3283a8b40dddb866b Mon Sep 17 00:00:00 2001 From: chn Date: Tue, 24 Sep 2024 11:25:22 +0800 Subject: [PATCH] packages.vasp.intel: use openmpi --- flake.lock | 6 +++--- packages/default.nix | 23 +++++++++++++---------- packages/vasp/intel/default.nix | 11 +++-------- packages/vasp/intel/makefile.include | 4 ++-- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/flake.lock b/flake.lock index 3448d8cc..4fee9cad 100644 --- a/flake.lock +++ b/flake.lock @@ -970,11 +970,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1724925520, - "narHash": "sha256-MfvD4Ed4wCTG1V+h3rUN9j9csEi+2tgpRwhGAV4MFqw=", + "lastModified": 1727148179, + "narHash": "sha256-XITWIyKQ6owAcFn1Tq53By5kOYqLt/fhAw4y+rPTZfU=", "owner": "CHN-beta", "repo": "nixpkgs", - "rev": "8c66b7335f2f4ab354e41d828b74d851c64c4b85", + "rev": "4cc8c8166956210ccf8c731bb2aec3d95648180e", "type": "github" }, "original": { diff --git a/packages/default.nix b/packages/default.nix index aaf9e695..29ddc4f1 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -55,18 +55,21 @@ inputs: rec { inherit vtst src; inherit (inputs.pkgs.intelPackages_2023) stdenv; - mpi = inputs.pkgs.intelPackages_2023.intel-mpi; - hdf5 = hdf5-oneapi; + mpi = inputs.pkgs.openmpi.override + { + inherit (inputs.pkgs.intelPackages_2023) stdenv; + enableSubstitute = false; + }; + hdf5 = inputs.pkgs.hdf5.override + { + inherit (inputs.pkgs.intelPackages_2023) stdenv; + cppSupport = false; + fortranSupport = true; + enableShared = false; + enableStatic = true; + }; }; hdf5-nvhpc = inputs.pkgs.callPackage ./vasp/hdf5-nvhpc { inherit lmod nvhpc; inherit (inputs.pkgs.hdf5) src; }; - hdf5-oneapi = inputs.pkgs.hdf5.override - { - inherit (inputs.pkgs.intelPackages_2023) stdenv; - cppSupport = false; - fortranSupport = true; - enableShared = false; - enableStatic = true; - }; vtst = (inputs.pkgs.callPackage ./vasp/vtst.nix {}); vtstscripts = inputs.pkgs.callPackage ./vasp/vtstscripts.nix {}; }; diff --git a/packages/vasp/intel/default.nix b/packages/vasp/intel/default.nix index 5101064a..afe0de18 100644 --- a/packages/vasp/intel/default.nix +++ b/packages/vasp/intel/default.nix @@ -35,17 +35,12 @@ let vasp = stdenv.mkDerivation # vasp directly include headers under ${mkl}/include/fftw MKLROOT = mkl; + + # tell openmpi use ifx + OMPI_F90 = "ifx"; }; in writeShellScriptBin "vasp-intel" '' - # not sure why mpi could not find libfabric.so - export LD_LIBRARY_PATH=${libfabric}/lib''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} - - # intel mpi need this to talk with slurm - ${lib.optionalString integratedWithSlurm "export I_MPI_PMI_LIBRARY=${slurm}/lib/libpmi2.so"} - - # add vasp and intel mpi in PATH export PATH=${vasp}/bin:${mpi}/bin''${PATH:+:$PATH} - exec "$@" '' diff --git a/packages/vasp/intel/makefile.include b/packages/vasp/intel/makefile.include index e295d499..5be1d391 100644 --- a/packages/vasp/intel/makefile.include +++ b/packages/vasp/intel/makefile.include @@ -12,8 +12,8 @@ CPP_OPTIONS = -DHOST=\"LinuxIFC\" \ CPP = fpp -f_com=no -free -w0 $*$(FUFFIX) $*$(SUFFIX) $(CPP_OPTIONS) -FC = mpiifx -qopenmp -FCL = mpiifx +FC = mpif90 -qopenmp +FCL = mpif90 FREE = -free -names lowercase