Skip to content

Commit a634126

Browse files
committed
refac(repoerting): use association, document syncs
1 parent 6adf9f0 commit a634126

1 file changed

Lines changed: 24 additions & 23 deletions

File tree

src/julienne/julienne_test_result_s.F90

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,40 +26,41 @@
2626

2727
module procedure co_characterize
2828

29-
logical i_skipped, i_passed
29+
logical i_passed
3030
integer, parameter :: skips=1, passes=2
3131
integer tally(skips:passes)
3232
character(len=*), parameter :: indent = " "
3333

34-
i_skipped = .not. allocated(self%diagnosis_)
34+
associate(i_skipped => .not. allocated(self%diagnosis_))
3535

36-
if (i_skipped) then
37-
i_passed = .false.
38-
else
39-
i_passed = self%diagnosis_%test_passed()
40-
end if
41-
42-
tally = [merge(1,0,i_skipped), merge(1,0,i_passed)]
43-
call co_sum(tally)
44-
45-
associate(me => this_image(), images => num_images(), images_skipped => tally(skips), images_passed => tally(passes))
46-
call_julienne_assert(any(images_skipped == [0,images]))
4736
if (i_skipped) then
48-
if (me==1) print '(a)', indent // "SKIPS on " // trim(self%description_%string()) // "."
37+
i_passed = .false.
4938
else
50-
if (me==1) print '(a)', indent // merge("passes on ", "FAILS on ", images_passed == images) // trim(self%description_%string()) // "."
39+
i_passed = self%diagnosis_%test_passed()
40+
end if
41+
42+
tally = [merge(1,0,i_skipped), merge(1,0,i_passed)]
43+
call co_sum(tally)
44+
45+
associate(me => this_image(), images => num_images(), images_skipped => tally(skips), images_passed => tally(passes))
46+
call_julienne_assert(any(images_skipped == [0,images]))
47+
if (i_skipped) then
48+
if (me==1) print '(a)', indent // "SKIPS on " // trim(self%description_%string()) // "."
49+
else
50+
if (me==1) print '(a)', indent // merge("passes on ", "FAILS on ", images_passed == images) // trim(self%description_%string()) // "."
5151
#if ! ASYNCHRONOUS_DIAGNOSTICS
52-
sync all
52+
sync all ! ensure image 1 reports/prints outcome before any failure diagnostics print
5353
#endif
54-
if ((.not. i_skipped) .and. (.not. i_passed)) then
55-
associate(image => string_t(me))
56-
print '(a)', indent // indent // "diagnostics on image " // image%string() // ": " // self%diagnosis_%diagnostics_string()
57-
end associate
58-
end if
54+
if ((.not. i_skipped) .and. (.not. i_passed)) then
55+
associate(image => string_t(me))
56+
print '(a)', indent // indent // "diagnostics on image " // image%string() // ": " // self%diagnosis_%diagnostics_string()
57+
end associate
58+
end if
5959
#if ! ASYNCHRONOUS_DIAGNOSTICS
60-
sync all
60+
sync all ! ensure all images print failure diagnostics, if any, before any image moves on to the next test
6161
#endif
62-
end if
62+
end if
63+
end associate
6364
end associate
6465
end procedure
6566

0 commit comments

Comments
 (0)