root/oshmem/shmem/c/shmem_addr_accessible.c

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

DEFINITIONS

This source file includes following definitions.
  1. shmem_addr_accessible

   1 /*
   2  * Copyright (c) 2013-2016 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 #include "oshmem/mca/memheap/memheap.h"
  17 #include "oshmem/mca/memheap/base/base.h"
  18 
  19 #if OSHMEM_PROFILING
  20 #include "oshmem/include/pshmem.h"
  21 #pragma weak shmem_addr_accessible = pshmem_addr_accessible
  22 #include "oshmem/shmem/c/profile/defines.h"
  23 #endif
  24 
  25 int shmem_addr_accessible(const void *addr, int pe)
  26 {
  27     void* rva;
  28     sshmem_mkey_t *mkey;
  29     int i;
  30 
  31     RUNTIME_CHECK_INIT();
  32 
  33     for (i = 0; i < mca_memheap_base_num_transports(); i++) {
  34         /* TODO: iterate on all ctxs, try to get cached mkey */
  35         mkey = mca_memheap_base_get_cached_mkey(oshmem_ctx_default, pe, (void *)addr, i, &rva);
  36         if (mkey) {
  37             return 1;
  38         }
  39     }
  40 
  41     return 0;
  42 }

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