nbodykit.algorithms.pair_counters.corrfunc.base¶
Functions
|
Classes
|
A class used internally to hold the array-like result of a pair counting algorithm from |
|
A base class to represent an MPI-enabled |
Exceptions
- class nbodykit.algorithms.pair_counters.corrfunc.base.CorrfuncResult(data)[source]¶
A class used internally to hold the array-like result of a pair counting algorithm from
Corrfunc
.This class is useful for reducing pair count results in parallel while accounting for columns that are pair-weighted.
- Parameters
data (numpy.ndarray) – the numpy structured array result from
Corrfunc
- Attributes
- dtype
- shape
Methods
reshape
- class nbodykit.algorithms.pair_counters.corrfunc.base.MPICorrfuncCallable(callable, comm, show_progress=True)[source]¶
A base class to represent an MPI-enabled
Corrfunc
callable.This class adds the following functionality to the Corrfunc code:
If
show_progress
isTrue
, execute the function in chunks, logging to screen the progress along the way. This is useful for potentially long running pair counting jobs.When calling the function, capture stdout/stderr and C-level output and if an error occurs, raise an exception with all generated output for the user.
The relevant subclasses of this class are in
mocks
andtheory
.- Attributes
- binning_dims
Methods
__call__
(loads, kwargs[, callback])Calls
callable
in iterations, optionally callingcallback
before each iteration.- __call__(loads, kwargs, callback=None)[source]¶
Calls
callable
in iterations, optionally callingcallback
before each iteration.This allows the
Corrfunc
functioncallable
to be called in chunks, giving the user a progress report after each iteration.- Parameters
loads (list of int) – the list of loads for every rank; this corresponds to the number of particles in the in
A
if we are correlatingA
xB
kwargs (dict) – the dictionary of arguments to pass to
func
callback (callable, optional) – a callable takings
kwargs
as its first argument and a slice object as its second argument; this will be called first during each iteration
- Returns
result – the total binned pair counting result
- Return type