From 4d0e425e8eb46ae75a053b71cb2654e196e325bf Mon Sep 17 00:00:00 2001 From: Kyle Gerard Felker Date: Tue, 31 Jul 2018 18:03:47 -0400 Subject: [PATCH] Public release of Athena++ version 1.1.1 --- CPPLINT.cfg | 3 +- configure.py | 630 +- inputs/hydro/athinput.kh-shear | 52 + .../hydro/{athinput.kh => athinput.kh-slip} | 12 +- inputs/hydro/athinput.shu_osher | 2 +- inputs/hydro/athinput.slow_shock | 72 + inputs/hydro/athinput.sod | 2 +- inputs/hydro/athinput.ssheet | 2 +- inputs/hydro/athinput.turb | 9 +- inputs/mhd/athinput.bw | 2 +- inputs/mhd/athinput.cpaw2d | 3 +- inputs/mhd/athinput.hb3 | 3 +- inputs/mhd/athinput.kh-shear | 53 + inputs/mhd/athinput.linear_wave2d_amr | 2 +- inputs/mhd/athinput.linear_wave_amr | 2 +- inputs/mhd/athinput.magnoh2 | 67 + inputs/mhd/athinput.magnoh3 | 67 + inputs/mhd/athinput.strat | 7 +- inputs/mhd/athinput.test_outputs | 18 +- setup.cfg | 24 + src/athena.hpp | 16 +- src/athena_arrays.hpp | 30 +- src/bvals/bvals.cpp | 24 +- src/bvals/bvals.hpp | 42 +- src/bvals/bvals_fc.cpp | 32 +- src/bvals/bvals_mg.cpp | 16 +- src/bvals/bvals_mg.hpp | 4 + src/bvals/outflow.cpp | 78 +- src/bvals/polarwedge.cpp | 26 +- src/bvals/reflect.cpp | 92 +- src/coordinates/spherical_polar.cpp | 18 +- src/defs.hpp.in | 3 +- src/eos/adiabatic_hydro.cpp | 3 - src/eos/adiabatic_hydro_sr.cpp | 242 +- src/eos/adiabatic_mhd.cpp | 3 - src/eos/adiabatic_mhd_sr.cpp | 221 +- src/eos/eos.hpp | 3 + src/eos/isothermal_hydro.cpp | 2 - src/eos/isothermal_mhd.cpp | 3 - src/fft/athena_fft.cpp | 16 +- src/fft/turbulence.cpp | 44 +- src/fft/turbulence.hpp | 1 - src/field/field.hpp | 2 + src/gravity/fftgravity.cpp | 6 +- src/gravity/fftgravity.hpp | 2 +- src/gravity/gravity.cpp | 9 + src/gravity/mggravity.cpp | 4 +- src/gravity/mggravity.hpp | 2 +- src/hydro/hydro.hpp | 2 + src/hydro/hydro_diffusion/conduction.cpp | 7 +- src/hydro/hydro_diffusion/viscosity.cpp | 299 +- src/hydro/rsolvers/hydro/hllc.cpp | 13 +- src/hydro/rsolvers/hydro/hllc_rel.cpp | 85 +- src/hydro/rsolvers/hydro/hlle.cpp | 6 +- src/hydro/rsolvers/hydro/hlle_rel.cpp | 55 +- src/hydro/rsolvers/hydro/llf.cpp | 128 + src/hydro/rsolvers/hydro/llf_rel.cpp | 50 +- src/hydro/rsolvers/hydro/roe.cpp | 456 +- src/hydro/rsolvers/mhd/hlld.cpp | 17 +- src/hydro/rsolvers/mhd/hlld_iso.cpp | 8 +- src/hydro/rsolvers/mhd/hlld_rel.cpp | 1081 +- src/hydro/rsolvers/mhd/hlle_mhd.cpp | 2 +- src/hydro/rsolvers/mhd/hlle_mhd_rel.cpp | 69 +- src/hydro/rsolvers/mhd/llf_mhd.cpp | 150 + src/hydro/rsolvers/mhd/llf_mhd_rel.cpp | 62 +- src/hydro/rsolvers/mhd/roe_mhd.cpp | 1030 +- src/main.cpp | 12 +- src/mesh/mesh.cpp | 65 +- src/mesh/mesh.hpp | 15 +- src/mesh/mesh_refinement.cpp | 1 + src/multigrid/multigrid_driver.cpp | 2 - src/outputs/io_wrapper.cpp | 46 +- src/outputs/io_wrapper.hpp | 8 +- src/pgen/disk.cpp | 36 +- src/pgen/dmr.cpp | 18 +- src/pgen/field_loop_poles.cpp | 60 +- src/pgen/gr_bondi.cpp | 18 +- src/pgen/gr_geodesic_infall.cpp | 10 +- src/pgen/gr_mhd_inflow.cpp | 18 +- src/pgen/gr_torus.cpp | 44 +- src/pgen/jeans.cpp | 25 +- src/pgen/jet.cpp | 12 +- src/pgen/kh.cpp | 183 +- src/pgen/magnoh.cpp | 202 + src/pgen/noh.cpp | 30 +- src/pgen/poisson.cpp | 2 +- src/pgen/rt.cpp | 94 +- src/pgen/shk_cloud.cpp | 8 +- src/pgen/strat.cpp | 24 +- src/pgen/turb.cpp | 3 +- src/pgen/visc.cpp | 2 +- src/reconstruct/plm.cpp | 9 - src/reconstruct/ppm.cpp | 10 - src/task_list/grav_task_list.cpp | 12 +- src/task_list/grav_task_list.hpp | 10 +- src/task_list/mg_task_list.cpp | 4 +- src/task_list/mg_task_list.hpp | 4 +- src/task_list/task_list.cpp | 14 +- src/task_list/task_list.hpp | 108 +- src/task_list/time_integrator.cpp | 443 +- tst/regression/data/gr_shock_tube.tab | 10001 ---------------- tst/regression/data/sr_hydro_shock1_hlle.vtk | Bin 240343 -> 0 bytes tst/regression/data/sr_hydro_shock2_hlle.vtk | Bin 240343 -> 0 bytes tst/regression/data/sr_hydro_shock3_hlle.vtk | Bin 240343 -> 0 bytes tst/regression/data/sr_hydro_shock4_hlle.vtk | Bin 240343 -> 0 bytes tst/regression/data/sr_mhd_shock1_hlle.vtk | Bin 360374 -> 0 bytes tst/regression/data/sr_mhd_shock2_hlle.vtk | Bin 360374 -> 0 bytes tst/regression/data/sr_mhd_shock4_hlle.vtk | Bin 360374 -> 0 bytes tst/regression/run_tests.py | 35 +- .../scripts/tests/amr/amr_linwave.py | 59 +- .../scripts/tests/curvilinear/blast_cyl.py | 51 +- .../scripts/tests/curvilinear/blast_sph.py | 49 +- .../scripts/tests/diffusion/linear_wave3d.py | 113 +- .../tests/diffusion/thermal_attenuation.py | 115 +- tst/regression/scripts/tests/example.py | 227 +- .../scripts/tests/gr/compile_kerr-schild.py | 17 +- .../scripts/tests/gr/compile_minkowski.py | 17 +- .../scripts/tests/gr/compile_schwarzschild.py | 17 +- .../scripts/tests/gr/hydro_shocks_hllc.py | 80 +- .../scripts/tests/gr/hydro_shocks_hlle.py | 80 +- .../gr/hydro_shocks_hlle_no_transform.py | 80 +- .../scripts/tests/gr/hydro_shocks_llf.py | 80 +- .../tests/gr/hydro_shocks_llf_no_transform.py | 80 +- .../scripts/tests/gr/mhd_shocks_hlld.py | 115 +- .../scripts/tests/gr/mhd_shocks_hlle.py | 115 +- .../scripts/tests/gr/mhd_shocks_llf.py | 115 +- tst/regression/scripts/tests/grav/jeans_3d.py | 201 +- .../tests/grav/unstable_jeans_3d_fft.py | 123 +- .../scripts/tests/hydro/hydro_linwave.py | 136 +- .../scripts/tests/hydro/sod_shock.py | 169 +- tst/regression/scripts/tests/mhd/cpaw.py | 97 +- .../scripts/tests/mhd/mhd_linwave.py | 187 +- .../scripts/tests/mhd/rj2a_shock.py | 172 +- .../scripts/tests/mpi/mpi_linwave.py | 100 +- .../scripts/tests/outputs/all_outputs.py | 97 +- .../scripts/tests/pgen/pgen_compile.py | 2 +- .../scripts/tests/shearingbox/mri2d.py | 6 +- .../scripts/tests/shearingbox/mri3d.py | 6 +- .../scripts/tests/sr/hydro_convergence.py | 185 +- .../scripts/tests/sr/hydro_shocks_hllc.py | 76 +- .../scripts/tests/sr/hydro_shocks_hlle.py | 76 +- .../scripts/tests/sr/hydro_shocks_llf.py | 76 +- .../scripts/tests/sr/mhd_convergence.py | 234 +- .../scripts/tests/sr/mhd_shocks_hlld.py | 111 +- .../scripts/tests/sr/mhd_shocks_hlle.py | 111 +- .../scripts/tests/sr/mhd_shocks_llf.py | 111 +- .../scripts/tests/sr/sr_mhd_linwave.py | 243 +- tst/regression/scripts/utils/athena.py | 17 +- tst/regression/scripts/utils/comparison.py | 27 +- tst/style/cpplint_athena.sh | 10 +- vis/python/athena_read.py | 1970 +-- vis/python/plot_lines.py | 322 +- vis/python/plot_mesh.py | 93 +- vis/python/plot_spherical.py | 611 +- vis/python/spherical_refinement.py | 1101 +- vis/python/uniform.py | 358 +- 156 files changed, 8398 insertions(+), 17124 deletions(-) create mode 100644 inputs/hydro/athinput.kh-shear rename inputs/hydro/{athinput.kh => athinput.kh-slip} (79%) create mode 100644 inputs/hydro/athinput.slow_shock create mode 100644 inputs/mhd/athinput.kh-shear create mode 100644 inputs/mhd/athinput.magnoh2 create mode 100644 inputs/mhd/athinput.magnoh3 create mode 100644 setup.cfg create mode 100644 src/hydro/rsolvers/hydro/llf.cpp create mode 100644 src/hydro/rsolvers/mhd/llf_mhd.cpp create mode 100644 src/pgen/magnoh.cpp delete mode 100644 tst/regression/data/gr_shock_tube.tab delete mode 100644 tst/regression/data/sr_hydro_shock1_hlle.vtk delete mode 100644 tst/regression/data/sr_hydro_shock2_hlle.vtk delete mode 100644 tst/regression/data/sr_hydro_shock3_hlle.vtk delete mode 100644 tst/regression/data/sr_hydro_shock4_hlle.vtk delete mode 100644 tst/regression/data/sr_mhd_shock1_hlle.vtk delete mode 100644 tst/regression/data/sr_mhd_shock2_hlle.vtk delete mode 100644 tst/regression/data/sr_mhd_shock4_hlle.vtk diff --git a/CPPLINT.cfg b/CPPLINT.cfg index 5ec95bbd..c1c4d518 100644 --- a/CPPLINT.cfg +++ b/CPPLINT.cfg @@ -5,10 +5,11 @@ linelength=90 # Don't use 'SRC_' as the cpp header guard prefix root=./src/ #extensions=hpp,cpp +# exclude_files=defs.hpp # does not work for files in subidirectories # Disable and enable specific categories (filters eval from left to right) filter=#+build/header_guard,+build/namespaces -filter=-readability/alt_tokens,-readability/casting,-readability/fn_size +filter=-readability/alt_tokens,-readability/fn_size filter=-runtime/references,-runtime/printf filter=-whitespace,+whitespace/line_length,+whitespace/braces#,+whitespace/parens # +build/include_alpha # only category disabled by default \ No newline at end of file diff --git a/configure.py b/configure.py index 3524c573..07962736 100755 --- a/configure.py +++ b/configure.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -#--------------------------------------------------------------------------------------- +# --------------------------------------------------------------------------------------- # configure.py: Athena++ configuration script in python. Original version by CJW. # # When configure.py is run, it uses the command line options and default settings to @@ -32,7 +32,7 @@ # --cflag=string append string whenever invoking compiler/linker # --include=path use -Ipath when compiling # --lib=path use -Lpath when linking -#----------------------------------------------------------------------------------------- +# ---------------------------------------------------------------------------------------- # Modules import argparse @@ -45,7 +45,7 @@ defsfile_input = 'src/defs.hpp.in' defsfile_output = 'src/defs.hpp' -#--- Step 1. Prepare parser, add each of the arguments ----------------------------------- +# --- Step 1. Prepare parser, add each of the arguments ------------------ parser = argparse.ArgumentParser() # --prob=[name] argument @@ -55,198 +55,221 @@ # remove 'src/pgen/' prefix and '.cpp' extension from each filename pgen_choices = [choice[len(pgen_directory):-4] for choice in pgen_choices] parser.add_argument('--prob', - default='shock_tube', - choices=pgen_choices, - help='select problem generator') + default='shock_tube', + choices=pgen_choices, + help='select problem generator') # --coord=[name] argument -parser.add_argument('--coord', +parser.add_argument( + '--coord', default='cartesian', - choices=['cartesian','cylindrical','spherical_polar','minkowski','sinusoidal', - 'tilted','schwarzschild','kerr-schild','gr_user'], + choices=[ + 'cartesian', + 'cylindrical', + 'spherical_polar', + 'minkowski', + 'sinusoidal', + 'tilted', + 'schwarzschild', + 'kerr-schild', + 'gr_user'], help='select coordinate system') # --eos=[name] argument parser.add_argument('--eos', - default='adiabatic', - choices=['adiabatic','isothermal'], - help='select equation of state') + default='adiabatic', + choices=['adiabatic', 'isothermal'], + help='select equation of state') # --flux=[name] argument parser.add_argument('--flux', - default='default', - choices=['default','hlle','hllc','hlld','roe','llf'], - help='select Riemann solver') + default='default', + choices=['default', 'hlle', 'hllc', 'hlld', 'roe', 'llf'], + help='select Riemann solver') # --nghost=[value] argument parser.add_argument('--nghost', - default='2', - help='set number of ghost zones') + default='2', + help='set number of ghost zones') # -b argument parser.add_argument('-b', - action='store_true', - default=False, - help='enable magnetic field') + action='store_true', + default=False, + help='enable magnetic field') # -s argument parser.add_argument('-s', - action='store_true', - default=False, - help='enable special relativity') + action='store_true', + default=False, + help='enable special relativity') # -g argument parser.add_argument('-g', - action='store_true', - default=False, - help='enable general relativity') + action='store_true', + default=False, + help='enable general relativity') # -t argument parser.add_argument('-t', - action='store_true', - default=False, - help='enable interface frame transformations for GR') + action='store_true', + default=False, + help='enable interface frame transformations for GR') # -shear argument parser.add_argument('-shear', - action='store_true', - default=False, - help='enable shearing box') + action='store_true', + default=False, + help='enable shearing box') # -debug argument parser.add_argument('-debug', - action='store_true', - default=False, - help='enable debug flags; override other compiler options') + action='store_true', + default=False, + help='enable debug flags; override other compiler options') # -float argument parser.add_argument('-float', - action='store_true', - default=False, - help='enable single precision') + action='store_true', + default=False, + help='enable single precision') # -mpi argument parser.add_argument('-mpi', - action='store_true', - default=False, - help='enable parallelization with MPI') + action='store_true', + default=False, + help='enable parallelization with MPI') # -omp argument parser.add_argument('-omp', - action='store_true', - default=False, - help='enable parallelization with OpenMP') + action='store_true', + default=False, + help='enable parallelization with OpenMP') # --grav=[name] argument parser.add_argument('--grav', - default='none', - choices=['none','fft'], - help='select self-gravity solver') + default='none', + choices=['none', 'fft'], + help='select self-gravity solver') # -fft argument parser.add_argument('-fft', - action='store_true', - default=False, - help='enable FFT') + action='store_true', + default=False, + help='enable FFT') # --fftw_path argument parser.add_argument('--fftw_path', - type=str, - default='', - help='path to FFTW libraries') + type=str, + default='', + help='path to FFTW libraries') # -hdf5 argument parser.add_argument('-hdf5', - action='store_true', - default=False, - help='enable HDF5 Output') + action='store_true', + default=False, + help='enable HDF5 Output') # -h5double argument parser.add_argument('-h5double', - action='store_true', - default=False, - help='enable double precision HDF5 output') + action='store_true', + default=False, + help='enable double precision HDF5 output') # --hdf5_path argument parser.add_argument('--hdf5_path', - default='', - help='path to HDF5 libraries') + default='', + help='path to HDF5 libraries') # --cxx=[name] argument -parser.add_argument('--cxx', +parser.add_argument( + '--cxx', default='g++', - choices=['g++','g++-simd','icc','cray','bgxl','icc-phi','clang++'], + choices=[ + 'g++', + 'g++-simd', + 'icc', + 'icc-debug', + 'cray', + 'bgxl', + 'icc-phi', + 'clang++', + 'clang++-simd', + ], help='select C++ compiler') # --ccmd=[name] argument parser.add_argument('--ccmd', - default=None, - help='override for command to use to call C++ compiler') + default=None, + help='override for command to use to call C++ compiler') # --cflag=[string] argument parser.add_argument('--cflag', - default=None, - help='additional string of flags to append to compiler/linker calls') + default=None, + help='additional string of flags to append to compiler/linker calls') # --include=[name] arguments -parser.add_argument('--include', +parser.add_argument( + '--include', default=[], action='append', - help='extra path for included header files (-I); can be specified multiple \ - times') - + help=('extra path for included header files (-I); can be specified multiple ' + 'times') +) # --lib=[name] arguments -parser.add_argument('--lib', +parser.add_argument( + '--lib', default=[], action='append', - help='extra path for linked library files (-L); can be specified multiple \ - times') + help=('extra path for linked library files (-L); can be specified multiple ' + 'times') +) # Parse command-line inputs args = vars(parser.parse_args()) -#--- Step 2. Test for incompatible arguments --------------------------------------------- +# --- Step 2. Test for incompatible arguments ---------------------------- # Set default flux; HLLD for MHD, HLLC for hydro, HLLE for isothermal hydro or any GR if args['flux'] == 'default': - if args['g']: - args['flux'] = 'hlle' - elif args['b']: - args['flux'] = 'hlld' - elif args['eos'] == 'isothermal': - args['flux'] = 'hlle' - else: - args['flux'] = 'hllc' + if args['g']: + args['flux'] = 'hlle' + elif args['b']: + args['flux'] = 'hlld' + elif args['eos'] == 'isothermal': + args['flux'] = 'hlle' + else: + args['flux'] = 'hllc' # Check Riemann solver compatibility if args['flux'] == 'hllc' and args['eos'] == 'isothermal': - raise SystemExit('### CONFIGURE ERROR: HLLC flux cannot be used with isothermal EOS') + raise SystemExit('### CONFIGURE ERROR: HLLC flux cannot be used with isothermal EOS') if args['flux'] == 'hllc' and args['b']: - raise SystemExit('### CONFIGURE ERROR: HLLC flux cannot be used with MHD') + raise SystemExit('### CONFIGURE ERROR: HLLC flux cannot be used with MHD') if args['flux'] == 'hlld' and not args['b']: - raise SystemExit('### CONFIGURE ERROR: HLLD flux can only be used with MHD') + raise SystemExit('### CONFIGURE ERROR: HLLD flux can only be used with MHD') # Check relativity if args['s'] and args['g']: - raise SystemExit('### CONFIGURE ERROR: ' \ - + 'GR implies SR; the -s option is restricted to pure SR') + raise SystemExit('### CONFIGURE ERROR: ' + + 'GR implies SR; the -s option is restricted to pure SR') if args['t'] and not args['g']: - raise SystemExit('### CONFIGURE ERROR: Frame transformations only apply to GR') -if args['g'] and not args['t'] and args['flux'] not in ('llf','hlle'): - raise SystemExit('### CONFIGURE ERROR: Frame transformations required for {0}'\ - .format(args['flux'])) -if args['g'] and args['coord'] in ('cartesian','cylindrical','spherical_polar'): - raise SystemExit('### CONFIGURE ERROR: GR cannot be used with {0} coordinates'\ - .format(args['coord'])) -if not args['g'] and args['coord'] not in ('cartesian','cylindrical','spherical_polar'): - raise SystemExit('### CONFIGURE ERROR: ' \ - + args['coord'] + ' coordinates only apply to GR') + raise SystemExit('### CONFIGURE ERROR: Frame transformations only apply to GR') +if args['g'] and not args['t'] and args['flux'] not in ('llf', 'hlle'): + raise SystemExit('### CONFIGURE ERROR: Frame transformations required for {0}' + .format(args['flux'])) +if args['g'] and args['coord'] in ('cartesian', 'cylindrical', 'spherical_polar'): + raise SystemExit('### CONFIGURE ERROR: GR cannot be used with {0} coordinates' + .format(args['coord'])) +if not args['g'] and args['coord'] not in ('cartesian', 'cylindrical', 'spherical_polar'): + raise SystemExit('### CONFIGURE ERROR: ' + + args['coord'] + ' coordinates only apply to GR') if args['eos'] == 'isothermal': - if args['s'] or args['g']: - raise SystemExit('### CONFIGURE ERROR: '\ - + 'Isothermal EOS is incompatible with relativity') + if args['s'] or args['g']: + raise SystemExit('### CONFIGURE ERROR: ' + + 'Isothermal EOS is incompatible with relativity') -#--- Step 3. Set definitions and Makefile options based on above arguments --------------- +# --- Step 3. Set definitions and Makefile options based on above argument # Prepare dictionaries of substitutions to be made definitions = {} @@ -264,9 +287,9 @@ makefile_options['EOS_FILE'] = args['eos'] # set number of hydro variables for adiabatic/isothermal if args['eos'] == 'adiabatic': - definitions['NHYDRO_VARIABLES'] = '5' + definitions['NHYDRO_VARIABLES'] = '5' if args['eos'] == 'isothermal': - definitions['NHYDRO_VARIABLES'] = '4' + definitions['NHYDRO_VARIABLES'] = '4' # --flux=[name] argument definitions['RSOLVER'] = makefile_options['RSOLVER_FILE'] = args['flux'] @@ -277,245 +300,288 @@ # -b argument # set variety of macros based on whether MHD/hydro or adi/iso are defined if args['b']: - definitions['MAGNETIC_FIELDS_ENABLED'] = '1' - makefile_options['EOS_FILE'] += '_mhd' - definitions['NFIELD_VARIABLES'] = '3' - makefile_options['RSOLVER_DIR'] = 'mhd/' - if args['flux'] == 'hlle' or args['flux'] == 'llf' or args['flux'] == 'roe': - makefile_options['RSOLVER_FILE'] += '_mhd' - if args['eos'] == 'adiabatic': - definitions['NWAVE_VALUE'] = '7' - else: - definitions['NWAVE_VALUE'] = '6' - if args['flux'] == 'hlld': - makefile_options['RSOLVER_FILE'] += '_iso' + definitions['MAGNETIC_FIELDS_ENABLED'] = '1' + makefile_options['EOS_FILE'] += '_mhd' + definitions['NFIELD_VARIABLES'] = '3' + makefile_options['RSOLVER_DIR'] = 'mhd/' + if args['flux'] == 'hlle' or args['flux'] == 'llf' or args['flux'] == 'roe': + makefile_options['RSOLVER_FILE'] += '_mhd' + if args['eos'] == 'adiabatic': + definitions['NWAVE_VALUE'] = '7' + else: + definitions['NWAVE_VALUE'] = '6' + if args['flux'] == 'hlld': + makefile_options['RSOLVER_FILE'] += '_iso' else: - definitions['MAGNETIC_FIELDS_ENABLED'] = '0' - makefile_options['EOS_FILE'] += '_hydro' - definitions['NFIELD_VARIABLES'] = '0' - makefile_options['RSOLVER_DIR'] = 'hydro/' - if args['eos'] == 'adiabatic': - definitions['NWAVE_VALUE'] = '5' - else: - definitions['NWAVE_VALUE'] = '4' + definitions['MAGNETIC_FIELDS_ENABLED'] = '0' + makefile_options['EOS_FILE'] += '_hydro' + definitions['NFIELD_VARIABLES'] = '0' + makefile_options['RSOLVER_DIR'] = 'hydro/' + if args['eos'] == 'adiabatic': + definitions['NWAVE_VALUE'] = '5' + else: + definitions['NWAVE_VALUE'] = '4' # -s, -g, and -t arguments definitions['RELATIVISTIC_DYNAMICS'] = '1' if args['s'] or args['g'] else '0' definitions['GENERAL_RELATIVITY'] = '1' if args['g'] else '0' definitions['FRAME_TRANSFORMATIONS'] = '1' if args['t'] else '0' if args['s']: - makefile_options['EOS_FILE'] += '_sr' - makefile_options['RSOLVER_FILE'] += '_rel' + makefile_options['EOS_FILE'] += '_sr' + makefile_options['RSOLVER_FILE'] += '_rel' if args['g']: - makefile_options['EOS_FILE'] += '_gr' - makefile_options['RSOLVER_FILE'] += '_rel' - if not args['t']: - makefile_options['RSOLVER_FILE'] += '_no_transform' + makefile_options['EOS_FILE'] += '_gr' + makefile_options['RSOLVER_FILE'] += '_rel' + if not args['t']: + makefile_options['RSOLVER_FILE'] += '_no_transform' # -shear argument if args['shear']: - definitions['SHEARING_BOX'] = '1' + definitions['SHEARING_BOX'] = '1' else: - definitions['SHEARING_BOX'] = '0' + definitions['SHEARING_BOX'] = '0' # --cxx=[name] argument if args['cxx'] == 'g++': - definitions['COMPILER_CHOICE'] = 'g++' - definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'g++' - makefile_options['PREPROCESSOR_FLAGS'] = '' - makefile_options['COMPILER_FLAGS'] = '-O3 -std=c++11' - makefile_options['LINKER_FLAGS'] = '' - makefile_options['LIBRARY_FLAGS'] = '' + definitions['COMPILER_CHOICE'] = 'g++' + definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'g++' + makefile_options['PREPROCESSOR_FLAGS'] = '' + makefile_options['COMPILER_FLAGS'] = '-O3 -std=c++11' + makefile_options['LINKER_FLAGS'] = '' + makefile_options['LIBRARY_FLAGS'] = '' if args['cxx'] == 'g++-simd': - definitions['COMPILER_CHOICE'] = 'g++-simd' # gcc version > 4.9 - definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'g++' - makefile_options['PREPROCESSOR_FLAGS'] = '' - makefile_options['COMPILER_FLAGS'] = '-O3 -std=c++11 -fopenmp-simd -fwhole-program' \ - + ' -march=skylake-avx512 -flto' - makefile_options['LINKER_FLAGS'] = '' - makefile_options['LIBRARY_FLAGS'] = '' + # GCC version >= 4.9, for OpenMP 4.0; version >= 6.1 for OpenMP 4.5 + definitions['COMPILER_CHOICE'] = 'g++-simd' + definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'g++' + makefile_options['PREPROCESSOR_FLAGS'] = '' + makefile_options['COMPILER_FLAGS'] = ( + '-O3 -std=c++11 -fopenmp-simd -fwhole-program -flto -ffast-math ' + '-march=native -fprefetch-loop-arrays' + # -march=skylake-avx512, skylake, core-avx2 + # -mprefer-vector-width=128 # available in gcc-8, but not gcc-7 + # -mtune=native, generic, broadwell + # -mprefer-avx128 + # -m64 (default) + ) + makefile_options['LINKER_FLAGS'] = '' + makefile_options['LIBRARY_FLAGS'] = '' if args['cxx'] == 'icc': - definitions['COMPILER_CHOICE'] = 'icc' - definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'icc' - makefile_options['PREPROCESSOR_FLAGS'] = '' - makefile_options['COMPILER_FLAGS'] = '-O3 -std=c++11 -ipo -xhost -inline-forceinline' \ - + ' -qopenmp-simd -qopt-prefetch=4' - #-qopt-zmm-usage=high' - makefile_options['LINKER_FLAGS'] = '' - makefile_options['LIBRARY_FLAGS'] = '' + definitions['COMPILER_CHOICE'] = 'icc' + definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'icc' + makefile_options['PREPROCESSOR_FLAGS'] = '' + makefile_options['COMPILER_FLAGS'] = ( + '-O3 -std=c++11 -ipo -xhost -inline-forceinline -qopenmp-simd -qopt-prefetch=4' + ) + # -qopt-zmm-usage=high' + makefile_options['LINKER_FLAGS'] = '' + makefile_options['LIBRARY_FLAGS'] = '' + +if args['cxx'] == 'icc-debug': + # Disable IPO, forced inlining, and fast math. Enable vectorization reporting. + # Useful for testing symmetry, SIMD-enabled functions and loops with OpenMP 4.5 + definitions['COMPILER_CHOICE'] = 'icc' + definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'icc' + makefile_options['PREPROCESSOR_FLAGS'] = '' + makefile_options['COMPILER_FLAGS'] = ( + '-O3 -std=c++11 -xhost -qopenmp-simd -fp-model precise -qopt-prefetch=4 ' + '-qopt-report=5 -qopt-report-phase=openmp,vec -g' + ) + makefile_options['LINKER_FLAGS'] = '' + makefile_options['LIBRARY_FLAGS'] = '' if args['cxx'] == 'cray': - definitions['COMPILER_CHOICE'] = 'cray' - definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'CC' - makefile_options['PREPROCESSOR_FLAGS'] = '' - makefile_options['COMPILER_FLAGS'] = '-O3 -std=c++11 -h aggress -h vector3 -hfp3' - makefile_options['LINKER_FLAGS'] = '-hwp -hpl=obj/lib' - makefile_options['LIBRARY_FLAGS'] = '-lm' + definitions['COMPILER_CHOICE'] = 'cray' + definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'CC' + makefile_options['PREPROCESSOR_FLAGS'] = '' + makefile_options['COMPILER_FLAGS'] = '-O3 -std=c++11 -h aggress -h vector3 -hfp3' + makefile_options['LINKER_FLAGS'] = '-hwp -hpl=obj/lib' + makefile_options['LIBRARY_FLAGS'] = '-lm' if args['cxx'] == 'bgxl': - # suppressed messages: - # 1500-036: The NOSTRICT option has the potential to alter the semantics of a program - # 1540-1401: An unknown "pragma simd" is specified - # 1586-083: ld option ignored by IPA - # 1586-233: Duplicate definition of symbol ignored - # 1586-267: Inlining of specified subprogram failed due to the presence of a C++ - # exception handler - definitions['COMPILER_CHOICE'] = 'bgxlc++' - definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'bgxlc++' - makefile_options['PREPROCESSOR_FLAGS'] = '' - makefile_options['COMPILER_FLAGS'] = \ - '-O3 -qhot=level=1:vector -qinline=level=5:auto -qipa=level=1:noobject' \ - + ' -qstrict=subnormals -qmaxmem=150000 -qlanglvl=extended -qsuppress=1500-036' \ - + ' -qsuppress=1540-1401 -qsuppress=1586-083 -qsuppress=1586-233' \ - + ' -qsuppress=1586-267' - makefile_options['LINKER_FLAGS'] = makefile_options['COMPILER_FLAGS'] - makefile_options['LIBRARY_FLAGS'] = '' + # suppressed messages: + # 1500-036: The NOSTRICT option has the potential to alter the program's semantics + # 1540-1401: An unknown "pragma simd" is specified + # 1586-083: ld option ignored by IPA + # 1586-233: Duplicate definition of symbol ignored + # 1586-267: Inlining of specified subprogram failed due to the presence of a C++ + # exception handler + definitions['COMPILER_CHOICE'] = 'bgxlc++' + definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'bgxlc++' + makefile_options['PREPROCESSOR_FLAGS'] = '' + makefile_options['COMPILER_FLAGS'] = ( + '-O3 -qhot=level=1:vector -qinline=level=5:auto -qipa=level=1:noobject' + ' -qstrict=subnormals -qmaxmem=150000 -qlanglvl=extended -qsuppress=1500-036' + ' -qsuppress=1540-1401 -qsuppress=1586-083 -qsuppress=1586-233' + ' -qsuppress=1586-267' + ) + makefile_options['LINKER_FLAGS'] = makefile_options['COMPILER_FLAGS'] + makefile_options['LIBRARY_FLAGS'] = '' if args['cxx'] == 'icc-phi': - definitions['COMPILER_CHOICE'] = 'icc' - definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'icc' - makefile_options['PREPROCESSOR_FLAGS'] = '' - makefile_options['COMPILER_FLAGS'] = '-O3 -std=c++11 -ipo -xMIC-AVX512 -inline-forceinline -qopenmp-simd' - makefile_options['LINKER_FLAGS'] = '' - makefile_options['LIBRARY_FLAGS'] = '' + definitions['COMPILER_CHOICE'] = 'icc' + definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'icc' + makefile_options['PREPROCESSOR_FLAGS'] = '' + makefile_options['COMPILER_FLAGS'] = ( + '-O3 -std=c++11 -ipo -xMIC-AVX512 -inline-forceinline -qopenmp-simd' + ) + makefile_options['LINKER_FLAGS'] = '' + makefile_options['LIBRARY_FLAGS'] = '' if args['cxx'] == 'clang++': - definitions['COMPILER_CHOICE'] = 'clang++' - definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'clang++' - makefile_options['PREPROCESSOR_FLAGS'] = '' - makefile_options['COMPILER_FLAGS'] = '-O3 -std=c++11' - makefile_options['LINKER_FLAGS'] = '' - makefile_options['LIBRARY_FLAGS'] = '' + definitions['COMPILER_CHOICE'] = 'clang++' + definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'clang++' + makefile_options['PREPROCESSOR_FLAGS'] = '' + makefile_options['COMPILER_FLAGS'] = '-O3 -std=c++11' + makefile_options['LINKER_FLAGS'] = '' + makefile_options['LIBRARY_FLAGS'] = '' + +if args['cxx'] == 'clang++-simd': + # LLVM/clang version >= 3.9 for most of OpenMP 4.0, 4.5 (still incomplete; no + # offloading, target/declare simd directives). OpenMP 3.1 fully supported in LLVM 3.7 + definitions['COMPILER_CHOICE'] = 'clang++-simd' + definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'clang++' + makefile_options['PREPROCESSOR_FLAGS'] = '' + makefile_options['COMPILER_FLAGS'] = '-O3 -std=c++11 -fopenmp-simd' + makefile_options['LINKER_FLAGS'] = '' + makefile_options['LIBRARY_FLAGS'] = '' # -float argument if args['float']: - definitions['SINGLE_PRECISION_ENABLED'] = '1' + definitions['SINGLE_PRECISION_ENABLED'] = '1' else: - definitions['SINGLE_PRECISION_ENABLED'] = '0' + definitions['SINGLE_PRECISION_ENABLED'] = '0' # -debug argument if args['debug']: - definitions['DEBUG'] = 'DEBUG' - if args['cxx'] == 'g++' or args['cxx'] == 'g++-simd' or args['cxx'] == 'icc': - makefile_options['COMPILER_FLAGS'] = '-O0 -g' - if args['cxx'] == 'cray': - makefile_options['COMPILER_FLAGS'] = '-O0' - if args['cxx'] == 'bgxl': - makefile_options['COMPILER_FLAGS'] = '-O0 -g -qlanglvl=extended' - if args['cxx'] == 'icc-phi': - makefile_options['COMPILER_FLAGS'] = '-O0 -g -xMIC-AVX512' + definitions['DEBUG'] = 'DEBUG' + if (args['cxx'] == 'g++' or args['cxx'] == 'g++-simd' or args['cxx'] == 'icc' + or args['cxx'] == 'icc-debug'): + makefile_options['COMPILER_FLAGS'] = '-O0 -g' + if args['cxx'] == 'cray': + makefile_options['COMPILER_FLAGS'] = '-O0' + if args['cxx'] == 'bgxl': + makefile_options['COMPILER_FLAGS'] = '-O0 -g -qlanglvl=extended' + if args['cxx'] == 'icc-phi': + makefile_options['COMPILER_FLAGS'] = '-O0 -g -xMIC-AVX512' else: - definitions['DEBUG'] = 'NOT_DEBUG' + definitions['DEBUG'] = 'NOT_DEBUG' # -mpi argument if args['mpi']: - definitions['MPI_OPTION'] = 'MPI_PARALLEL' - if args['cxx'] == 'g++' or args['cxx'] == 'icc' or args['cxx'] == 'icc-phi' \ - or args['cxx'] == 'g++-simd' or args['cxx'] == 'clang++': - definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'mpicxx' - if args['cxx'] == 'cray': - makefile_options['COMPILER_FLAGS'] += ' -h mpi1' - if args['cxx'] == 'bgxl': - definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'mpixlcxx' + definitions['MPI_OPTION'] = 'MPI_PARALLEL' + if (args['cxx'] == 'g++' or args['cxx'] == 'icc' or args['cxx'] == 'icc-debug' + or args['cxx'] == 'icc-phi' or args['cxx'] == 'g++-simd' + or args['cxx'] == 'clang++' or args['cxx'] == 'clang++-simd'): + definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'mpicxx' + if args['cxx'] == 'cray': + makefile_options['COMPILER_FLAGS'] += ' -h mpi1' + if args['cxx'] == 'bgxl': + definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = 'mpixlcxx' # noqa else: - definitions['MPI_OPTION'] = 'NOT_MPI_PARALLEL' + definitions['MPI_OPTION'] = 'NOT_MPI_PARALLEL' # -omp argument if args['omp']: - definitions['OPENMP_OPTION'] = 'OPENMP_PARALLEL' - if args['cxx'] == 'g++' or args['cxx'] == 'g++-simd' or args['cxx'] == 'clang++': - makefile_options['COMPILER_FLAGS'] += ' -fopenmp' - if args['cxx'] == 'icc' or args['cxx'] == 'icc-phi': - makefile_options['COMPILER_FLAGS'] += ' -qopenmp' - if args['cxx'] == 'cray': - makefile_options['COMPILER_FLAGS'] += ' -homp' - if args['cxx'] == 'bgxl': - # use thread-safe version of compiler - definitions['COMPILER_COMMAND'] += '_r' - makefile_options['COMPILER_COMMAND'] += '_r' - makefile_options['COMPILER_FLAGS'] += ' -qsmp' + definitions['OPENMP_OPTION'] = 'OPENMP_PARALLEL' + if (args['cxx'] == 'g++' or args['cxx'] == 'g++-simd' or args['cxx'] == 'clang++' + or args['cxx'] == 'clang++-simd'): + makefile_options['COMPILER_FLAGS'] += ' -fopenmp' + if args['cxx'] == 'icc' or args['cxx'] == 'icc-debug' or args['cxx'] == 'icc-phi': + makefile_options['COMPILER_FLAGS'] += ' -qopenmp' + if args['cxx'] == 'cray': + makefile_options['COMPILER_FLAGS'] += ' -homp' + if args['cxx'] == 'bgxl': + # use thread-safe version of compiler + definitions['COMPILER_COMMAND'] += '_r' + makefile_options['COMPILER_COMMAND'] += '_r' + makefile_options['COMPILER_FLAGS'] += ' -qsmp' else: - definitions['OPENMP_OPTION'] = 'NOT_OPENMP_PARALLEL' - if args['cxx'] == 'cray': - makefile_options['COMPILER_FLAGS'] += ' -hnoomp' - if args['cxx'] == 'icc' or args['cxx'] == 'icc-phi': - # suppressed messages: - # 3180: pragma omp not recognized - makefile_options['COMPILER_FLAGS'] += ' -diag-disable 3180' + definitions['OPENMP_OPTION'] = 'NOT_OPENMP_PARALLEL' + if args['cxx'] == 'cray': + makefile_options['COMPILER_FLAGS'] += ' -hnoomp' + if args['cxx'] == 'icc' or args['cxx'] == 'icc-debug' or args['cxx'] == 'icc-phi': + # suppressed messages: + # 3180: pragma omp not recognized + makefile_options['COMPILER_FLAGS'] += ' -diag-disable 3180' # --grav argument if args['grav'] == "none": - definitions['SELF_GRAVITY_ENABLED'] = '0' + definitions['SELF_GRAVITY_ENABLED'] = '0' else: - if args['grav'] == "fft": - definitions['SELF_GRAVITY_ENABLED'] = '1' - if not args['fft']: - raise SystemExit('### CONFIGURE ERROR: FFT Poisson solver only be used with FFT') + if args['grav'] == "fft": + definitions['SELF_GRAVITY_ENABLED'] = '1' + if not args['fft']: + raise SystemExit( + '### CONFIGURE ERROR: FFT Poisson solver only be used with FFT') # -fft argument makefile_options['MPIFFT_FILE'] = ' ' definitions['FFT_ENABLED'] = '0' definitions['FFT_DEFINE'] = 'NO_FFT' if args['fft']: - definitions['FFT_ENABLED'] = '1' - definitions['FFT_DEFINE'] = 'FFT' - if args['fftw_path'] != '': - makefile_options['PREPROCESSOR_FLAGS'] += ' -I{0}/include'.format(args['fftw_path']) - makefile_options['LINKER_FLAGS'] += ' -L{0}/lib'.format(args['fftw_path']) - if args['omp']: - makefile_options['LIBRARY_FLAGS'] += ' -lfftw3_omp' - if args['mpi']: - makefile_options['MPIFFT_FILE'] = ' $(wildcard src/fft/plimpton/*.cpp)' - makefile_options['LIBRARY_FLAGS'] += ' -lfftw3' + definitions['FFT_ENABLED'] = '1' + definitions['FFT_DEFINE'] = 'FFT' + if args['fftw_path'] != '': + makefile_options['PREPROCESSOR_FLAGS'] += ' -I{0}/include'.format( + args['fftw_path']) + makefile_options['LINKER_FLAGS'] += ' -L{0}/lib'.format(args['fftw_path']) + if args['omp']: + makefile_options['LIBRARY_FLAGS'] += ' -lfftw3_omp' + if args['mpi']: + makefile_options['MPIFFT_FILE'] = ' $(wildcard src/fft/plimpton/*.cpp)' + makefile_options['LIBRARY_FLAGS'] += ' -lfftw3' # -hdf5 argument if args['hdf5']: - definitions['HDF5_OPTION'] = 'HDF5OUTPUT' - - if args['hdf5_path'] != '': - makefile_options['PREPROCESSOR_FLAGS'] += ' -I{0}/include'.format(args['hdf5_path']) - makefile_options['LINKER_FLAGS'] += ' -L{0}/lib'.format(args['hdf5_path']) - if args['cxx'] == 'g++' or args['cxx'] == 'icc' or args['cxx'] == 'cray' \ - or args['cxx'] == 'icc-phi' or args['cxx'] == 'clang++': - makefile_options['LIBRARY_FLAGS'] += ' -lhdf5' - if args['cxx'] == 'bgxl': - makefile_options['PREPROCESSOR_FLAGS'] += \ - ' -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_BSD_SOURCE' \ - + ' -I/soft/libraries/hdf5/1.10.0/cnk-xl/current/include' \ - + ' -I/bgsys/drivers/ppcfloor/comm/include' - makefile_options['LINKER_FLAGS'] += \ - ' -L/soft/libraries/hdf5/1.10.0/cnk-xl/current/lib' \ - + ' -L/soft/libraries/alcf/current/xl/ZLIB/lib' - makefile_options['LIBRARY_FLAGS'] += ' -lhdf5 -lz -lm' + definitions['HDF5_OPTION'] = 'HDF5OUTPUT' + + if args['hdf5_path'] != '': + makefile_options['PREPROCESSOR_FLAGS'] += ' -I{0}/include'.format( + args['hdf5_path']) + makefile_options['LINKER_FLAGS'] += ' -L{0}/lib'.format(args['hdf5_path']) + if (args['cxx'] == 'g++' or args['cxx'] == 'icc' or args['cxx'] == 'cray' + or args['cxx'] == 'icc-debug' or args['cxx'] == 'icc-phi' + or args['cxx'] == 'clang++' or args['cxx'] == 'clang++-simd'): + makefile_options['LIBRARY_FLAGS'] += ' -lhdf5' + if args['cxx'] == 'bgxl': + makefile_options['PREPROCESSOR_FLAGS'] += ( + ' -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_BSD_SOURCE' + ' -I/soft/libraries/hdf5/1.10.0/cnk-xl/current/include' + ' -I/bgsys/drivers/ppcfloor/comm/include') + makefile_options['LINKER_FLAGS'] += ( + ' -L/soft/libraries/hdf5/1.10.0/cnk-xl/current/lib' + ' -L/soft/libraries/alcf/current/xl/ZLIB/lib') + makefile_options['LIBRARY_FLAGS'] += ' -lhdf5 -lz -lm' else: - definitions['HDF5_OPTION'] = 'NO_HDF5OUTPUT' + definitions['HDF5_OPTION'] = 'NO_HDF5OUTPUT' # -h5double argument (does nothing if no -hdf5) if args['h5double']: - definitions['H5_DOUBLE_PRECISION_ENABLED'] = '1' + definitions['H5_DOUBLE_PRECISION_ENABLED'] = '1' else: - definitions['H5_DOUBLE_PRECISION_ENABLED'] = '0' + definitions['H5_DOUBLE_PRECISION_ENABLED'] = '0' # --ccmd=[name] argument if args['ccmd'] is not None: - definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = args['ccmd'] + definitions['COMPILER_COMMAND'] = makefile_options['COMPILER_COMMAND'] = args['ccmd'] # --cflag=[string] argument if args['cflag'] is not None: - makefile_options['COMPILER_FLAGS'] += ' '+args['cflag'] + makefile_options['COMPILER_FLAGS'] += ' '+args['cflag'] # --include=[name] arguments for include_path in args['include']: - makefile_options['COMPILER_FLAGS'] += ' -I'+include_path + makefile_options['COMPILER_FLAGS'] += ' -I'+include_path # --lib=[name] arguments for library_path in args['lib']: - makefile_options['LINKER_FLAGS'] += ' -L'+library_path + makefile_options['LINKER_FLAGS'] += ' -L'+library_path # Assemble all flags of any sort given to compiler -definitions['COMPILER_FLAGS'] = ' '.join([makefile_options[opt+'_FLAGS'] for opt in \ - ['PREPROCESSOR','COMPILER','LINKER','LIBRARY']]) +definitions['COMPILER_FLAGS'] = ' '.join( + [makefile_options[opt+'_FLAGS'] for opt in + ['PREPROCESSOR', 'COMPILER', 'LINKER', 'LIBRARY']]) -#--- Step 4. Create new files, finish up ------------------------------------------------- +# --- Step 4. Create new files, finish up -------------------------------- # Terminate all filenames with .cpp extension makefile_options['PROBLEM_FILE'] += '.cpp' @@ -525,21 +591,21 @@ # Read templates with open(defsfile_input, 'r') as current_file: - defsfile_template = current_file.read() + defsfile_template = current_file.read() with open(makefile_input, 'r') as current_file: - makefile_template = current_file.read() + makefile_template = current_file.read() # Make substitutions -for key,val in definitions.items(): - defsfile_template = re.sub(r'@{0}@'.format(key), val, defsfile_template) -for key,val in makefile_options.items(): - makefile_template = re.sub(r'@{0}@'.format(key), val, makefile_template) +for key, val in definitions.items(): + defsfile_template = re.sub(r'@{0}@'.format(key), val, defsfile_template) +for key, val in makefile_options.items(): + makefile_template = re.sub(r'@{0}@'.format(key), val, makefile_template) # Write output files with open(defsfile_output, 'w') as current_file: - current_file.write(defsfile_template) + current_file.write(defsfile_template) with open(makefile_output, 'w') as current_file: - current_file.write(makefile_template) + current_file.write(makefile_template) # Finish with diagnostic output print('Your Athena++ distribution has now been configured with the following options:') @@ -554,8 +620,8 @@ print(' Frame transformations: ' + ('ON' if args['t'] else 'OFF')) print(' ShearingBox: ' + ('ON' if args['shear'] else 'OFF')) print(' Debug flags: ' + ('ON' if args['debug'] else 'OFF')) -print(' Linker flags: ' + makefile_options['LINKER_FLAGS'] + ' ' \ - + makefile_options['LIBRARY_FLAGS']) +print(' Linker flags: ' + makefile_options['LINKER_FLAGS'] + ' ' + + makefile_options['LIBRARY_FLAGS']) print(' Precision: ' + ('single' if args['float'] else 'double')) print(' Number of ghost cells: ' + args['nghost']) print(' MPI parallelism: ' + ('ON' if args['mpi'] else 'OFF')) @@ -564,5 +630,5 @@ print(' HDF5 output: ' + ('ON' if args['hdf5'] else 'OFF')) print(' HDF5 precision: ' + ('double' if args['h5double'] else 'single')) print(' Compiler: ' + args['cxx']) -print(' Compilation command: ' + makefile_options['COMPILER_COMMAND'] + ' ' \ - + makefile_options['PREPROCESSOR_FLAGS'] + ' ' + makefile_options['COMPILER_FLAGS']) +print(' Compilation command: ' + makefile_options['COMPILER_COMMAND'] + ' ' + + makefile_options['PREPROCESSOR_FLAGS'] + ' ' + makefile_options['COMPILER_FLAGS']) diff --git a/inputs/hydro/athinput.kh-shear b/inputs/hydro/athinput.kh-shear new file mode 100644 index 00000000..5165e97f --- /dev/null +++ b/inputs/hydro/athinput.kh-shear @@ -0,0 +1,52 @@ + +problem = Kelvin Helmholtz instability +reference = Frank et al., ApJ 460, 777, 1996 +configure = --prob=kh + + +problem_id = kh-shear # problem ID: basename of output filenames + + +file_type = hst # History data dump +dt = 0.01 # time increment between outputs + + +file_type = vtk # Binary data dump +variable = prim # variables to be output +dt = 0.1 # time increment between outputs + +