Skip to content

Commit a1264b6

Browse files
committed
Rename caffeine_m to prif_m and update procedure names in tests
1 parent 94c025f commit a1264b6

13 files changed

+129
-129
lines changed

example/hello.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
program hello_world
2-
use caffeine_m, only : prif_caffeinate, this_image => prif_this_image, num_images => prif_num_images, prif_stop
2+
use prif_m, only : prif_caffeinate, this_image => prif_this_image, num_images => prif_num_images, prif_stop
33
implicit none
44

55
if (prif_caffeinate() /= 0) error stop "caffeinate returned a non-zero exit code"

example/support-test/error_stop_character_code.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
program error_stop_character_code
2-
use caffeine_m, only : prif_caffeinate, prif_error_stop
2+
use prif_m, only : prif_caffeinate, prif_error_stop
33
implicit none
44

55
if (prif_caffeinate() /= 0) error stop "caffeinate returned a non-zero exit_code"

example/support-test/error_stop_integer_code.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
program error_stop_integer_code
2-
use caffeine_m, only : prif_caffeinate, prif_error_stop
2+
use prif_m, only : prif_caffeinate, prif_error_stop
33
implicit none
44

55
if (prif_caffeinate() /= 0) error stop "caffeinate returned a non-zero exit_code"

example/support-test/stop_with_integer_code.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
program stop_with_no_code
2-
use caffeine_m, only : prif_caffeinate, prif_stop
2+
use prif_m, only : prif_caffeinate, prif_stop
33
implicit none
44

55
if (prif_caffeinate() /= 0) error stop "caffeinate returned a non-zero exit_code"

example/support-test/stop_with_no_code.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
program stop_with_no_code
2-
use caffeine_m, only : prif_caffeinate, prif_stop
2+
use prif_m, only : prif_caffeinate, prif_stop
33
implicit none
44

55
if (prif_caffeinate() /= 0) error stop "caffeinate returned a non-zero exit_code"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
! Copyright (c), The Regents of the University of California
22
! Terms of use are as specified in LICENSE.txt
3-
module caffeine_m
3+
module prif_m
44
use program_termination_m, only : prif_stop, prif_error_stop
55
use image_enumeration_m, only : prif_this_image, prif_num_images
66
use collective_subroutines_m, only : prif_co_sum, prif_co_max, prif_co_min, prif_co_reduce, prif_co_broadcast
77
use caffeinate_decaffeinate_m, only : prif_caffeinate, prif_decaffeinate
88
use team_type_m, only: prif_form_team, prif_change_team, prif_end_team, prif_team_type
99
use synchronization_m, only : prif_sync_all
1010
implicit none
11-
end module caffeine_m
11+
end module prif_m

test/caf_co_broadcast_test.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module caf_co_broadcast_test
2-
use caffeine_m, only : caf_co_broadcast, caf_num_images, caf_this_image
2+
use prif_m, only : prif_co_broadcast, prif_num_images, prif_this_image
33
use veggies, only : result_t, test_item_t, describe, it, assert_equals, assert_that
44

55
implicit none
66
private
7-
public :: test_caf_co_broadcast
7+
public :: test_prif_co_broadcast
88

99
type object_t
1010
integer i
@@ -19,11 +19,11 @@ module caf_co_broadcast_test
1919

2020
contains
2121

22-
function test_caf_co_broadcast() result(tests)
22+
function test_prif_co_broadcast() result(tests)
2323
type(test_item_t) tests
2424

2525
tests = describe( &
26-
"The caf_co_broadcast subroutine", &
26+
"The prif_co_broadcast subroutine", &
2727
[ it("broadcasts a default integer scalar with no optional arguments present", broadcast_default_integer_scalar) &
2828
,it("broadcasts a derived type scalar with no allocatable components", broadcast_derived_type) &
2929
])
@@ -44,8 +44,8 @@ function broadcast_default_integer_scalar() result(result_)
4444
integer iPhone
4545
integer, parameter :: source_value = 7779311, junk = -99
4646

47-
iPhone = merge(source_value, junk, caf_this_image()==1)
48-
call caf_co_broadcast(iPhone, source_image=1)
47+
iPhone = merge(source_value, junk, prif_this_image()==1)
48+
call prif_co_broadcast(iPhone, source_image=1)
4949
result_ = assert_equals(source_value, iPhone)
5050
end function
5151

