adjtomo / seisflows

An automated workflow tool for full waveform inversion and adjoint tomography
http://seisflows.readthedocs.org
BSD 2-Clause "Simplified" License
172 stars 122 forks source link

Issue with running example 1 #211

Closed trinitite271 closed 1 month ago

trinitite271 commented 2 months ago

I install seisflows with this.

Installing the devel branch gives errors, the master branch is fine. So the devel branch may have some bugs

I met this priblem below:

(seisflows) [zhangchang@gpu01 example1]$ seisflows examples run 1

                                @@@@@@@@@@
                           .@@@@.    .%&(  %@.
                        @@@@   @@@@   &@@@@@@ ,%@
                     @@@@   @@@,  /@@              @
                    @@@   @@@@   @@@              @
                  @@@@   @@@@   @@@                @  @
                  @@@   @@@@   ,@@@                @ @
                 @@@@   @@@@    @@@@              @@ @ @
                 @@@@   @@@@@    @@@@@          @@@ @@ @
                 @@@@    @@@@@     @@@@@@@@@@@@@@  @@  @
                  @@@@    @@@@@@        @@@&     @@@  @
                  @@@@@     @@@@@@@@         %@@@@#  @@
                    @@@@#      @@@@@@@@@@@@@@@@@   @@
                     &@@@@@          @@@@(       @@&
                        @@@@@@@             /@@@@
                            @@@@@@@@@@@@@@@@@
                                @@@@@@@@@@

================================================================================ SEISFLOWS EXAMPLE 1 /////////////////// This is a [SPECFEM2D] [WORKSTATION] example, which will run an inversion to assess misfit between two homogeneous halfspace models with slightly different velocities. [1 events, 1 station, 1 iterations]. The tasks involved include:

  1. (optional) Download, configure, compile SPECFEM2D
  2. [Setup] a SPECFEM2D working directory
  3. [Setup] starting model from 'Tape2007' example
  4. [Setup] target model w/ perturbed starting model
  5. [Setup] a SeisFlows working directory
  6. [Run] the inversion workflow

================================================================================ EXAMPLE SETUP

Configuring SPECFEM2D with command: ./configure configure: WARNING: required lex library not found; giving up on flex fatal: No names found, cannot describe anything. Making SPECFEM2D binaries with command: make all

================================================================================ GENERATING INITIAL MODEL

Setting the SPECFEM2D Par_file for SeisFlows compatiblility NPROC: 1 -> 1 setup_with_binary_database: 0 -> 1 SAVE_MODEL: default -> binary save_ASCII_kernels: .true. -> .false. Running SPECFEM2D with command: ./bin/xmeshfem2D > OUTPUT_FILES/mesher.log.txt Running SPECFEM2D with command: ./bin/xspecfem2D > OUTPUT_FILES/solver.log.txt Cleaning up after xspecfem2d, setting up for new run

================================================================================ GENERATING TRUE/TARGET MODEL

Updating initial homogeneous velocity model values VELOCITY_MODEL:

1 1 2600.d0 5800.d0 3500.0d0 0 0 10.d0 10.d0 0 0 0 0 0 0 -> 1 1 2600.d0 5900.d0 3550.0d0 0 0 10.d0 10.d0 0 0 0 0 0 0 Running SPECFEM2D with command: ./bin/xmeshfem2D > OUTPUT_FILES/mesher.log.txt Running SPECFEM2D with command: ./bin/xspecfem2D > OUTPUT_FILES/solver.log.txt

Cleaning up after xspecfem2d, setting up for new run created parameter file: parameters.yaml workflow: forward -> inversion configuring SeisFlows parameter file ntask: 1 -> 1 materials: acoustic -> elastic update_density: False -> False generate_data: False -> True syn_data_format: ascii -> ascii obs_data_format: ASCII -> ascii unit_output: VEL -> disp nproc: 1 -> 1 start: 1 -> 1 end: 1 -> 1 step_count_max: 10 -> 5 components: null -> Y attenuation: False -> False plot_waveforms: False -> True misfit: waveform -> traveltime adjoint: waveform -> traveltime path_specfem_bin: null -> /home/zhangchang/example1/specfem2d_workdir/bin path_specfem_data: null -> /home/zhangchang/example1/specfem2d_workdir/DATA path_model_init: null -> /home/zhangchang/example1/specfem2d_workdir/OUTPUT_FILES_INIT path_model_true: null -> /home/zhangchang/example1/specfem2d_workdir/OUTPUT_FILES_TRUE Finalizing SPECFEM2D Par_file for SeisFlows example MODEL: default -> gll use_existing_STATIONS: .false. -> .true. NPROC: 1 -> 1 Using 1 stations in this SeisFlows example

================================================================================ COMPLETE EXAMPLE SETUP

================================================================================ RUNNING SEISFLOWS EXAMPLE WORKFLOW

2024-04-29 07:01:56 [INFO] | running setup for all modules 2024-04-29 07:01:56 [DEBU] | workflow.Inversion 2024-04-29 07:02:07 [DEBU] | system.Workstation 2024-04-29 07:02:09 [DEBU] | solver.Specfem2D 2024-04-29 07:02:11 [INFO] | initializing 1 solver directories 2024-04-29 07:02:12 [DEBU] | source 0: 001 2024-04-29 07:02:17 [DEBU] | linking source '001' as 'mainsolver' 2024-04-29 07:02:18 [DEBU] | preprocess.Default 2024-04-29 07:02:19 [DEBU] | optimize.Gradient 2024-04-29 07:02:21 [INFO] | no optimization checkpoint file, assume 1st iteration 2024-04-29 07:02:25 [INFO] |

                          RUNNING ITERATION 01

================================================================================ 2024-04-29 07:02:25 [INFO] | //////////////////////////////////////////////////////////////////////////////// GENERATE SYNTHETIC DATA //////////////////////////////////////////////////////////////////////////////// 2024-04-29 07:02:25 [INFO] | checking true/target model parameters: 2024-04-29 07:02:25 [INFO] | vp: min=5900.000; mean=5900.000; max=5900.000 2024-04-29 07:02:25 [INFO] | vs: min=3550.000; mean=3550.000; max=3550.000 2024-04-29 07:02:25 [INFO] | evaluating objective function for source 001 2024-04-29 07:02:25 [DEBU] | running forward simulation with 'Specfem2D' 2024-04-29 07:02:25 [DEBU] | running executable with cmd: 'bin/xmeshfem2D' 2024-04-29 07:02:25 [DEBU] | running executable with cmd: 'bin/xspecfem2D' 2024-04-29 07:02:34 [DEBU] | checkpointing workflow to seisflows state file Traceback (most recent call last): File "/home/zhangchang/miniconda3/envs/seisflows/bin/seisflows", line 8, in sys.exit(main()) ^^^^^^ File "/home/zhangchang/seisflows/seisflows/seisflows.py", line 1431, in main sf() File "/home/zhangchang/seisflows/seisflows/seisflows.py", line 451, in call getattr(self, self._args.command)(vars(self._args)) File "/home/zhangchang/seisflows/seisflows/seisflows.py", line 804, in submit system.submit(workdir=self._args.workdir, File "/home/zhangchang/seisflows/seisflows/system/workstation.py", line 211, in submit workflow.run() File "/home/zhangchang/seisflows/seisflows/workflow/inversion.py", line 197, in run super().run() # Runs task list ^^^^^^^^^^^^^ File "/home/zhangchang/seisflows/seisflows/workflow/forward.py", line 283, in run func() File "/home/zhangchang/seisflows/seisflows/workflow/inversion.py", line 239, in generate_synthetic_data super().generate_synthetic_data(kwargs) File "/home/zhangchang/seisflows/seisflows/workflow/forward.py", line 315, in generate_synthetic_data self.system.run([self._generate_synthetic_data_single], kwargs) File "/home/zhangchang/seisflows/seisflows/system/workstation.py", line 250, in run func(kwargs) File "/home/zhangchang/seisflows/seisflows/workflow/forward.py", line 346, in _generate_synthetic_data_single self.run_forward_simulations( File "/home/zhangchang/seisflows/seisflows/workflow/inversion.py", line 419, in run_forward_simulations super().run_forward_simulations(path_model, save_traces=save_traces, File "/home/zhangchang/seisflows/seisflows/workflow/forward.py", line 582, in run_forward_simulations self.solver.forward_simulation(save_traces=save_traces, File "/home/zhangchang/seisflows/seisflows/solver/specfem.py", line 634, in forward_simulation if self.prune_scratch: ^^^^^^^^^^^^^^^^^^ AttributeError: 'Specfem2D' object has no attribute 'prune_scratch'

================================================================================ EXAMPLE FAILED

Command 'seisflows submit' returned non-zero exit status 1.

bch0w commented 1 month ago

Hi @trinitite271, sorry there was a small bug in the devel branch that I just fixed in #212, can you try again and see if that works?