Snapshot when using MPI

223 views
Skip to first unread message

Guangnian Ji

unread,
Jan 7, 2026, 7:51:01 AMJan 7
to basilisk-fr
Dear all,

I am experiencing a strange issue with dump() while running a 2D atomisation simulation using MPI.

I used the code in atomisation.c to save the snapshot (dump file):

event snapshot (t = 0.1; t += 0.1; t <= 3.8) {
  char name[80];
  sprintf (name, "snapshot-%g", t);
  scalar pid[];
  foreach()
    pid[] = fmod(pid()*(npe() + 37), npe());
  dump (name);
}

When I run my simulation using 1 core, the snapshot files are created correctly and I can visualize them using bview2D. However, when I run the same code using MPI appear to contain only zeros when opened in bview2D.

Has anyone encountered this discrepancy between serial and MPI dump outputs? Could this be related to how Rank 0 gathers data from other ranks before writing the header?

Any suggestions or insights would be greatly appreciated.

Best regards,
Guangnian

alienor...@gmail.com

unread,
Jan 7, 2026, 1:31:37 PMJan 7
to basilisk-fr
Dear Guangnian,

Can you restart your simulation using the dump files generated with MPI?

If so, I am experiencing the same problem but unfortunately could not find a solution either:
I can visualize the simulation on the fly when compiled in parallel. I can also save dumps and restart from them. Yet, when using dump2D to open a previously generated dump, it's seems like the dump is empty or contains only zeros (which is obviously not true since I can restart simulations from it).
The statistics show the correct fields' names but with all the values equal to 0.

I experience the same problem with dump3D.

I tried reinstalling everything with no success. If anyone has a clue I'll be happy to hear about it as well.

Happy New Year to all of you!

Best,

Aliénor

Vatsal Sanjay

unread,
Jan 12, 2026, 9:05:52 PMJan 12
to basilisk-fr
can you try this patch: https://github.com/comphy-lab/basilisk-C/blob/main/patches/2026-01-13-mpi-tree-dump-header-fix.patch - it works fine on Snellius (the Dutch supercomputer). 

As far as I can tell, this happened after: https://basilisk.fr/src/?changes=20251014143750 

header.n is uninitialized if MULTIGRID_MPI is not defined. This only affects if you would dump files in MPI and try to read in serial (for example in bview). dump (MPI) -> restore (MPI) or dump (serial) -> restore (serial) or dump (serial) -> restore (serial) were all fine. And, of course, this only affects tree. 

Cheers, Vatsal

alienor...@gmail.com

unread,
Jan 16, 2026, 8:45:21 AMJan 16
to basilisk-fr
Dear Vatsal, dear all,

Thanks for your help!
Unfortunately, I applied the patch and it did not fixed the problem for me.

However, after investigation, I agree with your conclusions: all of this dump (MPI) -> restore (MPI) or dump (serial) -> restore (serial) or dump (serial) -> restore (serial) work fine. The problems comes when trying to visualize a dump created with MPI.

For the moment I use some dirty tricks (compiling bview.c with mpi) which allow me to visualize anyway.

Best,

Aliénor

Andrés Castillo-Castellanos

unread,
Jan 26, 2026, 12:35:04 PM (9 days ago) Jan 26
to basilisk-fr
Hi Alienor and Vatsal, 

I've been having issues with corrupted dumps in a certain cluster and I use this python script to examine the header. Plots work on multigrid, but problably won't on trees. You can do something like 

python3 basilisk_dump_inspector.py sample_dump

and get : 

======================================================================
BASILISK DUMP FILE INSPECTION REPORT
======================================================================

File: data/sample_dump_file_number1
File Size: 13281911 bytes

DumpHeader:
  Simulation time (t): 2000.0995433614
  Number of scalars (len): 9
  Iteration (i): 20390
  Grid depth: 7
  Number of processes (npe): 8
  Version: 170901
  Dimensions (n): x=8.0, y=1.0, z=0.0

Scalar Fields:
  0. size
  1. u.x
  2. u.y
  3. g.x
  4. g.y
  5. f
  6. rhov
  7. h.x
  8. h.y

Domain Coordinates:
  Origin: X0=-140.0, Y0=-17.5, Z0=0.0
  Domain size (L0): 280.0

Cell Data:
  Cells read: 1000
  (Truncated for inspection - file contains more cells)

Scalar Field Statistics:
...
======================================================================


Cheers, 
basilisk_dump_inspector.py
plot_scalar.py

Stephane Popinet

unread,
Jan 27, 2026, 12:28:19 PM (8 days ago) Jan 27
to basil...@googlegroups.com
Hi Alienor, Vatsal et al,

The latest release includes this patch:

https://basilisk.fr/src/?changes=20260127162124

Please check whether it fixes your problems.

cheers,

Stephane


alienor...@gmail.com

unread,
Feb 3, 2026, 5:08:44 AM (yesterday) Feb 3
to basilisk-fr
Dear Stéphane, 

This fixed the problem on my side. Everything works fine now. 
Thanks a lot, 

Aliénor
Reply all
Reply to author
Forward
0 new messages