Skip to content

Commit 62add8d

Browse files
committed
delete useless sum_xxx codes in integrate/tools
1 parent c7d5c6a commit 62add8d

File tree

8 files changed

+28
-192
lines changed

8 files changed

+28
-192
lines changed
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
BAND1_GAMMA_SPIN1_ENV.cube 1.06417
2-
BAND2_GAMMA_SPIN1_ENV.cube 1.0719
3-
BAND3_GAMMA_SPIN1_ENV.cube 1.06891
4-
BAND4_GAMMA_SPIN1_ENV.cube 1.06869
5-
totaltimeref 0.16356
1+
wf1s1.cube 1.063865347
2+
wf1s2.cube 1.063865347
3+
wf2s1.cube 1.067613307
4+
wf2s2.cube 1.067613308
5+
wf3s1.cube 1.067439633
6+
wf3s2.cube 1.067439633
7+
wf4s1.cube 1.064460607
8+
wf4s2.cube 1.064460607
9+
totaltimeref 0.37

tests/integrate/CMakeLists.txt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,10 @@ else()
1313
COMMAND ${BASH} Autotest.sh -a ${ABACUS_BIN_PATH} -n 4
1414
WORKING_DIRECTORY ${ABACUS_TEST_DIR}/integrate
1515
)
16-
add_executable(sum_ENV_H2 ${ABACUS_TEST_DIR}/integrate/tools/sum_ENV_H2.cpp)
17-
install(TARGETS sum_ENV_H2 DESTINATION ${ABACUS_TEST_DIR}/integrate/tools/)
18-
add_executable(sum_ENV_H2_cube ${ABACUS_TEST_DIR}/integrate/tools/sum_ENV_H2_cube.cpp)
19-
install(TARGETS sum_ENV_H2_cube DESTINATION ${ABACUS_TEST_DIR}/integrate/tools/)
20-
add_executable(sum_BAND_CHG_H2 ${ABACUS_TEST_DIR}/integrate/tools/sum_BAND_CHG_H2.cpp)
21-
install(TARGETS sum_BAND_CHG_H2 DESTINATION ${ABACUS_TEST_DIR}/integrate/tools/)
22-
add_executable(sum_BAND_CHG_H2_cube ${ABACUS_TEST_DIR}/integrate/tools/sum_BAND_CHG_H2_cube.cpp)
23-
install(TARGETS sum_BAND_CHG_H2_cube DESTINATION ${ABACUS_TEST_DIR}/integrate/tools/)
16+
add_executable(sum_cube.exe ${ABACUS_TEST_DIR}/integrate/tools/sum_cube.cpp)
17+
install(TARGETS sum_cube.exe DESTINATION ${ABACUS_TEST_DIR}/integrate/tools/)
2418

2519
if(ENABLE_COVERAGE)
26-
add_coverage(sum_ENV_H2)
27-
add_coverage(sum_ENV_H2_cube)
28-
add_coverage(sum_BAND_CHG_H2)
29-
add_coverage(sum_BAND_CHG_H2_cube)
20+
add_coverage(sum_cube.exe)
3021
endif()
3122
endif()

tests/integrate/tools/catch_properties.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ file=$1
3434
calculation=`grep calculation INPUT | grep -v '^#' | awk '{print $2}' | sed s/[[:space:]]//g`
3535

