I have this loop which looks like the following in openmp but I am getting allocation errors:
!$OMP PARALLEL DO PRIVATE(fn)
do fn=0, NFILES
allocate(temparray(1:3,1:Ntot))
LOAD temparray FROM FILE(fn)
Ntot = len(temparray)
TOTALARRAY(1+nstart:nstart+Ntot,1:3)=temparray(1:Ntot, 1:3)
deallocate(temparray)
nstart=nstart+len(temparray)
end do
!$OMP END PARALLEL DO
Is there a way to load these files into memory and combine them very quickly using openmp? Or do I have to do it sequentially? The arrays I have are MUCH larger than this - this is just for demonstration. I want to load them in in parallel.