This commit shows how the lifecycle of as slice goes.
At some point, a rank gets a list of slices that needs
in the next iteration, at classifies them according
to the characteristics of every situation.
If for instance we are given a slice with
an abc tuple such that we find that this tuple
was given to our rank, then we know that
we have to create a SelfSufficient tuple.
What we do is that we find a blank slice in our
SliceUnion slices bucket. This buffer is blank
and safe to do everything we want with it.
Without cuda, we just need to point this
blank slice to the correct memory address
of the data, that we (the SliceUnion) own.
This is therefore the line
blank.data = sources[from.source].data();
Of course, doing this in CUDA will mess everything,
as it was until now, since we are pointing to a Host
address. Sadly the way the casting fu is now implemented,
the typechecker did not get that one and I foolishly
forgot about this important bit.
After the creation of the slice comes at some point
in the life cycle the destruction, which we also
have to handle separately.
This is done every iteration in the
void clearUnusedSlicesForNext(ABCTuple const& abc);
function. There, normally the SelfSufficient slice
would just forget about the pointer it points, slice.data,
since this point is part of the original data of the tensor
distributed in the SliceUnion. In the CUDA case however,
we gave the SelfSufficient slice a freePointer from our
SliceUnion's bucket of allocated freePointers in the GPU
(of which we have around 6 per SliceUnion type).
This pointer needs to be marked again free to use
by a slice in the future, so it has to go back to the bucket,
we can't afford to lose it.
|
||
|---|---|---|
| .github/workflows | ||
| bench | ||
| docs | ||
| etc | ||
| include | ||
| src | ||
| test | ||
| .gitignore | ||
| atrip.mk | ||
| atrip.org | ||
| bootstrap.sh | ||
| config.el | ||
| configure.ac | ||
| cuda.nix | ||
| LICENSE | ||
| LICENSE-HEADER | ||
| Makefile.am | ||
| README.org | ||
| shell.nix | ||
| Sources.mk | ||
ATRIP: An MPI-asynchronous implementation of CCSD(T)
About this document
You can find this project written as a literate program
or if you prefer reading the source code with Doxygen there is also a built of doxygen available:
How to cite
If you need to cite this algorithm before the proper paper is released please contact me.
In the mean time the code has been used in this publication and can therefore been cited.