Hello to all,
I have a question that bothers me a lot and I could not find any answer.
I have some structures in my code, that are very useful in parallel programing using MPI, the problem is sometimes in sorting they will cause a lot of latency.
like the below one
Is there any way in calling a subroutine for sorting like operation instead of passing the array of one of these components passing sth like pointer. Because in my code arrays are too big and it will affect the speed very much.
I can not change the structure to normal arrays, because in parallel it is really useful for me.
I mean now I call
So in the subroutine it has to jump across a lot to do some operation and then return it back.
Is there any way that I can call
and in the subroutine it gets
both
and
as they are sequntial and then jump to the next one
and
, so when I have big arrays the speed increases!!!!!!!!!!!!!!!!!!!
the idea of send sth as a new structure to the subroutine?????
Is there any way or not?
I am really looking forward to hearing your hints.
Thank you very much for your help.
Best Regards,
I have a question that bothers me a lot and I could not find any answer.
I have some structures in my code, that are very useful in parallel programing using MPI, the problem is sometimes in sorting they will cause a lot of latency.
like the below one
Code:
Type person
Sequence
Real(Kind = 8) :: wgt
Real(Kind = 8) :: chg
Real(Kind = 8) :: cnc
Integer :: lsi
Integer :: lsa
End Type person
Is there any way in calling a subroutine for sorting like operation instead of passing the array of one of these components passing sth like pointer. Because in my code arrays are too big and it will affect the speed very much.
I can not change the structure to normal arrays, because in parallel it is really useful for me.
I mean now I call
Code:
Call check(n, person(1:n)%lsi, person(1:n)%lsa)
So in the subroutine it has to jump across a lot to do some operation and then return it back.
Is there any way that I can call
Code:
Call check(n, person(1:n)%lsi)
and in the subroutine it gets
both
Code:
person(1)%lsi
Code:
person(1)%lsa
Code:
person(2)%lsi
Code:
person(2)%lsa
the idea of send sth as a new structure to the subroutine?????
Is there any way or not?
I am really looking forward to hearing your hints.
Thank you very much for your help.
Best Regards,