Skip to content
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
22 changes: 21 additions & 1 deletion src/spikeinterface/core/job_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,27 @@ def __init__(
self.max_threads_per_process = max_threads_per_process

if verbose:
print(self.job_name, "with n_jobs =", self.n_jobs, "and chunk_size =", self.chunk_size)
if self.n_jobs > 1:
chunk_memory = self.chunk_size * recording.get_num_channels() * np.dtype(recording.get_dtype()).itemsize
total_memory = chunk_memory * self.n_jobs
chunk_duration = self.chunk_size / recording.get_sampling_frequency()
from spikeinterface.core.core_tools import convert_bytes_to_str, convert_seconds_to_str

chunk_memory_str = convert_bytes_to_str(chunk_memory)
total_memory_str = convert_bytes_to_str(total_memory)
chunk_duration_str = convert_seconds_to_str(chunk_duration)
print(
self.job_name,
"\n"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure 2 lines is a good idea because with the progressbar this will be 3 lines in total.

Copy link
Copy Markdown
Collaborator Author

@h-mayorquin h-mayorquin May 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with reducing it to two. Any preferences @alejoe91 ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted to one line.

image

f"n_jobs={self.n_jobs} - "
f"samples_per_chunk={self.chunk_size:,} - "
f"chunk_memory={chunk_memory_str} - "
f"total_memory={total_memory_str} - "
f"chunk_duration={chunk_duration_str}",
)

else:
print(self.job_name, "with n_jobs =", self.n_jobs, "and chunk_size =", self.chunk_size)

def run(self):
"""
Expand Down