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

Feature request: additional hook for Initializer after Initialization #73

Open
klreuther opened this issue Oct 16, 2019 · 2 comments
Open

Comments

@klreuther
Copy link

klreuther commented Oct 16, 2019

The initializer is not only responsible for the creation of the grid, it also stores some information needed during the entire calculation run (e.g., the total number of steps). The initializer object is therefore persistent throughout the calculation.

If the initializer requires significant amounts memory for grid creation, an additional hook Initializer::gridInitializationDone() can signal it to free the initialization memory.

Exemplary call in libgeodecomp/parallelization/hiparsimulator.h:

231a232,233
>
>       initializer->gridInitializationDone();

Change to /libgeodecomp/io/initializer.h:

111a112,113
>     virtual void gridInitializationDone() = 0;
>
@klreuther
Copy link
Author

klreuther commented Oct 16, 2019

As far as I see, the persistently needed methods of the initializer are only

  1. startStep()
  2. maxSteps()
  3. gridBox()
  4. gridDimensions().

IMHO these could just as well be parameters to the simulator itself which in turn passes it to the initializer. I am aware that this minor structural change requires adaptations of all codes using LGD, but a person can dream, no?

@aproeme
Copy link

aproeme commented Jan 15, 2020

In porting a code to use LibGeoDecomp I've found the need to enable resetting of maxSteps of an Initializer, and have implemented this by passing a new value from a Simulator to an Initializer in the following way: aproeme/libgeodecomp@a81ed60

I may not permanently rely on the ability to change these parameters via an existing Simulator, but could not see a better solution for the moment. It seems useful to be able to stage simulations by changing parameters via the Simulator, regardless of whether the parameters themselves are moved to live in the Simulators they initialise or whether they stay inside the original Initializer and are modified by passing new values through the Simulator, as I did for maxSteps and as suggested by klreuther.

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

No branches or pull requests

2 participants