Skip to content

Commit f6f57e8

Browse files
authored
Merge pull request #45 from BerkeleyLab/update-names
Update names based on new naming convention with `prif` and `caffeine`
2 parents 7da3f4e + 7722251 commit f6f57e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+400
-407
lines changed

example/hello.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
program hello_world
2-
use caffeine_m, only : caf_caffeinate, this_image => caf_this_image, num_images => caf_num_images, caf_stop
2+
use prif, only : prif_init, this_image => prif_this_image, num_images => prif_num_images, prif_stop
33
implicit none
44

5-
if (caf_caffeinate() /= 0) error stop "caffeinate returned a non-zero exit code"
5+
if (prif_init() /= 0) error stop "caffeinate returned a non-zero exit code"
66

77
print *, "Hello from image", this_image(), "of", num_images()
88

9-
call caf_stop(stop_code=0) ! normal termination
9+
call prif_stop(stop_code=0) ! normal termination
1010

1111
end program
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
program error_stop_character_code
2-
use caffeine_m, only : caf_caffeinate, caf_error_stop
2+
use prif, only : prif_init, prif_error_stop
33
implicit none
44

5-
if (caf_caffeinate() /= 0) error stop "caffeinate returned a non-zero exit_code"
5+
if (prif_init() /= 0) error stop "caffeinate returned a non-zero exit_code"
66

7-
call caf_error_stop("Oh snap!")
7+
call prif_error_stop("Oh snap!")
88

99
stop 0 ! ../../test/caf_error_stop_test.f90 will report a test failure if this line runs
1010
end program
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
program error_stop_integer_code
2-
use caffeine_m, only : caf_caffeinate, caf_error_stop
2+
use prif, only : prif_init, prif_error_stop
33
implicit none
44

5-
if (caf_caffeinate() /= 0) error stop "caffeinate returned a non-zero exit_code"
5+
if (prif_init() /= 0) error stop "caffeinate returned a non-zero exit_code"
66

7-
call caf_error_stop(1)
7+
call prif_error_stop(1)
88

99
stop 0 ! caffeine/test/caf_error_stop_test.f90 reports a failure if this line runs
10-
end program
10+
end program
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
program stop_with_no_code
2-
use caffeine_m, only : caf_caffeinate, caf_stop
2+
use prif, only : prif_init, prif_stop
33
implicit none
44

5-
if (caf_caffeinate() /= 0) error stop "caffeinate returned a non-zero exit_code"
5+
if (prif_init() /= 0) error stop "caffeinate returned a non-zero exit_code"
66

7-
call caf_stop(1)
7+
call prif_stop(1)
88

99
stop 2 ! caffeine/test/zzz_finalization_test.f90 reports a failure if this line runs
1010
end program
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
program stop_with_no_code
2-
use caffeine_m, only : caf_caffeinate, caf_stop
2+
use prif, only : prif_init, prif_stop
33
implicit none
44

5-
if (caf_caffeinate() /= 0) error stop "caffeinate returned a non-zero exit_code"
5+
if (prif_init() /= 0) error stop "caffeinate returned a non-zero exit_code"
66

7-
call caf_stop
7+
call prif_stop
88

99
stop 1 ! caffeine/test/zzz_finalization_test.f90 reports a failure if this line runs
1010
end program

src/caffeine/assert/assert_s.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
module procedure assert
1313
use caffeine_characterizable_m, only : characterizable_t
14-
use program_termination_m, only: caf_error_stop
15-
use image_enumeration_m, only: this_image => caf_this_image
14+
use program_termination_m, only: prif_error_stop
15+
use image_enumeration_m, only: this_image => prif_this_image
1616

1717
character(len=:), allocatable :: header, trailer
1818

@@ -52,7 +52,7 @@
5252

5353
end if represent_diagnostics_as_string
5454

