nrn icon indicating copy to clipboard operation
nrn copied to clipboard

Refactor `src/gnu`

Open alexsavulescu opened this issue 3 years ago • 3 comments

Not familiar with all the code in gnu (except for the d_avec refactoring to std::vector) A couple of ideas to brainstorm:

  • random generators + distribution -> use std library ? Can all be replaced? Do we have a 1to1 replacement in the std library? Do we need to maintain all of them? Binary differences to be expected
  • [x] complex -> move to std::complex ?
  • [ ] ACG : can be replaced by Random123 generator
  • [ ] Binomial : https://en.cppreference.com/w/cpp/numeric/random/binomial_distribution
  • [ ] DiscUnif : https://en.cppreference.com/w/cpp/numeric/random/uniform_int_distribution
  • [ ] Erlang :
  • [ ] Geom : https://en.cppreference.com/w/cpp/numeric/random/geometric_distribution
  • [ ] HypGeom :
  • [ ] LogNorm : https://en.cppreference.com/w/cpp/numeric/random/lognormal_distribution
  • [ ] MLCG : can be replaced by Random123 generator
  • [ ] NegExp :
  • [ ] Normal : https://en.cppreference.com/w/cpp/numeric/random/normal_distribution
  • [ ] Poisson : https://en.cppreference.com/w/cpp/numeric/random/poisson_distribution
  • [ ] RndInt :
  • [ ] Uniform : https://en.cppreference.com/w/cpp/numeric/random/uniform_real_distribution
  • [ ] Weibull : https://en.cppreference.com/w/cpp/numeric/random/weibull_distribution

alexsavulescu avatar Jun 11 '21 19:06 alexsavulescu

I'd be delighted to see the gnu subdirectory disappear.

nrnhines avatar Jun 12 '21 12:06 nrnhines

Was discussing today about PRNGs, we were wondering if we shouldn't drop some unused number generators?

https://nrn.readthedocs.io/en/latest/python/programming/math/random.html?highlight=random#Random.ACG

As far as I understand , only Random123 and MCellRan4 are of interest wrt support for parallel simulations. Do we have any usecase for the rest? If so, I imagine we can use std implementations for most of them (readily available)

cc: @jamesgking

alexsavulescu avatar Jul 07 '21 13:07 alexsavulescu

For what it's worth, MLCG and ACG do not appear to be used in any ModelDB entries.

ramcdougal avatar Jul 07 '21 14:07 ramcdougal