Skip to content

Commit

Permalink
#474 Add memory use for -oa flag option
Browse files Browse the repository at this point in the history
  • Loading branch information
N720720 committed Jun 10, 2024
1 parent 31427ab commit d8f3d24
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lindemann/index/mem_use.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def in_gb(nframes: int, natoms: int) -> str:
num_distances = natoms * (natoms - 1) // 2
float_size = np.float32().nbytes
trj = nframes * natoms * 3 * float_size
atom_atom_array = 3 * natoms * natoms * float_size
atom_atom_array = 2 * natoms * natoms * float_size
atom_array = natoms * float_size
linde_index = nframes * natoms * float_size
sum_bytes = trj + atom_atom_array + atom_array + linde_index
Expand All @@ -35,5 +35,6 @@ def in_gb(nframes: int, natoms: int) -> str:
)
per_frames = f"Flag -f (per_frames) will use {np.round((trj+(num_distances*2*float_size)+(nframes*float_size))/1024**3,4)} GB\n"
online_per_frames = f"Flag -of (per_frames) will use {np.round(((num_distances*2*float_size)+(nframes*float_size))/1024**3,4)} GB\n"
per_atoms = f"Flag -a (per_atoms) will use {np.round(sum_bytes/1024**3,4)} GB"
return f"{per_trj}{online_per_trj}{per_frames}{online_per_frames}{per_atoms}"
per_atoms = f"Flag -a (per_atoms) will use {np.round((sum_bytes)/1024**3,4)} GB\n"
online_per_atoms = f"Flag -oa (per_atoms) will use {np.round((sum_bytes-trj)/1024**3,4)} GB"
return f"{per_trj}{online_per_trj}{per_frames}{online_per_frames}{per_atoms}{online_per_atoms}"

0 comments on commit d8f3d24

Please sign in to comment.