For example, if there were DiskVertex[1000] on disk, and a memory buffer of MemVertex[1000].
How can I read the data from DiskVertex into MemVertex? I want to avoid allocating a temporary buffer, reading the array into it, then copying that data into the destination. I’m not sure how to specify the data transfer options for this.
If the dimension is indeed 1000 you are adding code complexity for little to no gain. In any other cases, where N is on different scale, you read data into a buffer then you scatter it into to your MemVertex structure. (inverse of gather operation)
This will make it work for you, but it introduces a design flaw: non-coalesced memory access. you are to lose significant bandwidth The alternative representation where each field is a separate vector you get the best performance – when loading data, at the cost of code complexity – you have to add a multiplexer.
Here is my presentation slide for the problem.
Steve - thanks for the reply. The 1000 was an example, and the MemVertex is in a std::vector. I’ll take a look at your slides and will respond if I have further questions.