Hello,
I am trying to solve a problem involving quite a lot of data, and started creating derived types which pack the data together. For simplicity purposes, let's say I have an allocatable array of the PARENT type, each of which contains an allocatable array of the CHILD type, and each child has a allocatable array of DATA. All the data, and derived type definition and declarations reside in a common module, so in global memory.
Most of my operations involve data at the PARENT(i) % CHILD(j) % DATA level. I was wondering if there was a difference in performance when passing (i,j) to a subroutine and access PARENT(i) % CHILD(j) % DATA from the global memory, compared to passing PARENT(i) % CHILD(j) % DATA directly? Since the data is supposedly passed by reference (my DATA arrays are contiguous and I'm not passing non contiguous slices, my dummy arguments are adjustable arrays), I'm guessing the two are approximately equivalent, but I don't know for sure. Also, I want to be able to use openMP to work on several i's at the same time, but I think I can do it with both options.
Thank you very much for your help!