55-
call caf_error_stop(header // ' with diagnostic data "' // trailer // '"')
55+
call prif_error_stop(header // ' with diagnostic data "' // trailer // '"')
5656

5757
end if check_assertion
5858

@@ -77,7 +77,7 @@ pure function string(numeric) result(number_as_string)
7777
type is(real)
7878
write(untrimmed_string, *) numeric
7979
class default
80-
call caf_error_stop("Internal error in subroutine 'assert': unsupported type in function 'string'.")
80+
call prif_error_stop("Internal error in subroutine 'assert': unsupported type in function 'string'.")
8181
end select
8282

8383
number_as_string = trim(adjustl(untrimmed_string))

src/caffeine/assert/intrinsic_array_s.F90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
submodule(caffeine_intrinsic_array_m) caffeine_intrinsic_array_s
2-
use program_termination_m, only: caf_error_stop
2+
use program_termination_m, only: prif_error_stop
33
implicit none
44

55
contains
@@ -22,7 +22,7 @@
2222
type is(double precision)
2323
intrinsic_array%double_precision_1D = array
2424
class default
25-
call caf_error_stop("intrinsic_array_t construct: unsupported rank-2 type")
25+
call prif_error_stop("intrinsic_array_t construct: unsupported rank-2 type")
2626
end select
2727
#ifndef NAGFOR
2828
rank(2)
@@ -38,7 +38,7 @@
3838
type is(double precision)
3939
intrinsic_array%double_precision_2D = array
4040
class default
41-
call caf_error_stop("intrinsic_array_t construct: unsupported rank-2 type")
41+
call prif_error_stop("intrinsic_array_t construct: unsupported rank-2 type")
4242
end select
4343

4444
rank(3)
@@ -54,11 +54,11 @@
5454
type is(double precision)
5555
intrinsic_array%double_precision_3D = array
5656
class default
57-
call caf_error_stop("intrinsic_array_t construct: unsupported rank-3 type")
57+
call prif_error_stop("intrinsic_array_t construct: unsupported rank-3 type")
5858
end select
5959

6060
rank default
61-
call caf_error_stop("intrinsic_array_t construct: unsupported rank")
61+
call prif_error_stop("intrinsic_array_t construct: unsupported rank")
6262
end select
6363
#endif
6464

@@ -74,7 +74,7 @@
7474
allocated(self%logical_2D), allocated(self%real_2D), &
7575
allocated(self%complex_3D), allocated(self%complex_double_3D), allocated(self%integer_3D), &
7676
allocated(self%logical_3D), allocated(self%real_3D) &
77-
])) call caf_error_stop("intrinsic_array_t as_character: ambiguous component allocation status.")
77+
])) call prif_error_stop("intrinsic_array_t as_character: ambiguous component allocation status.")
7878

7979
if (allocated(self%complex_1D)) then
8080
character_self = repeat(" ", ncopies = single_number_width*size(self%complex_1D))

src/caffeine/caffeinate_decaffeinate_m.f90

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/caffeine/caffeine.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static gex_Rank_t rank, size;
2121
const int double_Complex_workaround =4100;
2222
#endif
2323

24-
void caf_c_caffeinate(int argc, char *argv[])
24+
void caf_caffeinate(int argc, char *argv[])
2525
{
2626
GASNET_SAFE(gex_Client_Init(&myclient, &myep, &myteam, "caffeine", &argc, &argv, 0));
2727

@@ -42,28 +42,28 @@ void caf_c_caffeinate(int argc, char *argv[])
4242
GASNET_SAFE(gex_Segment_Attach(&mysegment, myteam, segsz));
4343
}
4444

45-
void caf_c_decaffeinate(int exit_code)
45+
void caf_decaffeinate(int exit_code)
4646
{
4747
gasnet_exit(exit_code);
4848
}
4949

50-
int caf_c_this_image()
50+
int caf_this_image()
5151
{
5252
return gex_TM_QueryRank(myteam) + 1;
5353
}
5454

55-
int caf_c_num_images()
55+
int caf_num_images()
5656
{
5757
return gex_TM_QuerySize(myteam);
5858
}
5959

60-
void caf_c_sync_all()
60+
void caf_sync_all()
6161
{
6262
gasnet_barrier_notify(0,GASNET_BARRIERFLAG_ANONYMOUS);
6363
gasnet_barrier_wait(0,GASNET_BARRIERFLAG_ANONYMOUS);
6464
}
6565

