23.10.2014 Views

slides - Spring School in Advanced Computing TACC @ UP

slides - Spring School in Advanced Computing TACC @ UP

slides - Spring School in Advanced Computing TACC @ UP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Overlapp<strong>in</strong>g Communication and<br />

Work<br />

<strong>in</strong>clude
‘mpi.h’
<br />

program
hybover
<br />

!$OMP
parallel
<br />




if
(ithread
.eq.
0)
then
<br />







call
MPI_(…,ierr)
<br />




else
<br />








<br />




endif
<br />

!$OMP
end
parallel
<br />

end
<br />

Fortran
 C
<br />

#<strong>in</strong>clude

<br />

<strong>in</strong>t
ma<strong>in</strong>(<strong>in</strong>t
argc,
char
**argv){
<br />


<strong>in</strong>t
rank,
size,
ierr,
i;
<br />

#pragma
omp
parallel
<br />

{
<br />




if
(thread
==
0){
<br />







ierr=MPI_(…)
<br />




}
<br />



if(thread
!=
0){
<br />







work
<br />



}
<br />

}
<br />

24

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!