Communication in Parallel

General discussion about Elmer
Post Reply
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Communication in Parallel

Post by Franz Pichler »

Hello dear Elmer community,

i was just wondering what the best way would be to let the processors of an Elmer parallel run communicate with each other.
Think of a very time comsuming user function that would calculate the source term in my nodes.
Now in parallel there are many nodes which belong to two or more partitions.
Is there a way to tell Elmer that just the owner processor
should calculate the source term and that the other processes should get the value from the owner afterwards.

i know how to find out the owner

Code: Select all

  
i =NODEINDEX
if(ParEnv % PEs>1) then
                 IF( Mesh % ParallelInfo % NeighbourList(NodeIndexes(i)) % Neighbours(1) == ParEnv % MyPE ) THEN !I AM THE OWNER
                                  DO CALCULATION                 
                 ELSE IF THEN
                          REMEMBER(k)=i            !THIS is to remember the postponed nodes
                          k=k+1
                         CYCLE
                END IF
end if
Then i thought maybe i can tell the solver to get the information about the postponed nodes after all the owned nodes are calculated. Somethibg like

Code: Select all

loop over processors
    if i send
              everybody listens
    if i not send 
             i listen
end loop
i am aware that this will be quite costly because communication is costly but for me i think it would really pay of. the send and listening part is the one i am not sure of. Any ideas and hints are highly appreciated.

Thanks

Franz
Post Reply