Skip to content

Commit

Permalink
Merge #3125 #3132 #3133
Browse files Browse the repository at this point in the history
3125: Document Correlator.result() r=jngrad a=pkreissl

Fixes #2997 

Description of changes:
 - Document `result` method of `Correlator` class. Documentation done by @christophlohrmann.


3132: Core: Use slightly smaller value when adjusting max skin in tune_skin r=jngrad a=RudolfWeeber

@jngrad, this removes one potential issue with the p3m benchmark.


3133: CI: The cuda no_gpu test doesn't need a gpu runner r=jngrad a=RudolfWeeber

Fixes #

Description of changes:
 - 


PR Checklist
------------
 - [ ] Tests?
   - [ ] Interface
   - [ ] Core 
 - [ ] Docs?


Co-authored-by: Christoph Lohrmann <[email protected]>
Co-authored-by: Patrick Kreissl <[email protected]>
Co-authored-by: Rudolf Weeber <[email protected]>
  • Loading branch information
4 people authored Sep 5, 2019
4 parents 1f5f6ad + c3eb186 + 6a9a8aa + dc396ff commit 95673d5
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 27 deletions.
1 change: 0 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ check_cuda_maxset_no_gpu:
tags:
- docker
- linux
- cuda


check_with_odd_no_of_processors:
Expand Down
26 changes: 15 additions & 11 deletions doc/sphinx/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,8 @@ are of the form

.. math::
C(\tau) = \left<A\left(t\right) \otimes B\left(t+\tau\right)\right>\,,
\label{eq:corr.def}
C(\tau) = \left<A\left(t\right) \otimes B\left(t+\tau\right)\right>
where :math:`t` is time, :math:`\tau` is the lag time (time difference)
between the measurements of (vector) observables :math:`A` and
Expand Down Expand Up @@ -841,33 +841,37 @@ found its way to the Fluorescence Correlation Spectroscopy
Smit :cite:`frenkel02b` describes its application for the
special case of the velocity autocorrelation function.

.. _fig_correlator_scheme:

.. figure:: figures/correlator_scheme.png
:scale: 50 %
:alt: Schematic representation of buffers in the correlator.

Schematic representation of buffers in the correlator.

Let us consider a set of :math:`N` observable values as schematically
shown in figure [fig:dataSet], where a value of index :math:`i` was
measured in time :math:`i\delta t`. We are interested in computing the
correlation function according to equation  for a range lag times
:math:`\tau = (i-j)\delta t` between the measurements :math:`i` and
:math:`j`. To simplify the notation, we further drop :math:`\delta t`
when referring to observables and lag times.
shown in the figure above, where a value of index :math:`i` was
measured at times :math:`i\delta t`. We are interested in computing the
correlation function for a range
of lag times :math:`\tau = (i-j)\delta t` between the measurements
:math:`i` and :math:`j`. To simplify the notation, we drop
:math:`\delta t` when referring to observables and lag times.

The trivial implementation takes all possible pairs of values
corresponding to lag times
:math:`\tau \in [{\tau_{\mathrm{min}}}:{\tau_{\mathrm{max}}}]`. Without
loss of generality, let us further consider
loss of generality, we consider
:math:`{\tau_{\mathrm{min}}}=0`. The computational effort for such an
algorithm scales as
:math:`{\cal O} \bigl({\tau_{\mathrm{max}}}^2\bigr)`. As a rule of
thumb, this is feasible if :math:`{\tau_{\mathrm{max}}}< 10^3`. The
multiple tau correlator provides a solution to compute the correlation
functions for arbitrary range of the lag times by coarse-graining the
high :math:`\tau` values. It applies the naive algorithm to a relatively
small range of lag times :math:`\tau \in [0:p-1]`. This we refer to as
compression level 0. To compute the correlations for lag times
small range of lag times :math:`\tau \in [0:p-1]`
(:math:`p` corresponds to parameter ``tau_lin``).
This we refer to as compression level 0.
To compute the correlations for lag times
:math:`\tau \in [p:2(p-1)]`, the original data are first coarse-grained,
so that :math:`m` values of the original data are compressed to produce
a single data point in the higher compression level. Thus the lag time
Expand Down
14 changes: 0 additions & 14 deletions src/core/accumulators/Correlator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,20 +222,6 @@ class Correlator : public AccumulatorBase {

int get_correlation_time(double *correlation_time);

/** The function to process a new datapoint of A and B
*
* First the function finds out if it necessary to make some space for the new
* entries of A and B.
* Then, if necessary, it compresses old Values of A and B to make for the new
* value. Finally
* The new values of A and B are stored in A[newest[0]] and B[newest[0]],
* where the newest indices
* have been increased before. Finally the correlation estimate is updated.
* TODO: Not all
* the correlation estimates have to be updated.
*
*/

/** Return correlation result */
std::vector<double> get_correlation();

Expand Down
3 changes: 2 additions & 1 deletion src/core/tuning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ void tune_skin(double min_skin, double max_skin, double tol, int int_steps,
double time_a, time_b;
double min_cell_size =
std::min(std::min(dd.cell_size[0], dd.cell_size[1]), dd.cell_size[2]);
double const max_permissible_skin = min_cell_size - max_cut;
double const max_permissible_skin =
std::nextafter(min_cell_size - max_cut, 0.);

if (adjust_max_skin and max_skin > max_permissible_skin)
b = max_permissible_skin;
Expand Down
12 changes: 12 additions & 0 deletions src/python/espressomd/accumulators.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,18 @@ class Correlator(ScriptInterfaceHelper):
_so_creation_policy = "LOCAL"

def result(self):
"""
Returns
-------
numpy.ndarray
The result of the correlation function as a 2d-array.
The first column contains the values of the lag time tau.
The second column contains the number of values used to
perform the averaging of the correlation. Further columns contain
the values of the correlation function. The number of these columns
is the dimension of the output of the correlation operation.
"""
res = np.array(self.call_method("get_correlation"))
return res.reshape((self.n_result, 2 + self.dim_corr))

Expand Down

0 comments on commit 95673d5

Please sign in to comment.