-
Notifications
You must be signed in to change notification settings - Fork 10
Replace parallel statements with Caffeine calls #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7ce5305
fix(program_term): sync all->call prif_sync_all
rouson 60d74ae
fix(example): error stop -> call prif_error_stop
rouson 76354af
test(termination): dogfood termination
rouson 66153ec
test(stop): fix typo in test description
rouson 0a2ea18
test(prif_error_stop): add no-stop-code case
rouson 97c7ad1
test(prif_error_stop): rm confusing character code
rouson bc7486f
chore(src/): rm .mod files
rouson 0bea9a2
test(prif_error_stop): fix subprocess prog names
rouson 32cbffc
chore(.gitgnore): add file types
rouson f374998
test(caf_error_stop): fix prog names|add cmd* args
rouson 70cd956
doc(README): add line breaks and fix typo
rouson a39cbe4
test(prif_error_stop) pass non-empty string
rouson ca8428d
test(prif_stop): pass non-empty string
rouson 8d32257
test(main): switch stop/error-stop to prif calls
rouson e2a2156
test(main): update comment
rouson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,17 +1,23 @@ | ||
program hello_world | ||
use iso_c_binding, only: c_bool | ||
use prif, only : prif_init, this_image => prif_this_image_no_coarray, num_images => prif_num_images, prif_stop | ||
use prif, only : & | ||
prif_init & | ||
,prif_this_image_no_coarray & | ||
,prif_num_images & | ||
,prif_stop & | ||
,prif_error_stop | ||
implicit none | ||
|
||
integer :: init_exit_code, me, num_imgs | ||
logical(kind=c_bool), parameter :: false = .false._c_bool | ||
|
||
call prif_init(init_exit_code) | ||
if (init_exit_code /= 0) error stop "caffeinate returned a non-zero exit code" | ||
if (init_exit_code /= 0) call prif_error_stop(quiet=false, stop_code_char="program startup failed") | ||
|
||
call this_image(this_image=me) | ||
call num_images(num_images=num_imgs) | ||
call prif_this_image_no_coarray(this_image=me) | ||
call prif_num_images(num_images=num_imgs) | ||
print *, "Hello from image", me, "of", num_imgs | ||
|
||
call prif_stop(.false._c_bool, stop_code_int=0) ! normal termination | ||
call prif_stop(quiet=false) | ||
|
||
end program |
This file contains hidden or 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,3 +1,3 @@ | ||
Test Support | ||
------------ | ||
The programs in this directory intentionally error-terminate to support the `error stop` tests in `test/caf_error_stop.f90`, which use Fortran's `execute_command_line` to run the programms in this directory and check for the expected non-zero stop codes. Running the tests in this manner enables the Vegetable tests to continue executing in the presence of error-terminating tests. | ||
The programs in this directory intentionally terminate to support the `stop` and `error stop` unit tests, which use Fortran's `execute_command_line` to run the programs in this directory and to check for the expected non-zero stop codes. Running the tests in this manner enables the tests to continue executing the child process launced by `execute_command_line` terminates. | ||
rouson marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,15 @@ | ||
program error_stop_with_character_code | ||
use iso_c_binding, only: c_bool | ||
use prif, only : & | ||
prif_init & | ||
,prif_stop & | ||
,prif_error_stop | ||
implicit none | ||
|
||
integer init_exit_code | ||
logical(kind=c_bool), parameter :: false = .false._c_bool | ||
|
||
call prif_init(init_exit_code) | ||
call prif_error_stop(quiet=false, stop_code_char="") ! a prif_error_stop unit test passes if this line executes error termination | ||
rouson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
call prif_stop(quiet=false) ! a prif_error_stop unit test fails if this line runs | ||
end program |
This file contains hidden or 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,16 @@ | ||
program error_stop_with_integer_code | ||
use iso_c_binding, only: c_bool | ||
use prif, only : & | ||
prif_init & | ||
,prif_stop & | ||
,prif_error_stop | ||
use unit_test_parameters_m, only : expected_error_stop_code | ||
implicit none | ||
|
||
integer init_exit_code | ||
logical(kind=c_bool), parameter :: false = .false._c_bool | ||
|
||
call prif_init(init_exit_code) | ||
call prif_error_stop(quiet=false, stop_code_int=expected_error_stop_code) ! a prif_error_stop unit test passes if this line executes error termination | ||
call prif_stop(quiet=false) ! a prif_error_stop unit tests fails if this line runs | ||
end program |
This file contains hidden or 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,16 @@ | ||
program error_stop_with_no_code | ||
use iso_c_binding, only: c_bool | ||
use prif, only : & | ||
prif_init & | ||
,prif_stop & | ||
,prif_error_stop | ||
implicit none | ||
|
||
integer init_exit_code | ||
logical(kind=c_bool), parameter :: false = .false._c_bool | ||
|
||
call prif_init(init_exit_code) | ||
call prif_error_stop(quiet=false) ! a prif_error_stop unit test passes if this line correctly executes error termination | ||
call prif_stop(quiet=false, stop_code_char= "program startup failed") ! a prif_error_stop unit test fails if this line runs | ||
rouson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
end program |
This file contains hidden or 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,15 @@ | ||
program stop_with_character_code | ||
use iso_c_binding, only: c_bool | ||
use prif, only : & | ||
prif_init & | ||
,prif_stop & | ||
,prif_error_stop | ||
implicit none | ||
|
||
integer init_exit_code | ||
logical(kind=c_bool), parameter :: false = .false._c_bool | ||
|
||
call prif_init(init_exit_code) | ||
call prif_stop(quiet=false, stop_code_char="") ! a prif_stop unit test passes if this line executes normal termination | ||
rouson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
call prif_error_stop(quiet=false) ! a prif_stop unit test fails if this line runs | ||
end program |
This file contains hidden or 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,14 +1,16 @@ | ||
program stop_with_no_code | ||
program stop_with_integer_code | ||
use iso_c_binding, only: c_bool | ||
use prif, only : prif_init, prif_stop | ||
use prif, only : & | ||
prif_init & | ||
,prif_stop & | ||
,prif_error_stop | ||
use unit_test_parameters_m, only : expected_stop_code | ||
implicit none | ||
|
||
integer :: init_exit_code | ||
integer init_exit_code | ||
logical(kind=c_bool), parameter :: false = .false._c_bool | ||
|
||
call prif_init(init_exit_code) | ||
if (init_exit_code /= 0) error stop "caffeinate returned a non-zero exit_code" | ||
|
||
call prif_stop(.false._c_bool, 1) | ||
|
||
stop 2 ! caffeine/test/zzz_finalization_test.f90 reports a failure if this line runs | ||
call prif_stop(quiet=false, stop_code_int=expected_stop_code) ! a prif_stop unit test passes if this line executes normal termination | ||
call prif_error_stop(quiet=false) ! a prif_stop unit test fails if this line runs | ||
end program |
This file contains hidden or 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,14 +1,15 @@ | ||
program stop_with_no_code | ||
use iso_c_binding, only: c_bool | ||
use prif, only : prif_init, prif_stop | ||
use prif, only : & | ||
prif_init & | ||
,prif_stop & | ||
,prif_error_stop | ||
implicit none | ||
|
||
integer :: init_exit_code | ||
integer init_exit_code | ||
logical(kind=c_bool), parameter :: false = .false._c_bool | ||
|
||
call prif_init(init_exit_code) | ||
if (init_exit_code /= 0) error stop "caffeinate returned a non-zero exit_code" | ||
|
||
call prif_stop(.false._c_bool) | ||
|
||
stop 1 ! caffeine/test/zzz_finalization_test.f90 reports a failure if this line runs | ||
call prif_stop(false) ! a prif_stop test passes if this line executes normal termination | ||
call prif_error_stop(quiet=false) ! a prif_stop test fails if this line runs | ||
end program |
rouson marked this conversation as resolved.
Show resolved
Hide resolved
|
Binary file not shown.
This file contains hidden or 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 hidden or 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,16 @@ | ||
! Copyright (c), The Regents of the University | ||
! Terms of use are as specified in LICENSE.txt | ||
module unit_test_parameters_m | ||
!! Define values for consistent use throughout the test suite | ||
implicit none | ||
|
||
private | ||
public :: expected_stop_code | ||
public :: expected_error_stop_code | ||
|
||
enum, bind(C) | ||
enumerator :: expected_stop_code=99, expected_error_stop_code | ||
! used in stop/error-stop unit tests and example/test-support supporting programs | ||
end enum | ||
|
||
end module unit_test_parameters_m |
rouson marked this conversation as resolved.
Show resolved
Hide resolved
|
Binary file not shown.
rouson marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.