Merge branch 'server' into production

This commit is contained in:
2024-04-14 12:20:22 +08:00
7 changed files with 108 additions and 7 deletions

View File

@@ -57,9 +57,9 @@ inputs: rec
hdf5 = inputs.pkgs.hdf5.override { mpiSupport = true; fortranSupport = true; };
};
nvidia = inputs.pkgs.callPackage ./vasp/nvidia
{ inherit lmod nvhpc wannier90 additionalCommands; hdf5 = hdf5-nvhpc; };
{ inherit lmod nvhpc wannier90 additionalCommands vtst; hdf5 = hdf5-nvhpc; };
intel = inputs.pkgs.callPackage ./vasp/intel
{ inherit lmod oneapi wannier90 additionalCommands; hdf5 = hdf5-oneapi; };
{ inherit lmod oneapi wannier90 additionalCommands vtst; hdf5 = hdf5-oneapi; };
amd = inputs.pkgs.callPackage ./vasp/amd
{ inherit aocc aocl wannier90 additionalCommands; hdf5 = hdf5-aocc; openmpi = openmpi-aocc; gcc = gcc-pie; };
wannier90 = inputs.pkgs.callPackage
@@ -73,6 +73,8 @@ inputs: rec
{ configureFlags = prev.configureFlags ++ [ "--enable-default-pie" ];}));
additionalCommands = let uid = inputs.config.nixos.user.uid.gb; in
''[ "$(${inputs.pkgs.coreutils}/bin/id -u)" -eq ${builtins.toString uid} ] && exit 1'';
vtst = (inputs.pkgs.callPackage ./vasp/vtst.nix {});
vtstscripts = inputs.pkgs.callPackage ./vasp/vtstscripts.nix {};
};
# TODO: use other people packaged hpc version
oneapi = inputs.pkgs.callPackage ./oneapi {};

View File

