-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue #10. Examples showing how to mix mfc and gfortran.
- Loading branch information
1 parent
a7035ac
commit 53c76c8
Showing
6 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
ocean/nemo/nemolite2d_psykal_ompss/simple_tests/Makefile.mixed2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
F90 = gfortran | ||
F90FLAGS = -g | ||
OMPSSF90 = mfc | ||
OMPSSF90FLAGS = --ompss -g | ||
FOBJ = field.o main.o psy_deref.o psy_target.o my_work1.o my_work2.o | ||
|
||
test_example: ${FOBJ} | ||
${OMPSSF90} -o $@ ${FOBJ} ${OMPSSF90FLAGS} | ||
|
||
psy_target.o : psy_target.f90 | ||
${OMPSSF90} ${OMPSSF90FLAGS} -c $< | ||
my_work1.o : my_work1.f90 | ||
${OMPSSF90} ${OMPSSF90FLAGS} -c $< | ||
my_work2.o : my_work2.f90 | ||
${OMPSSF90} ${OMPSSF90FLAGS} -c $< | ||
|
||
psy_target.o : my_work1.o my_work2.o | ||
psy_deref.o : field.o | ||
main.o : psy_deref.o field.o | ||
|
||
%.o: %.f90 | ||
${F90} ${F90FLAGS} -c $< | ||
clean: | ||
rm -f *.o *.mod test_example |
27 changes: 27 additions & 0 deletions
27
ocean/nemo/nemolite2d_psykal_ompss/simple_tests/Makefile.mixed3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
F90 = gfortran | ||
F90FLAGS = -g | ||
OMPSSF90 = mfc | ||
OMPSSF90FLAGS = --ompss -g | ||
FOBJ = field.o top.o main2.o psy_deref.o psy_target.o my_work1.o my_work2.o | ||
|
||
test_example: ${FOBJ} | ||
${OMPSSF90} -o $@ ${FOBJ} ${OMPSSF90FLAGS} | ||
|
||
psy_target.o : psy_target.f90 | ||
${OMPSSF90} ${OMPSSF90FLAGS} -c $< | ||
my_work1.o : my_work1.f90 | ||
${OMPSSF90} ${OMPSSF90FLAGS} -c $< | ||
my_work2.o : my_work2.f90 | ||
${OMPSSF90} ${OMPSSF90FLAGS} -c $< | ||
top.o : top.f90 | ||
${OMPSSF90} ${OMPSSF90FLAGS} -c $< | ||
|
||
top.o : main2.o | ||
psy_target.o : my_work1.o my_work2.o | ||
psy_deref.o : field.o | ||
main2.o : psy_deref.o field.o | ||
|
||
%.o: %.f90 | ||
${F90} ${F90FLAGS} -c $< | ||
clean: | ||
rm -f *.o *.mod test_example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
subroutine algorithm | ||
! example algorithm code | ||
use field_mod, only : field | ||
use psy_layer, only : psy | ||
implicit none | ||
type(field) :: a | ||
|
||
call psy(a) | ||
|
||
end subroutine algorithm |
11 changes: 11 additions & 0 deletions
11
ocean/nemo/nemolite2d_psykal_ompss/simple_tests/psy_deref.f90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module psy_layer | ||
contains | ||
subroutine psy(a) | ||
use field_mod, only : field | ||
implicit none | ||
type(field) :: a | ||
|
||
call psy_target(a%data) | ||
|
||
end subroutine psy | ||
end module psy_layer |
30 changes: 30 additions & 0 deletions
30
ocean/nemo/nemolite2d_psykal_ompss/simple_tests/psy_target.f90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
subroutine psy_target(a) | ||
! full field dependencies with gocean data types and doubly nested | ||
! loops | ||
use kernel_work1, only : work1 | ||
use kernel_work2, only : work2 | ||
implicit none | ||
integer :: i, j | ||
real :: a(2,2) | ||
|
||
a = 0.0 | ||
|
||
do j=1,2 | ||
do i=1,2 | ||
!$omp task out(a(i,j)) | ||
call work1(i,j,a) | ||
!$omp end task | ||
end do | ||
end do | ||
|
||
do j=1,2 | ||
do i=1,2 | ||
!$omp task in(a(i,j)) | ||
call work2(i,j,a) | ||
!$omp end task | ||
end do | ||
end do | ||
|
||
!$omp taskwait | ||
|
||
end subroutine psy_target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
program top | ||
call algorithm() | ||
end program top |