Make batches always use contiguous memory: introduce simpler variables and remove states and states_linear
Description
Introduce new batch buffers: X(ff), X(ff_linear), X(ff_pack) - instead of using the states or states_linear arrays, these contiguous arrays can be used to access the data stored in a batch. X(ff_linear) is just another view of X(ff) with the spinor dimension folded into the state dimension. X(ff_pack) is now also allocated using the hardware aware functions if requested.
This change allows for much easier access to the data. Here is an example loop for unpacking:
do ip = 1, this%pack%size(2)
forall(ist = 1:this%nst_linear)
this%zff_linear(ip, ist) = this%zff_pack(ist, ip)
end forall
end do
Now that these new contiguous arrays are available, the states and states_linear arrays are removed to make the handling of the batches easier.
News snippet
Make batch memory always contiguous
Checklist
-
I have checked that my code follows the Octopus coding standards -
I have added tests for all the new features added in this request.
Edited by Martin Lueders