Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run GC after reading frames and show progress #42

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/mddf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,15 @@
firstframe!(trajectory)

# Skip initial frames if desired
iframe = 0 # Counter for all frames of the input file, that must be read serially
while iframe < options.firstframe - 1
progress = Progress(options.firstframe; dt=1)
for _ in 1:options.firstframe - 1
nextframe!(trajectory)
iframe += 1
if options.GC && (Sys.free_memory() / Sys.total_memory() < options.GC_threshold)
GC.gc()

Check warning on line 198 in src/mddf.jl

View check run for this annotation

Codecov / codecov/patch

src/mddf.jl#L198

Added line #L198 was not covered by tests
end
options.silent || next!(progress)
end
iframe = options.firstframe - 1

# Define how the parallelization will be performed, according to the memory
# requirements of the computation
Expand Down
Loading