3636
running_path=`echo "OUT.autotest/running_$calculation"".log"`
37-
echo $running_path
37+
#echo $running_path
38+
3839
natom=`grep -En '(^|[[:space:]])TOTAL ATOM NUMBER($|[[:space:]])' $running_path | tail -1 | awk '{print $6}'`
3940
has_force=$(get_input_key_value "cal_force" "INPUT")
4041
has_stress=$(get_input_key_value "cal_stress" "INPUT")
@@ -92,7 +93,10 @@ if [ $calculation != "get_wf" ]\
9293
&& [ $calculation != "get_pchg" ] && [ $calculation != "get_S" ]\
9394
&& [ $is_lr == 0 ]; then
9495
etot=$(grep "ETOT_" "$running_path" | tail -1 | awk '{print $2}')
96+
#echo "etot = $etot"
9597
etotperatom=`awk 'BEGIN {x='$etot';y='$natom';printf "%.10f\n",x/y}'`
98+
#echo "etotperatom = $etotperatom"
99+
# put the results in file
96100
echo "etotref $etot" >>$1
97101
echo "etotperatomref $etotperatom" >>$1
98102
fi
@@ -495,14 +499,14 @@ fi
495499
if [ $calculation == "get_wf" ]; then
496500
nfile=0
497501
cubefiles=`ls OUT.autotest/ | grep -E '.cube$'`
498-
#echo "The cube file is $cubefiles"
502+
#echo "The cube files are $cubefiles"
499503
if test -z "$cubefiles"; then
500504
echo "Can't find $cubefiles files"
501505
exit 1
502506
else
503507
for cube in $cubefiles;
504508
do
505-
total_chg=`../tools/sum_ENV_H2_cube OUT.autotest/$cube`
509+
total_chg=`../tools/sum_cube.exe OUT.autotest/$cube`
506510
echo "$cube $total_chg" >>$1
507511
done
508512
fi
@@ -534,7 +538,7 @@ if [ $calculation == "get_pchg" ]; then
534538
else
535539
for cube in $cubefiles;
536540
do
537-
total_chg=`../tools/sum_BAND_CHG_H2_cube OUT.autotest/$cube`
541+
total_chg=`../tools/sum_cube.exe OUT.autotest/$cube`
538542
echo "$cube $total_chg" >>$1
539543
done
540544
fi

tests/integrate/tools/run_check.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ check_out(){
88
for word in $worddir; do
99
# serach result.out and get information
1010
cal=`grep "$word" $outfile | awk '{printf "%.'$CA'f\n",$2}'`
11+
# echo "cal = $cal"
1112
# search result.ref and get information
1213
ref=`grep "$word" result.ref | awk '{printf "%.'$CA'f\n",$2}'`
14+
# echo "ref = $ref"
1315
# compute the error between 'cal' and 'ref'
1416
error=`awk 'BEGIN {x='$ref';y='$cal';printf "%.'$CA'f\n",x-y}'`
17+
# echo "error = $error"
1518
# compare the total time
1619
if [ $word == "totaltimeref" ]; then
1720
echo "$word this-test: $cal ref-1core-test: $ref"

tests/integrate/tools/sum_BAND_CHG_H2.cpp

Lines changed: 0 additions & 54 deletions
This file was deleted.

tests/integrate/tools/sum_ENV_H2.cpp

Lines changed: 0 additions & 54 deletions
This file was deleted.

tests/integrate/tools/sum_ENV_H2_cube.cpp

Lines changed: 0 additions & 59 deletions
This file was deleted.

tests/integrate/tools/sum_BAND_CHG_H2_cube.cpp renamed to tests/integrate/tools/sum_cube.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ int main(int argc, char **argv)
1818
cout << "Can't find " << input_file << " !" << endl;
1919
return 1;
2020
}
21+
else
22+
{
23+
// cout << "Find the " << input_file << endl;
24+
}
2125

2226
int nx = 0;
2327
int ny = 0;
@@ -50,10 +54,7 @@ int main(int argc, char **argv)
5054
double ne = 0.0;
5155

5256
ne = sum * mx * my * mz;
53-
//std::cout<<nx<<"--"<<ny<<"--"<<nz<<std::endl;
54-
//std::cout<<" sum = "<<sum<< " ne = "<<ne<<std::endl;
55-
std::cout<<ne<<std::endl;
56-
57+
std::cout<<setprecision(10)<<ne<<std::endl;
5758

5859
return 0;
5960
}

0 commit comments

Comments
 (0)