25 #include "ompi_config.h"
26 #include <sys/types.h>
31 #include "opal/mca/event/event.h"
32 #include "ompi/class/ompi_free_list.h"
37 #include "btl_gm_endpoint.h"
41 #define GM_BUFFER_SIZE 7
42 #define GM_BUFFER_LENGTH gm_max_length_for_size(GM_BUFFER_SIZE)
56 size_t gm_eager_frag_size;
57 size_t gm_max_frag_size;
59 int32_t gm_num_repost;
90 int32_t gm_num_send_tokens;
91 int32_t gm_max_send_tokens;
92 int32_t gm_num_recv_tokens;
93 int32_t gm_max_recv_tokens;
94 int32_t gm_num_repost;
100 #if OMPI_ENABLE_PROGRESS_THREADS
128 int *num_btl_modules,
129 bool allow_multi_user_threads,
130 bool have_hidden_threads
205 mca_btl_base_tag_t tag
325 #define MCA_BTL_GM_ACQUIRE_TOKEN_NL(btl, frag) \
328 if(OPAL_THREAD_ADD32(&gm_btl->gm_num_send_tokens, -1) < 0) { \
329 opal_list_append(&gm_btl->gm_pending, (opal_list_item_t*)frag); \
330 OPAL_THREAD_ADD32(&gm_btl->gm_num_send_tokens, 1); \
331 return OMPI_SUCCESS; \
336 #define MCA_BTL_GM_ACQUIRE_TOKEN(btl, frag) \
339 if(OPAL_THREAD_ADD32(&gm_btl->gm_num_send_tokens, -1) < 0) { \
340 opal_list_append(&gm_btl->gm_pending, (opal_list_item_t*)frag); \
341 OPAL_THREAD_ADD32(&gm_btl->gm_num_send_tokens, 1); \
342 OPAL_THREAD_UNLOCK(&mca_btl_gm_component.gm_lock); \
343 return OMPI_SUCCESS; \
352 #define MCA_BTL_GM_RETURN_TOKEN(btl) \
354 OPAL_THREAD_ADD32( &btl->gm_num_send_tokens, 1 ); \
355 if(opal_list_get_size(&btl->gm_pending)) { \
356 mca_btl_gm_frag_t* frag; \
357 frag = (mca_btl_gm_frag_t*)opal_list_remove_first(&btl->gm_pending); \
359 switch(frag->type) { \
360 case MCA_BTL_GM_SEND: \
361 case MCA_BTL_GM_EAGER: \
362 mca_btl_gm_send_nl(&btl->super, frag->endpoint, &frag->base, frag->hdr->tag); \
364 case MCA_BTL_GM_PUT: \
365 mca_btl_gm_put_nl(&btl->super, frag->endpoint, &frag->base); \
367 case MCA_BTL_GM_GET: \
368 mca_btl_gm_get_nl(&btl->super, frag->endpoint, &frag->base); \
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_base_module_t super
base BTL interface
Definition: btl_gm.h:78
int mca_btl_gm_free(struct mca_btl_base_module_t *btl, mca_btl_base_descriptor_t *des)
Return a segment allocated by this BTL.
Definition: btl_gm.c:229
mca_btl_base_component_2_0_0_t super
base BTL component
Definition: btl_gm.h:49
Definition: opal_bitmap.h:53
int gm_free_list_max
maximum size of free lists
Definition: btl_gm.h:64
int mca_btl_gm_put(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *btl_peer, struct mca_btl_base_descriptor_t *decriptor)
Initiate an asynchronous put.
Definition: btl_gm.c:747
opal_mutex_t gm_lock
lock for accessing module state
Definition: btl_gm.h:67
size_t gm_max_btls
maximum number of supported hcas
Definition: btl_gm.h:52
int mca_btl_gm_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_gm.c:168
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
int gm_free_list_num
initial size of free lists
Definition: btl_gm.h:63
Definition: mutex_unix.h:53
int mca_btl_gm_add_procs(struct mca_btl_base_module_t *btl, size_t nprocs, struct ompi_proc_t **procs, struct mca_btl_base_endpoint_t **peers, opal_bitmap_t *reachable)
PML->BTL notification of change in the process list.
Definition: btl_gm.c:101
mca_btl_base_descriptor_t * mca_btl_gm_prepare_src(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *peer, struct mca_mpool_base_registration_t *, struct opal_convertor_t *convertor, uint8_t order, size_t reserve, size_t *size, uint32_t flags)
Prepare a descriptor for send/rdma using the supplied convertor.
Definition: btl_gm.c:250
size_t gm_max_ports
maximum number of ports per board
Definition: btl_gm.h:54
Remote Open MPI process structure.
Definition: proc.h:56
int mca_btl_gm_finalize(struct mca_btl_base_module_t *btl)
Cleanup any resources held by the BTL.
Definition: btl_gm.c:946
size_t gm_num_btls
number of hcas available to the GM component
Definition: btl_gm.h:51
int gm_free_list_inc
number of elements to alloc when growing free lists
Definition: btl_gm.h:65
int mca_btl_gm_ft_event(int state)
Fault Tolerance Event Notification Function.
Definition: btl_gm.c:967
opal_list_t gm_repost
list of pending fragments
Definition: btl_gm.h:98
Byte Transfer Layer (BTL)
int mca_btl_gm_get(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *btl_peer, struct mca_btl_base_descriptor_t *decriptor)
Initiate an asynchronous get.
Definition: btl_gm.c:903
Definition: ompi_free_list.h:39
int mca_btl_gm_component_open(void)
Register GM component parameters with the MCA framework.
Definition: btl_gm_component.c:109
int mca_btl_gm_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_gm.c:156
Structure used to publish GM id information to peers.
Definition: btl_gm_endpoint.h:37
State of ELAN endpoint connection.
Definition: btl_elan_endpoint.h:33
opal_list_t gm_pending
list of pending send descriptors
Definition: btl_gm.h:97
int mca_btl_gm_component_progress(void)
GM component progress.
Definition: btl_gm_component.c:568
BTL component descriptor.
Definition: btl.h:411
Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana University Research and Techno...
Definition: opal_convertor.h:90
mca_btl_base_descriptor_t * mca_btl_gm_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 descriptor with a segment of the requested size.
Definition: btl_gm.c:185
size_t gm_max_boards
maximum number of boards
Definition: btl_gm.h:55
int gm_debug
turn on debug output
Definition: btl_gm.h:61
opal_list_t gm_procs
list of gm proc structures
Definition: btl_gm.h:66
Definition: opal_list.h:147
struct mca_btl_gm_module_t ** gm_btls
array of available BTL modules
Definition: btl_gm.h:53
int32_t gm_num_high_priority
number of receive descriptors at high priority
Definition: btl_gm.h:60
mca_btl_base_descriptor_t * mca_btl_gm_prepare_dst(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *peer, struct mca_mpool_base_registration_t *, struct opal_convertor_t *convertor, uint8_t order, size_t reserve, size_t *size, uint32_t flags)
Prepare a descriptor for send/rdma using the supplied convertor.
Definition: btl_gm.c:370
Myrinet (GM) BTL component.
Definition: btl_gm.h:48
BTL module interface functions and attributes.
Definition: btl.h:786
int mca_btl_gm_component_close(void)
Any final cleanup before being unloaded.
Definition: btl_gm_component.c:184
BTL Module Interface.
Definition: btl_gm.h:77
int mca_btl_gm_send(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *btl_peer, struct mca_btl_base_descriptor_t *descriptor, mca_btl_base_tag_t tag)
Initiate an asynchronous send.
Definition: btl_gm.c:574
mca_btl_base_module_t ** mca_btl_gm_component_init(int *num_btl_modules, bool allow_multi_user_threads, bool have_hidden_threads)
GM component initialization.
Definition: btl_gm_component.c:491
char * gm_mpool_name
name of memory pool
Definition: btl_gm.h:68