[CIG-SEISMO] Specfem2D wave field dump bug

Dimitri Komatitsch komatitsch at lma.cnrs-mrs.fr
Thu Apr 20 03:39:51 PDT 2017


Hi Michael,

Thank you very much for your bug report. I have fixed the official 
version of the code, and I also suppressed 
NSTEP_BETWEEN_OUTPUT_WAVE_DUMPS, which as you say was unused apparently, 
I replaced it with NSTEP_BETWEEN_OUTPUT_IMAGES.

(I did it in the "devel" branch only, as we always do)

Regarding recombining the information into a single dump for all MPI 
partitions, yes, the information should exist (likely in 
src/specfem2D/assemble_MPI.F90 , look for subroutine 
assemble_MPI_scalar() for instance, in which we use the MPI partition 
edge information to assemble the mass matrix (or any other scalar). Let 
me cc Etienne Bachmann because he has been modifying the 2D code 
recently to simplify it and thus he may have other/better suggestions on 
how to do that.

The best thing would probably be to completely get rid of 
utils/recombine_all_slices_from_binary_dump.f90 and recombine all the 
slices inside the code instead, we do that for instance in 
src/specfem2D/plot_post.F90 to create the PostScript snapshots. There is 
also this comment in src/specfem2D/write_movie_output.f90 :

   ! dump the full (local) wavefield to a file
   ! note: in the case of MPI, in the future it would be more convenient 
to output a single file
   !       rather than one for each myrank
   if (output_wavefield_dumps) then


If you do it please let us know and we will be glad to commit the change 
to the official source code (or just submit a Git pull request, see e.g. 
https://github.com/geodynamics/specfem3d/wiki/Using-Git-for-SPECFEM )

Thanks again!
Best wishes,

Dimitri.


On 04/12/2017 09:51 PM, Michael Gineste wrote:
> Hi Specfem2D team,
>
> First I would like to thank you for making and maintaining such an
> excellent piece of software.
>
> I encountered a bug when wanting to dump the entire wave field at some
> rate but with no need of the postscript plot output (switching this off
> as postscript export is rather slow). Running the code with
> output_postscript_snapshot = .false. and output_wavefield_dumps = .true.
> would result in a segmentation fault. The reason being that the variable
> this_is_the_first_we_dump was not initialised correctly leading to other
> variables not being allocated.
> I have attached my simpel workaround as a diff file, which might not be
> the optimal solution but it worked for my purpose. As a sidenote, the
> wavefield dump input NSTEP_BETWEEN_OUTPUT_WAVE_DUMPS is not used
> directly, so one must set NSTEP_BETWEEN_OUTPUT_IMAGES to the value one
> wants.
>
> In continuation of this I have question that I hoped you could help me
> with.
> I have used the function utils/recombine_all_slices_from_binary_dump.f90
> as offset for making a slightly more flexible recombining routine. But I
> have found that the search for duplicates is a really slow process when
> the mesh is large (as is said in the printout message) and this becomes
> quite the bottleneck for my use.
>
> So I was wandering if this information of which coordinates interfacing
> partitions shares, were not already calculated in the preparation of a
> simulation? So that I could export this information at same time of
> dumping grid and load this later, saving me the (brute force) search for
> duplicates.
>
> I have spent some time looking through the Specfem2D code, but I have
> not managed to conclude whether this information on coordinate
> duplicates between partitions is available or not. Could you help me
> with confirming/refute that this information is being generated
> somewhere in the code, and if this information really is there, point me
> towards the area/variable names that I should look at?
>
> My code version is (git) commit
> dd9cc6b798da8b4ff7137eb8d96fd2a6bc4685eb, I cloned the stable repo
> fairly recently.
>
> Thank you.
>
> Best regards,
>
> Michael Gineste
>
> PhD Candidate
> Department of Mathematical Sciences
> Norwegian University of Science and Technology (NTNU)
>
>
>
>
> _______________________________________________
> CIG-SEISMO mailing list
> CIG-SEISMO at geodynamics.org
> http://lists.geodynamics.org/cgi-bin/mailman/listinfo/cig-seismo
>

-- 
Dimitri Komatitsch, CNRS Research Director (DR CNRS)
Laboratory of Mechanics and Acoustics, Marseille, France
http://komatitsch.free.fr


More information about the CIG-SEISMO mailing list