From 787eb397156ba33d11127952dce99eacd9444ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiziano=20M=C3=BCller?= Date: Mon, 13 May 2019 15:20:11 +0200 Subject: [PATCH] python scripts: drop empty selftest arguments unfortunately sourcing the script does not check the AST, rendering even that part of the selftest useless (see for example tools/autotune_grid/xyz_to_vab/template_parser.py which contains syntax errors on Python 3) --- tools/build_utils/check_archives.py | 7 +- tools/build_utils/discover_programs.py | 6 +- tools/conventions/analyze_gfortran_ast.py | 6 +- .../conventions/analyze_gfortran_warnings.py | 6 +- tools/conventions/analyze_src.py | 6 +- tools/conventions/summarize_issues.py | 7 +- tools/coverage/test_coverage.py | 7 +- tools/dashboard/generate_dashboard.py | 6 +- tools/dashboard/generate_regtest_survey.py | 6 +- tools/diff_cp2k.py | 62 +++++----- tools/docker/scripts/test_python.sh | 16 ++- tools/find_bitrot_code.py | 6 +- tools/find_openmp_mistakes.py | 6 +- tools/fix_unused_public.py | 7 +- tools/logo/gen_cp2k_logo.py | 6 +- tools/manual/generate_sitemap.py | 6 +- tools/maple2f90/maple2f90.py | 116 +++++++++--------- .../minimax_to_fortran_source.py | 3 - tools/package_planner/plan_packages.py | 7 +- tools/regtesting/prettify_TEST_FILES.py | 6 +- tools/regtesting/test_scaling.py | 6 +- tools/regtesting/timings.py | 7 +- 22 files changed, 111 insertions(+), 200 deletions(-) diff --git a/tools/build_utils/check_archives.py b/tools/build_utils/check_archives.py index 792282510d..ac41640d66 100755 --- a/tools/build_utils/check_archives.py +++ b/tools/build_utils/check_archives.py @@ -61,9 +61,4 @@ def check_output(*popenargs, **kwargs): return output.decode() #============================================================================= -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() - -#EOF +main() diff --git a/tools/build_utils/discover_programs.py b/tools/build_utils/discover_programs.py index 3e0bc47114..6847bf8af5 100755 --- a/tools/build_utils/discover_programs.py +++ b/tools/build_utils/discover_programs.py @@ -58,8 +58,4 @@ def has_main_function(fn): return(m != None) #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() -#EOF +main() diff --git a/tools/conventions/analyze_gfortran_ast.py b/tools/conventions/analyze_gfortran_ast.py index 1934d824db..8b5edba990 100755 --- a/tools/conventions/analyze_gfortran_ast.py +++ b/tools/conventions/analyze_gfortran_ast.py @@ -163,8 +163,4 @@ def parse_args(line): raise(Exception("Could not find matching parentheses")) #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() -#EOF +main() diff --git a/tools/conventions/analyze_gfortran_warnings.py b/tools/conventions/analyze_gfortran_warnings.py index 8b4a455484..2868c58fa2 100755 --- a/tools/conventions/analyze_gfortran_warnings.py +++ b/tools/conventions/analyze_gfortran_warnings.py @@ -114,8 +114,4 @@ def may_call_implicit(loc, routine): return(re.match(manifest["implicit"], routine)) #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() -#EOF +main() diff --git a/tools/conventions/analyze_src.py b/tools/conventions/analyze_src.py index 50b59a5bd6..fbd8ad8122 100755 --- a/tools/conventions/analyze_src.py +++ b/tools/conventions/analyze_src.py @@ -121,8 +121,4 @@ def main(): #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() -#EOF +main() diff --git a/tools/conventions/summarize_issues.py b/tools/conventions/summarize_issues.py index 77a3fffbfc..aa75545d8d 100755 --- a/tools/conventions/summarize_issues.py +++ b/tools/conventions/summarize_issues.py @@ -51,9 +51,4 @@ def main(): #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1] == "--selftest"): - pass #TODO implement selftest -else: - main() - -#EOF +main() diff --git a/tools/coverage/test_coverage.py b/tools/coverage/test_coverage.py index eaad42bbd1..0ef713f0ee 100755 --- a/tools/coverage/test_coverage.py +++ b/tools/coverage/test_coverage.py @@ -78,9 +78,4 @@ def main(): open(ref_fn, "w").write(pformat(new_ref_coverage)) #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() - -#EOF +main() diff --git a/tools/dashboard/generate_dashboard.py b/tools/dashboard/generate_dashboard.py index f741bd4692..b64011bafd 100755 --- a/tools/dashboard/generate_dashboard.py +++ b/tools/dashboard/generate_dashboard.py @@ -623,8 +623,4 @@ def parse_plots(report_txt): return({'plots': plots, 'plotpoints': plotpoints}) #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() -#EOF +main() diff --git a/tools/dashboard/generate_regtest_survey.py b/tools/dashboard/generate_regtest_survey.py index 709da0a062..f8e47e2c8d 100755 --- a/tools/dashboard/generate_regtest_survey.py +++ b/tools/dashboard/generate_regtest_survey.py @@ -288,8 +288,4 @@ def parse_report(report_url): #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() -#EOF +main() diff --git a/tools/diff_cp2k.py b/tools/diff_cp2k.py index 8dd484d37b..e89015be8e 100755 --- a/tools/diff_cp2k.py +++ b/tools/diff_cp2k.py @@ -7,14 +7,14 @@ # Example 1: show timings for a CP2K output # > diff_cp2k.py -# It shows the values of the timings for the MAXIMUM SELF -# timings as extracted from the final table of timings of -# CP2K output. The values are sorted (only values >0). +# It shows the values of the timings for the MAXIMUM SELF +# timings as extracted from the final table of timings of +# CP2K output. The values are sorted (only values >0). # You can use the option # -f <1 || 2 || 3 || 4> # to change between AVERAGE SELF (1), MAX SELF (2), AVERAGE TOTAL (3) or MAX TOTAL (4). # The last line CP2K_Total refers always to the MAXIMUM TOTAL TIME. -# There is also the possibility to filter between the SUBROUTINE names +# There is also the possibility to filter between the SUBROUTINE names # by using the options: # -g : partial comparison (similar to linux command grep) # -e : exact comparison @@ -23,48 +23,48 @@ # Example 2: compare two (or more) CP2K outputs # > diff_cp2k.py # You can use wild cards (for example *.out). -# It shows the timings from all outputs, sorted by the values -# of the first file, which is the reference for the comparison. -# It also shows the relative difference (in percentage) with respect to +# It shows the timings from all outputs, sorted by the values +# of the first file, which is the reference for the comparison. +# It also shows the relative difference (in percentage) with respect to # the reference values. Colors/bold are used to easy spot the larger discrepancies: -# blue: smaller than reference +# blue: smaller than reference # blue bold: smaller than reference > 100% -# green: bigger than reference +# green: bigger than reference # green bold: bigger than reference > 100% -# A set of dashes "-------" are reported for SUBROUTINES that -# are only in the reference file, while the SUBROUTINES +# A set of dashes "-------" are reported for SUBROUTINES that +# are only in the reference file, while the SUBROUTINES # that are only in the other files are reported for each file at the end. -# You can use the option +# You can use the option # -b <#> -# to change the file used as reference (default is 1). +# to change the file used as reference (default is 1). # The other options mentioned in Example 1 are still valid here. -# It is possible to replace the SUBROUTINE names. This feature allows, for example, +# It is possible to replace the SUBROUTINE names. This feature allows, for example, # to compare SUBROUTINEs with different names belonging to different files. -# Create a file, called diff_cp2k_keys.py, where you declare +# Create a file, called diff_cp2k_keys.py, where you declare # the SUBROUTINE names and their replacements, e.g. # special_keys={'cannon_multiply_low_rma_metroc':'cannon_multiply_low_metrocomm1' , # 'cannon_multiply_low_rma':'cannon_multiply_low'} # In this case the SUBROUTINE with name cannon_multiply_low_rma_metroc will be # replaced by the name cannon_multiply_low_metrocomm1. -# The file is automatically loaded from the local directory where +# The file is automatically loaded from the local directory where # you run the script or from the home directory. Alternatively it is possible # to use the option # -k # to specify a different file. # # Example 3: grep for some other values -# As described in Example 2, create a file, called diff_cp2k_keys.py, +# As described in Example 2, create a file, called diff_cp2k_keys.py, # where you declare the keywords that you want to grep from the output, e.g. # stats_keys={'flops total':[0],'average stack size':[1,2]} -# The script splits the line by the keyword in two parts and reports +# The script splits the line by the keyword in two parts and reports # the field at the given position of the right part. -# The file is automatically loaded from the local directory where +# The file is automatically loaded from the local directory where # you run the script or from the home directory. Alternatively it is possible # to use the option # -k # to specify a different file. # The values will appear under "Stats report". -# +# import sys import argparse @@ -100,7 +100,7 @@ def read_file(filename,field,special_keys,stats_keys): nline+=1 if nline < 6: continue # end reading - if "-----" in line: + if "-----" in line: nline=0 continue values=line.split() @@ -170,7 +170,7 @@ def main(): # if not file_keys is provided, then look for it in the local directory and home file_keys.append(os.getcwd()+'/diff_cp2k_keys.py') file_keys.append(os.path.expanduser('~')+'/diff_cp2k_keys.py') - + for filename in file_keys: try: module = imp.load_source('*',filename) @@ -181,12 +181,12 @@ def main(): print("Cannont open file keys "+filename+"!") print("Exit") sys.exit(-1) - + if args.base < 1 or args.base > len(args.file_lists): print("Value for -b option out-of-bounds! Allowed values are between 1 and "+str(len(args.file_lists))) print("Exit") sys.exit(-1) - + dict_values={} dict_stats={} files={} @@ -195,14 +195,14 @@ def main(): args.field-1, special_keys, stats_keys) - + print("===== Timings report =====") - + # sorted by first file timings sorted_values = sorted(dict_values[args.file_lists[args.base-1]].items(), key=operator.itemgetter(1)) for key in sorted_values: # Apply filtering - if (key[0]!="CP2K_Total" and + if (key[0]!="CP2K_Total" and ((len(args.grep) > 0 and any(s not in key[0] for s in args.grep)) or (len(args.filter) > 0 and key[0] not in args.filter))): continue @@ -235,7 +235,7 @@ def main(): sys.stdout.write(('-'*20).rjust(20)) print("") - print("") + print("") for filename in args.file_lists: if filename == args.file_lists[args.base-1]: @@ -273,8 +273,4 @@ def main(): print("") #=============================================================================== -if (len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() -#EOF +main() diff --git a/tools/docker/scripts/test_python.sh b/tools/docker/scripts/test_python.sh index f3bbebc4dc..3cde8b6f40 100755 --- a/tools/docker/scripts/test_python.sh +++ b/tools/docker/scripts/test_python.sh @@ -2,7 +2,7 @@ # author: Ole Schuett -function run_selftests { +function run_tests { PYTHON=$1 SCRIPTS=$2 BASEDIR=$(pwd) @@ -19,7 +19,7 @@ function run_selftests { echo "Selftesting $i" cd "$(dirname "$i")" SCRIPT=$(basename "$i") - if ! $PYTHON -B "./${SCRIPT}" --selftest ; then + if ! $PYTHON -B "./${SCRIPT}" ; then echo "Selftest of $i failed" ERRORS=$((ERRORS+1)) fi @@ -38,22 +38,20 @@ ALL_TEST_SCRIPTS=$(find ./src/ ./tools/ -name "*_test.py" -executable) ESSENTIAL_TEST_SCRIPTS=$(find ./tools/build_utils -name "*_test.py" -executable) # python 2.6 -run_selftests python2.6 "${ESSENTIAL_SCRIPTS}" +run_tests python2.6 "${ESSENTIAL_TEST_SCRIPTS}" # python 2.7 -run_selftests python2.7 "${ALL_SCRIPTS}" +run_tests python2.7 "${ALL_TEST_SCRIPTS}" # python 3.x -run_selftests python3 "${ALL_SCRIPTS}" +run_tests python3 "${ALL_TEST_SCRIPTS}" # print report -NUM_SCRIPTS=$(echo "${ALL_SCRIPTS}" | wc -w) +NUM_TEST_SCRIPTS=$(echo "${ALL_TEST_SCRIPTS}" | wc -w) echo "" -echo "Summary: Checked ${NUM_SCRIPTS} Python scripts, found ${ERRORS} errors." +echo "Summary: Run ${NUM_TEST_SCRIPTS} Python test scripts, found ${ERRORS} errors." if [ $ERRORS == 0 ]; then echo "Status: OK" else echo "Status: FAILED" fi - -#EOF diff --git a/tools/find_bitrot_code.py b/tools/find_bitrot_code.py index 4ff3544971..f8fc8b3458 100755 --- a/tools/find_bitrot_code.py +++ b/tools/find_bitrot_code.py @@ -55,8 +55,4 @@ def check(fn): #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() -#EOF +main() diff --git a/tools/find_openmp_mistakes.py b/tools/find_openmp_mistakes.py index cc59dc51d9..f38f169558 100755 --- a/tools/find_openmp_mistakes.py +++ b/tools/find_openmp_mistakes.py @@ -51,8 +51,4 @@ def check(fn): #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() -#EOF +main() diff --git a/tools/fix_unused_public.py b/tools/fix_unused_public.py index 1eae42ea06..50f920e9bc 100755 --- a/tools/fix_unused_public.py +++ b/tools/fix_unused_public.py @@ -144,9 +144,4 @@ def parse_file(fn): return({"mod":mods, "use":uses, "pub":publics}) #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() - -#EOF +main() diff --git a/tools/logo/gen_cp2k_logo.py b/tools/logo/gen_cp2k_logo.py index 5a53a80c36..b338c1732b 100755 --- a/tools/logo/gen_cp2k_logo.py +++ b/tools/logo/gen_cp2k_logo.py @@ -64,8 +64,4 @@ def gen_povray(): #------------------------------------------------------------------------------- -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() -#EOF +main() diff --git a/tools/manual/generate_sitemap.py b/tools/manual/generate_sitemap.py index 112ed10440..561b13a759 100755 --- a/tools/manual/generate_sitemap.py +++ b/tools/manual/generate_sitemap.py @@ -47,8 +47,4 @@ def main(): print("Wrote "+fn_out) #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() -#EOF +main() diff --git a/tools/maple2f90/maple2f90.py b/tools/maple2f90/maple2f90.py index 22a2a6a784..1b2da00c6f 100755 --- a/tools/maple2f90/maple2f90.py +++ b/tools/maple2f90/maple2f90.py @@ -147,7 +147,7 @@ code=""" #D1 * t167 + 0.985880D0 * t170 t173 = 0.1D1 / t23 t174 = t172 * t173 - cg6 = -0.1328829340D-1 * rsrhoa * t24 + 0.9999999999D0 * t162 * + cg6 = -0.1328829340D-1 * rsrhoa * t24 + 0.9999999999D0 * t162 * #t174 t179 = t33 ** 2 t180 = 0.1D1 / t179 @@ -156,7 +156,7 @@ code=""" #D1 * t167 + 0.1250340D1 * t170 t187 = 0.1D1 / t36 t188 = t186 * t187 - cg27 = -0.638837320D-2 * rsrhoa * t37 + 0.1000000000D1 * t181 * + cg27 = -0.638837320D-2 * rsrhoa * t37 + 0.1000000000D1 * t181 * #t188 t193 = t46 ** 2 t194 = 0.1D1 / t193 @@ -180,7 +180,7 @@ code=""" t221 = t70 * frhoa t223 = t213 * cg10 t225 = 0.4D1 * t71 * t223 - cg59 = cg6 + t209 * t68 + t211 * t68 - t217 + t219 * t66 + t221 + cg59 = cg6 + t209 * t68 + t211 * t68 - t217 + t219 * t66 + t221 #* t66 + t225 t226 = 0.1D1 / t57 t228 = 0.1D1 / t60 @@ -240,7 +240,7 @@ code=""" t315 = 0.1D1 / t313 * mu cg72 = 0.2000000001D1 * t315 * cg58 * cg44 t319 = rhoa * cg78 - exc_rhoa = cg81 * cg25 + t319 * cg25 + t129 * cg72 + cg37 + rho + exc_rhoa = cg81 * cg25 + t319 * cg25 + t129 * cg72 + cg37 + rho #* cg40 cg24 = -t2 - t151 rsrhob = rsrhoa @@ -255,7 +255,7 @@ code=""" t343 = 0.7059450000D1 * t326 + 0.61977D1 * rsrhob + 0.5049300000 #D1 * t329 + 0.1250340D1 * t331 t344 = t343 * t187 - cg83 = -0.638837320D-2 * rsrhob * t37 + 0.1000000000D1 * t181 * + cg83 = -0.638837320D-2 * rsrhob * t37 + 0.1000000000D1 * t181 * #t344 t353 = 0.5178500000D1 * t326 + 0.36231D1 * rsrhob + 0.1320390000 #D1 * t329 + 0.993420D0 * t331 @@ -308,7 +308,7 @@ code=""" t436 = 0.1D1 / t434 * mu cg42 = 0.2000000001D1 * t436 * cg84 * cg8 t440 = rhob * cg69 - exc_rhob = cg32 * cg20 + t440 * cg20 + t145 * cg42 + cg37 + rho + exc_rhob = cg32 * cg20 + t440 * cg20 + t145 * cg42 + cg37 + rho #* cg28 t445 = t84 * t86 cg86 = t445 * t2 / 0.2D1 @@ -330,7 +330,7 @@ code=""" t475 = t1 * t474 cg82 = -0.2D1 * t150 + 0.2D1 * t475 t480 = t149 ** 2 - cg45 = -dble(t6) / t152 / t8 * t76 / t480 / 0.18D2 + dble(t6) * + cg45 = -dble(t6) / t152 / t8 * t76 / t480 / 0.18D2 + dble(t6) * #t154 * t474 / 0.6D1 t490 = rsrhoa * t161 t495 = t12 / t160 / t20 @@ -347,7 +347,7 @@ code=""" t521 = t23 ** 2 t522 = 0.1D1 / t521 cg77 = -0.1328829340D-1 * cg45 * t24 + 0.4274000000D0 * t490 * t - #174 - 0.2000000000D1 * t495 * t496 * t173 + 0.9999999999D0 * t162 + #174 - 0.2000000000D1 * t495 * t496 * t173 + 0.9999999999D0 * t162 #* (-0.1898925000D1 * t502 + 0.3797850000D1 * t504 + 0.35876D1 * cg #45 + 0.1228650000D1 * t507 + 0.2457300000D1 * t509 + 0.9858800D0 * # t501 + 0.985880D0 * t512) * t173 + 0.1608182432D2 * t520 * t496 * @@ -382,28 +382,28 @@ code=""" t640 = t633 * f t643 = t70 * f1rhoa t652 = -0.4D1 * t63 * t214 * cg82 + (-0.638837320D-2 * cg45 * t3 - #7 + 0.4109600000D0 * t528 * t188 - 0.2000000000D1 * t533 * t534 * + #7 + 0.4109600000D0 * t528 * t188 - 0.2000000000D1 * t533 * t534 * #t187 + 0.1000000000D1 * t181 * (-0.3529725000D1 * t502 + 0.7059450 #000D1 * t504 + 0.61977D1 * cg45 + 0.2524650000D1 * t507 + 0.504930 #0000D1 * t509 + 0.12503400D1 * t501 + 0.1250340D1 * t512) * t187 + # 0.3216468318D2 * t551 * t534 * t553 - cg77) * f * t66 + t218 * f1 #rhoa * t66 + 0.4D1 * t219 * t223 + t633 * frhoa * t66 + t70 * cg63 - # * t66 + 0.4D1 * t221 * t223 + 0.4D1 * t640 * t223 + 0.4D1 * t643 + # * t66 + 0.4D1 * t221 * t223 + 0.4D1 * t640 * t223 + 0.4D1 * t643 #* t223 + 0.12D2 * t71 * t65 * t589 + 0.4D1 * t71 * t213 * cg82 cg75 = cg77 + (0.375735750D-1 * cg45 * t50 - 0.2225000000D0 * t5 #59 * t202 + 0.2000000000D1 * t564 * t565 * t201 - 0.9999999999D0 * # t195 * (-0.2589250000D1 * t502 + 0.5178500000D1 * t504 + 0.36231D #1 * cg45 + 0.6601950000D0 * t507 + 0.1320390000D1 * t509 + 0.99342 - #00D0 * t501 + 0.993420D0 * t512) * t201 - 0.2960857464D1 * t582 * + #00D0 * t501 + 0.993420D0 * t512) * t201 - 0.2960857464D1 * t582 * #t565 * t584) * f * t68 + cg93 * f1rhoa * t68 - 0.4D1 * t209 * t215 - # + cg14 * frhoa * t68 + cg62 * cg63 * t68 - 0.4D1 * t211 * t215 - - #0.4D1 * t612 * t215 - 0.4D1 * t615 * t215 - 0.12D2 * t63 * t618 * + # + cg14 * frhoa * t68 + cg62 * cg63 * t68 - 0.4D1 * t211 * t215 - + #0.4D1 * t612 * t215 - 0.4D1 * t615 * t215 - 0.12D2 * t63 * t618 * #t589 + t652 cg76 = cg21 + t612 * t68 + t615 * t68 - t217 + t640 * t66 + t643 # * t66 + t225 t657 = 0.1D1 / t58 t662 = 0.1D1 / t61 - cg30 = -t657 * t589 / 0.9D1 + t226 * cg82 / 0.3D1 - t662 * t589 + cg30 = -t657 * t589 / 0.9D1 + t226 * cg82 / 0.3D1 - t662 * t589 #/ 0.9D1 - t228 * cg82 / 0.3D1 cg60 = cg18 t670 = t75 ** 2 @@ -420,12 +420,12 @@ code=""" t705 = t242 * t150 t708 = t85 * t705 * cg55 / 0.2D1 t719 = t85 * t86 * t474 - cg49 = t682 * t683 * cg60 + t686 * t683 * cg34 / 0.2D1 + t692 - + cg49 = t682 * t683 * cg60 + t686 * t683 * cg34 / 0.2D1 + t692 - #t238 * t87 * cg30 / 0.2D1 + t686 * t696 * cg60 / 0.2D1 + t702 * t6 #96 * cg34 + t708 - t85 * t243 * (-t674 * t675 * t76 / 0.2D1 + t235 - # * cg87 * t7) / 0.2D1 + t238 * t246 * cg60 / 0.2D1 + t85 * t705 * + # * cg87 * t7) / 0.2D1 + t238 * t246 * cg60 / 0.2D1 + t85 * t705 * #cg34 / 0.2D1 + t719 - t1rhoa = -t238 * t87 * cg60 / 0.2D1 - t85 * t243 * cg34 / 0.2D1 + t1rhoa = -t238 * t87 * cg60 / 0.2D1 - t85 * t243 * cg34 / 0.2D1 #- t247 / 0.2D1 t727 = t89 / t249 / t96 t728 = t95 ** 2 @@ -465,7 +465,7 @@ code=""" t846 = t845 * t289 t853 = A * t285 t862 = t104 * t100 - t868 = t815 + t818 + t821 + t824 + t826 + 0.2D1 * A1rhoa * t105 + t868 = t815 + t818 + t821 + t824 + t826 + 0.2D1 * A1rhoa * t105 #* Arhoa + 0.8D1 * t853 * Arhoa * t1rhoa + 0.2D1 * t282 * cg67 + 0. #8D1 * t853 * trhoa * A1rhoa + 0.12D2 * t862 * trhoa * t1rhoa + 0.4 #D1 * t286 * cg49 @@ -473,7 +473,7 @@ code=""" #76 * trhoa - 0.133450D0 * t804 * t805 * t783 + 0.133450D0 * t267 * # t109 * cg49 + 0.133450D0 * t267 * t276 * t1rhoa + 0.66725D-1 * t1 #01 * (t815 + t818 + t821 + t824 + t826) * t108 - 0.66725D-1 * t101 - # * t831 * t783 - 0.133450D0 * t804 * t835 * t1rhoa - 0.66725D-1 * + # * t831 * t783 - 0.133450D0 * t804 * t835 * t1rhoa - 0.66725D-1 * #t101 * t775 * t280 * t289 + 0.133450D0 * t843 * t846 * t783 - 0.66 #725D-1 * t101 * t281 * t868 t875 = t112 ** 2 @@ -487,12 +487,12 @@ code=""" t909 = 0.1D1 / t313 / t126 * t908 t910 = t123 * cg44 cg65 = 0.2000000001D1 * t315 * cg58 * cg52 - exc_rhoa_rhoa = cg26 * cg25 + cg81 * cg65 + cg78 * cg25 - 0.3D1 + exc_rhoa_rhoa = cg26 * cg25 + cg81 * cg65 + cg78 * cg25 - 0.3D1 #/ 0.4D1 * rhoa * t7 * cg47 * cg25 + t319 * cg65 + cg81 * cg72 + rh - #oa * cg26 * cg72 + t129 * (-0.9950248765D1 * t909 * t910 * cg52 + + #oa * cg26 * cg72 + t129 * (-0.9950248765D1 * t909 * t910 * cg52 + #0.2000000001D1 * t315 * cg52 * cg44 + 0.2000000001D1 * t315 * cg58 # * (cg0 / t304 / cg54 * t121 * t895 + t306 * t310 * cg7 - t306 * t - #121 * cg47 / 0.2D1 + t120 / t309 / rhoa)) + cg76 + 0.3D1 * t263 * + #121 * cg47 / 0.2D1 + t120 / t309 / rhoa)) + cg76 + 0.3D1 * t263 * #t113 * cg60 + t99 * t788 + cg40 + rho * (cg75 + 0.6D1 * t765 * t26 #4 * cg60 + 0.3D1 * t263 * t788 * cg18 + 0.3D1 * t263 * t113 * cg30 # + 0.3D1 * t263 * t295 * cg60 + t99 * t872 * t294 - t99 * t877 * t @@ -507,7 +507,7 @@ code=""" t954 = rsrhoa * rsrhob t956 = t169 * cg56 cg73 = -0.1328829340D-1 * cg56 * t24 + 0.2137000000D0 * t490 * t - #334 + 0.2137000000D0 * t938 * t174 - 0.2000000000D1 * t495 * t174 + #334 + 0.2137000000D0 * t938 * t174 - 0.2000000000D1 * t495 * t174 #* t333 + 0.9999999999D0 * t162 * (-0.1898925000D1 * t945 + 0.37978 #50000D1 * t947 + 0.35876D1 * cg56 + 0.1228650000D1 * t950 + 0.2457 #300000D1 * t952 + 0.9858800D0 * t954 + 0.985880D0 * t956) * t173 + @@ -521,30 +521,30 @@ code=""" t1074 = -0.4D1 * t63 * t214 * cg23 + (-0.638837320D-2 * cg56 * t #37 + 0.2054800000D0 * t528 * t344 + 0.2054800000D0 * t970 * t188 - # 0.2000000000D1 * t533 * t188 * t343 + 0.1000000000D1 * t181 * (-0 - #.3529725000D1 * t945 + 0.7059450000D1 * t947 + 0.61977D1 * cg56 + + #.3529725000D1 * t945 + 0.7059450000D1 * t947 + 0.61977D1 * cg56 + #0.2524650000D1 * t950 + 0.5049300000D1 * t952 + 0.12503400D1 * t95 #4 + 0.1250340D1 * t956) * t187 + 0.3216468318D2 * t551 * t186 * t5 - #53 * t343 - cg73) * f * t66 + t218 * frhob * t66 + 0.4D1 * t219 * + #53 * t343 - cg73) * f * t66 + t218 * frhob * t66 + 0.4D1 * t219 * #t373 + t368 * frhoa * t66 + t70 * cg22 * t66 + 0.4D1 * t221 * t373 # + 0.4D1 * t369 * t223 + 0.4D1 * t371 * t223 + 0.12D2 * t71 * t104 #5 + 0.4D1 * t71 * t213 * cg23 cg11 = cg73 + (0.375735750D-1 * cg56 * t50 - 0.1112500000D0 * t5 #59 * t354 - 0.1112500000D0 * t995 * t202 + 0.2000000000D1 * t564 * # t202 * t353 - 0.9999999999D0 * t195 * (-0.2589250000D1 * t945 + 0 - #.5178500000D1 * t947 + 0.36231D1 * cg56 + 0.6601950000D0 * t950 + - #0.1320390000D1 * t952 + 0.9934200D0 * t954 + 0.993420D0 * t956) * + #.5178500000D1 * t947 + 0.36231D1 * cg56 + 0.6601950000D0 * t950 + + #0.1320390000D1 * t952 + 0.9934200D0 * t954 + 0.993420D0 * t956) * #t201 - 0.2960857464D1 * t582 * t200 * t584 * t353) * f * t68 + cg9 - #3 * frhob * t68 - 0.4D1 * t209 * t365 + cg50 * frhoa * t68 + cg62 + #3 * frhob * t68 - 0.4D1 * t209 * t365 + cg50 * frhoa * t68 + cg62 #* cg22 * t68 - 0.4D1 * t211 * t365 - 0.4D1 * t361 * t215 - 0.4D1 * # t363 * t215 - 0.12D2 * t63 * t64 * t1045 + t1074 - cg68 = -t657 * cg10 * cg24 / 0.9D1 + t226 * cg23 / 0.3D1 - t662 + cg68 = -t657 * cg10 * cg24 / 0.9D1 + t226 * cg23 / 0.3D1 - t662 #* cg10 * cg24 / 0.9D1 - t228 * cg23 / 0.3D1 cg15 = cg87 t1109 = t238 * t246 * cg38 / 0.2D1 t1112 = t85 * t705 * cg80 / 0.2D1 - cg61 = t682 * t683 * cg38 + t686 * t683 * cg80 / 0.2D1 + t692 - + cg61 = t682 * t683 * cg38 + t686 * t683 * cg80 / 0.2D1 + t692 - #t238 * t87 * cg68 / 0.2D1 + t686 * t696 * cg38 / 0.2D1 + t702 * t6 - #96 * cg80 + t708 - t85 * t243 * (-t674 * cg3 * t76 * cg36 / 0.2D1 + #96 * cg80 + t708 - t85 * t243 * (-t674 * cg3 * t76 * cg36 / 0.2D1 #+ t235 * cg15 * t7) / 0.2D1 + t1109 + t1112 + t719 cg33 = 0.133450D0 * t727 * t729 * t390 - 0.66725D-1 * t251 * (-c #g11 * t89 * t93 + 0.3D1 * t252 * t387 + 0.3D1 * t385 * t256 - 0.12 @@ -557,18 +557,18 @@ code=""" t1171 = 0.2D1 * A * trhob * trhoa t1173 = 0.2D1 * t272 * cg61 t1184 = t403 * t280 - t1207 = t1163 + t1165 + t1168 + t1171 + t1173 + 0.2D1 * Arhob * - #t105 * Arhoa + 0.8D1 * t853 * Arhoa * trhob + 0.2D1 * t282 * cg33 + t1207 = t1163 + t1165 + t1168 + t1171 + t1173 + 0.2D1 * Arhob * + #t105 * Arhoa + 0.8D1 * t853 * Arhoa * trhob + 0.2D1 * t282 * cg33 #+ 0.8D1 * t853 * trhoa * Arhob + 0.12D2 * t862 * trhoa * trhob + 0 #.4D1 * t286 * cg61 t1211 = 0.133450D0 * t89 * trhob * t268 + 0.133450D0 * t267 * t4 #04 * trhoa - 0.133450D0 * t804 * t805 * t411 + 0.133450D0 * t267 * # t109 * cg61 + 0.133450D0 * t267 * t276 * trhob + 0.66725D-1 * t10 - #1 * (t1163 + t1165 + t1168 + t1171 + t1173) * t108 - 0.66725D-1 * + #1 * (t1163 + t1165 + t1168 + t1171 + t1173) * t108 - 0.66725D-1 * #t101 * t831 * t411 - 0.133450D0 * t804 * t835 * trhob - 0.66725D-1 # * t101 * t1184 * t289 + 0.133450D0 * t843 * t846 * t411 - 0.66725 #D-1 * t101 * t281 * t1207 - exc_rhoa_rhob = cg28 + cg40 + rho * (cg11 + 0.6D1 * t765 * t264 + exc_rhoa_rhob = cg28 + cg40 + rho * (cg11 + 0.6D1 * t765 * t264 #* cg38 + 0.3D1 * t263 * t416 * cg18 + 0.3D1 * t263 * t113 * cg68 + # 0.3D1 * t263 * t295 * cg38 + t99 * t1211 * t294 - t99 * t877 * t4 #15) @@ -602,20 +602,20 @@ code=""" t1339 = t1332 * f t1342 = t70 * f1rhob t1351 = -0.4D1 * t63 * t214 * cg16 + (-0.638837320D-2 * cg57 * t - #37 + 0.4109600000D0 * t970 * t344 - 0.2000000000D1 * t533 * t1250 + #37 + 0.4109600000D0 * t970 * t344 - 0.2000000000D1 * t533 * t1250 #* t187 + 0.1000000000D1 * t181 * (-0.3529725000D1 * t1227 + 0.7059 #450000D1 * t1229 + 0.61977D1 * cg57 + 0.2524650000D1 * t1232 + 0.5 - #049300000D1 * t1234 + 0.12503400D1 * t1226 + 0.1250340D1 * t1237) - #* t187 + 0.3216468318D2 * t551 * t1250 * t553 - cg66) * f * t66 + - #t368 * f1rhob * t66 + 0.4D1 * t369 * t373 + t1332 * frhob * t66 + + #049300000D1 * t1234 + 0.12503400D1 * t1226 + 0.1250340D1 * t1237) + #* t187 + 0.3216468318D2 * t551 * t1250 * t553 - cg66) * f * t66 + + #t368 * f1rhob * t66 + 0.4D1 * t369 * t373 + t1332 * frhob * t66 + #t70 * cg70 * t66 + 0.4D1 * t371 * t373 + 0.4D1 * t1339 * t373 + 0. #4D1 * t1342 * t373 + 0.12D2 * t71 * t65 * t1290 + 0.4D1 * t71 * t2 #13 * cg16 cg79 = cg66 + (0.375735750D-1 * cg57 * t50 - 0.2225000000D0 * t9 - #95 * t354 + 0.2000000000D1 * t564 * t1272 * t201 - 0.9999999999D0 + #95 * t354 + 0.2000000000D1 * t564 * t1272 * t201 - 0.9999999999D0 #* t195 * (-0.2589250000D1 * t1227 + 0.5178500000D1 * t1229 + 0.362 #31D1 * cg57 + 0.6601950000D0 * t1232 + 0.1320390000D1 * t1234 + 0. - #9934200D0 * t1226 + 0.993420D0 * t1237) * t201 - 0.2960857464D1 * + #9934200D0 * t1226 + 0.993420D0 * t1237) * t201 - 0.2960857464D1 * #t582 * t1272 * t584) * f * t68 + cg50 * f1rhob * t68 - 0.4D1 * t36 #1 * t365 + cg85 * frhob * t68 + cg62 * cg70 * t68 - 0.4D1 * t363 * # t365 - 0.4D1 * t1312 * t365 - 0.4D1 * t1315 * t365 - 0.12D2 * t63 @@ -630,11 +630,11 @@ code=""" t1370 = t2 * cg38 t1379 = t2 * cg80 cg31 = t682 * t1370 * cg17 + t686 * t1370 * cg43 / 0.2D1 + t1109 - # - t238 * t87 * cg71 / 0.2D1 + t686 * t1379 * cg17 / 0.2D1 + t702 + # - t238 * t87 * cg71 / 0.2D1 + t686 * t1379 * cg17 / 0.2D1 + t702 #* t1379 * cg43 + t1112 - t85 * t243 * (-t674 * t1364 * t76 / 0.2D1 - # + t235 * cg15 * t7) / 0.2D1 + t238 * t246 * cg17 / 0.2D1 + t85 * + # + t235 * cg15 * t7) / 0.2D1 + t238 * t246 * cg17 / 0.2D1 + t85 * #t705 * cg43 / 0.2D1 + t719 - t1rhob = -t238 * t87 * cg17 / 0.2D1 - t85 * t243 * cg43 / 0.2D1 + t1rhob = -t238 * t87 * cg17 / 0.2D1 - t85 * t243 * cg43 / 0.2D1 #- t247 / 0.2D1 t1400 = cg13 * t89 t1402 = t255 * cg17 @@ -650,7 +650,7 @@ code=""" t1443 = t1442 * t108 t1450 = t1439 + t1441 + 0.2D1 * t282 * A1rhob + 0.4D1 * t286 * t #1rhob - t1454 = 0.133450D0 * t267 * t109 * t1rhob + 0.66725D-1 * t101 * + t1454 = 0.133450D0 * t267 * t109 * t1rhob + 0.66725D-1 * t101 * #t1443 - 0.66725D-1 * t101 * t281 * t1450 t1455 = t1454 * t294 t1471 = t280 * trhob @@ -667,7 +667,7 @@ code=""" # + 0.4D1 * t286 * cg31 t1531 = 0.133450D0 * t89 * t1rhob * t397 + 0.133450D0 * t267 * t #1443 * trhob - 0.133450D0 * t804 * t1471 * t1450 + 0.133450D0 * t2 - #67 * t109 * cg31 + 0.133450D0 * t267 * t404 * t1rhob + 0.66725D-1 + #67 * t109 * cg31 + 0.133450D0 * t267 * t404 * t1rhob + 0.66725D-1 #* t101 * (t1481 + t1483 + t1486 + t1489 + t1491) * t108 - 0.66725D #-1 * t101 * t1184 * t1450 - 0.133450D0 * t804 * t1499 * t1rhob - 0 #.66725D-1 * t101 * t1442 * t280 * t411 + 0.133450D0 * t843 * t1507 @@ -680,14 +680,14 @@ code=""" t1565 = 0.1D1 / t434 / t142 * t908 t1566 = t139 * cg8 cg92 = 0.2000000001D1 * t436 * cg84 * cg88 - exc_rhob_rhob = cg90 * cg20 + cg32 * cg92 + cg69 * cg20 - 0.3D1 + exc_rhob_rhob = cg90 * cg20 + cg32 * cg92 + cg69 * cg20 - 0.3D1 #/ 0.4D1 * rhob * t7 * cg89 * cg20 + t440 * cg92 + cg32 * cg42 + rh - #ob * cg90 * cg42 + t145 * (-0.9950248765D1 * t1565 * t1566 * cg88 + #ob * cg90 * cg42 + t145 * (-0.9950248765D1 * t1565 * t1566 * cg88 #+ 0.2000000001D1 * t436 * cg88 * cg8 + 0.2000000001D1 * t436 * cg8 #4 * (cg1 / t425 / cg19 * t137 * t1552 + t427 * t431 * cg2 - t427 * - # t137 * cg89 / 0.2D1 + t136 / t430 / rhob)) + cg13 + 0.3D1 * t263 - #* t113 * cg17 + t99 * t1455 + cg28 + rho * (cg79 + 0.6D1 * t765 * - #t394 * cg17 + 0.3D1 * t263 * t1455 * cg38 + 0.3D1 * t263 * t113 * + # t137 * cg89 / 0.2D1 + t136 / t430 / rhob)) + cg13 + 0.3D1 * t263 + #* t113 * cg17 + t99 * t1455 + cg28 + rho * (cg79 + 0.6D1 * t765 * + #t394 * cg17 + 0.3D1 * t263 * t1455 * cg38 + 0.3D1 * t263 * t113 * #cg71 + 0.3D1 * t263 * t416 * cg17 + t99 * t1531 * t294 - t99 * t15 #34 * t1454) t1590 = t237 * t86 @@ -712,9 +712,9 @@ code=""" # * t281 * (0.2D1 * t1616 + 0.2D1 * t1617 + 0.2D1 * t1618 + 0.8D1 * # t853 * Arhoa * cg86 + 0.12D2 * t862 * trhoa * cg86 + 0.4D1 * t286 # * cg91) - exc_rhoa_norm_drho = cg48 + rho * (0.3D1 * t263 * t464 * cg18 + + exc_rhoa_norm_drho = cg48 + rho * (0.3D1 * t263 * t464 * cg18 + #t99 * t1651 * t294 - t99 * t877 * t463) - cg64 = -t1590 * t1370 / 0.2D1 - t1592 * t1379 / 0.2D1 - t1594 / + cg64 = -t1590 * t1370 / 0.2D1 - t1592 * t1379 / 0.2D1 - t1594 / #0.2D1 t1677 = t1166 * cg86 t1678 = t451 * trhob @@ -722,14 +722,14 @@ code=""" t1688 = t1499 * cg86 t1711 = 0.133450D0 * t1599 * t397 + 0.266900D0 * t1602 * t1603 * # trhob - 0.133450D0 * t804 * t1471 * t459 + 0.133450D0 * t267 * t1 - #09 * cg64 + 0.133450D0 * t267 * t404 * cg86 + 0.66725D-1 * t101 * + #09 * cg64 + 0.133450D0 * t267 * t404 * cg86 + 0.66725D-1 * t101 * #(0.2D1 * t1677 + 0.2D1 * t1678 + 0.2D1 * t1679) * t108 - 0.66725D- #1 * t101 * t1184 * t459 - 0.133450D0 * t804 * t1688 - 0.133450D0 * # t1630 * t1688 + 0.133450D0 * t843 * t1507 * t459 - 0.66725D-1 * t #101 * t281 * (0.2D1 * t1677 + 0.2D1 * t1678 + 0.2D1 * t1679 + 0.8D #1 * t853 * Arhob * cg86 + 0.12D2 * t862 * trhob * cg86 + 0.4D1 * t #286 * cg64) - exc_rhob_norm_drho = cg48 + rho * (0.3D1 * t263 * t464 * cg38 + + exc_rhob_norm_drho = cg48 + rho * (0.3D1 * t263 * t464 * cg38 + #t99 * t1711 * t294 - t99 * t1534 * t463) t1717 = cg86 ** 2 t1721 = A * t1717 @@ -749,7 +749,7 @@ code=""" exc_norm_drhoa_norm_drhoa = t129 * (-0.9950248765D1 * t909 * t12 #3 * t1766 + 0.2000000001D1 * t315 * t1766) exc_rhob_norm_drhob = cg32 * cg39 + t440 * cg39 + t145 * (-0.995 - #0248765D1 * t1565 * t1566 * cg74 + 0.2000000001D1 * t436 * cg74 * + #0248765D1 * t1565 * t1566 * cg74 + 0.2000000001D1 * t436 * cg74 * #cg8 + 0.2000000001D1 * t436 * cg84 * (-t426 * t137 * cg2 / 0.2D1 - # t135 * t431 / 0.2D1)) t1790 = cg74 ** 2 @@ -799,6 +799,4 @@ if __name__=="__main__": output = maple2f90(code,replacements) # print output unless we are selftesting - if(len(sys.argv)!=2 or sys.argv[-1]!="--selftest"): - print(output) -#EOF + print(output) diff --git a/tools/minimax_tools/minimax_to_fortran_source.py b/tools/minimax_tools/minimax_to_fortran_source.py index 0de60ef564..eb7d35267f 100755 --- a/tools/minimax_tools/minimax_to_fortran_source.py +++ b/tools/minimax_tools/minimax_to_fortran_source.py @@ -4,9 +4,6 @@ import re import sys import os.path -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - sys.exit(0) - # 1) parse data # ################# diff --git a/tools/package_planner/plan_packages.py b/tools/package_planner/plan_packages.py index b23744b6ec..ccd43c41c5 100755 --- a/tools/package_planner/plan_packages.py +++ b/tools/package_planner/plan_packages.py @@ -268,9 +268,4 @@ def error(msg): #============================================================================= -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() - -#EOF +main() diff --git a/tools/regtesting/prettify_TEST_FILES.py b/tools/regtesting/prettify_TEST_FILES.py index 9110d7bd9e..334e83cfbe 100755 --- a/tools/regtesting/prettify_TEST_FILES.py +++ b/tools/regtesting/prettify_TEST_FILES.py @@ -48,8 +48,4 @@ def main(): f.close() #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() -#EOF +main() diff --git a/tools/regtesting/test_scaling.py b/tools/regtesting/test_scaling.py index 626a75f76d..6224ffa41d 100755 --- a/tools/regtesting/test_scaling.py +++ b/tools/regtesting/test_scaling.py @@ -112,8 +112,4 @@ def parse_output(out_fn, ref_energy): return(runtime) #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() -#EOF +main() diff --git a/tools/regtesting/timings.py b/tools/regtesting/timings.py index 430f5f0e3e..4fb7a8e0d1 100755 --- a/tools/regtesting/timings.py +++ b/tools/regtesting/timings.py @@ -35,9 +35,4 @@ def percentile(values, percent): return d0 + d1 #=============================================================================== -if(len(sys.argv)==2 and sys.argv[-1]=="--selftest"): - pass #TODO implement selftest -else: - main() - -#EOF +main()