-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
1,446 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
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,7 @@ | ||
Name: @PROJECT_NAME@ | ||
Description: @PROJECT_DESCRIPTION@ | ||
Version: @PROJECT_VERSION@ | ||
|
||
Requires: fortuno | ||
Cflags: -I@CMAKE_INSTALL_FULL_LIBDIR@/@FORTUNO_COA_INSTALL_MODULEDIR@ | ||
Libs: -L@CMAKE_INSTALL_FULL_LIBDIR@ -lfortuno-coarray |
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 @@ | ||
name = "fortuno-coarray" | ||
version = "0.1.0" | ||
license = "BSD-2-Clause-Patent" | ||
author = "Fortuno authors" | ||
maintainer = "aradi@uni-bremen.de" | ||
copyright = "Copyright 2024, Fortuno authors" | ||
|
||
[fortran] | ||
implicit-typing = false | ||
implicit-external = false | ||
source-form = "free" |
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,5 @@ | ||
*~ | ||
*.mod | ||
*.a | ||
*.o | ||
|
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,12 @@ | ||
LICENSE | ||
src/ | ||
src/fortuno.f90 | ||
src/fortuno/ | ||
src/fortuno/** | ||
src/fortuno_coarray.f90 | ||
src/fortuno_coarray/ | ||
src/fortuno_coarray/** | ||
test/ | ||
test/export/ | ||
test/export/coarray/ | ||
test/export/coarray/** |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
fpm.serial.toml | ||
LICENSE | ||
src/ | ||
src/fortuno.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
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
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,32 @@ | ||
# This file is part of Fortuno. | ||
# Licensed under the BSD-2-Clause Plus Patent license. | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
|
||
list(APPEND CMAKE_MESSAGE_CONTEXT Coarray) | ||
|
||
add_library(fortuno_example_coarray_mylib) | ||
set_target_properties( | ||
fortuno_example_coarray_mylib PROPERTIES | ||
OUTPUT_NAME mylib | ||
) | ||
target_sources( | ||
fortuno_example_coarray_mylib PRIVATE | ||
mylib.f90 | ||
) | ||
fortuno_add_coarray_build_flags(fortuno_example_coarray_mylib) | ||
|
||
add_executable(fortuno_example_coarray_testapp) | ||
set_target_properties( | ||
fortuno_example_coarray_testapp PROPERTIES | ||
OUTPUT_NAME testapp | ||
) | ||
target_sources( | ||
fortuno_example_coarray_testapp PRIVATE | ||
test_simple.f90 | ||
testapp.f90 | ||
) | ||
target_link_libraries( | ||
fortuno_example_coarray_testapp PRIVATE | ||
fortuno_example_coarray_mylib Fortuno::fortuno_coarray | ||
) | ||
fortuno_add_coarray_build_flags(fortuno_example_coarray_testapp) |
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,26 @@ | ||
# This file is part of Fortuno. | ||
# Licensed under the BSD-2-Clause Plus Patent license. | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
|
||
example_mylib_lib = library( | ||
'mylib', | ||
sources: ['mylib.f90'], | ||
install: false, | ||
fortran_args: coarray_compile_flags, | ||
link_args: coarray_link_flags, | ||
) | ||
example_mylib_dep = declare_dependency( | ||
link_with: example_mylib_lib, | ||
) | ||
|
||
example_testapp_exe = executable( | ||
'testapp', | ||
sources: [ | ||
'test_simple.f90', | ||
'testapp.f90', | ||
], | ||
dependencies: [example_mylib_dep, fortuno_coarray_dep], | ||
install: false, | ||
fortran_args: coarray_compile_flags, | ||
link_args: coarray_link_flags, | ||
) |
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 @@ | ||
! This file is part of Fortuno. | ||
! Licensed under the BSD-2-Clause Plus Patent license. | ||
! SPDX-License-Identifier: BSD-2-Clause-Patent | ||
|
||
!> Demo module/library to be tested | ||
module mylib | ||
implicit none | ||
|
||
private | ||
public :: broadcast | ||
|
||
contains | ||
|
||
|
||
!> Broadcasts a scalar integer. | ||
subroutine broadcast(buffer, source) | ||
|
||
!> Buffer to broadcast | ||
integer, intent(inout) :: buffer | ||
|
||
!> Source image | ||
integer, intent(in) :: source | ||
|
||
integer :: stat | ||
|
||
call co_broadcast(buffer, source) | ||
|
||
end subroutine broadcast | ||
|
||
end module mylib |
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,55 @@ | ||
! This file is part of Fortuno. | ||
! Licensed under the BSD-2-Clause Plus Patent license. | ||
! SPDX-License-Identifier: BSD-2-Clause-Patent | ||
|
||
module test_simple | ||
use mylib, only : broadcast | ||
use fortuno_coarray, only : as_char, test => coa_pure_case_item, context => coa_context,& | ||
& is_equal, test_list | ||
implicit none | ||
|
||
contains | ||
|
||
|
||
!> Returns the tests from this module | ||
function tests() | ||
type(test_list) :: tests | ||
|
||
tests = test_list([& | ||
test("broadcast", test_broadcast)& | ||
]) | ||
|
||
end function tests | ||
|
||
|
||
!> Broadcast test with collective communication | ||
subroutine test_broadcast(ctx) | ||
class(context), intent(inout) :: ctx | ||
|
||
integer, parameter :: sourceimg = 1, sourceval = 100, otherval = -1 | ||
integer :: buffer | ||
|
||
character(:), allocatable :: msg | ||
|
||
! GIVEN source rank contains a different integer value as all other ranks | ||
if (this_image() == sourceimg) then | ||
buffer = sourceval | ||
else | ||
buffer = otherval | ||
end if | ||
|
||
! WHEN source rank broadcasts its value | ||
call broadcast(buffer, sourceimg) | ||
|
||
! Make every third rank fail for demonstration purposes | ||
if (mod(this_image() - 1, 3) == 2) then | ||
buffer = sourceval + 1 | ||
msg = "Failing on image " // as_char(this_image()) // " on purpose" | ||
end if | ||
|
||
! THEN each rank must contain source rank's value | ||
call ctx%check(is_equal(buffer, sourceval), msg=msg) | ||
|
||
end subroutine test_broadcast | ||
|
||
end module test_simple |
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,13 @@ | ||
! This file is part of Fortuno. | ||
! Licensed under the BSD-2-Clause Plus Patent license. | ||
! SPDX-License-Identifier: BSD-2-Clause-Patent | ||
|
||
!> Test app, collecting and executing the tests | ||
program testapp | ||
use fortuno_coarray, only : execute_coa_cmd_app | ||
use test_simple, only : tests | ||
implicit none | ||
|
||
call execute_coa_cmd_app(tests()) | ||
|
||
end program testapp |
Oops, something went wrong.