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

Emit (crude) intermediate code for Chemora. #121

Open
dmkoppelman opened this issue Feb 5, 2015 · 0 comments
Open

Emit (crude) intermediate code for Chemora. #121

dmkoppelman opened this issue Feb 5, 2015 · 0 comments

Comments

@dmkoppelman
Copy link
Collaborator

Currently, Kranc can generate Cactus thorns compatible with
CaKernel. For the Kranc trunk version it generates thorns compatible
with template gpu_cuda/3dblock, for my branch it generates thorns
compatible with gpu_cuda_dc/3dblock2.

In this issue modify Kranc so that it generates thorns compatible both
with the gpu_cuda_dc/3dblock2 template and with the new Chemora code
generation system (see GBS12 Ticket 128).

The generated thorn will have a new file, Chemora.h, in the src
directory. Chemora.h contains intermediate-form code corresponding to
the EDL or Kranc script. When the Startup.cc code is executed
(something which is currently placed in the thorn's src directory) the
intermediate-form code in Chemora.h will be passed to Chemora.

The intermediate-form code is passed to Chemora by a series of
function calls. Crude but quick.

Here are the major changes to Kranc:

Most of the generation of intermediate form code is performed in
CodeGenCalculation.m. Pre-definitions, grid function loads and stores,
and differencing operations are converted into C function calls (what
I'll all intermediate form) and collected on Calculation key reference
ChemoraContents. In KrancThorn.m ChemoraContents is written to new
file Chemora.h, where the intermediate code is wrapped in a procedure
named chemora_cg_thorn_startup. The Startup.cc file is modified to
call chemora_cg_thorn_startup.

Differencing Operations (changes to Differencing.m)
DifferencingProcessCode will now provide the differencing operations
in two forms, as strings (the current method), for existing key
PreDefinitions; and as MMA expressions, for new key
PreDefinitionsExpr.

New function chemoraPrecomputeDerivatives provides information
about each use of a differencing operation.

Consider this a quick-and-dirty first try. I expect that as I
understand Kranc better I'll generate the intermediate code for
Chemora at places that are more appropriate.

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

1 participant