@@ -1,7 +1,7 @@
{
buildFHSEnv, writeScript, stdenvNoCC, requireFile, substituteAll, symlinkJoin, writeTextDir,
config, oneapiArch ? config.oneapiArch or "SSE3", additionalCommands ? "",
oneapi, gcc, glibc, lmod, rsync, which, wannier90, binutils, hdf5, zlib
oneapi, gcc, glibc, lmod, rsync, which, wannier90, binutils, hdf5, zlib, vtst
}:
let
sources = import ../source.nix { inherit requireFile; };
@@ -31,10 +31,14 @@ let
pname = "vasp-intel";
inherit version;
src = sources.${version};
patches = [ ../vtst.patch ];
configurePhase =
''
cp ${include version} makefile.include
chmod +w makefile.include
cp ${../constr_cell_relax.F} src/constr_cell_relax.F
cp -r ${vtst version}/* src
chmod -R +w src
'';
nativeBuildInputs = [ rsync which ];
HDF5_ROOT = hdf5;

View File

@@ -1,7 +1,7 @@
{
buildFHSEnv, writeScript, stdenvNoCC, requireFile, substituteAll, symlinkJoin,
config, cudaCapabilities ? config.cudaCapabilities, nvhpcArch ? config.nvhpcArch or "px", additionalCommands ? "",
nvhpc, lmod, mkl, gfortran, rsync, which, hdf5, wannier90, zlib
nvhpc, lmod, mkl, gfortran, rsync, which, hdf5, wannier90, zlib, vtst
}:
let
sources = import ../source.nix { inherit requireFile; };
@@ -31,10 +31,14 @@ let
pname = "vasp-nvidia";
inherit version;
src = sources.${version};
patches = [ ../vtst.patch ];
configurePhase =
''
cp ${include version} makefile.include
chmod +w makefile.include
cp ${../constr_cell_relax.F} src/constr_cell_relax.F
cp -r ${vtst version}/* src
chmod -R +w src
'';
enableParallelBuilding = true;
buildInputs = [ mkl hdf5 wannier90 ];

9
local/pkgs/vasp/vtst.nix Normal file
View File

@@ -0,0 +1,9 @@
{ fetchzip, lib }: version:
let
src = fetchzip
{
url = "http://theory.cm.utexas.edu/code/vtstcode-199.tgz";
sha256 = "06c9f14a90ka3p396q6spr25xwkih4n01nm1qjj9fnvqzxlp9k9y";
};
shortVersion = builtins.concatStringsSep "." (lib.lists.take 2 (builtins.splitVersion version));
in if version == null then src else "${src}/vtstcode${shortVersion}"

View File

@@ -0,0 +1,56 @@
diff --color -ur /nix/store/wxa9k7aq7yw0b8rrcnvsmi8jq487x1lr-vasp-6.4.0/src/main.F /home/chn/Desktop/vasp/src/main.F
--- a/src/main.F 1970-01-01 08:00:01.000000000 +0800
+++ b/src/main.F 2024-04-14 11:09:56.920197043 +0800
@@ -965,7 +965,7 @@
! init all chains (INCAR reader)
!-----------------------------------------------------------------------
LCHAIN = IMAGES > 0 .AND. .NOT.AFQMC_SET % ACTIVE
- IF (LCHAIN) CALL chain_init( T_INFO, IO)
+ CALL chain_init( T_INFO, IO)
!-----------------------------------------------------------------------
!xml finish copying parameters from INCAR to xml file
! no INCAR reading from here
@@ -3623,7 +3623,7 @@
ENDIF
CALL CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &
- LATT_CUR%A,LATT_CUR%B,IO%IU6)
+ TSIF,LATT_CUR%A,LATT_CUR%B,IO%IU6)
CALL PARALLEL_TEMPERING(NSTEP,T_INFO%NIONS,DYN%POSION,DYN%VEL,TOTEN,TIFOR,DYN%TEBEG,DYN%TEEND, &
LATT_CUR%A,LATT_CUR%B,IO%IU6)
diff --color -ur /nix/store/wxa9k7aq7yw0b8rrcnvsmi8jq487x1lr-vasp-6.4.0/src/makefile /home/chn/Desktop/vasp/src/makefile
--- a/src/makefile 1970-01-01 08:00:01.000000000 +0800
+++ b/src/makefile 2024-04-14 11:12:29.534219679 +0800
@@ -14,7 +14,7 @@
OFLAG=$(OFLAG_2)
OFLAG_IN=$(OFLAG)
-LIB=lib parser
+LIB=lib parser pyamff_fortran
LLIB=-Llib -ldmy -Lparser -lparser
SRCDIR=../../src
@@ -146,7 +146,7 @@
$(MAKE) -C $@ -j1
# $(MAKE) -C $@
-dependencies: sources
+dependencies: sources libs
$(MAKE) depend
depend: $(F90SRC)
diff --color -ur /nix/store/wxa9k7aq7yw0b8rrcnvsmi8jq487x1lr-vasp-6.4.0/src/.objects /home/chn/Desktop/vasp/src/.objects
--- a/src/.objects 1970-01-01 08:00:01.000000000 +0800
+++ b/src/.objects 2024-04-14 11:10:56.879417040 +0800
@@ -122,6 +122,10 @@
dos.o \
elf.o \
hamil_rot.o \
+ bfgs.o dynmat.o instanton.o lbfgs.o sd.o cg.o dimer.o bbm.o \
+ fire.o lanczos.o neb.o qm.o \
+ pyamff_fortran/*.o ml_pyamff.o \
+ opt.o \
chain.o \
dyna.o \
fileio.o \

View File

@@ -0,0 +1,24 @@
{ fetchzip, stdenv, autoPatchelfHook, perl, writeScriptBin }:
let vtstscript-unwrapped = stdenv.mkDerivation
{
name = "vtstscript-unwrapped";
src = fetchzip
{
url = "http://theory.cm.utexas.edu/code/vtstscripts.tgz";
sha256 = "04476wgxvja15jijh9dxbzwy4mdrdqnd93s66jsm26rf73caj7lr";
};
buildInputs = [ autoPatchelfHook perl ];
installPhase =
''
mkdir -p $out/lib/vtstscripts
cp -r * $out/lib/vtstscripts
patchShebangs $out/lib/vtstscripts
'';
};
in writeScriptBin "vtstscripts"
''
# add vtstscript-unwrapped in PERL5LIB
export PERL5LIB=${vtstscript-unwrapped}/lib/vtstscripts''${PERL5LIB:+:$PERL5LIB}
export PATH=${vtstscript-unwrapped}/lib/vtstscripts''${PATH:+:$PATH}
exec "$@"
''

View File

@@ -2,8 +2,10 @@ inputs:
{
config = inputs.lib.mkIf (builtins.elem "workstation" inputs.config.nixos.packages._packageSets)
{
nixos.packages._packages = builtins.concatLists (builtins.map
(compiler: builtins.map (version: inputs.pkgs.localPackages.vasp.${compiler}.${version}) [ "6.3.1" "6.4.0" ])
[ "amd" "gnu" "gnu-mkl" "intel" "nvidia" ]);
nixos.packages._packages =
(builtins.concatLists (builtins.map
(compiler: builtins.map (version: inputs.pkgs.localPackages.vasp.${compiler}.${version}) [ "6.4.0" ])
[ "intel" "nvidia" ]))
++ [ inputs.pkgs.localPackages.vasp.vtstscripts ];
};
}