OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

btl_sm.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2009 The University of Tennessee and The University
6 * of Tennessee Research Foundation. All rights
7 * reserved.
8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9 * University of Stuttgart. All rights reserved.
10 * Copyright (c) 2004-2005 The Regents of the University of California.
11 * All rights reserved.
12 * Copyright (c) 2006-2007 Voltaire. All rights reserved.
13 * Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved.
14 * Copyright (c) 2010 Los Alamos National Security, LLC.
15 * All rights reserved.
16 * Copyright (c) 2010-2012 IBM Corporation. All rights reserved.
17 * $COPYRIGHT$
18 *
19 * Additional copyrights may follow
20 *
21 * $HEADER$
22 */
23 /**
24 * @file
25 */
26 #ifndef MCA_BTL_SM_H
27 #define MCA_BTL_SM_H
28
29 #include "ompi_config.h"
30 #include <stddef.h>
31 #include <stdlib.h>
32 #include <string.h>
33 #ifdef HAVE_STDINT_H
34 #include <stdint.h>
35 #endif /* HAVE_STDINT_H */
36 #ifdef HAVE_SCHED_H
37 #include <sched.h>
38 #endif /* HAVE_SCHED_H */
39 #if OMPI_BTL_SM_HAVE_KNEM
40 #include "knem_io.h"
41 #endif /* OMPI_BTL_SM_HAVE_KNEM */
42
43 #include "opal/util/bit_ops.h"
44 #include "opal/class/opal_free_list.h"
45 #include "ompi/mca/btl/btl.h"
46 #include "ompi/mca/common/sm/common_sm.h"
47
48 BEGIN_C_DECLS
49
50 /*
51 * Shared Memory FIFOs
52 *
53 * The FIFO is implemented as a circular queue with head and tail pointers
54 * (integer indices). For efficient wraparound indexing, the size of the
55 * queue is constrained to be a power of two and we "&" indices with a "mask".
56 *
57 * More than one process can write to the FIFO head. Therefore, there is a head
58 * lock. One cannot write until the head slot is empty, indicated by the special
59 * queue entry SM_FIFO_FREE.
60 *
61 * Only the receiver can read the FIFO tail. Therefore, the tail lock is
62 * required only in multithreaded applications. If a tail read returns the
63 * SM_FIFO_FREE value, that means the FIFO is empty. Once a non-FREE value
64 * has been read, the queue slot is *not* automatically reset to SM_FIFO_FREE.
65 * Rather, read tail slots are reset "lazily" (see "lazy_free" and "num_to_clear")
66 * to reduce the number of memory barriers and improve performance.
67 *
68 * Since the FIFO lives in shared memory that is mapped differently into
69 * each address space, the "queue" pointer is relative (each process must
70 * add its own offset) and the queue_recv pointer is meaningful only in the
71 * receiver's address space.
72 *
73 * Since multiple processes access different parts of the FIFO structure in
74 * different ways, we introduce padding to keep different parts on different
75 * cachelines.
76 */
77
78 #define SM_FIFO_FREE (void *) (-2)
79 /* We can't use opal_cache_line_size here because we need a
80 compile-time constant for padding the struct. We can't really have
81 a compile-time constant that is portable, either (e.g., compile on
82 one machine and run on another). So just use a big enough cache
83 line that should hopefully be good in most places. */
84 #define SM_CACHE_LINE_PAD 128
85
86 struct sm_fifo_t {
87 /* This queue pointer is used only by the heads. */
88 volatile void **queue;
89 char pad0[SM_CACHE_LINE_PAD - sizeof(void **)];
90 /* This lock is used by the heads. */
91 opal_atomic_lock_t head_lock;
92 char pad1[SM_CACHE_LINE_PAD - sizeof(opal_atomic_lock_t)];
93 /* This index is used by the head holding the head lock. */
94 volatile int head;
95 char pad2[SM_CACHE_LINE_PAD - sizeof(int)];
96 /* This mask is used "read only" by all processes. */
97 unsigned int mask;
98 char pad3[SM_CACHE_LINE_PAD - sizeof(int)];
99 /* The following are used only by the tail. */
100 volatile void **queue_recv;
101 opal_atomic_lock_t tail_lock;
102 volatile int tail;
103 int num_to_clear;
104 int lazy_free;
105 char pad4[SM_CACHE_LINE_PAD - sizeof(void **) -
106 sizeof(opal_atomic_lock_t) -
107 sizeof(int) * 3];
108 };
109 typedef struct sm_fifo_t sm_fifo_t;
110
111 /*
112 * Shared Memory resource managment
113 */
114
115 #if OMPI_ENABLE_PROGRESS_THREADS == 1
116 #define DATA (char)0
117 #define DONE (char)1
118 #endif
119
120 typedef struct mca_btl_sm_mem_node_t {
121 mca_mpool_base_module_t* sm_mpool; /**< shared memory pool */
122 } mca_btl_sm_mem_node_t;
123
124 /**
125 * Shared Memory (SM) BTL module.
126 */
127 struct mca_btl_sm_component_t {
128 mca_btl_base_component_2_0_0_t super; /**< base BTL component */
129 int sm_free_list_num; /**< initial size of free lists */
130 int sm_free_list_max; /**< maximum size of free lists */
131 int sm_free_list_inc; /**< number of elements to alloc when growing free lists */
132 int32_t sm_max_procs; /**< upper limit on the number of processes using the shared memory pool */
133 int sm_extra_procs; /**< number of extra procs to allow */
134 char* sm_mpool_name; /**< name of shared memory pool module */
135 mca_mpool_base_module_t **sm_mpools; /**< shared memory pools (one for each memory node) */
136 mca_mpool_base_module_t *sm_mpool; /**< mpool on local node */
137 void* sm_mpool_base; /**< base address of shared memory pool */
138 size_t eager_limit; /**< first fragment size */
139 size_t max_frag_size; /**< maximum (second and beyone) fragment size */
140 opal_mutex_t sm_lock;
141 mca_common_sm_module_t *sm_seg; /**< description of shared memory segment */
142 volatile sm_fifo_t **shm_fifo; /**< pointer to fifo 2D array in shared memory */
143 char **shm_bases; /**< pointer to base pointers in shared memory */
144 uint16_t *shm_mem_nodes; /**< pointer to mem noded in shared memory */
145 sm_fifo_t **fifo; /**< cached copy of the pointer to the 2D
146 fifo array. The address in the shared
147 memory segment sm_ctl_header is a relative,
148 but this one, in process private memory, is
149 a real virtual address */
150 uint16_t *mem_nodes; /**< cached copy of mem nodes of each local rank */
151 size_t fifo_size; /**< number of FIFO queue entries */
152 size_t fifo_lazy_free; /**< number of reads before lazy fifo free is triggered */
153 int nfifos; /**< number of FIFOs per receiver */
154 int32_t num_smp_procs; /**< current number of smp procs on this host */
155 int32_t my_smp_rank; /**< My SMP process rank. Used for accessing
156 * SMP specfic data structures. */
157 ompi_free_list_t sm_frags_eager; /**< free list of sm first */
158 ompi_free_list_t sm_frags_max; /**< free list of sm second */
159 ompi_free_list_t sm_frags_user;
160 ompi_free_list_t sm_first_frags_to_progress; /**< list of first
161 fragments that are
162 awaiting resources */
163 struct mca_btl_base_endpoint_t **sm_peers;
164
165 opal_free_list_t pending_send_fl;
166 int num_outstanding_frags; /**< number of fragments sent but not yet returned to free list */
167 int num_pending_sends; /**< total number on all of my pending-send queues */
168 int mem_node;
169 int num_mem_nodes;
170
171 #if OMPI_ENABLE_PROGRESS_THREADS == 1
172 char sm_fifo_path[PATH_MAX]; /**< path to fifo used to signal this process */
173 int sm_fifo_fd; /**< file descriptor corresponding to opened fifo */
174 opal_thread_t sm_fifo_thread;
175 #endif
176 struct mca_btl_sm_t **sm_btls;
177 struct mca_btl_sm_frag_t **table;
178 size_t sm_num_btls;
179 size_t sm_max_btls;
180
181 #if OMPI_BTL_SM_HAVE_KNEM
182 /* Knem capabilities info */
183 struct knem_cmd_info knem_info;
184 #endif
185
186 /** MCA: should we be using knem or not? neg=try but continue if
187 not available, 0=don't try, 1=try and fail if not available */
188 int use_knem;
189
190 /** MCA: minimal message size (bytes) to offload on DMA engine
191 when using knem */
192 uint32_t knem_dma_min;
193
194 /** MCA: how many simultaneous ongoing knem operations to
195 support */
196 int knem_max_simultaneous;
197
198 /** If we want DMA and DMA is supported, this will be loaded with
199 KNEM_FLAG_DMA. Otherwise, it'll be 0. */
200 int knem_dma_flag;
201
202 /** MCA: should we be using CMA or not?
203 0 = no, 1 = yes */
204 int use_cma;
205 };
206 typedef struct mca_btl_sm_component_t mca_btl_sm_component_t;
207 OMPI_MODULE_DECLSPEC extern mca_btl_sm_component_t mca_btl_sm_component;
208
209 /**
210 * SM BTL Interface
211 */
212 struct mca_btl_sm_t {
213 mca_btl_base_module_t super; /**< base BTL interface */
214 bool btl_inited; /**< flag indicating if btl has been inited */
215 mca_btl_base_module_error_cb_fn_t error_cb;
216
217 #if OMPI_BTL_SM_HAVE_KNEM
218
219 /* File descriptor for knem */
220 int knem_fd;
221
222 /* Array of knem status items for non-blocking knem requests */
223 knem_status_t *knem_status_array;
224
225 /* Array of fragments currently being moved by knem non-blocking
226 operations */
227 struct mca_btl_sm_frag_t **knem_frag_array;
228
229 /* First free/available location in knem_status_array */
230 int knem_status_first_avail;
231
232 /* First currently-being used location in the knem_status_array */
233 int knem_status_first_used;
234
235 /* Number of status items currently in use */
236 int knem_status_num_used;
237 #endif
238 };
239 typedef struct mca_btl_sm_t mca_btl_sm_t;
240 OMPI_MODULE_DECLSPEC extern mca_btl_sm_t mca_btl_sm;
241
242
243
244
245
246 struct btl_sm_pending_send_item_t
247 {
248 opal_free_list_item_t super;
249 void *data;
250 };
251 typedef struct btl_sm_pending_send_item_t btl_sm_pending_send_item_t;
252
253 /***
254 * FIFO support for sm BTL.
255 */
256
257 /***
258 * One or more FIFO components may be a pointer that must be
259 * accessed by multiple processes. Since the shared region may
260 * be mmapped differently into each process's address space,
261 * these pointers will be relative to some base address. Here,
262 * we define macros to translate between relative addresses and
263 * virtual addresses.
264 */
265 #define VIRTUAL2RELATIVE(VADDR ) ((long)(VADDR) - (long)mca_btl_sm_component.shm_bases[mca_btl_sm_component.my_smp_rank])
266 #define RELATIVE2VIRTUAL(OFFSET) ((long)(OFFSET) + (long)mca_btl_sm_component.shm_bases[mca_btl_sm_component.my_smp_rank])
267
268 static inline int sm_fifo_init(int fifo_size, mca_mpool_base_module_t *mpool,
269 sm_fifo_t *fifo, int lazy_free)
270 {
271 int i, qsize;
272
273 /* figure out the queue size (a power of two that is at least 1) */
274 qsize = opal_next_poweroftwo_inclusive (fifo_size);
275
276 /* allocate the queue in the receiver's address space */
277 fifo->queue_recv = (volatile void **)mpool->mpool_alloc(
278 mpool, sizeof(void *) * qsize, opal_cache_line_size, 0, NULL);
279 if(NULL == fifo->queue_recv) {
280 return OMPI_ERR_OUT_OF_RESOURCE;
281 }
282
283 /* initialize the queue */
284 for ( i = 0; i < qsize; i++ )
285 fifo->queue_recv[i] = SM_FIFO_FREE;
286
287 /* shift queue address to be relative */
288 fifo->queue = (volatile void **) VIRTUAL2RELATIVE(fifo->queue_recv);
289
290 /* initialize the locks */
291 opal_atomic_init(&(fifo->head_lock), OPAL_ATOMIC_UNLOCKED);
292 opal_atomic_init(&(fifo->tail_lock), OPAL_ATOMIC_UNLOCKED);
293 opal_atomic_unlock(&(fifo->head_lock)); /* should be unnecessary */
294 opal_atomic_unlock(&(fifo->tail_lock)); /* should be unnecessary */
295
296 /* other initializations */
297 fifo->head = 0;
298 fifo->mask = qsize - 1;
299 fifo->tail = 0;
300 fifo->num_to_clear = 0;
301 fifo->lazy_free = lazy_free;
302
303 return OMPI_SUCCESS;
304 }
305
306
307 static inline int sm_fifo_write(void *value, sm_fifo_t *fifo)
308 {
309 volatile void **q = (volatile void **) RELATIVE2VIRTUAL(fifo->queue);
310
311 /* if there is no free slot to write, report exhausted resource */
312 opal_atomic_rmb();
313 if ( SM_FIFO_FREE != q[fifo->head] )
314 return OMPI_ERR_OUT_OF_RESOURCE;
315
316 /* otherwise, write to the slot and advance the head index */
317 q[fifo->head] = value;
318 opal_atomic_wmb();
319 fifo->head = (fifo->head + 1) & fifo->mask;
320 return OMPI_SUCCESS;
321 }
322
323
324 static inline void *sm_fifo_read(sm_fifo_t *fifo)
325 {
326 void *value;
327
328 /* read the next queue entry */
329 value = (void *) fifo->queue_recv[fifo->tail];
330
331 opal_atomic_rmb();
332
333 /* if you read a non-empty slot, advance the tail pointer */
334 if ( SM_FIFO_FREE != value ) {
335
336 fifo->tail = ( fifo->tail + 1 ) & fifo->mask;
337 fifo->num_to_clear += 1;
338
339 /* check if it's time to free slots, which we do lazily */
340 if ( fifo->num_to_clear >= fifo->lazy_free ) {
341 int i = (fifo->tail - fifo->num_to_clear ) & fifo->mask;
342
343 while ( fifo->num_to_clear > 0 ) {
344 fifo->queue_recv[i] = SM_FIFO_FREE;
345 i = (i+1) & fifo->mask;
346 fifo->num_to_clear -= 1;
347 }
348 opal_atomic_wmb();
349 }
350 }
351
352 return value;
353 }
354
355 /**
356 * shared memory component progress.
357 */
358 extern int mca_btl_sm_component_progress(void);
359
360
361
362 /**
363 * Register a callback function that is called on error..
364 *
365 * @param btl (IN) BTL module
366 * @return Status indicating if cleanup was successful
367 */
368
369 int mca_btl_sm_register_error_cb(
370 struct mca_btl_base_module_t* btl,
371 mca_btl_base_module_error_cb_fn_t cbfunc
372 );
373
374 /**
375 * Cleanup any resources held by the BTL.
376 *
377 * @param btl BTL instance.
378 * @return OMPI_SUCCESS or error status on failure.
379 */
380
381 extern int mca_btl_sm_finalize(
382 struct mca_btl_base_module_t* btl
383 );
384
385
386 /**
387 * PML->BTL notification of change in the process list.
388 * PML->BTL Notification that a receive fragment has been matched.
389 * Called for message that is send from process with the virtual
390 * address of the shared memory segment being different than that of
391 * the receiver.
392 *
393 * @param btl (IN)
394 * @param proc (IN)
395 * @param peer (OUT)
396 * @return OMPI_SUCCESS or error status on failure.
397 *
398 */
399
400 extern int mca_btl_sm_add_procs(
401 struct mca_btl_base_module_t* btl,
402 size_t nprocs,
403 struct ompi_proc_t **procs,
404 struct mca_btl_base_endpoint_t** peers,
405 struct opal_bitmap_t* reachability
406 );
407
408
409 /**
410 * PML->BTL notification of change in the process list.
411 *
412 * @param btl (IN) BTL instance
413 * @param proc (IN) Peer process
414 * @param peer (IN) Peer addressing information.
415 * @return Status indicating if cleanup was successful
416 *
417 */
418 extern int mca_btl_sm_del_procs(
419 struct mca_btl_base_module_t* btl,
420 size_t nprocs,
421 struct ompi_proc_t **procs,
422 struct mca_btl_base_endpoint_t **peers
423 );
424
425
426 /**
427 * Allocate a segment.
428 *
429 * @param btl (IN) BTL module
430 * @param size (IN) Request segment size.
431 */
432 extern mca_btl_base_descriptor_t* mca_btl_sm_alloc(
433 struct mca_btl_base_module_t* btl,
434 struct mca_btl_base_endpoint_t* endpoint,
435 uint8_t order,
436 size_t size,
437 uint32_t flags
438 );
439
440 /**
441 * Return a segment allocated by this BTL.
442 *
443 * @param btl (IN) BTL module
444 * @param segment (IN) Allocated segment.
445 */
446 extern int mca_btl_sm_free(
447 struct mca_btl_base_module_t* btl,
448 mca_btl_base_descriptor_t* segment
449 );
450
451
452 /**
453 * Pack data
454 *
455 * @param btl (IN) BTL module
456 * @param peer (IN) BTL peer addressing
457 */
458 struct mca_btl_base_descriptor_t* mca_btl_sm_prepare_src(
459 struct mca_btl_base_module_t* btl,
460 struct mca_btl_base_endpoint_t* endpoint,
461 mca_mpool_base_registration_t* registration,
462 struct opal_convertor_t* convertor,
463 uint8_t order,
464 size_t reserve,
465 size_t* size,
466 uint32_t flags
467 );
468
469
470 /**
471 * Initiate an inlined send to the peer or return a descriptor.
472 *
473 * @param btl (IN) BTL module
474 * @param peer (IN) BTL peer addressing
475 */
476 extern int mca_btl_sm_sendi( struct mca_btl_base_module_t* btl,
477 struct mca_btl_base_endpoint_t* endpoint,
478 struct opal_convertor_t* convertor,
479 void* header,
480 size_t header_size,
481 size_t payload_size,
482 uint8_t order,
483 uint32_t flags,
484 mca_btl_base_tag_t tag,
485 mca_btl_base_descriptor_t** descriptor );
486
487 /**
488 * Initiate a send to the peer.
489 *
490 * @param btl (IN) BTL module
491 * @param peer (IN) BTL peer addressing
492 */
493 extern int mca_btl_sm_send(
494 struct mca_btl_base_module_t* btl,
495 struct mca_btl_base_endpoint_t* endpoint,
496 struct mca_btl_base_descriptor_t* descriptor,
497 mca_btl_base_tag_t tag
498 );
499
500 #if OMPI_BTL_SM_HAVE_KNEM || OMPI_BTL_SM_HAVE_CMA
501 /*
502 * Synchronous knem/cma get
503 */
504 extern int mca_btl_sm_get_sync(
505 struct mca_btl_base_module_t* btl,
506 struct mca_btl_base_endpoint_t* endpoint,
507 struct mca_btl_base_descriptor_t* des );
508
509 extern struct mca_btl_base_descriptor_t* mca_btl_sm_prepare_dst(
510 struct mca_btl_base_module_t* btl,
511 struct mca_btl_base_endpoint_t* endpoint,
512 struct mca_mpool_base_registration_t* registration,
513 struct opal_convertor_t* convertor,
514 uint8_t order,
515 size_t reserve,
516 size_t* size,
517 uint32_t flags);
518 #endif
519
520 #if OMPI_BTL_SM_HAVE_KNEM
521 /*
522 * Asynchronous knem get
523 */
524 extern int mca_btl_sm_get_async(
525 struct mca_btl_base_module_t* btl,
526 struct mca_btl_base_endpoint_t* endpoint,
527 struct mca_btl_base_descriptor_t* des );
528
529 #endif
530
531 /**
532 * Fault Tolerance Event Notification Function
533 * @param state Checkpoint Stae
534 * @return OMPI_SUCCESS or failure status
535 */
536 int mca_btl_sm_ft_event(int state);
537
538 #if OMPI_ENABLE_PROGRESS_THREADS == 1
539 void mca_btl_sm_component_event_thread(opal_object_t*);
540 #endif
541
542 #if OMPI_ENABLE_PROGRESS_THREADS == 1
543 #define MCA_BTL_SM_SIGNAL_PEER(peer) \
544 { \
545 unsigned char cmd = DATA; \
546 if(write(peer->fifo_fd, &cmd, sizeof(cmd)) != sizeof(cmd)) { \
547 opal_output(0, "mca_btl_sm_send: write fifo failed: errno=%d\n", errno); \
548 } \
549 }
550 #else
551 #define MCA_BTL_SM_SIGNAL_PEER(peer)
552 #endif
553
554 END_C_DECLS
555
556 #endif
557
mca_btl_sm_component_t
Shared Memory (SM) BTL module.
Definition: btl_sm.h:127
mca_btl_sm_component_t::shm_bases
char ** shm_bases
pointer to base pointers in shared memory
Definition: btl_sm.h:143
mca_btl_sm_component_t::max_frag_size
size_t max_frag_size
maximum (second and beyone) fragment size
Definition: btl_sm.h:139
mca_btl_sm_component_t::my_smp_rank
int32_t my_smp_rank
My SMP process rank.
Definition: btl_sm.h:155
mca_btl_sm_component_t::sm_max_procs
int32_t sm_max_procs
upper limit on the number of processes using the shared memory pool
Definition: btl_sm.h:132
mca_btl_sm_component_t::knem_max_simultaneous
int knem_max_simultaneous
MCA: how many simultaneous ongoing knem operations to support.
Definition: btl_sm.h:196
mca_btl_sm_t::btl_inited
bool btl_inited
flag indicating if btl has been inited
Definition: btl_sm.h:214
mca_btl_base_descriptor_t
A descriptor that holds the parameters to a send/put/get operation along w/ a callback routine that i...
Definition: btl.h:275
mca_btl_sm_mem_node_t
Definition: btl_sm.h:120
mca_btl_sm_component_t::shm_mem_nodes
uint16_t * shm_mem_nodes
pointer to mem noded in shared memory
Definition: btl_sm.h:144
mca_btl_sm_component_t::sm_free_list_max
int sm_free_list_max
maximum size of free lists
Definition: btl_sm.h:130
mca_btl_sm_ft_event
int mca_btl_sm_ft_event(int state)
Fault Tolerance Event Notification Function.
Definition: btl_sm.c:1158
opal_atomic_rmb
void opal_atomic_rmb(void)
Read memory barrier.
opal_bitmap_t
Definition: opal_bitmap.h:53
mca_common_sm_module_t
Definition: common_sm.h:60
mca_btl_sm_component_t::sm_free_list_inc
int sm_free_list_inc
number of elements to alloc when growing free lists
Definition: btl_sm.h:131
mca_btl_base_module_error_cb_fn_t
void(* mca_btl_base_module_error_cb_fn_t)(struct mca_btl_base_module_t *btl, int32_t flags, struct ompi_proc_t *errproc, char *btlinfo)
Callback function that is called asynchronously on receipt of an error from the transport layer...
Definition: btl.h:538
opal_mutex_t
Definition: mutex_unix.h:53
mca_btl_sm_component_t::fifo
sm_fifo_t ** fifo
cached copy of the pointer to the 2D fifo array.
Definition: btl_sm.h:145
mca_btl_sm_t::super
mca_btl_base_module_t super
base BTL interface
Definition: btl_sm.h:213
mca_btl_sm_prepare_src
struct mca_btl_base_descriptor_t * mca_btl_sm_prepare_src(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, mca_mpool_base_registration_t *registration, struct opal_convertor_t *convertor, uint8_t order, size_t reserve, size_t *size, uint32_t flags)
Pack data.
Definition: btl_sm.c:678
mca_btl_sm_component_t::sm_free_list_num
int sm_free_list_num
initial size of free lists
Definition: btl_sm.h:129
mca_mpool_base_registration_t
Definition: mpool.h:44
ompi_proc_t
Remote Open MPI process structure.
Definition: proc.h:56
mca_btl_sm_component_t::shm_fifo
volatile sm_fifo_t ** shm_fifo
pointer to fifo 2D array in shared memory
Definition: btl_sm.h:142
opal_atomic_lock_t
Volatile lock object (with optional padding).
Definition: atomic.h:102
mca_btl_sm_component_t::sm_frags_max
ompi_free_list_t sm_frags_max
free list of sm second
Definition: btl_sm.h:158
opal_atomic_unlock
static void opal_atomic_unlock(opal_atomic_lock_t *lock)
Release a lock.
mca_btl_sm_sendi
int mca_btl_sm_sendi(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, struct opal_convertor_t *convertor, void *header, size_t header_size, size_t payload_size, uint8_t order, uint32_t flags, mca_btl_base_tag_t tag, mca_btl_base_descriptor_t **descriptor)
Initiate an inlined send to the peer or return a descriptor.
Definition: btl_sm.c:815
mca_btl_sm_component_t::sm_mpool_base
void * sm_mpool_base
base address of shared memory pool
Definition: btl_sm.h:137
mca_btl_sm_register_error_cb
int mca_btl_sm_register_error_cb(struct mca_btl_base_module_t *btl, mca_btl_base_module_error_cb_fn_t cbfunc)
Register a callback function that is called on error.
Definition: btl_sm.c:619
mca_btl_sm_component_t::sm_mpool_name
char * sm_mpool_name
name of shared memory pool module
Definition: btl_sm.h:134
opal_free_list_item_t
Definition: opal_free_list.h:47
mca_btl_sm_component_t::super
mca_btl_base_component_2_0_0_t super
base BTL component
Definition: btl_sm.h:128
mca_btl_sm_component_t::fifo_lazy_free
size_t fifo_lazy_free
number of reads before lazy fifo free is triggered
Definition: btl_sm.h:152
mca_btl_sm_component_t::fifo_size
size_t fifo_size
number of FIFO queue entries
Definition: btl_sm.h:151
mca_btl_sm_component_t::use_knem
int use_knem
MCA: should we be using knem or not? neg=try but continue if not available, 0=don't try...
Definition: btl_sm.h:188
mca_btl_sm_component_t::sm_seg
mca_common_sm_module_t * sm_seg
description of shared memory segment
Definition: btl_sm.h:141
mca_btl_sm_component_t::eager_limit
size_t eager_limit
first fragment size
Definition: btl_sm.h:138
btl_sm_pending_send_item_t
Definition: btl_sm.h:246
opal_free_list_t
Definition: opal_free_list.h:31
mca_btl_sm_add_procs
int mca_btl_sm_add_procs(struct mca_btl_base_module_t *btl, size_t nprocs, struct ompi_proc_t **procs, struct mca_btl_base_endpoint_t **peers, struct opal_bitmap_t *reachability)
PML->BTL notification of change in the process list.
Definition: btl_sm.c:436
mca_btl_sm_component_t::sm_frags_eager
ompi_free_list_t sm_frags_eager
free list of sm first
Definition: btl_sm.h:157
btl.h
Byte Transfer Layer (BTL)
mca_btl_sm_t
SM BTL Interface.
Definition: btl_sm.h:212
mca_btl_sm_component_progress
int mca_btl_sm_component_progress(void)
shared memory component progress.
Definition: btl_sm_component.c:608
mca_btl_sm_send
int mca_btl_sm_send(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, struct mca_btl_base_descriptor_t *descriptor, mca_btl_base_tag_t tag)
Initiate a send to the peer.
Definition: btl_sm.c:900
mca_btl_sm_frag_t
shared memory send fragment derived type.
Definition: btl_sm_frag.h:51
ompi_free_list_t
Definition: ompi_free_list.h:39
mca_btl_sm_del_procs
int mca_btl_sm_del_procs(struct mca_btl_base_module_t *btl, size_t nprocs, struct ompi_proc_t **procs, struct mca_btl_base_endpoint_t **peers)
PML->BTL notification of change in the process list.
Definition: btl_sm.c:587
mca_btl_sm_component_t::knem_dma_flag
int knem_dma_flag
If we want DMA and DMA is supported, this will be loaded with KNEM_FLAG_DMA.
Definition: btl_sm.h:200
mca_btl_base_endpoint_t
State of ELAN endpoint connection.
Definition: btl_elan_endpoint.h:33
mca_btl_base_component_2_0_0_t
BTL component descriptor.
Definition: btl.h:411
opal_object_t
Base object.
Definition: opal_object.h:182
opal_convertor_t
Definition: opal_convertor.h:90
mca_btl_sm_component_t::num_pending_sends
int num_pending_sends
total number on all of my pending-send queues
Definition: btl_sm.h:167
mca_btl_base_descriptor_t::order
uint8_t order
order value, this is only valid in the local completion callback and may be used in subsequent calls ...
Definition: btl.h:292
mca_btl_sm_component_t::mem_nodes
uint16_t * mem_nodes
cached copy of mem nodes of each local rank
Definition: btl_sm.h:150
opal_atomic_wmb
void opal_atomic_wmb(void)
Write memory barrier.
mca_btl_sm_alloc
mca_btl_base_descriptor_t * mca_btl_sm_alloc(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, uint8_t order, size_t size, uint32_t flags)
Allocate a segment.
Definition: btl_sm.c:634
opal_atomic_init
static void opal_atomic_init(opal_atomic_lock_t *lock, int32_t value)
Initialize a lock to value.
mca_btl_sm_free
int mca_btl_sm_free(struct mca_btl_base_module_t *btl, mca_btl_base_descriptor_t *segment)
Return a segment allocated by this BTL.
Definition: btl_sm.c:662
mca_btl_sm_component_t::nfifos
int nfifos
number of FIFOs per receiver
Definition: btl_sm.h:153
mca_btl_sm_component_t::num_outstanding_frags
int num_outstanding_frags
number of fragments sent but not yet returned to free list
Definition: btl_sm.h:166
opal_thread_t
Definition: threads.h:46
mca_btl_sm_component_t::sm_first_frags_to_progress
ompi_free_list_t sm_first_frags_to_progress
list of first fragments that are awaiting resources
Definition: btl_sm.h:160
mca_mpool_base_module_t::mpool_alloc
mca_mpool_base_module_alloc_fn_t mpool_alloc
allocate function
Definition: mpool.h:177
sm_fifo_t
Definition: btl_sm.h:86
mca_btl_sm_component_t::sm_extra_procs
int sm_extra_procs
number of extra procs to allow
Definition: btl_sm.h:133
mca_btl_base_module_t
BTL module interface functions and attributes.
Definition: btl.h:786
mca_btl_sm_component_t::knem_dma_min
uint32_t knem_dma_min
MCA: minimal message size (bytes) to offload on DMA engine when using knem.
Definition: btl_sm.h:192
mca_btl_sm_finalize
int mca_btl_sm_finalize(struct mca_btl_base_module_t *btl)
Cleanup any resources held by the BTL.
Definition: btl_sm.c:610
mca_btl_sm_mem_node_t::sm_mpool
mca_mpool_base_module_t * sm_mpool
shared memory pool
Definition: btl_sm.h:121
mca_btl_sm_component_t::num_smp_procs
int32_t num_smp_procs
current number of smp procs on this host
Definition: btl_sm.h:154
mca_btl_sm_component_t::sm_mpools
mca_mpool_base_module_t ** sm_mpools
shared memory pools (one for each memory node)
Definition: btl_sm.h:135
mca_btl_sm_component_t::use_cma
int use_cma
MCA: should we be using CMA or not? 0 = no, 1 = yes.
Definition: btl_sm.h:204
mca_btl_sm_component_t::sm_mpool
mca_mpool_base_module_t * sm_mpool
mpool on local node
Definition: btl_sm.h:136
mca_mpool_base_module_t
mpool module descriptor.
Definition: mpool.h:174