Skip to content

🐛 [BUG] - <title>Misallocation of stations to slices #1745

@eyalshimony

Description

@eyalshimony

Description

Some stations (or sources for adjoint simulations) are misallocated to the wrong core when they are close to the boundary. I printed some station values as an example, for core number 4 on the machine I run on. In theory, it should handle 6000<x<10000 and -10000<y<-6000.
station # 52982 located in slice 4 x: 5999.96 y: -6708.24
station # 53984 located in slice 9 x: 6708.13 y: -6000.09
station # 53985 located in slice 4 x: 6708.79 y: -5999.34
Overall, there are 3 stations that are misallocated here. One station that should be in slice 3 is allocated to slice 4, and another station that should be in slice 9 is allocated to slice 4. There is also one station that should be in slice 4 that is allocated to slice 9.
I encountered the problem when I tried to migrate my code to use SU seismograms (and adjoint sources), and as a result of the bug there is a mismatch between the number of seismograms in the .adj file and the number of receivers allocated in the corresponding slice. This causes the read error in the image.
image

Affected SPECFEM3D version

Latest Development Version

Your software and hardware environment

gcc & gfortran 9.3.1, intel mpi 2021.1, on CentOS 7

Reproduction steps

I believe that the problem can be produced by entering the following entries in STATIONS_ADJOINT:
ST1        DS      -6708.235405744787      5999.964811656147       0       0.0
ST2        DS      -6000.086675107924      6708.126406918124       0       0.0
ST3        DS      -5999.341290654987      6708.793041840081       0       0.0
With a Mesh_Par_file with the following parameters:
LATITUDE_MIN                    = -10000
LATITUDE_MAX                    = 10000
LONGITUDE_MIN                   = -10000
LONGITUDE_MAX                   = 10000
DEPTH_BLOCK_KM                  = 20.d0
UTM_PROJECTION_ZONE             = 36
SUPPRESS_UTM_PROJECTION         = .true.
NEX_XI                          = 80
NEX_ETA                         = 80
NPROC_XI                        = 5
NPROC_ETA                       = 5
And the number of processors, by extension being 25.

Screenshots

No response

Logs

At line 344 of file src/specfem3D/compute_arrays_source.f90 (unit = 47, file = 'run0002/./OUTPUT_FILES/../SEM/0_dx_SU.adj')
Fortran runtime error: End of file
Error termination. Backtrace:
At line 344 of file src/specfem3D/compute_arrays_source.f90 (unit = 47, file = 'run0002/./OUTPUT_FILES/../SEM/4_dx_SU.adj')
Fortran runtime error: End of file
Error termination. Backtrace:
#0  0x2ac9c2c4edfd in ???
#1  0x2ac9c2c4f995 in ???
#2  0x2ac9c2c5017d in ???
#3  0x2ac9c2e53bb2 in ???
#4  0x2ac9c2e57d0f in ???
#5  0x2ac9c2e53721 in ???
#0  0x2b3c438dadfd in ???
#1  0x2b3c438db995 in ???
#2  0x2b3c438dc17d in ???
#3  0x2b3c43adfbb2 in ???
#4  0x2b3c43ae3d0f in ???
#5  0x2b3c43adf721 in ???
#6  0x417629 in compute_arrays_adjoint_source_su_
	at src/specfem3D/compute_arrays_source.f90:344
#6  0x417629 in compute_arrays_adjoint_source_su_
	at src/specfem3D/compute_arrays_source.f90:344
#7  0x40d46b in compute_add_sources_viscoelastic_
	at src/specfem3D/compute_add_sources_viscoelastic.F90:225
#7  0x40d46b in compute_add_sources_viscoelastic_
	at src/specfem3D/compute_add_sources_viscoelastic.F90:225
#8  0x428f14 in compute_forces_viscoelastic_calling_
	at src/specfem3D/compute_forces_viscoelastic_calling_routine.F90:275
#8  0x428f14 in compute_forces_viscoelastic_calling_
	at src/specfem3D/compute_forces_viscoelastic_calling_routine.F90:275
#9  0x4c6716 in iterate_time_undoatt_
	at src/specfem3D/iterate_time_undoatt.F90:557
#10  0x403909 in xspecfem3d
	at src/specfem3D/specfem3D.F90:412
#11  0x403909 in main
	at src/specfem3D/specfem3D.F90:365
#9  0x4c6716 in iterate_time_undoatt_
	at src/specfem3D/iterate_time_undoatt.F90:557
#10  0x403909 in xspecfem3d
	at src/specfem3D/specfem3D.F90:412
#11  0x403909 in main
	at src/specfem3D/specfem3D.F90:365
At line 344 of file src/specfem3D/compute_arrays_source.f90 (unit = 47, file = 'run0002/./OUTPUT_FILES/../SEM/20_dx_SU.adj')
Fortran runtime error: End of file

OS

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions