Skip to content

Commit fb39966

Browse files
authored
Merge branch 'master' into issue-550-errno-fix
2 parents 915720e + 81f1114 commit fb39966

File tree

5 files changed

+5865
-5620
lines changed

5 files changed

+5865
-5620
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ if(opencoarrays_aware_compiler)
786786
add_caf_test(issue-488-multi-dim-cobounds-false 8 issue-488-multi-dim-cobounds false)
787787
add_caf_test(issue-503-multidim-array-broadcast 2 issue-503-multidim-array-broadcast)
788788
add_caf_test(issue-503-non-contig-red-ndarray 2 issue-503-non-contig-red-ndarray)
789+
add_caf_test(issue-552-send_by_ref-singleton 2 issue-552-send_by_ref-singleton)
789790
if((gfortran_compiler AND (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0)) OR (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
790791
add_caf_test(issue-515-mimic-mpi-gatherv 2 issue-515-mimic-mpi-gatherv)
791792
endif()

src/libcaf.h

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
2828
#ifndef LIBCAF_H
2929
#define LIBCAF_H
3030

31-
#include <stddef.h> /* For size_t. */
31+
#include <stddef.h> /* For size_t. */
3232
#include <stdbool.h>
3333

34-
#include "libcaf-version-def.h"
34+
#include "libcaf-version-def.h"
3535
#include "libcaf-gfortran-descriptor.h"
3636

3737
#include <mpi.h>
@@ -56,11 +56,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
5656

5757
/* Definitions of the Fortran 2008 standard; need to kept in sync with
5858
ISO_FORTRAN_ENV, cf. libgfortran.h. */
59-
#define STAT_UNLOCKED 0
60-
#define STAT_LOCKED 1
61-
#define STAT_LOCKED_OTHER_IMAGE 2
59+
#define STAT_UNLOCKED 0
60+
#define STAT_LOCKED 1
61+
#define STAT_LOCKED_OTHER_IMAGE 2
6262
#define STAT_DUP_SYNC_IMAGES 3
63-
#define STAT_STOPPED_IMAGE 6000
63+
#define STAT_STOPPED_IMAGE 6000
6464
#define STAT_FAILED_IMAGE 6001
6565

6666
/* Describes what type of array we are registerring. Keep in sync with
@@ -95,14 +95,12 @@ typedef struct caf_teams_list {
9595
caf_team_t team;
9696
int team_id;
9797
struct caf_teams_list *prev;
98-
}
99-
caf_teams_list;
98+
} caf_teams_list;
10099

101100
typedef struct caf_used_teams_list {
102101
struct caf_teams_list *team_list_elem;
103102
struct caf_used_teams_list *prev;
104-
}
105-
caf_used_teams_list;
103+
} caf_used_teams_list;
106104

107105

108106
/* When there is a vector subscript in this dimension, nvec == 0, otherwise,
@@ -119,8 +117,7 @@ typedef struct caf_vector_t {
119117
ptrdiff_t lower_bound, upper_bound, stride;
120118
} triplet;
121119
} u;
122-
}
123-
caf_vector_t;
120+
} caf_vector_t;
124121

125122

126123
#ifdef GCC_GE_7
@@ -174,30 +171,30 @@ typedef struct caf_reference_t {
174171
/* The offset (in bytes) of the component in the derived type. */
175172
ptrdiff_t offset;
176173
/* The offset (in bytes) to the caf_token associated with this
177-
component. NULL, when not allocatable/pointer ref. */
174+
component. NULL, when not allocatable/pointer ref. */
178175
ptrdiff_t caf_token_offset;
179176
} c;
180177
struct {
181178
/* The mode of the array ref. See CAF_ARR_REF_*. */
182179
/* caf_array_ref_t, replaced by unsigend char to allow specification in
183-
fortran FE. */
180+
fortran FE. */
184181
unsigned char mode[GFC_MAX_DIMENSIONS];
185182
/* The type of a static array. Unset for array's with descriptors. */
186183
int static_array_type;
187184
/* Subscript refs (s) or vector refs (v). */
188185
union {
189-
struct {
190-
/* The start and end boundary of the ref and the stride. */
191-
ptrdiff_t start, end, stride;
192-
} s;
193-
struct {
194-
/* nvec entries of kind giving the elements to reference. */
195-
void *vector;
196-
/* The number of entries in vector. */
197-
size_t nvec;
198-
/* The integer kind used for the elements in vector. */
199-
int kind;
200-
} v;
186+
struct {
187+
/* The start and end boundary of the ref and the stride. */
188+
ptrdiff_t start, end, stride;
189+
} s;
190+
struct {
191+
/* nvec entries of kind giving the elements to reference. */
192+
void *vector;
193+
/* The number of entries in vector. */
194+
size_t nvec;
195+
/* The integer kind used for the elements in vector. */
196+
int kind;
197+
} v;
201198
} dim[GFC_MAX_DIMENSIONS];
202199
} a;
203200
} u;
@@ -235,7 +232,7 @@ int PREFIX (num_images) (int, int);
235232