66-
void caf_c_co_reduce(
66+
void caf_co_reduce(
6767
CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg, int num_elements, gex_Coll_ReduceFn_t* user_op, void* client_data
6868
)
6969
{
@@ -85,7 +85,7 @@ void caf_c_co_reduce(
8585
if (stat != NULL) *stat = 0;
8686
}
8787

88-
void caf_c_co_broadcast(CFI_cdesc_t * a_desc, int source_image, int* stat, int num_elements)
88+
void caf_co_broadcast(CFI_cdesc_t * a_desc, int source_image, int* stat, int num_elements)
8989
{
9090
char* c_loc_a = (char*) a_desc->base_addr;
9191
size_t c_sizeof_a = a_desc->elem_len;
@@ -117,7 +117,7 @@ void set_stat_errmsg_or_abort(int* stat, char* errmsg, const int return_stat, co
117117
}
118118
}
119119

120-
void caf_c_co_max(CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg, size_t num_elements)
120+
void caf_co_max(CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg, size_t num_elements)
121121
{
122122
gex_DT_t a_type;
123123

@@ -147,7 +147,7 @@ void caf_c_co_max(CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg
147147
if (stat != NULL) *stat = 0;
148148
}
149149

150-
void caf_c_co_min(CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg, size_t num_elements)
150+
void caf_co_min(CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg, size_t num_elements)
151151
{
152152
gex_DT_t a_type;
153153

@@ -177,7 +177,7 @@ void caf_c_co_min(CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg
177177
if (stat != NULL) *stat = 0;
178178
}
179179

180-
void caf_c_co_sum(CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg, size_t num_elements)
180+
void caf_co_sum(CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg, size_t num_elements)
181181
{
182182
gex_DT_t a_type;
183183

@@ -209,18 +209,18 @@ void caf_c_co_sum(CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg
209209
if (stat != NULL) *stat = 0;
210210
}
211211

212-
bool caf_c_same_cfi_type(CFI_cdesc_t* a_desc, CFI_cdesc_t* b_desc)
212+
bool caf_same_cfi_type(CFI_cdesc_t* a_desc, CFI_cdesc_t* b_desc)
213213
{
214214
if (a_desc->type == b_desc->type) return true;
215215
return false;
216216
}
217217

218-
size_t caf_c_elem_len(CFI_cdesc_t* a_desc)
218+
size_t caf_elem_len(CFI_cdesc_t* a_desc)
219219
{
220220
return a_desc->elem_len;
221221
}
222222

223-
bool caf_c_numeric_type(CFI_cdesc_t* a_desc)
223+
bool caf_numeric_type(CFI_cdesc_t* a_desc)
224224
{
225225
switch (a_desc->type)
226226
{
@@ -235,12 +235,12 @@ bool caf_c_numeric_type(CFI_cdesc_t* a_desc)
235235
}
236236

237237
#ifdef __GNUC__
238-
bool caf_c_is_f_string(CFI_cdesc_t* a_desc){
238+
bool caf_is_f_string(CFI_cdesc_t* a_desc){
239239
if ( (a_desc->type - 5) % 256 == 0) return true;
240240
return false;
241241
}
242242
#else // The code below is untested but believed to conform with the Fortran 2018 standard.
243-
bool caf_c_is_f_string(CFI_cdesc_t* a_desc){
243+
bool caf_is_f_string(CFI_cdesc_t* a_desc){
244244
if (a_desc->type == CFI_type_char) return true;
245245
return false;
246246
}

src/caffeine/caffeine.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,48 +16,48 @@ enum {
1616

1717
// Program launch and finalization
1818

19-
void caf_c_caffeinate(int argc, char *argv[]);
20-
void caf_c_decaffeinate(int exit_code);
19+
void caf_caffeinate(int argc, char *argv[]);
20+
void caf_decaffeinate(int exit_code);
2121

2222
// Image enumeration
2323

24-
int caf_c_this_image();
25-
int caf_c_num_images();
24+
int caf_this_image();
25+
int caf_num_images();
2626

2727
// Synchronization
2828

29-
void caf_c_sync_all();
29+
void caf_sync_all();
3030

3131
// _______ Collective Subroutines _______
3232

33-
void caf_c_co_reduce(
33+
void caf_co_reduce(
3434
CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg, int num_elements, gex_Coll_ReduceFn_t* user_op, void* client_data
3535
);
3636

37-
void caf_c_co_broadcast(
37+
void caf_co_broadcast(
3838
CFI_cdesc_t * a_desc, int source_image, int* stat, int num_elements
3939
);
4040

41-
void caf_c_co_sum(
41+
void caf_co_sum(
4242
CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg, size_t num_elements
4343
);
4444

45-
void caf_c_co_min(
45+
void caf_co_min(
4646
CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg, size_t num_elements
4747
);
4848

49-
void caf_c_co_max(
49+
void caf_co_max(
5050
CFI_cdesc_t* a_desc, int result_image, int* stat, char* errmsg, size_t num_elements
5151
);
5252

5353
// ____________ Utilities ____________
5454

55-
bool caf_c_same_cfi_type(CFI_cdesc_t* a_desc, CFI_cdesc_t* b_desc);
55+
bool caf_same_cfi_type(CFI_cdesc_t* a_desc, CFI_cdesc_t* b_desc);
5656

57-
bool caf_c_numeric_type(CFI_cdesc_t* a_desc);
57+
bool caf_numeric_type(CFI_cdesc_t* a_desc);
5858

59-
bool caf_c_is_f_string(CFI_cdesc_t* a_desc);
59+
bool caf_is_f_string(CFI_cdesc_t* a_desc);
6060

61-
size_t caf_c_elem_len(CFI_cdesc_t* a_desc);
61+
size_t caf_elem_len(CFI_cdesc_t* a_desc);
6262

6363
#endif // CAFFEINE_H

0 commit comments

Comments
 (0)