Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/caffeine/program_termination_s.f90
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ subroutine prif_error_stop_integer(quiet, stop_code)

if (present(stop_code)) then
if (.not.quiet) then
write(error_unit) "ERROR STOP ", stop_code
write(error_unit,'(A, I0)') "ERROR STOP ", stop_code
flush error_unit
end if
exit_code = stop_code
else
if (.not.quiet) then
write(error_unit) "ERROR STOP"
write(error_unit,'(a)') "ERROR STOP"
flush error_unit
end if
exit_code = 1_c_int
Expand Down
23 changes: 13 additions & 10 deletions test/caf_co_max_test.f90
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,24 @@ function max_double_precision_2D_array() result(result_)
function max_elements_in_2D_string_arrays() result(result_)
type(result_t) result_
character(len=*), parameter :: script(*,*,*) = reshape( &
[ "To be ","or not " &
, "to ","be. " &

, "that ","is " &
, "the ","question"], &
[ "To be ","or not " & ! images with odd image
, "to ","be. " & ! numbers get this slice
! ----------------------
, "that ","is " & ! images with even image
, "the ","question"], & ! numbers get this slice
[2,2,2])
character(len=len(script)), dimension(size(script,1),size(script,2)) :: scramlet, expected
character(len=len(script)), dimension(size(script,1),size(script,2)) :: slice
integer me, ni

call prif_this_image_no_coarray(this_image=me)
call prif_num_images(ni)
scramlet = script(:,:,mod(me,size(script,3))+1)
call prif_co_max(scramlet)
expected = maxval(script(:,:,1:min(ni,size(script,3))), dim=3)
result_ = assert_that(all(expected == scramlet),"all(expected == scramlet)")
associate(slice_number => mod(me-1,size(script,3)) + 1)
slice = script(:,:,slice_number)
end associate
call prif_co_max(slice)
associate(expected => maxval(script(:,:,1:min(ni,size(script,3))), dim=3))
result_ = assert_that(all(expected == slice),"all(expected == scramlet)")
end associate
end function

function reverse_alphabetize_default_character_scalars() result(result_)
Expand Down
23 changes: 13 additions & 10 deletions test/caf_co_min_test.f90
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,24 @@ function min_double_precision_2D_array() result(result_)
function min_elements_in_2D_string_arrays() result(result_)
type(result_t) result_
character(len=*), parameter :: script(*,*,*) = reshape( &
[ "To be ","or not " &
, "to ","be. " &

, "that ","is " &
, "the ","question"], &
[ "To be ","or not " & ! images with odd image
, "to ","be. " & ! numbers get this slice
! ----------------------
, "that ","is " & ! images with even image
, "the ","question"], & ! numbers get this slice
[2,2,2])
character(len=len(script)), dimension(size(script,1),size(script,2)) :: scramlet, expected
character(len=len(script)), dimension(size(script,1),size(script,2)) :: slice
integer me, ni

call prif_this_image_no_coarray(this_image=me)
call prif_num_images(ni)
scramlet = script(:,:,mod(me,size(script,3))+1)
call prif_co_min(scramlet)
expected = minval(script(:,:,1:min(ni,size(script,3))), dim=3)
result_ = assert_that(all(expected == scramlet),"all(expected == scramlet)")
associate(slice_number => mod(me-1,size(script,3)) + 1)
slice = script(:,:,slice_number)
end associate
call prif_co_min(slice)
associate(expected => minval(script(:,:,1:min(ni,size(script,3))), dim=3))
result_ = assert_that(all(expected == slice),"all(expected == scramlet)")
end associate
end function

function alphabetically_1st_scalar_string() result(result_)
Expand Down