1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
3 * (C) 2015 by Argonne National Laboratory.
4 * See COPYRIGHT in top-level directory.
7 /* This code tests the case when a large ACC is issued, and then
8 * several small ACCs is issued between the same origin and target.
9 * The purpose of this test is to check if the ordering of ACCs
17 #define DATA_COUNT 8192
19 int main(int argc, char *argv[])
23 uint64_t buf[DATA_COUNT], orig_buf[DATA_COUNT];
24 uint64_t small_orig_buf_1 = 2, small_orig_buf_2[2] = { 3, 3 };
27 MPI_Init(&argc, &argv);
28 MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
29 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
31 for (j = 0; j < LOOP; j++) {
35 for (i = 0; i < DATA_COUNT; i++) {
40 MPI_Win_create(buf, sizeof(uint64_t) * DATA_COUNT, sizeof(uint64_t),
41 MPI_INFO_NULL, MPI_COMM_WORLD, &win);
43 MPI_Win_fence(0, win);
46 /* ACC (atomic PUT) to win_buf[0...DATA_COUNT-1] */
47 MPI_Accumulate(orig_buf, DATA_COUNT, MPI_UINT64_T, 1, 0, DATA_COUNT, MPI_UINT64_T,
49 /* ACC (atomic PUT) to win_buf[0] */
50 MPI_Accumulate(&small_orig_buf_1, 1, MPI_UINT64_T, 1, 0, 1, MPI_UINT64_T, MPI_REPLACE,
52 /* ACC (atomic PUT) to win_buf[1,2] */
53 MPI_Accumulate(&small_orig_buf_2, 2, MPI_UINT64_T, 1, 1, 2, MPI_UINT64_T, MPI_REPLACE,
57 MPI_Win_fence(0, win);
60 for (i = 0; i < DATA_COUNT; i++) {
66 else if (i == 1 || i == 2) {
82 if (rank == 1 && error == 0) {
83 printf(" No Errors\n");