@@ -54,11 +54,11 @@ function broadcast_derived_type() result(result_)
5454
type(object_t) object
5555

5656

57-
associate(me => caf_this_image(), ni => caf_num_images())
57+
associate(me => prif_this_image(), ni => prif_num_images())
5858

5959
object = object_t(me, .false., "gooey", me*(1.,0.))
6060

61-
call caf_co_broadcast(object, source_image=ni)
61+
call prif_co_broadcast(object, source_image=ni)
6262

6363
associate(expected_object => object_t(ni, .false., "gooey", ni*(1.,0.)))
6464
result_ = assert_that(expected_object == object, "co_broadcast derived type")

test/caf_co_max_test.f90

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
module caf_co_max_test
2-
use caffeine_m, only : caf_co_max, caf_num_images
2+
use prif_m, only : prif_co_max, prif_num_images
33
use veggies, only: result_t, test_item_t, assert_equals, describe, it, assert_that, assert_equals
4-
use image_enumeration_m, only : caf_this_image, caf_num_images
4+
use image_enumeration_m, only : prif_this_image, prif_num_images
55

66
implicit none
77
private
8-
public :: test_caf_co_max
8+
public :: test_prif_co_max
99

1010
contains
11-
function test_caf_co_max() result(tests)
11+
function test_prif_co_max() result(tests)
1212
type(test_item_t) tests
1313

