
Development methodologies for GPU and cluster of GPUs 125
Listing 7.7. sending function in the basic asynchronous scheme
// Variables de clar ati on and i n i t i a l i z a t i o n
. . .
while ( ! F i n i s h e d ) {
5 o m p s e t l o c k (& l o ck Se n d ) ; // Waiting f o r si gn a l from the comp. thread
i f ( ! F i n i s h e d ) {
// Blocking synchronous sends to a l l dependencies
fo r ( i =0; i <nbDeps ; ++i ) {
MPI Ssend(&dataToSend [ dep s [ i ] ] , nb data , t y p e o f d a t a , d eps [ i ] ,
tagCom , MPI COMM WORLD) ;
10 }
S e n d s I n P r o g r e s s = 0 ; // I ndi cat es that the sendings are done
}
}
// At the end of the process , sendings