Skip to content
Closed
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
37 changes: 28 additions & 9 deletions src/julienne/julienne_test_harness_s.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "language-support.F90"

submodule(julienne_test_harness_m) julienne_test_harness_s
use iso_fortran_env, only : int64, real64
use iso_fortran_env, only : int32, real32
use julienne_command_line_m, only : command_line_t
use julienne_string_m, only : string_t
use julienne_multi_image_m, only : internal_this_image, internal_num_images, internal_error_stop
Expand All @@ -23,8 +23,7 @@
module procedure report_results

integer i, passes, tests, skips
integer(int64) start_time, end_time, clock_rate
integer, parameter :: ms_per_sec = 1000
integer(int32) start_time, end_time, clock_rate

passes=0; tests=0; skips=0

Expand All @@ -35,17 +34,14 @@
call self%test_fixture_(i)%report(passes, tests, skips)
end do

call do_random_time_consuming_stuff

call system_clock(end_time)

associate(me => internal_this_image(), image_count => internal_num_images())
if (me==1) then
print *
#if defined(__flang__) && !defined(__linux__)
! workaround issue 155 observed on flang + macOS
print '(a,f0.3,a)', "Test-suite run time: ", (end_time - start_time)/(real(clock_rate, real64)*ms_per_sec), " seconds"
#else
print '(a,f0.3,a)', "Test-suite run time: ", (end_time - start_time)/ real(clock_rate, real64 ), " seconds"
#endif
print '(a,f0.3,a)', "Test-suite run time: ", (end_time - start_time)/(real(clock_rate, real32)), " seconds"
print '(a,i0)', "Number of images: ", image_count
print *
print '(*(a,:,i0))', "_____ ", passes, " of ", tests, " tests passed. ", skips, " tests were skipped _____"
Expand All @@ -54,6 +50,29 @@
if (passes + skips /= tests .and. me==1) call internal_error_stop("Some tests failed.")
end associate

contains

subroutine do_random_time_consuming_stuff
use iso_fortran_env, only : int64, real64
implicit none
integer(int64) start_time, end_time, clock_rate, i
integer, parameter :: N = 256
real(real64) A(N,N), B(N,N), C(N,N)

call random_init(repeatable=.true., image_distinct=.true.)
call random_number(A)
call random_number(B)
call random_number(C)

do i = 1, 1000
A = matmul(B,C)
end do

print *,"maxval(A) = ", maxval(A)

end subroutine


end procedure

subroutine print_usage_info_and_stop_if_requested
Expand Down