104104 * Objects of this data structure are owned by the library and are treated as a
105105 * black box by the compiler. In the coarray-program the tokens are opaque
106106 * pointers, i.e. black boxes.
107- *
107+ *
108108 * For each coarray (allocatable|save|pointer) (scalar|array|event|lock) a
109109 * token needs to be present. */
110110typedef struct mpi_caf_token_t
@@ -129,20 +129,20 @@ typedef struct mpi_caf_token_t
129129 * component has the allocatable or pointer attribute. The token is reduced in
130130 * size, because the other data is already accessible and has been read from
131131 * the remote to fullfill the request.
132- *
132+ *
133133 * TYPE t
134134 * +------------------+
135135 * | comp * |
136136 * | comp_token * |
137137 * +------------------+
138- *
138+ *
139139 * TYPE(t) : o struct T // the mpi_caf_token to t
140140 * +----------------+
141141 * | ... |
142142 * +----------------+
143- *
143+ *
144144 * o[2]%.comp // using T to get o of [2]
145- *
145+ *
146146 * +-o-on-image-2----+ "copy" of the requierd parts of o[2] on current image
147147 * | 0x4711 | comp * in global_dynamic_window
148148 * | 0x2424 | comp_token * of type slave_token
@@ -415,7 +415,7 @@ static void
415415caf_runtime_error (const char * message , ...)
416416{
417417 va_list ap ;
418- fprintf (stderr , "Fortran runtime error on image %d: " , caf_this_image );
418+ fprintf (stderr , "OpenCoarrays internal error on image %d: " , caf_this_image );
419419 va_start (ap , message );
420420 vfprintf (stderr , message , ap );
421421 va_end (ap );
@@ -1210,7 +1210,7 @@ PREFIX(register) (size_t size, caf_register_t type, caf_token_t *token,
12101210 mem = malloc (actual_size );
12111211 slave_token -> memptr = mem ;
12121212 ierr = MPI_Win_attach (global_dynamic_win , mem , actual_size );
1213- chk_err (ierr );
1213+ chk_err (ierr );
12141214#ifdef EXTRA_DEBUG_OUTPUT
12151215 ierr = MPI_Get_address (mem , & mpi_address ); chk_err (ierr );
12161216#endif
@@ -1941,7 +1941,7 @@ copy_char_to_self(void *src, int src_type, int src_size, int src_kind,
19411941 caf_runtime_error ("internal error: copy_char_to_self() "
19421942 "for non-char types called." );
19431943#endif
1944- const size_t
1944+ const size_t
19451945 dst_len = dst_size / dst_kind ,
19461946 src_len = src_size / src_kind ;
19471947 const size_t min_len = (src_len < dst_len ) ? src_len : dst_len ;
@@ -2022,13 +2022,13 @@ copy_to_self(gfc_descriptor_t *src, int src_kind,
20222022 ? GFC_DESCRIPTOR_SIZE (src ) : 0 , size , stat );
20232023}
20242024
2025- /* token: The token of the array to be written to.
2025+ /* token: The token of the array to be written to.
20262026 * offset: Difference between the coarray base address and the actual data,
2027- * used for caf(3)[2] = 8 or caf[4]%a(4)%b = 7.
2027+ * used for caf(3)[2] = 8 or caf[4]%a(4)%b = 7.
20282028 * image_index: Index of the coarray (typically remote,
2029- * though it can also be on this_image).
2030- * data: Pointer to the to-be-transferred data.
2031- * size: The number of bytes to be transferred.
2029+ * though it can also be on this_image).
2030+ * data: Pointer to the to-be-transferred data.
2031+ * size: The number of bytes to be transferred.
20322032 * asynchronous: Return before the data transfer has been complete */
20332033
20342034void selectType (int size , MPI_Datatype * dt )
@@ -4019,7 +4019,7 @@ do \
40194019(sizeof(gfc_descriptor_t) + (rank) * sizeof(descriptor_dimension))
40204020
40214021/* Define the descriptor of max rank.
4022- *
4022+ *
40234023 * This typedef is made to allow storing a copy of a remote descriptor on the
40244024 * stack without having to care about the rank. */
40254025typedef struct gfc_max_dim_descriptor_t
@@ -4329,7 +4329,7 @@ case kind: \
43294329 ref -> u .a .dim [src_dim ].s .stride ,
43304330 ref -> u .a .dim [src_dim ].s .start ,
43314331 ref -> u .a .dim [src_dim ].s .end );
4332- array_offset_src =
4332+ array_offset_src =
43334333 (ref -> u .a .dim [src_dim ].s .start - src -> dim [src_dim ].lower_bound )
43344334 * src -> dim [src_dim ]._stride ;
43354335 stride_src =
@@ -4588,7 +4588,7 @@ PREFIX(get_by_ref) (caf_token_t token, int image_index,
45884588 bool realloc_required , extent_mismatch = false;
45894589 /* Set when the first non-scalar array reference is encountered. */
45904590 bool in_array_ref = false, array_extent_fixed = false;
4591- /* Set when remote data is to be accessed through the
4591+ /* Set when remote data is to be accessed through the
45924592 * global dynamic window. */
45934593 bool access_data_through_global_win = false;
45944594 /* Set when the remote descriptor is to accessed through the global window. */
@@ -4752,7 +4752,7 @@ case kind: \
47524752 riter -> u .a .dim [i ].s .stride ,
47534753 riter -> u .a .dim [i ].s .start ,
47544754 riter -> u .a .dim [i ].s .end );
4755- remote_memptr +=
4755+ remote_memptr +=
47564756 (riter -> u .a .dim [i ].s .start - src -> dim [i ].lower_bound )
47574757 * src -> dim [i ]._stride * riter -> item_size ;
47584758 break ;
@@ -5532,7 +5532,7 @@ case kind: \
55325532 send_for_ref (ref , i , src_index , mpi_token , dst , src , ds , sr ,
55335533 dst_byte_offset + array_offset_dst * ref -> item_size ,
55345534 desc_byte_offset + array_offset_dst * ref -> item_size ,
5535- dst_kind , src_kind , next_dst_dim , src_dim + 1 ,
5535+ dst_kind , src_kind , next_dst_dim , src_dim + 1 ,
55365536 1 , stat , global_dynamic_win_rank , memptr_win_rank ,
55375537 ds_global , desc_global
55385538#ifdef GCC_GE_8
@@ -5878,7 +5878,7 @@ PREFIX(send_by_ref) (caf_token_t token, int image_index,
58785878 * which is taken care of in the else part. */
58795879 if (access_data_through_global_win )
58805880 {
5881- for (ref_rank = 0 ;
5881+ for (ref_rank = 0 ;
58825882 riter -> u .a .mode [ref_rank ] != CAF_ARR_REF_NONE ; ++ ref_rank ) ;
58835883 /* Get the remote descriptor and use the stack to store it
58845884 * Note, dst may be pointing to mpi_token->desc therefore it
@@ -6271,7 +6271,7 @@ PREFIX(sendget_by_ref) (caf_token_t dst_token, int dst_image_index,
62716271 /* Set when the first non-scalar array reference is encountered. */
62726272 bool in_array_ref = false;
62736273 bool array_extent_fixed = false;
6274- /* Set when remote data is to be accessed through the
6274+ /* Set when remote data is to be accessed through the
62756275 * global dynamic window. */
62766276 bool access_data_through_global_win = false;
62776277 /* Set when the remote descriptor is to accessed through the global window. */
@@ -6447,7 +6447,7 @@ case kind: \
64476447 riter -> u .a .dim [i ].s .stride ,
64486448 riter -> u .a .dim [i ].s .start ,
64496449 riter -> u .a .dim [i ].s .end );
6450- remote_memptr +=
6450+ remote_memptr +=
64516451 (riter -> u .a .dim [i ].s .start - src -> dim [i ].lower_bound )
64526452 * src -> dim [i ]._stride * riter -> item_size ;
64536453 break ;
@@ -6695,7 +6695,7 @@ PREFIX(is_present) (caf_token_t token, int image_index, caf_reference_t *refs)
66956695 break ;
66966696 case CAF_REF_ARRAY :
66976697 {
6698- const gfc_descriptor_t * src =
6698+ const gfc_descriptor_t * src =
66996699 (gfc_descriptor_t * )(mpi_token -> memptr + local_offset );
67006700 for (i = 0 ; riter -> u .a .mode [i ] != CAF_ARR_REF_NONE ; ++ i )
67016701 {
@@ -6855,7 +6855,7 @@ PREFIX(is_present) (caf_token_t token, int image_index, caf_reference_t *refs)
68556855 switch (array_ref )
68566856 {
68576857 case CAF_ARR_REF_FULL :
6858- /* The local_offset stays unchanged when ref'ing the first
6858+ /* The local_offset stays unchanged when ref'ing the first
68596859 * element in a dimension. */
68606860 break ;
68616861 case CAF_ARR_REF_SINGLE :
@@ -7174,11 +7174,11 @@ GEN_REDUCTION(do_max_int1, int8_t,
71747174#endif
71757175
71767176/*
7177- #ifndef MPI_INTEGER2
7178- GEN_REDUCTION(do_sum_int1, int16_t, inoutvec[i] += invec[i])
7177+ #ifndef MPI_INTEGER2
7178+ GEN_REDUCTION(do_sum_int1, int16_t, inoutvec[i] += invec[i])
71797179GEN_REDUCTION(do_min_int1, int16_t,
7180- inoutvec[i] = (invec[i] >= inoutvec[i] ? inoutvec[i] : invec[i]))
7181- GEN_REDUCTION(do_max_int1, int16_t,
7180+ inoutvec[i] = (invec[i] >= inoutvec[i] ? inoutvec[i] : invec[i]))
7181+ GEN_REDUCTION(do_max_int1, int16_t,
71827182 inoutvec[i] = (invec[i] <= inoutvec[i] ? inoutvec[i] : invec[i]))
71837183#endif
71847184*/
@@ -7685,7 +7685,7 @@ PREFIX(atomic_ref) (caf_token_t token, size_t offset,
76857685{
76867686 MPI_Win * p = TOKEN (token );
76877687 MPI_Datatype dt ;
7688- int ierr = 0 ,
7688+ int ierr = 0 ,
76897689 image = (image_index != 0 ) ? image_index - 1 : caf_this_image - 1 ;
76907690
76917691 selectType (kind , & dt );
@@ -7809,7 +7809,7 @@ PREFIX(event_post) (caf_token_t token, size_t index, int image_index,
78097809
78107810#if MPI_VERSION >= 3
78117811 CAF_Win_lock (MPI_LOCK_EXCLUSIVE , image , * p );
7812- ierr = MPI_Accumulate (& value , 1 , MPI_INT , image , index * sizeof (int ), 1 ,
7812+ ierr = MPI_Accumulate (& value , 1 , MPI_INT , image , index * sizeof (int ), 1 ,
78137813 MPI_INT , MPI_SUM , * p ); chk_err (ierr );
78147814 CAF_Win_unlock (image , * p );
78157815#else // MPI_VERSION
@@ -8273,19 +8273,19 @@ void PREFIX(change_team) (caf_team_t *team,
82738273 tmp_used = (caf_used_teams_list * )calloc (1 ,sizeof (caf_used_teams_list ));
82748274 tmp_used -> prev = used_teams ;
82758275
8276- /* We need to look in the teams_list and find the appropriate element.
8277- * This is not efficient but can be easily fixed in the future.
8278- * Instead of keeping track of the communicator in the compiler
8279- * we should keep track of the caf_teams_list element associated with it. */
8276+ /* We need to look in the teams_list and find the appropriate element.
8277+ * This is not efficient but can be easily fixed in the future.
8278+ * Instead of keeping track of the communicator in the compiler
8279+ * we should keep track of the caf_teams_list element associated with it. */
82808280
82818281 /*
8282- tmp_list = teams_list;
8282+ tmp_list = teams_list;
82838283
8284- while (tmp_list)
8285- {
8286- if (tmp_list->team == tmp_team)
8287- break;
8288- tmp_list = tmp_list->prev;
8284+ while (tmp_list)
8285+ {
8286+ if (tmp_list->team == tmp_team)
8287+ break;
8288+ tmp_list = tmp_list->prev;
82898289 }
82908290 */
82918291
0 commit comments