Research Article

Multi-GPU Support on Single Node Using Directive-Based Programming Model

Algorithm 2

S3D thermodynamics kernel in multi-GPU using hybrid model.
call omp_set_num_threads(2)
!$omp parallel private(m)
!$omp sections
!$omp section
call acc_set_device_num(1, acc_device_not_host)
!$acc data copyout(c(1:np)) copyin(T(1:np),…)
do m = 1, MR
call calc_mixcp(np, nslvs, T, …  ,  c)
end do
!$acc end data
!$omp section
call acc_set_device_num(2, acc_device_not_host)
!$acc data copyout(h(1:np)) copyin(T(1:np),…)
do m = 1, MR
call calc_mixenth(np, nslvs, T, …  ,  h)
end do
!$acc end data
!$omp end sections
!$omp end parallel