diff --git a/.github/scripts/run_coverage.sh b/.github/scripts/run_coverage.sh index a3f0d597c..ecbb885b6 100755 --- a/.github/scripts/run_coverage.sh +++ b/.github/scripts/run_coverage.sh @@ -56,7 +56,12 @@ run_simple() { # run ./run_this_example.sh if [[ $? -ne 0 ]]; then exit 1; fi + + # cleanup mv -v DATA/Par_file.org DATA/Par_file + rm -rf OUTPUT_FILES/ + if [ -e DATABASES_MPI ]; then rm -rf DATABASES_MPI/; fi + cd "$WORKDIR" } @@ -83,7 +88,13 @@ run_kernel() { # run ./run_this_example_kernel.sh if [[ $? -ne 0 ]]; then exit 1; fi + + # cleanup mv -v DATA/Par_file.org DATA/Par_file + rm -rf OUTPUT_FILES/ + if [ -e DATABASES_MPI ]; then rm -rf DATABASES_MPI/; fi + if [ -e SEM ]; then rm -rf SEM/; fi + cd "$WORKDIR" } @@ -113,8 +124,13 @@ run_serial() { # run ./run_this_example.sh if [[ $? -ne 0 ]]; then exit 1; fi + + # cleanup mv -v DATA/Par_file.org DATA/Par_file if [ -e DATA/meshfem3D_files/Mesh_Par_file.org ]; then mv -v DATA/meshfem3D_files/Mesh_Par_file.org DATA/meshfem3D_files/Mesh_Par_file; fi + rm -rf OUTPUT_FILES/ + if [ -e DATABASES_MPI ]; then rm -rf DATABASES_MPI/; fi + cd "$WORKDIR" } diff --git a/.github/scripts/run_tests.sh b/.github/scripts/run_tests.sh index 63e8c592a..2678cbce6 100755 --- a/.github/scripts/run_tests.sh +++ b/.github/scripts/run_tests.sh @@ -225,7 +225,7 @@ if [ -e DATA/Par_file ]; then cp -v DATA/Par_file DATA/Par_file.bak fi -# use kernel script +# runs simulation if [ "${RUN_KERNEL}" == "true" ]; then # use kernel script ./run_this_example_kernel.sh | tee output.log diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5639aa351..e3e74aef4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -345,8 +345,8 @@ jobs: # debug #export I_MPI_DEBUG=5,pid,host #export I_MPI_LIBRARY_KIND=debug - # remove -ftrapuv which leads to issues for running tests - sed -i "s/-ftrapuv//g" flags.guess + # remove -ftrapuv in case it leads to issues for running tests + #sed -i "s/-ftrapuv//g" flags.guess # environment setting export TERM=xterm # export info @@ -363,7 +363,7 @@ jobs: - name: configure serial debug run: | set +e # revert the default `set -e` - ./configure --enable-debug --without-mpi FC=ifx CC=icx + ./configure --enable-debug --without-mpi FC=ifx CC=icx CXX=icx if [[ $? -ne 0 ]]; then echo "configuration failed:"; cat config.log; echo ""; echo "exiting..."; exit 1; fi - name: make serial debug @@ -374,7 +374,7 @@ jobs: - name: configure serial run: | - ./configure --without-mpi FC=ifx CC=icx + ./configure --without-mpi FC=ifx CC=icx CXX=icx - name: make serial run: | @@ -384,7 +384,8 @@ jobs: - name: configure parallel debug run: | set +e # revert the default `set -e` - ./configure --enable-debug --with-mpi FC=ifx CC=icx MPIFC=mpiifx MPI_INC="${I_MPI_ROOT}/include" + # adds -std=gnu17 to CFLAGS otherwise it will by default use -std=gnu23 which leads to errors in Scotch compilation + ./configure --enable-debug --with-mpi FC=ifx CC=icx CXX=icx CFLAGS="-std=gnu17 -Wall" MPIFC=mpiifx MPI_INC="${I_MPI_ROOT}/include" if [[ $? -ne 0 ]]; then echo "configuration failed:"; cat config.log; echo ""; echo "exiting..."; exit 1; fi - name: make parallel debug @@ -395,7 +396,7 @@ jobs: - name: configure parallel run: | - ./configure --with-mpi FC=ifx CC=icx MPIFC=mpiifx MPI_INC="${I_MPI_ROOT}/include" + ./configure --with-mpi FC=ifx CC=icx CXX=icx CFLAGS="-std=gnu17" MPIFC=mpiifx MPI_INC="${I_MPI_ROOT}/include" - name: make parallel run: | diff --git a/.gitignore b/.gitignore index c995d3a90..a4621c17e 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,3 @@ doc/USER_MANUAL/Schedule .*swn *~ *.pyc - -# misc -.aider* - diff --git a/DATA/Par_file b/DATA/Par_file index 0e5cd7059..a8fd51264 100644 --- a/DATA/Par_file +++ b/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/CPML_examples/CPML_realistic_mesh_with_topography/DATA/Par_file b/EXAMPLES/applications/CPML_examples/CPML_realistic_mesh_with_topography/DATA/Par_file index 78053886e..997e08fc3 100644 --- a/EXAMPLES/applications/CPML_examples/CPML_realistic_mesh_with_topography/DATA/Par_file +++ b/EXAMPLES/applications/CPML_examples/CPML_realistic_mesh_with_topography/DATA/Par_file @@ -19,11 +19,11 @@ INVERSE_FWI_FULL_PROBLEM = .false. # Use a negative zone number for the Southern hemisphere: # The Northern hemisphere corresponds to zones +1 to +60, # The Southern hemisphere corresponds to zones -1 to -60. -UTM_PROJECTION_ZONE = 33 +UTM_PROJECTION_ZONE = 33 SUPPRESS_UTM_PROJECTION = .true. # number of MPI processors -NPROC = 4 +NPROC = 4 # time step parameters NSTEP = 2000 @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_absorbing_CPML_5sides/DATA/Par_file b/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_absorbing_CPML_5sides/DATA/Par_file index 07f7d30f2..9d7670766 100644 --- a/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_absorbing_CPML_5sides/DATA/Par_file +++ b/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_absorbing_CPML_5sides/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_absorbing_CPML_6sides/DATA/Par_file b/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_absorbing_CPML_6sides/DATA/Par_file index 78d50c0d9..922f6cf60 100644 --- a/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_absorbing_CPML_6sides/DATA/Par_file +++ b/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_absorbing_CPML_6sides/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_elastic_absorbing_CPML_5sides/DATA/Par_file b/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_elastic_absorbing_CPML_5sides/DATA/Par_file index 817783596..bbd820036 100644 --- a/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_elastic_absorbing_CPML_5sides/DATA/Par_file +++ b/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_elastic_absorbing_CPML_5sides/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_elastic_absorbing_CPML_6sides/DATA/Par_file b/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_elastic_absorbing_CPML_6sides/DATA/Par_file index 78d50c0d9..922f6cf60 100644 --- a/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_elastic_absorbing_CPML_6sides/DATA/Par_file +++ b/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_acoustic_elastic_absorbing_CPML_6sides/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_elastic_absorbing_CPML_5sides/DATA/Par_file b/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_elastic_absorbing_CPML_5sides/DATA/Par_file index 817783596..bbd820036 100644 --- a/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_elastic_absorbing_CPML_5sides/DATA/Par_file +++ b/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_elastic_absorbing_CPML_5sides/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_elastic_absorbing_CPML_6sides/DATA/Par_file b/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_elastic_absorbing_CPML_6sides/DATA/Par_file index 78d50c0d9..922f6cf60 100644 --- a/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_elastic_absorbing_CPML_6sides/DATA/Par_file +++ b/EXAMPLES/applications/CPML_examples/homogeneous_halfspace_HEX8_elastic_absorbing_CPML_6sides/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/Gmsh_simple_box_hex27/DATA/Par_file b/EXAMPLES/applications/Gmsh_simple_box_hex27/DATA/Par_file index 36db53e51..361b2040f 100644 --- a/EXAMPLES/applications/Gmsh_simple_box_hex27/DATA/Par_file +++ b/EXAMPLES/applications/Gmsh_simple_box_hex27/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/Gmsh_simple_lddrk/DATA/Par_file b/EXAMPLES/applications/Gmsh_simple_lddrk/DATA/Par_file index 74579e160..a2a5928e1 100644 --- a/EXAMPLES/applications/Gmsh_simple_lddrk/DATA/Par_file +++ b/EXAMPLES/applications/Gmsh_simple_lddrk/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/LTS_homogeneous_halfspace_HEX8/DATA/Par_file b/EXAMPLES/applications/LTS_homogeneous_halfspace_HEX8/DATA/Par_file index e56138fc4..5d59226ae 100644 --- a/EXAMPLES/applications/LTS_homogeneous_halfspace_HEX8/DATA/Par_file +++ b/EXAMPLES/applications/LTS_homogeneous_halfspace_HEX8/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/cmt_force_hybrid/DATA/Par_file b/EXAMPLES/applications/cmt_force_hybrid/DATA/Par_file index a0b14b38a..0dd00482a 100644 --- a/EXAMPLES/applications/cmt_force_hybrid/DATA/Par_file +++ b/EXAMPLES/applications/cmt_force_hybrid/DATA/Par_file @@ -189,13 +189,13 @@ USE_SOURCES_RECEIVERS_Z = .false. # - the components of a (non necessarily unitary) direction vector for the force source in the E/N/Z_UP basis. # The direction vector is made unitary internally in the code and thus only its direction matters here; # its norm is ignored and the norm of the force used is the factor force source times the source time function. -USE_FORCE_POINT_SOURCE = .false. +USE_FORCE_POINT_SOURCE = .false. # USE BOTH CMTSOLUTION AND FORCESOLUTION SOURCES -USE_CMT_AND_FORCE_SOURCE = .false. +USE_CMT_AND_FORCE_SOURCE = .false. # BINARY SOURCE FILE, can handle millions of sources with different source time functions -USE_BINARY_SOURCE_FILE = .false. +USE_BINARY_SOURCE_FILE = .false. # set to true to use a Ricker source time function instead of the source time functions set by default # to represent a (tilted) FORCESOLUTION force point source or a CMTSOLUTION moment-tensor source. @@ -208,7 +208,7 @@ USE_RICKER_TIME_FUNCTION = .false. # This file must have a single column containing the amplitudes of the source at all time steps; # time step size used must be equal to DT as defined at the beginning of this Par_file. # Be sure when this option is .false. to remove the name of stf file in CMTSOLUTION or FORCESOLUTION -USE_EXTERNAL_SOURCE_FILE = .true. +USE_EXTERNAL_SOURCE_FILE = .true. # print source time function PRINT_SOURCE_TIME_FUNCTION = .false. @@ -324,7 +324,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel @@ -386,7 +386,7 @@ BROADCAST_SAME_MESH_AND_MODEL = .false. #----------------------------------------------------------- # set to true to use GPUs -GPU_MODE = .TRUE. +GPU_MODE = .TRUE. # ADIOS Options for I/Os ADIOS_ENABLED = .false. diff --git a/EXAMPLES/applications/coffee_mug_with_fluid_inside/DATA/Par_file b/EXAMPLES/applications/coffee_mug_with_fluid_inside/DATA/Par_file index 686531d12..8c5d5bc27 100644 --- a/EXAMPLES/applications/coffee_mug_with_fluid_inside/DATA/Par_file +++ b/EXAMPLES/applications/coffee_mug_with_fluid_inside/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/decompose_mesh_MPI/DATA/Par_file b/EXAMPLES/applications/decompose_mesh_MPI/DATA/Par_file index fa71c0b10..e39728a8c 100644 --- a/EXAMPLES/applications/decompose_mesh_MPI/DATA/Par_file +++ b/EXAMPLES/applications/decompose_mesh_MPI/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/decompose_mesh_MPI_with_faults/DATA/Par_file b/EXAMPLES/applications/decompose_mesh_MPI_with_faults/DATA/Par_file index d3a0b57cd..80efd01f4 100644 --- a/EXAMPLES/applications/decompose_mesh_MPI_with_faults/DATA/Par_file +++ b/EXAMPLES/applications/decompose_mesh_MPI_with_faults/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/fault_examples/hete_fault_properties/DATA/Par_file b/EXAMPLES/applications/fault_examples/hete_fault_properties/DATA/Par_file index 85de9f581..eedf07cb7 100644 --- a/EXAMPLES/applications/fault_examples/hete_fault_properties/DATA/Par_file +++ b/EXAMPLES/applications/fault_examples/hete_fault_properties/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/fault_examples/splay_faults/DATA/Par_file b/EXAMPLES/applications/fault_examples/splay_faults/DATA/Par_file index f9bd8b03c..00877aea1 100644 --- a/EXAMPLES/applications/fault_examples/splay_faults/DATA/Par_file +++ b/EXAMPLES/applications/fault_examples/splay_faults/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/fault_examples/tpv102/DATA/Par_file b/EXAMPLES/applications/fault_examples/tpv102/DATA/Par_file index 95d028812..09d5e989c 100644 --- a/EXAMPLES/applications/fault_examples/tpv102/DATA/Par_file +++ b/EXAMPLES/applications/fault_examples/tpv102/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/fault_examples/tpv103/DATA/Par_file b/EXAMPLES/applications/fault_examples/tpv103/DATA/Par_file index 6e6fb34b7..5190c2b04 100644 --- a/EXAMPLES/applications/fault_examples/tpv103/DATA/Par_file +++ b/EXAMPLES/applications/fault_examples/tpv103/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/fault_examples/tpv15/DATA/Par_file b/EXAMPLES/applications/fault_examples/tpv15/DATA/Par_file index 1134b4caa..227794d12 100644 --- a/EXAMPLES/applications/fault_examples/tpv15/DATA/Par_file +++ b/EXAMPLES/applications/fault_examples/tpv15/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/fault_examples/tpv16/DATA/Par_file b/EXAMPLES/applications/fault_examples/tpv16/DATA/Par_file index a4e7b683c..eb46c10f5 100644 --- a/EXAMPLES/applications/fault_examples/tpv16/DATA/Par_file +++ b/EXAMPLES/applications/fault_examples/tpv16/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/fault_examples/tpv5/DATA/Par_file b/EXAMPLES/applications/fault_examples/tpv5/DATA/Par_file index 873e4c434..f0221e62d 100644 --- a/EXAMPLES/applications/fault_examples/tpv5/DATA/Par_file +++ b/EXAMPLES/applications/fault_examples/tpv5/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/homogeneous_acoustic/DATA/Par_file b/EXAMPLES/applications/homogeneous_acoustic/DATA/Par_file index 5f0a9fdbc..275ddfc61 100644 --- a/EXAMPLES/applications/homogeneous_acoustic/DATA/Par_file +++ b/EXAMPLES/applications/homogeneous_acoustic/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/homogeneous_halfspace_HEX27_elastic_no_absorbing/DATA/Par_file b/EXAMPLES/applications/homogeneous_halfspace_HEX27_elastic_no_absorbing/DATA/Par_file index aea74ac61..8ba140980 100644 --- a/EXAMPLES/applications/homogeneous_halfspace_HEX27_elastic_no_absorbing/DATA/Par_file +++ b/EXAMPLES/applications/homogeneous_halfspace_HEX27_elastic_no_absorbing/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/DATA/Par_file b/EXAMPLES/applications/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/DATA/Par_file index 0e5cd7059..a8fd51264 100644 --- a/EXAMPLES/applications/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/DATA/Par_file +++ b/EXAMPLES/applications/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/homogeneous_halfspace_HEX8_elastic_no_absorbing/DATA/Par_file b/EXAMPLES/applications/homogeneous_halfspace_HEX8_elastic_no_absorbing/DATA/Par_file index 1ebbd739c..4d151df5c 100644 --- a/EXAMPLES/applications/homogeneous_halfspace_HEX8_elastic_no_absorbing/DATA/Par_file +++ b/EXAMPLES/applications/homogeneous_halfspace_HEX8_elastic_no_absorbing/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/homogeneous_poroelastic/DATA/Par_file b/EXAMPLES/applications/homogeneous_poroelastic/DATA/Par_file index 28f55914e..d3e0dcb79 100644 --- a/EXAMPLES/applications/homogeneous_poroelastic/DATA/Par_file +++ b/EXAMPLES/applications/homogeneous_poroelastic/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/homogeneous_poroelastic/DATA/Par_file_coarse b/EXAMPLES/applications/homogeneous_poroelastic/DATA/Par_file_coarse index 9cbd025d2..a0e668018 100644 --- a/EXAMPLES/applications/homogeneous_poroelastic/DATA/Par_file_coarse +++ b/EXAMPLES/applications/homogeneous_poroelastic/DATA/Par_file_coarse @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/inversion_examples/fwi_test_acoustic/DATA/Par_file b/EXAMPLES/applications/inversion_examples/fwi_test_acoustic/DATA/Par_file index e5ec5f0d6..8d48086f6 100644 --- a/EXAMPLES/applications/inversion_examples/fwi_test_acoustic/DATA/Par_file +++ b/EXAMPLES/applications/inversion_examples/fwi_test_acoustic/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = dummy FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/layered_halfspace/DATA/Par_file b/EXAMPLES/applications/layered_halfspace/DATA/Par_file index 3571c952a..7c6e31929 100644 --- a/EXAMPLES/applications/layered_halfspace/DATA/Par_file +++ b/EXAMPLES/applications/layered_halfspace/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/meshfem3D_examples/CPML_extended_mesh/DATA/Par_file b/EXAMPLES/applications/meshfem3D_examples/CPML_extended_mesh/DATA/Par_file index 3d4e9e0ca..080eccde1 100644 --- a/EXAMPLES/applications/meshfem3D_examples/CPML_extended_mesh/DATA/Par_file +++ b/EXAMPLES/applications/meshfem3D_examples/CPML_extended_mesh/DATA/Par_file @@ -23,7 +23,7 @@ UTM_PROJECTION_ZONE = 0 SUPPRESS_UTM_PROJECTION = .true. # number of MPI processors -NPROC = 4 +NPROC = 4 # time step parameters NSTEP = 3000 @@ -107,7 +107,7 @@ PML_CONDITIONS = .true. PML_INSTEAD_OF_FREE_SURFACE = .false. # C-PML dominant frequency -f0_FOR_PML = 4.0 +f0_FOR_PML = 4.0 # parameters used to rotate C-PML boundary conditions by a given angle (not completed yet) # ROTATE_PML_ACTIVATE = .false. @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/meshfem3D_examples/cavity/DATA/Par_file b/EXAMPLES/applications/meshfem3D_examples/cavity/DATA/Par_file index e7ed2a915..4c1c31aa4 100644 --- a/EXAMPLES/applications/meshfem3D_examples/cavity/DATA/Par_file +++ b/EXAMPLES/applications/meshfem3D_examples/cavity/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/meshfem3D_examples/cavity/DATA/Par_file.96procs b/EXAMPLES/applications/meshfem3D_examples/cavity/DATA/Par_file.96procs index 75a96b2bf..eccc2d51c 100644 --- a/EXAMPLES/applications/meshfem3D_examples/cavity/DATA/Par_file.96procs +++ b/EXAMPLES/applications/meshfem3D_examples/cavity/DATA/Par_file.96procs @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/meshfem3D_examples/many_interfaces/DATA/Par_file b/EXAMPLES/applications/meshfem3D_examples/many_interfaces/DATA/Par_file index 1629b3fcf..b4a230b40 100644 --- a/EXAMPLES/applications/meshfem3D_examples/many_interfaces/DATA/Par_file +++ b/EXAMPLES/applications/meshfem3D_examples/many_interfaces/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/meshfem3D_examples/regular_element_mesh/DATA/Par_file b/EXAMPLES/applications/meshfem3D_examples/regular_element_mesh/DATA/Par_file index 8fb797678..fd16c5596 100644 --- a/EXAMPLES/applications/meshfem3D_examples/regular_element_mesh/DATA/Par_file +++ b/EXAMPLES/applications/meshfem3D_examples/regular_element_mesh/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/meshfem3D_examples/sep_bathymetry/DATA/Par_file b/EXAMPLES/applications/meshfem3D_examples/sep_bathymetry/DATA/Par_file index e854ec781..49cad193b 100644 --- a/EXAMPLES/applications/meshfem3D_examples/sep_bathymetry/DATA/Par_file +++ b/EXAMPLES/applications/meshfem3D_examples/sep_bathymetry/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/meshfem3D_examples/simple_model/DATA/Par_file b/EXAMPLES/applications/meshfem3D_examples/simple_model/DATA/Par_file index bf2bf80f7..a016746a4 100644 --- a/EXAMPLES/applications/meshfem3D_examples/simple_model/DATA/Par_file +++ b/EXAMPLES/applications/meshfem3D_examples/simple_model/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/meshfem3D_examples/socal1D/DATA/Par_file b/EXAMPLES/applications/meshfem3D_examples/socal1D/DATA/Par_file index 01ce2f5e1..4c90c232b 100644 --- a/EXAMPLES/applications/meshfem3D_examples/socal1D/DATA/Par_file +++ b/EXAMPLES/applications/meshfem3D_examples/socal1D/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/meshfem3D_examples/socal1D/example_utm/Par_file_utm b/EXAMPLES/applications/meshfem3D_examples/socal1D/example_utm/Par_file_utm index 61ca03514..4c98183ff 100644 --- a/EXAMPLES/applications/meshfem3D_examples/socal1D/example_utm/Par_file_utm +++ b/EXAMPLES/applications/meshfem3D_examples/socal1D/example_utm/Par_file_utm @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/noise_non_uniform/DATA/Par_file b/EXAMPLES/applications/noise_non_uniform/DATA/Par_file index 9455a9d62..36d5b7e95 100644 --- a/EXAMPLES/applications/noise_non_uniform/DATA/Par_file +++ b/EXAMPLES/applications/noise_non_uniform/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/noise_non_uniform/DATA/Par_file_step1 b/EXAMPLES/applications/noise_non_uniform/DATA/Par_file_step1 index 5c991c74d..7ad288bf7 100644 --- a/EXAMPLES/applications/noise_non_uniform/DATA/Par_file_step1 +++ b/EXAMPLES/applications/noise_non_uniform/DATA/Par_file_step1 @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/noise_non_uniform/DATA/Par_file_step2 b/EXAMPLES/applications/noise_non_uniform/DATA/Par_file_step2 index 9455a9d62..36d5b7e95 100644 --- a/EXAMPLES/applications/noise_non_uniform/DATA/Par_file_step2 +++ b/EXAMPLES/applications/noise_non_uniform/DATA/Par_file_step2 @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/noise_tomography/DATA/Par_file b/EXAMPLES/applications/noise_tomography/DATA/Par_file index cd46d14c0..d878a497d 100644 --- a/EXAMPLES/applications/noise_tomography/DATA/Par_file +++ b/EXAMPLES/applications/noise_tomography/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/oldstuff/small_example_coupling_axisem_specfem_matlab_gui_CURRENTLY_BROKEN_according_to_Vadim/Param_files/DATA/Par_file b/EXAMPLES/applications/oldstuff/small_example_coupling_axisem_specfem_matlab_gui_CURRENTLY_BROKEN_according_to_Vadim/Param_files/DATA/Par_file index 34fab8249..27d57cdfc 100644 --- a/EXAMPLES/applications/oldstuff/small_example_coupling_axisem_specfem_matlab_gui_CURRENTLY_BROKEN_according_to_Vadim/Param_files/DATA/Par_file +++ b/EXAMPLES/applications/oldstuff/small_example_coupling_axisem_specfem_matlab_gui_CURRENTLY_BROKEN_according_to_Vadim/Param_files/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = true -INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = false TRACTION_PATH = ./DATA/AxiSEM_tractions/1/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/oldstuff/small_example_coupling_axisem_specfem_matlab_gui_CURRENTLY_BROKEN_according_to_Vadim/Param_files/DATA/Par_file_one_proc b/EXAMPLES/applications/oldstuff/small_example_coupling_axisem_specfem_matlab_gui_CURRENTLY_BROKEN_according_to_Vadim/Param_files/DATA/Par_file_one_proc index 6c9e8069d..3c7f29ae5 100644 --- a/EXAMPLES/applications/oldstuff/small_example_coupling_axisem_specfem_matlab_gui_CURRENTLY_BROKEN_according_to_Vadim/Param_files/DATA/Par_file_one_proc +++ b/EXAMPLES/applications/oldstuff/small_example_coupling_axisem_specfem_matlab_gui_CURRENTLY_BROKEN_according_to_Vadim/Param_files/DATA/Par_file_one_proc @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = true -INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = false TRACTION_PATH = ./DATA/AxiSEM_tractions/1/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/oldstuff/small_example_coupling_axisem_specfem_matlab_gui_CURRENTLY_BROKEN_according_to_Vadim/Param_files/DATA/Par_file_several_proc b/EXAMPLES/applications/oldstuff/small_example_coupling_axisem_specfem_matlab_gui_CURRENTLY_BROKEN_according_to_Vadim/Param_files/DATA/Par_file_several_proc index 34fab8249..27d57cdfc 100644 --- a/EXAMPLES/applications/oldstuff/small_example_coupling_axisem_specfem_matlab_gui_CURRENTLY_BROKEN_according_to_Vadim/Param_files/DATA/Par_file_several_proc +++ b/EXAMPLES/applications/oldstuff/small_example_coupling_axisem_specfem_matlab_gui_CURRENTLY_BROKEN_according_to_Vadim/Param_files/DATA/Par_file_several_proc @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = true -INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = false TRACTION_PATH = ./DATA/AxiSEM_tractions/1/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/oldstuff/small_example_please_do_not_remove_CURRENTLY_BROKEN_according_to_Vadim/create_data/DATA/Par_file b/EXAMPLES/applications/oldstuff/small_example_please_do_not_remove_CURRENTLY_BROKEN_according_to_Vadim/create_data/DATA/Par_file index 565e5673b..a4c20b52c 100644 --- a/EXAMPLES/applications/oldstuff/small_example_please_do_not_remove_CURRENTLY_BROKEN_according_to_Vadim/create_data/DATA/Par_file +++ b/EXAMPLES/applications/oldstuff/small_example_please_do_not_remove_CURRENTLY_BROKEN_according_to_Vadim/create_data/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .true. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = ./DATA/FKmodel_30_20 diff --git a/EXAMPLES/applications/oldstuff/small_example_please_do_not_remove_CURRENTLY_BROKEN_according_to_Vadim/fwi_fk/DATA/Par_file b/EXAMPLES/applications/oldstuff/small_example_please_do_not_remove_CURRENTLY_BROKEN_according_to_Vadim/fwi_fk/DATA/Par_file index e01a89b19..37f97adf7 100644 --- a/EXAMPLES/applications/oldstuff/small_example_please_do_not_remove_CURRENTLY_BROKEN_according_to_Vadim/fwi_fk/DATA/Par_file +++ b/EXAMPLES/applications/oldstuff/small_example_please_do_not_remove_CURRENTLY_BROKEN_according_to_Vadim/fwi_fk/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .true. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = ./DATA/FKmodel_30_20 diff --git a/EXAMPLES/applications/small_adjoint_multiple_sources/DATA/Par_file b/EXAMPLES/applications/small_adjoint_multiple_sources/DATA/Par_file index 0b58e24b8..a4eed9e62 100644 --- a/EXAMPLES/applications/small_adjoint_multiple_sources/DATA/Par_file +++ b/EXAMPLES/applications/small_adjoint_multiple_sources/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/small_example_coupling_FK_specfem/DATA/Par_file b/EXAMPLES/applications/small_example_coupling_FK_specfem/DATA/Par_file index 10e8b2604..3895c4c78 100644 --- a/EXAMPLES/applications/small_example_coupling_FK_specfem/DATA/Par_file +++ b/EXAMPLES/applications/small_example_coupling_FK_specfem/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .true. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/1/ FKMODEL_FILE = DATA/FKMODEL diff --git a/EXAMPLES/applications/small_example_coupling_FK_specfem_with_fluid/DATA/Par_file b/EXAMPLES/applications/small_example_coupling_FK_specfem_with_fluid/DATA/Par_file index 809a3be78..e8f2aee9f 100644 --- a/EXAMPLES/applications/small_example_coupling_FK_specfem_with_fluid/DATA/Par_file +++ b/EXAMPLES/applications/small_example_coupling_FK_specfem_with_fluid/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .true. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/1/ FKMODEL_FILE = DATA/FKMODEL diff --git a/EXAMPLES/applications/small_example_coupling_SPECFEM_specfem/DATA.local/Par_file b/EXAMPLES/applications/small_example_coupling_SPECFEM_specfem/DATA.local/Par_file index f5f0780c7..a6a27df60 100644 --- a/EXAMPLES/applications/small_example_coupling_SPECFEM_specfem/DATA.local/Par_file +++ b/EXAMPLES/applications/small_example_coupling_SPECFEM_specfem/DATA.local/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .true. -INJECTION_TECHNIQUE_TYPE = 4 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM +INJECTION_TECHNIQUE_TYPE = 4 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./COUPLING_FILES FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/small_example_coupling_SPECFEM_specfem/DATA.regional/Par_file b/EXAMPLES/applications/small_example_coupling_SPECFEM_specfem/DATA.regional/Par_file index 7b3e03c67..2c4586aa4 100644 --- a/EXAMPLES/applications/small_example_coupling_SPECFEM_specfem/DATA.regional/Par_file +++ b/EXAMPLES/applications/small_example_coupling_SPECFEM_specfem/DATA.regional/Par_file @@ -223,7 +223,7 @@ NTSTEP_BETWEEN_OUTPUT_SEISMOS = 10000 # set to n to reduce the sampling rate of output seismograms by a factor of n # defaults to 1, which means no down-sampling -NTSTEP_BETWEEN_OUTPUT_SAMPLE = 2 +NTSTEP_BETWEEN_OUTPUT_SAMPLE = 2 # decide if we save displacement, velocity, acceleration and/or pressure in forward runs (they can be set to true simultaneously) # currently pressure seismograms are implemented in acoustic (i.e. fluid) elements only @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 4 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM +INJECTION_TECHNIQUE_TYPE = 4 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./COUPLING_FILES FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files/DATA/Par_file b/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files/DATA/Par_file index 5acadcd32..77af53c3e 100644 --- a/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files/DATA/Par_file +++ b/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = true -INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = false TRACTION_PATH = ./DATA/AxiSEM_tractions/1/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files/DATA/Par_file_one_proc b/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files/DATA/Par_file_one_proc index 6c9e8069d..3c7f29ae5 100644 --- a/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files/DATA/Par_file_one_proc +++ b/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files/DATA/Par_file_one_proc @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = true -INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = false TRACTION_PATH = ./DATA/AxiSEM_tractions/1/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files/DATA/Par_file_several_proc b/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files/DATA/Par_file_several_proc index 5acadcd32..77af53c3e 100644 --- a/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files/DATA/Par_file_several_proc +++ b/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files/DATA/Par_file_several_proc @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = true -INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = false TRACTION_PATH = ./DATA/AxiSEM_tractions/1/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files_for_buried_box/DATA/Par_file b/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files_for_buried_box/DATA/Par_file index 69f29e5cc..aebf7ac50 100644 --- a/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files_for_buried_box/DATA/Par_file +++ b/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files_for_buried_box/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .true -INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/1/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files_for_buried_box/DATA/Par_file_one_proc b/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files_for_buried_box/DATA/Par_file_one_proc index 03dbfb237..15b1d1f13 100644 --- a/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files_for_buried_box/DATA/Par_file_one_proc +++ b/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files_for_buried_box/DATA/Par_file_one_proc @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .true -INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/1/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files_for_buried_box/DATA/Par_file_several_proc b/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files_for_buried_box/DATA/Par_file_several_proc index 69f29e5cc..aebf7ac50 100644 --- a/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files_for_buried_box/DATA/Par_file_several_proc +++ b/EXAMPLES/applications/small_example_coupling_axisem_specfem/Param_files_for_buried_box/DATA/Par_file_several_proc @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .true -INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 2 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/1/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/tomographic_model/DATA/Par_file b/EXAMPLES/applications/tomographic_model/DATA/Par_file index 8a3178256..9e28034ce 100644 --- a/EXAMPLES/applications/tomographic_model/DATA/Par_file +++ b/EXAMPLES/applications/tomographic_model/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/tomographic_model/tomoblock_mesh.py b/EXAMPLES/applications/tomographic_model/tomoblock_mesh.py index b52ec3461..2a81556ab 100755 --- a/EXAMPLES/applications/tomographic_model/tomoblock_mesh.py +++ b/EXAMPLES/applications/tomographic_model/tomoblock_mesh.py @@ -18,7 +18,7 @@ #print("") import cubit -cubit.init([""]) +cubit.init(["-noecho","-nojournal"]) # Creating the volumes cubit.cmd('reset') @@ -49,8 +49,8 @@ boundary_definition.define_bc(boundary_definition.entities,parallel=True) # sets the id of the volume block -# (volume block starts at id 4) -id_block = 4 +# (volume block starts at id 1) +id_block = 1 print("cubit block:") print(" volume block id = " + str(id_block)) print("") diff --git a/EXAMPLES/applications/waterlayered_halfspace/DATA/Par_file b/EXAMPLES/applications/waterlayered_halfspace/DATA/Par_file index 7d0937b26..9602bda29 100644 --- a/EXAMPLES/applications/waterlayered_halfspace/DATA/Par_file +++ b/EXAMPLES/applications/waterlayered_halfspace/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/waterlayered_poroelastic/DATA/Par_file b/EXAMPLES/applications/waterlayered_poroelastic/DATA/Par_file index 830a6de41..15c6bbbb5 100644 --- a/EXAMPLES/applications/waterlayered_poroelastic/DATA/Par_file +++ b/EXAMPLES/applications/waterlayered_poroelastic/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = dummy FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/applications/wavefield_discontinuity/test_small_injection/DATA/Par_file b/EXAMPLES/applications/wavefield_discontinuity/test_small_injection/DATA/Par_file index c8d6b9b01..3d554d57a 100644 --- a/EXAMPLES/applications/wavefield_discontinuity/test_small_injection/DATA/Par_file +++ b/EXAMPLES/applications/wavefield_discontinuity/test_small_injection/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/benchmarks/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC/DATA/Par_file b/EXAMPLES/benchmarks/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC/DATA/Par_file index bb9715bfe..2f2376638 100644 --- a/EXAMPLES/benchmarks/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC/DATA/Par_file +++ b/EXAMPLES/benchmarks/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/benchmarks/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC_ELASTIC/DATA/Par_file b/EXAMPLES/benchmarks/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC_ELASTIC/DATA/Par_file index ffc584ecc..a528a5d31 100644 --- a/EXAMPLES/benchmarks/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC_ELASTIC/DATA/Par_file +++ b/EXAMPLES/benchmarks/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC_ELASTIC/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/benchmarks/BENCHMARK_CLAERBOUT_ADJOINT/ELASTIC/DATA/Par_file b/EXAMPLES/benchmarks/BENCHMARK_CLAERBOUT_ADJOINT/ELASTIC/DATA/Par_file index bc2386f23..3c8ffd9b9 100644 --- a/EXAMPLES/benchmarks/BENCHMARK_CLAERBOUT_ADJOINT/ELASTIC/DATA/Par_file +++ b/EXAMPLES/benchmarks/BENCHMARK_CLAERBOUT_ADJOINT/ELASTIC/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/benchmarks/analytic_examples/analytic_solution_elastic/DATA/Par_file b/EXAMPLES/benchmarks/analytic_examples/analytic_solution_elastic/DATA/Par_file index d21ea354c..7b32a703e 100644 --- a/EXAMPLES/benchmarks/analytic_examples/analytic_solution_elastic/DATA/Par_file +++ b/EXAMPLES/benchmarks/analytic_examples/analytic_solution_elastic/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/benchmarks/attenuation/viscoelastic/DATA/Par_file b/EXAMPLES/benchmarks/attenuation/viscoelastic/DATA/Par_file index df2f38b1c..eaa04230a 100644 --- a/EXAMPLES/benchmarks/attenuation/viscoelastic/DATA/Par_file +++ b/EXAMPLES/benchmarks/attenuation/viscoelastic/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/benchmarks/check_absolute_amplitude_of_force_source_seismograms/DATA/Par_file b/EXAMPLES/benchmarks/check_absolute_amplitude_of_force_source_seismograms/DATA/Par_file index f32de8e86..4202ad52a 100644 --- a/EXAMPLES/benchmarks/check_absolute_amplitude_of_force_source_seismograms/DATA/Par_file +++ b/EXAMPLES/benchmarks/check_absolute_amplitude_of_force_source_seismograms/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/process_DATA_Par_files_to_update_their_parameters_from_a_main_file.py b/EXAMPLES/process_DATA_Par_files_to_update_their_parameters_from_a_main_file.py index c428c7564..4d0221c6e 100755 --- a/EXAMPLES/process_DATA_Par_files_to_update_their_parameters_from_a_main_file.py +++ b/EXAMPLES/process_DATA_Par_files_to_update_their_parameters_from_a_main_file.py @@ -43,7 +43,19 @@ # optional parameters in Par_file OPTIONAL_PARAMETERS = [ - "IS_WAVEFIELD_DISCONTINUITY" + "HDF5_ENABLED", \ + "HDF5_FOR_MOVIES", \ + "HDF5_FORMAT", \ + "HDF5_IO_NODES", \ + "INJECTION_START_TIME", \ + "IS_WAVEFIELD_DISCONTINUITY", \ + "MOVIE_VOLUME_STRESS", \ + "SCATTERING_CORRELATION", \ + "SCATTERING_MATERIAL_IDS", \ + "SCATTERING_PERTURBATIONS", \ + "SCATTERING_STRENGTH", \ + "USE_BINARY_SOURCE_FILE", \ + "USE_CMT_AND_FORCE_SOURCE" \ ] # diff --git a/EXAMPLES/real_world/Birch_glacier_collapse/DATA/Par_file b/EXAMPLES/real_world/Birch_glacier_collapse/DATA/Par_file index f64f4a975..d8deecad9 100644 --- a/EXAMPLES/real_world/Birch_glacier_collapse/DATA/Par_file +++ b/EXAMPLES/real_world/Birch_glacier_collapse/DATA/Par_file @@ -6,7 +6,7 @@ # forward or adjoint simulation # 1 = forward, 2 = adjoint, 3 = both simultaneously -SIMULATION_TYPE = 2 +SIMULATION_TYPE = 2 # 0 = earthquake simulation, 1/2/3 = three steps in noise simulation NOISE_TOMOGRAPHY = 0 SAVE_FORWARD = .false. @@ -23,7 +23,7 @@ UTM_PROJECTION_ZONE = 32 SUPPRESS_UTM_PROJECTION = .false. # number of MPI processors -NPROC = 16 +NPROC = 16 # time step parameters NSTEP = 20001 @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = dummy FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/real_world/Campi_Flegrei/DATA/Par_file b/EXAMPLES/real_world/Campi_Flegrei/DATA/Par_file index 864578f51..9d7f297e8 100644 --- a/EXAMPLES/real_world/Campi_Flegrei/DATA/Par_file +++ b/EXAMPLES/real_world/Campi_Flegrei/DATA/Par_file @@ -23,7 +23,7 @@ UTM_PROJECTION_ZONE = 33 SUPPRESS_UTM_PROJECTION = .false. # number of MPI processors -NPROC = 16 +NPROC = 16 # time step parameters NSTEP = 40000 @@ -54,7 +54,7 @@ RATIO_BY_WHICH_TO_INCREASE_IT = 1.4 # Number of nodes for 2D and 3D shape functions for hexahedra. # We use either 8-node mesh elements (bricks) or 27-node elements. # If you use our internal mesher, the only option is 8-node bricks (27-node elements are not supported). -NGNOD = 27 +NGNOD = 27 # models: # available options are: @@ -107,7 +107,7 @@ PML_CONDITIONS = .true. PML_INSTEAD_OF_FREE_SURFACE = .false. # C-PML dominant frequency -f0_FOR_PML = 3.0 +f0_FOR_PML = 3.0 # parameters used to rotate C-PML boundary conditions by a given angle (not completed yet) # ROTATE_PML_ACTIVATE = .false. @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = dummy FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/real_world/Mendocino_Mw7.0/DATA/Par_file b/EXAMPLES/real_world/Mendocino_Mw7.0/DATA/Par_file index 14eebea3a..f43b712a7 100644 --- a/EXAMPLES/real_world/Mendocino_Mw7.0/DATA/Par_file +++ b/EXAMPLES/real_world/Mendocino_Mw7.0/DATA/Par_file @@ -23,7 +23,7 @@ UTM_PROJECTION_ZONE = 10 SUPPRESS_UTM_PROJECTION = .false. # number of MPI processors -NPROC = 16 +NPROC = 16 # time step parameters NSTEP = 20000 @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = dummy FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/real_world/Moon_Apollo_impact/DATA/Par_file b/EXAMPLES/real_world/Moon_Apollo_impact/DATA/Par_file index 53f22d610..86bf4ab8a 100644 --- a/EXAMPLES/real_world/Moon_Apollo_impact/DATA/Par_file +++ b/EXAMPLES/real_world/Moon_Apollo_impact/DATA/Par_file @@ -23,7 +23,7 @@ UTM_PROJECTION_ZONE = 20 SUPPRESS_UTM_PROJECTION = .false. # number of MPI processors -NPROC = 8 +NPROC = 8 # time step parameters NSTEP = 20000 @@ -63,7 +63,7 @@ NGNOD = 8 # 1d_prem,1d_socal,1d_cascadia # 3D models available are: # aniso,external,gll,salton_trough,tomo,SEP,coupled,... -MODEL = moon_default +MODEL = moon_default # path for external tomographic models files TOMOGRAPHY_PATH = ./DATA/tomo_files/ @@ -100,7 +100,7 @@ SCATTERING_STRENGTH = 0.4d0 # correlation factor SCATTERING_CORRELATION = 5.d0 # list of material ids to apply scattering perturbations (0 == for all materials) -SCATTERING_MATERIAL_IDS = 2,3 +SCATTERING_MATERIAL_IDS = 2,3 #----------------------------------------------------------- # @@ -117,7 +117,7 @@ PML_CONDITIONS = .false. PML_INSTEAD_OF_FREE_SURFACE = .false. # C-PML dominant frequency -f0_FOR_PML = 1.0 +f0_FOR_PML = 1.0 # parameters used to rotate C-PML boundary conditions by a given angle (not completed yet) # ROTATE_PML_ACTIVATE = .false. @@ -328,9 +328,9 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. -TRACTION_PATH = dummy +TRACTION_PATH = dummy FKMODEL_FILE = FKmodel RECIPROCITY_AND_KH_INTEGRAL = .false. # does not work yet diff --git a/EXAMPLES/real_world/Mount_StHelens/DATA/Par_file b/EXAMPLES/real_world/Mount_StHelens/DATA/Par_file index 4fa2ee516..2ed3f5e11 100644 --- a/EXAMPLES/real_world/Mount_StHelens/DATA/Par_file +++ b/EXAMPLES/real_world/Mount_StHelens/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/real_world/Myanmar_Mw7.7/DATA/Par_file b/EXAMPLES/real_world/Myanmar_Mw7.7/DATA/Par_file index 1f5bf4437..35c675b1e 100644 --- a/EXAMPLES/real_world/Myanmar_Mw7.7/DATA/Par_file +++ b/EXAMPLES/real_world/Myanmar_Mw7.7/DATA/Par_file @@ -23,7 +23,7 @@ UTM_PROJECTION_ZONE = 47 SUPPRESS_UTM_PROJECTION = .false. # number of MPI processors -NPROC = 16 +NPROC = 16 # time step parameters NSTEP = 50000 @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = dummy FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/reproducible_study/seismoacoustic_bishop2022/DATA_FIG4/Par_file b/EXAMPLES/reproducible_study/seismoacoustic_bishop2022/DATA_FIG4/Par_file index e7f92122e..f8ce1c3fc 100644 --- a/EXAMPLES/reproducible_study/seismoacoustic_bishop2022/DATA_FIG4/Par_file +++ b/EXAMPLES/reproducible_study/seismoacoustic_bishop2022/DATA_FIG4/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/reproducible_study/seismoacoustic_bishop2022/DATA_FIG8/Par_file b/EXAMPLES/reproducible_study/seismoacoustic_bishop2022/DATA_FIG8/Par_file index 8b13ae1e3..c995ff3ec 100644 --- a/EXAMPLES/reproducible_study/seismoacoustic_bishop2022/DATA_FIG8/Par_file +++ b/EXAMPLES/reproducible_study/seismoacoustic_bishop2022/DATA_FIG8/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = ./DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/EXAMPLES/reproducible_study/sensitivity_kernels_liutromp2006/DATA/Par_file b/EXAMPLES/reproducible_study/sensitivity_kernels_liutromp2006/DATA/Par_file index 2f3cbc851..90d3747b5 100644 --- a/EXAMPLES/reproducible_study/sensitivity_kernels_liutromp2006/DATA/Par_file +++ b/EXAMPLES/reproducible_study/sensitivity_kernels_liutromp2006/DATA/Par_file @@ -318,7 +318,7 @@ SAVE_MOHO_MESH = .false. # #----------------------------------------------------------- COUPLE_WITH_INJECTION_TECHNIQUE = .false. -INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK +INJECTION_TECHNIQUE_TYPE = 3 # 1 = DSM, 2 = AxiSEM, 3 = FK, 4 = SPECFEM MESH_A_CHUNK_OF_THE_EARTH = .false. TRACTION_PATH = DATA/AxiSEM_tractions/3/ FKMODEL_FILE = FKmodel diff --git a/Makefile.in b/Makefile.in index d8545a153..400ca3f78 100644 --- a/Makefile.in +++ b/Makefile.in @@ -178,6 +178,12 @@ PART_LIBS += $(PATOH_LIBS) @COND_CUDA_PLUS_TRUE@CUDA_PLUS = yes @COND_CUDA_PLUS_FALSE@CUDA_PLUS = no +# CUDA-aware MPI flag +@COND_CUDA_AWARE_MPI_TRUE@CUDA_MPI_FLAG = $(FC_DEFINE)WITH_CUDA_AWARE_MPI +@COND_CUDA_AWARE_MPI_FALSE@CUDA_MPI_FLAG = + +@COND_CUDA_AWARE_MPI_TRUE@FCFLAGS += $(CUDA_MPI_FLAG) + # default cuda libraries # runtime library -lcudart needed, others are optional -lcuda -lcublas @@ -244,7 +250,7 @@ GENCODE_120 = -gencode=arch=compute_120,code=\"sm_120,compute_120\" @COND_CUDA_TRUE@@COND_CUDA_PLUS_FALSE@GENCODE = $(GENCODE_20) # CUDA flags and linking -@COND_CUDA_TRUE@NVCC_FLAGS_BASE = $(CUDA_FLAGS) $(CUDA_INC) $(CUDA_DEBUG) $(MPI_INCLUDES) $(COND_MPI_CPPFLAGS) +@COND_CUDA_TRUE@NVCC_FLAGS_BASE = $(CUDA_FLAGS) $(CUDA_INC) $(CUDA_DEBUG) $(CUDA_MPI_FLAG) $(MPI_INCLUDES) $(COND_MPI_CPPFLAGS) @COND_CUDA_TRUE@@COND_CUDA_PLUS_TRUE@NVCC_FLAGS = $(NVCC_FLAGS_BASE) -dc $(GENCODE) @COND_CUDA_TRUE@@COND_CUDA_PLUS_FALSE@NVCC_FLAGS = $(NVCC_FLAGS_BASE) -DUSE_OLDER_CUDA4_GPU $(GENCODE) @@ -311,7 +317,7 @@ GENCODE_AMD_MI350 = --amdgpu-target=gfx950 @COND_HIP_TRUE@@COND_HIP_CUDA13_TRUE@GENCODE_HIP = $(GENCODE_100) # --with-hip=cuda13 .. HIP_FLAGS = @HIP_FLAGS@ -HIP_INC = @HIP_CPPFLAGS@ $(MPI_INCLUDES) +HIP_INC = @HIP_CPPFLAGS@ $(CUDA_MPI_FLAG) $(MPI_INCLUDES) @COND_HIP_TRUE@HIPCC = @HIPCC@ @COND_HIP_FALSE@HIPCC = @CC@ diff --git a/configure b/configure index 4d2424ff8..55a96c969 100755 --- a/configure +++ b/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for SPECFEM3D Cartesian 4.1.1. +# Generated by GNU Autoconf 2.73 for SPECFEM3D Cartesian 4.1.1. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2026 Free Software Foundation, # Inc. # # @@ -22,7 +22,7 @@ then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. + # contradicts POSIX and common usage. Disable this. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( @@ -109,7 +109,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf '%s\n' "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi @@ -131,10 +131,13 @@ case $- in # (((( *x* ) as_opts=-x ;; * ) as_opts= ;; esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +case $# in # (( + 0) exec $CONFIG_SHELL $as_opts "$as_myself" ;; + *) exec $CONFIG_SHELL $as_opts "$as_myself" "$@" ;; +esac # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf '%s\n' "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. @@ -145,7 +148,7 @@ then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. + # contradicts POSIX and common usage. Disable this. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case e in #( @@ -254,22 +257,25 @@ case $- in # (((( *x* ) as_opts=-x ;; * ) as_opts= ;; esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +case $# in # (( + 0) exec $CONFIG_SHELL $as_opts "$as_myself" ;; + *) exec $CONFIG_SHELL $as_opts "$as_myself" "$@" ;; +esac # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf '%s\n' "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : - printf "%s\n" "$0: This script requires a shell more modern than all" - printf "%s\n" "$0: the shells that I found on your system." + printf '%s\n' "$0: This script requires a shell more modern than all" + printf '%s\n' "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then - printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" - printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + printf '%s\n' "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf '%s\n' "$0: be upgraded to zsh 4.3.4 or later." else - printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and see the wiki about + printf '%s\n' "$0: Please tell bug-autoconf@gnu.org and see the wiki about $0: your system, including any error possibly output before $0: this message. Then install a modern shell, or manually $0: run the script under such a shell if you do have one." @@ -329,7 +335,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf '%s\n' "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -338,7 +344,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | +printf '%s\n' X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -421,9 +427,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - printf "%s\n" "$as_me: error: $2" >&2 + printf '%s\n' "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -450,7 +456,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | +printf '%s\n' X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -496,7 +502,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf '%s\n' "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -510,29 +516,6 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -591,6 +574,7 @@ ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # Initializations. # ac_default_prefix=/usr/local +ac_clean_CONFIG_STATUS= ac_clean_files= ac_config_libobj_dir=. LIBOBJS= @@ -601,7 +585,7 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='SPECFEM3D Cartesian' -PACKAGE_TARNAME='Specfem3D' +PACKAGE_TARNAME='Specfem3DCartesian' PACKAGE_VERSION='4.1.1' PACKAGE_STRING='SPECFEM3D Cartesian 4.1.1' PACKAGE_BUGREPORT='see the wiki' @@ -784,6 +768,8 @@ COND_HIP_MI8_FALSE COND_HIP_MI8_TRUE COND_HIP_FALSE COND_HIP_TRUE +COND_CUDA_AWARE_MPI_FALSE +COND_CUDA_AWARE_MPI_TRUE COND_CUDA_PLUS_FALSE COND_CUDA_PLUS_TRUE COND_CUDA13_FALSE @@ -824,13 +810,13 @@ build_os build_vendor build_cpu build +ECHO_T +ECHO_N +ECHO_C target_alias host_alias build_alias LIBS -ECHO_T -ECHO_N -ECHO_C DEFS mandir localedir @@ -871,6 +857,8 @@ enable_debug with_mpi enable_vectorization with_cuda +enable_cuda_aware_mpi +with_cuda_aware_mpi with_hip with_openmp enable_openmp @@ -1040,7 +1028,7 @@ do expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf '%s\n' "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1066,7 +1054,7 @@ do expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf '%s\n' "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1279,7 +1267,7 @@ do expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf '%s\n' "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1295,7 +1283,7 @@ do expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf '%s\n' "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1339,9 +1327,9 @@ Try '$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf '%s\n' "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf '%s\n' "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1349,7 +1337,7 @@ Try '$0 --help' for more information" done if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` + ac_option=--`printf '%s\n' $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi @@ -1357,7 +1345,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf '%s\n' "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1421,7 +1409,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_myself" | +printf '%s\n' X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1527,7 +1515,8 @@ Fine tuning of the installation directories: --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/Specfem3D] + --docdir=DIR documentation root + [DATAROOTDIR/doc/Specfem3DCartesian] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] @@ -1557,6 +1546,7 @@ Optional Features: --enable-debug build with debugging options enabled [default=no] --enable-vectorization build FORCE_VECTORIZATION enabled version [default=auto] + --enable-cuda-aware-mpi build CUDA-aware MPI enabled version [default=no] --enable-openmp build OpenMP enabled version [default=no] --enable-vtk build VTK enabled version [default=no] @@ -1565,6 +1555,7 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-mpi build parallel version [default=yes] --with-cuda build CUDA GPU enabled version [default=no] + --with-cuda-aware-mpi build CUDA-aware MPI enabled version [default=no] --with-hip build HIP GPU enabled version [default=no] --with-openmp build OpenMP enabled version [default=no] --with-adios build ADIOS enabled version [default=no] @@ -1662,9 +1653,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf '%s\n' "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf '%s\n' "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1701,7 +1692,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf '%s\n' "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1711,9 +1702,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF SPECFEM3D Cartesian configure 4.1.1 -generated by GNU Autoconf 2.72 +generated by GNU Autoconf 2.73 -Copyright (C) 2023 Free Software Foundation, Inc. +Copyright (C) 2026 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1737,7 +1728,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1745,7 +1736,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_fc_werror_flag" || test ! -s conftest.err @@ -1753,7 +1744,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 then : ac_retval=0 else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 + e) printf '%s\n' "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; @@ -1777,7 +1768,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1785,7 +1776,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -1793,7 +1784,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 then : ac_retval=0 else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 + e) printf '%s\n' "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; @@ -1817,7 +1808,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1825,7 +1816,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -1836,7 +1827,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 then : ac_retval=0 else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 + e) printf '%s\n' "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; @@ -1865,7 +1856,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1873,7 +1864,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_fc_werror_flag" || test ! -s conftest.err @@ -1884,7 +1875,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 then : ac_retval=0 else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 + e) printf '%s\n' "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; @@ -1907,7 +1898,7 @@ fi ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : @@ -1929,8 +1920,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1948,7 +1939,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1956,7 +1947,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err @@ -1964,7 +1955,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 then : ac_retval=0 else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 + e) printf '%s\n' "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; @@ -1987,7 +1978,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1995,7 +1986,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err @@ -2003,7 +1994,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 then : ac_retval=0 else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 + e) printf '%s\n' "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; @@ -2021,7 +2012,7 @@ fi ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : @@ -2043,8 +2034,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_compile @@ -2061,7 +2052,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2069,7 +2060,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -2077,7 +2068,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 then : ac_retval=0 else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 + e) printf '%s\n' "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; @@ -2092,7 +2083,7 @@ for ac_arg do case $ac_arg in *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf '%s\n' "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done @@ -2104,7 +2095,7 @@ case $ac_configure_args_raw in ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" - ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; + ac_configure_args_raw=` printf '%s\n' "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF @@ -2112,7 +2103,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by SPECFEM3D Cartesian $as_me 4.1.1, which was -generated by GNU Autoconf 2.72. Invocation command line was +generated by GNU Autoconf 2.73. Invocation command line was $ $0$ac_configure_args_raw @@ -2152,7 +2143,7 @@ do */) ;; *) as_dir=$as_dir/ ;; esac - printf "%s\n" "PATH: $as_dir" + printf '%s\n' "PATH: $as_dir" done IFS=$as_save_IFS @@ -2187,7 +2178,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf '%s\n' "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2216,31 +2207,22 @@ done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Sanitize IFS. - IFS=" "" $as_nl" - # Save into config.log some information that might help in debugging. - { - echo - - printf "%s\n" "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, +# Dump the cache to stdout. It can be in a pipe (this is a requirement). +ac_cache_dump () +{ + # The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. ( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf '%s\n' "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2249,67 +2231,95 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} esac ;; esac done + (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) + # 'set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) - echo +} - printf "%s\n" "## ----------------- ## +# Print debugging info to stdout. +ac_dump_debugging_info () +{ + echo + + printf '%s\n' "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + ac_cache_dump + echo + + printf '%s\n' "## ----------------- ## ## Output variables. ## ## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'*) ac_val=`printf '%s\n' "$ac_val" | sed "s/'/'\\\\\\\\''/g"`;; + esac + printf '%s\n' "$ac_var='$ac_val'" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf '%s\n' "## ------------------- ## +## File substitutions. ## +## ------------------- ##" echo - for ac_var in $ac_subst_vars + for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'*) ac_val=`printf '%s\n' "$ac_val" | sed "s/'/'\\\\\\\\''/g"`;; esac - printf "%s\n" "$ac_var='\''$ac_val'\''" + printf '%s\n' "$ac_var='$ac_val'" done | sort echo + fi - if test -n "$ac_subst_files"; then - printf "%s\n" "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - printf "%s\n" "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - printf "%s\n" "## ----------- ## + if test -s confdefs.h; then + printf '%s\n' "## ----------- ## ## confdefs.h. ## ## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - printf "%s\n" "$as_me: caught signal $ac_signal" - printf "%s\n" "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf '%s\n' "$as_me: caught signal $ac_signal" + printf '%s\n' "$as_me: exit $exit_status" +} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. +ac_exit_trap () +{ + exit_status= + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + ac_dump_debugging_info >&5 + eval "rm -f $ac_clean_CONFIG_STATUS core *.core core.conftest.*" && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status -' 0 +} + +trap 'ac_exit_trap $?' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done @@ -2318,21 +2328,21 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -printf "%s\n" "/* confdefs.h */" > confdefs.h +printf '%s\n' "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h +printf '%s\n' "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h +printf '%s\n' "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h +printf '%s\n' "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h +printf '%s\n' "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h +printf '%s\n' "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h +printf '%s\n' "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. @@ -2354,12 +2364,12 @@ do ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf '%s\n' "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + || { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See 'config.log' for more details" "$LINENO" 5; } fi @@ -2369,27 +2379,120 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf '%s\n' "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf '%s\n' "$as_me: creating cache $cache_file" >&6;} >$cache_file fi +# Test code for whether the C compiler supports C23 (global declarations) +ac_c_conftest_c23_globals=' +/* Does the compiler advertise conformance to C17 or earlier? + Although GCC 14 does not do that, even with -std=gnu23, + it is close enough, and defines __STDC_VERSION == 202000L. */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ <= 201710L +# error "Compiler advertises conformance to C17 or earlier" +#endif + +// Check alignas. +char alignas (double) c23_aligned_as_double; +char alignas (0) c23_no_special_alignment; +extern char c23_aligned_as_int; +char alignas (0) alignas (int) c23_aligned_as_int; + +// Check alignof. +enum +{ + c23_int_alignment = alignof (int), + c23_int_array_alignment = alignof (int[100]), + c23_char_alignment = alignof (char) +}; +static_assert (0 < -alignof (int), "alignof is signed"); + +int function_with_unnamed_parameter (int) { return 0; } + +void c23_noreturn (); + +/* Test parsing of string and char UTF-8 literals (including hex escapes). + The parens pacify GCC 15. */ +bool use_u8 = (!sizeof u8"\xFF") == (!u8'\''x'\''); + +bool check_that_bool_works = true | false | !nullptr; +#if !true +# error "true does not work in #if" +#endif +#if false +#elifdef __STDC_VERSION__ +#else +# error "#elifdef does not work" +#endif + +#ifndef __has_c_attribute +# error "__has_c_attribute not defined" +#endif + +#ifndef __has_include +# error "__has_include not defined" +#endif + +#define LPAREN() ( +#define FORTY_TWO(x) 42 +#define VA_OPT_TEST(r, x, ...) __VA_OPT__ (FORTY_TWO r x)) +static_assert (VA_OPT_TEST (LPAREN (), 0, <:-) == 42); + +static_assert (0b101010 == 42); +static_assert (0B101010 == 42); +static_assert (0xDEAD'\''BEEF == 3'\''735'\''928'\''559); +static_assert (0.500'\''000'\''000 == 0.5); + +enum unsignedish : unsigned int { uione = 1 }; +static_assert (0 < -uione); + +#include +constexpr nullptr_t null_pointer = nullptr; + +static typeof (1 + 1L) two () { return 2; } +static long int three () { return 3; } +' + +# Test code for whether the C compiler supports C23 (body of main). +ac_c_conftest_c23_main=' + { + label_before_declaration: + int arr[10] = {}; + if (arr[0]) + goto label_before_declaration; + if (!arr[0]) + goto label_at_end_of_block; + label_at_end_of_block: + } + ok |= !null_pointer; + ok |= two != three; +' + +# Test code for whether the C compiler supports C23 (complete). +ac_c_conftest_c23_program="${ac_c_conftest_c23_globals} + +int +main (int, char **) +{ + int ok = 0; + ${ac_c_conftest_c23_main} + return ok; +} +" + # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' -/* Does the compiler advertise C89 conformance? - Do not test the value of __STDC__, because some compilers set it to 0 - while being otherwise adequately conformant. */ -#if !defined __STDC__ -# error "Compiler does not advertise C89 conformance" -#endif +/* Do not test the value of __STDC__, because some compilers define it to 0 + or do not define it, while otherwise adequately conforming. */ #include #include @@ -2469,7 +2572,8 @@ extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare -// FILE and stderr. +// FILE and stderr, and "aND" is used instead of "and" to work around +// GCC bug 40564 which is irrelevant here. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) @@ -2480,7 +2584,7 @@ test_varargs_macros (void) int y = 5678; debug ("Flag"); debug ("X = %d\n", x); - showlist (The first, second, and third items.); + showlist (The first, second, aND third items.); report (x>y, "x is %d but y is %d", x, y); } @@ -2568,15 +2672,15 @@ ac_c_conftest_c99_main=' // Check restrict. if (test_restrict ("String literal") == 0) success = true; - char *restrict newvar = "Another string"; + const char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + static struct incomplete_array *volatile incomplete_array_pointer; + struct incomplete_array *ia = incomplete_array_pointer; ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; @@ -2592,13 +2696,12 @@ ac_c_conftest_c99_main=' ni.number = 58; - int dynamic_array[ni.number]; - dynamic_array[0] = argv[0][0]; - dynamic_array[ni.number - 1] = 543; + // Do not test for VLAs, as some otherwise-conforming compilers lack them. + // C code should instead use __STDC_NO_VLA__; see Autoconf manual. // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' - || dynamic_array[ni.number - 1] != 543); + || ni.number != 58); ' # Test code for whether the C compiler supports C11 (global declarations) @@ -2716,222 +2819,6 @@ as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" -# Test code for whether the C++ compiler supports C++98 (global declarations) -ac_cxx_conftest_cxx98_globals=' -// Does the compiler advertise C++98 conformance? -#if !defined __cplusplus || __cplusplus < 199711L -# error "Compiler does not advertise C++98 conformance" -#endif - -// These inclusions are to reject old compilers that -// lack the unsuffixed header files. -#include -#include - -// and are *not* freestanding headers in C++98. -extern void assert (int); -namespace std { - extern int strcmp (const char *, const char *); -} - -// Namespaces, exceptions, and templates were all added after "C++ 2.0". -using std::exception; -using std::strcmp; - -namespace { - -void test_exception_syntax() -{ - try { - throw "test"; - } catch (const char *s) { - // Extra parentheses suppress a warning when building autoconf itself, - // due to lint rules shared with more typical C programs. - assert (!(strcmp) (s, "test")); - } -} - -template struct test_template -{ - T const val; - explicit test_template(T t) : val(t) {} - template T add(U u) { return static_cast(u) + val; } -}; - -} // anonymous namespace -' - -# Test code for whether the C++ compiler supports C++98 (body of main) -ac_cxx_conftest_cxx98_main=' - assert (argc); - assert (! argv[0]); -{ - test_exception_syntax (); - test_template tt (2.0); - assert (tt.add (4) == 6.0); - assert (true && !false); -} -' - -# Test code for whether the C++ compiler supports C++11 (global declarations) -ac_cxx_conftest_cxx11_globals=' -// Does the compiler advertise C++ 2011 conformance? -#if !defined __cplusplus || __cplusplus < 201103L -# error "Compiler does not advertise C++11 conformance" -#endif - -namespace cxx11test -{ - constexpr int get_val() { return 20; } - - struct testinit - { - int i; - double d; - }; - - class delegate - { - public: - delegate(int n) : n(n) {} - delegate(): delegate(2354) {} - - virtual int getval() { return this->n; }; - protected: - int n; - }; - - class overridden : public delegate - { - public: - overridden(int n): delegate(n) {} - virtual int getval() override final { return this->n * 2; } - }; - - class nocopy - { - public: - nocopy(int i): i(i) {} - nocopy() = default; - nocopy(const nocopy&) = delete; - nocopy & operator=(const nocopy&) = delete; - private: - int i; - }; - - // for testing lambda expressions - template Ret eval(Fn f, Ret v) - { - return f(v); - } - - // for testing variadic templates and trailing return types - template auto sum(V first) -> V - { - return first; - } - template auto sum(V first, Args... rest) -> V - { - return first + sum(rest...); - } -} -' - -# Test code for whether the C++ compiler supports C++11 (body of main) -ac_cxx_conftest_cxx11_main=' -{ - // Test auto and decltype - auto a1 = 6538; - auto a2 = 48573953.4; - auto a3 = "String literal"; - - int total = 0; - for (auto i = a3; *i; ++i) { total += *i; } - - decltype(a2) a4 = 34895.034; -} -{ - // Test constexpr - short sa[cxx11test::get_val()] = { 0 }; -} -{ - // Test initializer lists - cxx11test::testinit il = { 4323, 435234.23544 }; -} -{ - // Test range-based for - int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, - 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; - for (auto &x : array) { x += 23; } -} -{ - // Test lambda expressions - using cxx11test::eval; - assert (eval ([](int x) { return x*2; }, 21) == 42); - double d = 2.0; - assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); - assert (d == 5.0); - assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); - assert (d == 5.0); -} -{ - // Test use of variadic templates - using cxx11test::sum; - auto a = sum(1); - auto b = sum(1, 2); - auto c = sum(1.0, 2.0, 3.0); -} -{ - // Test constructor delegation - cxx11test::delegate d1; - cxx11test::delegate d2(); - cxx11test::delegate d3(45); -} -{ - // Test override and final - cxx11test::overridden o1(55464); -} -{ - // Test nullptr - char *c = nullptr; -} -{ - // Test template brackets - test_template<::test_template> v(test_template(12)); -} -{ - // Unicode literals - char const *utf8 = u8"UTF-8 string \u2500"; - char16_t const *utf16 = u"UTF-8 string \u2500"; - char32_t const *utf32 = U"UTF-32 string \u2500"; -} -' - -# Test code for whether the C compiler supports C++11 (complete). -ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} -${ac_cxx_conftest_cxx11_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_cxx_conftest_cxx98_main} - ${ac_cxx_conftest_cxx11_main} - return ok; -} -" - -# Test code for whether the C compiler supports C++98 (complete). -ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_cxx_conftest_cxx98_main} - return ok; -} -" - # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub" @@ -2946,7 +2833,7 @@ ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${ # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: -printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +printf '%s\n' "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates @@ -2959,7 +2846,7 @@ do esac as_found=: - printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files @@ -2970,13 +2857,13 @@ do if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no @@ -2988,7 +2875,7 @@ do fi else if test -f "${as_dir}${ac_aux}"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then @@ -3041,38 +2928,44 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf '%s\n' "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf '%s\n' "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` + ac_old_val_w= + for ac_val in x $ac_old_val; do + ac_old_val_w="$ac_old_val_w $ac_val" + done + ac_new_val_w= + for ac_val in x $ac_new_val; do + ac_new_val_w="$ac_new_val_w $ac_val" + done if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf '%s\n' "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf '%s\n' "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf '%s\n' "$as_me: former value: '$ac_old_val'" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf '%s\n' "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`printf '%s\n' "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -3082,10 +2975,10 @@ printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf '%s\n' "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi @@ -3093,6 +2986,23 @@ fi ## Main body of script. ## ## -------------------- ## + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3243,7 +3153,7 @@ ac_config_headers="$ac_config_headers setup/config.h" ############################################################ -printf "%s\n" "## ---------------------------- ## +printf '%s\n' "## ---------------------------- ## ## setting up compilation flags ## ## ---------------------------- ##" @@ -3253,7 +3163,7 @@ printf "%s\n" "## ---------------------------- ## $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : @@ -3269,8 +3179,8 @@ ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -printf "%s\n" "$ac_cv_build" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf '%s\n' "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -3286,10 +3196,10 @@ shift; shift # except with old shells: build_os=$* IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac +case $build_os in *\ *) build_os=`printf '%s\n' "$build_os" | sed 's/ /-/g'`;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : @@ -3304,8 +3214,8 @@ fi ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -printf "%s\n" "$ac_cv_host" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf '%s\n' "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -3321,7 +3231,7 @@ shift; shift # except with old shells: host_os=$* IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +case $host_os in *\ *) host_os=`printf '%s\n' "$host_os" | sed 's/ /-/g'`;; esac @@ -3559,6 +3469,42 @@ else fi +# CUDA-aware MPI setting +# Check whether --enable-cuda-aware-mpi was given. +if test ${enable_cuda_aware_mpi+y} +then : + enableval=$enable_cuda_aware_mpi; enable_cuda_aware_mpi="$enableval" +else case e in #( + e) enable_cuda_aware_mpi=no ;; +esac +fi + + +# Check whether --with-cuda-aware-mpi was given. +if test ${with_cuda_aware_mpi+y} +then : + withval=$with_cuda_aware_mpi; with_cuda_aware_mpi="$withval" +else case e in #( + e) with_cuda_aware_mpi=no ;; +esac +fi + +if test x"$enable_cuda_aware_mpi" != xno || test x"$with_cuda_aware_mpi" != xno +then : + want_cuda_aware_mpi=yes +else case e in #( + e) want_cuda_aware_mpi=no ;; +esac +fi + if test x"$want_cuda_aware_mpi" != xno; then + COND_CUDA_AWARE_MPI_TRUE= + COND_CUDA_AWARE_MPI_FALSE='#' +else + COND_CUDA_AWARE_MPI_TRUE='#' + COND_CUDA_AWARE_MPI_FALSE= +fi + + ## HIP # Check whether --with-hip was given. @@ -3894,7 +3840,7 @@ if test -n "$ac_tool_prefix"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FC+y} then : @@ -3915,7 +3861,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_FC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3927,11 +3873,11 @@ esac fi FC=$ac_cv_prog_FC if test -n "$FC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 -printf "%s\n" "$FC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 +printf '%s\n' "$FC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -3944,7 +3890,7 @@ if test -z "$FC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_FC+y} then : @@ -3965,7 +3911,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_FC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3977,11 +3923,11 @@ esac fi ac_ct_FC=$ac_cv_prog_ac_ct_FC if test -n "$ac_ct_FC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 -printf "%s\n" "$ac_ct_FC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 +printf '%s\n' "$ac_ct_FC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -3993,8 +3939,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac FC=$ac_ct_FC @@ -4003,7 +3949,7 @@ fi # Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 +printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -4013,7 +3959,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -4023,7 +3969,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done rm -f a.out @@ -4038,9 +3984,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler works" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler works" >&5 printf %s "checking whether the Fortran compiler works... " >&6; } -ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +ac_link_default=`printf '%s\n' "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -4061,10 +4007,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. @@ -4105,29 +4051,29 @@ esac fi if test -z "$ac_file" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -printf "%s\n" "$as_me: failed program was:" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +printf '%s\n' "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +{ { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "Fortran compiler cannot create executables See 'config.log' for more details" "$LINENO" 5; } else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } ;; + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler default output file name" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler default output file name" >&5 printf %s "checking for Fortran compiler default output file name... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -printf "%s\n" "$ac_file" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf '%s\n' "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in @@ -4135,10 +4081,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) @@ -4155,15 +4101,15 @@ for ac_file in conftest.exe conftest conftest.*; do esac done else case e in #( - e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + e) { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest conftest$ac_cv_exeext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -printf "%s\n" "$ac_cv_exeext" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf '%s\n' "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -4178,7 +4124,7 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" @@ -4187,10 +4133,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -4198,31 +4144,31 @@ printf "%s\n" "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run Fortran compiled programs. If you meant to cross compile, use '--host'. See 'config.log' for more details" "$LINENO" 5; } fi fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -printf "%s\n" "$cross_compiling" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf '%s\n' "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext \ conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : @@ -4240,10 +4186,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do @@ -4255,11 +4201,11 @@ then : esac done else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 + e) printf '%s\n' "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +{ { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See 'config.log' for more details" "$LINENO" 5; } ;; esac @@ -4267,15 +4213,15 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -printf "%s\n" "$ac_cv_objext" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf '%s\n' "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT # If we don't use '.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU Fortran" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU Fortran" >&5 printf %s "checking whether the compiler supports GNU Fortran... " >&6; } if test ${ac_cv_fc_compiler_gnu+y} then : @@ -4301,15 +4247,15 @@ ac_cv_fc_compiler_gnu=$ac_compiler_gnu ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_fc_compiler_gnu" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 +printf '%s\n' "$ac_cv_fc_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_fc_compiler_gnu ac_ext=$ac_save_ext ac_test_FCFLAGS=${FCFLAGS+y} ac_save_FCFLAGS=$FCFLAGS FCFLAGS= -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 printf %s "checking whether $FC accepts -g... " >&6; } if test ${ac_cv_prog_fc_g+y} then : @@ -4332,8 +4278,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 -printf "%s\n" "$ac_cv_prog_fc_g" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 +printf '%s\n' "$ac_cv_prog_fc_g" >&6; } if test $ac_test_FCFLAGS; then FCFLAGS=$ac_save_FCFLAGS elif test $ac_cv_prog_fc_g = yes; then @@ -4371,8 +4317,8 @@ FFLAGS="$FCFLAGS" flags_guess="$SHELL $srcdir/flags.guess" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: running $flags_guess" >&5 -printf "%s\n" "$as_me: running $flags_guess" >&6;} +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: running $flags_guess" >&5 +printf '%s\n' "$as_me: running $flags_guess" >&6;} flags=`$flags_guess` || as_fn_error $? "$flags_guess failed" "$LINENO" 5 eval $flags @@ -4382,7 +4328,7 @@ ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $FC" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $FC" >&5 printf %s "checking how to get verbose linking output from $FC... " >&6; } if test ${ac_cv_prog_fc_v+y} then : @@ -4412,23 +4358,23 @@ ac_save_FCFLAGS=$FCFLAGS FCFLAGS="$FCFLAGS $ac_verb" eval "set x $ac_link" shift -printf "%s\n" "$as_me:${as_lineno-$LINENO}: $*" >&5 +printf '%s\n' "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` -printf "%s\n" "$ac_fc_v_output" >&5 +printf '%s\n' "$ac_fc_v_output" >&5 FCFLAGS=$ac_save_FCFLAGS rm -rf conftest* -# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where +# On HP-UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): -ac_fc_v_output="`echo $ac_fc_v_output | +ac_fc_v_output=`printf '%s\n' "$ac_fc_v_output"| grep 'LPATH is:' | - sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output" + sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'`" $ac_fc_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented @@ -4437,7 +4383,7 @@ case $ac_fc_v_output in # With xlf replace commas with spaces, # and remove "-link" and closing parenthesis. *xlfentry*) - ac_fc_v_output=`echo $ac_fc_v_output | + ac_fc_v_output=`printf '%s\n' "$ac_fc_v_output" | sed ' s/,/ /g s/ -link / /g @@ -4448,20 +4394,20 @@ case $ac_fc_v_output in # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; + ac_fc_v_output=`printf '%s\n' "$ac_fc_v_output" | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) - ac_fc_v_output=`echo $ac_fc_v_output | sed "\ + ac_fc_v_output=`printf '%s\n' $ac_fc_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. *fort77*f2c*gcc*) - ac_fc_v_output=`echo "$ac_fc_v_output" | sed -n ' + ac_fc_v_output=`printf '%s\n' "$ac_fc_v_output" | sed -n ' /:[ ]\+Running[ ]\{1,\}"gcc"/{ /"-c"/d /[.]c"*/d @@ -4471,7 +4417,7 @@ case $ac_fc_v_output in # If we are using Cray Fortran then delete quotes. *cft90*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;; + ac_fc_v_output=`printf '%s\n' "$ac_fc_v_output" | sed 's/"//g'` ;; esac @@ -4485,21 +4431,21 @@ esac done done if test -z "$ac_cv_prog_fc_v"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $FC" >&5 -printf "%s\n" "$as_me: WARNING: cannot determine how to obtain linking information from $FC" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $FC" >&5 +printf '%s\n' "$as_me: WARNING: cannot determine how to obtain linking information from $FC" >&2;} fi else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 -printf "%s\n" "$as_me: WARNING: compilation failed" >&2;} ;; + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 +printf '%s\n' "$as_me: WARNING: compilation failed" >&2;} ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_v" >&5 -printf "%s\n" "$ac_cv_prog_fc_v" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran libraries of $FC" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_v" >&5 +printf '%s\n' "$ac_cv_prog_fc_v" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for Fortran libraries of $FC" >&5 printf %s "checking for Fortran libraries of $FC... " >&6; } if test ${ac_cv_fc_libs+y} then : @@ -4523,23 +4469,23 @@ ac_save_FCFLAGS=$FCFLAGS FCFLAGS="$FCFLAGS $ac_cv_prog_fc_v" eval "set x $ac_link" shift -printf "%s\n" "$as_me:${as_lineno-$LINENO}: $*" >&5 +printf '%s\n' "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` -printf "%s\n" "$ac_fc_v_output" >&5 +printf '%s\n' "$ac_fc_v_output" >&5 FCFLAGS=$ac_save_FCFLAGS rm -rf conftest* -# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where +# On HP-UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): -ac_fc_v_output="`echo $ac_fc_v_output | +ac_fc_v_output=`printf '%s\n' "$ac_fc_v_output"| grep 'LPATH is:' | - sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output" + sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'`" $ac_fc_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented @@ -4548,7 +4494,7 @@ case $ac_fc_v_output in # With xlf replace commas with spaces, # and remove "-link" and closing parenthesis. *xlfentry*) - ac_fc_v_output=`echo $ac_fc_v_output | + ac_fc_v_output=`printf '%s\n' "$ac_fc_v_output" | sed ' s/,/ /g s/ -link / /g @@ -4559,20 +4505,20 @@ case $ac_fc_v_output in # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; + ac_fc_v_output=`printf '%s\n' "$ac_fc_v_output" | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) - ac_fc_v_output=`echo $ac_fc_v_output | sed "\ + ac_fc_v_output=`printf '%s\n' $ac_fc_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. *fort77*f2c*gcc*) - ac_fc_v_output=`echo "$ac_fc_v_output" | sed -n ' + ac_fc_v_output=`printf '%s\n' "$ac_fc_v_output" | sed -n ' /:[ ]\+Running[ ]\{1,\}"gcc"/{ /"-c"/d /[.]c"*/d @@ -4582,7 +4528,7 @@ case $ac_fc_v_output in # If we are using Cray Fortran then delete quotes. *cft90*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;; + ac_fc_v_output=`printf '%s\n' "$ac_fc_v_output" | sed 's/"//g'` ;; esac @@ -4639,9 +4585,9 @@ fi ;; # Ignore these flags. -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \ - |-LANG:=* | -LIST:* | -LNO:* | -link) + | -[lLR]*=* | -LIST:* | -LNO:* | -link) ;; - -lkernel32 | -lmingw* | -lmoldname) + -lkernel32) # Ignore this library only on Windows-like systems. case $host_os in cygwin* | msys* | mingw* | windows*) ;; @@ -4664,6 +4610,12 @@ fi ;; esac ;; + -target-feature) + # for target specific feature flags, ignore the next argument, + # which may include a feature starting with -l + # (e.g -target-feature -lwp) + shift; + ;; -[LRuYz]) # These flags, when seen by themselves, take an argument. # We remove the space between option and argument and re-iterate @@ -4678,7 +4630,7 @@ fi esac ;; -YP,*) - for ac_j in `printf "%s\n" "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do + for ac_j in `printf '%s\n' "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do ac_exists=false for ac_i in $ac_cv_fc_libs; do if test x"$ac_j" = x"$ac_i"; then @@ -4729,7 +4681,7 @@ set X $ac_save_positional; shift # must begin with a "/"). case `(uname -sr) 2>/dev/null` in "SunOS 5"*) - ac_ld_run_path=`printf "%s\n" "$ac_fc_v_output" | + ac_ld_run_path=`printf '%s\n' "$ac_fc_v_output" | sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` test "x$ac_ld_run_path" != x && if test "$ac_compiler_gnu" = yes; then @@ -4745,8 +4697,8 @@ fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_libs" >&5 -printf "%s\n" "$ac_cv_fc_libs" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_libs" >&5 +printf '%s\n' "$ac_cv_fc_libs" >&6; } FCLIBS="$ac_cv_fc_libs" @@ -4765,6 +4717,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4773,7 +4728,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : @@ -4794,7 +4749,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4806,11 +4761,11 @@ esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -4819,7 +4774,7 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : @@ -4840,7 +4795,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4852,11 +4807,11 @@ esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf '%s\n' "$ac_ct_CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -4864,8 +4819,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -4878,7 +4833,7 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : @@ -4899,7 +4854,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4911,11 +4866,11 @@ esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -4924,7 +4879,7 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : @@ -4950,7 +4905,7 @@ do continue fi ac_cv_prog_CC="cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4974,11 +4929,11 @@ esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -4989,7 +4944,7 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : @@ -5010,7 +4965,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5022,11 +4977,11 @@ esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -5039,7 +4994,7 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : @@ -5060,7 +5015,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5072,11 +5027,11 @@ esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf '%s\n' "$ac_ct_CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -5088,8 +5043,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -5101,7 +5056,7 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : @@ -5122,7 +5077,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5134,11 +5089,11 @@ esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -5147,7 +5102,7 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : @@ -5168,7 +5123,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5180,11 +5135,11 @@ esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf '%s\n' "$ac_ct_CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -5192,8 +5147,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -5205,13 +5160,13 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +test -z "$CC" && { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do @@ -5221,7 +5176,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -5231,11 +5186,11 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : @@ -5275,8 +5230,8 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf '%s\n' "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then @@ -5286,7 +5241,7 @@ else fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : @@ -5378,8 +5333,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf '%s\n' "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -5398,7 +5353,56 @@ fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C23 features" >&5 +printf %s "checking for $CC option to enable C23 features... " >&6; } +if test ${ac_cv_prog_cc_c23+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c23=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c23_program +_ACEOF +for ac_arg in '' -std=gnu23 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c23=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c23" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c23" = xno +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c23" = x +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } +else case e in #( + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c23" >&5 +printf '%s\n' "$ac_cv_prog_cc_c23" >&6; } + CC="$CC $ac_cv_prog_cc_c23" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c23 + ac_prog_cc_stdc=c23 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : @@ -5410,7 +5414,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF -for ac_arg in '' -std=gnu11 +for ac_arg in '' -std=gnu11 -std:c11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" @@ -5427,16 +5431,16 @@ fi if test "x$ac_cv_prog_cc_c11" = xno then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf '%s\n' "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi @@ -5447,7 +5451,7 @@ fi fi if test x$ac_prog_cc_stdc = xno then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : @@ -5476,16 +5480,16 @@ fi if test "x$ac_cv_prog_cc_c99" = xno then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf '%s\n' "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi @@ -5496,7 +5500,7 @@ fi fi if test x$ac_prog_cc_stdc = xno then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : @@ -5525,16 +5529,16 @@ fi if test "x$ac_cv_prog_cc_c89" = xno then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf '%s\n' "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi @@ -5556,7 +5560,7 @@ ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran libraries" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran libraries" >&5 printf %s "checking for dummy main to link with Fortran libraries... " >&6; } if test ${ac_cv_fc_dummy_main+y} then : @@ -5640,24 +5644,24 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_dummy_main" >&5 -printf "%s\n" "$ac_cv_fc_dummy_main" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_dummy_main" >&5 +printf '%s\n' "$ac_cv_fc_dummy_main" >&6; } FC_DUMMY_MAIN=$ac_cv_fc_dummy_main if test "$FC_DUMMY_MAIN" != unknown then : if test $FC_DUMMY_MAIN != none; then -printf "%s\n" "#define FC_DUMMY_MAIN $FC_DUMMY_MAIN" >>confdefs.h +printf '%s\n' "#define FC_DUMMY_MAIN $FC_DUMMY_MAIN" >>confdefs.h if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then -printf "%s\n" "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h +printf '%s\n' "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h fi fi else case e in #( - e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + e) { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "linking to Fortran libraries from C fails See 'config.log' for more details" "$LINENO" 5; } ;; esac @@ -5673,7 +5677,7 @@ ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran name-mangling scheme" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for Fortran name-mangling scheme" >&5 printf %s "checking for Fortran name-mangling scheme... " >&6; } if test ${ac_cv_fc_mangling+y} then : @@ -5829,8 +5833,8 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu rm -rf conftest* rm -f cfortran_test* else case e in #( - e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + e) { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compile a simple Fortran program See 'config.log' for more details" "$LINENO" 5; } ;; esac @@ -5839,8 +5843,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_mangling" >&5 -printf "%s\n" "$ac_cv_fc_mangling" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_mangling" >&5 +printf '%s\n' "$ac_cv_fc_mangling" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -5854,48 +5858,48 @@ ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest ac_compiler_gnu=$ac_cv_fc_compiler_gnu case $ac_cv_fc_mangling in "lower case, no underscore, no extra underscore") - printf "%s\n" "#define FC_FUNC(name,NAME) name" >>confdefs.h + printf '%s\n' "#define FC_FUNC(name,NAME) name" >>confdefs.h - printf "%s\n" "#define FC_FUNC_(name,NAME) name" >>confdefs.h + printf '%s\n' "#define FC_FUNC_(name,NAME) name" >>confdefs.h ;; "lower case, no underscore, extra underscore") - printf "%s\n" "#define FC_FUNC(name,NAME) name" >>confdefs.h + printf '%s\n' "#define FC_FUNC(name,NAME) name" >>confdefs.h - printf "%s\n" "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h + printf '%s\n' "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h ;; "lower case, underscore, no extra underscore") - printf "%s\n" "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h + printf '%s\n' "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h - printf "%s\n" "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h + printf '%s\n' "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h ;; "lower case, underscore, extra underscore") - printf "%s\n" "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h + printf '%s\n' "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h - printf "%s\n" "#define FC_FUNC_(name,NAME) name ## __" >>confdefs.h + printf '%s\n' "#define FC_FUNC_(name,NAME) name ## __" >>confdefs.h ;; "upper case, no underscore, no extra underscore") - printf "%s\n" "#define FC_FUNC(name,NAME) NAME" >>confdefs.h + printf '%s\n' "#define FC_FUNC(name,NAME) NAME" >>confdefs.h - printf "%s\n" "#define FC_FUNC_(name,NAME) NAME" >>confdefs.h + printf '%s\n' "#define FC_FUNC_(name,NAME) NAME" >>confdefs.h ;; "upper case, no underscore, extra underscore") - printf "%s\n" "#define FC_FUNC(name,NAME) NAME" >>confdefs.h + printf '%s\n' "#define FC_FUNC(name,NAME) NAME" >>confdefs.h - printf "%s\n" "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h + printf '%s\n' "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h ;; "upper case, underscore, no extra underscore") - printf "%s\n" "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h + printf '%s\n' "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h - printf "%s\n" "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h + printf '%s\n' "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h ;; "upper case, underscore, extra underscore") - printf "%s\n" "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h + printf '%s\n' "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h - printf "%s\n" "#define FC_FUNC_(name,NAME) NAME ## __" >>confdefs.h + printf '%s\n' "#define FC_FUNC_(name,NAME) NAME ## __" >>confdefs.h ;; *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5 -printf "%s\n" "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5 +printf '%s\n' "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;} ;; esac @@ -5914,7 +5918,7 @@ ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran flag to compile .f90 files" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for Fortran flag to compile .f90 files" >&5 printf %s "checking for Fortran flag to compile .f90 files... " >&6; } if test ${ac_cv_fc_srcext_f90+y} then : @@ -5946,8 +5950,8 @@ ac_fcflags_srcext=$ac_fcflags_srcext_save ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_srcext_f90" >&5 -printf "%s\n" "$ac_cv_fc_srcext_f90" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_srcext_f90" >&5 +printf '%s\n' "$ac_cv_fc_srcext_f90" >&6; } if test "x$ac_cv_fc_srcext_f90" = xunknown; then as_fn_error $? "Fortran could not compile .f90 files" "$LINENO" 5 else @@ -5971,7 +5975,7 @@ ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran flag needed to accept free-form source" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for Fortran flag needed to accept free-form source" >&5 printf %s "checking for Fortran flag needed to accept free-form source... " >&6; } if test ${ac_cv_fc_freeform+y} then : @@ -6002,8 +6006,8 @@ FCFLAGS=$ac_fc_freeform_FCFLAGS_save ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_freeform" >&5 -printf "%s\n" "$ac_cv_fc_freeform" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_freeform" >&5 +printf '%s\n' "$ac_cv_fc_freeform" >&6; } if test "x$ac_cv_fc_freeform" = xunknown; then as_fn_error 77 "Fortran does not accept free-form source" "$LINENO" 5 else @@ -6027,7 +6031,7 @@ ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran flag to compile preprocessed .F files" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for Fortran flag to compile preprocessed .F files" >&5 printf %s "checking for Fortran flag to compile preprocessed .F files... " >&6; } if test ${ac_cv_fc_pp_srcext_F+y} then : @@ -6080,8 +6084,8 @@ ac_fcflags_srcext=$ac_fcflags_pp_srcext_save ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_pp_srcext_F" >&5 -printf "%s\n" "$ac_cv_fc_pp_srcext_F" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_pp_srcext_F" >&5 +printf '%s\n' "$ac_cv_fc_pp_srcext_F" >&6; } if test "x$ac_cv_fc_pp_srcext_F" = xunknown; then as_fn_error $? "Fortran could not compile preprocessed .F files" "$LINENO" 5 else @@ -6101,7 +6105,7 @@ ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to define symbols for preprocessed Fortran" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking how to define symbols for preprocessed Fortran" >&5 printf %s "checking how to define symbols for preprocessed Fortran... " >&6; } if test ${ac_cv_fc_pp_define+y} then : @@ -6135,8 +6139,8 @@ FCFLAGS=$ac_fc_pp_define_FCFLAGS_save ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_pp_define" >&5 -printf "%s\n" "$ac_cv_fc_pp_define" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_pp_define" >&5 +printf '%s\n' "$ac_cv_fc_pp_define" >&6; } ac_fc_srcext=$ac_fc_pp_define_srcext_save if test "x$ac_cv_fc_pp_define" = xunknown; then FC_DEFINE= @@ -6155,7 +6159,7 @@ ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran flag to compile preprocessed .F90 files" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for Fortran flag to compile preprocessed .F90 files" >&5 printf %s "checking for Fortran flag to compile preprocessed .F90 files... " >&6; } if test ${ac_cv_fc_pp_srcext_F90+y} then : @@ -6208,8 +6212,8 @@ ac_fcflags_srcext=$ac_fcflags_pp_srcext_save ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_pp_srcext_F90" >&5 -printf "%s\n" "$ac_cv_fc_pp_srcext_F90" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_pp_srcext_F90" >&5 +printf '%s\n' "$ac_cv_fc_pp_srcext_F90" >&6; } if test "x$ac_cv_fc_pp_srcext_F90" = xunknown; then as_fn_error $? "Fortran could not compile preprocessed .F90 files" "$LINENO" 5 else @@ -6237,7 +6241,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : @@ -6258,7 +6262,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6270,11 +6274,11 @@ esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -6283,7 +6287,7 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : @@ -6304,7 +6308,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6316,11 +6320,11 @@ esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf '%s\n' "$ac_ct_CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -6328,8 +6332,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -6342,7 +6346,7 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : @@ -6363,7 +6367,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6375,11 +6379,11 @@ esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -6388,7 +6392,7 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : @@ -6414,7 +6418,7 @@ do continue fi ac_cv_prog_CC="cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6438,11 +6442,11 @@ esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -6453,7 +6457,7 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : @@ -6474,7 +6478,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6486,11 +6490,11 @@ esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -6503,7 +6507,7 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : @@ -6524,7 +6528,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6536,11 +6540,11 @@ esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf '%s\n' "$ac_ct_CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -6552,8 +6556,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -6565,7 +6569,7 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : @@ -6586,7 +6590,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6598,11 +6602,11 @@ esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -6611,7 +6615,7 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : @@ -6632,7 +6636,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6644,11 +6648,11 @@ esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf '%s\n' "$ac_ct_CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -6656,8 +6660,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -6669,13 +6673,13 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +test -z "$CC" && { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do @@ -6685,7 +6689,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -6695,11 +6699,11 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : @@ -6739,8 +6743,8 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf '%s\n' "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then @@ -6750,7 +6754,7 @@ else fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : @@ -6842,8 +6846,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf '%s\n' "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -6862,7 +6866,56 @@ fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C23 features" >&5 +printf %s "checking for $CC option to enable C23 features... " >&6; } +if test ${ac_cv_prog_cc_c23+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c23=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c23_program +_ACEOF +for ac_arg in '' -std=gnu23 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c23=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c23" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c23" = xno +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c23" = x +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } +else case e in #( + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c23" >&5 +printf '%s\n' "$ac_cv_prog_cc_c23" >&6; } + CC="$CC $ac_cv_prog_cc_c23" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c23 + ac_prog_cc_stdc=c23 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : @@ -6874,7 +6927,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF -for ac_arg in '' -std=gnu11 +for ac_arg in '' -std=gnu11 -std:c11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" @@ -6891,16 +6944,16 @@ fi if test "x$ac_cv_prog_cc_c11" = xno then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf '%s\n' "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi @@ -6911,7 +6964,7 @@ fi fi if test x$ac_prog_cc_stdc = xno then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : @@ -6940,16 +6993,16 @@ fi if test "x$ac_cv_prog_cc_c99" = xno then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf '%s\n' "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi @@ -6960,7 +7013,7 @@ fi fi if test x$ac_prog_cc_stdc = xno then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : @@ -6989,16 +7042,16 @@ fi if test "x$ac_cv_prog_cc_c89" = xno then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf '%s\n' "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi @@ -7017,7 +7070,7 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu ############################################################ #checks for Scotch -printf "%s\n" "## ------ ## +printf '%s\n' "## ------ ## ## SCOTCH ## ## ------ ##" @@ -7079,7 +7132,7 @@ if test "${USE_BUNDLED_SCOTCH}" != "1"; then if test -n "${ac_scotch_lib_dir}"; then LDFLAGS="${LDFLAGS} -L${ac_scotch_lib_dir}"; fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for scotchfarchinit in -lscotch" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for scotchfarchinit in -lscotch" >&5 printf %s "checking for scotchfarchinit in -lscotch... " >&6; } if test ${ac_cv_lib_scotch_scotchfarchinit_+y} then : @@ -7104,8 +7157,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_scotch_scotchfarchinit_" >&5 -printf "%s\n" "$ac_cv_lib_scotch_scotchfarchinit_" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_scotch_scotchfarchinit_" >&5 +printf '%s\n' "$ac_cv_lib_scotch_scotchfarchinit_" >&6; } if test "x$ac_cv_lib_scotch_scotchfarchinit_" = xyes then : scotch_lib="yes"; @@ -7127,32 +7180,32 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Scotch is usable" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether Scotch is usable" >&5 printf %s "checking whether Scotch is usable... " >&6; } if test "x${scotch_usable}" = "xyes"; then -printf "%s\n" "#define HAVE_SCOTCH 1" >>confdefs.h +printf '%s\n' "#define HAVE_SCOTCH 1" >>confdefs.h want_scotch=yes USE_BUNDLED_SCOTCH=0 SCOTCH_DIR="${ac_scotch_dir}" SCOTCH_LIBDIR="${ac_scotch_lib_dir}" SCOTCH_INCLUDEDIR="${ac_scotch_include_dir}" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else -printf "%s\n" "#define HAVE_SCOTCH 1" >>confdefs.h +printf '%s\n' "#define HAVE_SCOTCH 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using bundled scotch instead" >&5 -printf "%s\n" "no, using bundled scotch instead" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no, using bundled scotch instead" >&5 +printf '%s\n' "no, using bundled scotch instead" >&6; } for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LEX+y} then : @@ -7173,7 +7226,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7185,11 +7238,11 @@ esac fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 -printf "%s\n" "$LEX" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 +printf '%s\n' "$LEX" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -7234,7 +7287,7 @@ main (void) return ! yylex (); } _ACEOF -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex output file root" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for lex output file root" >&5 printf %s "checking for lex output file root... " >&6; } if test ${ac_cv_prog_lex_root+y} then : @@ -7248,10 +7301,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy @@ -7260,22 +7313,30 @@ elif test -f lexyy.c; then fi ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 -printf "%s\n" "$ac_cv_prog_lex_root" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 +printf '%s\n' "$ac_cv_prog_lex_root" >&6; } if test "$ac_cv_prog_lex_root" = unknown then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find output from $LEX; giving up on $LEX" >&5 -printf "%s\n" "$as_me: WARNING: cannot find output from $LEX; giving up on $LEX" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: cannot find output from $LEX; giving up on $LEX" >&5 +printf '%s\n' "$as_me: WARNING: cannot find output from $LEX; giving up on $LEX" >&2;} LEX=: LEXLIB= fi LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root +# When compiled as C++, the test lexer declares yywrap with extern "C". +# Solaris 10 lex (Software Generation Utilities (SGU) Solaris-ELF (4.0))'s +# scanner skeleton will provide a conflicting declaration of yywrap, +# *without* extern "C", unless we define this macro on the command line. +# The %{ %} block is not early enough for the definition to be effective. +ac_save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -D__EXTERN_C__=1" + if test ${LEXLIB+y} then : else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex library" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for lex library" >&5 printf %s "checking for lex library... " >&6; } if test ${ac_cv_lib_lex+y} then : @@ -7313,12 +7374,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 -printf "%s\n" "$ac_cv_lib_lex" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 +printf '%s\n' "$ac_cv_lib_lex" >&6; } if test "$ac_cv_lib_lex" = 'not found' then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: required lex library not found; giving up on $LEX" >&5 -printf "%s\n" "$as_me: WARNING: required lex library not found; giving up on $LEX" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: required lex library not found; giving up on $LEX" >&5 +printf '%s\n' "$as_me: WARNING: required lex library not found; giving up on $LEX" >&2;} LEX=: LEXLIB= elif test "$ac_cv_lib_lex" = 'none needed' then : @@ -7335,7 +7396,7 @@ fi if test "$LEX" != : then : -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 printf %s "checking whether yytext is a pointer... " >&6; } if test ${ac_cv_prog_lex_yytext_pointer+y} then : @@ -7358,15 +7419,16 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 -printf "%s\n" "$ac_cv_prog_lex_yytext_pointer" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 +printf '%s\n' "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then -printf "%s\n" "#define YYTEXT_POINTER 1" >>confdefs.h +printf '%s\n' "#define YYTEXT_POINTER 1" >>confdefs.h fi fi +CPPFLAGS="$ac_save_CPPFLAGS" rm -f conftest.l $LEX_OUTPUT_ROOT.c fi @@ -7379,7 +7441,7 @@ fi do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_YACC+y} then : @@ -7400,7 +7462,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7412,11 +7474,11 @@ esac fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 -printf "%s\n" "$YACC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +printf '%s\n' "$YACC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -7451,7 +7513,7 @@ if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 printf %s "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7488,8 +7550,8 @@ then : fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 -printf "%s\n" "$acx_pthread_ok" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 +printf '%s\n' "$acx_pthread_ok" >&6; } if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" @@ -7550,12 +7612,12 @@ for flag in $acx_pthread_flags; do case $flag in none) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 printf %s "checking whether pthreads work without any flags... " >&6; } ;; -*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 printf %s "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; @@ -7563,7 +7625,7 @@ printf %s "checking whether pthreads work with $flag... " >&6; } pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_acx_pthread_config+y} then : @@ -7584,7 +7646,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_acx_pthread_config="yes" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7597,11 +7659,11 @@ esac fi acx_pthread_config=$ac_cv_prog_acx_pthread_config if test -n "$acx_pthread_config"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_config" >&5 -printf "%s\n" "$acx_pthread_config" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_config" >&5 +printf '%s\n' "$acx_pthread_config" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -7611,7 +7673,7 @@ fi ;; *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 printf %s "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; @@ -7662,8 +7724,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 -printf "%s\n" "$acx_pthread_ok" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 +printf '%s\n' "$acx_pthread_ok" >&6; } if test "x$acx_pthread_ok" = xyes; then break; fi @@ -7681,7 +7743,7 @@ if test "x$acx_pthread_ok" = xyes; then CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 printf %s "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do @@ -7711,23 +7773,23 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 -printf "%s\n" "$attr_name" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 +printf '%s\n' "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then -printf "%s\n" "#define PTHREAD_CREATE_JOINABLE $attr_name" >>confdefs.h +printf '%s\n' "#define PTHREAD_CREATE_JOINABLE $attr_name" >>confdefs.h fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 printf %s "checking if more special flags are required for pthreads... " >&6; } flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 -printf "%s\n" "${flag}" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 +printf '%s\n' "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi @@ -7741,7 +7803,7 @@ printf "%s\n" "${flag}" >&6; } do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PTHREAD_CC+y} then : @@ -7762,7 +7824,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7774,11 +7836,11 @@ esac fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 -printf "%s\n" "$PTHREAD_CC" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +printf '%s\n' "$PTHREAD_CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -7799,8 +7861,8 @@ fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: pthread found" >&5 -printf "%s\n" "pthread found" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: pthread found" >&5 +printf '%s\n' "pthread found" >&6; } : else acx_pthread_ok=no @@ -7843,13 +7905,13 @@ fi if test "$want_scotch" = yes then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: SCOTCH is enabled" >&5 -printf "%s\n" "SCOTCH is enabled" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: SCOTCH is enabled" >&5 +printf '%s\n' "SCOTCH is enabled" >&6; } else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: SCOTCH is not enabled" >&5 -printf "%s\n" "SCOTCH is not enabled" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: SCOTCH is not enabled" >&5 +printf '%s\n' "SCOTCH is not enabled" >&6; } ;; esac fi @@ -7898,11 +7960,11 @@ fi # Checks for typedefs, structures, and compiler characteristics. # check fortran modules flag -printf "%s\n" "## ----------------- ## +printf '%s\n' "## ----------------- ## ## module extensions ## ## ----------------- ##" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Fortran 90 module extension" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking Fortran 90 module extension" >&5 printf %s "checking Fortran 90 module extension... " >&6; } if test ${ac_cv_fc_module_ext+y} then : @@ -7943,8 +8005,8 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_module_ext" >&5 -printf "%s\n" "$ac_cv_fc_module_ext" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_module_ext" >&5 +printf '%s\n' "$ac_cv_fc_module_ext" >&6; } FC_MODEXT=$ac_cv_fc_module_ext if test "$FC_MODEXT" = unknown; then FC_MODEXT= @@ -7952,7 +8014,7 @@ fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Fortran 90 module inclusion flag" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking Fortran 90 module inclusion flag" >&5 printf %s "checking Fortran 90 module inclusion flag... " >&6; } if test ${ac_cv_fc_module_flag+y} then : @@ -8012,8 +8074,8 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_module_flag" >&5 -printf "%s\n" "$ac_cv_fc_module_flag" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_module_flag" >&5 +printf '%s\n' "$ac_cv_fc_module_flag" >&6; } if test "$ac_cv_fc_module_flag" != unknown; then FC_MODINC=$ac_cv_fc_module_flag @@ -8027,7 +8089,7 @@ ac_empty="" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Fortran 90 module output flag" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking Fortran 90 module output flag" >&5 printf %s "checking Fortran 90 module output flag... " >&6; } if test ${ac_cv_fc_module_output_flag+y} then : @@ -8090,8 +8152,8 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_module_output_flag" >&5 -printf "%s\n" "$ac_cv_fc_module_output_flag" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_module_output_flag" >&5 +printf '%s\n' "$ac_cv_fc_module_output_flag" >&6; } if test x"$ac_cv_fc_module_output_flag" != xunknown then : FC_MODOUT=$ac_cv_fc_module_output_flag @@ -8127,7 +8189,7 @@ do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then - printf "%s\n" "#define $ac_item 1" >> confdefs.h + printf '%s\n' "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then @@ -8147,14 +8209,14 @@ done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : -printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h +printf '%s\n' "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "emmintrin.h" "ac_cv_header_emmintrin_h" "$ac_includes_default" if test "x$ac_cv_header_emmintrin_h" = xyes then : -printf "%s\n" "#define HAVE_EMMINTRIN 1" >>confdefs.h +printf '%s\n' "#define HAVE_EMMINTRIN 1" >>confdefs.h fi @@ -8162,7 +8224,7 @@ ac_fn_c_check_header_compile "$LINENO" "xmmintrin.h" "ac_cv_header_xmmintrin_h" if test "x$ac_cv_header_xmmintrin_h" = xyes then : -printf "%s\n" "#define HAVE_XMMINTRIN 1" >>confdefs.h +printf '%s\n' "#define HAVE_XMMINTRIN 1" >>confdefs.h fi @@ -8171,7 +8233,7 @@ ac_fn_c_check_header_compile "$LINENO" "err.h" "ac_cv_header_err_h" "$ac_include if test "x$ac_cv_header_err_h" = xyes then : -printf "%s\n" "#define HAVE_ERR 1" >>confdefs.h +printf '%s\n' "#define HAVE_ERR 1" >>confdefs.h fi @@ -8187,12 +8249,6 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu ### MPI ### - - - - - - ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -8207,7 +8263,7 @@ if test -z "$CXX"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : @@ -8228,7 +8284,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8240,11 +8296,11 @@ esac fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -printf "%s\n" "$CXX" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf '%s\n' "$CXX" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -8257,7 +8313,7 @@ if test -z "$CXX"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : @@ -8278,7 +8334,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8290,11 +8346,11 @@ esac fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -printf "%s\n" "$ac_ct_CXX" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf '%s\n' "$ac_ct_CXX" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -8306,8 +8362,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -8317,7 +8373,7 @@ fi fi fi # Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -8327,7 +8383,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -8337,11 +8393,11 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : @@ -8381,8 +8437,8 @@ ac_cv_cxx_compiler_gnu=$ac_compiler_gnu ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf '%s\n' "$ac_cv_cxx_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test $ac_compiler_gnu = yes; then @@ -8392,7 +8448,7 @@ else fi ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : @@ -8484,8 +8540,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf '%s\n' "$ac_cv_prog_cxx_g" >&6; } if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then @@ -8501,106 +8557,6 @@ else CXXFLAGS= fi fi -ac_prog_cxx_stdcxx=no -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 -printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx11+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_prog_cxx_cxx11=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx11_program -_ACEOF -for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx11" != "xno" && break -done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX ;; -esac -fi - -if test "x$ac_cv_prog_cxx_cxx11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else case e in #( - e) if test "x$ac_cv_prog_cxx_cxx11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx11" ;; -esac -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 - ac_prog_cxx_stdcxx=cxx11 ;; -esac -fi -fi -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 -printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx98+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_prog_cxx_cxx98=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx98_program -_ACEOF -for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx98=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx98" != "xno" && break -done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX ;; -esac -fi - -if test "x$ac_cv_prog_cxx_cxx98" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else case e in #( - e) if test "x$ac_cv_prog_cxx_cxx98" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx98" ;; -esac -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 - ac_prog_cxx_stdcxx=cxx98 ;; -esac -fi -fi - ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -8613,7 +8569,7 @@ ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 printf %s "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test ${ac_cv_prog_CXXCPP+y} @@ -8680,8 +8636,8 @@ fi else ac_cv_prog_CXXCPP=$CXXCPP fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -printf "%s\n" "$CXXCPP" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +printf '%s\n' "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do @@ -8729,8 +8685,8 @@ if $ac_preproc_ok then : else case e in #( - e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + e) { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac @@ -8746,7 +8702,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "$want_mpi" = yes then : - printf "%s\n" "## --- ## + printf '%s\n' "## --- ## ## MPI ## ## --- ##" # checks MPI include directory @@ -8802,7 +8758,7 @@ fi if test x"$want_adios" != xno then : - printf "%s\n" "## ----- ## + printf '%s\n' "## ----- ## ## ADIOS ## ## ----- ##" if test "$want_mpi" != yes; then @@ -8812,7 +8768,7 @@ then : # Extract the first word of "adios_config", so it can be a program name with args. set dummy adios_config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ADIOS_CONFIG+y} then : @@ -8835,7 +8791,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_ADIOS_CONFIG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8848,11 +8804,11 @@ esac fi ADIOS_CONFIG=$ac_cv_path_ADIOS_CONFIG if test -n "$ADIOS_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ADIOS_CONFIG" >&5 -printf "%s\n" "$ADIOS_CONFIG" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ADIOS_CONFIG" >&5 +printf '%s\n' "$ADIOS_CONFIG" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -8870,7 +8826,7 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu FCFLAGS_save="$FCFLAGS" LIBS_save="$LIBS" FC="$MPIFC" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ADIOS modules" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for ADIOS modules" >&5 printf %s "checking for ADIOS modules... " >&6; } ADIOS_FCFLAGS=`$ADIOS_CONFIG -c -f` FCFLAGS="$ADIOS_FCFLAGS $FCFLAGS" @@ -8887,20 +8843,20 @@ _ACEOF if ac_fn_fc_try_compile "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "ADIOS modules not found; is ADIOS built with Fortran support for this compiler?" "$LINENO" 5 ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ADIOS libraries" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for ADIOS libraries" >&5 printf %s "checking for ADIOS libraries... " >&6; } FCFLAGS="$ADIOS_FCFLAGS $FCFLAGS_save" ADIOS_LIBS=`$ADIOS_CONFIG -l -f` @@ -8915,13 +8871,13 @@ _ACEOF if ac_fn_fc_try_link "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "ADIOS libraries not found." "$LINENO" 5 ;; esac @@ -8951,7 +8907,7 @@ fi if test x"$want_adios2" != xno then : - printf "%s\n" "## ------ ## + printf '%s\n' "## ------ ## ## ADIOS2 ## ## ------ ##" if test "$want_mpi" != yes; then @@ -8963,7 +8919,7 @@ then : # Extract the first word of "adios2-config", so it can be a program name with args. set dummy adios2-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ADIOS2_CONFIG+y} then : @@ -8986,7 +8942,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_ADIOS2_CONFIG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8999,11 +8955,11 @@ esac fi ADIOS2_CONFIG=$ac_cv_path_ADIOS2_CONFIG if test -n "$ADIOS2_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ADIOS2_CONFIG" >&5 -printf "%s\n" "$ADIOS2_CONFIG" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ADIOS2_CONFIG" >&5 +printf '%s\n' "$ADIOS2_CONFIG" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -9021,7 +8977,7 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu FCFLAGS_save="$FCFLAGS" LIBS_save="$LIBS" FC="$MPIFC" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ADIOS2 modules" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for ADIOS2 modules" >&5 printf %s "checking for ADIOS2 modules... " >&6; } ADIOS2_FCFLAGS=`$ADIOS2_CONFIG --fortran-flags` FCFLAGS="$ADIOS2_FCFLAGS $FCFLAGS" @@ -9038,20 +8994,20 @@ _ACEOF if ac_fn_fc_try_compile "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "ADIOS2 modules not found; is ADIOS2 built with Fortran support for this compiler?" "$LINENO" 5 ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ADIOS2 libraries" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for ADIOS2 libraries" >&5 printf %s "checking for ADIOS2 libraries... " >&6; } FCFLAGS="$ADIOS2_FCFLAGS $FCFLAGS_save" ADIOS2_LIBS=`$ADIOS2_CONFIG --fortran-libs` @@ -9072,13 +9028,13 @@ _ACEOF if ac_fn_fc_try_link "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "ADIOS2 libraries not found." "$LINENO" 5 ;; esac @@ -9100,19 +9056,19 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu # for C file compilation - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ADIOS2 C flags and libs" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for ADIOS2 C flags and libs" >&5 printf %s "checking for ADIOS2 C flags and libs... " >&6; } if test x"$ADIOS2_CONFIG" != x then : ADIOS2_CFLAGS=`$ADIOS2_CONFIG --c-flags` ADIOS2_CLIBS=`$ADIOS2_CONFIG --c-libs` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 -printf "%s\n" "done" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf '%s\n' "done" >&6; } else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no adios2_config" >&5 -printf "%s\n" "no adios2_config" >&6; } ;; + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no adios2_config" >&5 +printf '%s\n' "no adios2_config" >&6; } ;; esac fi @@ -9130,7 +9086,7 @@ fi if test x"$want_asdf" != xno then : - printf "%s\n" "## ---- ## + printf '%s\n' "## ---- ## ## ASDF ## ## ---- ##" @@ -9140,7 +9096,7 @@ fi #mpbl: adding flags to config.h.in through autoheader in order to save them into the adios file. #configure_flags_str="FC=$FC FCFLAGS=$FCFLAGS $FLAGS_CHECK" #AC_DEFINE_UNQUOTED([CONFIGURE_FLAGS],["${configure_flags_str}"], -# [configuration flags to be saved in the adios output file.]) +# [configuration flags to be saved in the adios output file.]) CONFIGURE_FLAGS="FC=$FC FCFLAGS=$FCFLAGS" @@ -9154,7 +9110,7 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then @@ -9225,8 +9181,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -printf "%s\n" "$CPP" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf '%s\n' "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -9274,8 +9230,8 @@ if $ac_preproc_ok then : else case e in #( - e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + e) { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac @@ -9291,7 +9247,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test x"$want_cuda" != xno then : - printf "%s\n" "## ---- ## + printf '%s\n' "## ---- ## ## CUDA ## ## ---- ##" @@ -9314,7 +9270,7 @@ fi # checks if program in path # Extract the first word of "$NVCC", so it can be a program name with args. set dummy $NVCC; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_NVCC_PROG+y} then : @@ -9337,7 +9293,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_NVCC_PROG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9350,11 +9306,11 @@ esac fi NVCC_PROG=$ac_cv_path_NVCC_PROG if test -n "$NVCC_PROG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVCC_PROG" >&5 -printf "%s\n" "$NVCC_PROG" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $NVCC_PROG" >&5 +printf '%s\n' "$NVCC_PROG" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -9383,7 +9339,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Check for CUDA headers # runs test with nvcc - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cuda_runtime.h" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for cuda_runtime.h" >&5 printf %s "checking for cuda_runtime.h... " >&6; } ac_compile='$NVCC -c $CFLAGS conftest.$ac_ext >&5' cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9412,13 +9368,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "CUDA runtime header not found; try setting CUDA_INC." "$LINENO" 5 ;; esac @@ -9434,7 +9390,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext LIBS="$CUDA_LIBS $LIBS" # runs compilation test with nvcc - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking nvcc compilation with cudaMalloc in -lcudart" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking nvcc compilation with cudaMalloc in -lcudart" >&5 printf %s "checking nvcc compilation with cudaMalloc in -lcudart... " >&6; } ac_compile='$NVCC -c $CFLAGS conftest.$ac_ext >&5' cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9463,13 +9419,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "CUDA library function with nvcc compilation failed; try setting CUDA_INC." "$LINENO" 5 ;; esac @@ -9477,7 +9433,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # runs linking test with nvcc - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking nvcc linking with cudaMalloc in -lcudart" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking nvcc linking with cudaMalloc in -lcudart" >&5 printf %s "checking nvcc linking with cudaMalloc in -lcudart... " >&6; } ac_link='$NVCC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9504,11 +9460,11 @@ void* ptr = 0;cudaMalloc(&ptr, 1); _ACEOF if ac_fn_c_try_link "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "CUDA library linking with nvcc failed; try setting CUDA_LIB." "$LINENO" 5 ;; esac @@ -9517,7 +9473,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # runs linking test with standard compiler - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking linking with cudaMalloc in -lcudart" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking linking with cudaMalloc in -lcudart" >&5 printf %s "checking linking with cudaMalloc in -lcudart... " >&6; } # C compiler linking ac_link='$NVCC -c $CFLAGS conftest.$ac_ext >&5; $CC -o conftest$ac_exeext $LDFLAGS conftest.$ac_objext $LIBS >&5' @@ -9548,11 +9504,11 @@ void* ptr = 0;cudaMalloc(&ptr, 1); _ACEOF if ac_fn_c_try_link "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "CUDA library linking failed; try setting CUDA_LIB." "$LINENO" 5 ;; esac @@ -9581,7 +9537,7 @@ fi if test x"$want_hip" != xno then : - printf "%s\n" "## --- ## + printf '%s\n' "## --- ## ## HIP ## ## --- ##" # environment variables @@ -9595,8 +9551,8 @@ then : if test x"$HIPCC" = x then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using default hip compiler: \`hipcc\`" >&5 -printf "%s\n" "$as_me: using default hip compiler: \`hipcc\`" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: using default hip compiler: \`hipcc\`" >&5 +printf '%s\n' "$as_me: using default hip compiler: \`hipcc\`" >&6;} HIPCC=hipcc fi @@ -9605,7 +9561,7 @@ fi # checks if program in path # Extract the first word of "$HIPCC", so it can be a program name with args. set dummy $HIPCC; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_HIPCC_PROG+y} then : @@ -9628,7 +9584,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_HIPCC_PROG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9641,11 +9597,11 @@ esac fi HIPCC_PROG=$ac_cv_path_HIPCC_PROG if test -n "$HIPCC_PROG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HIPCC_PROG" >&5 -printf "%s\n" "$HIPCC_PROG" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $HIPCC_PROG" >&5 +printf '%s\n' "$HIPCC_PROG" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -9656,7 +9612,7 @@ fi # sets default HIP path # Extract the first word of "hipconfig", so it can be a program name with args. set dummy hipconfig; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_HIPCONFIG_PROG+y} then : @@ -9679,7 +9635,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_HIPCONFIG_PROG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9692,11 +9648,11 @@ esac fi HIPCONFIG_PROG=$ac_cv_path_HIPCONFIG_PROG if test -n "$HIPCONFIG_PROG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HIPCONFIG_PROG" >&5 -printf "%s\n" "$HIPCONFIG_PROG" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $HIPCONFIG_PROG" >&5 +printf '%s\n' "$HIPCONFIG_PROG" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -9705,7 +9661,7 @@ then : # Extract the first word of "hipconfig", so it can be a program name with args. set dummy hipconfig; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_HIPCONFIG_PROG+y} then : @@ -9728,7 +9684,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_HIPCONFIG_PROG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9742,11 +9698,11 @@ esac fi HIPCONFIG_PROG=$ac_cv_path_HIPCONFIG_PROG if test -n "$HIPCONFIG_PROG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HIPCONFIG_PROG" >&5 -printf "%s\n" "$HIPCONFIG_PROG" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $HIPCONFIG_PROG" >&5 +printf '%s\n' "$HIPCONFIG_PROG" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -9758,10 +9714,10 @@ then : HIP_PATH=`$HIPCONFIG_PROG --path` fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: hipconfig program: $HIPCONFIG_PROG" >&5 -printf "%s\n" "$as_me: hipconfig program: $HIPCONFIG_PROG" >&6;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: HIP path: $HIP_PATH" >&5 -printf "%s\n" "$as_me: HIP path: $HIP_PATH" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: hipconfig program: $HIPCONFIG_PROG" >&5 +printf '%s\n' "$as_me: hipconfig program: $HIPCONFIG_PROG" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: HIP path: $HIP_PATH" >&5 +printf '%s\n' "$as_me: HIP path: $HIP_PATH" >&6;} #AS_IF([test x"$HIP_INC" = x],[ # HIP_INC="${HIP_PATH}/include" @@ -9772,8 +9728,8 @@ printf "%s\n" "$as_me: HIP path: $HIP_PATH" >&6;} then : HIP_LIBS="-L${HIP_PATH}/lib" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: adding default HIP library path: ${HIP_LIBS}" >&5 -printf "%s\n" "$as_me: adding default HIP library path: ${HIP_LIBS}" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: adding default HIP library path: ${HIP_LIBS}" >&5 +printf '%s\n' "$as_me: adding default HIP library path: ${HIP_LIBS}" >&6;} fi @@ -9785,8 +9741,8 @@ then : if test x"$HIP_PLATFORM" = xnvidia then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: HIP PLATFORM NVIDIA detected." >&5 -printf "%s\n" "$as_me: HIP PLATFORM NVIDIA detected." >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: HIP PLATFORM NVIDIA detected." >&5 +printf '%s\n' "$as_me: HIP PLATFORM NVIDIA detected." >&6;} HIP_PLATFORM=nvidia FLAG_PLATFORM="${FC_DEFINE}__HIP_PLATFORM_NVIDIA__" @@ -9795,21 +9751,21 @@ fi if test x"$HIP_PLATFORM" = xamd then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: HIP PLATFORM AMD detected." >&5 -printf "%s\n" "$as_me: HIP PLATFORM AMD detected." >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: HIP PLATFORM AMD detected." >&5 +printf '%s\n' "$as_me: HIP PLATFORM AMD detected." >&6;} HIP_PLATFORM=amd FLAG_PLATFORM="${FC_DEFINE}__HIP_PLATFORM_AMD__" fi # compiler might require a platform selection flag case "${HIP_FLAGS}" in - *HIP_PLATFORM*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: hip flags contain platform specifier: ${HIP_FLAGS}" >&5 -printf "%s\n" "$as_me: hip flags contain platform specifier: ${HIP_FLAGS}" >&6;} ;; - *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: adding flag for platform specifier: ${FLAG_PLATFORM}" >&5 -printf "%s\n" "$as_me: adding flag for platform specifier: ${FLAG_PLATFORM}" >&6;}; + *HIP_PLATFORM*) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: hip flags contain platform specifier: ${HIP_FLAGS}" >&5 +printf '%s\n' "$as_me: hip flags contain platform specifier: ${HIP_FLAGS}" >&6;} ;; + *) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: adding flag for platform specifier: ${FLAG_PLATFORM}" >&5 +printf '%s\n' "$as_me: adding flag for platform specifier: ${FLAG_PLATFORM}" >&6;}; HIP_FLAGS="${HIP_FLAGS} ${FLAG_PLATFORM}" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: HIP_FLAGS: ${HIP_FLAGS}" >&5 -printf "%s\n" "$as_me: HIP_FLAGS: ${HIP_FLAGS}" >&6;} ;; + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: HIP_FLAGS: ${HIP_FLAGS}" >&5 +printf '%s\n' "$as_me: HIP_FLAGS: ${HIP_FLAGS}" >&6;} ;; esac fi @@ -9823,10 +9779,10 @@ fi # HIP_FLAGS="-fno-gpu-rdc" # compiler might require a -fPIC flag case "${HIP_FLAGS}" in - *fPIC*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: HIP flags contain position independent code flag -fPIC: ${HIP_FLAGS}" >&5 -printf "%s\n" "$as_me: HIP flags contain position independent code flag -fPIC: ${HIP_FLAGS}" >&6;};; - *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: consider adding compilation flag for position independent code: HIP_FLAGS=\"-fPIC\"" >&5 -printf "%s\n" "$as_me: consider adding compilation flag for position independent code: HIP_FLAGS=\"-fPIC\"" >&6;};; + *fPIC*) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: HIP flags contain position independent code flag -fPIC: ${HIP_FLAGS}" >&5 +printf '%s\n' "$as_me: HIP flags contain position independent code flag -fPIC: ${HIP_FLAGS}" >&6;};; + *) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: consider adding compilation flag for position independent code: HIP_FLAGS=\"-fPIC\"" >&5 +printf '%s\n' "$as_me: consider adding compilation flag for position independent code: HIP_FLAGS=\"-fPIC\"" >&6;};; esac # test include @@ -9855,10 +9811,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu HIP_CPPFLAGS="-I$HIP_INC" CFLAGS="$CFLAGS $HIP_CPPFLAGS" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using hip compilation flags: $CFLAGS" >&5 -printf "%s\n" "$as_me: using hip compilation flags: $CFLAGS" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: using hip compilation flags: $CFLAGS" >&5 +printf '%s\n' "$as_me: using hip compilation flags: $CFLAGS" >&6;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hip/hip_runtime.h" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for hip/hip_runtime.h" >&5 printf %s "checking for hip/hip_runtime.h... " >&6; } ac_compile='$HIPCC -c $CFLAGS conftest.$ac_ext >&5' cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9885,13 +9841,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "HIP runtime header not found; try setting HIP_INC." "$LINENO" 5 ;; esac @@ -9899,7 +9855,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # runs compilation test with hipcc - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hip compilation with hipMalloc" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for hip compilation with hipMalloc" >&5 printf %s "checking for hip compilation with hipMalloc... " >&6; } ac_compile='$HIPCC -c $CFLAGS conftest.$ac_ext >&5' cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9926,13 +9882,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "HIP library function with hipcc compilation failed; try setting HIP_FLAGS and HIP_INC." "$LINENO" 5 ;; esac @@ -9946,26 +9902,26 @@ then : HIP_PLATFORM=amd fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: HIP_PLATFORM: $HIP_PLATFORM" >&5 -printf "%s\n" "$as_me: HIP_PLATFORM: $HIP_PLATFORM" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: HIP_PLATFORM: $HIP_PLATFORM" >&5 +printf '%s\n' "$as_me: HIP_PLATFORM: $HIP_PLATFORM" >&6;} # linking library if test x"$HIP_PLATFORM" = xamd then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: adding default '-lamdhip64' linking for HIP platform AMD" >&5 -printf "%s\n" "$as_me: adding default '-lamdhip64' linking for HIP platform AMD" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: adding default '-lamdhip64' linking for HIP platform AMD" >&5 +printf '%s\n' "$as_me: adding default '-lamdhip64' linking for HIP platform AMD" >&6;} HIP_LIBS="-lamdhip64" fi # test lib LIBS="$HIP_LIBS $LIBS $LDFLAGS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using hip linking flags: $LIBS" >&5 -printf "%s\n" "$as_me: using hip linking flags: $LIBS" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: using hip linking flags: $LIBS" >&5 +printf '%s\n' "$as_me: using hip linking flags: $LIBS" >&6;} # runs linking test with hipcc - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hip linking with hipMalloc" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for hip linking with hipMalloc" >&5 printf %s "checking for hip linking with hipMalloc... " >&6; } ac_link='$HIPCC -o conftest$ac_exeext $CFLAGS conftest.$ac_ext $LIBS >&5' cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9994,13 +9950,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "HIP library linking with HIP failed; try setting HIP_LIBS and HIP_PLATFORM." "$LINENO" 5 ;; esac @@ -10052,6 +10008,15 @@ else fi +# CUDA-aware MPI setting +if test x"$want_cuda_aware_mpi" != xno +then : + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: enabling CUDA-aware MPI support" >&5 +printf '%s\n' "$as_me: enabling CUDA-aware MPI support" >&6;} + +fi + ### ### OpenMP ### @@ -10059,18 +10024,18 @@ fi if test x"$want_omp" != xno then : - printf "%s\n" "## ------ ## + printf '%s\n' "## ------ ## ## OpenMP ## ## ------ ##" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: OpenMP compilation is enabled" >&5 -printf "%s\n" "$as_me: OpenMP compilation is enabled" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: OpenMP compilation is enabled" >&5 +printf '%s\n' "$as_me: OpenMP compilation is enabled" >&6;} # openmp checking - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: OpenMP flag $OMP_FCFLAGS" >&5 -printf "%s\n" "$as_me: OpenMP flag $OMP_FCFLAGS" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: OpenMP flag $OMP_FCFLAGS" >&5 +printf '%s\n' "$as_me: OpenMP flag $OMP_FCFLAGS" >&6;} ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' @@ -10082,7 +10047,7 @@ cit_fc_save_fcflags=$FCFLAGS FC=$FC FCFLAGS="$FCFLAGS $OMP_FCFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether OpenMP directives work" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether OpenMP directives work" >&5 printf %s "checking whether OpenMP directives work... " >&6; } #AC_COMPILE_IFELSE(_CIT_FC_TRIVIAL_OPENMP_PROGRAM, [ @@ -10113,15 +10078,15 @@ _ACEOF if ac_fn_fc_try_link "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot link a trivial OpenMP program using $FC with flags: $OMP_FCFLAGS See 'config.log' for more details" "$LINENO" 5; } ;; @@ -10150,11 +10115,11 @@ fi if test x"$want_vec" != xno then : - printf "%s\n" "## ------------------- ## + printf '%s\n' "## ------------------- ## ## FORCE VECTORIZATION ## ## ------------------- ##" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: FORCE_VECTORIZATION is enabled" >&5 -printf "%s\n" "$as_me: FORCE_VECTORIZATION is enabled" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: FORCE_VECTORIZATION is enabled" >&5 +printf '%s\n' "$as_me: FORCE_VECTORIZATION is enabled" >&6;} FLAGS_CHECK="${FLAGS_CHECK} ${FC_DEFINE}FORCE_VECTORIZATION" CPPFLAGS="${CPPFLAGS} -DFORCE_VECTORIZATION" @@ -10168,7 +10133,7 @@ fi if test x"$want_vtk" != xno then : - printf "%s\n" "## --- ## + printf '%s\n' "## --- ## ## VTK ## ## --- ##" @@ -10244,8 +10209,8 @@ fi # [vtkFound="OK"]) # checks for common file: vtkVersion.h - as_ac_File=`printf "%s\n" "ac_cv_file_$VTK_PREFIX/include/vtk$vtk_suffix/vtkVersion.h" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $VTK_PREFIX/include/vtk$vtk_suffix/vtkVersion.h" >&5 + as_ac_File=`printf '%s\n' "ac_cv_file_$VTK_PREFIX/include/vtk$vtk_suffix/vtkVersion.h" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $VTK_PREFIX/include/vtk$vtk_suffix/vtkVersion.h" >&5 printf %s "checking for $VTK_PREFIX/include/vtk$vtk_suffix/vtkVersion.h... " >&6; } if eval test \${$as_ac_File+y} then : @@ -10261,27 +10226,27 @@ fi ;; esac fi eval ac_res=\$$as_ac_File - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes" then : vtkFound="OK" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if VTK is installed in $VTK_PREFIX" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking if VTK is installed in $VTK_PREFIX" >&5 printf %s "checking if VTK is installed in $VTK_PREFIX... " >&6; } if test -z "$vtkFound"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -10300,8 +10265,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # note: versions 6+ change library names maj=`echo $vtk_version | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` VTK_MAJOR=$maj - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: VTK version $vtk_version - major version number is $VTK_MAJOR" >&5 -printf "%s\n" "$as_me: VTK version $vtk_version - major version number is $VTK_MAJOR" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: VTK version $vtk_version - major version number is $VTK_MAJOR" >&5 +printf '%s\n' "$as_me: VTK version $vtk_version - major version number is $VTK_MAJOR" >&6;} VTK_LDFLAGS="" if test -d "$VTK_PREFIX/lib/vtk$vtk_suffix" ; then VTK_LDFLAGS+="-L$VTK_PREFIX/lib/vtk$vtk_suffix "; fi if test -d "$VTK_PREFIX/lib64/vtk$vtk_suffix" ; then VTK_LDFLAGS+="-L$VTK_PREFIX/lib64/vtk$vtk_suffix "; fi @@ -10313,8 +10278,8 @@ printf "%s\n" "$as_me: VTK version $vtk_version - major version number is $VTK_M CFLAGS="$VTK_CFLAGS $CFLAGS" CXXFLAGS="$VTK_CXXFLAGS $CXXFLAGS" LDFLAGS="$VTK_LDFLAGS $LDFLAGS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking with linker flags $LDFLAGS" >&5 -printf "%s\n" "$as_me: checking with linker flags $LDFLAGS" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking with linker flags $LDFLAGS" >&5 +printf '%s\n' "$as_me: checking with linker flags $LDFLAGS" >&6;} # tests common vtkIO library if test "${VTK_MAJOR}" -gt "5" ; then @@ -10324,11 +10289,11 @@ printf "%s\n" "$as_me: checking with linker flags $LDFLAGS" >&6;} # for vtk versions <= 5 lib_vtkIO=vtkIO fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking VTK library file: -l$lib_vtkIO" >&5 -printf "%s\n" "$as_me: checking VTK library file: -l$lib_vtkIO" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking VTK library file: -l$lib_vtkIO" >&5 +printf '%s\n' "$as_me: checking VTK library file: -l$lib_vtkIO" >&6;} found_vtk_lib=no - as_ac_Lib=`printf "%s\n" "ac_cv_lib_$lib_vtkIO""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -l$lib_vtkIO" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_$lib_vtkIO""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -l$lib_vtkIO" >&5 printf %s "checking for main in -l$lib_vtkIO... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -10369,18 +10334,18 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : found_vtk_lib=yes else case e in #( e) if test "x$VTK_LIBS" != "x" ; then LIBS="$LIBS -L$VTK_LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ... with LIBS: $LIBS" >&5 -printf "%s\n" "$as_me: ... with LIBS: $LIBS" >&6;} - as_ac_Lib=`printf "%s\n" "ac_cv_lib_$lib_vtkIO""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -l$lib_vtkIO" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: ... with LIBS: $LIBS" >&5 +printf '%s\n' "$as_me: ... with LIBS: $LIBS" >&6;} + as_ac_Lib=`printf '%s\n' "ac_cv_lib_$lib_vtkIO""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -l$lib_vtkIO" >&5 printf %s "checking for main in -l$lib_vtkIO... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -10421,8 +10386,8 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : found_vtk_lib=yes @@ -10431,8 +10396,8 @@ else case e in #( # checks name without suffix vtk_suffix="" lib_vtkIO=vtkIOCore$vtk_suffix - as_ac_Lib=`printf "%s\n" "ac_cv_lib_$lib_vtkIO""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -l$lib_vtkIO" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_$lib_vtkIO""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -l$lib_vtkIO" >&5 printf %s "checking for main in -l$lib_vtkIO... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -10473,8 +10438,8 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : found_vtk_lib=yes @@ -10505,8 +10470,8 @@ fi fi if test "${VTK_MAJOR}" -gt "5" ; then # version 6+ - as_ac_Lib=`printf "%s\n" "ac_cv_lib_vtkIOXML$vtk_suffix""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkIOXML$vtk_suffix" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_vtkIOXML$vtk_suffix""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkIOXML$vtk_suffix" >&5 printf %s "checking for main in -lvtkIOXML$vtk_suffix... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -10547,20 +10512,20 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIBvtkIOXML$vtk_suffix" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIBvtkIOXML$vtk_suffix" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-lvtkIOXML$vtk_suffix $LIBS" fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_vtkIOImage$vtk_suffix""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkIOImage$vtk_suffix" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_vtkIOImage$vtk_suffix""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkIOImage$vtk_suffix" >&5 printf %s "checking for main in -lvtkIOImage$vtk_suffix... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -10601,20 +10566,20 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIBvtkIOImage$vtk_suffix" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIBvtkIOImage$vtk_suffix" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-lvtkIOImage$vtk_suffix $LIBS" fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_vtkDICOMParser$vtk_suffix""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkDICOMParser$vtk_suffix" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_vtkDICOMParser$vtk_suffix""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkDICOMParser$vtk_suffix" >&5 printf %s "checking for main in -lvtkDICOMParser$vtk_suffix... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -10655,20 +10620,20 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIBvtkDICOMParser$vtk_suffix" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIBvtkDICOMParser$vtk_suffix" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-lvtkDICOMParser$vtk_suffix $LIBS" fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_vtkRenderingCore$vtk_suffix""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkRenderingCore$vtk_suffix" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_vtkRenderingCore$vtk_suffix""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkRenderingCore$vtk_suffix" >&5 printf %s "checking for main in -lvtkRenderingCore$vtk_suffix... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -10709,20 +10674,20 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIBvtkRenderingCore$vtk_suffix" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIBvtkRenderingCore$vtk_suffix" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-lvtkRenderingCore$vtk_suffix $LIBS" fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_vtkRenderingLabel$vtk_suffix""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkRenderingLabel$vtk_suffix" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_vtkRenderingLabel$vtk_suffix""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkRenderingLabel$vtk_suffix" >&5 printf %s "checking for main in -lvtkRenderingLabel$vtk_suffix... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -10763,20 +10728,20 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIBvtkRenderingLabel$vtk_suffix" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIBvtkRenderingLabel$vtk_suffix" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-lvtkRenderingLabel$vtk_suffix $LIBS" fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_vtkRenderingAnnotation$vtk_suffix""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkRenderingAnnotation$vtk_suffix" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_vtkRenderingAnnotation$vtk_suffix""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkRenderingAnnotation$vtk_suffix" >&5 printf %s "checking for main in -lvtkRenderingAnnotation$vtk_suffix... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -10817,20 +10782,20 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIBvtkRenderingAnnotation$vtk_suffix" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIBvtkRenderingAnnotation$vtk_suffix" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-lvtkRenderingAnnotation$vtk_suffix $LIBS" fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_vtkFiltersCore$vtk_suffix""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkFiltersCore$vtk_suffix" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_vtkFiltersCore$vtk_suffix""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkFiltersCore$vtk_suffix" >&5 printf %s "checking for main in -lvtkFiltersCore$vtk_suffix... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -10871,20 +10836,20 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIBvtkFiltersCore$vtk_suffix" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIBvtkFiltersCore$vtk_suffix" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-lvtkFiltersCore$vtk_suffix $LIBS" fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_vtkFiltersGeneric$vtk_suffix""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkFiltersGeneric$vtk_suffix" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_vtkFiltersGeneric$vtk_suffix""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkFiltersGeneric$vtk_suffix" >&5 printf %s "checking for main in -lvtkFiltersGeneric$vtk_suffix... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -10925,20 +10890,20 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIBvtkFiltersGeneric$vtk_suffix" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIBvtkFiltersGeneric$vtk_suffix" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-lvtkFiltersGeneric$vtk_suffix $LIBS" fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_vtkCommonCore$vtk_suffix""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkCommonCore$vtk_suffix" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_vtkCommonCore$vtk_suffix""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkCommonCore$vtk_suffix" >&5 printf %s "checking for main in -lvtkCommonCore$vtk_suffix... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -10979,20 +10944,20 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIBvtkCommonCore$vtk_suffix" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIBvtkCommonCore$vtk_suffix" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-lvtkCommonCore$vtk_suffix $LIBS" fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_vtkInteractionStyle$vtk_suffix""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkInteractionStyle$vtk_suffix" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_vtkInteractionStyle$vtk_suffix""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkInteractionStyle$vtk_suffix" >&5 printf %s "checking for main in -lvtkInteractionStyle$vtk_suffix... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -11033,20 +10998,20 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIBvtkInteractionStyle$vtk_suffix" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIBvtkInteractionStyle$vtk_suffix" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-lvtkInteractionStyle$vtk_suffix $LIBS" fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_vtkzlib$vtk_suffix""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkzlib$vtk_suffix" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_vtkzlib$vtk_suffix""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkzlib$vtk_suffix" >&5 printf %s "checking for main in -lvtkzlib$vtk_suffix... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -11087,20 +11052,20 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIBvtkzlib$vtk_suffix" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIBvtkzlib$vtk_suffix" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-lvtkzlib$vtk_suffix $LIBS" fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_vtkexpat$vtk_suffix""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkexpat$vtk_suffix" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_vtkexpat$vtk_suffix""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkexpat$vtk_suffix" >&5 printf %s "checking for main in -lvtkexpat$vtk_suffix... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -11141,20 +11106,20 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIBvtkexpat$vtk_suffix" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIBvtkexpat$vtk_suffix" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-lvtkexpat$vtk_suffix $LIBS" fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_vtksys$vtk_suffix""_main" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtksys$vtk_suffix" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_vtksys$vtk_suffix""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtksys$vtk_suffix" >&5 printf %s "checking for main in -lvtksys$vtk_suffix... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -11195,12 +11160,12 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIBvtksys$vtk_suffix" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIBvtksys$vtk_suffix" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-lvtksys$vtk_suffix $LIBS" @@ -11209,7 +11174,7 @@ fi else # version <= 5 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkDICOMParser" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkDICOMParser" >&5 printf %s "checking for main in -lvtkDICOMParser... " >&6; } if test ${ac_cv_lib_vtkDICOMParser_main+y} then : @@ -11249,17 +11214,17 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkDICOMParser_main" >&5 -printf "%s\n" "$ac_cv_lib_vtkDICOMParser_main" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkDICOMParser_main" >&5 +printf '%s\n' "$ac_cv_lib_vtkDICOMParser_main" >&6; } if test "x$ac_cv_lib_vtkDICOMParser_main" = xyes then : - printf "%s\n" "#define HAVE_LIBVTKDICOMPARSER 1" >>confdefs.h + printf '%s\n' "#define HAVE_LIBVTKDICOMPARSER 1" >>confdefs.h LIBS="-lvtkDICOMParser $LIBS" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkRendering" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkRendering" >&5 printf %s "checking for main in -lvtkRendering... " >&6; } if test ${ac_cv_lib_vtkRendering_main+y} then : @@ -11299,17 +11264,17 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkRendering_main" >&5 -printf "%s\n" "$ac_cv_lib_vtkRendering_main" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkRendering_main" >&5 +printf '%s\n' "$ac_cv_lib_vtkRendering_main" >&6; } if test "x$ac_cv_lib_vtkRendering_main" = xyes then : - printf "%s\n" "#define HAVE_LIBVTKRENDERING 1" >>confdefs.h + printf '%s\n' "#define HAVE_LIBVTKRENDERING 1" >>confdefs.h LIBS="-lvtkRendering $LIBS" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkGraphics" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkGraphics" >&5 printf %s "checking for main in -lvtkGraphics... " >&6; } if test ${ac_cv_lib_vtkGraphics_main+y} then : @@ -11349,17 +11314,17 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkGraphics_main" >&5 -printf "%s\n" "$ac_cv_lib_vtkGraphics_main" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkGraphics_main" >&5 +printf '%s\n' "$ac_cv_lib_vtkGraphics_main" >&6; } if test "x$ac_cv_lib_vtkGraphics_main" = xyes then : - printf "%s\n" "#define HAVE_LIBVTKGRAPHICS 1" >>confdefs.h + printf '%s\n' "#define HAVE_LIBVTKGRAPHICS 1" >>confdefs.h LIBS="-lvtkGraphics $LIBS" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkFiltering" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkFiltering" >&5 printf %s "checking for main in -lvtkFiltering... " >&6; } if test ${ac_cv_lib_vtkFiltering_main+y} then : @@ -11399,17 +11364,17 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkFiltering_main" >&5 -printf "%s\n" "$ac_cv_lib_vtkFiltering_main" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkFiltering_main" >&5 +printf '%s\n' "$ac_cv_lib_vtkFiltering_main" >&6; } if test "x$ac_cv_lib_vtkFiltering_main" = xyes then : - printf "%s\n" "#define HAVE_LIBVTKFILTERING 1" >>confdefs.h + printf '%s\n' "#define HAVE_LIBVTKFILTERING 1" >>confdefs.h LIBS="-lvtkFiltering $LIBS" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkGenericFiltering" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkGenericFiltering" >&5 printf %s "checking for main in -lvtkGenericFiltering... " >&6; } if test ${ac_cv_lib_vtkGenericFiltering_main+y} then : @@ -11449,17 +11414,17 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkGenericFiltering_main" >&5 -printf "%s\n" "$ac_cv_lib_vtkGenericFiltering_main" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkGenericFiltering_main" >&5 +printf '%s\n' "$ac_cv_lib_vtkGenericFiltering_main" >&6; } if test "x$ac_cv_lib_vtkGenericFiltering_main" = xyes then : - printf "%s\n" "#define HAVE_LIBVTKGENERICFILTERING 1" >>confdefs.h + printf '%s\n' "#define HAVE_LIBVTKGENERICFILTERING 1" >>confdefs.h LIBS="-lvtkGenericFiltering $LIBS" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkCommon" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkCommon" >&5 printf %s "checking for main in -lvtkCommon... " >&6; } if test ${ac_cv_lib_vtkCommon_main+y} then : @@ -11499,17 +11464,17 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkCommon_main" >&5 -printf "%s\n" "$ac_cv_lib_vtkCommon_main" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkCommon_main" >&5 +printf '%s\n' "$ac_cv_lib_vtkCommon_main" >&6; } if test "x$ac_cv_lib_vtkCommon_main" = xyes then : - printf "%s\n" "#define HAVE_LIBVTKCOMMON 1" >>confdefs.h + printf '%s\n' "#define HAVE_LIBVTKCOMMON 1" >>confdefs.h LIBS="-lvtkCommon $LIBS" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkzlib" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkzlib" >&5 printf %s "checking for main in -lvtkzlib... " >&6; } if test ${ac_cv_lib_vtkzlib_main+y} then : @@ -11549,17 +11514,17 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkzlib_main" >&5 -printf "%s\n" "$ac_cv_lib_vtkzlib_main" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkzlib_main" >&5 +printf '%s\n' "$ac_cv_lib_vtkzlib_main" >&6; } if test "x$ac_cv_lib_vtkzlib_main" = xyes then : - printf "%s\n" "#define HAVE_LIBVTKZLIB 1" >>confdefs.h + printf '%s\n' "#define HAVE_LIBVTKZLIB 1" >>confdefs.h LIBS="-lvtkzlib $LIBS" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkexpat" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtkexpat" >&5 printf %s "checking for main in -lvtkexpat... " >&6; } if test ${ac_cv_lib_vtkexpat_main+y} then : @@ -11599,17 +11564,17 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkexpat_main" >&5 -printf "%s\n" "$ac_cv_lib_vtkexpat_main" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtkexpat_main" >&5 +printf '%s\n' "$ac_cv_lib_vtkexpat_main" >&6; } if test "x$ac_cv_lib_vtkexpat_main" = xyes then : - printf "%s\n" "#define HAVE_LIBVTKEXPAT 1" >>confdefs.h + printf '%s\n' "#define HAVE_LIBVTKEXPAT 1" >>confdefs.h LIBS="-lvtkexpat $LIBS" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lvtksys" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lvtksys" >&5 printf %s "checking for main in -lvtksys... " >&6; } if test ${ac_cv_lib_vtksys_main+y} then : @@ -11649,21 +11614,21 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtksys_main" >&5 -printf "%s\n" "$ac_cv_lib_vtksys_main" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vtksys_main" >&5 +printf '%s\n' "$ac_cv_lib_vtksys_main" >&6; } if test "x$ac_cv_lib_vtksys_main" = xyes then : - printf "%s\n" "#define HAVE_LIBVTKSYS 1" >>confdefs.h + printf '%s\n' "#define HAVE_LIBVTKSYS 1" >>confdefs.h LIBS="-lvtksys $LIBS" fi fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking VTK library features in $lib_vtkIO" >&5 -printf "%s\n" "$as_me: checking VTK library features in $lib_vtkIO" >&6;} - as_ac_Lib=`printf "%s\n" "ac_cv_lib_$lib_vtkIO""_strcmp" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strcmp in -l$lib_vtkIO" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking VTK library features in $lib_vtkIO" >&5 +printf '%s\n' "$as_me: checking VTK library features in $lib_vtkIO" >&6;} + as_ac_Lib=`printf '%s\n' "ac_cv_lib_$lib_vtkIO""_strcmp" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for strcmp in -l$lib_vtkIO" >&5 printf %s "checking for strcmp in -l$lib_vtkIO... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -11713,12 +11678,12 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIB$lib_vtkIO" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIB$lib_vtkIO" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-l$lib_vtkIO $LIBS" @@ -11733,8 +11698,8 @@ else case e in #( # version <= 5 VTK_SUPPORT_LIBS="-lvtktiff -lvtkpng -lvtkjpeg -lvtkzlib -lvtkexpat" fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_$lib_vtkIO""_abort" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for abort in -l$lib_vtkIO" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_$lib_vtkIO""_abort" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for abort in -l$lib_vtkIO" >&5 printf %s "checking for abort in -l$lib_vtkIO... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -11784,12 +11749,12 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIB$lib_vtkIO" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIB$lib_vtkIO" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-l$lib_vtkIO $LIBS" @@ -11797,8 +11762,8 @@ _ACEOF else case e in #( e) VTK_SUPPORT_LIBS="-ltiff -lpng -ljpeg -lz -lexpat" - as_ac_Lib=`printf "%s\n" "ac_cv_lib_$lib_vtkIO""_exit" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for exit in -l$lib_vtkIO" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_$lib_vtkIO""_exit" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for exit in -l$lib_vtkIO" >&5 printf %s "checking for exit in -l$lib_vtkIO... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -11848,12 +11813,12 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIB$lib_vtkIO" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIB$lib_vtkIO" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-l$lib_vtkIO $LIBS" @@ -11861,8 +11826,8 @@ _ACEOF else case e in #( e) VTK_SUPPORT_LIBS="" - as_ac_Lib=`printf "%s\n" "ac_cv_lib_$lib_vtkIO""_strstr" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strstr in -l$lib_vtkIO" >&5 + as_ac_Lib=`printf '%s\n' "ac_cv_lib_$lib_vtkIO""_strstr" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for strstr in -l$lib_vtkIO" >&5 printf %s "checking for strstr in -l$lib_vtkIO... " >&6; } if eval test \${$as_ac_Lib+y} then : @@ -11912,12 +11877,12 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIB$lib_vtkIO" | sed "$as_sed_cpp"` 1 +#define `printf '%s\n' "HAVE_LIB$lib_vtkIO" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-l$lib_vtkIO $LIBS" @@ -11954,7 +11919,7 @@ fi maj=`echo | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` min=`echo | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` rel=`echo | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if VTK version is at least $maj.$min.$rel" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking if VTK version is at least $maj.$min.$rel" >&5 printf %s "checking if VTK version is at least $maj.$min.$rel... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12010,12 +11975,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext LIBS=$OLD_LIBS if test "$vtkVersion" = "OK"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -12037,7 +12002,7 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu -printf "%s\n" "#define HAVE_VTK /**/" >>confdefs.h +printf '%s\n' "#define HAVE_VTK /**/" >>confdefs.h fi # if [[ -z "$vtkFound" ]]; @@ -12054,14 +12019,15 @@ fi ### ### HDF5 ### + if test x"$want_hdf5" != xno then : - printf "%s\n" "## ---- ## + printf '%s\n' "## ---- ## ## HDF5 ## ## ---- ##" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: HDF5 is enabled" >&5 -printf "%s\n" "$as_me: HDF5 is enabled" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: HDF5 is enabled" >&5 +printf '%s\n' "$as_me: HDF5 is enabled" >&6;} @@ -12073,7 +12039,7 @@ ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HDF5 modules" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for HDF5 modules" >&5 printf %s "checking for HDF5 modules... " >&6; } FCFLAGS="$HDF5_FCFLAGS $FCFLAGS" # adds include directory @@ -12094,13 +12060,13 @@ _ACEOF if ac_fn_fc_try_compile "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "HDF5 module not found; is HDF5 built with Fortran support for this compiler?" "$LINENO" 5 ;; esac @@ -12118,12 +12084,13 @@ fi ## ## Git version info ## -printf "%s\n" "## ---------------- ## + +printf '%s\n' "## ---------------- ## ## git version info ## ## ---------------- ##" pushd $srcdir > /dev/null -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for .git/config" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for .git/config" >&5 printf %s "checking for .git/config... " >&6; } if test ${ac_cv_file__git_config+y} then : @@ -12138,8 +12105,8 @@ else fi ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__git_config" >&5 -printf "%s\n" "$ac_cv_file__git_config" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__git_config" >&5 +printf '%s\n' "$ac_cv_file__git_config" >&6; } if test "x$ac_cv_file__git_config" = xyes then : @@ -12162,40 +12129,40 @@ fi popd > /dev/null -printf "%s\n" "#define SPECFEM3D_RELEASE_VERSION $SPECFEM3D_RELEASE_VERSION" >>confdefs.h +printf '%s\n' "#define SPECFEM3D_RELEASE_VERSION $SPECFEM3D_RELEASE_VERSION" >>confdefs.h -printf "%s\n" "#define SPECFEM3D_GIT_REVISION \"$SPECFEM3D_GIT_REVISION\"" >>confdefs.h +printf '%s\n' "#define SPECFEM3D_GIT_REVISION \"$SPECFEM3D_GIT_REVISION\"" >>confdefs.h -printf "%s\n" "#define SPECFEM3D_GIT_HASH \"$SPECFEM3D_GIT_HASH\"" >>confdefs.h +printf '%s\n' "#define SPECFEM3D_GIT_HASH \"$SPECFEM3D_GIT_HASH\"" >>confdefs.h -printf "%s\n" "#define SPECFEM3D_GIT_DATE \"$SPECFEM3D_GIT_DATE\"" >>confdefs.h +printf '%s\n' "#define SPECFEM3D_GIT_DATE \"$SPECFEM3D_GIT_DATE\"" >>confdefs.h -printf "%s\n" "#define SPECFEM3D_GIT_BRANCH \"$SPECFEM3D_GIT_BRANCH\"" >>confdefs.h +printf '%s\n' "#define SPECFEM3D_GIT_BRANCH \"$SPECFEM3D_GIT_BRANCH\"" >>confdefs.h -printf "%s\n" "#define SPECFEM3D_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h +printf '%s\n' "#define SPECFEM3D_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -#AC_DEFINE_UNQUOTED([SPECFEM3D_DOI], ["10.5281/zenodo.xxxxx"], [Define SPECFEM3D doi]) +#AC_DEFINE_UNQUOTED([SPECFEM3D_DOI], ["10.5281/zenodo.xxxxx"], [Define SPECFEM3D Cartesian doi]) if test x"$SPECFEM3D_RELEASE_VERSION" = x0 then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: building from git repository" >&5 -printf "%s\n" "$as_me: building from git repository" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: building from git repository" >&5 +printf '%s\n' "$as_me: building from git repository" >&6;} GIT_PACKAGE_VERSION=$SPECFEM3D_GIT_REVISION GIT_COMMIT_VERSION=$SPECFEM3D_GIT_HASH GIT_DATE_VERSION=$SPECFEM3D_GIT_DATE else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not a git repository" >&5 -printf "%s\n" "$as_me: not a git repository" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: not a git repository" >&5 +printf '%s\n' "$as_me: not a git repository" >&6;} GIT_PACKAGE_VERSION=$PACKAGE_VERSION GIT_COMMIT_VERSION="unknown" GIT_DATE_VERSION="unknown" @@ -12208,7 +12175,7 @@ fi ############################################################ -printf "%s\n" "## ----------------------------------- ## +printf '%s\n' "## ----------------------------------- ## ## setting up default simulation setup ## ## ----------------------------------- ##" @@ -12252,44 +12219,7 @@ cat >confcache <<\_ACEOF _ACEOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # 'set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # 'set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | +ac_cache_dump | sed ' /^ac_cv_env_/b end t clear @@ -12301,8 +12231,8 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf '%s\n' "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -12316,8 +12246,8 @@ printf "%s\n" "$as_me: updating cache $cache_file" >&6;} fi fi else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf '%s\n' "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -12334,7 +12264,7 @@ U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + ac_i=`printf '%s\n' "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -12405,6 +12335,10 @@ if test -z "${COND_CUDA_PLUS_TRUE}" && test -z "${COND_CUDA_PLUS_FALSE}"; then as_fn_error $? "conditional \"COND_CUDA_PLUS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${COND_CUDA_AWARE_MPI_TRUE}" && test -z "${COND_CUDA_AWARE_MPI_FALSE}"; then + as_fn_error $? "conditional \"COND_CUDA_AWARE_MPI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${COND_HIP_TRUE}" && test -z "${COND_HIP_FALSE}"; then as_fn_error $? "conditional \"COND_HIP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -12525,13 +12459,21 @@ Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" +case $CONFIG_STATUS in #( + -*) : + CONFIG_STATUS=./$CONFIG_STATUS ;; #( + */*) : + ;; #( + *) : + CONFIG_STATUS=./$CONFIG_STATUS ;; +esac + ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +ac_clean_CONFIG_STATUS='"$CONFIG_STATUS"' +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf '%s\n' "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +cat >"$CONFIG_STATUS" <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -12545,7 +12487,7 @@ ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## @@ -12557,7 +12499,7 @@ then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. + # contradicts POSIX and common usage. Disable this. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( @@ -12644,7 +12586,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf '%s\n' "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi @@ -12660,9 +12602,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - printf "%s\n" "$as_me: error: $2" >&2 + printf '%s\n' "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -12757,7 +12699,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | +printf '%s\n' X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -12779,29 +12721,6 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -12843,7 +12762,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf '%s\n' "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -12852,7 +12771,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | +printf '%s\n' X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -12905,19 +12824,19 @@ as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## +## ------------------------------------- ## +## Main body of "$CONFIG_STATUS" script. ## +## ------------------------------------- ## _ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 +test $as_write_fail = 0 && chmod +x "$CONFIG_STATUS" || ac_write_fail=1 -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by SPECFEM3D Cartesian $as_me 4.1.1, which was -generated by GNU Autoconf 2.72. Invocation command line was +generated by GNU Autoconf 2.73. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -12939,7 +12858,7 @@ case $ac_config_headers in *" esac -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" @@ -12947,7 +12866,7 @@ config_commands="$ac_config_commands" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ '$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files @@ -12979,25 +12898,29 @@ $config_commands Report bugs to ." _ACEOF -ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` -ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config=`printf '%s\n' "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf '%s\n' "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ SPECFEM3D Cartesian config.status 4.1.1 -configured by $0, generated by GNU Autoconf 2.72, +configured by $0, generated by GNU Autoconf 2.73, with options \\"\$ac_cs_config\\" -Copyright (C) 2023 Free Software Foundation, Inc. +Copyright (C) 2026 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' -test -n "\$AWK" || AWK=awk +test -n "\$AWK" || { + awk '' >$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 @@ -13025,15 +12948,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - printf "%s\n" "$ac_cs_version"; exit ;; + printf '%s\n' "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - printf "%s\n" "$ac_cs_config"; exit ;; + printf '%s\n' "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf '%s\n' "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -13041,7 +12964,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf '%s\n' "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -13050,7 +12973,7 @@ do as_fn_error $? "ambiguous option: '$1' Try '$0 --help' for more information.";; --help | --hel | -h ) - printf "%s\n" "$ac_cs_usage"; exit ;; + printf '%s\n' "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -13074,32 +12997,32 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf '%s\n' "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - printf "%s\n" "$ac_log" + printf '%s\n' "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -13194,13 +13117,13 @@ _ACEOF echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim_num=`echo "$ac_subst_vars" | sed -n '$='` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | sed -n '$='` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then @@ -13211,7 +13134,7 @@ for ac_last_try in false false false false false :; do done rm -f conf$$subs.sh -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' @@ -13256,9 +13179,9 @@ t delim N s/\n// } -' >>$CONFIG_STATUS || ac_write_fail=1 +' >>"$CONFIG_STATUS" || ac_write_fail=1 rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 @@ -13287,7 +13210,7 @@ cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && _ACAWK _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else @@ -13319,7 +13242,7 @@ s/^[^=]*=[ ]*$// }' fi -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. @@ -13390,9 +13313,9 @@ s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 +"/g' >>"$CONFIG_STATUS" || ac_write_fail=1 -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } @@ -13410,8 +13333,12 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { + suffix = P[macro] D[macro] + while (suffix ~ /[\t ]$/) { + suffix = substr(suffix, 1, length(suffix) - 1) + } # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] + print prefix "define", macro suffix next } else { # Replace #undef with comments. This is necessary, for example, @@ -13426,7 +13353,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 { print } _ACAWK _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -13470,7 +13397,7 @@ do esac || as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf '%s\n' "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -13478,17 +13405,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf '%s\n' "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -printf "%s\n" "$as_me: creating $ac_file" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf '%s\n' "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`printf "%s\n" "$configure_input" | + ac_sed_conf_input=`printf '%s\n' "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -13505,7 +13432,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$ac_file" | +printf '%s\n' X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -13529,9 +13456,9 @@ printf "%s\n" X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf '%s\n' "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf '%s\n' "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -13567,7 +13494,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= @@ -13584,10 +13511,10 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf '%s\n' "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -13601,11 +13528,11 @@ _ACEOF # Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t @@ -13627,9 +13554,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' +printf '%s\n' "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -13645,27 +13572,27 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - printf "%s\n" "/* $configure_input */" >&1 \ + printf '%s\n' "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf '%s\n' "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - printf "%s\n" "/* $configure_input */" >&1 \ + printf '%s\n' "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; - :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + :C) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf '%s\n' "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -13683,7 +13610,7 @@ done # for ac_tag as_fn_exit 0 _ACEOF -ac_clean_files=$ac_clean_files_save +ac_clean_CONFIG_STATUS= test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 @@ -13699,19 +13626,26 @@ test $ac_write_fail = 0 || # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: + case $CONFIG_STATUS in #( + -*) : + ac_no_opts=-- ;; #( + *) : + ac_no_opts= ;; +esac ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + $SHELL $ac_no_opts "$CONFIG_STATUS" $ac_config_status_args || + ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf '%s\n' "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi @@ -13720,26 +13654,26 @@ fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 -printf "%s\n" "" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf '%s\n' "" >&6; } sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## $PACKAGE_NAME $PACKAGE_VERSION ## _ASBOX -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 -printf "%s\n" "" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $0 has completed and set up a default configuration to build." >&5 -printf "%s\n" "$0 has completed and set up a default configuration to build." >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 -printf "%s\n" "" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: You may wish to modify the following files before running a simulation:" >&5 -printf "%s\n" "You may wish to modify the following files before running a simulation:" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: DATA/Par_file Set parameters affecting the simulation." >&5 -printf "%s\n" " DATA/Par_file Set parameters affecting the simulation." >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: DATA/CMTSOLUTION Set the source parameters before running the solver." >&5 -printf "%s\n" " DATA/CMTSOLUTION Set the source parameters before running the solver." >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: DATA/STATIONS Set the receiver stations before running the solver." >&5 -printf "%s\n" " DATA/STATIONS Set the receiver stations before running the solver." >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 -printf "%s\n" "" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf '%s\n' "" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $0 has completed and set up a default configuration to build." >&5 +printf '%s\n' "$0 has completed and set up a default configuration to build." >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf '%s\n' "" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: You may wish to modify the following files before running a simulation:" >&5 +printf '%s\n' "You may wish to modify the following files before running a simulation:" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: DATA/Par_file Set parameters affecting the simulation." >&5 +printf '%s\n' " DATA/Par_file Set parameters affecting the simulation." >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: DATA/CMTSOLUTION Set the source parameters before running the solver." >&5 +printf '%s\n' " DATA/CMTSOLUTION Set the source parameters before running the solver." >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: DATA/STATIONS Set the receiver stations before running the solver." >&5 +printf '%s\n' " DATA/STATIONS Set the receiver stations before running the solver." >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf '%s\n' "" >&6; } diff --git a/configure.ac b/configure.ac index cd3f6df84..c0a3a729f 100644 --- a/configure.ac +++ b/configure.ac @@ -13,8 +13,8 @@ dnl ############################################################ -AC_PREREQ(2.61) -AC_INIT([SPECFEM3D Cartesian], m4_normalize(m4_include([VERSION])), [see the wiki], [Specfem3D]) +AC_PREREQ([2.72]) +AC_INIT([SPECFEM3D Cartesian],[m4_normalize(m4_include(VERSION))],[see the wiki],[Specfem3DCartesian]) AC_CONFIG_SRCDIR([src/specfem3D/specfem3D.F90]) AC_CONFIG_HEADERS([setup/config.h]) @@ -135,6 +135,21 @@ AM_CONDITIONAL([COND_CUDA_PLUS], -o "$want_cuda" = cuda13 \] ) +# CUDA-aware MPI setting +AC_ARG_ENABLE([cuda-aware-mpi], + [AS_HELP_STRING([--enable-cuda-aware-mpi], + [build CUDA-aware MPI enabled version @<:@default=no@:>@])], + [enable_cuda_aware_mpi="$enableval"], + [enable_cuda_aware_mpi=no]) +AC_ARG_WITH([cuda-aware-mpi], + [AS_HELP_STRING([--with-cuda-aware-mpi], + [build CUDA-aware MPI enabled version @<:@default=no@:>@])], + [with_cuda_aware_mpi="$withval"], + [with_cuda_aware_mpi=no]) +AS_IF([test x"$enable_cuda_aware_mpi" != xno || test x"$with_cuda_aware_mpi" != xno], + [want_cuda_aware_mpi=yes],[want_cuda_aware_mpi=no]) +AM_CONDITIONAL([COND_CUDA_AWARE_MPI], [test x"$want_cuda_aware_mpi" != xno]) + ## HIP AC_ARG_WITH([hip], [AS_HELP_STRING([--with-hip], [build HIP GPU enabled version @<:@default=no@:>@])], @@ -524,7 +539,7 @@ AS_IF([test x"$want_asdf" != xno], [ #mpbl: adding flags to config.h.in through autoheader in order to save them into the adios file. #configure_flags_str="FC=$FC FCFLAGS=$FCFLAGS $FLAGS_CHECK" #AC_DEFINE_UNQUOTED([CONFIGURE_FLAGS],["${configure_flags_str}"], -# [configuration flags to be saved in the adios output file.]) +# [configuration flags to be saved in the adios output file.]) CONFIGURE_FLAGS="FC=$FC FCFLAGS=$FCFLAGS" AC_SUBST([CONFIGURE_FLAGS]) @@ -709,6 +724,11 @@ AM_CONDITIONAL([COND_HIP_PLATFORM_AMD], [test x"$HIP_PLATFORM" = xamd]) AM_CONDITIONAL([COND_HIP_PLATFORM_NVIDIA], [test x"$HIP_PLATFORM" = xnvidia]) AM_CONDITIONAL([COND_HIP_PLATFORM_CPU], [test x"$HIP_PLATFORM" = xcpu]) +# CUDA-aware MPI setting +AS_IF([test x"$want_cuda_aware_mpi" != xno], [ + AC_MSG_NOTICE([enabling CUDA-aware MPI support]) +]) + ### ### OpenMP ### @@ -750,6 +770,7 @@ AS_IF([test x"$want_vtk" != xno], [ ### ### HDF5 ### + AS_IF([test x"$want_hdf5" != xno], [ AS_BOX([HDF5]) AC_MSG_NOTICE([HDF5 is enabled]) @@ -785,11 +806,12 @@ AS_IF([test x"$want_hdf5" != xno], [ ## ## Git version info ## + AS_BOX([git version info]) CIG_PKG_GIT(SPECFEM3D) -AC_DEFINE_UNQUOTED([SPECFEM3D_VERSION], ["$PACKAGE_VERSION"], [Define SPECFEM3D version]) -#AC_DEFINE_UNQUOTED([SPECFEM3D_DOI], ["10.5281/zenodo.xxxxx"], [Define SPECFEM3D doi]) +AC_DEFINE_UNQUOTED([SPECFEM3D_VERSION], ["$PACKAGE_VERSION"], [Define SPECFEM3D Cartesian version]) +#AC_DEFINE_UNQUOTED([SPECFEM3D_DOI], ["10.5281/zenodo.xxxxx"], [Define SPECFEM3D Cartesian doi]) AS_IF([test x"$SPECFEM3D_RELEASE_VERSION" = x0],[ AC_MSG_NOTICE([building from git repository]) diff --git a/doc/USER_MANUAL/04_creating_databases.tex b/doc/USER_MANUAL/04_creating_databases.tex index 9392ef0ee..7d287622e 100644 --- a/doc/USER_MANUAL/04_creating_databases.tex +++ b/doc/USER_MANUAL/04_creating_databases.tex @@ -45,30 +45,37 @@ \section{Main parameter file \texttt{Par\_file}}\label{cha:Main-Parameter} \item [{\texttt{SIMULATION\_TYPE}}] is set to 1 for forward simulations, 2 for adjoint simulations (see Section \ref{sec:Adjoint-simulation-finite}) and 3 for kernel simulations (see Section \ref{sec:Finite-Frequency-Kernels}). +% \item [{\texttt{SAVE\_FORWARD}}] is only set to \texttt{.true.} for a forward simulation with the last frame of the simulation saved, as part of the finite-frequency kernel calculations (see Section \ref{sec:Finite-Frequency-Kernels}). For a regular forward simulation, leave \texttt{SIMULATION\_TYPE} and \texttt{SAVE\_FORWARD} at their default values. +% \item [{\texttt{UTM\_PROJECTION\_ZONE}}] UTM projection zone in which your model resides, only valid when \texttt{SUPPRESS\_UTM\_PROJECTION} is \texttt{.false.}. +% \item [{\texttt{SUPPRESS\_UTM\_PROJECTION}}] set to be \texttt{.false.} when your model range is specified in the geographical coordinates, and needs to be \texttt{.true.} when your model is specified in a cartesian coordinates. \noun{UTM projection zone in which your simulation region resides.} +% \item [{\texttt{NPROC}}] The number of MPI processors, each one is assigned one slice of the whole mesh. +% \item [{\texttt{NSTEP}}] The number of time steps of the simulation. This controls the length of the numerical simulation, i.e., twice the number of time steps requires twice as much CPU time. This feature is not used at the time of generating the distributed databases but is required for the solver, i.e., you may change this parameter after running \texttt{xgenerate\_databases}. +% \item [{\texttt{DT}}] The length of each time step in seconds. This feature is not used at the time of generating the distributed databases but is required for the solver. Please see also Section~\ref{sec:Choosing-the-Time-Step} for further details. +% \item [{\texttt{LTS\_MODE}}] Turning this flag on will use a local-time stepping scheme for the Newmark time scheme \citep{Rietmann2015,Rietmann2016}. It will re-distribute the mesh partitioning to balance out elements with similar local-time step sizes. This feature can help improve the time-to-solution when the mesh contains elements of various sizes, @@ -86,6 +93,7 @@ \section{Main parameter file \texttt{Par\_file}}\label{cha:Main-Parameter} support HEX27 elements either (it can generate them, but they are flat, i.e. identical to HEX8). To generate HEX27 elements with curvature properly taken into account, you can use Gmsh \url{http://gmsh.info} +% \item [{\texttt{MODEL}}] Must be set to one of the following: \begin{description} @@ -157,11 +165,13 @@ \section{Main parameter file \texttt{Par\_file}}\label{cha:Main-Parameter} at short periods, then set this flag to \texttt{.false.} and mesh the fluid layer explicitly in your mesher, so that it is computed accurately and without this approximation. +% \item [{\texttt{TOPOGRAPHY}}] This feature is only effective if \texttt{APPROXIMATE\_OCEAN\_LOAD} is set to \texttt{.true.}. Set to \texttt{.true.} if topography and bathymetry should be read in based upon the topography file specified in the main constants file \texttt{setup/constants.h} to evaluate elevations. If not set, elevations will be read from the numerical mesh. +% \item [{\texttt{ATTENUATION}}] Set to \texttt{.true.} if attenuation should be incorporated. Turning this feature on increases the memory requirements significantly (roughly by a factor of~1.5), and is numerically fairly @@ -176,18 +186,27 @@ \section{Main parameter file \texttt{Par\_file}}\label{cha:Main-Parameter} To convert one to the other see \texttt{doc/note\_on\_Qkappa\_versus\_Qp.pdf} and in folder \texttt{utils/small\_utilities/attenuation}, the tool \texttt{conversion\_from\_Qkappa\_Qmu\_to\_Qp\_Qs\_from\_Dahlen\_Tromp\_959\_960.f90}. - +% \item [{\texttt{ANISOTROPY}}] Set to \texttt{.true.} if you want to use an anisotropy model. Please see the file \texttt{model\_aniso.f90} in subdirectory \texttt{src/generate\_databases/} for the current implementation of anisotropic models. +% +\item [{\texttt{GRAVITY}}] Set to \texttt{.true.} if self-gravitation should +be incorporated in the Cowling approximation \citep{KoTr02b,DaTr98}. +Turning this feature on is relatively inexpensive, both from the perspective +of memory requirements as well as in terms of computational speed. +The gravitational acceleration is assumed to be constant and acts in vertical direction (z-axis). +% \item [{\texttt{TOMOGRAPHY\_PATH}}] Directory in which the tomography files are stored for using external tomographic Earth models (please read Chapter \ref{cha:-Changing-the} and Section \ref{sec:Using-tomographic} `Using external tomographic Earth models' for further details.). +% \item [{\texttt{USE\_OLSEN\_ATTENUATION}}] Set to \texttt{.true.} if you want to use the attenuation model that scaled from the S-wave speed model using Olsen's empirical relation (see \citet{OlDaBr03}). +% \item [{\texttt{OLSEN\_ATTENUATION\_RATIO}}] Determines the Olsen's constant in Olsen's empirical relation (see \citet{OlDaBr03}). \end{description} @@ -197,9 +216,11 @@ \section{Main parameter file \texttt{Par\_file}}\label{cha:Main-Parameter} \begin{description} \item [{\texttt{PML\_CONDITIONS}}] Set to \texttt{.true.} to turn on C-PML boundary conditions for a regional simulation. Both fluids and elastic solids are supported. +% \item [{\texttt{PML\_INSTEAD\_OF\_FREE\_SURFACE}}] Set to \texttt{.true.} to turn on C-PML boundary conditions on the top surface instead of the usual free surface. +% \item [{\texttt{f0\_FOR\_PML}}] Determines the dominant frequency that will be used in the calculation of PML damping profiles; \red{This should be set to the same (or similar) dominant frequency as that of the @@ -207,13 +228,16 @@ \section{Main parameter file \texttt{Par\_file}}\label{cha:Main-Parameter} absorbing conditions can become unstable.} If you plan to use a Dirac source, then use the dominant frequency of the source wavelet with which you plan to convolve your seismograms later on in post-processing. +% \item [{\texttt{STACEY\_ABSORBING\_CONDITIONS}}] Set to \texttt{.true.} to turn on Clayton-Engquist absorbing boundary conditions (see \citet{KoTr99}). In almost all cases it is much better to use CPML absorbing layers (see the options above) and leave this flag to \texttt{.false.}. +% \item [{\texttt{STACEY\_INSTEAD\_OF\_FREE\_SURFACE}}] Set to \texttt{.true.} to turn on absorbing boundary conditions on the top surface which by default constitutes a free surface of the model. +% \item [{\texttt{BOTTOM\_FREE\_SURFACE}}] When STACEY\_ABSORBING\_CONDITIONS is set to .true. : absorbing conditions are defined in xmin, xmax, ymin, ymax and zmin @@ -228,47 +252,57 @@ \section{Main parameter file \texttt{Par\_file}}\label{cha:Main-Parameter} create a ShakeMap\textregistered{}, e.g., a peak ground velocity map of the maximum absolute value of the two horizontal components of the velocity vector. +% \item [{\texttt{MOVIE\_SURFACE}}] Set to \texttt{.false.}, unless you want to create a movie of seismic wave propagation on the Earth's surface. Turning this option on generates large output files. See Section~\ref{sec:Movies} for a discussion on the generation of movies. This feature is only relevant for the solver. +% \item [{\texttt{MOVIE\_TYPE}}] Set this flag to 1 to show the top surface (tomography + oceans) only, to 2 to show all external faces of the mesh (i.e. topography + vertical edges + bottom) in shakemaps and surface movies. +% \item [{\texttt{MOVIE\_VOLUME}}] Set to \texttt{.false.}, unless you want to create a movie of seismic wave propagation in the Earth's interior. Turning this option on generates huge output files. See Section~\ref{sec:Movies} for a discussion on the generation of movies. This feature is only relevant for the solver. +% \item [{\texttt{SAVE\_DISPLACEMENT}}] Set this flag to \texttt{.true.} if you want to save the displacement instead of velocity for the movie frames. +% \item [{\texttt{MOVIE\_VOLUME\_STRESS}}] Set this flag to \texttt{.true.} if you want to save the stress tensor for the volume movie. To activate this option, \texttt{MOVIE\_VOLUME} must be \texttt{.true.}. Please note that this option will generate huge outputs, because it will save six independent stress tensor components in the entire volume. This option is currently implemented only for the viscoelastic simulations. +% \item [{\texttt{USE\_HIGHRES\_FOR\_MOVIES}}] Set this flag to \texttt{.true.} if you want to save the values at all the NGLL grid points for the movie frames. +% \item [{\texttt{NTSTEP\_BETWEEN\_FRAMES}}] Determines the number of timesteps between movie frames. Typically you want to save a snapshot every 100 timesteps. The smaller you make this number the more output will be generated! See Section~\ref{sec:Movies} for a discussion on the generation of movies. This feature is only relevant for the solver. +% \item [{\texttt{HDUR\_MOVIE}}] Determines the half duration of the source time function for the movie simulations. When this parameter is set to be 0, a default half duration that corresponds to the accuracy of the simulation is provided. Otherwise, it adds this half duration to the half duration specified in the source file \texttt{CMTSOLUTION}, thus simulates longer periods to make the movie images look smoother. +% \item [{\texttt{SAVE\_MESH\_FILES}}] Set this flag to \texttt{.true.} to save \href{www.paraview.org}{ParaView} mesh files for subsequent viewing. Turning the flag on generates large (distributed) files in the \texttt{LOCAL\_PATH} directory. See Section~\ref{sec:Mesh-graphics} for a discussion of mesh viewing features. +% \item [{\texttt{LOCAL\_PATH}}] Directory in which the distributed databases will be written. Generally one uses a directory on the local disk of the compute nodes, although on some machines these databases are @@ -283,6 +317,7 @@ \section{Main parameter file \texttt{Par\_file}}\label{cha:Main-Parameter} Please note that the \texttt{LOCAL\_PATH} directory should already contain the output files of the partitioner, i.e. from \texttt{xdecompose\_mesh} or \texttt{xmeshfem3D}. +% \item [{\texttt{NTSTEP\_BETWEEN\_OUTPUT\_INFO}}] This parameter specifies the interval at which basic information about a run is written to the file system (\texttt{timestamp{*}} files in the \texttt{OUTPUT\_FILES} @@ -315,6 +350,7 @@ \section{Main parameter file \texttt{Par\_file}}\label{cha:Main-Parameter} When using this option, by default the code can locate the force source anywhere between mesh points in order to honor its exact location; this is more precise than using the closest GLL mesh point, but it is also a bit slower. +% \item [{\texttt{USE\_RICKER\_TIME\_FUNCTION}}] Turn this flag on to use a Ricker source-time function, i.e., the second derivative of a Gaussian, instead of the source-time functions set by default to represent a (tilted) \texttt{FORCESOLUTION} force @@ -340,6 +376,7 @@ \section{Main parameter file \texttt{Par\_file}}\label{cha:Main-Parameter} the fluid. Otherwise, if a \texttt{FORCESOLUTION} force source is used, a (pseudo) Dirac delta source-time function is defined by default. Any other source-time function may then be obtained by convolution. +% \item [{\texttt{PRINT\_SOURCE\_TIME\_FUNCTION}}] Turn this flag on to print information about the source-time function in the file \texttt{OUTPUT\_FILES/plot\_source\_time\_function.txt}. This feature is only relevant for the solver. @@ -356,7 +393,7 @@ \section{Main parameter file \texttt{Par\_file}}\label{cha:Main-Parameter} \texttt{NTSTEP\_BETWEEN\_OUTPUT\_SEISMOS} to a relatively high value to avoid writing to the seismograms too often. This feature is only relevant for the solver. - +% \item [{\texttt{NUMBER\_OF\_SIMULTANEOUS\_RUNS}}] adds the ability to run several calculations (several earthquakes) in an embarrassingly-parallel fashion from within the same run; this can be useful when using a very large supercomputer to compute @@ -423,16 +460,22 @@ \section{Main parameter file \texttt{Par\_file}}\label{cha:Main-Parameter} %% ADIOS \item [\texttt{ADIOS\_ENABLED}] Turn this flag on to enable ADIOS. If set to \texttt{.false.}, subsequent ADIOS parameters will not be considered. +% \item [\texttt{ADIOS\_FOR\_DATABASES}] Turn this flag on to use ADIOS for xmeshfem3D output and xgenerate\_database input. +% \item [\texttt{ADIOS\_FOR\_MESH}] Turn this flag on to use ADIOS for generated databases. +% \item [\texttt{ADIOS\_FOR\_FORWARD\_ARRAYS}] Turn this flag on to read and write forward arrays using ADIOS. +% \item [\texttt{ADIOS\_FOR\_KERNELS}] Turn this flag on to produce ADIOS kernels that can later be visualized with the ADIOS version of combine\_vol\_data. %% HDF5 \item [\texttt{HDF5\_ENABLED}] Turn this flag on to enable HDF5 file I/O. If set to \texttt{.false.}, subsequent HDF5 parameters will not be considered. +% \item [\texttt{HDF5\_FOR\_MOVIES}] Turn this flag on to use HDF5 format for movie outputs. +% \item [\texttt{HDF5\_IO\_NODES}] Setting this number >0 will allocate additional MPI processes specifically to handle the HDF5 file I/O in an asynchronous way. diff --git a/doc/USER_MANUAL/features.tex b/doc/USER_MANUAL/features.tex index bab56f249..a39e9cac2 100644 --- a/doc/USER_MANUAL/features.tex +++ b/doc/USER_MANUAL/features.tex @@ -25,6 +25,7 @@ \chapter*{Simulation features supported in SPECFEM3D Cartesian} & Elastic & X & X & X \\ & Poroelastic & X & - & - \\ & Ocean load / Topography & X & X & X \\ + & Gravity & - & - & - \\ & Gravity field / integrals & X & X & X \\ & Anisotropy & X & X & X \\ & Attenuation & X & X & X \\ diff --git a/flags.guess b/flags.guess index 9914bac92..2d3e8084a 100644 --- a/flags.guess +++ b/flags.guess @@ -105,7 +105,8 @@ case $my_FC in # DEF_FFLAGS="-xHost -fpe0 -ftz -assume buffered_io -assume byterecl -align sequence -std08 -diag-disable 6477 -implicitnone -gen-interfaces -warn all,noexternal" OPT_FFLAGS="-O3 -check nobounds" - DEBUG_FFLAGS="-check all -debug -g -O0 -fp-stack-check -traceback -ftrapuv" + # new version 2026: -fp-stack-check not available anymore, use -fstack-protector-all or -fstack-security-check + DEBUG_FFLAGS="-check all -debug -g -O0 -traceback -ftrapuv -fstack-security-check" # -fp-stack-check OMP_FFLAGS="-qopenmp" ;; gfortran|*/gfortran|f95|*/f95) diff --git a/setup/config.h.in b/setup/config.h.in index 9f5519a17..1dca33a4d 100644 --- a/setup/config.h.in +++ b/setup/config.h.in @@ -124,7 +124,7 @@ /* Set to 0 if source is from GIT, 1 otherwise. */ #undef SPECFEM3D_RELEASE_VERSION -/* Define SPECFEM3D version */ +/* Define SPECFEM3D Cartesian version */ #undef SPECFEM3D_VERSION /* Define to 1 if all of the C89 standard headers exist (not just the ones diff --git a/setup/constants.h.in b/setup/constants.h.in index 79141da8e..6d9314778 100644 --- a/setup/constants.h.in +++ b/setup/constants.h.in @@ -798,7 +798,18 @@ !! !!----------------------------------------------------------- ! gravitational constant - double precision, parameter :: GRAV = 6.6723d-11 +!! in S.I. units i.e. in m3 kg-1 s-2, or equivalently in N.(m/kg)^2 +!! April 2014: switched to the 2010 Committee on Data for Science and Technology (CODATA) recommended value +!! see e.g. http://www.physics.nist.gov/cgi-bin/cuu/Value?bg +!! and http://en.wikipedia.org/wiki/Gravitational_constant +!! double precision, parameter :: GRAV = 6.6723d-11 +!! double precision, parameter :: GRAV = 6.67430d-11 ! newer suggestion by CODATA 2018 + double precision, parameter :: GRAV = 6.67384d-11 ! CODATA 2010 + +! standard gravity (at the surface of the Earth) + double precision, parameter :: STANDARD_GRAVITY = 9.80665d0 ! in m.s-2 + +!! PREM ! number of layers in PREM integer, parameter :: NR = 640 ! R_EARTH is the radius of the bottom of the oceans (radius of Earth in m) diff --git a/src/check_mesh_quality/check_mesh_quality.f90 b/src/check_mesh_quality/check_mesh_quality.f90 index f13be98b1..f1e2eab46 100644 --- a/src/check_mesh_quality/check_mesh_quality.f90 +++ b/src/check_mesh_quality/check_mesh_quality.f90 @@ -693,126 +693,126 @@ subroutine local_version_of_create_mesh_quality_data_3D(x,y,z,ibool,ispec,NGNOD, integer :: count_contributions -! topology of faces of cube for skewness + ! topology of faces of cube for skewness integer faces_topo(6,6) -! store the corners of this element for the skewness routine + ! store the corners of this element for the skewness routine do i = 1,NGNOD xelm(i) = x(ibool(i,ispec)) yelm(i) = y(ibool(i,ispec)) zelm(i) = z(ibool(i,ispec)) enddo -! define topology of faces of cube for skewness + ! define topology of faces of cube for skewness -! face 1 + ! face 1 faces_topo(1,1) = 1 faces_topo(1,2) = 2 faces_topo(1,3) = 6 faces_topo(1,4) = 5 -! face 2 + ! face 2 faces_topo(2,1) = 2 faces_topo(2,2) = 3 faces_topo(2,3) = 7 faces_topo(2,4) = 6 -! face 3 + ! face 3 faces_topo(3,1) = 4 faces_topo(3,2) = 3 faces_topo(3,3) = 7 faces_topo(3,4) = 8 -! face 4 + ! face 4 faces_topo(4,1) = 1 faces_topo(4,2) = 5 faces_topo(4,3) = 8 faces_topo(4,4) = 4 -! face 5 + ! face 5 faces_topo(5,1) = 1 faces_topo(5,2) = 2 faces_topo(5,3) = 3 faces_topo(5,4) = 4 -! face 6 + ! face 6 faces_topo(6,1) = 5 faces_topo(6,2) = 6 faces_topo(6,3) = 7 faces_topo(6,4) = 8 -! define wraparound for angles for skewness calculation + ! define wraparound for angles for skewness calculation faces_topo(:,5) = faces_topo(:,1) faces_topo(:,6) = faces_topo(:,2) -! compute equiangle skewness (as defined in Fluent/Gambit manual) -! and compute edge aspect ratio using the corners of the element - distmin = + HUGEVAL - distmax = - HUGEVAL - distmean = ZERO - count_contributions = 0 - equiangle_skewness = - HUGEVAL - - do iface = 1,6 - do icorner = 1,4 - -! first vector of angle - vectorA_x = xelm(faces_topo(iface,icorner)) - xelm(faces_topo(iface,icorner+1)) - vectorA_y = yelm(faces_topo(iface,icorner)) - yelm(faces_topo(iface,icorner+1)) - vectorA_z = zelm(faces_topo(iface,icorner)) - zelm(faces_topo(iface,icorner+1)) - -! second vector of angle - vectorB_x = xelm(faces_topo(iface,icorner+2)) - xelm(faces_topo(iface,icorner+1)) - vectorB_y = yelm(faces_topo(iface,icorner+2)) - yelm(faces_topo(iface,icorner+1)) - vectorB_z = zelm(faces_topo(iface,icorner+2)) - zelm(faces_topo(iface,icorner+1)) - -! norm of vectors A and B - norm_A = sqrt(vectorA_x**2 + vectorA_y**2 + vectorA_z**2) - norm_B = sqrt(vectorB_x**2 + vectorB_y**2 + vectorB_z**2) - -! sanity check - if (norm_A <= ZERO .or. norm_B <= ZERO) then - print *,'error detected in element ',ispec,' out of ',NSPEC - print *,'error: negative of null norm found, norm_A, norm_B = ',norm_A, norm_B - stop 'error in the norm found' - endif - -! angle formed by the two vectors - argument_of_arccos = (vectorA_x*vectorB_x + vectorA_y*vectorB_y + vectorA_z*vectorB_z) / (norm_A * norm_B) - -! compute equiangle skewness - if (abs(argument_of_arccos) <= 0.9999999d0) then - angle_vectors = dacos(argument_of_arccos) - equiangle_skewness = max(equiangle_skewness,dabs(2.d0 * angle_vectors - PI) / PI) - else - angle_vectors = 0.d0 - equiangle_skewness = 1.d0 - endif - -! compute min and max size of an edge - dist = sqrt(vectorA_x**2 + vectorA_y**2 + vectorA_z**2) - - distmin = min(distmin,dist) - distmax = max(distmax,dist) - - count_contributions = count_contributions + 1 - distmean = distmean + dist - - enddo - enddo + ! compute equiangle skewness (as defined in Fluent/Gambit manual) + ! and compute edge aspect ratio using the corners of the element + distmin = + HUGEVAL + distmax = - HUGEVAL + distmean = ZERO + count_contributions = 0 + equiangle_skewness = - HUGEVAL + + do iface = 1,6 + do icorner = 1,4 + + ! first vector of angle + vectorA_x = xelm(faces_topo(iface,icorner)) - xelm(faces_topo(iface,icorner+1)) + vectorA_y = yelm(faces_topo(iface,icorner)) - yelm(faces_topo(iface,icorner+1)) + vectorA_z = zelm(faces_topo(iface,icorner)) - zelm(faces_topo(iface,icorner+1)) + + ! second vector of angle + vectorB_x = xelm(faces_topo(iface,icorner+2)) - xelm(faces_topo(iface,icorner+1)) + vectorB_y = yelm(faces_topo(iface,icorner+2)) - yelm(faces_topo(iface,icorner+1)) + vectorB_z = zelm(faces_topo(iface,icorner+2)) - zelm(faces_topo(iface,icorner+1)) + + ! norm of vectors A and B + norm_A = sqrt(vectorA_x**2 + vectorA_y**2 + vectorA_z**2) + norm_B = sqrt(vectorB_x**2 + vectorB_y**2 + vectorB_z**2) + + ! sanity check + if (norm_A <= ZERO .or. norm_B <= ZERO) then + print *,'Error: invalid norm detected in element ',ispec,' out of ',NSPEC + print *,' norm_A, norm_B = ',norm_A, norm_B + stop 'Error in the norm found' + endif -! compute the mean distance - distmean = distmean / count_contributions + ! angle formed by the two vectors + argument_of_arccos = (vectorA_x*vectorB_x + vectorA_y*vectorB_y + vectorA_z*vectorB_z) / (norm_A * norm_B) + + ! compute equiangle skewness + if (abs(argument_of_arccos) <= 0.9999999d0) then + angle_vectors = dacos(argument_of_arccos) + equiangle_skewness = max(equiangle_skewness,dabs(2.d0 * angle_vectors - PI) / PI) + else + angle_vectors = 0.d0 + equiangle_skewness = 1.d0 + endif + + ! compute min and max size of an edge + dist = sqrt(vectorA_x**2 + vectorA_y**2 + vectorA_z**2) + + distmin = min(distmin,dist) + distmax = max(distmax,dist) + + count_contributions = count_contributions + 1 + distmean = distmean + dist + + enddo + enddo + + ! compute the mean distance + distmean = distmean / count_contributions -! compute edge aspect ratio - edge_aspect_ratio = distmax / distmin + ! compute edge aspect ratio + edge_aspect_ratio = distmax / distmin -! compute diagonal aspect ratio - dist1 = sqrt((xelm(1) - xelm(7))**2 + (yelm(1) - yelm(7))**2 + (zelm(1) - zelm(7))**2) - dist2 = sqrt((xelm(2) - xelm(8))**2 + (yelm(2) - yelm(8))**2 + (zelm(2) - zelm(8))**2) - dist3 = sqrt((xelm(3) - xelm(5))**2 + (yelm(3) - yelm(5))**2 + (zelm(3) - zelm(5))**2) - dist4 = sqrt((xelm(4) - xelm(6))**2 + (yelm(4) - yelm(6))**2 + (zelm(4) - zelm(6))**2) - diagonal_aspect_ratio = max(dist1,dist2,dist3,dist4) / min(dist1,dist2,dist3,dist4) + ! compute diagonal aspect ratio + dist1 = sqrt((xelm(1) - xelm(7))**2 + (yelm(1) - yelm(7))**2 + (zelm(1) - zelm(7))**2) + dist2 = sqrt((xelm(2) - xelm(8))**2 + (yelm(2) - yelm(8))**2 + (zelm(2) - zelm(8))**2) + dist3 = sqrt((xelm(3) - xelm(5))**2 + (yelm(3) - yelm(5))**2 + (zelm(3) - zelm(5))**2) + dist4 = sqrt((xelm(4) - xelm(6))**2 + (yelm(4) - yelm(6))**2 + (zelm(4) - zelm(6))**2) + diagonal_aspect_ratio = max(dist1,dist2,dist3,dist4) / min(dist1,dist2,dist3,dist4) end subroutine local_version_of_create_mesh_quality_data_3D diff --git a/src/generate_databases/model_tomography.f90 b/src/generate_databases/model_tomography.f90 index 7efa83666..4921ab132 100644 --- a/src/generate_databases/model_tomography.f90 +++ b/src/generate_databases/model_tomography.f90 @@ -305,6 +305,7 @@ subroutine init_tomography_files() ! sets material domain materials_domain_id(ifiles_tomo) = idomain_id + ! data section ! counts remaining records do while (ier == 0) read(IIN,*,iostat=ier) diff --git a/src/gpu/assemble_MPI_scalar_cuda.cu b/src/gpu/assemble_MPI_scalar_cuda.cu index 2efc20d32..4a903ee70 100644 --- a/src/gpu/assemble_MPI_scalar_cuda.cu +++ b/src/gpu/assemble_MPI_scalar_cuda.cu @@ -65,11 +65,19 @@ void FC_FUNC_(transfer_boun_pot_from_device, if (*FORWARD_OR_ADJOINT == 1) { // forward wavefield d_potential_dot_dot = mp->d_potential_dot_dot_acoustic; - d_send_buffer = mp->d_send_potential_dot_dot_buffer; + if (mp->use_cuda_aware_mpi) { + d_send_buffer = send_potential_dot_dot_buffer; // buffer on GPU + } else { + d_send_buffer = mp->d_send_potential_dot_dot_buffer; + } } else if (*FORWARD_OR_ADJOINT == 3) { // backward/reconstructed wavefield d_potential_dot_dot = mp->d_b_potential_dot_dot_acoustic; - d_send_buffer = mp->d_b_send_potential_dot_dot_buffer; + if (mp->use_cuda_aware_mpi) { + d_send_buffer = send_potential_dot_dot_buffer; // buffer on GPU + } else { + d_send_buffer = mp->d_b_send_potential_dot_dot_buffer; + } } #ifdef USE_CUDA @@ -105,7 +113,13 @@ void FC_FUNC_(transfer_boun_pot_from_device, gpuStreamSynchronize(mp->compute_stream); // copies buffer to CPU - gpuMemcpy_tohost_field(send_potential_dot_dot_buffer,d_send_buffer,mp->size_mpi_buffer_potential); + if (mp->use_cuda_aware_mpi){ + // CUDA-aware MPI buffers on GPU, no copy needed + //gpuMemcpy_devicetodevice_field(send_potential_dot_dot_buffer,d_send_buffer,mp->size_mpi_buffer_potential); + } else { + // copies buffer to CPU + gpuMemcpy_tohost_field(send_potential_dot_dot_buffer,d_send_buffer,mp->size_mpi_buffer_potential); + } } // finish timing of kernel+memcpy @@ -157,18 +171,32 @@ void FC_FUNC_(transfer_asmbl_pot_to_device, if (*FORWARD_OR_ADJOINT == 1) { // forward wavefield d_potential_dot_dot = mp->d_potential_dot_dot_acoustic; - d_send_buffer = mp->d_send_potential_dot_dot_buffer; + if (mp->use_cuda_aware_mpi) { + d_send_buffer = buffer_recv_scalar_ext_mesh; // buffer on device + } else { + d_send_buffer = mp->d_send_potential_dot_dot_buffer; + } } else if (*FORWARD_OR_ADJOINT == 3) { // backward/reconstructed wavefield d_potential_dot_dot = mp->d_b_potential_dot_dot_acoustic; - d_send_buffer = mp->d_b_send_potential_dot_dot_buffer; + if (mp->use_cuda_aware_mpi) { + d_send_buffer = buffer_recv_scalar_ext_mesh; // buffer on device + } else { + d_send_buffer = mp->d_b_send_potential_dot_dot_buffer; + } } // synchronizes gpuSynchronize(); // copies buffer onto GPU - gpuMemcpy_todevice_field(d_send_buffer, buffer_recv_scalar_ext_mesh,mp->size_mpi_buffer_potential); + if (mp->use_cuda_aware_mpi){ + // CUDA-aware MPI buffers on GPU, no copy needed + //gpuMemcpy_devicetodevice_field(d_send_buffer, buffer_recv_scalar_ext_mesh,mp->size_mpi_buffer_potential); + } else { + // // buffer copy from CPU + gpuMemcpy_todevice_field(d_send_buffer, buffer_recv_scalar_ext_mesh,mp->size_mpi_buffer_potential); + } // assembles field #ifdef USE_CUDA diff --git a/src/gpu/assemble_MPI_vector_cuda.cu b/src/gpu/assemble_MPI_vector_cuda.cu index 360717b55..09bb3e4c3 100644 --- a/src/gpu/assemble_MPI_vector_cuda.cu +++ b/src/gpu/assemble_MPI_vector_cuda.cu @@ -65,11 +65,19 @@ TRACE("transfer_boun_accel_from_device"); if (*FORWARD_OR_ADJOINT == 1) { // forward wavefield d_accel = mp->d_accel; - d_send_buffer = mp->d_send_accel_buffer; + if (mp->use_cuda_aware_mpi) { + d_send_buffer = send_accel_buffer; // buffer on GPU + } else { + d_send_buffer = mp->d_send_accel_buffer; + } } else if (*FORWARD_OR_ADJOINT == 3) { // backward/reconstructed wavefield d_accel = mp->d_b_accel; - d_send_buffer = mp->d_b_send_accel_buffer; + if (mp->use_cuda_aware_mpi) { + d_send_buffer = send_accel_buffer; // buffer on GPU + } else { + d_send_buffer = mp->d_b_send_accel_buffer; + } } // Cuda timing @@ -104,7 +112,13 @@ TRACE("transfer_boun_accel_from_device"); gpuStreamSynchronize(mp->compute_stream); // copies buffer from GPU to CPU host - gpuMemcpy_tohost_realw(send_accel_buffer,d_send_buffer,mp->size_mpi_buffer); + if (mp->use_cuda_aware_mpi){ + // CUDA-aware MPI buffers on GPU, no copy needed + //gpuMemcpy_devicetodevice_realw(send_accel_buffer,d_send_buffer,mp->size_mpi_buffer); + } else { + // copies buffer to CPU + gpuMemcpy_tohost_realw(send_accel_buffer,d_send_buffer,mp->size_mpi_buffer); + } // kernel timing // finish timing of kernel+memcpy @@ -118,7 +132,8 @@ TRACE("transfer_boun_accel_from_device"); extern EXTERN_LANG void FC_FUNC_(transfer_boundary_from_device_a, - TRANSFER_BOUNDARY_FROM_DEVICE_A)(long* Mesh_pointer) { + TRANSFER_BOUNDARY_FROM_DEVICE_A)(long* Mesh_pointer, + realw* send_accel_buffer) { // asynchronous transfer from device to host @@ -138,9 +153,16 @@ void FC_FUNC_(transfer_boundary_from_device_a, dim3 threads(blocksize,1,1); // prepares boundary buffer + realw* d_send_buffer = NULL; + if (mp->use_cuda_aware_mpi) { + d_send_buffer = send_accel_buffer; // buffer on GPU + } else { + d_send_buffer = mp->d_send_accel_buffer; + } + #ifdef USE_CUDA if (run_cuda){ - prepare_boundary_accel_on_device<<compute_stream>>>(mp->d_accel,mp->d_send_accel_buffer, + prepare_boundary_accel_on_device<<compute_stream>>>(mp->d_accel,d_send_buffer, mp->num_interfaces_ext_mesh, mp->max_nibool_interfaces_ext_mesh, mp->d_nibool_interfaces_ext_mesh, @@ -150,7 +172,7 @@ void FC_FUNC_(transfer_boundary_from_device_a, #ifdef USE_HIP if (run_hip){ hipLaunchKernelGGL(prepare_boundary_accel_on_device, dim3(grid), dim3(threads), 0, mp->compute_stream, - mp->d_accel,mp->d_send_accel_buffer, + mp->d_accel,d_send_buffer, mp->num_interfaces_ext_mesh, mp->max_nibool_interfaces_ext_mesh, mp->d_nibool_interfaces_ext_mesh, @@ -163,7 +185,14 @@ void FC_FUNC_(transfer_boundary_from_device_a, // waits until previous compute stream finishes gpuStreamSynchronize(mp->compute_stream); - gpuMemcpyAsync_tohost_realw(mp->h_send_accel_buffer,mp->d_send_accel_buffer,mp->size_mpi_buffer,mp->copy_stream); + // copies buffer from GPU to CPU host (asynchronuous) + if (mp->use_cuda_aware_mpi){ + // CUDA-aware MPI buffers on GPU, no copy needed + //gpuMemcpyAsync_devicetodevice_realw(send_accel_buffer,mp->d_send_accel_buffer,mp->size_mpi_buffer,mp->copy_stream); + } else { + // copies buffer to CPU (pinned memory) + gpuMemcpyAsync_tohost_realw(mp->h_send_accel_buffer,mp->d_send_accel_buffer,mp->size_mpi_buffer,mp->copy_stream); + } } } @@ -181,11 +210,17 @@ void FC_FUNC_(transfer_boundary_to_device_a, Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container if (mp->size_mpi_buffer > 0){ - // copy on host memory - memcpy(mp->h_recv_accel_buffer,buffer_recv_vector_ext_mesh,mp->size_mpi_buffer*sizeof(realw)); - - // asynchronous copy to GPU using copy_stream - gpuMemcpyAsync_todevice_realw(mp->d_send_accel_buffer, mp->h_recv_accel_buffer,mp->size_mpi_buffer,mp->copy_stream); + // copies buffer from CPU to GPU + if (mp->use_cuda_aware_mpi){ + // CUDA-aware MPI buffers on GPU, no copy needed + //gpuMemcpyAsync_devicetodevice_realw(mp->d_send_accel_buffer,buffer_recv_vector_ext_mesh,mp->size_mpi_buffer,mp->copy_stream); + } else { + // copy on host memory (to pinned memory) + memcpy(mp->h_recv_accel_buffer,buffer_recv_vector_ext_mesh,mp->size_mpi_buffer*sizeof(realw)); + + // asynchronous copy to GPU using copy_stream + gpuMemcpyAsync_todevice_realw(mp->d_send_accel_buffer, mp->h_recv_accel_buffer,mp->size_mpi_buffer,mp->copy_stream); + } } } @@ -209,17 +244,27 @@ TRACE("transfer_asmbl_accel_to_device"); if (mp->size_mpi_buffer > 0){ - //daniel: todo - check if this copy is only needed for adjoint simulation, otherwise it is called asynchronously? + // note: array copy is only needed for adjoint simulation, otherwise it is called asynchronously before + // in routine transfer_boundary_to_device() and transfer_boundary_to_device_a() if (*FORWARD_OR_ADJOINT == 1){ // Wait until previous copy stream finishes. We assemble while other compute kernels execute. - gpuStreamSynchronize(mp->copy_stream); + if (! mp->use_cuda_aware_mpi){ + gpuStreamSynchronize(mp->copy_stream); + } } else if (*FORWARD_OR_ADJOINT == 3){ // explicitly synchronizes // (cudaMemcpy implicitly synchronizes all other cuda operations) gpuSynchronize(); - gpuMemcpy_todevice_realw(mp->d_b_send_accel_buffer, buffer_recv_vector_ext_mesh,mp->size_mpi_buffer); + // copy array onto GPU + if (mp->use_cuda_aware_mpi){ + // CUDA-aware MPI buffers on GPU, no copy needed + //gpuMemcpy_devicetodevice_realw(mp->d_b_send_accel_buffer, buffer_recv_vector_ext_mesh,mp->size_mpi_buffer); + } else { + // copies to GPU + gpuMemcpy_todevice_realw(mp->d_b_send_accel_buffer, buffer_recv_vector_ext_mesh,mp->size_mpi_buffer); + } } int blocksize = BLOCKSIZE_TRANSFER; @@ -237,11 +282,19 @@ TRACE("transfer_asmbl_accel_to_device"); if (*FORWARD_OR_ADJOINT == 1) { // forward wavefield d_accel = mp->d_accel; - d_send_buffer = mp->d_send_accel_buffer; + if (mp->use_cuda_aware_mpi){ + d_send_buffer = buffer_recv_vector_ext_mesh; // buffer on GPU + } else { + d_send_buffer = mp->d_send_accel_buffer; + } } else if (*FORWARD_OR_ADJOINT == 3) { // backward/reconstructed wavefield d_accel = mp->d_b_accel; - d_send_buffer = mp->d_b_send_accel_buffer; + if (mp->use_cuda_aware_mpi){ + d_send_buffer = buffer_recv_vector_ext_mesh; // buffer on GPU + } else { + d_send_buffer = mp->d_b_send_accel_buffer; + } } //double start_time = get_time_val(); @@ -288,103 +341,108 @@ TRACE("transfer_asmbl_accel_to_device"); /* ----------------------------------------------------------------------------------------------- */ - - -/* ----------------------------------------------------------------------------------------------- */ - +// not used yet... +// // FORWARD_OR_ADJOINT == 1 for accel, and == 3 for b_accel -// This sync function is for FAULT_SOLVER -extern EXTERN_LANG -void FC_FUNC_(transfer_sync_accel_to_device, - TRANSFER_ASMBL_ACCEL_TO_DEVICE)(long* Mesh_pointer, - realw* buffer_recv_vector_ext_mesh, - const int* FORWARD_OR_ADJOINT) { -TRACE("transfer_sync_accel_to_device"); - - Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container - - if (mp->size_mpi_buffer > 0){ - - //daniel: todo - check if this copy is only needed for adjoint simulation, otherwise it is called asynchronously? - if (*FORWARD_OR_ADJOINT == 1){ - // Wait until previous copy stream finishes. We assemble while other compute kernels execute. - gpuStreamSynchronize(mp->copy_stream); - } - else if (*FORWARD_OR_ADJOINT == 3){ - // explicitly synchronizes - // (cudaMemcpy implicitly synchronizes all other cuda operations) - gpuSynchronize(); - - gpuMemcpy_todevice_realw(mp->d_b_send_accel_buffer, buffer_recv_vector_ext_mesh,mp->size_mpi_buffer); - } - - int blocksize = BLOCKSIZE_TRANSFER; - int size_padded = ((int)ceil(((double)mp->max_nibool_interfaces_ext_mesh)/((double)blocksize)))*blocksize; - - int num_blocks_x, num_blocks_y; - get_blocks_xy(size_padded/blocksize,&num_blocks_x,&num_blocks_y); - - dim3 grid(num_blocks_x,num_blocks_y); - dim3 threads(blocksize,1,1); - - //double start_time = get_time_val(); - // cudaEvent_t start, stop; - // realw time; - // cudaEventCreate(&start); - // cudaEventCreate(&stop); - // cudaEventRecord( start, 0); - - // selects arrays - realw* d_accel = NULL; - realw* d_send_buffer = NULL; - if (*FORWARD_OR_ADJOINT == 1) { - // forward wavefield - d_accel = mp->d_accel; - d_send_buffer = mp->d_send_accel_buffer; - } else if (*FORWARD_OR_ADJOINT == 3) { - // backward/reconstructed wavefield - d_accel = mp->d_b_accel; - d_send_buffer = mp->d_b_send_accel_buffer; - } - - //assembles accel -#ifdef USE_CUDA - if (run_cuda){ - synchronize_boundary_accel_on_device<<compute_stream>>>(d_accel, d_send_buffer, - mp->num_interfaces_ext_mesh, - mp->max_nibool_interfaces_ext_mesh, - mp->d_nibool_interfaces_ext_mesh, - mp->d_ibool_interfaces_ext_mesh); - } -#endif -#ifdef USE_HIP - if (run_hip){ - hipLaunchKernelGGL(synchronize_boundary_accel_on_device, dim3(grid), dim3(threads), 0, mp->compute_stream, - d_accel, d_send_buffer, - mp->num_interfaces_ext_mesh, - mp->max_nibool_interfaces_ext_mesh, - mp->d_nibool_interfaces_ext_mesh, - mp->d_ibool_interfaces_ext_mesh); - } -#endif - - // cudaEventRecord( stop, 0); - // cudaEventSynchronize( stop ); - // cudaEventElapsedTime( &time, start, stop ); - // cudaEventDestroy( start ); - // cudaEventDestroy( stop ); - // printf("Boundary Assemble Kernel Execution Time: %f ms\n",time); - } - - //double end_time = get_time_val(); - //printf("Elapsed time: %e\n",end_time-start_time); - - GPU_ERROR_CHECKING("transfer_sync_accel_to_device"); -} +// +//extern EXTERN_LANG +//void FC_FUNC_(transfer_sync_accel_to_device, +// TRANSFER_ASMBL_ACCEL_TO_DEVICE)(long* Mesh_pointer, +// realw* buffer_recv_vector_ext_mesh, +// const int* FORWARD_OR_ADJOINT) { +//TRACE("transfer_sync_accel_to_device"); +// +// Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container +// +// if (mp->size_mpi_buffer > 0){ +// +// // note: array copy is only needed for adjoint simulation, otherwise it is called asynchronously? +// if (*FORWARD_OR_ADJOINT == 1){ +// // Wait until previous copy stream finishes. We assemble while other compute kernels execute. +// gpuStreamSynchronize(mp->copy_stream); +// } +// else if (*FORWARD_OR_ADJOINT == 3){ +// // explicitly synchronizes +// // (cudaMemcpy implicitly synchronizes all other cuda operations) +// gpuSynchronize(); +// +// // copy array onto GPU +// if (mp->use_cuda_aware_mpi){ +// // CUDA-aware MPI copies buffers on GPU +// gpuMemcpy_devicetodevice_realw(mp->d_b_send_accel_buffer, buffer_recv_vector_ext_mesh,mp->size_mpi_buffer); +// } else { +// // copies to GPU +// gpuMemcpy_todevice_realw(mp->d_b_send_accel_buffer, buffer_recv_vector_ext_mesh,mp->size_mpi_buffer); +// } +// } +// +// int blocksize = BLOCKSIZE_TRANSFER; +// int size_padded = ((int)ceil(((double)mp->max_nibool_interfaces_ext_mesh)/((double)blocksize)))*blocksize; +// +// int num_blocks_x, num_blocks_y; +// get_blocks_xy(size_padded/blocksize,&num_blocks_x,&num_blocks_y); +// +// dim3 grid(num_blocks_x,num_blocks_y); +// dim3 threads(blocksize,1,1); +// +// //double start_time = get_time_val(); +// // cudaEvent_t start, stop; +// // realw time; +// // cudaEventCreate(&start); +// // cudaEventCreate(&stop); +// // cudaEventRecord( start, 0); +// +// // selects arrays +// realw* d_accel = NULL; +// realw* d_send_buffer = NULL; +// if (*FORWARD_OR_ADJOINT == 1) { +// // forward wavefield +// d_accel = mp->d_accel; +// d_send_buffer = mp->d_send_accel_buffer; +// } else if (*FORWARD_OR_ADJOINT == 3) { +// // backward/reconstructed wavefield +// d_accel = mp->d_b_accel; +// d_send_buffer = mp->d_b_send_accel_buffer; +// } +// +// //assembles accel +//#ifdef USE_CUDA +// if (run_cuda){ +// synchronize_boundary_accel_on_device<<compute_stream>>>(d_accel, d_send_buffer, +// mp->num_interfaces_ext_mesh, +// mp->max_nibool_interfaces_ext_mesh, +// mp->d_nibool_interfaces_ext_mesh, +// mp->d_ibool_interfaces_ext_mesh); +// } +//#endif +//#ifdef USE_HIP +// if (run_hip){ +// hipLaunchKernelGGL(synchronize_boundary_accel_on_device, dim3(grid), dim3(threads), 0, mp->compute_stream, +// d_accel, d_send_buffer, +// mp->num_interfaces_ext_mesh, +// mp->max_nibool_interfaces_ext_mesh, +// mp->d_nibool_interfaces_ext_mesh, +// mp->d_ibool_interfaces_ext_mesh); +// } +//#endif +// +// // cudaEventRecord( stop, 0); +// // cudaEventSynchronize( stop ); +// // cudaEventElapsedTime( &time, start, stop ); +// // cudaEventDestroy( start ); +// // cudaEventDestroy( stop ); +// // printf("Boundary Assemble Kernel Execution Time: %f ms\n",time); +// } +// +// //double end_time = get_time_val(); +// //printf("Elapsed time: %e\n",end_time-start_time); +// +// GPU_ERROR_CHECKING("transfer_sync_accel_to_device"); +//} /* ----------------------------------------------------------------------------------------------- */ -//daniel: not used ... +// not used yet... // //extern EXTERN_LANG //void FC_FUNC_(assemble_accel_on_device, @@ -448,12 +506,14 @@ void FC_FUNC_(sync_copy_from_device, if (*iphase != 2){ exit_on_gpu_error("sync_copy_from_device must be called for iphase == 2"); } if (mp->size_mpi_buffer > 0){ - // waits for asynchronous copy to finish - gpuStreamSynchronize(mp->copy_stream); + if (! mp->use_cuda_aware_mpi) { + // waits for asynchronous copy to finish + gpuStreamSynchronize(mp->copy_stream); - // There have been problems using the pinned-memory with MPI, so - // we copy the buffer into a non-pinned region. - memcpy(send_buffer,mp->h_send_accel_buffer,mp->size_mpi_buffer*sizeof(realw)); + // There have been problems using the pinned-memory with MPI, so + // we copy the buffer into a non-pinned region. + memcpy(send_buffer,mp->h_send_accel_buffer,mp->size_mpi_buffer*sizeof(realw)); + } } // memory copy is now finished, so non-blocking MPI send can proceed } diff --git a/src/gpu/helper_functions.cu b/src/gpu/helper_functions.cu index 74a4ae130..ce000a09c 100644 --- a/src/gpu/helper_functions.cu +++ b/src/gpu/helper_functions.cu @@ -411,6 +411,83 @@ void synchronize_mpi () { } +/* ----------------------------------------------------------------------------------------------- */ +// CUDA-aware MPI helper function +/* ----------------------------------------------------------------------------------------------- */ + +// allocates buffers on GPU device + +extern EXTERN_LANG +void FC_FUNC_ (allocate_gpu_buffer, + ALLOCATE_GPU_BUFFER) (realw** buffer_f, int* total_size) { + TRACE ("allocate_gpu_buffer"); + + realw* buffer; + size_t size = *total_size; + + // initializes buffer pointer + *buffer_f = NULL; + + // checks if anything to do + if (size == 0){ return; } + + // allocates buffer on GPU + gpuMalloc_realw((void**) &buffer, size); + + //debug + //int myrank; +#ifdef WITH_MPI + //MPI_Comm_rank(MPI_COMM_WORLD, &myrank); +#else + //myrank = 0; +#endif + //printf("[allocate_gpu_buffer] rank %d: cudaMalloc pointer: %p\n", myrank, (void*) buffer); + + // initializes + gpuMemset_realw(buffer, size, 0); + + // returns buffer pointer +#ifdef USE_CUDA + if (run_cuda) { *buffer_f = buffer; } +#endif +#ifdef USE_HIP + if (run_hip) { *buffer_f = buffer; } +#endif +} + + +// for debugging + +extern EXTERN_LANG +void FC_FUNC_ (check_gpu_pointer, + CHECK_GPU_POINTER)(void* ptr) { + // checks if pointer is associated with memory on device. + // CUDA-aware MPI needs a positive check to allow for device-to-device MPI transfers. + +#ifdef USE_CUDA + struct cudaPointerAttributes attrs; + cudaError_t err = cudaPointerGetAttributes(&attrs, ptr); + if (err != cudaSuccess) { + printf("[check_gpu_pointer] cudaPointerGetAttributes failed: %s\n", cudaGetErrorString(err)); + return; + } + + int myrank; +#ifdef WITH_MPI + MPI_Comm_rank(MPI_COMM_WORLD, &myrank); +#else + myrank = 0; +#endif + //printf("[check_gpu_pointer] pointer : %p\n", ptr); + //printf("[check_gpu_pointer] devicePointer: %p\n", attrs.devicePointer); + //printf("[check_gpu_pointer] hostPointer : %p\n", attrs.hostPointer); + // attrs.type: cudaMemoryTypeDevice, cudaMemoryTypeHost, cudaMemoryTypeManaged + //printf("[check_gpu_pointer] memoryType : %d (2=device)\n", attrs.type); + printf("[check_gpu_pointer] rank %d: pointer: %p devicePointer: %p hostPointer: %p memoryType: %d (2=device) \n", + myrank, ptr, attrs.devicePointer, attrs.hostPointer, attrs.type); +#endif // USE_CUDA +} + /* ----------------------------------------------------------------------------------------------- */ // for debugging purposes, unused so far... diff --git a/src/gpu/initialize_gpu.cu b/src/gpu/initialize_gpu.cu index 21bfb3fca..1feb45f46 100644 --- a/src/gpu/initialize_gpu.cu +++ b/src/gpu/initialize_gpu.cu @@ -29,6 +29,9 @@ #include "mesh_constants_gpu.h" +// number of GPU cards (per compute node) +static int number_of_gpu_devices = 0; + // gpu runtime flags int run_cuda = 0; int run_hip = 0; @@ -56,19 +59,19 @@ int run_hip = 0; #endif -void initialize_cuda_device(int* myrank_f,int* ncuda_devices) { +void initialize_cuda_device(int myrank,int* nb_devices) { TRACE("initialize_cuda_device"); int device; - int device_count; + int device_count = 0; + + // user error info + const char* err_info = "Please check GPU settings on your node \n\n"; // sets gpu runtime flag run_cuda = 1; - // Gets rank number of MPI process - int myrank = *myrank_f; - /* // cuda initialization (needs -lcuda library) // note: cuInit initializes the driver API. @@ -102,7 +105,6 @@ void initialize_cuda_device(int* myrank_f,int* ncuda_devices) { // note: from here on we use the runtime API ... // Gets number of GPU devices - device_count = 0; cudaGetDeviceCount(&device_count); // Do not check if command failed with `exit_on_gpu_error` since it calls cudaDevice()/ThreadSynchronize(): // If multiple MPI tasks access multiple GPUs per node, they will try to synchronize @@ -131,8 +133,11 @@ void initialize_cuda_device(int* myrank_f,int* ncuda_devices) { // checks if CUDA devices available if (device_count == 0) exit_on_error("CUDA runtime error: there is no device supporting CUDA\n"); + // stores counts + number_of_gpu_devices = device_count; + // returns device count to fortran - *ncuda_devices = device_count; + *nb_devices = number_of_gpu_devices; // Sets the active device if (device_count >= 1) { @@ -157,6 +162,15 @@ void initialize_cuda_device(int* myrank_f,int* ncuda_devices) { // double check that device was properly selected cudaGetDevice(&device); + + err = cudaGetLastError(); + if (err != cudaSuccess) { + fprintf(stderr,"Error cudaGetDevice: %s\n", cudaGetErrorString(err)); + if (err == cudaErrorDevicesUnavailable){ fprintf(stderr,"\n%s\n", err_info); } + exit_on_error("CUDA runtime error: cudaGetDevice failed\n\n"); + } + + // checks device id if (device != GPU_DEVICE_ID ){ printf("Error rank: %d devices: %d \n",myrank,device_count); printf(" cudaSetDevice()=%d\n cudaGetDevice()=%d\n",GPU_DEVICE_ID,device); @@ -172,6 +186,15 @@ void initialize_cuda_device(int* myrank_f,int* ncuda_devices) { // double check that device was properly selected cudaGetDevice(&device); + + err = cudaGetLastError(); + if (err != cudaSuccess) { + fprintf(stderr,"Error cudaGetDevice: %s\n", cudaGetErrorString(err)); + if (err == cudaErrorDevicesUnavailable){ fprintf(stderr,"\n%s\n", err_info); } + exit_on_error("CUDA runtime error: cudaGetDevice failed\n\n"); + } + + // checks device id if (device != (myrank % device_count) ){ printf("Error rank: %d devices: %d \n",myrank,device_count); printf(" cudaSetDevice()=%d\n cudaGetDevice()=%d\n",myrank%device_count,device); @@ -179,13 +202,30 @@ void initialize_cuda_device(int* myrank_f,int* ncuda_devices) { } #endif } +} + +// outputs devices infos + +static void output_cuda_device_infos(int myrank){ + + struct cudaDeviceProp deviceProp; + int device; // returns a handle to the active device cudaGetDevice(&device); + exit_on_gpu_error("cudaGetDevice failed"); + + // Gets number of GPU devices & version infos + int device_count = 0; + int driverVersion = 0, runtimeVersion = 0; + + cudaGetDeviceCount(&device_count); + cudaDriverGetVersion(&driverVersion); + cudaRuntimeGetVersion(&runtimeVersion); // get device properties - struct cudaDeviceProp deviceProp; cudaGetDeviceProperties(&deviceProp,device); + exit_on_gpu_error("cudaGetDeviceProperties failed"); // exit if the machine has no CUDA-enabled device if (deviceProp.major == 9999 && deviceProp.minor == 9999){ @@ -200,10 +240,9 @@ void initialize_cuda_device(int* myrank_f,int* ncuda_devices) { // outputs device infos to file char filename[BUFSIZ]; FILE* fp; - int do_output_info; + int do_output_info = 0; // by default, only main process outputs device infos to avoid file cluttering - do_output_info = 0; if (myrank == 0){ do_output_info = 1; sprintf(filename,OUTPUT_FILES"/gpu_device_info.txt"); @@ -322,15 +361,12 @@ void initialize_cuda_device(int* myrank_f,int* ncuda_devices) { #ifdef USE_HIP -void initialize_hip_device(int* myrank_f,int* ncuda_devices) { +void initialize_hip_device(int myrank,int* nb_devices) { TRACE("initialize_hip_device"); int device; - int device_count; - - // Gets rank number of MPI process - int myrank = *myrank_f; + int device_count = 0; // first HIP call // @@ -340,8 +376,8 @@ void initialize_hip_device(int* myrank_f,int* ncuda_devices) { //if (status != hipSuccess) exit_on_error("HIP initialization failed\n"); // // gets number of devices - device_count = 0; hipGetDeviceCount(&device_count); + hipError_t err = hipGetLastError(); // adds quick check on versions @@ -363,8 +399,11 @@ void initialize_hip_device(int* myrank_f,int* ncuda_devices) { // checks if HIP devices available if (device_count == 0) exit_on_error("HIP runtime error: no HIP devices available\n"); + // stores counts + number_of_gpu_devices = device_count; + // returns device count to fortran - *ncuda_devices = device_count; + *nb_devices = number_of_gpu_devices; // Sets the active device if (device_count >= 1) { @@ -373,11 +412,7 @@ void initialize_hip_device(int* myrank_f,int* ncuda_devices) { // "setting the device when a process is active is not allowed" // releases previous contexts -#if CUDA_VERSION < 4000 hipDeviceReset(); -#else - hipDeviceReset(); -#endif //printf("rank %d: cuda device count = %d sets device = %d \n",myrank,device_count,myrank % device_count); //MPI_Barrier(MPI_COMM_WORLD); @@ -415,13 +450,28 @@ void initialize_hip_device(int* myrank_f,int* ncuda_devices) { } #endif } +} + +// outputs devices infos + +static void output_hip_device_infos(int myrank){ + + struct hipDeviceProp_t deviceProp; + int device; // returns a handle to the active device hipGetDevice(&device); exit_on_gpu_error("hipGetDevice failed"); + // Gets number of GPU devices & version infos + int device_count = 0; + int driverVersion = 0, runtimeVersion = 0; + + hipGetDeviceCount(&device_count); + hipDriverGetVersion(&driverVersion); + hipRuntimeGetVersion(&runtimeVersion); + // get device properties - struct hipDeviceProp_t deviceProp; hipGetDeviceProperties(&deviceProp,device); exit_on_gpu_error("hipGetDevicePropoerties failed"); @@ -432,10 +482,9 @@ void initialize_hip_device(int* myrank_f,int* ncuda_devices) { // outputs device infos to file char filename[BUFSIZ]; FILE* fp; - int do_output_info; + int do_output_info = 0; // by default, only master process outputs device infos to avoid file cluttering - do_output_info = 0; if (myrank == 0){ do_output_info = 1; sprintf(filename,OUTPUT_FILES"/gpu_device_info.txt"); @@ -494,13 +543,11 @@ void initialize_hip_device(int* myrank_f,int* ncuda_devices) { } } - /* daniel todo: check in case this applies... // we use pinned memory for asynchronous copy if (! deviceProp.canMapHostMemory){ fprintf(stderr,"Device capability should allow to map host memory, exiting...\n"); - exit_on_error("CUDA Device capability canMapHostMemory should be TRUE\n"); + exit_on_error("HIP Device capability canMapHostMemory should be TRUE\n"); } - */ // checks kernel optimization setting #ifdef USE_LAUNCH_BOUNDS @@ -538,29 +585,277 @@ void initialize_hip_device(int* myrank_f,int* ncuda_devices) { extern EXTERN_LANG void FC_FUNC_(initialize_gpu_device, - INITIALIZE_GPU_DEVICE)(int* myrank_f,int* ncuda_devices) { + INITIALIZE_GPU_DEVICE)(int* myrank_f,int* nb_devices,int* cuda_aware_mpi_init_type) { TRACE("initialize_gpu_device"); + // rank + int myrank = *myrank_f; + int init_type = *cuda_aware_mpi_init_type; + + // flags to run initialization and output device infos + int do_init = 1; + int do_output = 1; + // check if compiled with both CUDA and HIP support #if defined(USE_CUDA) && defined(USE_HIP) - if (*myrank_f == 0) { - printf("Error: GPU version compilation with both USE_CUDA and USE_HIP not supported yet.\nPlease only use one for now...\n\n",); + if (myrank == 0) { + printf("Error: GPU version compilation with both USE_CUDA and USE_HIP not supported yet.\nPlease only use one for now...\n\n"); } exit(1); #endif + // CUDA-aware MPI + // we need to set the GPU device before MPI_init but should avoid calling further CUDA calls to avoid issues. + // for example, on Summit the PAMI backend uses "CUDA hooks" and would complain about: + // CUDA Hook Library: Failed to find symbol mem_find_dreg_entries, ./bin/xspecfem3D: undefined symbol: __PAMI_Invalidate_region + // see: https://docs.olcf.ornl.gov/systems/summit_user_guide.html#cuda-hook-error-when-program-uses-cuda-without-first-calling-mpi-init + // + // thus, we separate the initialization and the device output (which contains a memory allocation check leading to this problem). +#ifdef WITH_CUDA_AWARE_MPI + // checks if initialize called by CUDA-aware check + if (init_type == 1) { + // initial call to set device + if (myrank == 0){ printf("using CUDA-aware MPI: initializing GPU devices\n"); } + // only initialization + do_init = 1; + do_output = 0; + }else if (init_type == 2){ + // called again with Par_file setting + if (myrank == 0){ printf("using CUDA-aware MPI: returning number of devices = %d\n",number_of_gpu_devices); } + // already initialized + *nb_devices = number_of_gpu_devices; + // only device infos + do_init = 0; + do_output = 1; + } +#endif // WITH_CUDA_AWARE_MPI + // initializes gpu cards + if (do_init) { #ifdef USE_CUDA - run_cuda = 1; - if (run_cuda) { - initialize_cuda_device(myrank_f, ncuda_devices); + run_cuda = 1; + if (run_cuda) { initialize_cuda_device(myrank, nb_devices); } +#endif +#ifdef USE_HIP + run_hip = 1; + if (run_hip) { initialize_hip_device(myrank, nb_devices); } +#endif } + + // outputs device infos + if (do_output){ +#ifdef USE_CUDA + if (run_cuda) { output_cuda_device_infos(myrank); } #endif #ifdef USE_HIP - run_hip = 1; - if (run_hip) { - initialize_hip_device(myrank_f, ncuda_devices); + if (run_hip) { output_hip_device_infos(myrank); } +#endif } +} + +/* ----------------------------------------------------------------------------------------------- */ + +// CUDA-aware MPI +// we need to call cudaSetDevice before MPI_Init to ensure that the same GPU is chosen by MPI and your application + +// CUDA-aware support compile-time information +#ifdef WITH_CUDA_AWARE_MPI +// rank info +#if defined(OPEN_MPI) && OPEN_MPI +// OpenMPI +#pragma message ("\n\nCompiling with: WITH_CUDA_AWARE_MPI uses OPEN_MPI CUDA-aware local rank\n") +#elif defined(MVAPICH2_NUMVERSION) && (MVAPICH2_NUMVERSION >= 20205300) +// MVAPICH +#pragma message ("\n\nCompiling with: WITH_CUDA_AWARE_MPI uses MVAPICH2 CUDA-aware local rank\n") +#else +// unknown +#pragma message ("\n\nCompiling with: unknown CUDA-aware local rank environment, use -DENV_LOCAL_RANK \"\" setting\n") +#endif +// MPIX query +#if defined(MPIX_CUDA_AWARE_SUPPORT) +#pragma message ("\n\nCompiling with: WITH_CUDA_AWARE_MPI has MPIX_CUDA_AWARE_SUPPORT\n") +#else +#pragma message ("\n\nCompiling with: WITH_CUDA_AWARE_MPI has no MPIX_CUDA_AWARE_SUPPORT, please check MPI installation\n") +#endif // MPIX_CUDA_AWARE_SUPPORT +#endif // WITH_CUDA_AWARE_MPI + +extern EXTERN_LANG +void FC_FUNC_ (check_cuda_aware_mpi, + CHECK_CUDA_AWARE_MPI) (int* has_cuda_aware_mpi_f) { + + TRACE ("check_cuda_aware_mpi"); + + // flags + int has_cuda_aware_mpi = 0; + +#ifdef WITH_CUDA_AWARE_MPI + // environment variable which allows the reading of the local rank of the current MPI + // process before the MPI environment gets initialized with MPI_Init(). + // + // This is necessary when running the CUDA-aware MPI version, which needs this information in order to be able to + // set the CUDA device for the MPI process before MPI environment initialization. + // + // If you are using MVAPICH2, set this constant to "MV2_COMM_WORLD_LOCAL_RANK"; + // for Open MPI, use "OMPI_COMM_WORLD_LOCAL_RANK". +#if defined(OPEN_MPI) && OPEN_MPI +// OpenMPI +#define ENV_LOCAL_RANK "OMPI_COMM_WORLD_LOCAL_RANK" +#elif defined(MVAPICH2_NUMVERSION) && (MVAPICH2_NUMVERSION >= 20205300) +// MVAPICH +#define ENV_LOCAL_RANK "MV2_COMM_WORLD_LOCAL_RANK" +#else +// unknown +// defines local rank environment variables as unknown if not set by compilation flag, mostly to be able to run getenv() command +#ifndef ENV_LOCAL_RANK +#define ENV_LOCAL_RANK "UNKNOWN_LOCAL_RANK" #endif +#endif // OPEN_MPI + + // sets GPU device before MPI initialization + // MPI will then recognize the setting and take over the GPU device setup + + // determine local rank + // note: local rank is the rank id per compute node + // for example, 4 MPI processes per node -> local rank id = 0,1,2,3 on all cmopute nodes + // not the same as the MPI rank which goes from 0 to MPI size-1 + int has_local_rank_info = 0; + int rank = 0; + char * localRankStr = NULL; + + // info + const char* msg; + + // local rank info from environment + if ((localRankStr = getenv(ENV_LOCAL_RANK)) != NULL) { + // catching OpenMPI environment rank + rank = atoi(localRankStr); + has_local_rank_info = 1; + } else { + // no OpenMPI environment rank found, initializing myrank to zero + rank = 0; + has_local_rank_info = 0; + } + + // debug + //printf("[check_cuda_aware_mpi] CUDA-aware check: has_local_rank_info = %d - local rank = %d\n",has_local_rank_info,rank); + + // enables CUDA-aware MPI support + if (has_local_rank_info){ + // user output + if (rank == 0){ printf("\nchecking CUDA-aware MPI\n\n");} + + // debug + //printf("[check_cuda_aware_mpi] compile time check for CUDA-aware MPI - rank %d\n",rank); + +#if defined(MPIX_CUDA_AWARE_SUPPORT) + // assume CUDA-aware support, will run query later to double-check + has_cuda_aware_mpi = 1; + msg = "\ +This version has been compiled with flag WITH_CUDA_AWARE_MPI and MPI library has MPIX query cuda support.\n \ +We assume CUDA-aware MPI.\n\n"; +#else + // no MPIX query support + has_cuda_aware_mpi = 0; + msg = "\ +This version has been compiled with flag WITH_CUDA_AWARE_MPI, but MPI library cannot determine if there is CUDA-aware support.\n \ +Please check MPI installation.\n\n"; + //debug + //printf("[check_cuda_aware_mpi] rank = %d - no MPIX has cuda aware MPI = %d\n",rank,has_cuda_aware_mpi); +#endif // MPIX_CUDA_AWARE_SUPPORT + + // user info + if (rank == 0){ + printf("%s",msg); + } + // debug + //printf("[check_cuda_aware_mpi] query cuda support: MPI library CUDA-aware support - rank %d has support %d\n\n",rank,has_cuda_aware_mpi); + + // sets local rank's GPU association + if (has_cuda_aware_mpi){ + // dummy value, not needed at this point + int dummy_nb_devices; + int init_type = 1; // type 1 == only initialize, no device info output yet + // debug + //printf("debug: setting - rank %d has support %d - running GPU init\n\n",rank,has_cuda_aware_mpi); + + // sets device + FC_FUNC_(initialize_gpu_device,INITIALIZE_GPU_DEVICE)(&rank,&dummy_nb_devices,&init_type); + } + } + +#endif // WITH_CUDA_AWARE_MPI + + // return value + *has_cuda_aware_mpi_f = has_cuda_aware_mpi; } + +/* ----------------------------------------------------------------------------------------------- */ + +// note: MPIX_Query_cuda_support() can only be called after MPI_init(). +// However, for CUDA-aware MPI, we must set the device with cudaSetDevice() before MPI_init(). +// Thus, we use a compile-time check for MPIX_CUDA_AWARE_SUPPORT to see if there is CUDA-aware MPI support. +// And then use the query here after setting device and MPI initialization as a validity check of the loaded MPI system. + +extern EXTERN_LANG +void FC_FUNC_ (query_cuda_aware_mpi, + QUERY_CUDA_AWARE_MPI) (int* myrank_f, int* has_cuda_aware_mpi_f) { + + TRACE ("query_cuda_aware_mpi"); + + // rank + int myrank = *myrank_f; + + // flags + int has_cuda_aware_mpi = 0; + +#ifdef WITH_CUDA_AWARE_MPI + // debug output to file + char filename[BUFSIZ]; + FILE* fp; + const char* msg; + + sprintf(filename,OUTPUT_FILES"/gpu_aware_info.txt"); + +#if defined(MPIX_CUDA_AWARE_SUPPORT) + int ret = MPIX_Query_cuda_support(); + if (ret == 1) { + // MPI library loaded has CUDA-aware support + has_cuda_aware_mpi = 1; + msg = "CUDA-aware support is available. MPIX query returned CUDA support.\n"; + } else { + // MPI library does not have CUDA-aware support + has_cuda_aware_mpi = 0; + msg = "CUDA-aware support is disabled or unavailable. MPIX query returned no CUDA support.\n"; + } + //debug + //printf("[query_cuda_aware_mpi] myrank = %d - MPIX query: has cuda aware MPI = %d\n",myrank,has_cuda_aware_mpi); +#else + // no MPIX query support + has_cuda_aware_mpi = 0; + msg = "\ +This version has been compiled with flag WITH_CUDA_AWARE_MPI, but MPI library cannot determine if there is CUDA-aware support.\n \ +Please check MPI installation.\n"; + //debug + //printf("[query_cuda_aware_mpi] myrank = %d - no MPIX has cuda aware MPI = %d\n",myrank,has_cuda_aware_mpi); +#endif // MPIX_CUDA_AWARE_SUPPORT + + // user info + if (myrank == 0){ + printf("%s",msg); + } + + // file output + if (myrank == 0){ + fp = fopen(filename,"w"); + if (fp != NULL){ + fprintf (fp, "%s", msg); + fclose(fp); + } + } +#endif // WITH_CUDA_AWARE_MPI + + // return value + *has_cuda_aware_mpi_f = has_cuda_aware_mpi; +} + diff --git a/src/gpu/kernels/Kernel_2_viscoelastic_impl.cu b/src/gpu/kernels/Kernel_2_viscoelastic_impl.cu index dc29cb4c8..402723d92 100644 --- a/src/gpu/kernels/Kernel_2_viscoelastic_impl.cu +++ b/src/gpu/kernels/Kernel_2_viscoelastic_impl.cu @@ -218,6 +218,7 @@ __device__ __forceinline__ void compute_element_gravity(int tx,int working_eleme realw factor; // compute non-symmetric terms for gravity + rhol = get_global_cr( &d_rhostore[working_element*NGLL3_PADDED + tx] ); // get g, rho and dg/dr=dg minus_g = d_minus_g[*iglob]; @@ -226,7 +227,7 @@ __device__ __forceinline__ void compute_element_gravity(int tx,int working_eleme // Cartesian components of the gravitational acceleration //gxl = 0.f; //gyl = 0.f; - gzl = minus_g; + gzl = minus_g * rhol; // Cartesian components of gradient of gravitational acceleration // H = grad g @@ -238,13 +239,11 @@ __device__ __forceinline__ void compute_element_gravity(int tx,int working_eleme //Hxzl = 0.f; //Hyzl = 0.f; - rhol = get_global_cr( &d_rhostore[working_element*NGLL3_PADDED + tx] ); - // get displacement and multiply by density to compute G tensor // G = rho [ sg - (s * g) I ] - sx_l = rhol * sh_displx[tx]; // d_displ[iglob*3]; - sy_l = rhol * sh_disply[tx]; // d_displ[iglob*3 + 1]; - sz_l = rhol * sh_displz[tx]; // d_displ[iglob*3 + 2]; + sx_l = sh_displx[tx]; // d_displ[iglob*3]; + sy_l = sh_disply[tx]; // d_displ[iglob*3 + 1]; + sz_l = sh_displz[tx]; // d_displ[iglob*3 + 2]; // compute G tensor from s . g and add to sigma (not symmetric) //sigma_xx += sy_l*gyl + sz_l*gzl; @@ -263,7 +262,7 @@ __device__ __forceinline__ void compute_element_gravity(int tx,int working_eleme //sigma_zy -= sz_l*gyl; // precompute vector - factor = jacobianl * wgll_cube[tx]; + factor = jacobianl * wgll_cube[tx] * rhol; //rho_s_H1 = fac1 * (sx_l * Hxxl + sy_l * Hxyl + sz_l * Hxzl); //rho_s_H2 = fac1 * (sx_l * Hxyl + sy_l * Hyyl + sz_l * Hyzl); diff --git a/src/gpu/kernels/kernel_proto.cu.h b/src/gpu/kernels/kernel_proto.cu.h index 48d11096c..89c36c32a 100644 --- a/src/gpu/kernels/kernel_proto.cu.h +++ b/src/gpu/kernels/kernel_proto.cu.h @@ -1287,16 +1287,17 @@ __global__ void Kernel_2_smooth_pde(const int nb_blocks_to_compute, __global__ void kernel_3_smooth_pde_cuda_device(field* d_ddat_smooth_glob, realw_const_p rvol, - int size); + int size) ; __global__ void UpdateData_smooth_pde_kernel(field* d_dat_smooth_glob, field* d_ddat_smooth_glob, - int size); + int size) ; __global__ void zero_pml_smooth_pde_kernel(int nb_blocks_to_compute, field * d_dat_smooth_glob, const int * d_ibool, - const int * d_CPML_to_spec); + const int * d_CPML_to_spec) ; + // // src/gpu/kernels/synchronize_boundary_accel_on_device.cu diff --git a/src/gpu/lts_assembly_mpi_cuda.cu b/src/gpu/lts_assembly_mpi_cuda.cu index 9f7642767..7e81567bb 100644 --- a/src/gpu/lts_assembly_mpi_cuda.cu +++ b/src/gpu/lts_assembly_mpi_cuda.cu @@ -47,9 +47,12 @@ void FC_FUNC_(sync_copy_reduced_from_device, if (num_interface_p_refine_boundary == 0) return; // Wait until async-memcpy of outer elements is finished and start MPI. - if (*iphase != 2){ exit_on_error("sync_copy_from_device must be called for iphase == 2"); } + if (*iphase != 2){ exit_on_error("sync_copy_reduced_from_device must be called for iphase == 2"); } if (mp->size_mpi_buffer > 0){ + // safety check: CUDA-aware MPI - not fully implemented yet + if (mp->use_cuda_aware_mpi) { exit_on_error("LTS mode with CUDA-aware MPI is not fully implemented yet."); } + // waits for asynchronous copy to finish gpuStreamSynchronize(mp->copy_stream); @@ -79,6 +82,9 @@ void FC_FUNC_(test_boundary_transfer_lts, int max_num_interface_p_refine_ibool = *max_num_interface_p_refine_ibool_f; if (mp->size_mpi_buffer > 0){ + // safety check: CUDA-aware MPI - not fully implemented yet + if (mp->use_cuda_aware_mpi) { exit_on_error("LTS mode with CUDA-aware MPI is not fully implemented yet."); } + int blocksize = BLOCKSIZE_TRANSFER; int size_padded = ((int)ceil(((double)max_num_interface_p_refine_ibool)/((double)blocksize)))*blocksize; @@ -144,6 +150,9 @@ void FC_FUNC_(transfer_reduced_boundary_from_device_async_lts, if (num_interface_p_refine_boundary == 0) return; if (mp->size_mpi_buffer > 0){ + // safety check: CUDA-aware MPI - not fully implemented yet + if (mp->use_cuda_aware_mpi) { exit_on_error("LTS mode with CUDA-aware MPI is not fully implemented yet."); } + int blocksize = BLOCKSIZE_TRANSFER; int size_padded = ((int)ceil(((double)num_interface_p_refine_boundary)/((double)blocksize)))*blocksize; @@ -202,6 +211,9 @@ void FC_FUNC_(transfer_boundary_from_device_async_lts, int max_num_interface_p_refine_ibool = *max_num_interface_p_refine_ibool_f; if (mp->size_mpi_buffer > 0){ + // safety check: CUDA-aware MPI - not fully implemented yet + if (mp->use_cuda_aware_mpi) { exit_on_error("LTS mode with CUDA-aware MPI is not fully implemented yet."); } + int blocksize = BLOCKSIZE_TRANSFER; int size_padded = ((int)ceil(((double)max_num_interface_p_refine_ibool)/((double)blocksize)))*blocksize; @@ -250,7 +262,7 @@ void FC_FUNC_(transfer_boundary_from_device_async_lts, extern EXTERN_LANG void FC_FUNC_(transfer_reduced_boundary_to_device_async_lts, TRANSFER_REDUCED_BOUNDARY_TO_DEVICE_ASYNC_LTS)(long* Mesh_pointer, - realw* reduced_buffer_recv_vector_ext_mesh, + realw* buffer_reduced_recv_vector, int* num_interface_p_refine_boundary_f) { // asynchronous transfer from host to device @@ -264,8 +276,11 @@ void FC_FUNC_(transfer_reduced_boundary_to_device_async_lts, if (num_interface_p_refine_boundary == 0) return; if (mp->size_mpi_buffer > 0){ + // safety check: CUDA-aware MPI - not fully implemented yet + if (mp->use_cuda_aware_mpi) { exit_on_error("LTS mode with CUDA-aware MPI is not fully implemented yet."); } + // copy on host memory - memcpy(mp->h_recv_accel_buffer,reduced_buffer_recv_vector_ext_mesh,3*num_interface_p_refine_boundary*sizeof(realw)); + memcpy(mp->h_recv_accel_buffer,buffer_reduced_recv_vector,3*num_interface_p_refine_boundary*sizeof(realw)); // asynchronous copy to GPU using copy_stream gpuMemcpyAsync_todevice_realw(mp->d_send_accel_buffer, mp->h_recv_accel_buffer, NDIM * num_interface_p_refine_boundary, mp->copy_stream); @@ -291,7 +306,10 @@ void FC_FUNC_(assemble_mpi_device_lts, int max_num_interface_p_refine_ibool = *max_num_interface_p_refine_ibool_f; if (mp->size_mpi_buffer > 0){ + // safety check: CUDA-aware MPI - not fully implemented yet + if (mp->use_cuda_aware_mpi) { exit_on_error("LTS mode with CUDA-aware MPI is not fully implemented yet."); } + // wait for copy to finish gpuStreamSynchronize(mp->copy_stream); int blocksize = BLOCKSIZE_TRANSFER; @@ -354,7 +372,10 @@ void FC_FUNC_(assemble_reduced_mpi_device_lts, if (num_interface_p_refine_boundary == 0) return; if (mp->size_mpi_buffer > 0){ + // safety check: CUDA-aware MPI - not fully implemented yet + if (mp->use_cuda_aware_mpi) { exit_on_error("LTS mode with CUDA-aware MPI is not fully implemented yet."); } + // wait for copy to finish gpuStreamSynchronize(mp->copy_stream); int blocksize = BLOCKSIZE_TRANSFER; diff --git a/src/gpu/mesh_constants_gpu.h b/src/gpu/mesh_constants_gpu.h index 098de9e67..5440193d7 100644 --- a/src/gpu/mesh_constants_gpu.h +++ b/src/gpu/mesh_constants_gpu.h @@ -54,6 +54,17 @@ #include "config.h" +#ifdef WITH_MPI +#include +// CUDA-aware support +#ifdef WITH_CUDA_AWARE_MPI +// extension +#if defined(OPEN_MPI) +#include /* extensions */ +#endif +#endif // WITH_CUDA_AWARE_MPI +#endif // WITH_MPI + #ifdef USE_CUDA #include #include @@ -63,9 +74,6 @@ #include #endif -#ifdef WITH_MPI -#include -#endif // type of "working" variables: see also CUSTOM_REAL in constants.h // @@ -462,7 +470,6 @@ typedef struct mesh_ { int compute_and_store_strain; int approximate_hess_kl; - int use_mesh_coloring_gpu; // ------------------------------------------------------------------ // // GLL points & weights @@ -854,6 +861,15 @@ typedef struct mesh_ { int* d_lts_interface_p_refine_boundary; int lts_max_nibool_interfaces_boundary; + // ------------------------------------------------------------------ // + // optimizations + // ------------------------------------------------------------------ // + // CUDA-aware MPI flag + int use_cuda_aware_mpi; + + // mesh coloring (to avoid atomic adds) + int use_mesh_coloring_gpu; + } Mesh; /* ----------------------------------------------------------------------------------------------- */ diff --git a/src/gpu/mesh_constants_wrapper.h b/src/gpu/mesh_constants_wrapper.h index f2f50bacb..abd4ee8c1 100644 --- a/src/gpu/mesh_constants_wrapper.h +++ b/src/gpu/mesh_constants_wrapper.h @@ -52,6 +52,20 @@ static inline void gpuMemcpy_todevice_realw(realw* d_array,realw* h_array,const #endif } +static inline void gpuMemcpy_devicetodevice_realw(realw* to_array,realw* from_array,const size_t size){ + // CUDA-aware MPI copies array onto GPU from buffer allocated on device (device-to-device copy) +#ifdef USE_CUDA + if (run_cuda){ + print_CUDA_error_if_any(cudaMemcpy(to_array,from_array,size*sizeof(realw),cudaMemcpyDeviceToDevice),1801); + } +#endif +#ifdef USE_HIP + if (run_hip){ + print_HIP_error_if_any(hipMemcpy(to_array,from_array,size*sizeof(realw),hipMemcpyDeviceToDevice),1801); + } +#endif +} + static inline void gpuMemcpy_todevice_field(field* d_array,field* h_array,const size_t size){ // copies array onto GPU #ifdef USE_CUDA @@ -66,6 +80,20 @@ static inline void gpuMemcpy_todevice_field(field* d_array,field* h_array,const #endif } +static inline void gpuMemcpy_devicetodevice_field(field* to_array,field* from_array,const size_t size){ + // CUDA-aware MPI copies array onto GPU from buffer allocated on device (device-to-device copy) +#ifdef USE_CUDA + if (run_cuda){ + print_CUDA_error_if_any(cudaMemcpy(to_array,from_array,size*sizeof(field),cudaMemcpyDeviceToDevice),1802); + } +#endif +#ifdef USE_HIP + if (run_hip){ + print_HIP_error_if_any(hipMemcpy(to_array,from_array,size*sizeof(field),hipMemcpyDeviceToDevice),1802); + } +#endif +} + static inline void gpuMemcpy_todevice_int(int* d_array,int* h_array,const size_t size){ // copies array onto GPU #ifdef USE_CUDA @@ -213,6 +241,20 @@ static inline void gpuMemcpyAsync_todevice_realw(realw* d_array,realw* h_array,c #endif } +static inline void gpuMemcpyAsync_devicetodevice_realw(realw* to_array,realw* from_array,const size_t size, gpu_stream stream){ + // CUDA-aware MPI asynchronuous copy onto GPU from buffer allocated on device (device-to-device copy) +#ifdef USE_CUDA + if (run_cuda){ + cudaMemcpyAsync(to_array,from_array,size*sizeof(realw),cudaMemcpyDeviceToDevice,stream); + } +#endif +#ifdef USE_HIP + if (run_hip){ + hipMemcpyAsync(to_array,from_array,size*sizeof(realw),hipMemcpyDeviceToDevice,stream); + } +#endif +} + static inline void gpuMemcpyAsync_tohost_realw(realw* h_array,realw* d_array,const size_t size, gpu_stream stream){ // asynchronuous copy of array to CPU diff --git a/src/gpu/prepare_mesh_constants_cuda.cu b/src/gpu/prepare_mesh_constants_cuda.cu index a7be54cc0..2320c0583 100644 --- a/src/gpu/prepare_mesh_constants_cuda.cu +++ b/src/gpu/prepare_mesh_constants_cuda.cu @@ -109,7 +109,8 @@ void FC_FUNC_(prepare_constants_device, int* IS_WAVEFIELD_DISCONTINUITY, int* IS_COUPLE_WITH_INJECTION, int* UNDO_ATTENUATION_AND_OR_PML, - int* PML_CONDITIONS) { + int* PML_CONDITIONS, + int* USE_CUDA_AWARE_MPI_f) { TRACE("prepare_constants_device"); @@ -142,6 +143,9 @@ void FC_FUNC_(prepare_constants_device, mp->undo_attenuation = *UNDO_ATTENUATION_AND_OR_PML; + // CUDA-aware MPI flag + mp->use_cuda_aware_mpi = *USE_CUDA_AWARE_MPI_f; + // local time stepping initially false mp->lts_mode = 0; @@ -510,7 +514,13 @@ void FC_FUNC_(prepare_fields_acoustic_device, // mpi buffer mp->size_mpi_buffer_potential = (mp->num_interfaces_ext_mesh) * (mp->max_nibool_interfaces_ext_mesh); if (mp->size_mpi_buffer_potential > 0){ - gpuMalloc_field((void**)&(mp->d_send_potential_dot_dot_buffer),mp->size_mpi_buffer_potential); + if (mp->use_cuda_aware_mpi){ + // CUDA-aware MPI + // buffers already on device + mp->d_send_potential_dot_dot_buffer = NULL; + } else { + gpuMalloc_field((void**)&(mp->d_send_potential_dot_dot_buffer),mp->size_mpi_buffer_potential); + } } // mass matrix @@ -657,7 +667,13 @@ void FC_FUNC_(prepare_fields_acoustic_adj_dev, // mpi buffer if (mp->size_mpi_buffer_potential > 0){ - gpuMalloc_field((void**)&(mp->d_b_send_potential_dot_dot_buffer),mp->size_mpi_buffer_potential); + if (mp->use_cuda_aware_mpi) { + // CUDA-aware MPI + // buffers already on device + mp->d_b_send_potential_dot_dot_buffer = NULL; + } else { + gpuMalloc_field((void**)&(mp->d_b_send_potential_dot_dot_buffer),mp->size_mpi_buffer_potential); + } } GPU_ERROR_CHECKING("prepare_fields_acoustic_adj_dev"); @@ -766,30 +782,38 @@ void FC_FUNC_(prepare_fields_elastic_device, // MPI buffer mp->size_mpi_buffer = NDIM * (mp->num_interfaces_ext_mesh) * (mp->max_nibool_interfaces_ext_mesh); if (mp->size_mpi_buffer > 0){ - // note: Allocate pinned mpi-buffers. - // MPI buffers use pinned memory allocated by cudaMallocHost, which - // enables the use of asynchronous memory copies from host <-> device - - // send buffer - gpuMallocHost_realw((void**)&(mp->h_send_accel_buffer),mp->size_mpi_buffer); - - // unused so far.. - //mp->send_buffer = (realw*)malloc((mp->size_mpi_buffer)*sizeof(realw)); - // extra buffer for adjoint, not needed so far..., can use the same buffer for both forward/adjoint mpi exchanges - //gpuMallocHost_realw((void**)&(mp->h_send_b_accel_buffer),mp->size_mpi_buffer); - //mp->b_send_buffer = (realw*)malloc((size_mpi_buffer)*sizeof(realw)); - - // receive buffer - gpuMallocHost_realw((void**)&(mp->h_recv_accel_buffer),mp->size_mpi_buffer); - - // unused so far.. - //mp->recv_buffer = (realw*) malloc((mp->size_mpi_buffer)*sizeof(realw)); - - // non-pinned buffer - gpuMalloc_realw((void**)&(mp->d_send_accel_buffer),mp->size_mpi_buffer); - // adjoint - if (mp->simulation_type == 3){ - gpuMalloc_realw((void**)&(mp->d_b_send_accel_buffer),mp->size_mpi_buffer); + if (mp->use_cuda_aware_mpi){ + // CUDA-aware MPI + // MPI buffers already on device + mp->h_send_accel_buffer = NULL; // host buffers for async copies not needed + mp->h_recv_accel_buffer = NULL; + mp->d_send_accel_buffer = NULL; // device buffers not needed, already allocated in read_mesh_databases.F90 + mp->d_b_send_accel_buffer = NULL; + } else { + // note: Allocate pinned mpi-buffers. + // MPI buffers use pinned memory allocated by cudaMallocHost, which + // enables the use of asynchronous memory copies from host <-> device + // send buffer + gpuMallocHost_realw((void**)&(mp->h_send_accel_buffer),mp->size_mpi_buffer); + + // unused so far.. + //mp->send_buffer = (realw*)malloc((mp->size_mpi_buffer)*sizeof(realw)); + // extra buffer for adjoint, not needed so far..., can use the same buffer for both forward/adjoint mpi exchanges + //gpuMallocHost_realw((void**)&(mp->h_send_b_accel_buffer),mp->size_mpi_buffer); + //mp->b_send_buffer = (realw*)malloc((size_mpi_buffer)*sizeof(realw)); + + // receive buffer + gpuMallocHost_realw((void**)&(mp->h_recv_accel_buffer),mp->size_mpi_buffer); + + // unused so far.. + //mp->recv_buffer = (realw*) malloc((mp->size_mpi_buffer)*sizeof(realw)); + + // non-pinned buffer + gpuMalloc_realw((void**)&(mp->d_send_accel_buffer),mp->size_mpi_buffer); + // adjoint + if (mp->simulation_type == 3){ + gpuMalloc_realw((void**)&(mp->d_b_send_accel_buffer),mp->size_mpi_buffer); + } } } @@ -2017,8 +2041,10 @@ TRACE("prepare_cleanup_device"); gpuFree(mp->d_potential_dot_acoustic); gpuFree(mp->d_potential_dot_dot_acoustic); if (mp->size_mpi_buffer_potential > 0){ - gpuFree(mp->d_send_potential_dot_dot_buffer); - if (mp->simulation_type == 3) gpuFree(mp->d_b_send_potential_dot_dot_buffer); + if (! mp->use_cuda_aware_mpi){ + gpuFree(mp->d_send_potential_dot_dot_buffer); + if (mp->simulation_type == 3) gpuFree(mp->d_b_send_potential_dot_dot_buffer); + } } gpuFree(mp->d_rmass_acoustic); gpuFree(mp->d_kappastore); @@ -2054,8 +2080,10 @@ TRACE("prepare_cleanup_device"); gpuFree(mp->d_veloc); gpuFree(mp->d_accel); if (mp->size_mpi_buffer > 0){ - gpuFree(mp->d_send_accel_buffer); - if (mp->simulation_type == 3) gpuFree(mp->d_b_send_accel_buffer); + if (! mp->use_cuda_aware_mpi){ + gpuFree(mp->d_send_accel_buffer); + if (mp->simulation_type == 3) gpuFree(mp->d_b_send_accel_buffer); + } } if (! mp->lts_mode){ @@ -2284,7 +2312,10 @@ TRACE("prepare_cleanup_device"); } // releases previous contexts - gpuReset(); + // note: with CUDA-aware MPI, releasing the context before finishing MPI can lead to a PAMI error in MPI_Finalize(): + // Cuda failure .. /pami/components/devices/shmem/ShmemDevice.h:425: 'context is destroyed' + // thus, we only explicitly release it if no CUDA-aware MPI was used, otherwise let the system handle it. + if (! mp->use_cuda_aware_mpi){ gpuReset(); } // mesh pointer - not needed anymore free(mp); diff --git a/src/gpu/specfem3D_gpu_cuda_method_stubs.c b/src/gpu/specfem3D_gpu_cuda_method_stubs.c index 41148ed47..90387e612 100644 --- a/src/gpu/specfem3D_gpu_cuda_method_stubs.c +++ b/src/gpu/specfem3D_gpu_cuda_method_stubs.c @@ -64,7 +64,8 @@ void FC_FUNC_(transfer_boun_accel_from_device, const int* FORWARD_OR_ADJOINT){} void FC_FUNC_(transfer_boundary_from_device_a, - TRANSFER_BOUNDARY_FROM_DEVICE_A)(long* Mesh_pointer) {} + TRANSFER_BOUNDARY_FROM_DEVICE_A)(long* Mesh_pointer, + realw* send_accel_buffer) {} void FC_FUNC_(transfer_boundary_to_device_a, TRANSFER_BOUNDARY_TO_DEVICE_A)(long* Mesh_pointer, @@ -75,11 +76,6 @@ void FC_FUNC_(transfer_asmbl_accel_to_device, realw* buffer_recv_vector_ext_mesh, const int* FORWARD_OR_ADJOINT) {} -void FC_FUNC_(transfer_sync_accel_to_device, - TRANSFER_ASMBL_ACCEL_TO_DEVICE)(long* Mesh_pointer, - realw* buffer_recv_vector_ext_mesh, - const int* FORWARD_OR_ADJOINT) {} - void FC_FUNC_(sync_copy_from_device, SYNC_copy_FROM_DEVICE)(long* Mesh_pointer, int* iphase, @@ -434,17 +430,29 @@ void FC_FUNC_(fault_solver_gpu, void FC_FUNC_(pause_for_debug, PAUSE_FOR_DEBUG)() {} +void FC_FUNC_ (allocate_gpu_buffer, + ALLOCATE_GPU_BUFFER) (realw** buffer_f, int* total_size) {} + +void FC_FUNC_ (check_gpu_pointer, + CHECK_GPU_POINTER)(void* ptr) {} + // // src/gpu/initialize_gpu.cu // void FC_FUNC_(initialize_gpu_device, - INITIALIZE_GPU_DEVICE)(int* myrank_f,int* ncuda_devices) { + INITIALIZE_GPU_DEVICE)(int* myrank_f,int* nb_devices,int* cuda_aware_mpi_init_type) { fprintf(stderr,"ERROR: GPU_MODE enabled without GPU/CUDA/HIP Support. To enable GPU support, reconfigure with --with-cuda or --with-hip flag.\n"); exit(1); } +void FC_FUNC_ (check_cuda_aware_mpi, + CHECK_CUDA_AWARE_MPI) (int* has_cuda_aware_mpi_f) {} + +void FC_FUNC_ (query_cuda_aware_mpi, + QUERY_CUDA_AWARE_MPI) (int* myrank_f, int* has_cuda_aware_mpi_f) {} + // // src/gpu/lts_assembly_mpi_cuda.cu @@ -474,7 +482,7 @@ void FC_FUNC_(transfer_boundary_from_device_async_lts, void FC_FUNC_(transfer_reduced_boundary_to_device_async_lts, TRANSFER_REDUCED_BOUNDARY_TO_DEVICE_ASYNC_LTS)(long* Mesh_pointer, - realw* reduced_buffer_recv_vector_ext_mesh, + realw* buffer_reduced_recv_vector, int* num_interface_p_refine_boundary_f) {} void FC_FUNC_(assemble_mpi_device_lts, @@ -619,7 +627,8 @@ void FC_FUNC_(prepare_constants_device, int* IS_WAVEFIELD_DISCONTINUITY, int* IS_COUPLE_WITH_INJECTION, int* UNDO_ATTENUATION_AND_OR_PML, - int* PML_CONDITIONS) {} + int* PML_CONDITIONS, + int* USE_CUDA_AWARE_MPI_f) {} void FC_FUNC_(prepare_fields_acoustic_device, PREPARE_FIELDS_ACOUSTIC_DEVICE)(long* Mesh_pointer, @@ -836,6 +845,7 @@ void FC_FUNC_(get_smooth_gpu, GET_SMOOTH_gpu)(long * smooth_pointer, realw * data_smooth) {} + // // src/gpu/smooth_pde_cuda.cu // @@ -874,8 +884,7 @@ void FC_FUNC_(kernel_3_smooth_pde_cuda, void FC_FUNC_(update_dat_smooth_pde_cuda, UPDATE_DAT_SMOOTH_PDE_CUDA)(long * Mesh_pointer, - long * Container_smooth_pde - ) {} + long * Container_smooth_pde) {} void FC_FUNC_(zero_pml_smooth_pde_cuda, ZERO_PML_SMOOTH_PDE_CUDA)(long * Mesh_pointer, @@ -884,13 +893,14 @@ void FC_FUNC_(zero_pml_smooth_pde_cuda, void FC_FUNC_(get_norm_smooth_pde_from_device, GET_NORM_SMOOTH_PDE_FROM_DEVICE)(long * Mesh_pointer, long * Container_smooth_pde, - realw * norm, int* ind_val){} + realw * norm, int * ind_val){} void FC_FUNC_(transfer_dat_smooth_pde_from_device, TRANSFER_DAT_SMOOTH_PDE_FROM_DEVICE)(long * Mesh_pointer, long * Container_smooth_pde, realw* dat_smooth_glob){} + // // src/gpu/transfer_fields_cuda.cu // diff --git a/src/inverse_problem_for_model/parametrisation/elastic_isotropic_mod.f90 b/src/inverse_problem_for_model/parametrisation/elastic_isotropic_mod.f90 index bb36b354b..4e93b118b 100644 --- a/src/inverse_problem_for_model/parametrisation/elastic_isotropic_mod.f90 +++ b/src/inverse_problem_for_model/parametrisation/elastic_isotropic_mod.f90 @@ -127,7 +127,7 @@ function rho_lambda_mu_to_rho_kappa_mu(param_in,param_out) real, dimension(:,:,:,:,:), allocatable, intent(in) :: param_in real, dimension(:,:,:,:,:), allocatable, intent(out) :: param_out param_out(:,:,:,:,1) = param_in(:,:,:,:,1) - param_out(:,:,:,:,2) = param_in(:,:,:,:,2) + 2.*param_in(:,:,:,:,3))/ 3. + param_out(:,:,:,:,2) = param_in(:,:,:,:,2) + 2. * param_in(:,:,:,:,3) / 3. param_out(:,:,:,:,3) = param_in(:,:,:,:,3) end function rho_lambda_mu_to_rho_kappa_mu @@ -143,7 +143,7 @@ function rho_kappa_mu_to_rho_lambda_mu(param_in,param_out) real, dimension(:,:,:,:,:), allocatable, intent(in) :: param_in real, dimension(:,:,:,:,:), allocatable, intent(out) :: param_out param_out(:,:,:,:,1) = param_in(:,:,:,:,1) - param_out(:,:,:,:,2) = param_in(:,:,:,:,2) - 2.*param_in(:,:,:,:,3))/ 3. + param_out(:,:,:,:,2) = param_in(:,:,:,:,2) - 2. * param_in(:,:,:,:,3) / 3. param_out(:,:,:,:,3) = param_in(:,:,:,:,3) end function rho_kappa_mu_to_rho_lambda_mu !-------------------------------------------------------------------------------- diff --git a/src/inverse_problem_for_model/rules.mk b/src/inverse_problem_for_model/rules.mk index c24535046..c256c68c0 100644 --- a/src/inverse_problem_for_model/rules.mk +++ b/src/inverse_problem_for_model/rules.mk @@ -132,6 +132,7 @@ inverse_problem_for_model_OBJECTS += \ $O/compute_forces_acoustic.spec.o \ $O/compute_forces_viscoelastic_calling_routine.spec.o \ $O/compute_forces_viscoelastic.spec.o \ + $O/compute_element.spec.o \ $O/compute_element_att_memory.spec.o \ $O/compute_element_strain.spec.o \ $O/compute_forces_poro_fluid_part.spec.o \ diff --git a/src/meshfem3D/check_mesh_quality.f90 b/src/meshfem3D/check_mesh_quality.f90 index a8e0a913c..f5b004f6a 100644 --- a/src/meshfem3D/check_mesh_quality.f90 +++ b/src/meshfem3D/check_mesh_quality.f90 @@ -363,7 +363,7 @@ subroutine create_mesh_quality_data_3D(x,y,z,ibool,ispec,NSPEC,NGLOB,VP_MAX,dt_s equiangle_skewness,edge_aspect_ratio,diagonal_aspect_ratio, & stability,distmin,distmax) - use constants, only: NGNOD_EIGHT_CORNERS,PI,HUGEVAL + use constants, only: NGNOD_EIGHT_CORNERS,PI,HUGEVAL,ZERO use constants_meshfem, only: NGLLX_M,NGLLY_M,NGLLZ_M implicit none @@ -515,6 +515,13 @@ subroutine create_mesh_quality_data_3D(x,y,z,ibool,ispec,NSPEC,NGLOB,VP_MAX,dt_s norm_A = sqrt(vectorA_x**2 + vectorA_y**2 + vectorA_z**2) norm_B = sqrt(vectorB_x**2 + vectorB_y**2 + vectorB_z**2) + ! sanity check + if (norm_A <= ZERO .or. norm_B <= ZERO) then + print *,'Error: invalid norm detected in face ',iface,' corner ',icorner + print *,' norm_A, norm_B = ',norm_A, norm_B + stop 'Error in the norm found' + endif + ! angle formed by the two vectors argument_of_arccos = (vectorA_x*vectorB_x + vectorA_y*vectorB_y + vectorA_z*vectorB_z) / (norm_A * norm_B) diff --git a/src/meshfem3D/read_value_mesh_parameters.f90 b/src/meshfem3D/read_value_mesh_parameters.f90 index cfff31e9a..8b6475fcf 100644 --- a/src/meshfem3D/read_value_mesh_parameters.f90 +++ b/src/meshfem3D/read_value_mesh_parameters.f90 @@ -603,7 +603,7 @@ logical function is_digit_alpha(char) is_digit_alpha = .false. - if (index('0123456789.de-', char) /= 0) then + if (index('0123456789.dDeE-+', char) /= 0) then is_digit_alpha = .true. endif diff --git a/src/meshfem3D/save_mesh_as_cubit.f90 b/src/meshfem3D/save_mesh_as_cubit.f90 index feeb743c0..f659f928e 100644 --- a/src/meshfem3D/save_mesh_as_cubit.f90 +++ b/src/meshfem3D/save_mesh_as_cubit.f90 @@ -84,7 +84,7 @@ subroutine save_mesh_files_as_cubit(nspec,nglob, & ! safety check ! only for single process at the moment - if (NPROC_XI /= 1 .and. NPROC_ETA /= 1) then + if (.not. (NPROC_XI == 1 .and. NPROC_ETA == 1)) then print *,'Error: SAVE_MESH_AS_CUBIT output requires NPROC_XI == NPROC_ETA == 1' print *,' using NPROC_XI = ',NPROC_XI,' and NPROC_ETA = ',NPROC_ETA print *,'Please update your Mesh_Par_file and re-run the mesher...' @@ -393,7 +393,7 @@ subroutine save_mesh_files_for_coupled_model(nspec, & if (INJECTION_TECHNIQUE_TYPE /= INJECTION_TECHNIQUE_IS_AXISEM) return ! only for single process at the moment - if (NPROC_XI /= 1 .and. NPROC_ETA /= 1) then + if (.not. (NPROC_XI == 1 .and. NPROC_ETA == 1)) then print *,'Error: SAVE_MESH_AS_CUBIT output requires NPROC_XI == NPROC_ETA == 1' print *,' using NPROC_XI = ',NPROC_XI,' and NPROC_ETA = ',NPROC_ETA print *,'Please update your Mesh_Par_file and re-run the mesher...' diff --git a/src/shared/assemble_MPI_scalar.f90 b/src/shared/assemble_MPI_scalar.f90 index 2daf02596..c28662699 100644 --- a/src/shared/assemble_MPI_scalar.f90 +++ b/src/shared/assemble_MPI_scalar.f90 @@ -387,10 +387,10 @@ subroutine assemble_MPI_scalar_i_max(NPROC,NGLOB_AB,array_val, & integer, dimension(max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),intent(in) :: ibool_interfaces_ext_mesh ! local parameters - integer, dimension(:,:), allocatable :: buffer_send_scalar_ext_mesh - integer, dimension(:,:), allocatable :: buffer_recv_scalar_ext_mesh - integer, dimension(:), allocatable :: request_send_scalar_ext_mesh - integer, dimension(:), allocatable :: request_recv_scalar_ext_mesh + integer, dimension(:,:), allocatable :: buffer_send_scalar_local + integer, dimension(:,:), allocatable :: buffer_recv_scalar_local + integer, dimension(:), allocatable :: request_send_scalar_local + integer, dimension(:), allocatable :: request_recv_scalar_local integer :: ipoin,iinterface,ier @@ -401,19 +401,19 @@ subroutine assemble_MPI_scalar_i_max(NPROC,NGLOB_AB,array_val, & ! assemble only if more than one partition if (NPROC > 1) then - allocate(buffer_send_scalar_ext_mesh(max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if ( ier /= 0 ) stop 'error allocating array buffer_send_scalar_ext_mesh' - allocate(buffer_recv_scalar_ext_mesh(max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if ( ier /= 0 ) stop 'error allocating array buffer_recv_scalar_ext_mesh' - allocate(request_send_scalar_ext_mesh(num_interfaces_ext_mesh),stat=ier) - if ( ier /= 0 ) stop 'error allocating array request_send_scalar_ext_mesh' - allocate(request_recv_scalar_ext_mesh(num_interfaces_ext_mesh),stat=ier) - if ( ier /= 0 ) stop 'error allocating array request_recv_scalar_ext_mesh' + allocate(buffer_send_scalar_local(max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if ( ier /= 0 ) stop 'error allocating array buffer_send_scalar_local' + allocate(buffer_recv_scalar_local(max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if ( ier /= 0 ) stop 'error allocating array buffer_recv_scalar_local' + allocate(request_send_scalar_local(num_interfaces_ext_mesh),stat=ier) + if ( ier /= 0 ) stop 'error allocating array request_send_scalar_local' + allocate(request_recv_scalar_local(num_interfaces_ext_mesh),stat=ier) + if ( ier /= 0 ) stop 'error allocating array request_recv_scalar_local' ! partition border copy into the buffer do iinterface = 1, num_interfaces_ext_mesh do ipoin = 1, nibool_interfaces_ext_mesh(iinterface) - buffer_send_scalar_ext_mesh(ipoin,iinterface) = & + buffer_send_scalar_local(ipoin,iinterface) = & array_val(ibool_interfaces_ext_mesh(ipoin,iinterface)) enddo enddo @@ -421,42 +421,42 @@ subroutine assemble_MPI_scalar_i_max(NPROC,NGLOB_AB,array_val, & ! send messages do iinterface = 1, num_interfaces_ext_mesh ! non-blocking synchronous send request - call isend_i(buffer_send_scalar_ext_mesh(1:nibool_interfaces_ext_mesh(iinterface),iinterface), & + call isend_i(buffer_send_scalar_local(1:nibool_interfaces_ext_mesh(iinterface),iinterface), & nibool_interfaces_ext_mesh(iinterface), & my_neighbors_ext_mesh(iinterface), & itag, & - request_send_scalar_ext_mesh(iinterface)) + request_send_scalar_local(iinterface)) ! receive request - call irecv_i(buffer_recv_scalar_ext_mesh(1:nibool_interfaces_ext_mesh(iinterface),iinterface), & + call irecv_i(buffer_recv_scalar_local(1:nibool_interfaces_ext_mesh(iinterface),iinterface), & nibool_interfaces_ext_mesh(iinterface), & my_neighbors_ext_mesh(iinterface), & itag, & - request_recv_scalar_ext_mesh(iinterface)) + request_recv_scalar_local(iinterface)) enddo ! wait for communications completion do iinterface = 1, num_interfaces_ext_mesh - call wait_req(request_recv_scalar_ext_mesh(iinterface)) + call wait_req(request_recv_scalar_local(iinterface)) enddo ! takes only highest value which occurrs on interface points do iinterface = 1, num_interfaces_ext_mesh do ipoin = 1, nibool_interfaces_ext_mesh(iinterface) - if (array_val(ibool_interfaces_ext_mesh(ipoin,iinterface)) < buffer_recv_scalar_ext_mesh(ipoin,iinterface)) then - array_val(ibool_interfaces_ext_mesh(ipoin,iinterface)) = buffer_recv_scalar_ext_mesh(ipoin,iinterface) + if (array_val(ibool_interfaces_ext_mesh(ipoin,iinterface)) < buffer_recv_scalar_local(ipoin,iinterface)) then + array_val(ibool_interfaces_ext_mesh(ipoin,iinterface)) = buffer_recv_scalar_local(ipoin,iinterface) endif enddo enddo ! wait for communications completion (send) do iinterface = 1, num_interfaces_ext_mesh - call wait_req(request_send_scalar_ext_mesh(iinterface)) + call wait_req(request_send_scalar_local(iinterface)) enddo - deallocate(buffer_send_scalar_ext_mesh) - deallocate(buffer_recv_scalar_ext_mesh) - deallocate(request_send_scalar_ext_mesh) - deallocate(request_recv_scalar_ext_mesh) + deallocate(buffer_send_scalar_local) + deallocate(buffer_recv_scalar_local) + deallocate(request_send_scalar_local) + deallocate(request_recv_scalar_local) endif end subroutine assemble_MPI_scalar_i_max diff --git a/src/shared/define_derivation_matrices.f90 b/src/shared/define_derivation_matrices.f90 index 83dcd6342..0b81641cb 100644 --- a/src/shared/define_derivation_matrices.f90 +++ b/src/shared/define_derivation_matrices.f90 @@ -28,7 +28,7 @@ subroutine define_derivation_matrices(xigll,yigll,zigll,wxgll,wygll,wzgll, & hprime_xx,hprime_yy,hprime_zz, & hprimewgll_xx,hprimewgll_yy,hprimewgll_zz, & - wgllwgll_xy,wgllwgll_xz,wgllwgll_yz) + wgllwgll_xy,wgllwgll_xz,wgllwgll_yz,wgll_cube) use constants, only: CUSTOM_REAL,NGLLX,NGLLY,NGLLZ,GAUSSALPHA,GAUSSBETA @@ -47,6 +47,9 @@ subroutine define_derivation_matrices(xigll,yigll,zigll,wxgll,wygll,wzgll, & real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLZ), intent(out) :: wgllwgll_xz real(kind=CUSTOM_REAL), dimension(NGLLY,NGLLZ), intent(out) :: wgllwgll_yz + ! array with all the weights in the cube + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ),intent(out) :: wgll_cube + ! function for calculating derivatives of Lagrange polynomials double precision, external :: lagrange_deriv_GLL @@ -99,5 +102,13 @@ subroutine define_derivation_matrices(xigll,yigll,zigll,wxgll,wygll,wzgll, & enddo enddo + do i = 1,NGLLX + do j = 1,NGLLY + do k = 1,NGLLZ + wgll_cube(i,j,k) = real(wxgll(i)*wygll(j)*wzgll(k), kind=CUSTOM_REAL) + enddo + enddo + enddo + end subroutine define_derivation_matrices diff --git a/src/shared/read_parameter_file.F90 b/src/shared/read_parameter_file.F90 index dd47d85c0..7654d99aa 100644 --- a/src/shared/read_parameter_file.F90 +++ b/src/shared/read_parameter_file.F90 @@ -222,6 +222,14 @@ subroutine read_parameter_file(BROADCAST_AFTER_READ) write(*,*) endif + ! (optional) gravity + call read_value_logical(USE_GRAVITY_MINMAX, 'USE_GRAVITY_MINMAX', ier); ier = 0 + if (USE_GRAVITY_MINMAX) then + call read_value_double_precision(GRAVITY_MINMAX_TOP, 'GRAVITY_MINMAX_TOP', ier); ier = 0 + call read_value_double_precision(GRAVITY_MINMAX_BOTTOM, 'GRAVITY_MINMAX_BOTTOM', ier); ier = 0 + endif + + ! attenuation call read_value_double_precision(ATTENUATION_f0_REFERENCE, 'ATTENUATION_f0_REFERENCE', ier) if (ier /= 0) then some_parameters_missing_from_Par_file = .true. @@ -434,16 +442,14 @@ subroutine read_parameter_file(BROADCAST_AFTER_READ) write(*,*) endif - ! read two flags in CMT + FORCE simulation - call read_value_logical(USE_CMT_AND_FORCE_SOURCE, 'USE_CMT_AND_FORCE_SOURCE', ier) - ier = 0 + ! (optional) read two flags in CMT + FORCE simulation + call read_value_logical(USE_CMT_AND_FORCE_SOURCE, 'USE_CMT_AND_FORCE_SOURCE', ier); ier = 0 if (USE_CMT_AND_FORCE_SOURCE) then ! write(*,'(a)') 'cmt + force simulation is enabled' USE_FORCE_POINT_SOURCE = .true. endif - call read_value_logical(USE_BINARY_SOURCE_FILE, 'USE_BINARY_SOURCE_FILE', ier) - ier = 0 + call read_value_logical(USE_BINARY_SOURCE_FILE, 'USE_BINARY_SOURCE_FILE', ier); ier = 0 if (.not. USE_CMT_AND_FORCE_SOURCE) USE_BINARY_SOURCE_FILE = .false. ! binary file is disabled call read_value_logical(USE_RICKER_TIME_FUNCTION, 'USE_RICKER_TIME_FUNCTION', ier) @@ -711,9 +717,8 @@ subroutine read_parameter_file(BROADCAST_AFTER_READ) !------------------------------------------------------- - ! prescribed wavefield discontinuity on an interface - ! if these parameters do not exist in Par_file, then wavefield - ! is not switched on by default + ! (optional) prescribed wavefield discontinuity on an interface + ! if these parameters do not exist in Par_file, then wavefield is not switched on by default call read_value_logical(IS_WAVEFIELD_DISCONTINUITY, 'IS_WAVEFIELD_DISCONTINUITY', ier); ier = 0 if (IS_WAVEFIELD_DISCONTINUITY) write(*,'(a)') 'wavefield discontinuity enabled' @@ -1453,6 +1458,11 @@ subroutine broadcast_computed_parameters() call bcast_all_singlel(ANISOTROPY) call bcast_all_singlel(GRAVITY) + ! (optional) gravity min/max + call bcast_all_singlel(USE_GRAVITY_MINMAX) + call bcast_all_singledp(GRAVITY_MINMAX_TOP) + call bcast_all_singledp(GRAVITY_MINMAX_BOTTOM) + call bcast_all_singledp(ATTENUATION_f0_REFERENCE) call bcast_all_singledp(MIN_ATTENUATION_PERIOD) call bcast_all_singledp(MAX_ATTENUATION_PERIOD) diff --git a/src/shared/shared_par.F90 b/src/shared/shared_par.F90 index 7c422ddf9..e00d2bf96 100644 --- a/src/shared/shared_par.F90 +++ b/src/shared/shared_par.F90 @@ -61,7 +61,7 @@ module shared_input_parameters ! holds input parameters given in DATA/Par_file - use constants, only: MAX_STRING_LEN + use constants, only: MAX_STRING_LEN,STANDARD_GRAVITY implicit none @@ -226,6 +226,11 @@ module shared_input_parameters ! Moon's Lunar Projections (LTM/LPS) instead of UTM logical :: USE_LUNAR_PROJECTIONS = .false. + ! (optional) gravity min/max values + logical :: USE_GRAVITY_MINMAX = .false. + double precision :: GRAVITY_MINMAX_TOP = STANDARD_GRAVITY ! default in m/s^2 + double precision :: GRAVITY_MINMAX_BOTTOM = STANDARD_GRAVITY + end module shared_input_parameters ! diff --git a/src/shared/write_VTK_data.f90 b/src/shared/write_VTK_data.f90 index 5d6fb1876..0cfce4f53 100644 --- a/src/shared/write_VTK_data.f90 +++ b/src/shared/write_VTK_data.f90 @@ -1629,6 +1629,75 @@ subroutine write_VTK_wavefield(nspec,nglob,xstore,ystore,zstore,ibool, & end subroutine write_VTK_wavefield +! +!------------------------------------------------------------------------------------------------- +! + + subroutine write_VTK_wavefield_scalar(nspec,nglob,xstore,ystore,zstore,ibool, & + field,prname_file) + +! scalar wavefield output + + use constants, only: CUSTOM_REAL,MAX_STRING_LEN,IOUT_VTK,NGLLX,NGLLY,NGLLZ + + implicit none + + integer,intent(in) :: nspec,nglob + + ! global coordinates + integer, dimension(NGLLX,NGLLY,NGLLZ,nspec),intent(in) :: ibool + real(kind=CUSTOM_REAL), dimension(nglob),intent(in) :: xstore,ystore,zstore + + ! GLL data values array + real(kind=CUSTOM_REAL), dimension(nglob),intent(in) :: field + + ! file name + character(len=MAX_STRING_LEN),intent(in) :: prname_file + + ! local parameters + integer :: ispec,i + + open(IOUT_VTK,file=prname_file(1:len_trim(prname_file))//'.vtk',status='unknown') + write(IOUT_VTK,'(a)') '# vtk DataFile Version 3.1' + write(IOUT_VTK,'(a)') 'material model VTK file' + write(IOUT_VTK,'(a)') 'ASCII' + write(IOUT_VTK,'(a)') 'DATASET UNSTRUCTURED_GRID' + write(IOUT_VTK, '(a,i12,a)') 'POINTS ', nglob, ' float' + do i = 1,nglob + write(IOUT_VTK,'(3e18.6)') xstore(i),ystore(i),zstore(i) + enddo + write(IOUT_VTK,*) "" + + ! note: indices for vtk start at 0 + write(IOUT_VTK,'(a,i12,i12)') "CELLS ",nspec,nspec*9 + do ispec = 1,nspec + write(IOUT_VTK,'(9i12)') 8, & + ibool(1,1,1,ispec)-1,ibool(NGLLX,1,1,ispec)-1, & + ibool(NGLLX,NGLLY,1,ispec)-1,ibool(1,NGLLY,1,ispec)-1, & + ibool(1,1,NGLLZ,ispec)-1,ibool(NGLLX,1,NGLLZ,ispec)-1, & + ibool(NGLLX,NGLLY,NGLLZ,ispec)-1,ibool(1,NGLLY,NGLLZ,ispec)-1 + enddo + write(IOUT_VTK,*) "" + + ! type: hexahedrons + write(IOUT_VTK,'(a,i12)') "CELL_TYPES ",nspec + write(IOUT_VTK,'(6i12)') (12,ispec=1,nspec) + write(IOUT_VTK,*) "" + + write(IOUT_VTK,'(a,i12)') "POINT_DATA ",nglob + + ! single wavefield component + write(IOUT_VTK,'(a)') "SCALARS field float" + write(IOUT_VTK,'(a)') "LOOKUP_TABLE default" + do i = 1,nglob + write(IOUT_VTK,*) field(i) + enddo + write(IOUT_VTK,*) "" + + close(IOUT_VTK) + + end subroutine write_VTK_wavefield_scalar + !------------------------------------------------------------------------------------------------- ! ! VTU binary formats diff --git a/src/specfem3D/assemble_MPI_vector.f90 b/src/specfem3D/assemble_MPI_vector.f90 index e830cad67..5ff51e9c6 100644 --- a/src/specfem3D/assemble_MPI_vector.f90 +++ b/src/specfem3D/assemble_MPI_vector.f90 @@ -707,6 +707,9 @@ subroutine assemble_MPI_vector_send_cuda(NPROC, & use constants, only: NDIM,CUSTOM_REAL,itag + !debug + !use specfem_par, only: USE_CUDA_AWARE_MPI + implicit none integer,intent(in) :: NPROC @@ -730,6 +733,9 @@ subroutine assemble_MPI_vector_send_cuda(NPROC, & ! send messages do iinterface = 1, num_interfaces_ext_mesh + !debug + !if (USE_CUDA_AWARE_MPI) call check_gpu_pointer(buffer_send_vector_ext_mesh(1,1,iinterface)) + call isend_cr(buffer_send_vector_ext_mesh(1,1,iinterface), & NDIM*nibool_interfaces_ext_mesh(iinterface), & my_neighbors_ext_mesh(iinterface), & diff --git a/src/specfem3D/compute_element.F90 b/src/specfem3D/compute_element.F90 new file mode 100644 index 000000000..b479b9511 --- /dev/null +++ b/src/specfem3D/compute_element.F90 @@ -0,0 +1,761 @@ +!===================================================================== +! +! S p e c f e m 3 D +! ----------------- +! +! Main historical authors: Dimitri Komatitsch and Jeroen Tromp +! CNRS, France +! and Princeton University, USA +! (there are currently many more authors!) +! (c) October 2017 +! +! This program is free software; you can redistribute it and/or modify +! it under the terms of the GNU General Public License as published by +! the Free Software Foundation; either version 3 of the License, or +! (at your option) any later version. +! +! This program is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU General Public License for more details. +! +! You should have received a copy of the GNU General Public License along +! with this program; if not, write to the Free Software Foundation, Inc., +! 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +! +!===================================================================== + +! we switch between vectorized and non-vectorized version by using pre-processor flag FORCE_VECTORIZATION +! and macros INDEX_IJK, DO_LOOP_IJK, ENDDO_LOOP_IJK defined in config.fh +#include "config.fh" + +module mod_element + + implicit none + + private + + public :: compute_element_iso + public :: compute_element_aniso + +contains + + +!-------------------------------------------------------------------------------------------- +! +! isotropic element +! +!-------------------------------------------------------------------------------------------- + + pure subroutine compute_element_iso(ispec,ispec_irreg, & + minus_g,minus_deriv_gravity,rho_s_H, & + xixstore,xiystore,xizstore,etaxstore,etaystore,etazstore, & + gammaxstore,gammaystore,gammazstore,jacobianstore, & + duxdxl,duxdyl,duxdzl,duydxl,duydyl,duydzl,duzdxl,duzdyl,duzdzl, & + wgll_cube, & + kappastore,mustore, & + ibool, & + R_xx,R_yy,R_xy,R_xz,R_yz,R_trace, & + stress_xx,stress_yy,stress_zz,stress_xy,stress_xz,stress_yz, & + tempx1,tempx2,tempx3,tempy1,tempy2,tempy3,tempz1,tempz2,tempz3, & + dummyx_loc,dummyy_loc,dummyz_loc) + +! isotropic element in viscoelastic domain + + use constants, only: CUSTOM_REAL,NGLLX,NGLLY,NGLLZ,NDIM,N_SLS + + use shared_parameters, only: ATTENUATION, GRAVITY, MOVIE_VOLUME_STRESS + + use specfem_par_coupling, only: do_save_coupling_wavefield + + use specfem_par, only: & + NSPEC => NSPEC_AB, & + NGLOB => NGLOB_AB, & + NSPEC_ATTENUATION => NSPEC_ATTENUATION_AB + + use specfem_par, only: xix_regular, jacobian_regular + + ! PML + use pml_par, only: is_CPML + +#ifdef FORCE_VECTORIZATION + use constants, only: NGLLCUBE +#endif + + implicit none + + ! element id + integer,intent(in) :: ispec,ispec_irreg + + ! arrays with mesh parameters per slice + integer, dimension(NGLLX,NGLLY,NGLLZ,NSPEC),intent(in) :: ibool + + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ,NSPEC),intent(in) :: & + xixstore,xiystore,xizstore, & + etaxstore,etaystore,etazstore, & + gammaxstore,gammaystore,gammazstore,jacobianstore + + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ), intent(in) :: & + duxdxl,duxdyl,duxdzl,duydxl,duydyl,duydzl,duzdxl,duzdyl,duzdzl + + ! array with derivatives of Lagrange polynomials and precalculated products + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ),intent(in) :: wgll_cube + + ! isotropic properties + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ,NSPEC),intent(in) :: kappastore,mustore + + ! attenuation + ! memory variables for attenuation + ! memory variables R_ij are stored at the local rather than global level + ! to allow for optimization of cache access by compiler + real(kind=CUSTOM_REAL), dimension(N_SLS,NGLLX,NGLLY,NGLLZ,NSPEC_ATTENUATION),intent(in) :: R_xx,R_yy,R_xy,R_xz,R_yz + real(kind=CUSTOM_REAL), dimension(N_SLS,NGLLX,NGLLY,NGLLZ,NSPEC_ATTENUATION),intent(in) :: R_trace + + ! gravity + real(kind=CUSTOM_REAL),dimension(NGLOB),intent(in) :: minus_g,minus_deriv_gravity + real(kind=CUSTOM_REAL), dimension(NDIM,NGLLX,NGLLY,NGLLZ),intent(inout) :: rho_s_H + + ! movie + real(kind=CUSTOM_REAL),dimension(NGLLX,NGLLY,NGLLZ,NSPEC),intent(inout) :: & + stress_xx,stress_yy,stress_zz,stress_xy,stress_xz,stress_yz + + ! element info + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ),intent(inout) :: & + tempx1,tempx2,tempx3,tempy1,tempy2,tempy3,tempz1,tempz2,tempz3 + + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ),intent(in) :: dummyx_loc,dummyy_loc,dummyz_loc + + ! local parameters + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ) :: sigma_xx,sigma_yy,sigma_zz + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ) :: sigma_xy,sigma_xz,sigma_yz,sigma_yx,sigma_zx,sigma_zy + + real(kind=CUSTOM_REAL) :: xixl,xiyl,xizl,etaxl,etayl,etazl,gammaxl,gammayl,gammazl,jacobianl + real(kind=CUSTOM_REAL) :: R_trace_kappa_sum,R_xx_sum,R_yy_sum + + real(kind=CUSTOM_REAL) :: lambdal,mul,lambdalplus2mul + real(kind=CUSTOM_REAL) :: kappal + + real(kind=CUSTOM_REAL), parameter :: FOUR_THIRDS = 4.0_CUSTOM_REAL / 3.0_CUSTOM_REAL + +#ifdef FORCE_VECTORIZATION +! in this vectorized version we have to assume that N_SLS == 3 in order to be able to unroll and thus suppress +! an inner loop that would otherwise prevent vectorization; this is safe in practice in all cases because N_SLS == 3 +! in all known applications, and in the main program we check that N_SLS == 3 if FORCE_VECTORIZATION is used and we stop + integer :: ijk +#else + integer :: i,j,k +#endif + + ! + ! compute stress for isotropic element + ! + DO_LOOP_IJK + ! elastic parameters + kappal = kappastore(INDEX_IJK,ispec) + mul = mustore(INDEX_IJK,ispec) + + lambdalplus2mul = kappal + FOUR_THIRDS * mul + lambdal = lambdalplus2mul - 2._CUSTOM_REAL * mul + + ! compute stress sigma + sigma_xx(INDEX_IJK) = lambdalplus2mul * duxdxl(INDEX_IJK) + lambdal * (duydyl(INDEX_IJK) + duzdzl(INDEX_IJK)) + sigma_yy(INDEX_IJK) = lambdalplus2mul * duydyl(INDEX_IJK) + lambdal * (duxdxl(INDEX_IJK) + duzdzl(INDEX_IJK)) + sigma_zz(INDEX_IJK) = lambdalplus2mul * duzdzl(INDEX_IJK) + lambdal * (duxdxl(INDEX_IJK) + duydyl(INDEX_IJK)) + + sigma_xy(INDEX_IJK) = mul * (duxdyl(INDEX_IJK) + duydxl(INDEX_IJK)) + sigma_xz(INDEX_IJK) = mul * (duzdxl(INDEX_IJK) + duxdzl(INDEX_IJK)) + sigma_yz(INDEX_IJK) = mul * (duzdyl(INDEX_IJK) + duydzl(INDEX_IJK)) + + ! subtract memory variables if attenuation + if (ATTENUATION .and. .not. is_CPML(ispec)) then + R_xx_sum = sum(R_xx(:,INDEX_IJK,ispec)) + R_yy_sum = sum(R_yy(:,INDEX_IJK,ispec)) + R_trace_kappa_sum = sum(R_trace(:,INDEX_IJK,ispec)) + + ! in case no bulk attenuation is desired: + !R_trace_kappa_sum = 0.0 + + sigma_xx(INDEX_IJK) = sigma_xx(INDEX_IJK) - R_xx_sum - R_trace_kappa_sum + sigma_yy(INDEX_IJK) = sigma_yy(INDEX_IJK) - R_yy_sum - R_trace_kappa_sum + sigma_zz(INDEX_IJK) = sigma_zz(INDEX_IJK) + R_xx_sum + R_yy_sum - R_trace_kappa_sum + sigma_xy(INDEX_IJK) = sigma_xy(INDEX_IJK) - sum(R_xy(:,INDEX_IJK,ispec)) + sigma_xz(INDEX_IJK) = sigma_xz(INDEX_IJK) - sum(R_xz(:,INDEX_IJK,ispec)) + sigma_yz(INDEX_IJK) = sigma_yz(INDEX_IJK) - sum(R_yz(:,INDEX_IJK,ispec)) + endif + + ! define symmetric components of sigma + sigma_yx(INDEX_IJK) = sigma_xy(INDEX_IJK) + sigma_zx(INDEX_IJK) = sigma_xz(INDEX_IJK) + sigma_zy(INDEX_IJK) = sigma_yz(INDEX_IJK) + ENDDO_LOOP_IJK + + ! stores stress for movie output + ! and SPECFEM coupling injection technique to compute traction on boundary point + if (MOVIE_VOLUME_STRESS .or. do_save_coupling_wavefield) then + ! store stress tensor + stress_xx(:,:,:,ispec) = sigma_xx(:,:,:) + stress_yy(:,:,:,ispec) = sigma_yy(:,:,:) + stress_zz(:,:,:,ispec) = sigma_zz(:,:,:) + stress_xy(:,:,:,ispec) = sigma_xy(:,:,:) + stress_xz(:,:,:,ispec) = sigma_xz(:,:,:) + stress_yz(:,:,:,ispec) = sigma_yz(:,:,:) + endif + + ! compute non-symmetric terms for gravity + if (GRAVITY) then + call compute_element_gravity(ispec,ispec_irreg,NSPEC,NGLOB,ibool, & + jacobianstore,wgll_cube, & + minus_g,minus_deriv_gravity, & + dummyx_loc,dummyy_loc,dummyz_loc, & + sigma_xx,sigma_yy,sigma_zz, & + sigma_xy,sigma_xz,sigma_yz,sigma_yx,sigma_zx,sigma_zy, & + rho_s_H) + endif + + ! dot product with test vector + if (.not. is_CPML(ispec)) then + if (ispec_irreg /= 0) then + ! irregular element + DO_LOOP_IJK + xixl = xixstore(INDEX_IJK,ispec_irreg) + xiyl = xiystore(INDEX_IJK,ispec_irreg) + xizl = xizstore(INDEX_IJK,ispec_irreg) + etaxl = etaxstore(INDEX_IJK,ispec_irreg) + etayl = etaystore(INDEX_IJK,ispec_irreg) + etazl = etazstore(INDEX_IJK,ispec_irreg) + gammaxl = gammaxstore(INDEX_IJK,ispec_irreg) + gammayl = gammaystore(INDEX_IJK,ispec_irreg) + gammazl = gammazstore(INDEX_IJK,ispec_irreg) + jacobianl = jacobianstore(INDEX_IJK,ispec_irreg) + + ! form dot product with test vector, non-symmetric form (which is useful in the case of PML) + tempx1(INDEX_IJK) = jacobianl * & + (sigma_xx(INDEX_IJK) * xixl + sigma_yx(INDEX_IJK) * xiyl + sigma_zx(INDEX_IJK) * xizl) + tempy1(INDEX_IJK) = jacobianl * & + (sigma_xy(INDEX_IJK) * xixl + sigma_yy(INDEX_IJK) * xiyl + sigma_zy(INDEX_IJK) * xizl) + tempz1(INDEX_IJK) = jacobianl * & + (sigma_xz(INDEX_IJK) * xixl + sigma_yz(INDEX_IJK) * xiyl + sigma_zz(INDEX_IJK) * xizl) + + tempx2(INDEX_IJK) = jacobianl * & + (sigma_xx(INDEX_IJK) * etaxl + sigma_yx(INDEX_IJK) * etayl + sigma_zx(INDEX_IJK) * etazl) + tempy2(INDEX_IJK) = jacobianl * & + (sigma_xy(INDEX_IJK) * etaxl + sigma_yy(INDEX_IJK) * etayl + sigma_zy(INDEX_IJK) * etazl) + tempz2(INDEX_IJK) = jacobianl * & + (sigma_xz(INDEX_IJK) * etaxl + sigma_yz(INDEX_IJK) * etayl + sigma_zz(INDEX_IJK) * etazl) + + tempx3(INDEX_IJK) = jacobianl * & + (sigma_xx(INDEX_IJK) * gammaxl + sigma_yx(INDEX_IJK) * gammayl + sigma_zx(INDEX_IJK) * gammazl) + tempy3(INDEX_IJK) = jacobianl * & + (sigma_xy(INDEX_IJK) * gammaxl + sigma_yy(INDEX_IJK) * gammayl + sigma_zy(INDEX_IJK) * gammazl) + tempz3(INDEX_IJK) = jacobianl * & + (sigma_xz(INDEX_IJK) * gammaxl + sigma_yz(INDEX_IJK) * gammayl + sigma_zz(INDEX_IJK) * gammazl) + ENDDO_LOOP_IJK + else + ! regular element + jacobianl = jacobian_regular + xixl = xix_regular + + DO_LOOP_IJK + ! form dot product with test vector, non-symmetric form (which is useful in the case of PML) + tempx1(INDEX_IJK) = jacobianl * sigma_xx(INDEX_IJK) * xixl ! this goes to accel_x + tempy1(INDEX_IJK) = jacobianl * sigma_xy(INDEX_IJK) * xixl ! this goes to accel_y + tempz1(INDEX_IJK) = jacobianl * sigma_xz(INDEX_IJK) * xixl ! this goes to accel_z + + tempx2(INDEX_IJK) = jacobianl * sigma_yx(INDEX_IJK) * xixl ! this goes to accel_x + tempy2(INDEX_IJK) = jacobianl * sigma_yy(INDEX_IJK) * xixl ! this goes to accel_y + tempz2(INDEX_IJK) = jacobianl * sigma_yz(INDEX_IJK) * xixl ! this goes to accel_z + + tempx3(INDEX_IJK) = jacobianl * sigma_zx(INDEX_IJK) * xixl ! this goes to accel_x + tempy3(INDEX_IJK) = jacobianl * sigma_zy(INDEX_IJK) * xixl ! this goes to accel_y + tempz3(INDEX_IJK) = jacobianl * sigma_zz(INDEX_IJK) * xixl ! this goes to accel_z + ENDDO_LOOP_IJK + endif + endif + + + end subroutine compute_element_iso + + +!-------------------------------------------------------------------------------------------- +! +! anisotropic element +! +!-------------------------------------------------------------------------------------------- + + pure subroutine compute_element_aniso(ispec,ispec_irreg, & + minus_g,minus_deriv_gravity,rho_s_H, & + xixstore,xiystore,xizstore,etaxstore,etaystore,etazstore, & + gammaxstore,gammaystore,gammazstore,jacobianstore, & + duxdxl,duxdyl,duxdzl,duydxl,duydyl,duydzl,duzdxl,duzdyl,duzdzl, & + wgll_cube, & + c11store,c12store,c13store,c14store,c15store,c16store,c22store, & + c23store,c24store,c25store,c26store,c33store,c34store,c35store, & + c36store,c44store,c45store,c46store,c55store,c56store,c66store, & + ibool, & + R_xx,R_yy,R_xy,R_xz,R_yz,R_trace, & + stress_xx,stress_yy,stress_zz,stress_xy,stress_xz,stress_yz, & + tempx1,tempx2,tempx3,tempy1,tempy2,tempy3,tempz1,tempz2,tempz3, & + dummyx_loc,dummyy_loc,dummyz_loc) + +! fully anisotropic element in viscoelastic domain + + use constants, only: CUSTOM_REAL,NGLLX,NGLLY,NGLLZ,NDIM,N_SLS + + use shared_parameters, only: ATTENUATION, GRAVITY, MOVIE_VOLUME_STRESS + + use specfem_par_coupling, only: do_save_coupling_wavefield + + use specfem_par, only: & + NSPEC => NSPEC_AB, & + NGLOB => NGLOB_AB, & + NSPEC_ATTENUATION => NSPEC_ATTENUATION_AB + + use specfem_par_elastic, only: NSPEC_ANISO + + use specfem_par, only: xix_regular, jacobian_regular + + ! PML + use pml_par, only: is_CPML + +#ifdef FORCE_VECTORIZATION + use constants, only: NGLLCUBE +#endif + + implicit none + + ! element id + integer,intent(in) :: ispec,ispec_irreg + + ! arrays with mesh parameters per slice + integer, dimension(NGLLX,NGLLY,NGLLZ,NSPEC),intent(in) :: ibool + + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ,NSPEC),intent(in) :: & + xixstore,xiystore,xizstore, & + etaxstore,etaystore,etazstore, & + gammaxstore,gammaystore,gammazstore,jacobianstore + + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ), intent(in) :: & + duxdxl,duxdyl,duxdzl,duydxl,duydyl,duydzl,duzdxl,duzdyl,duzdzl + + ! array with derivatives of Lagrange polynomials and precalculated products + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ),intent(in) :: wgll_cube + + ! arrays for full anisotropy + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ,NSPEC_ANISO),intent(in) :: & + c11store,c12store,c13store,c14store,c15store,c16store,c22store, & + c23store,c24store,c25store,c26store,c33store,c34store,c35store, & + c36store,c44store,c45store,c46store,c55store,c56store,c66store + + ! attenuation + ! memory variables for attenuation + ! memory variables R_ij are stored at the local rather than global level + ! to allow for optimization of cache access by compiler + real(kind=CUSTOM_REAL), dimension(N_SLS,NGLLX,NGLLY,NGLLZ,NSPEC_ATTENUATION),intent(in) :: R_xx,R_yy,R_xy,R_xz,R_yz + real(kind=CUSTOM_REAL), dimension(N_SLS,NGLLX,NGLLY,NGLLZ,NSPEC_ATTENUATION),intent(in) :: R_trace + + ! gravity + real(kind=CUSTOM_REAL),dimension(NGLOB),intent(in) :: minus_g,minus_deriv_gravity + real(kind=CUSTOM_REAL), dimension(NDIM,NGLLX,NGLLY,NGLLZ),intent(inout) :: rho_s_H + + ! movie + real(kind=CUSTOM_REAL),dimension(NGLLX,NGLLY,NGLLZ,NSPEC),intent(inout) :: & + stress_xx,stress_yy,stress_zz,stress_xy,stress_xz,stress_yz + + ! element info + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ),intent(inout) :: & + tempx1,tempx2,tempx3,tempy1,tempy2,tempy3,tempz1,tempz2,tempz3 + + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ),intent(in) :: dummyx_loc,dummyy_loc,dummyz_loc + + ! local parameters + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ) :: sigma_xx,sigma_yy,sigma_zz + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ) :: sigma_xy,sigma_xz,sigma_yz,sigma_yx,sigma_zx,sigma_zy + + real(kind=CUSTOM_REAL) :: duxdyl_plus_duydxl,duzdxl_plus_duxdzl,duzdyl_plus_duydzl + real(kind=CUSTOM_REAL) :: xixl,xiyl,xizl,etaxl,etayl,etazl,gammaxl,gammayl,gammazl,jacobianl + real(kind=CUSTOM_REAL) :: R_trace_kappa_sum,R_xx_sum,R_yy_sum + + ! local anisotropy parameters + real(kind=CUSTOM_REAL) :: c11,c12,c13,c14,c15,c16,c22,c23,c24,c25,c26, & + c33,c34,c35,c36,c44,c45,c46,c55,c56,c66 + +#ifdef FORCE_VECTORIZATION +! in this vectorized version we have to assume that N_SLS == 3 in order to be able to unroll and thus suppress +! an inner loop that would otherwise prevent vectorization; this is safe in practice in all cases because N_SLS == 3 +! in all known applications, and in the main program we check that N_SLS == 3 if FORCE_VECTORIZATION is used and we stop + integer :: ijk +#else + integer :: i,j,k +#endif + + ! + ! compute stress for isotropic element + ! + DO_LOOP_IJK + ! full anisotropic case, stress calculations + c11 = c11store(INDEX_IJK,ispec) + c12 = c12store(INDEX_IJK,ispec) + c13 = c13store(INDEX_IJK,ispec) + c14 = c14store(INDEX_IJK,ispec) + c15 = c15store(INDEX_IJK,ispec) + c16 = c16store(INDEX_IJK,ispec) + c22 = c22store(INDEX_IJK,ispec) + c23 = c23store(INDEX_IJK,ispec) + c24 = c24store(INDEX_IJK,ispec) + c25 = c25store(INDEX_IJK,ispec) + c26 = c26store(INDEX_IJK,ispec) + c33 = c33store(INDEX_IJK,ispec) + c34 = c34store(INDEX_IJK,ispec) + c35 = c35store(INDEX_IJK,ispec) + c36 = c36store(INDEX_IJK,ispec) + c44 = c44store(INDEX_IJK,ispec) + c45 = c45store(INDEX_IJK,ispec) + c46 = c46store(INDEX_IJK,ispec) + c55 = c55store(INDEX_IJK,ispec) + c56 = c56store(INDEX_IJK,ispec) + c66 = c66store(INDEX_IJK,ispec) + + ! precompute some sums to save CPU time + duxdyl_plus_duydxl = duxdyl(INDEX_IJK) + duydxl(INDEX_IJK) + duzdxl_plus_duxdzl = duzdxl(INDEX_IJK) + duxdzl(INDEX_IJK) + duzdyl_plus_duydzl = duzdyl(INDEX_IJK) + duydzl(INDEX_IJK) + + ! compute stress sigma + sigma_xx(INDEX_IJK) = c11 * duxdxl(INDEX_IJK) + c16 * duxdyl_plus_duydxl + c12 * duydyl(INDEX_IJK) + & + c15 * duzdxl_plus_duxdzl + c14 * duzdyl_plus_duydzl + c13 * duzdzl(INDEX_IJK) + sigma_yy(INDEX_IJK) = c12 * duxdxl(INDEX_IJK) + c26 * duxdyl_plus_duydxl + c22 * duydyl(INDEX_IJK) + & + c25 * duzdxl_plus_duxdzl + c24 * duzdyl_plus_duydzl + c23 * duzdzl(INDEX_IJK) + sigma_zz(INDEX_IJK) = c13 * duxdxl(INDEX_IJK) + c36 * duxdyl_plus_duydxl + c23 * duydyl(INDEX_IJK) + & + c35 * duzdxl_plus_duxdzl + c34 * duzdyl_plus_duydzl + c33 * duzdzl(INDEX_IJK) + sigma_xy(INDEX_IJK) = c16 * duxdxl(INDEX_IJK) + c66 * duxdyl_plus_duydxl + c26 * duydyl(INDEX_IJK) + & + c56 * duzdxl_plus_duxdzl + c46 * duzdyl_plus_duydzl + c36 * duzdzl(INDEX_IJK) + sigma_xz(INDEX_IJK) = c15 * duxdxl(INDEX_IJK) + c56 * duxdyl_plus_duydxl + c25 * duydyl(INDEX_IJK) + & + c55 * duzdxl_plus_duxdzl + c45 * duzdyl_plus_duydzl + c35 * duzdzl(INDEX_IJK) + sigma_yz(INDEX_IJK) = c14 * duxdxl(INDEX_IJK) + c46 * duxdyl_plus_duydxl + c24 * duydyl(INDEX_IJK) + & + c45 * duzdxl_plus_duxdzl + c44 * duzdyl_plus_duydzl + c34 * duzdzl(INDEX_IJK) + + ! subtract memory variables if attenuation + if (ATTENUATION .and. .not. is_CPML(ispec)) then + R_xx_sum = sum(R_xx(:,INDEX_IJK,ispec)) + R_yy_sum = sum(R_yy(:,INDEX_IJK,ispec)) + R_trace_kappa_sum = sum(R_trace(:,INDEX_IJK,ispec)) + + ! in case no bulk attenuation is desired: + !R_trace_kappa_sum = 0.0 + + sigma_xx(INDEX_IJK) = sigma_xx(INDEX_IJK) - R_xx_sum - R_trace_kappa_sum + sigma_yy(INDEX_IJK) = sigma_yy(INDEX_IJK) - R_yy_sum - R_trace_kappa_sum + sigma_zz(INDEX_IJK) = sigma_zz(INDEX_IJK) + R_xx_sum + R_yy_sum - R_trace_kappa_sum + sigma_xy(INDEX_IJK) = sigma_xy(INDEX_IJK) - sum(R_xy(:,INDEX_IJK,ispec)) + sigma_xz(INDEX_IJK) = sigma_xz(INDEX_IJK) - sum(R_xz(:,INDEX_IJK,ispec)) + sigma_yz(INDEX_IJK) = sigma_yz(INDEX_IJK) - sum(R_yz(:,INDEX_IJK,ispec)) + endif + + ! define symmetric components of sigma + sigma_yx(INDEX_IJK) = sigma_xy(INDEX_IJK) + sigma_zx(INDEX_IJK) = sigma_xz(INDEX_IJK) + sigma_zy(INDEX_IJK) = sigma_yz(INDEX_IJK) + ENDDO_LOOP_IJK + + ! stores stress for movie output + ! and SPECFEM coupling injection technique to compute traction on boundary point + if (MOVIE_VOLUME_STRESS .or. do_save_coupling_wavefield) then + ! store stress tensor + stress_xx(:,:,:,ispec) = sigma_xx(:,:,:) + stress_yy(:,:,:,ispec) = sigma_yy(:,:,:) + stress_zz(:,:,:,ispec) = sigma_zz(:,:,:) + stress_xy(:,:,:,ispec) = sigma_xy(:,:,:) + stress_xz(:,:,:,ispec) = sigma_xz(:,:,:) + stress_yz(:,:,:,ispec) = sigma_yz(:,:,:) + endif + + ! compute non-symmetric terms for gravity + if (GRAVITY) then + call compute_element_gravity(ispec,ispec_irreg,NSPEC,NGLOB,ibool, & + jacobianstore,wgll_cube, & + minus_g,minus_deriv_gravity, & + dummyx_loc,dummyy_loc,dummyz_loc, & + sigma_xx,sigma_yy,sigma_zz, & + sigma_xy,sigma_xz,sigma_yz,sigma_yx,sigma_zx,sigma_zy, & + rho_s_H) + endif + + ! dot product with test vector + if (.not. is_CPML(ispec)) then + if (ispec_irreg /= 0) then + ! irregular element + DO_LOOP_IJK + xixl = xixstore(INDEX_IJK,ispec_irreg) + xiyl = xiystore(INDEX_IJK,ispec_irreg) + xizl = xizstore(INDEX_IJK,ispec_irreg) + etaxl = etaxstore(INDEX_IJK,ispec_irreg) + etayl = etaystore(INDEX_IJK,ispec_irreg) + etazl = etazstore(INDEX_IJK,ispec_irreg) + gammaxl = gammaxstore(INDEX_IJK,ispec_irreg) + gammayl = gammaystore(INDEX_IJK,ispec_irreg) + gammazl = gammazstore(INDEX_IJK,ispec_irreg) + jacobianl = jacobianstore(INDEX_IJK,ispec_irreg) + + ! form dot product with test vector, non-symmetric form (which is useful in the case of PML) + tempx1(INDEX_IJK) = jacobianl * & + (sigma_xx(INDEX_IJK) * xixl + sigma_yx(INDEX_IJK) * xiyl + sigma_zx(INDEX_IJK) * xizl) + tempy1(INDEX_IJK) = jacobianl * & + (sigma_xy(INDEX_IJK) * xixl + sigma_yy(INDEX_IJK) * xiyl + sigma_zy(INDEX_IJK) * xizl) + tempz1(INDEX_IJK) = jacobianl * & + (sigma_xz(INDEX_IJK) * xixl + sigma_yz(INDEX_IJK) * xiyl + sigma_zz(INDEX_IJK) * xizl) + + tempx2(INDEX_IJK) = jacobianl * & + (sigma_xx(INDEX_IJK) * etaxl + sigma_yx(INDEX_IJK) * etayl + sigma_zx(INDEX_IJK) * etazl) + tempy2(INDEX_IJK) = jacobianl * & + (sigma_xy(INDEX_IJK) * etaxl + sigma_yy(INDEX_IJK) * etayl + sigma_zy(INDEX_IJK) * etazl) + tempz2(INDEX_IJK) = jacobianl * & + (sigma_xz(INDEX_IJK) * etaxl + sigma_yz(INDEX_IJK) * etayl + sigma_zz(INDEX_IJK) * etazl) + + tempx3(INDEX_IJK) = jacobianl * & + (sigma_xx(INDEX_IJK) * gammaxl + sigma_yx(INDEX_IJK) * gammayl + sigma_zx(INDEX_IJK) * gammazl) + tempy3(INDEX_IJK) = jacobianl * & + (sigma_xy(INDEX_IJK) * gammaxl + sigma_yy(INDEX_IJK) * gammayl + sigma_zy(INDEX_IJK) * gammazl) + tempz3(INDEX_IJK) = jacobianl * & + (sigma_xz(INDEX_IJK) * gammaxl + sigma_yz(INDEX_IJK) * gammayl + sigma_zz(INDEX_IJK) * gammazl) + ENDDO_LOOP_IJK + else + ! regular element + jacobianl = jacobian_regular + xixl = xix_regular + + DO_LOOP_IJK + ! form dot product with test vector, non-symmetric form (which is useful in the case of PML) + tempx1(INDEX_IJK) = jacobianl * sigma_xx(INDEX_IJK) * xixl ! this goes to accel_x + tempy1(INDEX_IJK) = jacobianl * sigma_xy(INDEX_IJK) * xixl ! this goes to accel_y + tempz1(INDEX_IJK) = jacobianl * sigma_xz(INDEX_IJK) * xixl ! this goes to accel_z + + tempx2(INDEX_IJK) = jacobianl * sigma_yx(INDEX_IJK) * xixl ! this goes to accel_x + tempy2(INDEX_IJK) = jacobianl * sigma_yy(INDEX_IJK) * xixl ! this goes to accel_y + tempz2(INDEX_IJK) = jacobianl * sigma_yz(INDEX_IJK) * xixl ! this goes to accel_z + + tempx3(INDEX_IJK) = jacobianl * sigma_zx(INDEX_IJK) * xixl ! this goes to accel_x + tempy3(INDEX_IJK) = jacobianl * sigma_zy(INDEX_IJK) * xixl ! this goes to accel_y + tempz3(INDEX_IJK) = jacobianl * sigma_zz(INDEX_IJK) * xixl ! this goes to accel_z + ENDDO_LOOP_IJK + endif + endif + + + end subroutine compute_element_aniso + +!-------------------------------------------------------------------------------------------- +! +! helper functions +! +!-------------------------------------------------------------------------------------------- + +! +! please leave this routine in this file, to help compilers inlining this function... +! + + pure subroutine compute_element_gravity(ispec,ispec_irreg,NSPEC,NGLOB,ibool, & + jacobianstore, wgll_cube, & + minus_g,minus_deriv_gravity, & + dummyx_loc,dummyy_loc,dummyz_loc, & + sigma_xx,sigma_yy,sigma_zz, & + sigma_xy,sigma_xz,sigma_yz,sigma_yx,sigma_zx,sigma_zy, & + rho_s_H) + +! we can force inlining (Intel compiler) +#if defined __INTEL_COMPILER +!DIR$ ATTRIBUTES INLINE :: compute_element_gravity +#else +! cray +!DIR$ INLINEALWAYS compute_element_gravity +#endif + +! computes non-symmetric stress terms for gravity + + use constants, only: CUSTOM_REAL,NGLLX,NGLLY,NGLLZ,NDIM + use specfem_par, only: rhostore, jacobian_regular + +#ifdef FORCE_VECTORIZATION + use constants, only: NGLLCUBE +#endif + + implicit none + + integer,intent(in) :: ispec,ispec_irreg + integer,intent(in) :: NSPEC,NGLOB + + integer, dimension(NGLLX,NGLLY,NGLLZ,NSPEC),intent(in) :: ibool +! real(kind=CUSTOM_REAL), dimension(3,NGLOB),intent(in) :: rstore + + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ,NSPEC),intent(in) :: jacobianstore + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ),intent(in) :: wgll_cube + + ! gravity + real(kind=CUSTOM_REAL),dimension(NGLOB),intent(in) :: minus_g,minus_deriv_gravity + +! double precision, dimension(NRAD_GRAVITY),intent(in) :: minus_gravity_table,density_table,minus_deriv_gravity_table + + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ),intent(in) :: dummyx_loc,dummyy_loc,dummyz_loc + + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ),intent(inout) :: sigma_xx,sigma_yy,sigma_zz + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ),intent(inout) :: sigma_xy,sigma_xz,sigma_yz,sigma_yx,sigma_zx,sigma_zy + + real(kind=CUSTOM_REAL), dimension(NDIM,NGLLX,NGLLY,NGLLZ),intent(inout) :: rho_s_H + + ! local parameters + ! for gravity + real(kind=CUSTOM_REAL) :: rhol + +! double precision :: dphi,dtheta +! double precision :: radius,rho,minus_g,minus_dg +! double precision :: minus_g_over_radius,minus_dg_plus_g_over_radius +! double precision :: cos_theta,sin_theta,cos_phi,sin_phi +! double precision :: cos_theta_sq,sin_theta_sq,cos_phi_sq,sin_phi_sq + real(kind=CUSTOM_REAL) :: factor,sx_l,sy_l,sz_l,gxl,gyl,gzl,jacobianl + real(kind=CUSTOM_REAL) :: Hxxl,Hyyl,Hzzl,Hxyl,Hxzl,Hyzl + +! integer :: int_radius + integer :: iglob + +#ifdef FORCE_VECTORIZATION + integer :: ijk +#else + integer :: i,j,k +#endif + + ! minimum radius in inner core (to avoid zero radius) + !double precision, parameter :: MINIMUM_RADIUS_INNER_CORE = 100.d0 / R_PLANET + + ! computes non-symmetric terms for gravity + DO_LOOP_IJK + ! use mesh coordinates to get theta and phi + ! x y and z contain r theta and phi + iglob = ibool(INDEX_IJK,ispec) + + ! density + rhol = rhostore(INDEX_IJK,ispec) + + ! Cartesian components of the gravitational acceleration + ! assumes g acts in vertical direction only + gxl = 0._CUSTOM_REAL ! (minus_g * sin_theta * cos_phi) * rho + gyl = 0._CUSTOM_REAL ! (minus_g * sin_theta * sin_phi) * rho + gzl = minus_g(iglob) * rhol ! (minus_g * cos_theta) * rho + + ! Cartesian components of gradient of gravitational acceleration + ! get displacement and multiply by density to compute G tensor + sx_l = dummyx_loc(INDEX_IJK) + sy_l = dummyy_loc(INDEX_IJK) + sz_l = dummyz_loc(INDEX_IJK) + + ! compute G tensor from s . g and add to sigma (not symmetric) + ! + ! note: Komatitsch & Tromp 2002, Spectral-element simulations of global seismic wave propagation â“ II. Three-dimensional + ! models, oceans, rotation and self-gravitation, GJI, 150, 303-318 + ! https://doi.org/10.1046/j.1365-246X.2002.01716.x + ! + ! G is defined as G = \rho [ s g - (s \cdot g) I ]. G is non-symmetric. + ! + ! Here, the contribution added to the elastic stress tensor (sigma, or T in the paper) is: + ! (s \cdot (\rho g)) I - s (\rho g) = \rho [ (s \cdot g) I - s g ] + ! + ! In index notation the contribution here is: + ! \rho [ (s_k g_k) \delta_ij - s_i g_j ] + ! That is, the contribution added is - G. + ! + ! This will lead to a formulation of the weak form for stress as: + ! - int_\Omega \nabla w : (T - G) d\Omega + ! Note that the sign of G is different to the expression in the paper, where the derivation of the weak form seems + ! to contain a sign mistake in the (T - G) term. + ! + ! contribution \rho [ (s_k g_k) \delta_ij - s_i g_j ]: + ! for example: xx (i=1, j=1): (sx * gx + sy * gy + sz * gz) * 1 - sx gx == sy * gy + sz * gz + ! yy (i=2, j=2): (sx * gx + sy * gy + sz * gz) * 1 - sy gy == sx * gx + sz * gz + ! zz (i=3, j=3): (sx * gx + sy * gy + sz * gz) * 1 - sz gz == sx * gx + sy * gy + ! xy (i=1, j=2): (sx * gx + sy * gy + sz * gz) * 0 - sx gy == - sx * gy + ! .. + ! + sigma_xx(INDEX_IJK) = sigma_xx(INDEX_IJK) + sy_l * gyl + sz_l * gzl + sigma_yy(INDEX_IJK) = sigma_yy(INDEX_IJK) + sx_l * gxl + sz_l * gzl + sigma_zz(INDEX_IJK) = sigma_zz(INDEX_IJK) + sx_l * gxl + sy_l * gyl + + sigma_xy(INDEX_IJK) = sigma_xy(INDEX_IJK) - sx_l * gyl + sigma_yx(INDEX_IJK) = sigma_yx(INDEX_IJK) - sy_l * gxl + + sigma_xz(INDEX_IJK) = sigma_xz(INDEX_IJK) - sx_l * gzl + sigma_zx(INDEX_IJK) = sigma_zx(INDEX_IJK) - sz_l * gxl + + sigma_yz(INDEX_IJK) = sigma_yz(INDEX_IJK) - sy_l * gzl + sigma_zy(INDEX_IJK) = sigma_zy(INDEX_IJK) - sz_l * gyl + + ! H term contribution + ! note: this computes term \rho s \cdot H + ! Since H is defined as H = \nabla g and g = - \nabla \Psi with the gravitational potential \Psi, + ! the resulting tensor H = \nabla \nabla \Psi' must be symmetric (using \Psi' == -\Psi). + ! + ! (And for a symmetric tensor H, the product s \cdot H == H^T \cdot s == H \cdot s, + ! with H^T being the transpose of H) + ! + ! Note that the H term in the Komatitsch & Tromp 2002 paper seems to have a sign mistake as well, and should be + ! + \int_\Omega \rho s \cdot H \cdot w d\Omega + ! + ! contribution v = s \cdot H' with H' = \rho H, in index notation v_i = s_j H'_ji: + ! for example: vx: sx * Hxx + sy * Hyx + sz * Hzx == sx * Hxx + sy * Hxy + sz * Hxz (since Hyx == Hxy, Hzx == Hxz) + ! vy: sx * Hxy + sy * Hyy + sz * Hzy == sx * Hxy + sy * Hyy + sz * Hyz (since Hyx == Hxy, Hzy == Hyz) + ! vz: sx * Hxz + sy * Hyz + sz * Hzz + ! + ! + ! H-matrix + ! Cartesian components of gradient of gravitational acceleration + ! obtained from spherical components + !minus_g_over_radius = minus_g / radius + !minus_dg_plus_g_over_radius = minus_dg - minus_g_over_radius + !Hxxl = (minus_g_over_radius * (cos_phi_sq * cos_theta_sq + sin_phi_sq) + cos_phi_sq * minus_dg * sin_theta_sq) + !Hyyl = (minus_g_over_radius * (cos_phi_sq + cos_theta_sq * sin_phi_sq) + minus_dg * sin_phi_sq * sin_theta_sq) + !Hzzl = (cos_theta_sq * minus_dg + minus_g_over_radius * sin_theta_sq) + !Hxyl = (cos_phi * minus_dg_plus_g_over_radius * sin_phi * sin_theta_sq) + !Hxzl = (cos_phi * cos_theta * minus_dg_plus_g_over_radius * sin_theta) + !Hyzl = (cos_theta * minus_dg_plus_g_over_radius * sin_phi * sin_theta) + + ! vertical: colatitude theta == 0 -> cos_theta = 1 & sin_theta = 0 + ! the general expression + !Hxxl = (minus_g_over_radius * (cos_phi_sq * cos_theta_sq + sin_phi_sq) + cos_phi_sq * minus_dg * sin_theta_sq) + !Hyyl = (minus_g_over_radius * (cos_phi_sq + cos_theta_sq * sin_phi_sq) + minus_dg * sin_phi_sq * sin_theta_sq) + !Hzzl = (cos_theta_sq * minus_dg + minus_g_over_radius * sin_theta_sq) + !Hxyl = (cos_phi * minus_dg_plus_g_over_radius * sin_phi * sin_theta_sq) + !Hxzl = (cos_phi * cos_theta * minus_dg_plus_g_over_radius * sin_theta) + !Hyzl = (cos_theta * minus_dg_plus_g_over_radius * sin_phi * sin_theta) + ! becomes + !Hxxl = minus_g_over_radius * (cos_phi_sq + sin_phi_sq) = minus_g_over_radius + !Hyyl = minus_g_over_radius * (cos_phi_sq + sin_phi_sq) = minus_g_over_radius + !Hzzl = minus_dg + !Hxyl = 0 + !Hxzl = 0 + !Hyzl = 0 + ! note that the components Hxx == Hyy == - g/r account for the curvature of the Earth + ! that is if we move horizontally by dx, then the "down" direction tilts slightly which create a change in the x-component + ! and y-component correspondingly. + ! + ! flat Earth: assumes g only acts in negative z-direction + Hxxl = 0._CUSTOM_REAL + Hyyl = 0._CUSTOM_REAL + Hzzl = minus_deriv_gravity(iglob) + Hxyl = 0._CUSTOM_REAL + Hxzl = 0._CUSTOM_REAL + Hyzl = 0._CUSTOM_REAL + + ! precompute vector + if (ispec_irreg /= 0) then + jacobianl = jacobianstore(INDEX_IJK,ispec) + else + jacobianl = jacobian_regular + endif + + factor = jacobianl * wgll_cube(INDEX_IJK) * rhol + + rho_s_H(1,INDEX_IJK) = 0._CUSTOM_REAL ! factor * (sx_l * Hxxl + sy_l * Hxyl + sz_l * Hxzl) + rho_s_H(2,INDEX_IJK) = 0._CUSTOM_REAL ! factor * (sx_l * Hxyl + sy_l * Hyyl + sz_l * Hyzl) + rho_s_H(3,INDEX_IJK) = factor * (sx_l * Hxzl + sy_l * Hyzl + sz_l * Hzzl) + ENDDO_LOOP_IJK + + end subroutine compute_element_gravity + +end module mod_element diff --git a/src/specfem3D/compute_forces_viscoelastic.F90 b/src/specfem3D/compute_forces_viscoelastic.F90 index 4801b1079..a734a7340 100644 --- a/src/specfem3D/compute_forces_viscoelastic.F90 +++ b/src/specfem3D/compute_forces_viscoelastic.F90 @@ -40,13 +40,12 @@ subroutine compute_forces_viscoelastic(iphase,deltat, & epsilondev_xz,epsilondev_yz,epsilon_trace_over_3, & backward_simulation) - use constants, only: CUSTOM_REAL,NGLLX,NGLLY,NGLLZ,NDIM,N_SLS,ONE_THIRD,FOUR_THIRDS, & + use constants, only: CUSTOM_REAL,NGLLX,NGLLY,NGLLZ,NDIM,N_SLS,ONE_THIRD, & m1,m2 use shared_parameters, only: SIMULATION_TYPE, & USE_LDDRK,LTS_MODE,SAVE_MOHO_MESH, & - ATTENUATION,ANISOTROPY, & - MOVIE_VOLUME_STRESS + ATTENUATION,ANISOTROPY use fault_solver_common, only: Kelvin_Voigt_eta,USE_KELVIN_VOIGT_DAMPING @@ -62,7 +61,7 @@ subroutine compute_forces_viscoelastic(iphase,deltat, & NSPEC_ATTENUATION_AB,NSPEC_ATTENUATION_AB_LDDRK, & NSPEC_ADJOINT, & is_moho_top,is_moho_bot, & - irregular_element_number,xix_regular,jacobian_regular + irregular_element_number,xix_regular use specfem_par, only: wgllwgll_xy_3D,wgllwgll_xz_3D,wgllwgll_yz_3D !or: use specfem_par, only: wgllwgll_xy,wgllwgll_xz,wgllwgll_yz @@ -76,6 +75,9 @@ subroutine compute_forces_viscoelastic(iphase,deltat, & ispec2D_moho_top,ispec2D_moho_bot, & nspec_inner_elastic,nspec_outer_elastic,phase_ispec_inner_elastic + ! for gravity + use specfem_par, only: wgll_cube,minus_g,minus_deriv_gravity + ! movie use specfem_par_movie, only: stress_xx,stress_yy,stress_zz,stress_xy,stress_xz,stress_yz @@ -90,8 +92,8 @@ subroutine compute_forces_viscoelastic(iphase,deltat, & ! LTS use specfem_par_lts, only: lts_type_compute_pelem,current_lts_elem,current_lts_boundary_elem - ! coupling - use specfem_par_coupling, only: do_save_coupling_wavefield + ! element compute routines + use mod_element, only: compute_element_iso,compute_element_aniso #ifdef FORCE_VECTORIZATION use constants, only: NGLLCUBE @@ -157,27 +159,20 @@ subroutine compute_forces_viscoelastic(iphase,deltat, & real(kind=CUSTOM_REAL) :: tempy1l,tempy2l,tempy3l real(kind=CUSTOM_REAL) :: tempz1l,tempz2l,tempz3l - real(kind=CUSTOM_REAL) :: xixl,xiyl,xizl,etaxl,etayl,etazl,gammaxl,gammayl,gammazl,jacobianl - real(kind=CUSTOM_REAL) :: duxdyl_plus_duydxl,duzdxl_plus_duxdzl,duzdyl_plus_duydzl - real(kind=CUSTOM_REAL) :: sigma_xx,sigma_yy,sigma_zz,sigma_xy,sigma_xz,sigma_yz,sigma_yx,sigma_zx,sigma_zy + real(kind=CUSTOM_REAL) :: xixl,xiyl,xizl,etaxl,etayl,etazl,gammaxl,gammayl,gammazl real(kind=CUSTOM_REAL) :: fac1,fac2,fac3 real(kind=CUSTOM_REAL) :: hp1,hp2,hp3 - real(kind=CUSTOM_REAL) :: lambdal,mul,lambdalplus2mul - real(kind=CUSTOM_REAL) :: kappal + ! for gravity + real(kind=CUSTOM_REAL), dimension(NDIM,NGLLX,NGLLY,NGLLZ) :: rho_s_H ! faults real(kind=CUSTOM_REAL) :: eta - ! local anisotropy parameters - real(kind=CUSTOM_REAL) :: c11,c12,c13,c14,c15,c16,c22,c23,c24,c25,c26, & - c33,c34,c35,c36,c44,c45,c46,c55,c56,c66 - ! local attenuation parameters real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ) :: epsilondev_trace_loc, epsilondev_xx_loc, & epsilondev_yy_loc, epsilondev_xy_loc, epsilondev_xz_loc, epsilondev_yz_loc - real(kind=CUSTOM_REAL) :: R_trace_kappa_sum,R_xx_sum,R_yy_sum real(kind=CUSTOM_REAL) :: templ integer :: ispec,iglob,ispec_p,num_elements @@ -200,7 +195,7 @@ subroutine compute_forces_viscoelastic(iphase,deltat, & !$OMP SHARED( & !$OMP num_elements,ibool, & !$OMP iphase,phase_ispec_inner_elastic, & -!$OMP irregular_element_number,jacobian_regular,xix_regular, & +!$OMP irregular_element_number,xix_regular, & !$OMP displ,veloc,accel, & !$OMP is_CPML,backward_simulation, & !$OMP IS_WAVEFIELD_DISCONTINUITY, & @@ -214,26 +209,22 @@ subroutine compute_forces_viscoelastic(iphase,deltat, & !$OMP c55store,c56store,c66store, & !$OMP factor_common,factor_common_kappa, & !$OMP COMPUTE_AND_STORE_STRAIN,ATTENUATION,ANISOTROPY,SIMULATION_TYPE, & -!$OMP MOVIE_VOLUME_STRESS,do_save_coupling_wavefield, & !$OMP stress_xx,stress_yy,stress_zz,stress_xy,stress_xz,stress_yz, & !$OMP R_xx,R_yy,R_xy,R_xz,R_yz,R_trace, & !$OMP epsilondev_xx,epsilondev_yy,epsilondev_xy,epsilondev_xz,epsilondev_yz,epsilondev_trace,epsilon_trace_over_3, & !$OMP USE_LDDRK,R_xx_lddrk,R_yy_lddrk,R_xy_lddrk,R_xz_lddrk,R_yz_lddrk,R_trace_lddrk, & !$OMP NSPEC_AB,NSPEC_ATTENUATION_AB,NSPEC_ATTENUATION_AB_LDDRK,NSPEC_STRAIN_ONLY, & !$OMP SAVE_MOHO_MESH,dsdx_top,dsdx_bot,ispec2D_moho_top,ispec2D_moho_bot,is_moho_top,is_moho_bot, & -!$OMP LTS_MODE,lts_type_compute_pelem,current_lts_elem,current_lts_boundary_elem & +!$OMP LTS_MODE,lts_type_compute_pelem,current_lts_elem,current_lts_boundary_elem, & +!$OMP minus_g,minus_deriv_gravity & !$OMP ) & !$OMP PRIVATE( & !$OMP ispec_p,ispec,ispec_irreg,i,j,k,l,iglob,ispec2D, & #ifdef FORCE_VECTORIZATION !$OMP ijk, & #endif -!$OMP xixl,xiyl,xizl,etaxl,etayl,etazl,gammaxl,gammayl,gammazl,jacobianl,eta, & +!$OMP xixl,xiyl,xizl,etaxl,etayl,etazl,gammaxl,gammayl,gammazl,eta, & !$OMP duxdxl,duxdyl,duxdzl,duydxl,duydyl,duydzl,duzdxl,duzdyl,duzdzl, & -!$OMP duxdyl_plus_duydxl,duzdxl_plus_duxdzl,duzdyl_plus_duydzl, & -!$OMP sigma_xx,sigma_yy,sigma_zz,sigma_xy,sigma_xz,sigma_yz,sigma_yx,sigma_zx,sigma_zy, & -!$OMP c11,c12,c13,c14,c15,c16,c22,c23,c24,c25,c26,c33,c34,c35,c36,c44,c45,c46,c55,c56,c66, & -!$OMP lambdal,mul,lambdalplus2mul,kappal, & !$OMP hp1,hp2,hp3,fac1,fac2,fac3, & !$OMP dummyx_loc,dummyy_loc,dummyz_loc, & !$OMP tempx1,tempx2,tempx3,tempy1,tempy2,tempy3,tempz1,tempz2,tempz3, & @@ -245,13 +236,13 @@ subroutine compute_forces_viscoelastic(iphase,deltat, & !$OMP duxdyl_plus_duydxl_att,duzdxl_plus_duxdzl_att,duzdyl_plus_duydzl_att, & !$OMP tempx1_att,tempx2_att,tempx3_att,tempy1_att,tempy2_att,tempy3_att,tempz1_att,tempz2_att,tempz3_att, & !$OMP epsilondev_trace_loc, epsilondev_xx_loc,epsilondev_yy_loc, epsilondev_xy_loc, epsilondev_xz_loc, epsilondev_yz_loc, & -!$OMP R_trace_kappa_sum,R_xx_sum,R_yy_sum,templ & +!$OMP templ,rho_s_h & !$OMP ) & !$OMP FIRSTPRIVATE( & !$OMP hprime_xx,hprime_xxT,hprimewgll_xxT,hprimewgll_xx, & !$OMP hprime_yy,hprime_yyT,hprimewgll_yy, & !$OMP hprime_zz,hprime_zzT,hprimewgll_zz, & -!$OMP wgllwgll_yz_3D,wgllwgll_xz_3D,wgllwgll_xy_3D, & +!$OMP wgllwgll_yz_3D,wgllwgll_xz_3D,wgllwgll_xy_3D,wgll_cube, & !$OMP alphaval,betaval,gammaval & !$OMP ) @@ -328,8 +319,7 @@ subroutine compute_forces_viscoelastic(iphase,deltat, & !! note that this is called in adjoint simulation if (IS_WAVEFIELD_DISCONTINUITY .and. & ((SIMULATION_TYPE == 1) .or. backward_simulation)) then - call add_displacement_discontinuity_element(ispec, dummyx_loc, & - dummyy_loc, dummyz_loc) + call add_displacement_discontinuity_element(ispec, dummyx_loc, dummyy_loc, dummyz_loc) endif endif @@ -587,148 +577,38 @@ subroutine compute_forces_viscoelastic(iphase,deltat, & endif ! COMPUTE_AND_STORE_STRAIN ! stresses - DO_LOOP_IJK - ! precompute some sums to save CPU time - duxdyl_plus_duydxl = duxdyl(INDEX_IJK) + duydxl(INDEX_IJK) - duzdxl_plus_duxdzl = duzdxl(INDEX_IJK) + duxdzl(INDEX_IJK) - duzdyl_plus_duydzl = duzdyl(INDEX_IJK) + duydzl(INDEX_IJK) - - ! computes either isotropic or anisotropic element stresses - if (ANISOTROPY) then - ! full anisotropic case, stress calculations - c11 = c11store(INDEX_IJK,ispec) - c12 = c12store(INDEX_IJK,ispec) - c13 = c13store(INDEX_IJK,ispec) - c14 = c14store(INDEX_IJK,ispec) - c15 = c15store(INDEX_IJK,ispec) - c16 = c16store(INDEX_IJK,ispec) - c22 = c22store(INDEX_IJK,ispec) - c23 = c23store(INDEX_IJK,ispec) - c24 = c24store(INDEX_IJK,ispec) - c25 = c25store(INDEX_IJK,ispec) - c26 = c26store(INDEX_IJK,ispec) - c33 = c33store(INDEX_IJK,ispec) - c34 = c34store(INDEX_IJK,ispec) - c35 = c35store(INDEX_IJK,ispec) - c36 = c36store(INDEX_IJK,ispec) - c44 = c44store(INDEX_IJK,ispec) - c45 = c45store(INDEX_IJK,ispec) - c46 = c46store(INDEX_IJK,ispec) - c55 = c55store(INDEX_IJK,ispec) - c56 = c56store(INDEX_IJK,ispec) - c66 = c66store(INDEX_IJK,ispec) - - sigma_xx = c11 * duxdxl(INDEX_IJK) + c16 * duxdyl_plus_duydxl + c12 * duydyl(INDEX_IJK) + & - c15 * duzdxl_plus_duxdzl + c14 * duzdyl_plus_duydzl + c13 * duzdzl(INDEX_IJK) - sigma_yy = c12 * duxdxl(INDEX_IJK) + c26 * duxdyl_plus_duydxl + c22 * duydyl(INDEX_IJK) + & - c25 * duzdxl_plus_duxdzl + c24 * duzdyl_plus_duydzl + c23 * duzdzl(INDEX_IJK) - sigma_zz = c13 * duxdxl(INDEX_IJK) + c36 * duxdyl_plus_duydxl + c23 * duydyl(INDEX_IJK) + & - c35 * duzdxl_plus_duxdzl + c34 * duzdyl_plus_duydzl + c33 * duzdzl(INDEX_IJK) - sigma_xy = c16 * duxdxl(INDEX_IJK) + c66 * duxdyl_plus_duydxl + c26 * duydyl(INDEX_IJK) + & - c56 * duzdxl_plus_duxdzl + c46 * duzdyl_plus_duydzl + c36 * duzdzl(INDEX_IJK) - sigma_xz = c15 * duxdxl(INDEX_IJK) + c56 * duxdyl_plus_duydxl + c25 * duydyl(INDEX_IJK) + & - c55 * duzdxl_plus_duxdzl + c45 * duzdyl_plus_duydzl + c35 * duzdzl(INDEX_IJK) - sigma_yz = c14 * duxdxl(INDEX_IJK) + c46 * duxdyl_plus_duydxl + c24 * duydyl(INDEX_IJK) + & - c45 * duzdxl_plus_duxdzl + c44 * duzdyl_plus_duydzl + c34 * duzdzl(INDEX_IJK) - - else - ! isotropic case - kappal = kappastore(INDEX_IJK,ispec) - mul = mustore(INDEX_IJK,ispec) - - lambdalplus2mul = kappal + FOUR_THIRDS * mul - lambdal = lambdalplus2mul - 2._CUSTOM_REAL * mul - - ! compute stress sigma - sigma_xx = lambdalplus2mul * duxdxl(INDEX_IJK) + lambdal * (duydyl(INDEX_IJK) + duzdzl(INDEX_IJK)) - sigma_yy = lambdalplus2mul * duydyl(INDEX_IJK) + lambdal * (duxdxl(INDEX_IJK) + duzdzl(INDEX_IJK)) - sigma_zz = lambdalplus2mul * duzdzl(INDEX_IJK) + lambdal * (duxdxl(INDEX_IJK) + duydyl(INDEX_IJK)) - - sigma_xy = mul * duxdyl_plus_duydxl - sigma_xz = mul * duzdxl_plus_duxdzl - sigma_yz = mul * duzdyl_plus_duydzl - endif ! ANISOTROPY - - ! subtract memory variables if attenuation - if (ATTENUATION .and. .not. is_CPML(ispec)) then - R_xx_sum = sum(R_xx(:,INDEX_IJK,ispec)) - R_yy_sum = sum(R_yy(:,INDEX_IJK,ispec)) - R_trace_kappa_sum = sum(R_trace(:,INDEX_IJK,ispec)) - - ! in case no bulk attenuation is desired: - !R_trace_kappa_sum = 0.0 - - sigma_xx = sigma_xx - R_xx_sum - R_trace_kappa_sum - sigma_yy = sigma_yy - R_yy_sum - R_trace_kappa_sum - sigma_zz = sigma_zz + R_xx_sum + R_yy_sum - R_trace_kappa_sum - sigma_xy = sigma_xy - sum(R_xy(:,INDEX_IJK,ispec)) - sigma_xz = sigma_xz - sum(R_xz(:,INDEX_IJK,ispec)) - sigma_yz = sigma_yz - sum(R_yz(:,INDEX_IJK,ispec)) - endif - - ! stores stress for movie output - ! and SPECFEM coupling injection technique to compute traction on boundary point - if (MOVIE_VOLUME_STRESS .or. do_save_coupling_wavefield) then - ! store stress tensor - stress_xx(INDEX_IJK,ispec) = sigma_xx - stress_yy(INDEX_IJK,ispec) = sigma_yy - stress_zz(INDEX_IJK,ispec) = sigma_zz - stress_xy(INDEX_IJK,ispec) = sigma_xy - stress_xz(INDEX_IJK,ispec) = sigma_xz - stress_yz(INDEX_IJK,ispec) = sigma_yz - endif - - if (.not. is_CPML(ispec)) then - ! define symmetric components of sigma - sigma_yx = sigma_xy - sigma_zx = sigma_xz - sigma_zy = sigma_yz - - ! dot product with test vector - if (ispec_irreg /= 0) then - ! irregular element - xixl = xixstore(INDEX_IJK,ispec_irreg) - xiyl = xiystore(INDEX_IJK,ispec_irreg) - xizl = xizstore(INDEX_IJK,ispec_irreg) - etaxl = etaxstore(INDEX_IJK,ispec_irreg) - etayl = etaystore(INDEX_IJK,ispec_irreg) - etazl = etazstore(INDEX_IJK,ispec_irreg) - gammaxl = gammaxstore(INDEX_IJK,ispec_irreg) - gammayl = gammaystore(INDEX_IJK,ispec_irreg) - gammazl = gammazstore(INDEX_IJK,ispec_irreg) - jacobianl = jacobianstore(INDEX_IJK,ispec_irreg) - - ! form dot product with test vector, non-symmetric form (which is useful in the case of PML) - tempx1(INDEX_IJK) = jacobianl * (sigma_xx * xixl + sigma_yx * xiyl + sigma_zx * xizl) ! this goes to accel_x - tempy1(INDEX_IJK) = jacobianl * (sigma_xy * xixl + sigma_yy * xiyl + sigma_zy * xizl) ! this goes to accel_y - tempz1(INDEX_IJK) = jacobianl * (sigma_xz * xixl + sigma_yz * xiyl + sigma_zz * xizl) ! this goes to accel_z - - tempx2(INDEX_IJK) = jacobianl * (sigma_xx * etaxl + sigma_yx * etayl + sigma_zx * etazl) ! this goes to accel_x - tempy2(INDEX_IJK) = jacobianl * (sigma_xy * etaxl + sigma_yy * etayl + sigma_zy * etazl) ! this goes to accel_y - tempz2(INDEX_IJK) = jacobianl * (sigma_xz * etaxl + sigma_yz * etayl + sigma_zz * etazl) ! this goes to accel_z - - tempx3(INDEX_IJK) = jacobianl * (sigma_xx * gammaxl + sigma_yx * gammayl + sigma_zx * gammazl) ! this goes to accel_x - tempy3(INDEX_IJK) = jacobianl * (sigma_xy * gammaxl + sigma_yy * gammayl + sigma_zy * gammazl) ! this goes to accel_y - tempz3(INDEX_IJK) = jacobianl * (sigma_xz * gammaxl + sigma_yz * gammayl + sigma_zz * gammazl) ! this goes to accel_z - else - !regular element - jacobianl = jacobian_regular - - ! form dot product with test vector, non-symmetric form (which is useful in the case of PML) - tempx1(INDEX_IJK) = jacobianl * sigma_xx * xix_regular ! this goes to accel_x - tempy1(INDEX_IJK) = jacobianl * sigma_xy * xix_regular ! this goes to accel_y - tempz1(INDEX_IJK) = jacobianl * sigma_xz * xix_regular ! this goes to accel_z - - tempx2(INDEX_IJK) = jacobianl * sigma_yx * xix_regular ! this goes to accel_x - tempy2(INDEX_IJK) = jacobianl * sigma_yy * xix_regular ! this goes to accel_y - tempz2(INDEX_IJK) = jacobianl * sigma_yz * xix_regular ! this goes to accel_z - - tempx3(INDEX_IJK) = jacobianl * sigma_zx * xix_regular ! this goes to accel_x - tempy3(INDEX_IJK) = jacobianl * sigma_zy * xix_regular ! this goes to accel_y - tempz3(INDEX_IJK) = jacobianl * sigma_zz * xix_regular ! this goes to accel_z - endif - endif - ENDDO_LOOP_IJK + ! computes either isotropic or anisotropic element stresses + if (ANISOTROPY) then + ! full anisotropic case + call compute_element_aniso(ispec,ispec_irreg, & + minus_g,minus_deriv_gravity,rho_s_H, & + xixstore,xiystore,xizstore,etaxstore,etaystore,etazstore, & + gammaxstore,gammaystore,gammazstore,jacobianstore, & + duxdxl,duxdyl,duxdzl,duydxl,duydyl,duydzl,duzdxl,duzdyl,duzdzl, & + wgll_cube, & + c11store,c12store,c13store,c14store,c15store,c16store,c22store, & + c23store,c24store,c25store,c26store,c33store,c34store,c35store, & + c36store,c44store,c45store,c46store,c55store,c56store,c66store, & + ibool, & + R_xx,R_yy,R_xy,R_xz,R_yz,R_trace, & + stress_xx,stress_yy,stress_zz,stress_xy,stress_xz,stress_yz, & + tempx1,tempx2,tempx3,tempy1,tempy2,tempy3,tempz1,tempz2,tempz3, & + dummyx_loc,dummyy_loc,dummyz_loc) + else + ! isotropic case + call compute_element_iso(ispec,ispec_irreg, & + minus_g,minus_deriv_gravity,rho_s_H, & + xixstore,xiystore,xizstore,etaxstore,etaystore,etazstore, & + gammaxstore,gammaystore,gammazstore,jacobianstore, & + duxdxl,duxdyl,duxdzl,duydxl,duydyl,duydzl,duzdxl,duzdyl,duzdzl, & + wgll_cube, & + kappastore,mustore, & + ibool, & + R_xx,R_yy,R_xy,R_xz,R_yz,R_trace, & + stress_xx,stress_yy,stress_zz,stress_xy,stress_xz,stress_yz, & + tempx1,tempx2,tempx3,tempy1,tempy2,tempy3,tempz1,tempz2,tempz3, & + dummyx_loc,dummyy_loc,dummyz_loc) + endif ! second double-loop over GLL to compute all the terms diff --git a/src/specfem3D/compute_forces_viscoelastic_calling_routine.F90 b/src/specfem3D/compute_forces_viscoelastic_calling_routine.F90 index 69a50f149..f8947362c 100644 --- a/src/specfem3D/compute_forces_viscoelastic_calling_routine.F90 +++ b/src/specfem3D/compute_forces_viscoelastic_calling_routine.F90 @@ -155,26 +155,6 @@ subroutine compute_forces_viscoelastic_calling() endif endif - ! while inner elements compute "Kernel_2", we wait for MPI to - ! finish and transfer the boundary terms to the device asynchronously - if (GPU_MODE .and. iphase == 2) then - !daniel: todo - this avoids calling the Fortran vector send from CUDA routine - ! wait for asynchronous copy to finish - call sync_copy_from_device(Mesh_pointer,iphase,buffer_send_vector_ext_mesh) - - ! sends MPI buffers - call assemble_MPI_vector_send_cuda(NPROC, & - buffer_send_vector_ext_mesh,buffer_recv_vector_ext_mesh, & - num_interfaces_ext_mesh,max_nibool_interfaces_ext_mesh, & - nibool_interfaces_ext_mesh,my_neighbors_ext_mesh, & - request_send_vector_ext_mesh,request_recv_vector_ext_mesh) - - ! transfers MPI buffers onto GPU - call transfer_boundary_to_device(NPROC,Mesh_pointer,buffer_recv_vector_ext_mesh, & - num_interfaces_ext_mesh,max_nibool_interfaces_ext_mesh, & - request_recv_vector_ext_mesh) - endif ! inner elements - ! computes additional contributions if (iphase == 1) then ! adds elastic absorbing boundary term to acceleration (Stacey conditions) @@ -297,38 +277,57 @@ subroutine compute_forces_viscoelastic_calling() endif ! iphase ! assemble all the contributions between slices using MPI - if (iphase == 1) then - if (.not. GPU_MODE) then - ! on CPU - ! sends accel values to corresponding MPI interface neighbors - call assemble_MPI_vector_async_send(NPROC,NGLOB_AB,accel, & - buffer_send_vector_ext_mesh,buffer_recv_vector_ext_mesh, & - num_interfaces_ext_mesh,max_nibool_interfaces_ext_mesh, & - nibool_interfaces_ext_mesh,ibool_interfaces_ext_mesh, & - my_neighbors_ext_mesh, & - request_send_vector_ext_mesh,request_recv_vector_ext_mesh) + if (.not. GPU_MODE) then + ! on CPU + if (iphase == 1) then + ! sends accel values to corresponding MPI interface neighbors + call assemble_MPI_vector_async_send(NPROC,NGLOB_AB,accel, & + buffer_send_vector_ext_mesh,buffer_recv_vector_ext_mesh, & + num_interfaces_ext_mesh,max_nibool_interfaces_ext_mesh, & + nibool_interfaces_ext_mesh,ibool_interfaces_ext_mesh, & + my_neighbors_ext_mesh, & + request_send_vector_ext_mesh,request_recv_vector_ext_mesh) else - ! on GPU - ! transfers boundary region to host asynchronously. The - ! MPI-send is done from within compute_forces_viscoelastic_cuda, - ! once the inner element kernels are launched, and the - ! memcpy has finished. see compute_forces_viscoelastic_cuda: ~ line 1655 - call transfer_boundary_from_device_a(Mesh_pointer) - endif - else - ! waits for send/receive requests to be completed and assembles values - if (.not. GPU_MODE) then - ! on CPU - ! receives MPI buffers + ! waits for send/receive requests to be completed and assembles values call assemble_MPI_vector_async_recv(NPROC,NGLOB_AB,accel, & buffer_recv_vector_ext_mesh,num_interfaces_ext_mesh, & max_nibool_interfaces_ext_mesh, & nibool_interfaces_ext_mesh,ibool_interfaces_ext_mesh, & request_send_vector_ext_mesh,request_recv_vector_ext_mesh, & my_neighbors_ext_mesh) + endif + else + ! on GPU + ! note: the goal here is to overlap asynchronous memory copies of the MPI buffers between CPU-GPU + ! and the MPI send/receive while inner elements are computed. + ! for this, we start the transfer of MPI buffers from GPU->CPU as soon as possible, that is when the outer + ! element contributions are ready in iphase==1. once this asynchronous memory copy is initiated, + ! we launch the inner element computations before sending/receiving the MPI buffers. + ! this should overlap the element computation on the GPU with the MPI communication on the CPU. + ! finally, the assembly on the GPU can be started when MPI and buffer copying are done. + if (iphase == 1) then + ! transfers boundary region to host asynchronously + call transfer_boundary_from_device_a(Mesh_pointer,buffer_send_vector_ext_mesh) else - ! on GPU - ! waits for send/receive requests to be completed and assembles values + ! while inner elements compute "Kernel_2", we initiate and wait for MPI to + ! finish and transfer the halo buffer to the device asynchronously. + ! + ! wait for asynchronous copy to finish + call sync_copy_from_device(Mesh_pointer,iphase,buffer_send_vector_ext_mesh) + + ! initiates asynchronous MPI transfer by sending MPI buffers + call assemble_MPI_vector_send_cuda(NPROC, & + buffer_send_vector_ext_mesh,buffer_recv_vector_ext_mesh, & + num_interfaces_ext_mesh,max_nibool_interfaces_ext_mesh, & + nibool_interfaces_ext_mesh,my_neighbors_ext_mesh, & + request_send_vector_ext_mesh,request_recv_vector_ext_mesh) + + ! waits for send/receive requests to be completed and transfers MPI buffers onto GPU + call transfer_boundary_to_device(NPROC,Mesh_pointer,buffer_recv_vector_ext_mesh, & + num_interfaces_ext_mesh,max_nibool_interfaces_ext_mesh, & + request_recv_vector_ext_mesh) + + ! assembles values call assemble_MPI_vector_write_cuda(NPROC,NGLOB_AB,accel,Mesh_pointer, & buffer_recv_vector_ext_mesh,num_interfaces_ext_mesh, & max_nibool_interfaces_ext_mesh, & @@ -753,26 +752,6 @@ subroutine compute_forces_viscoelastic_GPU_calling() nspec_inner_elastic, & COMPUTE_AND_STORE_STRAIN,ATTENUATION,0) ! 0 == both combined - ! while inner elements compute "Kernel_2", we wait for MPI to - ! finish and transfer the boundary terms to the device asynchronously - if (iphase == 2) then - !daniel: todo - this avoids calling the Fortran vector send from CUDA routine - ! wait for asynchronous copy to finish - call sync_copy_from_device(Mesh_pointer,iphase,buffer_send_vector_ext_mesh) - - ! sends MPI buffers - call assemble_MPI_vector_send_cuda(NPROC, & - buffer_send_vector_ext_mesh,buffer_recv_vector_ext_mesh, & - num_interfaces_ext_mesh,max_nibool_interfaces_ext_mesh, & - nibool_interfaces_ext_mesh,my_neighbors_ext_mesh, & - request_send_vector_ext_mesh,request_recv_vector_ext_mesh) - - ! transfers MPI buffers onto GPU - call transfer_boundary_to_device(NPROC,Mesh_pointer,buffer_recv_vector_ext_mesh, & - num_interfaces_ext_mesh,max_nibool_interfaces_ext_mesh, & - request_recv_vector_ext_mesh) - endif ! inner elements - ! computes additional contributions if (iphase == 1) then ! adds elastic absorbing boundary term to acceleration (Stacey conditions) @@ -820,11 +799,9 @@ subroutine compute_forces_viscoelastic_GPU_calling() if (iphase == 1) then ! sends accel values to corresponding MPI interface neighbors - ! transfers boundary region to host asynchronously. The - ! MPI-send is done from within compute_forces_viscoelastic_cuda, - ! once the inner element kernels are launched, and the - ! memcpy has finished. see compute_forces_viscoelastic_cuda: ~ line 1655 - call transfer_boundary_from_device_a(Mesh_pointer) + ! transfers boundary region to host asynchronously + ! forward wavefield (accel forward) + call transfer_boundary_from_device_a(Mesh_pointer,buffer_send_vector_ext_mesh) ! adjoint simulations ! assumes SIMULATION_TYPE == 3 @@ -839,7 +816,26 @@ subroutine compute_forces_viscoelastic_GPU_calling() b_request_send_vector_ext_mesh,b_request_recv_vector_ext_mesh) else - ! waits for send/receive requests to be completed and assembles values + ! while inner elements compute "Kernel_2", we wait for MPI to + ! finish and transfer the boundary terms to the device asynchronously + ! + ! wait for asynchronous copy to finish + ! forward wavefield (accel forward) + call sync_copy_from_device(Mesh_pointer,iphase,buffer_send_vector_ext_mesh) + + ! sends MPI buffers + call assemble_MPI_vector_send_cuda(NPROC, & + buffer_send_vector_ext_mesh,buffer_recv_vector_ext_mesh, & + num_interfaces_ext_mesh,max_nibool_interfaces_ext_mesh, & + nibool_interfaces_ext_mesh,my_neighbors_ext_mesh, & + request_send_vector_ext_mesh,request_recv_vector_ext_mesh) + + ! waits for send/receive requests to be completed and transfers MPI buffers onto GPU + call transfer_boundary_to_device(NPROC,Mesh_pointer,buffer_recv_vector_ext_mesh, & + num_interfaces_ext_mesh,max_nibool_interfaces_ext_mesh, & + request_recv_vector_ext_mesh) + + ! assembles values call assemble_MPI_vector_write_cuda(NPROC,NGLOB_AB,accel,Mesh_pointer, & buffer_recv_vector_ext_mesh,num_interfaces_ext_mesh, & max_nibool_interfaces_ext_mesh, & diff --git a/src/specfem3D/couple_with_injection.f90 b/src/specfem3D/couple_with_injection.f90 index 741c21f76..ddd45b994 100644 --- a/src/specfem3D/couple_with_injection.f90 +++ b/src/specfem3D/couple_with_injection.f90 @@ -2132,8 +2132,10 @@ subroutine locate_coupling_points(num_coupling_points_total,coupling_points) num_output_info = min(100000,int(10**floor(log10(dble(npoints_total))))) else if (npoints_total > 50000) then num_output_info = min(10000,int(10**floor(log10(dble(npoints_total))))) - else + else if (npoints_total > 0) then num_output_info = min(1000,int(10**floor(log10(dble(npoints_total))))) + else + num_output_info = 1 endif ! number to output about ~50 steps, rounds to the next multiple of 1000 !num_output_info = max(1000,int(ceiling(ceiling(npoints_total/50.0)/1000.0)*1000)) diff --git a/src/specfem3D/detect_mesh_surfaces.f90 b/src/specfem3D/detect_mesh_surfaces.f90 index 7d9f57ae3..9cf6edb03 100644 --- a/src/specfem3D/detect_mesh_surfaces.f90 +++ b/src/specfem3D/detect_mesh_surfaces.f90 @@ -170,6 +170,11 @@ subroutine detect_mesh_surfaces() endif endif + ! dummy allocation (for passing arrays as routine arguments in compute_forces_viscoelastic.F90) + if (.not. allocated(stress_xx)) then + allocate(stress_xx(1,1,1,1),stress_yy(1,1,1,1),stress_zz(1,1,1,1),stress_xy(1,1,1,1),stress_xz(1,1,1,1),stress_yz(1,1,1,1)) + endif + ! initializes cross-section gif image if (PNM_IMAGE) then ! user output diff --git a/src/specfem3D/gravity_perturbation.f90 b/src/specfem3D/gravity_perturbation.f90 index fd5b9ef12..da72d8f2d 100644 --- a/src/specfem3D/gravity_perturbation.f90 +++ b/src/specfem3D/gravity_perturbation.f90 @@ -87,7 +87,7 @@ subroutine gravity_init() if (ier /= 0) then ! user output if (myrank == 0) then - write(IMAIN,*) ' no gravity simulation' + write(IMAIN,*) ' no gravity stations' call flush_IMAIN() endif ! nothing to do @@ -102,7 +102,7 @@ subroutine gravity_init() ! user output if (myrank == 0) then - write(IMAIN,*) ' incorporating gravity simulation' + write(IMAIN,*) ' incorporating gravity field simulation' write(IMAIN,*) ' gravity stations: ',nstat call flush_IMAIN() endif @@ -326,13 +326,14 @@ end subroutine recompute_jacobian_gravity subroutine gravity_timeseries() + use constants, only: GRAV use specfem_par, only: xstore, ystore, zstore, it, NGLOB_AB use specfem_par_elastic, only: displ implicit none ! local parameters - real(kind=CUSTOM_REAL),parameter :: G_const = 6.674e-11_CUSTOM_REAL + real(kind=CUSTOM_REAL),parameter :: G_const = GRAV real(kind=CUSTOM_REAL), dimension(NGLOB_AB) :: accEdV,accNdV,accZdV real(kind=CUSTOM_REAL) :: E_local,N_local,Z_local,E_all,N_all,Z_all diff --git a/src/specfem3D/initialize_simulation.F90 b/src/specfem3D/initialize_simulation.F90 index 25389ec30..8582342a7 100644 --- a/src/specfem3D/initialize_simulation.F90 +++ b/src/specfem3D/initialize_simulation.F90 @@ -304,7 +304,7 @@ subroutine initialize_simulation() call initialize_simulation_adjoint() ! initializes GPU cards - if (GPU_MODE) call initialize_GPU() + call initialize_GPU() ! output info for possible OpenMP call init_openmp() @@ -368,9 +368,6 @@ subroutine initialize_simulation_check() if (SIMULATION_TYPE /= 1 .and. SIMULATION_TYPE /= 2 .and. SIMULATION_TYPE /= 3) & call exit_mpi(myrank,'SIMULATION_TYPE can only be 1, 2, or 3') - ! gravity only on GPU supported - if (.not. GPU_MODE .and. GRAVITY) stop 'GRAVITY only supported in GPU mode' - if (NGLLX /= NGLLY .or. NGLLY /= NGLLZ) stop 'Methods that can handle unstructured meshes require NGLLX = NGLLY = NGLLZ' ! absorbing surfaces @@ -574,7 +571,11 @@ subroutine initialize_GPU() implicit none ! local parameters - integer :: ncuda_devices,num_device,ncuda_devices_min,ncuda_devices_max + integer :: ngpu_devices,num_device,ngpu_devices_min,ngpu_devices_max + logical :: USE_CUDA_AWARE_MPI_all + + ! checks if GPU simulation turned on + if (.not. GPU_MODE) return ! GPU_MODE now defined in Par_file if (myrank == 0) then @@ -583,16 +584,42 @@ subroutine initialize_GPU() call flush_IMAIN() endif - if (CUSTOM_REAL /= 4) stop 'GPU mode runs only with CUSTOM_REAL == 4' - - if (SAVE_MOHO_MESH) stop 'GPU mode does not support SAVE_MOHO_MESH yet' - + if (CUSTOM_REAL /= 4) & + stop 'GPU mode runs only with CUSTOM_REAL == 4' + if (SAVE_MOHO_MESH) & + stop 'GPU mode does not support SAVE_MOHO_MESH yet' if (ATTENUATION) then - if (N_SLS /= 3) stop 'GPU mode does not support N_SLS /= 3 yet' + if (N_SLS /= 3) & + stop 'GPU mode does not support N_SLS /= 3 yet' endif + if (POROELASTIC_SIMULATION) & + stop 'poroelastic simulations on GPUs not supported yet' + + ! initializes number of local gpu devices + ngpu_devices = 0 - if (POROELASTIC_SIMULATION) stop 'poroelastic simulations on GPUs not supported yet' + ! all processes will try to switch to CUDA-aware setup + call any_all_l(USE_CUDA_AWARE_MPI,USE_CUDA_AWARE_MPI_all) + USE_CUDA_AWARE_MPI = USE_CUDA_AWARE_MPI_all + +#ifdef WITH_CUDA_AWARE_MPI + if (USE_CUDA_AWARE_MPI) then + ! double check if loaded MPI system has CUDA support + ! query MPI for cuda support + call query_cuda_aware_mpi(myrank,USE_CUDA_AWARE_MPI) + + ! all processes need support + call any_all_l(USE_CUDA_AWARE_MPI,USE_CUDA_AWARE_MPI_all) + USE_CUDA_AWARE_MPI = USE_CUDA_AWARE_MPI_all + + if (myrank == 0) then + write(IMAIN,*) "check CUDA-aware MPI returned : ",USE_CUDA_AWARE_MPI + call flush_IMAIN() + endif + endif +#endif + ! simultaneous runs if (NPROC == 1 .and. NUMBER_OF_SIMULTANEOUS_RUNS > 1 ) then num_device = mygroup else if (NPROC > 1 .and. NUMBER_OF_SIMULTANEOUS_RUNS > 1 ) then @@ -602,18 +629,80 @@ subroutine initialize_GPU() endif ! initializes GPU and outputs info to files for all processes - call initialize_gpu_device(num_device,ncuda_devices) + if (USE_CUDA_AWARE_MPI) then + ! devices have already been set before MPI_init() + if (myrank == 0) then + write(IMAIN,*) "using CUDA-aware MPI" + call flush_IMAIN() + endif + ! just to get number of devices and device info output + call initialize_gpu_device(num_device,ngpu_devices,2) ! init type 2 == only show device output + else + ! sets GPU devices + call initialize_gpu_device(num_device,ngpu_devices,0) ! default init (initialization & device output) + endif ! collects min/max of local devices found for statistics call synchronize_all() - call min_all_i(ncuda_devices,ncuda_devices_min) - call max_all_i(ncuda_devices,ncuda_devices_max) + call min_all_i(ngpu_devices,ngpu_devices_min) + call max_all_i(ngpu_devices,ngpu_devices_max) if (myrank == 0) then - write(IMAIN,*) "GPU number of devices per node: min =",ncuda_devices_min - write(IMAIN,*) " max =",ncuda_devices_max + write(IMAIN,*) "GPU number of devices per node: min =",ngpu_devices_min + write(IMAIN,*) " max =",ngpu_devices_max write(IMAIN,*) call flush_IMAIN() endif end subroutine initialize_GPU + +! +!------------------------------------------------------------------------------------------------- +! + + subroutine initialize_cuda_aware_mpi() + + use shared_parameters, only: GPU_MODE + use specfem_par, only: USE_CUDA_AWARE_MPI + + implicit none + +#ifdef WITH_CUDA_AWARE_MPI + ! local parameters + integer :: ier + logical :: has_cuda_aware_mpi + + ! initializes flags + USE_CUDA_AWARE_MPI = .false. + + ! we check first if GPU_MODE is set in Par_file + ! opens the parameter file: DATA/Par_file + call open_parameter_file(ier) + if (ier /= 0) stop 'an error occurred while opening the parameter file' + + call read_value_logical(GPU_MODE, 'GPU_MODE', ier) + if (ier /= 0) stop 'an error occurred while reading the parameter file: GPU_MODE' + + ! closes parameter file + call close_parameter_file() + + ! default + has_cuda_aware_mpi = .false. + + if (GPU_MODE) then + ! CUDA-aware MPI check + call check_cuda_aware_mpi(has_cuda_aware_mpi) + + ! check if CUDA-aware MPI is supported (and GPU devices set) + if (has_cuda_aware_mpi) then + USE_CUDA_AWARE_MPI = .true. + endif + endif +#else + ! to avoid compiler warnings + ! initializes flags + GPU_MODE = .false. + USE_CUDA_AWARE_MPI = .false. +#endif + + end subroutine initialize_cuda_aware_mpi diff --git a/src/specfem3D/lts_assemble_MPI_vector.F90 b/src/specfem3D/lts_assemble_MPI_vector.F90 index 306afe752..db2cd7316 100644 --- a/src/specfem3D/lts_assemble_MPI_vector.F90 +++ b/src/specfem3D/lts_assemble_MPI_vector.F90 @@ -187,7 +187,8 @@ end subroutine assemble_MPI_vector_async_send_lts ! MPI routines that only recv if *this* p-level has elements on the MPI boundary subroutine assemble_MPI_vector_async_recv_lts(NPROC,NGLOB_AB,array_val,ilevel, & - buffer_recv_vector_ext_mesh,num_interfaces_ext_mesh, & + buffer_send_vector_ext_mesh,buffer_recv_vector_ext_mesh, & + num_interfaces_ext_mesh, & max_nibool_interfaces_ext_mesh,nibool_interfaces_ext_mesh, & request_send_vector_ext_mesh,request_recv_vector_ext_mesh, & my_neighbors_ext_mesh) @@ -198,7 +199,7 @@ subroutine assemble_MPI_vector_async_recv_lts(NPROC,NGLOB_AB,array_val,ilevel, & use specfem_par, only: FAULT_SIMULATION - use specfem_par, only: GPU_MODE, Mesh_pointer, buffer_send_vector_ext_mesh + use specfem_par, only: GPU_MODE, Mesh_pointer use specfem_par_lts, only: num_interface_p_refine_ibool, interface_p_refine_ibool, num_p_level @@ -217,7 +218,7 @@ subroutine assemble_MPI_vector_async_recv_lts(NPROC,NGLOB_AB,array_val,ilevel, & integer,intent(in) :: num_interfaces_ext_mesh,max_nibool_interfaces_ext_mesh real(kind=CUSTOM_REAL), dimension(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),intent(inout) :: & - buffer_recv_vector_ext_mesh + buffer_send_vector_ext_mesh,buffer_recv_vector_ext_mesh integer, dimension(num_interfaces_ext_mesh),intent(in) :: nibool_interfaces_ext_mesh integer, dimension(num_interfaces_ext_mesh),intent(inout) :: request_send_vector_ext_mesh,request_recv_vector_ext_mesh @@ -227,7 +228,7 @@ subroutine assemble_MPI_vector_async_recv_lts(NPROC,NGLOB_AB,array_val,ilevel, & integer :: ipoin,iinterface,iglob integer :: num_buffer_points ! GPU - real(kind=CUSTOM_REAL), dimension(:), allocatable :: reduced_buffer_recv_vector_ext_mesh, reduced_buffer_send_vector_ext_mesh + real(kind=CUSTOM_REAL), dimension(:), allocatable :: buffer_reduced_recv_vector, buffer_reduced_send_vector integer :: num_refine,index,ier ! testing logical, parameter :: TEST_GPU = .false. @@ -246,7 +247,8 @@ subroutine assemble_MPI_vector_async_recv_lts(NPROC,NGLOB_AB,array_val,ilevel, & if (FAULT_SIMULATION) then ! receives MPI buffers with ordered assembly call assemble_MPI_vector_async_w_ord_lts(NPROC,NGLOB_AB,array_val,ilevel, & - buffer_recv_vector_ext_mesh,num_interfaces_ext_mesh, & + buffer_send_vector_ext_mesh,buffer_recv_vector_ext_mesh, & + num_interfaces_ext_mesh, & max_nibool_interfaces_ext_mesh, & nibool_interfaces_ext_mesh, & request_send_vector_ext_mesh,request_recv_vector_ext_mesh, & @@ -323,11 +325,11 @@ subroutine assemble_MPI_vector_async_recv_lts(NPROC,NGLOB_AB,array_val,ilevel, & num_refine = num_interface_p_refine_boundary(ilevel) - allocate(reduced_buffer_send_vector_ext_mesh(3*num_refine), & - reduced_buffer_recv_vector_ext_mesh(3*num_refine),stat=ier) + allocate(buffer_reduced_send_vector(3*num_refine), & + buffer_reduced_recv_vector(3*num_refine),stat=ier) if (ier /= 0) stop "Error allocating reduced_buffer_send_vector" - call sync_copy_reduced_from_device(Mesh_pointer,2,reduced_buffer_send_vector_ext_mesh,num_refine) + call sync_copy_reduced_from_device(Mesh_pointer,2,buffer_reduced_send_vector,num_refine) ! when testing, zero out unused portions if (TEST_GPU) buffer_send_vector_ext_mesh = 0 @@ -339,11 +341,11 @@ subroutine assemble_MPI_vector_async_recv_lts(NPROC,NGLOB_AB,array_val,ilevel, & if (num_interface_p_refine_ibool(iinterface,ilevel) > 0 ) then do ipoin = 1, num_interface_p_refine_ibool(iinterface,ilevel) index = index + 1 - buffer_send_vector_ext_mesh(1,ipoin,iinterface) = reduced_buffer_send_vector_ext_mesh(index) + buffer_send_vector_ext_mesh(1,ipoin,iinterface) = buffer_reduced_send_vector(index) index = index + 1 - buffer_send_vector_ext_mesh(2,ipoin,iinterface) = reduced_buffer_send_vector_ext_mesh(index) + buffer_send_vector_ext_mesh(2,ipoin,iinterface) = buffer_reduced_send_vector(index) index = index + 1 - buffer_send_vector_ext_mesh(3,ipoin,iinterface) = reduced_buffer_send_vector_ext_mesh(index) + buffer_send_vector_ext_mesh(3,ipoin,iinterface) = buffer_reduced_send_vector(index) enddo endif enddo @@ -408,17 +410,17 @@ subroutine assemble_MPI_vector_async_recv_lts(NPROC,NGLOB_AB,array_val,ilevel, & if (num_interface_p_refine_ibool(iinterface,ilevel) > 0 ) then do ipoin = 1, num_interface_p_refine_ibool(iinterface,ilevel) index = index + 1 - reduced_buffer_recv_vector_ext_mesh(index) = buffer_recv_vector_ext_mesh(1,ipoin,iinterface) + buffer_reduced_recv_vector(index) = buffer_recv_vector_ext_mesh(1,ipoin,iinterface) index = index + 1 - reduced_buffer_recv_vector_ext_mesh(index) = buffer_recv_vector_ext_mesh(2,ipoin,iinterface) + buffer_reduced_recv_vector(index) = buffer_recv_vector_ext_mesh(2,ipoin,iinterface) index = index + 1 - reduced_buffer_recv_vector_ext_mesh(index) = buffer_recv_vector_ext_mesh(3,ipoin,iinterface) + buffer_reduced_recv_vector(index) = buffer_recv_vector_ext_mesh(3,ipoin,iinterface) enddo endif enddo ! async sends boundary to device (on memory copy stream) - call transfer_reduced_boundary_to_device_async_lts(Mesh_pointer,reduced_buffer_recv_vector_ext_mesh,num_refine) + call transfer_reduced_boundary_to_device_async_lts(Mesh_pointer,buffer_reduced_recv_vector,num_refine) ! assemble values on GPU to accel field call assemble_reduced_mpi_device_lts(Mesh_pointer,ilevel,num_refine) @@ -428,8 +430,8 @@ subroutine assemble_MPI_vector_async_recv_lts(NPROC,NGLOB_AB,array_val,ilevel, & call wait_req(request_send_vector_ext_mesh(iinterface)) enddo - deallocate(reduced_buffer_send_vector_ext_mesh) - deallocate(reduced_buffer_recv_vector_ext_mesh) + deallocate(buffer_reduced_send_vector) + deallocate(buffer_reduced_recv_vector) endif ! ilevel == num_p_level endif ! GPU @@ -445,7 +447,8 @@ end subroutine assemble_MPI_vector_async_recv_lts ! MPI routines that only recv if *this* p-level has elements on the MPI boundary subroutine assemble_MPI_vector_async_w_ord_lts(NPROC,NGLOB_AB,array_val,ilevel, & - buffer_recv_vector_ext_mesh,num_interfaces_ext_mesh, & + buffer_send_vector_ext_mesh,buffer_recv_vector_ext_mesh, & + num_interfaces_ext_mesh, & max_nibool_interfaces_ext_mesh, & nibool_interfaces_ext_mesh, & request_send_vector_ext_mesh,request_recv_vector_ext_mesh, & @@ -465,7 +468,7 @@ subroutine assemble_MPI_vector_async_w_ord_lts(NPROC,NGLOB_AB,array_val,ilevel, use constants, only: NDIM,CUSTOM_REAL,ASSEMBLE_MPI_OFF,myrank,itag - use specfem_par, only: GPU_MODE, Mesh_pointer, buffer_send_vector_ext_mesh + use specfem_par, only: GPU_MODE, Mesh_pointer use specfem_par_lts, only: num_interface_p_refine_ibool, interface_p_refine_ibool, num_p_level @@ -484,7 +487,7 @@ subroutine assemble_MPI_vector_async_w_ord_lts(NPROC,NGLOB_AB,array_val,ilevel, integer,intent(in) :: num_interfaces_ext_mesh,max_nibool_interfaces_ext_mesh real(kind=CUSTOM_REAL), dimension(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),intent(inout) :: & - buffer_recv_vector_ext_mesh + buffer_send_vector_ext_mesh,buffer_recv_vector_ext_mesh integer, dimension(num_interfaces_ext_mesh),intent(in) :: nibool_interfaces_ext_mesh integer, dimension(num_interfaces_ext_mesh),intent(inout) :: request_send_vector_ext_mesh,request_recv_vector_ext_mesh @@ -496,7 +499,7 @@ subroutine assemble_MPI_vector_async_w_ord_lts(NPROC,NGLOB_AB,array_val,ilevel, logical :: need_add_my_contrib integer :: num_buffer_points ! GPU - real(kind=CUSTOM_REAL), dimension(:), allocatable :: reduced_buffer_recv_vector_ext_mesh, reduced_buffer_send_vector_ext_mesh + real(kind=CUSTOM_REAL), dimension(:), allocatable :: buffer_reduced_recv_vector, buffer_reduced_send_vector integer :: num_refine,index,ier ! testing logical, parameter :: TEST_GPU = .false. @@ -600,11 +603,11 @@ subroutine assemble_MPI_vector_async_w_ord_lts(NPROC,NGLOB_AB,array_val,ilevel, num_refine = num_interface_p_refine_boundary(ilevel) - allocate(reduced_buffer_send_vector_ext_mesh(3*num_refine), & - reduced_buffer_recv_vector_ext_mesh(3*num_refine),stat=ier) + allocate(buffer_reduced_send_vector(3*num_refine), & + buffer_reduced_recv_vector(3*num_refine),stat=ier) if (ier /= 0) call exit_mpi(myrank,"Error allocating reduced_buffer_send_vector") - call sync_copy_reduced_from_device(Mesh_pointer,2,reduced_buffer_send_vector_ext_mesh,num_refine) + call sync_copy_reduced_from_device(Mesh_pointer,2,buffer_reduced_send_vector,num_refine) ! when testing, zero out unused portions if (TEST_GPU) buffer_send_vector_ext_mesh = 0 @@ -616,11 +619,11 @@ subroutine assemble_MPI_vector_async_w_ord_lts(NPROC,NGLOB_AB,array_val,ilevel, if (num_interface_p_refine_ibool(iinterface,ilevel) > 0 ) then do ipoin = 1, num_interface_p_refine_ibool(iinterface,ilevel) index = index + 1 - buffer_send_vector_ext_mesh(1,ipoin,iinterface) = reduced_buffer_send_vector_ext_mesh(index) + buffer_send_vector_ext_mesh(1,ipoin,iinterface) = buffer_reduced_send_vector(index) index = index + 1 - buffer_send_vector_ext_mesh(2,ipoin,iinterface) = reduced_buffer_send_vector_ext_mesh(index) + buffer_send_vector_ext_mesh(2,ipoin,iinterface) = buffer_reduced_send_vector(index) index = index + 1 - buffer_send_vector_ext_mesh(3,ipoin,iinterface) = reduced_buffer_send_vector_ext_mesh(index) + buffer_send_vector_ext_mesh(3,ipoin,iinterface) = buffer_reduced_send_vector(index) enddo endif enddo @@ -685,17 +688,17 @@ subroutine assemble_MPI_vector_async_w_ord_lts(NPROC,NGLOB_AB,array_val,ilevel, if (num_interface_p_refine_ibool(iinterface,ilevel) > 0 ) then do ipoin = 1, num_interface_p_refine_ibool(iinterface,ilevel) index = index + 1 - reduced_buffer_recv_vector_ext_mesh(index) = buffer_recv_vector_ext_mesh(1,ipoin,iinterface) + buffer_reduced_recv_vector(index) = buffer_recv_vector_ext_mesh(1,ipoin,iinterface) index = index + 1 - reduced_buffer_recv_vector_ext_mesh(index) = buffer_recv_vector_ext_mesh(2,ipoin,iinterface) + buffer_reduced_recv_vector(index) = buffer_recv_vector_ext_mesh(2,ipoin,iinterface) index = index + 1 - reduced_buffer_recv_vector_ext_mesh(index) = buffer_recv_vector_ext_mesh(3,ipoin,iinterface) + buffer_reduced_recv_vector(index) = buffer_recv_vector_ext_mesh(3,ipoin,iinterface) enddo endif enddo ! async sends boundary to device (on memory copy stream) - call transfer_reduced_boundary_to_device_async_lts(Mesh_pointer,reduced_buffer_recv_vector_ext_mesh,num_refine) + call transfer_reduced_boundary_to_device_async_lts(Mesh_pointer,buffer_reduced_recv_vector,num_refine) ! assemble values on GPU to accel field call assemble_reduced_mpi_device_lts(Mesh_pointer,ilevel,num_refine) @@ -705,8 +708,8 @@ subroutine assemble_MPI_vector_async_w_ord_lts(NPROC,NGLOB_AB,array_val,ilevel, call wait_req(request_send_vector_ext_mesh(iinterface)) enddo - deallocate(reduced_buffer_send_vector_ext_mesh) - deallocate(reduced_buffer_recv_vector_ext_mesh) + deallocate(buffer_reduced_send_vector) + deallocate(buffer_reduced_recv_vector) endif ! ilevel == num_p_level endif ! GPU diff --git a/src/specfem3D/lts_global_step.F90 b/src/specfem3D/lts_global_step.F90 index 770f43df5..62cd58314 100644 --- a/src/specfem3D/lts_global_step.F90 +++ b/src/specfem3D/lts_global_step.F90 @@ -333,7 +333,8 @@ recursive subroutine lts_global_step(ilevel) ! waits for send/receive requests to be completed and assembles values ! receives MPI buffers call assemble_MPI_vector_async_recv_lts(NPROC,NGLOB_AB,accel,ilevel, & - buffer_recv_vector_ext_mesh,num_interfaces_ext_mesh, & + buffer_send_vector_ext_mesh,buffer_recv_vector_ext_mesh, & + num_interfaces_ext_mesh, & max_nibool_interfaces_ext_mesh,nibool_interfaces_ext_mesh, & request_send_vector_ext_mesh,request_recv_vector_ext_mesh, & my_neighbors_ext_mesh) diff --git a/src/specfem3D/lts_setup.F90 b/src/specfem3D/lts_setup.F90 index 1c10b0fbe..21dd5dfec 100644 --- a/src/specfem3D/lts_setup.F90 +++ b/src/specfem3D/lts_setup.F90 @@ -49,10 +49,10 @@ subroutine lts_setup() use constants, only: NDIM,CUSTOM_REAL,VERYSMALLVAL,FIX_UNDERFLOW_PROBLEM,IMAIN,itag,myrank use shared_parameters, only: DT,NSTEP,NPROC,SIMULATION_TYPE,LTS_MODE,USE_LDDRK, & - SAVE_SEISMOGRAMS_ACCELERATION,CREATE_SHAKEMAP + SAVE_SEISMOGRAMS_ACCELERATION,CREATE_SHAKEMAP,GPU_MODE use specfem_par, only: ACOUSTIC_SIMULATION,ELASTIC_SIMULATION,POROELASTIC_SIMULATION, & - deltat,NGLOB_AB,PML_CONDITIONS + deltat,NGLOB_AB,PML_CONDITIONS,USE_CUDA_AWARE_MPI ! MPI interfaces use specfem_par, only: num_interfaces_ext_mesh,ibool_interfaces_ext_mesh,nibool_interfaces_ext_mesh, & @@ -88,13 +88,21 @@ subroutine lts_setup() ! safety checks ! checks simulation domain types - if (ACOUSTIC_SIMULATION) call exit_MPI(myrank,'LTS routines only implemented for purely ELASTIC simulations') - if (POROELASTIC_SIMULATION) call exit_MPI(myrank,'LTS routines only implemented for purely ELASTIC simulations') - if (.not. ELASTIC_SIMULATION) call exit_MPI(myrank,'LTS routines only implemented for purely ELASTIC simulations') - - if (SIMULATION_TYPE /= 1) call exit_MPI(myrank,'LTS routines only implemented for forward simulations (SIMULATION_TYPE == 1)') - if (USE_LDDRK) call exit_MPI(myrank,'LTS routines only implemented for Newark time scheme (USE_LDDRK == .false.)') - if (PML_CONDITIONS) call exit_MPI(myrank,'LTS mode w/ PML boundaries not implemented yet') + if (ACOUSTIC_SIMULATION) & + call exit_MPI(myrank,'LTS routines only implemented for purely ELASTIC simulations') + if (POROELASTIC_SIMULATION) & + call exit_MPI(myrank,'LTS routines only implemented for purely ELASTIC simulations') + if (.not. ELASTIC_SIMULATION) & + call exit_MPI(myrank,'LTS routines only implemented for purely ELASTIC simulations') + + if (SIMULATION_TYPE /= 1) & + call exit_MPI(myrank,'LTS routines only implemented for forward simulations (SIMULATION_TYPE == 1)') + if (USE_LDDRK) & + call exit_MPI(myrank,'LTS routines only implemented for Newark time scheme (USE_LDDRK == .false.)') + if (PML_CONDITIONS) & + call exit_MPI(myrank,'LTS mode w/ PML boundaries not implemented yet') + if (GPU_MODE .and. USE_CUDA_AWARE_MPI) & + call exit_MPI(myrank,'LTS mode on GPU does not support CUDA-aware MPI yet') ! user output if (myrank == 0) then diff --git a/src/specfem3D/prepare_gpu.f90 b/src/specfem3D/prepare_gpu.f90 index 6d549dffa..b632981da 100644 --- a/src/specfem3D/prepare_gpu.f90 +++ b/src/specfem3D/prepare_gpu.f90 @@ -103,7 +103,8 @@ subroutine prepare_GPU() IS_WAVEFIELD_DISCONTINUITY, & COUPLE_WITH_INJECTION_TECHNIQUE, & UNDO_ATTENUATION_AND_OR_PML, & - PML_CONDITIONS) + PML_CONDITIONS, & + USE_CUDA_AWARE_MPI) ! prepares fields on GPU for acoustic simulations diff --git a/src/specfem3D/prepare_gravity.f90 b/src/specfem3D/prepare_gravity.f90 index 8771e212d..a39f22472 100644 --- a/src/specfem3D/prepare_gravity.f90 +++ b/src/specfem3D/prepare_gravity.f90 @@ -39,14 +39,18 @@ subroutine prepare_gravity() implicit none ! local parameters - double precision RICB,RCMB,RTOPDDOUBLEPRIME, & - R80,R220,R400,R600,R670,R771,RMOHO,RMIDDLE_CRUST,ROCEAN + double precision :: RICB,RCMB,RTOPDDOUBLEPRIME,R80,R220,R400,R600,R670,R771,RMOHO,RMIDDLE_CRUST,ROCEAN double precision :: rspl_gravity(NR),gspl(NR),gspl2(NR) - double precision :: radius,g,dg ! radius_km - !double precision :: g_cmb_dble,g_icb_dble + double precision :: radius,g,dg double precision :: rho,drhodr,vp,vs,Qkappa,Qmu - integer :: nspl_gravity !int_radius - integer :: i,j,k,iglob,ier + ! min/max + double precision :: ztop,zbottom,ztop_glob,zbottom_glob,zrange,height,factor + double precision, parameter :: ZERO_TOLERANCE = 1.d-12 + + integer :: nspl_gravity + integer :: iglob,ier + ! debugging + character(len=MAX_STRING_LEN) :: filename ! user output if (myrank == 0) then @@ -58,65 +62,142 @@ subroutine prepare_gravity() ! sets up arrays for gravity field call gravity_init() - ! sets up weights needed for integration of gravity - do k = 1,NGLLZ - do j = 1,NGLLY - do i = 1,NGLLX - wgll_cube(i,j,k) = sngl( wxgll(i)*wygll(j)*wzgll(k) ) - enddo - enddo - enddo - ! store g, rho and dg/dr=dg using normalized radius in lookup table every 100 m ! get density and velocity from PREM model using dummy doubling flag ! this assumes that the gravity perturbations are small and smooth ! and that we can neglect the 3D model and use PREM every 100 m in all cases ! this is probably a rather reasonable assumption if (GRAVITY) then + if (myrank == 0) then + write(IMAIN,*) " ...setting up gravity arrays" + call flush_IMAIN() + endif + ! allocates gravity arrays allocate(minus_deriv_gravity(NGLOB_AB),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 2156') + minus_deriv_gravity(:) = 0.0_CUSTOM_REAL + allocate(minus_g(NGLOB_AB), stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 2157') if (ier /= 0) stop 'error allocating gravity arrays' + minus_g(:) = 0.0_CUSTOM_REAL + + if (USE_GRAVITY_MINMAX) then + ! gravitational acceleration specified by min/max values at top/bottom + if (myrank == 0) then + write(IMAIN,*) " using gravitational acceleration from min/max specification:" + write(IMAIN,*) " g at top (m/s^2): ",sngl(GRAVITY_MINMAX_TOP) + write(IMAIN,*) " g at bottom : ",sngl(GRAVITY_MINMAX_BOTTOM) + call flush_IMAIN() + endif + + ! determines z-values for bottom/top of the mesh + zbottom = minval(zstore) + ztop = maxval(zstore) + call min_all_all_dp(zbottom,zbottom_glob) + call max_all_all_dp(ztop,ztop_glob) + zbottom = zbottom_glob + ztop = ztop_glob + + if (myrank == 0) then + write(IMAIN,*) ' Zbottom and Ztop of the model: ',sngl(zbottom),'/',sngl(ztop) + call flush_IMAIN() + endif + + ! mesh size + zrange = ztop - zbottom + + ! to avoid division by zero + if (abs(zrange) < ZERO_TOLERANCE) then + call exit_mpi(myrank,"Invalid mesh with zero z-height") + endif + + ! linear increase of gravity + ! dg/dz + dg = (GRAVITY_MINMAX_TOP - GRAVITY_MINMAX_BOTTOM) / zrange + if (myrank == 0) then + write(IMAIN,*) ' dg (vertical rate of change): ',sngl(dg) + call flush_IMAIN() + endif + + ! pre-calculates gravity terms for all global points + do iglob = 1,NGLOB_AB + ! height (zstore values given in m) + height = zstore(iglob) - zbottom + ! normalized between [0,1] + factor = height / zrange + + ! gravitational acceleration (assumed to be in m / s^2) + ! linear increase from bottom to top + g = GRAVITY_MINMAX_BOTTOM + factor * (GRAVITY_MINMAX_TOP - GRAVITY_MINMAX_BOTTOM) + + minus_deriv_gravity(iglob) = - dg + minus_g(iglob) = - g ! in negative z-direction + + ! debug + !if (iglob == 1 .or. iglob == 1000 .or. iglob == 10000 .or. iglob == NGLOB_AB) then + ! print *,'gravity: iglob=',iglob,'height=',height,'g=',g,'dg=',dg,'factor=',factor + !endif + enddo - ! sets up spline table - call make_gravity(nspl_gravity,rspl_gravity,gspl,gspl2, & - ROCEAN,RMIDDLE_CRUST,RMOHO,R80,R220,R400,R600,R670, & - R771,RTOPDDOUBLEPRIME,RCMB,RICB) - - ! pre-calculates gravity terms for all global points - do iglob = 1,NGLOB_AB - - ! normalized radius ( zstore values given in m, negative values for depth) - radius = ( R_EARTH + zstore(iglob) ) / R_EARTH - call spline_evaluation(rspl_gravity,gspl,gspl2,nspl_gravity,radius,g) - - ! use PREM density profile to calculate gravity (fine for other 1D models) - call model_prem_iso(radius,rho,drhodr,vp,vs,Qkappa,Qmu, & - RICB,RCMB,RTOPDDOUBLEPRIME, & - R600,R670,R220,R771,R400,R80,RMOHO,RMIDDLE_CRUST,ROCEAN) - - dg = 4.0d0*rho - 2.0d0*g/radius - - ! re-dimensionalize - g = g * R_EARTH*(PI*GRAV*RHOAV) ! in m / s^2 ( should be around 10 m/s^2) - dg = dg * R_EARTH*(PI*GRAV*RHOAV) / R_EARTH ! gradient d/dz g , in 1/s^2 - - minus_deriv_gravity(iglob) = - dg - minus_g(iglob) = - g ! in negative z-direction - - ! debug - !if (iglob == 1 .or. iglob == 1000 .or. iglob == 10000) then - ! ! re-dimensionalize - ! radius = radius * R_EARTH ! in m - ! vp = vp * R_EARTH*dsqrt(PI*GRAV*RHOAV) ! in m / s - ! rho = rho * RHOAV ! in kg / m^3 - ! print *,'gravity: radius=',radius,'g=',g,'depth=',radius-R_EARTH - ! print *,'vp=',vp,'rho=',rho,'kappa=',(vp**2) * rho - ! print *,'minus_g..=',minus_g(iglob) - !endif - enddo + else + ! gravity acceleration for PREM + if (myrank == 0) then + write(IMAIN,*) " using gravitational acceleration from PREM" + call flush_IMAIN() + endif + + ! sets up spline table + call make_gravity(nspl_gravity,rspl_gravity,gspl,gspl2, & + ROCEAN,RMIDDLE_CRUST,RMOHO,R80,R220,R400,R600,R670, & + R771,RTOPDDOUBLEPRIME,RCMB,RICB) + + ! pre-calculates gravity terms for all global points + do iglob = 1,NGLOB_AB + ! normalized radius ( zstore values given in m, negative values for depth) + radius = ( R_EARTH + zstore(iglob) ) / R_EARTH + + call spline_evaluation(rspl_gravity,gspl,gspl2,nspl_gravity,radius,g) + + ! use PREM density profile to calculate gravity (fine for other 1D models) + call model_prem_iso(radius,rho,drhodr,vp,vs,Qkappa,Qmu, & + RICB,RCMB,RTOPDDOUBLEPRIME, & + R600,R670,R220,R771,R400,R80,RMOHO,RMIDDLE_CRUST,ROCEAN) + + dg = 4.0d0 * rho - 2.0d0 * g / radius + + ! re-dimensionalize + g = g * R_EARTH*(PI*GRAV*RHOAV) ! in m / s^2 ( should be around 10 m/s^2) + dg = dg * R_EARTH*(PI*GRAV*RHOAV) / R_EARTH ! gradient d/dz g , in 1/s^2 + + minus_deriv_gravity(iglob) = - dg + minus_g(iglob) = - g ! in negative z-direction + + ! debug + !if (iglob == 1 .or. iglob == 1000 .or. iglob == 10000 .or. iglob == NGLOB_AB) then + ! ! re-dimensionalize + ! radius = radius * R_EARTH ! in m + ! print *,'gravity: iglob=',iglob,'radius=',radius,'depth=',radius-R_EARTH,'g=',g,'dg=',dg + ! vp = vp * R_EARTH*dsqrt(PI*GRAV*RHOAV) ! in m / s + ! rho = rho * RHOAV ! in kg / m^3 + ! print *,'vp=',vp,'rho=',rho,'kappa=',(vp**2) * rho + ! print *,'minus_g..=',minus_g(iglob) + !endif + enddo + endif + + ! file output + if (SAVE_MESH_FILES) then + ! minus_g + filename = prname(1:len_trim(prname)) // 'minus_g' + call write_VTK_wavefield_scalar(NSPEC_AB,NGLOB_AB,xstore,ystore,zstore,ibool,minus_g,filename) + if (myrank == 0) write(IMAIN,*) ' saving VTK field -g (for slice 0): ',trim(filename)//'.vtk' + ! minus_deriv_gravity + filename = prname(1:len_trim(prname)) // 'minus_deriv_gravity' + call write_VTK_wavefield_scalar(NSPEC_AB,NGLOB_AB,xstore,ystore,zstore,ibool,minus_deriv_gravity,filename) + if (myrank == 0) write(IMAIN,*) ' saving VTK field -dg (for slice 0): ',trim(filename)//'.vtk' + endif else ! allocates dummy gravity arrays diff --git a/src/specfem3D/read_mesh_databases.F90 b/src/specfem3D/read_mesh_databases.F90 index 14e7d31fb..0659f49da 100644 --- a/src/specfem3D/read_mesh_databases.F90 +++ b/src/specfem3D/read_mesh_databases.F90 @@ -103,6 +103,7 @@ subroutine read_mesh_databases() ! local parameters integer :: ier,itest character(len=MAX_STRING_LEN) :: database_name + integer :: shape_2d(2), shape_3d(3) ! debugging integer :: i @@ -1300,12 +1301,20 @@ subroutine read_mesh_databases() ! MPI communications if (ACOUSTIC_SIMULATION) then - allocate(buffer_send_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1560') - allocate(buffer_recv_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1561') - buffer_send_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL; buffer_recv_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL - + if (USE_CUDA_AWARE_MPI) then + ! allocates buffers on GPU + shape_2d(1) = max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU + shape_2d(2) = num_interfaces_ext_mesh + call allocate_gpu_buffer_2d(buffer_send_scalar_ext_mesh,shape_2d) + call allocate_gpu_buffer_2d(buffer_recv_scalar_ext_mesh,shape_2d) + else + ! allocates buffers on CPU + allocate(buffer_send_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1560') + allocate(buffer_recv_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1561') + buffer_send_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL; buffer_recv_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL + endif allocate(request_send_scalar_ext_mesh(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1562') allocate(request_recv_scalar_ext_mesh(num_interfaces_ext_mesh), stat=ier) @@ -1315,12 +1324,22 @@ subroutine read_mesh_databases() endif if (ELASTIC_SIMULATION) then - allocate(buffer_send_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1564') - allocate(buffer_recv_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1565') - buffer_send_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL - + ! MPI buffers + if (USE_CUDA_AWARE_MPI) then + ! allocates buffers on GPU + shape_3d(1) = NDIM + shape_3d(2) = max_nibool_interfaces_ext_mesh + shape_3d(3) = num_interfaces_ext_mesh + call allocate_gpu_buffer_3d(buffer_send_vector_ext_mesh,shape_3d) + call allocate_gpu_buffer_3d(buffer_recv_vector_ext_mesh,shape_3d) + else + ! allocates buffers on CPU + allocate(buffer_send_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1564') + allocate(buffer_recv_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1565') + buffer_send_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL + endif allocate(request_send_vector_ext_mesh(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1566') allocate(request_recv_vector_ext_mesh(num_interfaces_ext_mesh), stat=ier) @@ -1330,17 +1349,28 @@ subroutine read_mesh_databases() endif if (POROELASTIC_SIMULATION) then - allocate(buffer_send_vector_ext_mesh_s(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1568') - allocate(buffer_recv_vector_ext_mesh_s(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1569') - allocate(buffer_send_vector_ext_mesh_w(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1570') - allocate(buffer_recv_vector_ext_mesh_w(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1571') - buffer_send_vector_ext_mesh_s(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh_s(:,:,:) = 0.0_CUSTOM_REAL - buffer_send_vector_ext_mesh_w(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh_w(:,:,:) = 0.0_CUSTOM_REAL - + if (USE_CUDA_AWARE_MPI) then + ! allocates buffers on GPU + shape_3d(1) = NDIM + shape_3d(2) = max_nibool_interfaces_ext_mesh + shape_3d(3) = num_interfaces_ext_mesh + call allocate_gpu_buffer_3d(buffer_send_vector_ext_mesh_s,shape_3d) + call allocate_gpu_buffer_3d(buffer_recv_vector_ext_mesh_s,shape_3d) + call allocate_gpu_buffer_3d(buffer_send_vector_ext_mesh_w,shape_3d) + call allocate_gpu_buffer_3d(buffer_recv_vector_ext_mesh_w,shape_3d) + else + ! allocates buffers on CPU + allocate(buffer_send_vector_ext_mesh_s(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1568') + allocate(buffer_recv_vector_ext_mesh_s(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1569') + allocate(buffer_send_vector_ext_mesh_w(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1570') + allocate(buffer_recv_vector_ext_mesh_w(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1571') + buffer_send_vector_ext_mesh_s(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh_s(:,:,:) = 0.0_CUSTOM_REAL + buffer_send_vector_ext_mesh_w(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh_w(:,:,:) = 0.0_CUSTOM_REAL + endif allocate(request_send_vector_ext_mesh_s(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1572') allocate(request_recv_vector_ext_mesh_s(num_interfaces_ext_mesh),stat=ier) @@ -1389,6 +1419,40 @@ subroutine print_mesh_databases_stats() endif end subroutine print_mesh_databases_stats + !-------- + + subroutine allocate_gpu_buffer_2d(buffer, shape) + + use iso_c_binding, only: c_ptr,c_f_pointer + + implicit none + real(kind=CUSTOM_REAL), dimension(:,:), pointer, intent(inout) :: buffer + integer, intent(in) :: shape(2) + ! local parameters + type(c_ptr) :: c_ptr_buffer + + call allocate_gpu_buffer(c_ptr_buffer, shape(1) * shape(2)) + call c_f_pointer(c_ptr_buffer, buffer, shape) + + end subroutine allocate_gpu_buffer_2d + + !-------- + + subroutine allocate_gpu_buffer_3d(buffer, shape) + + use iso_c_binding, only: c_ptr,c_f_pointer + + implicit none + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer, intent(inout) :: buffer + integer, intent(in) :: shape(3) + ! local parameters + type(c_ptr) :: c_ptr_buffer + + call allocate_gpu_buffer(c_ptr_buffer, shape(1) * shape(2) * shape(3)) + call c_f_pointer(c_ptr_buffer, buffer, shape) + + end subroutine allocate_gpu_buffer_3d + end subroutine read_mesh_databases ! @@ -1592,7 +1656,7 @@ subroutine read_mesh_databases_adjoint() use specfem_par_noise implicit none - + integer :: shape_2d(2), shape_3d(3) integer :: ier ! note: this routines has no file I/O, it (only) allocates necessary arrays for adjoint/kernel simulations @@ -1683,17 +1747,27 @@ subroutine read_mesh_databases_adjoint() hess_kappa_kl(:,:,:,:) = 0.0_CUSTOM_REAL; hess_mu_kl(:,:,:,:) = 0.0_CUSTOM_REAL ! MPI handling + if (USE_CUDA_AWARE_MPI) then + ! allocates buffers on GPU + shape_3d(1) = NDIM + shape_3d(2) = max_nibool_interfaces_ext_mesh + shape_3d(3) = num_interfaces_ext_mesh + call allocate_gpu_buffer_3d(b_buffer_send_vector_ext_mesh,shape_3d) + call allocate_gpu_buffer_3d(b_buffer_recv_vector_ext_mesh,shape_3d) + else + ! allocates buffers on CPU + allocate(b_buffer_send_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1608') + allocate(b_buffer_recv_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1609') + b_buffer_send_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL; b_buffer_recv_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL + endif allocate(b_request_send_vector_ext_mesh(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1606') allocate(b_request_recv_vector_ext_mesh(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1607') - allocate(b_buffer_send_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1608') - allocate(b_buffer_recv_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1609') if (ier /= 0) stop 'Error allocating array b_request_send_vector_ext_mesh etc.' b_request_send_vector_ext_mesh(:) = 0; b_request_recv_vector_ext_mesh(:) = 0 - b_buffer_send_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL; b_buffer_recv_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL ! allocates attenuation solids allocate(b_R_xx(N_SLS,NGLLX,NGLLY,NGLLZ,NSPEC_ATTENUATION_AB),stat=ier) @@ -1811,18 +1885,26 @@ subroutine read_mesh_databases_adjoint() hess_kappa_ac_kl(:,:,:,:) = 0.0_CUSTOM_REAL ! MPI handling + if (USE_CUDA_AWARE_MPI) then + ! allocates buffers on GPU + shape_2d(1) = max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU + shape_2d(2) = num_interfaces_ext_mesh + call allocate_gpu_buffer_2d(b_buffer_send_scalar_ext_mesh,shape_2d) + call allocate_gpu_buffer_2d(b_buffer_recv_scalar_ext_mesh,shape_2d) + else + ! allocates buffers on CPU + allocate(b_buffer_send_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1642') + allocate(b_buffer_recv_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1643') + b_buffer_send_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL; b_buffer_recv_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL + endif allocate(b_request_send_scalar_ext_mesh(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1640') allocate(b_request_recv_scalar_ext_mesh(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1641') - allocate(b_buffer_send_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1642') - allocate(b_buffer_recv_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1643') if (ier /= 0) stop 'Error allocating array b_request_send_scalar_ext_mesh' b_request_send_scalar_ext_mesh(:) = 0; b_request_recv_scalar_ext_mesh(:) = 0 - b_buffer_send_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL; b_buffer_recv_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL - else ! dummy arrays (needed for routine arguments) ! backward potentials @@ -1958,29 +2040,41 @@ subroutine read_mesh_databases_adjoint() cpII_kl(:,:,:,:) = 0.0_CUSTOM_REAL ! MPI handling + if (USE_CUDA_AWARE_MPI) then + ! allocates buffers on GPU + shape_3d(1) = NDIM + shape_3d(2) = max_nibool_interfaces_ext_mesh + shape_3d(3) = num_interfaces_ext_mesh + call allocate_gpu_buffer_3d(b_buffer_send_vector_ext_meshs,shape_3d) + call allocate_gpu_buffer_3d(b_buffer_recv_vector_ext_meshs,shape_3d) + call allocate_gpu_buffer_3d(b_buffer_send_vector_ext_meshw,shape_3d) + call allocate_gpu_buffer_3d(b_buffer_recv_vector_ext_meshw,shape_3d) + else + ! allocates buffers on CPU + allocate(b_buffer_send_vector_ext_meshs(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1685') + allocate(b_buffer_recv_vector_ext_meshs(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1686') + allocate(b_buffer_send_vector_ext_meshw(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1689') + allocate(b_buffer_recv_vector_ext_meshw(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1690') + b_buffer_send_vector_ext_meshs(:,:,:) = 0.0_CUSTOM_REAL; b_buffer_recv_vector_ext_meshs(:,:,:) = 0.0_CUSTOM_REAL + b_buffer_send_vector_ext_meshw(:,:,:) = 0.0_CUSTOM_REAL; b_buffer_recv_vector_ext_meshw(:,:,:) = 0.0_CUSTOM_REAL + endif allocate(b_request_send_vector_ext_meshs(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1683') allocate(b_request_recv_vector_ext_meshs(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1684') - allocate(b_buffer_send_vector_ext_meshs(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1685') - allocate(b_buffer_recv_vector_ext_meshs(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1686') if (ier /= 0) stop 'Error allocating array b_request_send_vector_ext_meshs etc.' b_request_send_vector_ext_meshs(:) = 0; b_request_recv_vector_ext_meshs(:) = 0 - b_buffer_send_vector_ext_meshs(:,:,:) = 0.0_CUSTOM_REAL; b_buffer_recv_vector_ext_meshs(:,:,:) = 0.0_CUSTOM_REAL allocate(b_request_send_vector_ext_meshw(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1687') allocate(b_request_recv_vector_ext_meshw(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1688') - allocate(b_buffer_send_vector_ext_meshw(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1689') - allocate(b_buffer_recv_vector_ext_meshw(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1690') if (ier /= 0) stop 'Error allocating array b_request_send_vector_ext_meshw etc.' b_request_send_vector_ext_meshw(:) = 0; b_request_recv_vector_ext_meshw(:) = 0 - b_buffer_send_vector_ext_meshw(:,:,:) = 0.0_CUSTOM_REAL; b_buffer_recv_vector_ext_meshw(:,:,:) = 0.0_CUSTOM_REAL ! arrays needed for kernel computations allocate(b_epsilonsdev_xx(NGLLX,NGLLY,NGLLZ,NSPEC_ADJOINT),stat=ier) @@ -2104,5 +2198,39 @@ subroutine read_mesh_databases_adjoint() endif +contains + + subroutine allocate_gpu_buffer_2d(buffer, shape) + + use iso_c_binding, only: c_ptr,c_f_pointer + + implicit none + real(kind=CUSTOM_REAL), dimension(:,:), pointer, intent(inout) :: buffer + integer, intent(in) :: shape(2) + ! local parameters + type(c_ptr) :: c_ptr_buffer + + call allocate_gpu_buffer(c_ptr_buffer, shape(1) * shape(2)) + call c_f_pointer(c_ptr_buffer, buffer, shape) + + end subroutine allocate_gpu_buffer_2d + + !-------- + + subroutine allocate_gpu_buffer_3d(buffer, shape) + + use iso_c_binding, only: c_ptr,c_f_pointer + + implicit none + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer, intent(inout) :: buffer + integer, intent(in) :: shape(3) + ! local parameters + type(c_ptr) :: c_ptr_buffer + + call allocate_gpu_buffer(c_ptr_buffer, shape(1) * shape(2) * shape(3)) + call c_f_pointer(c_ptr_buffer, buffer, shape) + + end subroutine allocate_gpu_buffer_3d + end subroutine read_mesh_databases_adjoint diff --git a/src/specfem3D/read_mesh_databases_adios.F90 b/src/specfem3D/read_mesh_databases_adios.F90 index d4e70bce3..71ca0582d 100644 --- a/src/specfem3D/read_mesh_databases_adios.F90 +++ b/src/specfem3D/read_mesh_databases_adios.F90 @@ -147,6 +147,7 @@ subroutine read_mesh_databases_adios() local_dim_neighbors_adjncy integer :: nspec_ext,nglob_ext,nspec_irregular_ext + integer :: shape_2d(2), shape_3d(3) !-------------------------------------. ! Open ADIOS Database file, read mode | @@ -1749,47 +1750,77 @@ subroutine read_mesh_databases_adios() ! MPI communications ! acoustic wavefield buffers if (ACOUSTIC_SIMULATION) then - allocate(buffer_send_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1930') - allocate(buffer_recv_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1931') - + if (USE_CUDA_AWARE_MPI) then + ! allocates buffers on GPU + shape_2d(1) = max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU + shape_2d(2) = num_interfaces_ext_mesh + call allocate_gpu_buffer_2d(buffer_send_scalar_ext_mesh,shape_2d) + call allocate_gpu_buffer_2d(buffer_recv_scalar_ext_mesh,shape_2d) + else + ! allocates buffers on CPU + allocate(buffer_send_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1930') + allocate(buffer_recv_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1931') + buffer_send_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL; buffer_recv_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL + endif allocate(request_send_scalar_ext_mesh(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1934') allocate(request_recv_scalar_ext_mesh(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1935') - - buffer_send_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL; buffer_recv_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL request_send_scalar_ext_mesh(:) = 0; request_recv_scalar_ext_mesh(:) = 0 endif ! elastic wavefield buffers if (ELASTIC_SIMULATION) then - allocate(buffer_send_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1928') - allocate(buffer_recv_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1929') - + ! MPI buffers + if (USE_CUDA_AWARE_MPI) then + ! allocates buffers on GPU + shape_3d(1) = NDIM + shape_3d(2) = max_nibool_interfaces_ext_mesh + shape_3d(3) = num_interfaces_ext_mesh + call allocate_gpu_buffer_3d(buffer_send_vector_ext_mesh,shape_3d) + call allocate_gpu_buffer_3d(buffer_recv_vector_ext_mesh,shape_3d) + else + ! allocates buffers on CPU + allocate(buffer_send_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1928') + allocate(buffer_recv_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1929') + buffer_send_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL + endif allocate(request_send_vector_ext_mesh(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1932') allocate(request_recv_vector_ext_mesh(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1933') - - buffer_send_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL request_send_vector_ext_mesh(:) = 0; request_recv_vector_ext_mesh(:) = 0 endif ! poroelastic wavefield buffers if (POROELASTIC_SIMULATION) then - allocate(buffer_send_vector_ext_mesh_s(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1936') - allocate(buffer_recv_vector_ext_mesh_s(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1937') - allocate(buffer_send_vector_ext_mesh_w(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1938') - allocate(buffer_recv_vector_ext_mesh_w(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1939') - + ! MPI buffers + if (USE_CUDA_AWARE_MPI) then + ! allocates buffers on GPU + shape_3d(1) = NDIM + shape_3d(2) = max_nibool_interfaces_ext_mesh + shape_3d(3) = num_interfaces_ext_mesh + call allocate_gpu_buffer_3d(buffer_send_vector_ext_mesh_s,shape_3d) + call allocate_gpu_buffer_3d(buffer_recv_vector_ext_mesh_s,shape_3d) + call allocate_gpu_buffer_3d(buffer_send_vector_ext_mesh_w,shape_3d) + call allocate_gpu_buffer_3d(buffer_recv_vector_ext_mesh_w,shape_3d) + else + ! allocates buffers on CPU + allocate(buffer_send_vector_ext_mesh_s(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1936') + allocate(buffer_recv_vector_ext_mesh_s(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1937') + allocate(buffer_send_vector_ext_mesh_w(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1938') + allocate(buffer_recv_vector_ext_mesh_w(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1939') + buffer_send_vector_ext_mesh_s(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh_s(:,:,:) = 0.0_CUSTOM_REAL + buffer_send_vector_ext_mesh_w(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh_w(:,:,:) = 0.0_CUSTOM_REAL + endif allocate(request_send_vector_ext_mesh_s(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1940') allocate(request_recv_vector_ext_mesh_s(num_interfaces_ext_mesh),stat=ier) @@ -1798,10 +1829,7 @@ subroutine read_mesh_databases_adios() if (ier /= 0) call exit_MPI_without_rank('error allocating array 1942') allocate(request_recv_vector_ext_mesh_w(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1943') - if (ier /= 0) stop 'error allocating array buffer_send_vector_ext_mesh etc.' - - buffer_send_vector_ext_mesh_s(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh_s(:,:,:) = 0.0_CUSTOM_REAL - buffer_send_vector_ext_mesh_w(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh_w(:,:,:) = 0.0_CUSTOM_REAL + if (ier /= 0) stop 'error allocating array buffer_send_vector_ext_mesh_s etc.' request_send_vector_ext_mesh_s(:) = 0; request_recv_vector_ext_mesh_s(:) = 0 request_send_vector_ext_mesh_w(:) = 0; request_recv_vector_ext_mesh_w(:) = 0 endif @@ -1813,6 +1841,40 @@ subroutine read_mesh_databases_adios() call flush_IMAIN() endif +contains + + subroutine allocate_gpu_buffer_2d(buffer, shape) + + use iso_c_binding, only: c_ptr,c_f_pointer + + implicit none + real(kind=CUSTOM_REAL), dimension(:,:), pointer, intent(inout) :: buffer + integer, intent(in) :: shape(2) + ! local parameters + type(c_ptr) :: c_ptr_buffer + + call allocate_gpu_buffer(c_ptr_buffer, shape(1) * shape(2)) + call c_f_pointer(c_ptr_buffer, buffer, shape) + + end subroutine allocate_gpu_buffer_2d + + !-------- + + subroutine allocate_gpu_buffer_3d(buffer, shape) + + use iso_c_binding, only: c_ptr,c_f_pointer + + implicit none + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer, intent(inout) :: buffer + integer, intent(in) :: shape(3) + ! local parameters + type(c_ptr) :: c_ptr_buffer + + call allocate_gpu_buffer(c_ptr_buffer, shape(1) * shape(2) * shape(3)) + call c_f_pointer(c_ptr_buffer, buffer, shape) + + end subroutine allocate_gpu_buffer_3d + end subroutine read_mesh_databases_adios diff --git a/src/specfem3D/read_mesh_databases_hdf5.F90 b/src/specfem3D/read_mesh_databases_hdf5.F90 index d73aa9af9..8697c202b 100644 --- a/src/specfem3D/read_mesh_databases_hdf5.F90 +++ b/src/specfem3D/read_mesh_databases_hdf5.F90 @@ -162,6 +162,8 @@ subroutine read_mesh_databases_hdf5() integer(kind=8) :: sum_offset_neighbors_adjncy_this_proc integer(kind=8), dimension(0:NPROC-1) :: offset_neighbors_adjncy_i8 + integer :: shape_2d(2), shape_3d(3) + ! user output if (myrank == 0) then write(IMAIN,*) "Reading mesh databases..." @@ -1672,12 +1674,20 @@ subroutine read_mesh_databases_hdf5() ! MPI communications if (ACOUSTIC_SIMULATION) then - allocate(buffer_send_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1560') - allocate(buffer_recv_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1561') - buffer_send_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL; buffer_recv_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL - + if (USE_CUDA_AWARE_MPI) then + ! allocates buffers on GPU + shape_2d(1) = max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU + shape_2d(2) = num_interfaces_ext_mesh + call allocate_gpu_buffer_2d(buffer_send_scalar_ext_mesh,shape_2d) + call allocate_gpu_buffer_2d(buffer_recv_scalar_ext_mesh,shape_2d) + else + ! allocates buffers on CPU + allocate(buffer_send_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1560') + allocate(buffer_recv_scalar_ext_mesh(max_nibool_interfaces_ext_mesh*NB_RUNS_ACOUSTIC_GPU,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1561') + buffer_send_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL; buffer_recv_scalar_ext_mesh(:,:) = 0.0_CUSTOM_REAL + endif allocate(request_send_scalar_ext_mesh(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1562') allocate(request_recv_scalar_ext_mesh(num_interfaces_ext_mesh), stat=ier) @@ -1687,12 +1697,21 @@ subroutine read_mesh_databases_hdf5() endif if (ELASTIC_SIMULATION) then - allocate(buffer_send_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1564') - allocate(buffer_recv_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1565') - buffer_send_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL - + if (USE_CUDA_AWARE_MPI) then + ! allocates buffers on GPU + shape_3d(1) = NDIM + shape_3d(2) = max_nibool_interfaces_ext_mesh + shape_3d(3) = num_interfaces_ext_mesh + call allocate_gpu_buffer_3d(buffer_send_vector_ext_mesh,shape_3d) + call allocate_gpu_buffer_3d(buffer_recv_vector_ext_mesh,shape_3d) + else + ! allocates buffers on CPU + allocate(buffer_send_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1564') + allocate(buffer_recv_vector_ext_mesh(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1565') + buffer_send_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh(:,:,:) = 0.0_CUSTOM_REAL + endif allocate(request_send_vector_ext_mesh(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1566') allocate(request_recv_vector_ext_mesh(num_interfaces_ext_mesh), stat=ier) @@ -1702,17 +1721,28 @@ subroutine read_mesh_databases_hdf5() endif if (POROELASTIC_SIMULATION) then - allocate(buffer_send_vector_ext_mesh_s(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1568') - allocate(buffer_recv_vector_ext_mesh_s(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1569') - allocate(buffer_send_vector_ext_mesh_w(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1570') - allocate(buffer_recv_vector_ext_mesh_w(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) - if (ier /= 0) call exit_MPI_without_rank('error allocating array 1571') - buffer_send_vector_ext_mesh_s(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh_s(:,:,:) = 0.0_CUSTOM_REAL - buffer_send_vector_ext_mesh_w(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh_w(:,:,:) = 0.0_CUSTOM_REAL - + if (USE_CUDA_AWARE_MPI) then + ! allocates buffers on GPU + shape_3d(1) = NDIM + shape_3d(2) = max_nibool_interfaces_ext_mesh + shape_3d(3) = num_interfaces_ext_mesh + call allocate_gpu_buffer_3d(buffer_send_vector_ext_mesh_s,shape_3d) + call allocate_gpu_buffer_3d(buffer_recv_vector_ext_mesh_s,shape_3d) + call allocate_gpu_buffer_3d(buffer_send_vector_ext_mesh_w,shape_3d) + call allocate_gpu_buffer_3d(buffer_recv_vector_ext_mesh_w,shape_3d) + else + ! allocates buffers on CPU + allocate(buffer_send_vector_ext_mesh_s(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1568') + allocate(buffer_recv_vector_ext_mesh_s(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1569') + allocate(buffer_send_vector_ext_mesh_w(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1570') + allocate(buffer_recv_vector_ext_mesh_w(NDIM,max_nibool_interfaces_ext_mesh,num_interfaces_ext_mesh),stat=ier) + if (ier /= 0) call exit_MPI_without_rank('error allocating array 1571') + buffer_send_vector_ext_mesh_s(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh_s(:,:,:) = 0.0_CUSTOM_REAL + buffer_send_vector_ext_mesh_w(:,:,:) = 0.0_CUSTOM_REAL; buffer_recv_vector_ext_mesh_w(:,:,:) = 0.0_CUSTOM_REAL + endif allocate(request_send_vector_ext_mesh_s(num_interfaces_ext_mesh),stat=ier) if (ier /= 0) call exit_MPI_without_rank('error allocating array 1572') allocate(request_recv_vector_ext_mesh_s(num_interfaces_ext_mesh),stat=ier) @@ -1733,6 +1763,40 @@ subroutine read_mesh_databases_hdf5() call flush_IMAIN() endif +contains + + subroutine allocate_gpu_buffer_2d(buffer, shape) + + use iso_c_binding, only: c_ptr,c_f_pointer + + implicit none + real(kind=CUSTOM_REAL), dimension(:,:), pointer, intent(inout) :: buffer + integer, intent(in) :: shape(2) + ! local parameters + type(c_ptr) :: c_ptr_buffer + + call allocate_gpu_buffer(c_ptr_buffer, shape(1) * shape(2)) + call c_f_pointer(c_ptr_buffer, buffer, shape) + + end subroutine allocate_gpu_buffer_2d + + !-------- + + subroutine allocate_gpu_buffer_3d(buffer, shape) + + use iso_c_binding, only: c_ptr,c_f_pointer + + implicit none + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer, intent(inout) :: buffer + integer, intent(in) :: shape(3) + ! local parameters + type(c_ptr) :: c_ptr_buffer + + call allocate_gpu_buffer(c_ptr_buffer, shape(1) * shape(2) * shape(3)) + call c_f_pointer(c_ptr_buffer, buffer, shape) + + end subroutine allocate_gpu_buffer_3d + #else ! no HDF5 compilation support ! user output diff --git a/src/specfem3D/rules.mk b/src/specfem3D/rules.mk index aa82fa415..ea091d866 100644 --- a/src/specfem3D/rules.mk +++ b/src/specfem3D/rules.mk @@ -65,6 +65,7 @@ specfem3D_OBJECTS = \ $O/compute_forces_acoustic.spec.o \ $O/compute_forces_viscoelastic_calling_routine.spec.o \ $O/compute_forces_viscoelastic.spec.o \ + $O/compute_element.spec.o \ $O/compute_element_att_memory.spec.o \ $O/compute_element_strain.spec.o \ $O/compute_forces_poro_fluid_part.spec.o \ @@ -191,6 +192,7 @@ specfem3D_MODULES = \ $(FC_MODDIR)/io_server_hdf5.$(FC_MODEXT) \ $(FC_MODDIR)/image_pnm_par.$(FC_MODEXT) \ $(FC_MODDIR)/manager_adios.$(FC_MODEXT) \ + $(FC_MODDIR)/mod_element.$(FC_MODEXT) \ $(FC_MODDIR)/pml_par.$(FC_MODEXT) \ $(FC_MODDIR)/specfem_par.$(FC_MODEXT) \ $(FC_MODDIR)/specfem_par_acoustic.$(FC_MODEXT) \ @@ -363,7 +365,7 @@ $O/write_output_ASDF.spec.o: $O/asdf_data.spec_module.o ## wavefield discontinuity $O/compute_forces_viscoelastic_calling_routine.spec.o: $O/wavefield_discontinuity_solver.spec.o -$O/compute_forces_viscoelastic.spec.o: $O/wavefield_discontinuity_solver.spec.o +$O/compute_forces_viscoelastic.spec.o: $O/wavefield_discontinuity_solver.spec.o $O/compute_element.spec.o $O/iterate_time.spec.o: $O/wavefield_discontinuity_solver.spec.o ## kdtree diff --git a/src/specfem3D/setup_GLL_points.f90 b/src/specfem3D/setup_GLL_points.f90 index 30dc59dc8..7d40750bb 100644 --- a/src/specfem3D/setup_GLL_points.f90 +++ b/src/specfem3D/setup_GLL_points.f90 @@ -61,7 +61,7 @@ subroutine setup_GLL_points() call define_derivation_matrices(xigll,yigll,zigll,wxgll,wygll,wzgll, & hprime_xx,hprime_yy,hprime_zz, & hprimewgll_xx,hprimewgll_yy,hprimewgll_zz, & - wgllwgll_xy,wgllwgll_xz,wgllwgll_yz) + wgllwgll_xy,wgllwgll_xz,wgllwgll_yz,wgll_cube) ! define transpose of derivation matrix do j = 1,NGLLY diff --git a/src/specfem3D/setup_sources_receivers.f90 b/src/specfem3D/setup_sources_receivers.f90 index 7c02d3f34..bf54c345b 100644 --- a/src/specfem3D/setup_sources_receivers.f90 +++ b/src/specfem3D/setup_sources_receivers.f90 @@ -2312,24 +2312,23 @@ subroutine setup_coupling_boundary_points() ! set flag to save wavefield on coupling points do_save_coupling_wavefield = .true. - ! allocate stress arrays to store element stresses and compute boundary tractions - if (.not. allocated(stress_xx)) then - ! might be done already in detect_mesh_surfaces() routine for MOVIE_VOLUME_STRESS case - ! we will use the same arrays here - allocate(stress_xx(NGLLX,NGLLY,NGLLZ,NSPEC_AB), & - stress_yy(NGLLX,NGLLY,NGLLZ,NSPEC_AB), & - stress_zz(NGLLX,NGLLY,NGLLZ,NSPEC_AB), & - stress_xy(NGLLX,NGLLY,NGLLZ,NSPEC_AB), & - stress_xz(NGLLX,NGLLY,NGLLZ,NSPEC_AB), & - stress_yz(NGLLX,NGLLY,NGLLZ,NSPEC_AB),stat=ier) - if (ier /= 0) stop 'error allocating array stress' - stress_xx(:,:,:,:) = 0._CUSTOM_REAL - stress_yy(:,:,:,:) = 0._CUSTOM_REAL - stress_zz(:,:,:,:) = 0._CUSTOM_REAL - stress_xy(:,:,:,:) = 0._CUSTOM_REAL - stress_xz(:,:,:,:) = 0._CUSTOM_REAL - stress_yz(:,:,:,:) = 0._CUSTOM_REAL - endif + ! allocate stress arrays to store element stresses and compute boundary tractions; + ! might be done already in detect_mesh_surfaces() routine for MOVIE_VOLUME_STRESS case + ! we will use the same arrays here + if (allocated(stress_xx)) deallocate(stress_xx,stress_yy,stress_zz,stress_xy,stress_xz,stress_yz) + allocate(stress_xx(NGLLX,NGLLY,NGLLZ,NSPEC_AB), & + stress_yy(NGLLX,NGLLY,NGLLZ,NSPEC_AB), & + stress_zz(NGLLX,NGLLY,NGLLZ,NSPEC_AB), & + stress_xy(NGLLX,NGLLY,NGLLZ,NSPEC_AB), & + stress_xz(NGLLX,NGLLY,NGLLZ,NSPEC_AB), & + stress_yz(NGLLX,NGLLY,NGLLZ,NSPEC_AB),stat=ier) + if (ier /= 0) stop 'error allocating array stress' + stress_xx(:,:,:,:) = 0._CUSTOM_REAL + stress_yy(:,:,:,:) = 0._CUSTOM_REAL + stress_zz(:,:,:,:) = 0._CUSTOM_REAL + stress_xy(:,:,:,:) = 0._CUSTOM_REAL + stress_xz(:,:,:,:) = 0._CUSTOM_REAL + stress_yz(:,:,:,:) = 0._CUSTOM_REAL ! main process writes out wavefield solutions for all coupling boundary points if (myrank == 0) then diff --git a/src/specfem3D/specfem3D.F90 b/src/specfem3D/specfem3D.F90 index 4cef773e9..242d57af1 100644 --- a/src/specfem3D/specfem3D.F90 +++ b/src/specfem3D/specfem3D.F90 @@ -366,6 +366,9 @@ program xspecfem3D implicit none + ! initializes CUDA-aware MPI + call initialize_cuda_aware_mpi() + ! MPI initialization call init_mpi() diff --git a/src/specfem3D/specfem3D_par.F90 b/src/specfem3D/specfem3D_par.F90 index 269cedffa..14e1e468d 100644 --- a/src/specfem3D/specfem3D_par.F90 +++ b/src/specfem3D/specfem3D_par.F90 @@ -230,6 +230,7 @@ module specfem_par real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY) :: wgllwgll_xy real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLZ) :: wgllwgll_xz real(kind=CUSTOM_REAL), dimension(NGLLY,NGLLZ) :: wgllwgll_yz + real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ) :: wgll_cube ! arrays for Deville and force_vectorization real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ) :: wgllwgll_xy_3D,wgllwgll_xz_3D,wgllwgll_yz_3D @@ -258,18 +259,22 @@ module specfem_par integer, dimension(:), allocatable :: my_neighbors_ext_mesh integer, dimension(:), allocatable :: nibool_interfaces_ext_mesh integer, dimension(:,:), allocatable :: ibool_interfaces_ext_mesh - real(kind=CUSTOM_REAL), dimension(:,:,:), allocatable :: buffer_send_vector_ext_mesh - real(kind=CUSTOM_REAL), dimension(:,:,:), allocatable :: buffer_recv_vector_ext_mesh - real(kind=CUSTOM_REAL), dimension(:,:), allocatable :: buffer_send_scalar_ext_mesh - real(kind=CUSTOM_REAL), dimension(:,:), allocatable :: buffer_recv_scalar_ext_mesh + + ! note: MPI buffers are declared as pointers instead of allocatable arrays. + ! this will allow for CUDA-aware MPI handling, where buffers have to be allocated on the GPU device. + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer :: buffer_send_vector_ext_mesh + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer :: buffer_recv_vector_ext_mesh + real(kind=CUSTOM_REAL), dimension(:,:), pointer :: buffer_send_scalar_ext_mesh + real(kind=CUSTOM_REAL), dimension(:,:), pointer :: buffer_recv_scalar_ext_mesh + integer, dimension(:), allocatable :: request_send_scalar_ext_mesh integer, dimension(:), allocatable :: request_recv_scalar_ext_mesh integer, dimension(:), allocatable :: request_send_vector_ext_mesh integer, dimension(:), allocatable :: request_recv_vector_ext_mesh - real(kind=CUSTOM_REAL), dimension(:,:,:), allocatable :: buffer_send_vector_ext_mesh_s - real(kind=CUSTOM_REAL), dimension(:,:,:), allocatable :: buffer_recv_vector_ext_mesh_s - real(kind=CUSTOM_REAL), dimension(:,:,:), allocatable :: buffer_send_vector_ext_mesh_w - real(kind=CUSTOM_REAL), dimension(:,:,:), allocatable :: buffer_recv_vector_ext_mesh_w + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer :: buffer_send_vector_ext_mesh_s + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer :: buffer_recv_vector_ext_mesh_s + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer :: buffer_send_vector_ext_mesh_w + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer :: buffer_recv_vector_ext_mesh_w integer, dimension(:), allocatable :: request_send_vector_ext_mesh_s integer, dimension(:), allocatable :: request_recv_vector_ext_mesh_s integer, dimension(:), allocatable :: request_send_vector_ext_mesh_w @@ -315,7 +320,6 @@ module specfem_par ! gravity real(kind=CUSTOM_REAL), dimension(:),allocatable :: minus_deriv_gravity,minus_g - real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ) :: wgll_cube ! for surface or volume integral on whole domain double precision, dimension(:), allocatable :: integral_vol, integral_boun @@ -362,6 +366,9 @@ module specfem_par ! for dynamic rupture computations on GPU integer(kind=8) :: Fault_pointer + ! flags for CUDA-aware MPI handling + logical :: USE_CUDA_AWARE_MPI = .false. + !----------------------------------------------------------------- ! ASDF !----------------------------------------------------------------- @@ -483,8 +490,8 @@ module specfem_par_elastic integer :: b_reclen_field ! for assembling backward field - real(kind=CUSTOM_REAL), dimension(:,:,:), allocatable :: b_buffer_send_vector_ext_mesh - real(kind=CUSTOM_REAL), dimension(:,:,:), allocatable :: b_buffer_recv_vector_ext_mesh + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer :: b_buffer_send_vector_ext_mesh + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer :: b_buffer_recv_vector_ext_mesh integer, dimension(:), allocatable :: b_request_send_vector_ext_mesh integer, dimension(:), allocatable :: b_request_recv_vector_ext_mesh @@ -561,8 +568,8 @@ module specfem_par_acoustic integer :: b_reclen_potential ! for assembling backward field - real(kind=CUSTOM_REAL), dimension(:,:), allocatable :: b_buffer_send_scalar_ext_mesh - real(kind=CUSTOM_REAL), dimension(:,:), allocatable :: b_buffer_recv_scalar_ext_mesh + real(kind=CUSTOM_REAL), dimension(:,:), pointer :: b_buffer_send_scalar_ext_mesh + real(kind=CUSTOM_REAL), dimension(:,:), pointer :: b_buffer_recv_scalar_ext_mesh integer, dimension(:), allocatable :: b_request_send_scalar_ext_mesh integer, dimension(:), allocatable :: b_request_recv_scalar_ext_mesh @@ -639,10 +646,10 @@ module specfem_par_poroelastic integer :: b_reclen_field_poro ! for assembling backward field - real(kind=CUSTOM_REAL), dimension(:,:,:), allocatable :: b_buffer_send_vector_ext_meshs - real(kind=CUSTOM_REAL), dimension(:,:,:), allocatable :: b_buffer_send_vector_ext_meshw - real(kind=CUSTOM_REAL), dimension(:,:,:), allocatable :: b_buffer_recv_vector_ext_meshs - real(kind=CUSTOM_REAL), dimension(:,:,:), allocatable :: b_buffer_recv_vector_ext_meshw + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer :: b_buffer_send_vector_ext_meshs + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer :: b_buffer_send_vector_ext_meshw + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer :: b_buffer_recv_vector_ext_meshs + real(kind=CUSTOM_REAL), dimension(:,:,:), pointer :: b_buffer_recv_vector_ext_meshw integer, dimension(:), allocatable :: b_request_send_vector_ext_meshs integer, dimension(:), allocatable :: b_request_send_vector_ext_meshw integer, dimension(:), allocatable :: b_request_recv_vector_ext_meshs diff --git a/src/tomography/postprocess_sensitivity_kernels/rules.mk b/src/tomography/postprocess_sensitivity_kernels/rules.mk index 9519e999c..3af59b15b 100644 --- a/src/tomography/postprocess_sensitivity_kernels/rules.mk +++ b/src/tomography/postprocess_sensitivity_kernels/rules.mk @@ -191,6 +191,7 @@ xsmooth_sem_pde_SHARED_OBJECTS = \ $O/compute_add_sources_viscoelastic.spec.o \ $O/compute_adj_source_frechet.spec.o \ $O/compute_arrays_source.spec.o \ + $O/compute_element.spec.o \ $O/compute_element_strain.spec.o \ $O/compute_gradient_in_acoustic.spec.o \ $O/compute_interpolated_dva.spec.o \ diff --git a/src/tomography/postprocess_sensitivity_kernels/smooth_sem.F90 b/src/tomography/postprocess_sensitivity_kernels/smooth_sem.F90 index 7d482547f..c262fc7af 100644 --- a/src/tomography/postprocess_sensitivity_kernels/smooth_sem.F90 +++ b/src/tomography/postprocess_sensitivity_kernels/smooth_sem.F90 @@ -108,7 +108,7 @@ program smooth_sem integer :: ijk #endif integer :: icounter,num_slices - integer :: iproc,ncuda_devices + integer :: iproc,ngpu_devices ! GPU integer(kind=8) :: Container @@ -350,7 +350,7 @@ program smooth_sem if (sigma_v < 1.e-9) stop 'Error sigma_v zero, must non-zero' ! GPU - if (USE_GPU) call initialize_gpu_device(myrank,ncuda_devices) + if (USE_GPU) call initialize_gpu_device(myrank,ngpu_devices,0) ! synchronizes call synchronize_all() diff --git a/src/tomography/postprocess_sensitivity_kernels/smooth_sem_pde.F90 b/src/tomography/postprocess_sensitivity_kernels/smooth_sem_pde.F90 index 62ec64c13..4b4683df0 100644 --- a/src/tomography/postprocess_sensitivity_kernels/smooth_sem_pde.F90 +++ b/src/tomography/postprocess_sensitivity_kernels/smooth_sem_pde.F90 @@ -253,7 +253,8 @@ program smooth_sem_pde call define_derivation_matrices(xigll,yigll,zigll,wxgll,wygll,wzgll, & hprime_xx,hprime_yy,hprime_zz, & hprimewgll_xx,hprimewgll_yy,hprimewgll_zz, & - wgllwgll_xy,wgllwgll_xz,wgllwgll_yz) + wgllwgll_xy,wgllwgll_xz,wgllwgll_yz,wgll_cube) + ! define transpose of derivation matrix do j = 1,NGLLY do i = 1,NGLLX diff --git a/src/tomography/rules.mk b/src/tomography/rules.mk index a31abe166..6c6067f2a 100644 --- a/src/tomography/rules.mk +++ b/src/tomography/rules.mk @@ -149,6 +149,13 @@ xadd_model_OBJECTS += $(adios_specfem3D_STUBS) endif +### +### GPU +### + +# cuda stubs +xadd_model_SHARED_OBJECTS += $(gpu_specfem3D_STUBS) + # extra dependencies $O/add_model_iso.tomo.o: $O/specfem3D_par.spec_module.o $O/tomography_par.tomo_module.o @@ -184,6 +191,7 @@ xmodel_update_SHARED_OBJECTS = \ $O/compute_add_sources_viscoelastic.spec.o \ $O/compute_adj_source_frechet.spec.o \ $O/compute_arrays_source.spec.o \ + $O/compute_element.spec.o \ $O/compute_element_strain.spec.o \ $O/compute_gradient_in_acoustic.spec.o \ $O/compute_interpolated_dva.spec.o \ @@ -225,9 +233,6 @@ xmodel_update_SHARED_OBJECTS += \ $O/write_VTK_data.shared.o \ $(EMPTY_MACRO) -# cuda stubs -xmodel_update_OBJECTS += $(gpu_specfem3D_STUBS) - ### ### ADIOS ### @@ -257,6 +262,13 @@ xmodel_update_OBJECTS += $(asdf_specfem3D_STUBS) xmodel_update_SHARED_OBJECTS += $(asdf_specfem3D_SHARED_STUBS) endif +### +### GPU +### + +# cuda stubs +xmodel_update_OBJECTS += $(gpu_specfem3D_STUBS) + # extra dependencies $O/model_update.tomo.o: $O/specfem3D_par.spec_module.o $O/tomography_par.tomo_module.o $O/save_external_bin_m_up.tomo.o: $O/specfem3D_par.spec_module.o diff --git a/utils/GPU_tools/check_cuda_device.cu b/utils/GPU_tools/check_cuda_device.cu index 999145cd7..71e16d8a1 100644 --- a/utils/GPU_tools/check_cuda_device.cu +++ b/utils/GPU_tools/check_cuda_device.cu @@ -393,11 +393,33 @@ e.g., on titan enable environment CRAY_CUDA_MPS=1 to use a single GPU with multi }else{ printf(" deviceOverlap: FALSE\n"); } + printf(" Compute Mode: %d\n", deviceProp.computeMode); #else // CUDA version >= 13, deviceOverlap deprecated, replaced by asyncEngineCount printf(" asyncEngineCount: %d\n", deviceProp.asyncEngineCount); + // computeMode deprecated, use cudaDeviceGetAttribute(cudaDevAttrComputeMode) + int computeMode = -1; + // Query the compute mode attribute + cudaDeviceGetAttribute(&computeMode, cudaDevAttrComputeMode, device); + // Interpret the result based on cudaComputeMode enum + switch (computeMode) { + case cudaComputeModeDefault: + printf(" Compute Mode: %d - Default (multiple threads can use cudaSetDevice)\n",computeMode); + break; + case cudaComputeModeExclusive: + printf(" Compute Mode: %d - Exclusive (only one thread can use cudaSetDevice)\n",computeMode); + break; + case cudaComputeModeProhibited: + printf(" Compute Mode: %d - Prohibited (no threads can use cudaSetDevice)\n",computeMode); + break; + case cudaComputeModeExclusiveProcess: + printf(" Compute Mode: %d - Exclusive Process (many threads in one process, or only one process)\n",computeMode); + break; + default: + printf(" Compute Mode: %d - Unknown\n",computeMode); + break; + } #endif - printf(" Compute Mode: %d\n", deviceProp.computeMode); fflush(stdout);