1 /*
2  * Copyright (C) by Argonne National Laboratory
3  *     See COPYRIGHT in top-level directory
4  */
5 
6 #ifndef MPIDU_INIT_SHM_H_INCLUDED
7 #define MPIDU_INIT_SHM_H_INCLUDED
8 
9 #define MPIDU_SHM_MAX_FNAME_LEN 256
10 #define MPIDU_SHM_CACHE_LINE_LEN MPL_CACHELINE_SIZE
11 
12 /* One cache line per process should be enough for all cases */
13 #define MPIDU_INIT_SHM_BLOCK_SIZE MPIDU_SHM_CACHE_LINE_LEN
14 
15 #if defined(MPL_USE_LOCK_BASED_PRIMITIVES) && !defined(ENABLE_NO_LOCAL)
16 #error Lock-based atomics are used (probably due to missing compiler support), \
17        shared memory will not work properly. Consider disable it with --enable-nolocal.
18 #endif
19 
20 typedef struct MPIDU_Init_shm_block {
21     char block[MPIDU_INIT_SHM_BLOCK_SIZE];
22 } MPIDU_Init_shm_block_t;
23 
24 int MPIDU_Init_shm_init(void);
25 int MPIDU_Init_shm_finalize(void);
26 int MPIDU_Init_shm_barrier(void);
27 int MPIDU_Init_shm_put(void *orig, size_t len);
28 int MPIDU_Init_shm_get(int local_rank, size_t len, void *target);
29 int MPIDU_Init_shm_query(int local_rank, void **target_addr);
30 
31 int MPIDU_Init_shm_alloc(size_t len, void **ptr);
32 int MPIDU_Init_shm_free(void *ptr);
33 int MPIDU_Init_shm_is_symm(void *ptr);
34 
35 #endif /* MPIDU_INIT_SHM_H_INCLUDED */
36