Merging files in d3

18 views
Skip to first unread message

Josh

unread,
Oct 3, 2025, 8:10:19 AM (2 days ago) Oct 3
to Dedalus Users
Hi All, 

The code I am running is parallelised over a number of cpus, and I am able to restart the simulation from the last saved snapshot without an issue. 

However, I want to explore the data in more depth, but the recombined snapshot appears to have 0 time steps of data in it. But I can see that the distributed files have the data I want. Why this occurs like this, I do not know.

Given this, I tried to merge the distributed files after the fact. I've tried all the merge options in dedalus.tools.post, but so far no luck. 

For reference, I have 16 distributed files that I'd like to merge. 

Cheers,
Josh

Jeffrey S. Oishi

unread,
Oct 3, 2025, 8:37:17 AM (2 days ago) Oct 3
to dedalu...@googlegroups.com
Hi Josh,

It's hard to troubleshoot this without more information. What are you doing in detail? Can you send a sample dataset? 

In case this is helpful, by default, d3 uses a virtual file strategy in which the data is stored in distributed files, one per core, but there is a virtual file that looks like it contains all of the data. If you are analyzing the data in another place, you need to move all of the files together. That is

path_to_data/snapshots_s1/snapshots_s1_p0.h5
path_to_data/snapshots_s1/snapshots_s1_p1.h5
...

will appear to be combined in 

path_to_data/snapshots_s1.h5

but if you only move that file, you will not be able to access the data, because it isn't actually combined. 

Jeff

--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dedalus-users/dd06ef15-81f8-49b3-a185-877c667e6bf0n%40googlegroups.com.

Josh

unread,
Oct 3, 2025, 8:59:08 PM (2 days ago) Oct 3
to Dedalus Users
Hi Jeff,

Thanks for helping me out. 

In detail, my simulation produces 16 distributed files (one for each core) under the pathname exactly as you've described. Because I am running these sims on a cluster, I am trying to download the snapshot files and look at various parameters like buoyancy or velocity on my local pc. 

What I have done is downloaded the whole folder, so the virtual file and all the distributed files in a subfolder, and then loaded the virtual file into python. Something like this:

import matplotlib.pyplot as plt
import h5py

filename = "/path/snapshots-3D/snapshot-3D_s1.h5"

with h5py.File(filename, mode='r') as f:
t = f['scales']['sim_time'][:]
u = f['tasks']['u'][:]
print(u.shape)

The shape I get for U is always (0, 3, nx, ny, nz). And the same will occur for all the other tasks. But I know that I have data for U because in the distributed files the shape will be (10, 3, nx, ny/cores, nz). 

The distributed files are too big to upload, so here is a screenshot of the shape of the tasks: 
Screenshot 2025-10-04 at 10.55.59.png

Best regards,
Josh
snapshots-3D-tm-B5-Re192-2-000_s1.h5
Reply all
Reply to author
Forward
0 new messages