1414
tests = describe( &
15-
"The caf_co_max subroutine computes the maximum", &
15+
"The prif_co_max subroutine computes the maximum", &
1616
[ it("default integer scalar with stat argument present", max_default_integer_scalars) &
1717
,it("integer(c_int64_t) scalar with no optional arguments present", max_c_int64_scalars) &
1818
,it("default integer 1D array elements with no optional arguments present", max_default_integer_1D_array) &
@@ -30,8 +30,8 @@ function max_default_integer_scalars() result(result_)
3030
integer i, status_
3131

3232
status_ = -1
33-
i = -caf_this_image()
34-
call caf_co_max(i, stat=status_)
33+
i = -prif_this_image()
34+
call prif_co_max(i, stat=status_)
3535
result_ = assert_equals(-1, i) .and. assert_equals(0, status_)
3636
end function
3737

@@ -40,20 +40,20 @@ function max_c_int64_scalars() result(result_)
4040
type(result_t) result_
4141
integer(c_int64_t) i
4242

43-
i = caf_this_image()
44-
call caf_co_max(i)
45-
result_ = assert_equals(caf_num_images(), int(i))
43+
i = prif_this_image()
44+
call prif_co_max(i)
45+
result_ = assert_equals(prif_num_images(), int(i))
4646
end function
4747

4848
function max_default_integer_1D_array() result(result_)
4949
type(result_t) result_
5050
integer i
5151
integer, allocatable :: array(:)
5252

53-
associate(sequence_ => caf_this_image()*[(i, i=1, caf_num_images())])
53+
associate(sequence_ => prif_this_image()*[(i, i=1, prif_num_images())])
5454
array = sequence_
55-
call caf_co_max(array)
56-
associate(max_sequence => caf_num_images()*[(i, i=1, caf_num_images())])
55+
call prif_co_max(array)
56+
associate(max_sequence => prif_num_images()*[(i, i=1, prif_num_images())])
5757
result_ = assert_that(all(max_sequence == array))
5858
end associate
5959
end associate
@@ -64,9 +64,9 @@ function max_default_integer_7D_array() result(result_)
6464
integer array(2,1,1, 1,1,1, 2), status_
6565

6666
status_ = -1
67-
array = 3 + caf_this_image()
68-
call caf_co_max(array, stat=status_)
69-
result_ = assert_that(all(array == 3+caf_num_images())) .and. assert_equals(0, status_)
67+
array = 3 + prif_this_image()
68+
call prif_co_max(array, stat=status_)
69+
result_ = assert_that(all(array == 3+prif_num_images())) .and. assert_equals(0, status_)
7070
end function
7171

7272
function max_default_real_scalars() result(result_)
@@ -76,8 +76,8 @@ function max_default_real_scalars() result(result_)
7676
integer status_
7777

7878
status_ = -1
79-
scalar = -pi*caf_this_image()
80-
call caf_co_max(scalar, stat=status_)
79+
scalar = -pi*prif_this_image()
80+
call prif_co_max(scalar, stat=status_)
8181
result_ = assert_equals(-dble(pi), dble(scalar) ) .and. assert_equals(0, status_)
8282
end function
8383

@@ -86,8 +86,8 @@ function max_double_precision_2D_array() result(result_)
8686
double precision, allocatable :: array(:,:)
8787
double precision, parameter :: tent(*,*) = dble(reshape(-[0,1,2,3,2,1], [3,2]))
8888

89-
array = tent*dble(caf_this_image())
90-
call caf_co_max(array)
89+
array = tent*dble(prif_this_image())
90+
call prif_co_max(array)
9191
result_ = assert_that(all(array==tent))
9292
end function
9393

@@ -104,15 +104,15 @@ function max_elements_in_3D_string_arrays() result(result_)
104104
end associate
105105

106106
co_max_scramlet = scramlet
107-
call caf_co_max(co_max_scramlet, result_image=1)
107+
call prif_co_max(co_max_scramlet, result_image=1)
108108

109109
block
110110
integer j, delta_j
111111
character(len=len(script)) expected_script(size(script)), expected_scramlet(size(scramlet,1),size(scramlet,2))
112112

113113
do j=1, size(script)
114114
expected_script(j) = script(j)
115-
do delta_j = 1, max(caf_num_images()-1, size(script))
115+
do delta_j = 1, max(prif_num_images()-1, size(script))
116116
associate(periodic_index => 1 + mod(j+delta_j-1, size(script)))
117117
expected_script(j) = max(expected_script(j), script(periodic_index))
118118
end associate
@@ -130,14 +130,14 @@ function reverse_alphabetize_default_character_scalars() result(result_)
130130
character(len=*), parameter :: words(*) = [character(len=len("loddy")):: "loddy","doddy","we","like","to","party"]
131131
character(len=:), allocatable :: my_word
132132

133-
associate(me => caf_this_image())
133+
associate(me => prif_this_image())
134134
associate(periodic_index => 1 + mod(me-1,size(words)))
135135
my_word = words(periodic_index)
136-
call caf_co_max(my_word)
136+
call prif_co_max(my_word)
137137
end associate
138138
end associate
139139

140-
associate(expected_word => maxval(words(1:min(caf_num_images(), size(words)))))
140+
associate(expected_word => maxval(words(1:min(prif_num_images(), size(words)))))
141141
result_ = assert_equals(expected_word, my_word)
142142
end associate
143143
end function

test/caf_co_min_test.f90

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
module caf_co_min_test
2-
use caffeine_m, only : caf_co_min, caf_num_images
2+
use prif_m, only : prif_co_min, prif_num_images
33
use veggies, only: result_t, test_item_t, assert_equals, describe, it, assert_that, assert_equals, succeed
4-
use image_enumeration_m, only : caf_this_image, caf_num_images
4+
use image_enumeration_m, only : prif_this_image, prif_num_images
55

66
implicit none
77
private
8-
public :: test_caf_co_min
8+
public :: test_prif_co_min
99

1010
contains
11-
function test_caf_co_min() result(tests)
11+
function test_prif_co_min() result(tests)
1212
type(test_item_t) tests
1313

1414
tests = describe( &
15-
"The caf_co_min subroutine computes the minimum", &
15+
"The prif_co_min subroutine computes the minimum", &
1616
[ it("default integer scalar with stat argument present", min_default_integer_scalars) &
1717
,it("integer(c_int64_t) scalar with no optional arguments present", min_c_int64_scalars) &
1818
,it("default integer 1D array elements with no optional arguments present", min_default_integer_1D_array) &
@@ -30,18 +30,18 @@ function min_default_integer_scalars() result(result_)
3030
integer i, status_
3131

3232
status_ = -1
33-
i = -caf_this_image()
34-
call caf_co_min(i, stat=status_)
35-
result_ = assert_equals(-caf_num_images(), i) .and. assert_equals(0, status_)
33+
i = -prif_this_image()
34+
call prif_co_min(i, stat=status_)
35+
result_ = assert_equals(-prif_num_images(), i) .and. assert_equals(0, status_)
3636
end function
3737

3838
function min_c_int64_scalars() result(result_)
3939
use iso_c_binding, only : c_int64_t
4040
type(result_t) result_
4141
integer(c_int64_t) i
4242

43-
i = caf_this_image()
44-
call caf_co_min(i)
43+
i = prif_this_image()
44+
call prif_co_min(i)
4545
result_ = assert_equals(1, int(i))
4646
end function
4747

@@ -50,10 +50,10 @@ function min_default_integer_1D_array() result(result_)
5050
integer i
5151
integer, allocatable :: array(:)
5252

53-
associate(sequence_ => caf_this_image()*[(i, i=1, caf_num_images())])
53+
associate(sequence_ => prif_this_image()*[(i, i=1, prif_num_images())])
5454
array = sequence_
55-
call caf_co_min(array)
56-
associate(min_sequence => [(i, i=1, caf_num_images())])
55+
call prif_co_min(array)
56+
associate(min_sequence => [(i, i=1, prif_num_images())])
5757
result_ = assert_that(all(min_sequence == array))
5858
end associate
5959
end associate
@@ -64,9 +64,9 @@ function min_default_integer_7D_array() result(result_)
6464
integer array(2,1,1, 1,1,1, 2), status_
6565

6666
status_ = -1
67-
array = 3 - caf_this_image()
68-
call caf_co_min(array, stat=status_)
69-
result_ = assert_that(all(array == 3 - caf_num_images())) .and. assert_equals(0, status_)
67+
array = 3 - prif_this_image()
68+
call prif_co_min(array, stat=status_)
69+
result_ = assert_that(all(array == 3 - prif_num_images())) .and. assert_equals(0, status_)
7070
end function
7171

7272
function min_default_real_scalars() result(result_)
@@ -76,19 +76,19 @@ function min_default_real_scalars() result(result_)
7676
integer status_
7777

7878
status_ = -1
79-
scalar = -pi*caf_this_image()
80-
call caf_co_min(scalar, stat=status_)
81-
result_ = assert_equals(-dble(pi*caf_num_images()), dble(scalar) ) .and. assert_equals(0, status_)
79+
scalar = -pi*prif_this_image()
80+
call prif_co_min(scalar, stat=status_)
81+
result_ = assert_equals(-dble(pi*prif_num_images()), dble(scalar) ) .and. assert_equals(0, status_)
8282
end function
8383

8484
function min_double_precision_2D_array() result(result_)
8585
type(result_t) result_
8686
double precision, allocatable :: array(:,:)
8787
double precision, parameter :: tent(*,*) = dble(reshape(-[0,1,2,3,2,1], [3,2]))
8888

89-
array = tent*dble(caf_this_image())
90-
call caf_co_min(array)
91-
result_ = assert_that(all(array==tent*caf_num_images()))
89+
array = tent*dble(prif_this_image())
90+
call prif_co_min(array)
91+
result_ = assert_that(all(array==tent*prif_num_images()))
9292
end function
9393

9494
function min_elements_in_2D_string_arrays() result(result_)
@@ -105,15 +105,15 @@ function min_elements_in_2D_string_arrays() result(result_)
105105
end associate
106106

107107
co_min_scramlet = scramlet
108-
call caf_co_min(co_min_scramlet, result_image=1)
108+
call prif_co_min(co_min_scramlet, result_image=1)
109109

110110
block
111111
integer j, delta_j
112112
character(len=len(script)) expected_script(size(script)), expected_scramlet(size(scramlet,1),size(scramlet,2))
113113

114114
do j=1, size(script)
115115
expected_script(j) = script(j)
116-
do delta_j = 1, min(caf_num_images()-1, size(script))
116+
do delta_j = 1, min(prif_num_images()-1, size(script))
117117
associate(periodic_index => 1 + mod(j+delta_j-1, size(script)))
118118
expected_script(j) = min(expected_script(j), script(periodic_index))
119119
end associate
@@ -131,14 +131,14 @@ function alphabetically_1st_scalar_string() result(result_)
131131
character(len=*), parameter :: words(*) = [character(len=len("to party!")):: "Loddy","doddy","we","like","to party!"]
132132
character(len=:), allocatable :: my_word
133133

134-
associate(me => caf_this_image())
134+
associate(me => prif_this_image())
135135
associate(periodic_index => 1 + mod(me-1,size(words)))
136136
my_word = words(periodic_index)
137-
call caf_co_min(my_word)
137+
call prif_co_min(my_word)
138138
end associate
139139
end associate
140140

141-
associate(expected_word => minval(words(1:min(caf_num_images(), size(words)))))
141+
associate(expected_word => minval(words(1:min(prif_num_images(), size(words)))))
142142
result_ = assert_equals(expected_word, my_word)
143143
end associate
144144
end function

0 commit comments

Comments
 (0)