Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
21 changes: 21 additions & 0 deletions tests/10_others/05_Alllog_filename/INPUT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
INPUT_PARAMETERS
#Parameters (1.General)
suffix autotest
calculation md
esolver_type ksdft
md_type nve
md_nstep 3
symmetry -1

#Parameters (2.Iteration)
ecutwfc 50
scf_thr 1e-5
scf_nmax 100
#Parameters (3.Basis)
basis_type lcao

#Parameters (4.Smearing)
smearing_method gauss
smearing_sigma 0.002

out_alllog 1
4 changes: 4 additions & 0 deletions tests/10_others/05_Alllog_filename/KPT
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
K_POINTS
0
Gamma
3 2 2 0 0 0
1 change: 1 addition & 0 deletions tests/10_others/05_Alllog_filename/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Test if the log filenames are set correctly when out_alllog=1
21 changes: 21 additions & 0 deletions tests/10_others/05_Alllog_filename/STRU
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ATOMIC_SPECIES
Si 14.000 ../../PP_ORB/Si_ONCV_PBE_FR-1.1.upf

NUMERICAL_ORBITAL
../../PP_ORB/Si_gga_6au_100Ry_2s2p1d.orb

LATTICE_CONSTANT
10.2

LATTICE_VECTORS
0.0 0.5 0.5 #Lattice vector 1
0.5 0.0 0.5 #Lattice vector 2
0.5 0.5 0.0 #Lattice vector 3

ATOMIC_POSITIONS
Cartesian #Cartesian(Unit is LATTICE_CONSTANT)
Si #Name of element
0.0 #Magnetic for this element.
2 #Number of atoms
0.00 0.00 0.00 0 0 0 #x,y,z, move_x, move_y, move_z
0.25 0.25 0.25 1 1 1
4 changes: 4 additions & 0 deletions tests/10_others/05_Alllog_filename/result.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
etotref -211.1186500606459
etotperatomref -105.5593250303
log_filename_validation 1
totaltimeref 1.55
1 change: 1 addition & 0 deletions tests/10_others/CASES_CPU.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
01_NP_KP_sp
02_NP_KP_spd
04_RDMFT_Si2
05_Alllog_filename
48 changes: 47 additions & 1 deletion tests/integrate/tools/catch_properties.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ file=$1
# the command will ignore lines starting with #
calculation=`grep calculation INPUT | grep -v '^#' | awk '{print $2}' | sed s/[[:space:]]//g`

running_path=`echo "OUT.autotest/running_$calculation"".log"`
# running_path=`echo "OUT.autotest/running_$calculation"".log"`
running_path=$(ls OUT.autotest/running_${calculation}*.log 2>/dev/null | head -1)
if [ -z "$running_path" ]; then
echo "Error: No running log file found for calculation=$calculation in OUT.autotest/"
exit 1
fi
#echo $running_path

natom=`grep -En '(^|[[:space:]])TOTAL ATOM NUMBER($|[[:space:]])' $running_path | tail -1 | awk '{print $6}'`
Expand Down Expand Up @@ -625,6 +630,47 @@ if ! test -z "$rdmft" && [[ $rdmft == 1 ]]; then
echo "" >>$1
fi

#--------------------------------------------
# Check if out_alllog is set to 1
# and verify running*.log filenames
#--------------------------------------------
out_alllog=$(get_input_key_value "out_alllog" "INPUT")
if ! test -z "$out_alllog" && [ $out_alllog -eq 1 ]; then
calculation=$(get_input_key_value "calculation" "INPUT")

if [ -z "$calculation" ]; then
echo "Error: calculation parameter not found in INPUT"
exit 1
fi

# Find all running*.log files in OUT.autotest directory
log_files=$(ls OUT.autotest/running*.log 2>/dev/null)

if [ -z "$log_files" ]; then
echo "Error: No running*.log files found in OUT.autotest/"
exit 1
fi

# Check each log file name contains the calculation parameter
all_valid=true
for log_file in $log_files; do
filename=$(basename "$log_file")
if [[ ! "$filename" =~ running_${calculation}_ ]]; then
echo "Error: Invalid log filename $filename - should contain 'running_${calculation}_'"
all_valid=false
fi
done

if $all_valid; then
echo "All log filenames contain 'running_${calculation}_' - validation passed"
echo "log_filename_validation 1" >>$1
else
echo "Error: Some log filenames do not contain 'running_${calculation}_'"
echo "log_filename_validation 0" >>$1
exit 1
fi
fi

#--------------------------------------------
# Check time information
#--------------------------------------------
Expand Down
Loading