236233
#ifdef GCC_GE_7
237234
void PREFIX (register) (size_t, caf_register_t, caf_token_t *,
238-
gfc_descriptor_t *, int *, char *, charlen_t);
235+
gfc_descriptor_t *, int *, char *, charlen_t);
239236
void PREFIX (deregister) (caf_token_t *, int, int *, char *, charlen_t);
240237
#else
241238
void * PREFIX (register) (size_t, caf_register_t, caf_token_t *, int *, char *,
@@ -293,17 +290,18 @@ void PREFIX (co_broadcast) (gfc_descriptor_t *, int, int *, char *, charlen_t);
293290
void PREFIX (co_max) (gfc_descriptor_t *, int, int *, char *, int, charlen_t);
294291
void PREFIX (co_min) (gfc_descriptor_t *, int, int *, char *, int, charlen_t);
295292
void PREFIX (co_reduce) (gfc_descriptor_t *, void *(*opr) (void *, void *),
296-
int, int, int *, char *, int , charlen_t);
293+
int, int, int *, char *, int , charlen_t);
297294
void PREFIX (co_sum) (gfc_descriptor_t *, int, int *, char *, charlen_t);
298295

299296
void PREFIX (sync_all) (int *, char *, charlen_t);
300297
void PREFIX (sync_images) (int, int[], int *, char *, charlen_t);
301298
void PREFIX (sync_memory) (int *, char *, charlen_t);
302299

303-
void PREFIX (stop_str) (const char *, charlen_t QUIETARG) __attribute__ ((noreturn));
300+
void PREFIX (stop_str) (const char *, charlen_t QUIETARG)
301+
__attribute__ ((noreturn));
304302
void PREFIX (stop) (int QUIETARG) __attribute__ ((noreturn));
305303
void PREFIX (error_stop_str) (const char *, charlen_t QUIETARG)
306-
__attribute__ ((noreturn));
304+
__attribute__ ((noreturn));
307305
void PREFIX (error_stop) (int QUIETARG) __attribute__ ((noreturn));
308306

309307
void PREFIX (fail_image) (void) __attribute__ ((noreturn));
@@ -321,9 +319,9 @@ void PREFIX (stopped_images) (gfc_descriptor_t *, int, int *);
321319
void PREFIX (atomic_define) (caf_token_t, size_t, int, void *, int *, int, int);
322320
void PREFIX (atomic_ref) (caf_token_t, size_t, int, void *, int *, int, int);
323321
void PREFIX (atomic_cas) (caf_token_t, size_t, int, void *, void *,
324-
void *, int *, int, int);
322+
void *, int *, int, int);
325323
void PREFIX (atomic_op) (int, caf_token_t, size_t, int, void *, void *,
326-
int *, int, int);
324+
int *, int, int);
327325

328326
void PREFIX (lock) (caf_token_t, size_t, int, int *, int *, char *, charlen_t);
329327
void PREFIX (unlock) (caf_token_t, size_t, int, int *, char *, charlen_t);

0 commit comments

Comments
 (0)