Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new tests #38

Open
wants to merge 5 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions test/test_lrdmc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ foreach( EXECUTABLE IN LISTS EXECUTABLES_S_L
set( PREFIX "" )
add_test_dependency_tree(
NAME "Test LRDMC run (${EXECUTABLE})"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA serial.out out_true.o REFERENCE_fortXXI 6 ${PREFIX}
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA datasfn.d serial.out out_true.o REFERENCE_fortXXI 6 ${PREFIX}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCY_TREE ${PARENT_DIR}
)
Expand All @@ -16,11 +16,31 @@ foreach( EXECUTABLE IN LISTS EXECUTABLES_S_L
set( PREFIX "mpirun -np 2" )
add_test_dependency_tree(
NAME "Test LRDMC run (${EXECUTABLE})"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA mpi_np2.out out_true_mpi_np2.o REFERENCE_fortXXI_mpi_np2 6 "${PREFIX}"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA datasfn.d mpi_np2.out out_true_mpi_np2.o REFERENCE_fortXXI_mpi_np2 6 "${PREFIX}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCY_TREE ${PARENT_DIR}
)
endif()
if( ${EXT_GPU} )
if( ${EXECUTABLE} MATCHES ".*-serial" )
set( PREFIX "" )
add_test_dependency_tree(
NAME "Test LRDMC run, forcing yet_ontarget (${EXECUTABLE})"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA datasfn_yot.d serial.out out_true.o REFERENCE_fortXXI 6 ${PREFIX}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCY_TREE ${PARENT_DIR}
)
endif()
if( ${EXECUTABLE} MATCHES ".*-mpi" )
set( PREFIX "mpirun -np 2" )
add_test_dependency_tree(
NAME "Test LRDMC run, forcing yet_ontarget (${EXECUTABLE})"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA datasfn_yot.d mpi_np2.out out_true_mpi_np2.o REFERENCE_fortXXI_mpi_np2 6 "${PREFIX}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCY_TREE ${PARENT_DIR}
)
endif()
endif()
endif()

if( ${EXECUTABLE} MATCHES testad*)
Expand Down
15 changes: 8 additions & 7 deletions test/test_lrdmc/cm.test1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ if [[ $# -gt 0 ]]; then
TURBORVB=$1
READF=$2
FORCEFN=$3
OUT=$4
TRUEOUT=$5
REF_FORT21=$6
ROUND_OFF=$7
if [[ $# -gt 7 ]]; then
PREFIX=$8
IN=$4
OUT=$5
TRUEOUT=$6
REF_FORT21=$7
ROUND_OFF=$8
if [[ $# -gt 8 ]]; then
PREFIX=$9
else
PREFIX=""
fi
Expand All @@ -25,7 +26,7 @@ fi

echo " LRDMC without 3-4body TEST "
echo " dir=test_lrdmc"
$PREFIX $TURBORVB < datasfn.d > $OUT
$PREFIX $TURBORVB < $IN > $OUT
[ $? -eq 0 ] && echo " Run without non-zero exit code" || exit 1

echo " Calculate local energies:'0 1 1 1' | readf.x"
Expand Down
34 changes: 34 additions & 0 deletions test/test_lrdmc/datasfn_yot.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
&simulation
itestr4=-6 ! LRDMC option
ngen=10 ! Number of branching
nscra=5 !Recomputing by scratch determinant each nscra accepted moves
nw=64 ! Number of walkers
iseedr=536473883 ! Initial random number
kappar=6.d0
ksq=0.5d0
!yesfast=0
max_target=0
/
&pseudo
nintpsa=6 ! 6 points integration pseudo
npsamax=1 ! Max number of atoms closer than 2 rc (pseudo core radius).
/
&dmclrdmc
tbra=0.1d0 ! DMC time between consecutive branching
etry=-5.42d0 ! Guess of the energy
plat(2)=1.2d0 ! eta in LRDMC eta = 1 + O(a^2)
plat(1)=-0.16d0
alat=0.25d0 ! lattice space a
parcutg=0 ! Standard LRDMC
alat2=2.64575131106459d0
iesrandoma=.false.
yes_fastbranch=.true.
/
&readio
wherescratch='old'
/
&parameters
epsbas=1d-7
ieser=1 ! Energy
isfix=1 ! Variance
/
24 changes: 22 additions & 2 deletions test/test_lrdmc_tilted/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ foreach( EXECUTABLE IN LISTS EXECUTABLES_S_L
set( PREFIX "" )
add_test_dependency_tree(
NAME "Test LRDMC TILTED run (${EXECUTABLE})"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA serial.out out_true.o REFERENCE_fortXXI 6 ${PREFIX}
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA datasfn.d serial.out out_true.o REFERENCE_fortXXI 6 ${PREFIX}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCY_TREE ${PARENT_DIR}
)
Expand All @@ -16,11 +16,31 @@ foreach( EXECUTABLE IN LISTS EXECUTABLES_S_L
set( PREFIX "mpirun -np 2" )
add_test_dependency_tree(
NAME "Test LRDMC TILTED run (${EXECUTABLE})"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA mpi_np2.out out_true_mpi_np2.o REFERENCE_fortXXI_mpi_np2 6 "${PREFIX}"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA datasfn.d mpi_np2.out out_true_mpi_np2.o REFERENCE_fortXXI_mpi_np2 6 "${PREFIX}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCY_TREE ${PARENT_DIR}
)
endif()
if( ${EXT_GPU} )
if( ${EXECUTABLE} MATCHES ".*-serial" )
set( PREFIX "" )
add_test_dependency_tree(
NAME "Test LRDMC TILTED run, forcing yes_ontarget (${EXECUTABLE})"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA datasfn_yot.d serial.out out_true.o REFERENCE_fortXXI 6 ${PREFIX}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCY_TREE ${PARENT_DIR}
)
endif()
if( ${EXECUTABLE} MATCHES ".*-mpi" )
set( PREFIX "mpirun -np 2" )
add_test_dependency_tree(
NAME "Test LRDMC TILTED run, forcing yes_ontarget (${EXECUTABLE})"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA datasfn_yot.d mpi_np2.out out_true_mpi_np2.o REFERENCE_fortXXI_mpi_np2 6 "${PREFIX}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCY_TREE ${PARENT_DIR}
)
endif()
endif()
endif()

endforeach()
15 changes: 8 additions & 7 deletions test/test_lrdmc_tilted/cm.test1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ if [[ $# -gt 0 ]]; then
TURBORVB=$1
READF=$2
FORCEFN=$3
OUT=$4
TRUEOUT=$5
REF_FORT21=$6
ROUND_OFF=$7
if [[ $# -gt 7 ]]; then
PREFIX=$8
IN=$4
OUT=$5
TRUEOUT=$6
REF_FORT21=$7
ROUND_OFF=$8
if [[ $# -gt 8 ]]; then
PREFIX=$9
else
PREFIX=""
fi
Expand All @@ -25,7 +26,7 @@ fi

echo " LRDMC PBC TILTED TEST "
echo " dir=test_lrdmc_tilted"
$PREFIX $TURBORVB < datasfn.d > $OUT
$PREFIX $TURBORVB < $IN > $OUT
[ $? -eq 0 ] && echo " Run with non-zero exit code" || exit 1

echo " Calculate local energies:'0 1 1 1' | readf.x"
Expand Down
39 changes: 39 additions & 0 deletions test/test_lrdmc_tilted/datasfn_yot.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
&simulation
itestr4=-6 ! LRDMC option
ngen=10 ! Number of branching
nscra=5 !Recomputing by scratch determinant each nscra accepted moves
nw=8 ! Number of walkers
iseedr=536473883 ! Initial random number
kappar=6.d0
ksq=0.5d0
membig=.false.
membigcpu=.false.
!yesfast=0
yes_sparse_choose=.false.
yes_sparse=.true.
max_target=0
/
&pseudo
nintpsa=6 ! 6 points integration pseudo
!npsamax=1 ! Max number of atoms closer than 2 rc (pseudo core radius).
/
&dmclrdmc
tbra=0.01d0 ! DMC time between consecutive branching
etry=-5.42d0 ! Guess of the energy
plat(1)=-0.16d0
plat(2)=1.2d0 ! eta in LRDMC eta = 1 + O(a^2)
alat=0.25d0 ! lattice space a
parcutg=0 ! Standard LRDMC
alat2=2.64575131106459d0
iesrandoma=.false.
yes_fastbranch=.false.
/
&readio
wherescratch='old'
/
&parameters
epsbas=1.d-6
ieser=1 ! Energy
isfix=1 ! Variance
yes_scemama=.false.
/
26 changes: 23 additions & 3 deletions test/test_vmc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ foreach( EXECUTABLE IN LISTS EXECUTABLES_S_L
set( PREFIX "" )
add_test_dependency_tree(
NAME "Test VMC run (${EXECUTABLE})"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA serial.out NA out_true.o NA REFERENCE_fortXXI NA 6 ${PREFIX}
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA datasvmc.d serial.out NA out_true.o NA REFERENCE_fortXXI NA 6 ${PREFIX}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCY_TREE ${PARENT_DIR}
)
Expand All @@ -16,17 +16,37 @@ foreach( EXECUTABLE IN LISTS EXECUTABLES_S_L
set( PREFIX "mpirun -np 2" )
add_test_dependency_tree(
NAME "Test VMC run (${EXECUTABLE})"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA mpi_np2.out NA out_true_mpi_np2.o NA REFERENCE_fortXXI_mpi_np2 NA 6 "${PREFIX}"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA datasvmc.d mpi_np2.out NA out_true_mpi_np2.o NA REFERENCE_fortXXI_mpi_np2 NA 6 "${PREFIX}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCY_TREE ${PARENT_DIR}
)
endif()
if( ${EXT_GPU} )
if( ${EXECUTABLE} MATCHES ".*-serial" )
set( PREFIX "" )
add_test_dependency_tree(
NAME "Test VMC run, forcing yes_ontarget (${EXECUTABLE})"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA datasvmc_yot.d serial.out NA out_true.o NA REFERENCE_fortXXI NA 6 ${PREFIX}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCY_TREE ${PARENT_DIR}
)
endif()
if( ${EXECUTABLE} MATCHES ".*-mpi" )
set( PREFIX "mpirun -np 2" )
add_test_dependency_tree(
NAME "Test VMC run, forcing yes_ontarget (${EXECUTABLE})"
COMMAND ${BASH_EXECUTABLE} cm.test1.sh $<TARGET_FILE:${EXECUTABLE}> $<TARGET_FILE:readf> NA datasvmc_yot.d mpi_np2.out NA out_true_mpi_np2.o NA REFERENCE_fortXXI_mpi_np2 NA 6 "${PREFIX}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCY_TREE ${PARENT_DIR}
)
endif()
endif()
endif()

if( ${EXECUTABLE} MATCHES testad*)
add_test_dependency_tree(
NAME "Test VMC (AD) run"
COMMAND ${BASH_EXECUTABLE} cm.test2.sh $<TARGET_FILE:testad>
COMMAND ${BASH_EXECUTABLE} cm.test_ad.sh $<TARGET_FILE:testad>
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCY_TREE ${PARENT_DIR}
)
Expand Down
21 changes: 11 additions & 10 deletions test/test_vmc/cm.test1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ if [[ $# -gt 0 ]]; then
TURBORVB=$1
READF=$2
FORCEVMC=$3
OUT=$4
OUT_FORCEVMC=$5
TRUEOUT=$6
TRUEOUT_FORCEMVC=$7
REF_FORT21=$8
REF_FORCEVMC=$9
ROUND_OFF=${10}
if [[ $# -gt 10 ]]; then
PREFIX=${11}
IN=$4
OUT=$5
OUT_FORCEVMC=$6
TRUEOUT=$7
TRUEOUT_FORCEMVC=$8
REF_FORT21=$9
REF_FORCEVMC=${10}
ROUND_OFF=${11}
if [[ $# -gt 11 ]]; then
PREFIX=${12}
else
PREFIX=""
fi
Expand All @@ -29,7 +30,7 @@ fi
#cd vmc
echo " VMC and VMC forces TEST "
echo " dir=test_vmc"
$PREFIX $TURBORVB < datasvmc.d > $OUT
$PREFIX $TURBORVB < $IN > $OUT
[ $? -eq 0 ] && echo " Run without non-zero exit code" || exit 1

#check energies
Expand Down
File renamed without changes.
23 changes: 23 additions & 0 deletions test/test_vmc/datasvmc_yot.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
&simulation
ngen=10
nscra=2
nbra=10
iseedr=25113183
yesfast=2
max_target=0
/
&pseudo
nintpsa=6
npsamax=1
/
&vmc
tstep=3.3
!epscut=0.0
/
&readio
iread=3
/
&parameters
ieskin=1
warp=.false.
/