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

Rework #1

Merged
merged 19 commits into from
Nov 25, 2020
Merged

Rework #1

merged 19 commits into from
Nov 25, 2020

Conversation

9il
Copy link
Contributor

@9il 9il commented Nov 18, 2020

Changelog:

  1. Reworked sweep_slice to access memory only once like the Python code. I didn't make a benchmark, but I expect it will be a few times faster now.
  2. Added fastmath to the kernel-like API and pragma(inline, false) for some API. The last one is required to make the first one work well.
  3. Changed / with * where possible (it is fine for this kind of numeric code).
  4. Used more mir.* alternatives if possible.
  5. Simplified API for some functions
  6. ndslice-like rework for restriction
  7. ndslice-like rework for prolongation
  8. @nogc cycle

@9il 9il changed the title Rework 'sweep_slice' and update code a bit WIP: Rework 'sweep_slice' and update code a bit Nov 18, 2020
@9il 9il changed the title WIP: Rework 'sweep_slice' and update code a bit WIP: Rework Nov 19, 2020
@9il 9il changed the title WIP: Rework Rework Nov 19, 2020
@9il
Copy link
Contributor Author

9il commented Nov 19, 2020

Hi @typohnebild
Please let me know how the numbers look like when you have a chance.
I don't have a Linux machine to run the scripts :/

@typohnebild
Copy link
Owner

Hi @9il,
thank you very much for your rework!
I have a done a small comparison between your branch and ours. Your rework gives a enormous speed up for all variations.
Especially the slice version only takes have the time

see
see

raw
raw

@9il
Copy link
Contributor Author

9il commented Nov 20, 2020

Thanks!
Hope I will add sweep_ndslice next week.
sweep_ndslicewill have a mir.ndslice idiomatic implementation like the new projection, also weighted projection can be additionally simplified.

And maybe a multithreaded version will be added too.

Would you mind to update the README and charts when all changes ready?

@sm1th3ry
Copy link
Collaborator

This is a great job you are doing! Thanks a lot!
We are learning a lot about D by analysing your code.

Of course. We will rerun the benchmarks when everything is done and update the README. Just let us know when you are finished.

@9il
Copy link
Contributor Author

9il commented Nov 23, 2020

done

PoissonCycle!(double, Dim, SweepType.ndslice) can be built with up to 8-dimensional space, higher dimensions may fail to compile.

@9il
Copy link
Contributor Author

9il commented Nov 23, 2020

The default sweep algorithm changes to ndslice, which may not be the fastest version. It is smaller, either to write and supports higher dimensions.

The field version doesn't use Mir except for API and looks more like C/C++ code. It isn't bad, but I am afraid that it may scare away potential users if we make it athe default sweep algorithm.

@typohnebild
Copy link
Owner

Thanks a lot!

We are going to merge this and then start a new run and afterwards we will update the readme!

@typohnebild typohnebild merged commit 6f036ff into typohnebild:master Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants