root/oshmem/shmem/c/shmem_barrier.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. shmem_barrier
  2. shmem_barrier_all

   1 /*
   2  * Copyright (c) 2013-2018 Mellanox Technologies, Inc.
   3  *                         All rights reserved.
   4  * $COPYRIGHT$
   5  *
   6  * Additional copyrights may follow
   7  *
   8  * $HEADER$
   9  */
  10 #include "oshmem_config.h"
  11 
  12 #include "oshmem/constants.h"
  13 #include "oshmem/include/shmem.h"
  14 
  15 #include "oshmem/runtime/runtime.h"
  16 
  17 #include "oshmem/mca/scoll/scoll.h"
  18 #include "oshmem/mca/scoll/base/base.h"
  19 
  20 #include "oshmem/proc/proc.h"
  21 
  22 
  23 #if OSHMEM_PROFILING
  24 #include "oshmem/include/pshmem.h"
  25 #pragma weak shmem_barrier = pshmem_barrier
  26 #pragma weak shmem_barrier_all = pshmem_barrier_all
  27 #include "oshmem/shmem/c/profile/defines.h"
  28 #endif
  29 
  30 void shmem_barrier(int PE_start, int logPE_stride, int PE_size, long *pSync)
  31 {
  32     int rc;
  33     oshmem_group_t* group;
  34 
  35     RUNTIME_CHECK_INIT();
  36 
  37 #if OSHMEM_SPEC_COMPAT == 1
  38     /* all outstanding puts must be completed */
  39     shmem_quiet();
  40 #endif
  41 
  42     /* Create group basing PE_start, logPE_stride and PE_size */
  43     group = oshmem_proc_group_create_nofail(PE_start, 1<<logPE_stride, PE_size);
  44     /* Call barrier operation */
  45     rc = group->g_scoll.scoll_barrier(group, pSync, SCOLL_DEFAULT_ALG);
  46 
  47     oshmem_proc_group_destroy(group);
  48     RUNTIME_CHECK_RC(rc);
  49 }
  50 
  51 void shmem_barrier_all(void)
  52 {
  53     int rc = OSHMEM_SUCCESS;
  54 
  55 #if OSHMEM_SPEC_COMPAT == 1
  56     /* all outstanding puts must be completed */
  57     shmem_quiet();
  58 #endif
  59 
  60     if (mca_scoll_sync_array) {
  61         rc = oshmem_group_all->g_scoll.scoll_barrier(oshmem_group_all,
  62                                                      mca_scoll_sync_array,
  63                                                      SCOLL_DEFAULT_ALG);
  64     }
  65     RUNTIME_CHECK_RC(rc);
  66 }

/* [<][>][^][v][top][bottom][index][help] */