Skip to content

Commit

Permalink
molpro: 2021.2.1 -> 2024.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
markuskowa committed Nov 27, 2024
1 parent bf677ae commit cb65d24
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
25 changes: 18 additions & 7 deletions pkgs/apps/molpro/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, requireFile, fetchurl, patchelf, python3
{ lib, stdenv, requireFile, patchelf, python3
, token
, comm ? "sockets"
} :
Expand All @@ -7,7 +7,7 @@ assert token != null;
assert (comm == "sockets") || (comm == "mpipr");

let
version = "2021.2.1";
version = "2024.3.0";
url = "http://www.molpro.net";

in stdenv.mkDerivation {
Expand All @@ -17,11 +17,11 @@ in stdenv.mkDerivation {
src = requireFile (if comm == "sockets" then {
inherit url;
name = "molpro-mpp-${version}.linux_x86_64_sockets.sh.gz";
sha256 = "05ngn0inffng12i3nn820f4cz9g28lz71mi8v5jzvwxbqim0dhds";
sha256 = "sha256-3yhUfo/2xYqO8Y22KKpja1kO2JpuV7/lsOBFamOxNUQ=";
} else {
inherit url;
name = "molpro-mpp-${version}.linux_x86_64_mpipr.sh.gz";
sha256 = "1hragygrqr3zwimc7c1vv2nkpzgrnjx32xrlsn21r1xgxcp66zni";
sha256 = "sha256-mhBhz6SIbbtZ1LcL+sEo33htkVOHYjamPh5db8xPzEs=";
});

nativeBuildInputs = [ patchelf ];
Expand All @@ -48,9 +48,14 @@ in stdenv.mkDerivation {
postFixup = ''
#
# Since version 2019.1 the binaris are dynamically linked
for bin in hydra_pmi_proxy molpro.exe mpiexec.hydra; do
for bin in ${lib.optionalString (comm == "sockets") "hydra_pmi_proxy mpiexec"} molpro.exe; do
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/$bin
done ''
+ lib.optionalString (comm == "mpipr") ''
for bin in hydra_pmi_proxy mpiexec mpiexec.hydra hydra_bstrap_proxy; do
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/impi/bin/$bin
done
'';

Expand All @@ -77,8 +82,14 @@ in stdenv.mkDerivation {
# pretend this is a writable home dir
export HOME=$PWD
# need to specify interface or: "MPID_nem_tcp_init(373) gethostbyname failed"
$out/bin/molpro --launcher \
"$out/bin/mpiexec.hydra -iface lo $out/bin/molpro.exe" $inp.inp
${lib.optionalString (comm == "sockets") ''
$out/bin/molpro --launcher \
"$out/bin/mpiexec -iface lo $out/bin/molpro.exe" $inp.inp
''}
${lib.optionalString (comm == "mpipr") ''
$out/bin/molpro --launcher \
$out/bin/molpro.exe $inp.inp
''}
echo "Check for successful run:"
grep "RHF STATE 1.1 Energy" $inp.out
Expand Down
8 changes: 4 additions & 4 deletions tests/molpro/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ batsTest {
testScript = ''
@test "Run-Molpro" {
${molpro}/bin/molpro --launcher \
"${molpro}/bin/mpiexec.hydra -iface lo
"${molpro}/bin/mpiexec -iface lo
-np $TEST_NUM_CPUS ${molpro}/bin/molpro.exe" \
molpro.inp
}
Expand All @@ -31,12 +31,12 @@ batsTest {
}
@test "CASPT2 Energy" {
grep '!RSPT2 STATE 1.1 Energy' molpro.out | tail -1 | grep '\-114.3045096'
grep '!RSPT2 STATE 1.1 Energy' molpro.out | tail -1 | grep '\-114.304518'
}
@test "MRCI Energy" {
grep '!MRCI STATE 1.1 Energy' molpro.out | grep '\-114.2818399'
grep '!MRCI STATE 2.1 Energy' molpro.out | grep '\-114.0268108'
grep '!MRCI STATE 1.1 Energy' molpro.out | grep '\-114.281846'
grep '!MRCI STATE 2.1 Energy' molpro.out | grep '\-114.026817'
}
'';
}
Expand Down
4 changes: 2 additions & 2 deletions tests/molpro/molpro.inp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ HF
state,3;
}

{rs2;noexc;}
force;

optg
optg,variable=energy(1)

freq

Expand Down

0 comments on commit cb65d24

Please sign in to comment.