More control over initial data creation
There are plenty of cases where I have the strong whish to break out of Peano's Hollywood principle. Another case is that I really need more control when setting up the initial data. I know some codes which work, in pseudo code, like
Begin Program
Startup: Populate grid with initial data.
Load files, etc, then loop over grid and set data.
Evolution:
do loop over timesteps
WaveToyC: Evolution of 3D wave equation
t = t+dt
Do the online analysis part
Write out data if neccessary
enddo
End Program.
This allows typical use cases for the inital data as opening files where to read initial data from (for instance, data created with the LORENE code), or checking parameters and precomputing quantities how to compute the intitial data. For instance, in Astrophysics there are quite easy codes to create simple space times (TOV, discs) but they cannot just return the wanted quantities in a
void getInitialDataAt(const double* pointCenter, double* theQplease);
fashion. Instead, they precompute grid transformations, potentials, etc. There has to be a place where they can do that, naturally on a per-process but not per-thread basis.
Just to turn the tables, how idiotic the following pseudo code would be:
FUNCTION getIntialDataAt(a point, returning the Q):
- somehow retrieve the initial data properties from environment variables or open and parse another config file
- 300 lines of code computing global derived quantities from the properties, solving several integrals and sums etc.
- Interpolation of data on a rectangular grid with dx spacing (I have programs where this interpolation takes 40 minutes)
- Throwing away everything and just returning the quantities for the requested point.
END FUNCTION
We would never see ExaHyPE starting to evolve something well before we get retired.