mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 18:18:03 +00:00
add max snapshot
This commit is contained in:
parent
f33bf0c3b2
commit
06d3fede95
1 changed files with 5 additions and 4 deletions
|
@ -14,7 +14,8 @@
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
"""
|
"""
|
||||||
Script to split particles into smaller files according to their clump
|
Script to split particles into smaller files according to their clump
|
||||||
membership for faster manipulation. Running this will require a lot of memory.
|
membership for faster manipulation. Currently does this for the maximum
|
||||||
|
snapshot of each simulation. Running this will require a lot of memory.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
@ -33,17 +34,17 @@ comm = MPI.COMM_WORLD
|
||||||
rank = comm.Get_rank()
|
rank = comm.Get_rank()
|
||||||
nproc = comm.Get_size()
|
nproc = comm.Get_size()
|
||||||
|
|
||||||
# Nsims = [9844]
|
|
||||||
Nsims = csiborgtools.io.get_csiborg_ids("/mnt/extraspace/hdesmond")
|
Nsims = csiborgtools.io.get_csiborg_ids("/mnt/extraspace/hdesmond")
|
||||||
Nsnap = 1016
|
|
||||||
partcols = ["x", "y", "z", "vx", "vy", "vz", "M", "level"]
|
partcols = ["x", "y", "z", "vx", "vy", "vz", "M", "level"]
|
||||||
dumpdir = join(utils.dumpdir, "temp")
|
dumpdir = join(utils.dumpdir, "temp")
|
||||||
|
|
||||||
jobs = csiborgtools.fits.split_jobs(len(Nsims), nproc)[rank]
|
jobs = csiborgtools.fits.split_jobs(len(Nsims), nproc)[rank]
|
||||||
for icount, Nsim in enumerate(jobs):
|
for icount, sim_index in enumerate(jobs):
|
||||||
print("{}: rank {} working {} / {} jobs.".format(datetime.now(), rank,
|
print("{}: rank {} working {} / {} jobs.".format(datetime.now(), rank,
|
||||||
icount + 1, len(jobs)))
|
icount + 1, len(jobs)))
|
||||||
|
Nsim = Nsims[sim_index]
|
||||||
simpath = csiborgtools.io.get_sim_path(Nsim)
|
simpath = csiborgtools.io.get_sim_path(Nsim)
|
||||||
|
Nsnap = csiborgtools.io.get_maximum_snapshot(simpath)
|
||||||
# Load the clumps, particles' clump IDs and particles.
|
# Load the clumps, particles' clump IDs and particles.
|
||||||
clumps = csiborgtools.io.read_clumps(Nsnap, simpath)
|
clumps = csiborgtools.io.read_clumps(Nsnap, simpath)
|
||||||
particle_clumps = csiborgtools.io.read_clumpid(Nsnap, simpath,
|
particle_clumps = csiborgtools.io.read_clumpid(Nsnap, simpath,
|
||||||
|
|
Loading…
Reference in a new issue