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

Update cython #51

Merged
merged 11 commits into from
Dec 12, 2019
Merged

Update cython #51

merged 11 commits into from
Dec 12, 2019

Conversation

LSchueler
Copy link
Member

I made a lot of changes to the Cython implementation of the variogram estimators. The code is a lot cleaner now and the two major changes are

  • Two types of estimator functions can now be used
  • the code for the structured variogram estimation is now unified for the different spatial dimensions

LSchueler and others added 9 commits November 26, 2019 15:19
In cython, const's can't be used for local variables,
   only for function interfaces.
The estimator function and the normalization of the variogram are now being
calculated in a separate function. Function pointers are used for the
flexibility of choosing different estimator functions.
The function pointers in cython seem to be a bit limited, therefore I
wrote 2 separate functions choosing the estimator func. and the norm.
func.
In the cython code, merged the 1d-, 2d-, and 3d-versions of the structured
variogram estimators into the 3d version, with a tiny little bit of
preparation code in the python wrappers. Switched off the OpenMP loop
for the moment, as it always results in errors for the 1d case and
sometimes causes problems for higher dimensions. Super strange!
I learnt a lot about OpenMP. It seems very difficult, to adequately
parallelise the structured variogram estimator in Cython. Its OpenMP
support is simply to good enough. I parallelised the inner loop. It's
better than nothing. The function could be implemented in pure C, C++
or maybe Rust.
@LSchueler LSchueler added enhancement New feature or request Refactoring Code-Refactoring needed here labels Dec 10, 2019
@LSchueler LSchueler added this to the 1.1.2 milestone Dec 10, 2019
@LSchueler LSchueler self-assigned this Dec 10, 2019
@LSchueler LSchueler modified the milestones: 1.1.2, 1.2 Dec 10, 2019
setup.py Show resolved Hide resolved
Copy link
Member

@MuellerSeb MuellerSeb left a comment

Choose a reason for hiding this comment

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

cool

@LSchueler LSchueler merged commit 4bde6a0 into develop Dec 12, 2019
@LSchueler LSchueler deleted the update_cython branch December 12, 2019 10:43
@MuellerSeb MuellerSeb mentioned this pull request Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Refactoring Code-Refactoring needed here
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants