2005-06-27 23:24:04 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-06-27 23:24:04 +04:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2008-04-22 02:22:18 +04:00
|
|
|
* Copyright (c) 2008 UT-Battelle, LLC. All rights reserved.
|
2005-06-27 23:24:04 +04:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* @file
|
|
|
|
*/
|
2005-07-21 17:31:52 +04:00
|
|
|
#ifndef OMPI_BTL_PORTALS_H
|
|
|
|
#define OMPI_BTL_PORTALS_H
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2006-07-04 05:20:20 +04:00
|
|
|
#include "ompi/mca/common/portals/common_portals.h"
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2005-07-05 20:29:57 +04:00
|
|
|
#include "ompi/mca/pml/pml.h"
|
|
|
|
#include "ompi/mca/btl/btl.h"
|
|
|
|
#include "ompi/mca/btl/base/base.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/class/ompi_bitmap.h"
|
|
|
|
#include "ompi/class/ompi_free_list.h"
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2005-07-06 01:14:29 +04:00
|
|
|
#include "btl_portals_endpoint.h"
|
2006-05-14 08:23:26 +04:00
|
|
|
#include "btl_portals_frag.h"
|
2005-07-06 01:14:29 +04:00
|
|
|
|
2005-06-27 23:24:04 +04:00
|
|
|
/*
|
2005-07-05 20:29:57 +04:00
|
|
|
* Portals BTL component.
|
2005-06-27 23:24:04 +04:00
|
|
|
*/
|
2005-06-30 09:50:55 +04:00
|
|
|
struct mca_btl_portals_component_t {
|
2005-07-05 20:29:57 +04:00
|
|
|
/* base BTL component */
|
2008-07-29 02:40:57 +04:00
|
|
|
mca_btl_base_component_2_0_0_t super;
|
2005-06-27 23:24:04 +04:00
|
|
|
|
|
|
|
/* output channel for debugging. Value settings when using
|
|
|
|
* output_verbose:
|
|
|
|
*
|
|
|
|
* - 0 : critical user information
|
|
|
|
* - 10: general execution diagnostic information
|
|
|
|
* - 20: initialization / shutdown diagnostic information
|
|
|
|
* - 30: basic debugging information
|
|
|
|
* - 90: useful only to developers
|
|
|
|
* - 100: lots and lots of performance impacting output
|
|
|
|
*/
|
|
|
|
int portals_output;
|
|
|
|
|
|
|
|
/* initial size of free lists */
|
|
|
|
int portals_free_list_init_num;
|
|
|
|
/* max size of free lists */
|
|
|
|
int portals_free_list_max_num;
|
|
|
|
/* numer of elements to grow free lists */
|
|
|
|
int portals_free_list_inc_num;
|
2006-05-14 08:23:26 +04:00
|
|
|
|
|
|
|
/* number of eager fragments */
|
|
|
|
int portals_free_list_eager_max_num;
|
2008-02-25 22:17:21 +03:00
|
|
|
|
|
|
|
/* shall I use portals to send to thyself? */
|
|
|
|
int portals_support_self;
|
2008-04-22 02:22:18 +04:00
|
|
|
|
|
|
|
/* do I need a portals ACK? */
|
|
|
|
int portals_need_ack;
|
|
|
|
|
2005-06-27 23:24:04 +04:00
|
|
|
};
|
2005-06-30 09:50:55 +04:00
|
|
|
typedef struct mca_btl_portals_component_t mca_btl_portals_component_t;
|
2005-06-27 23:24:04 +04:00
|
|
|
|
|
|
|
|
2005-08-09 00:56:26 +04:00
|
|
|
#define OMPI_BTL_PORTALS_EQ_SEND 0
|
2006-05-14 08:23:26 +04:00
|
|
|
#define OMPI_BTL_PORTALS_EQ_RECV 1
|
2005-08-09 00:56:26 +04:00
|
|
|
#define OMPI_BTL_PORTALS_EQ_SIZE 2
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
struct mca_btl_portals_module_t {
|
2005-07-05 20:29:57 +04:00
|
|
|
/* base BTL module interface */
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_base_module_t super;
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2005-08-09 00:56:26 +04:00
|
|
|
/* number of processes we're actively connected to. Needed to
|
|
|
|
know when to do activation / shutdown */
|
|
|
|
int32_t portals_num_procs;
|
2005-07-06 01:14:29 +04:00
|
|
|
|
2005-08-09 00:56:26 +04:00
|
|
|
/* fragment free lists */
|
2005-06-30 01:52:00 +04:00
|
|
|
ompi_free_list_t portals_frag_eager;
|
|
|
|
ompi_free_list_t portals_frag_max;
|
|
|
|
ompi_free_list_t portals_frag_user;
|
|
|
|
|
2005-08-09 00:56:26 +04:00
|
|
|
/* incoming send message receive memory descriptors */
|
2005-06-30 01:52:00 +04:00
|
|
|
int portals_recv_mds_num;
|
|
|
|
int portals_recv_mds_size;
|
2005-08-09 00:56:26 +04:00
|
|
|
opal_list_t portals_recv_blocks;
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2006-05-14 08:23:26 +04:00
|
|
|
/* frag for receive callbacks */
|
|
|
|
mca_btl_portals_frag_recv_t portals_recv_frag;
|
|
|
|
|
2005-08-09 00:56:26 +04:00
|
|
|
/* event queues. Keep sends on own eq, since we can't control
|
|
|
|
space for the ack otherwise */
|
2005-07-21 17:31:52 +04:00
|
|
|
int portals_eq_sizes[OMPI_BTL_PORTALS_EQ_SIZE];
|
|
|
|
ptl_handle_eq_t portals_eq_handles[OMPI_BTL_PORTALS_EQ_SIZE];
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2005-07-12 01:00:08 +04:00
|
|
|
/* "reject" entry for recv match list */
|
|
|
|
ptl_handle_me_t portals_recv_reject_me_h;
|
|
|
|
|
2006-05-14 08:23:26 +04:00
|
|
|
/* number outstanding sends and local rdma */
|
|
|
|
volatile int32_t portals_outstanding_ops;
|
|
|
|
int32_t portals_max_outstanding_ops;
|
2005-07-15 05:43:47 +04:00
|
|
|
|
2006-05-14 08:23:26 +04:00
|
|
|
/* sends queued until there's time to send */
|
2005-07-15 05:43:47 +04:00
|
|
|
opal_list_t portals_queued_sends;
|
2005-07-12 01:00:08 +04:00
|
|
|
|
2005-07-21 20:06:46 +04:00
|
|
|
/* key to use for next rdma operation */
|
|
|
|
volatile int64_t portals_rdma_key;
|
|
|
|
|
2005-06-27 23:24:04 +04:00
|
|
|
/* our portals network interface */
|
2005-06-30 01:52:00 +04:00
|
|
|
ptl_handle_ni_t portals_ni_h;
|
2005-06-27 23:24:04 +04:00
|
|
|
|
|
|
|
/* number of dropped messages */
|
2005-06-30 01:52:00 +04:00
|
|
|
ptl_sr_value_t portals_sr_dropped;
|
2005-07-06 01:14:29 +04:00
|
|
|
|
2005-08-09 00:56:26 +04:00
|
|
|
/* descriptors for send */
|
|
|
|
ptl_md_t md_send;
|
2005-06-27 23:24:04 +04:00
|
|
|
};
|
2005-06-30 09:50:55 +04:00
|
|
|
typedef struct mca_btl_portals_module_t mca_btl_portals_module_t;
|
2005-06-27 23:24:04 +04:00
|
|
|
|
|
|
|
/*
|
2005-06-30 09:50:55 +04:00
|
|
|
* Component functions (btl_portals_component.c)
|
2005-06-27 23:24:04 +04:00
|
|
|
*/
|
2005-06-30 09:50:55 +04:00
|
|
|
int mca_btl_portals_component_open(void);
|
|
|
|
int mca_btl_portals_component_close(void);
|
2005-06-27 23:24:04 +04:00
|
|
|
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_base_module_t** mca_btl_portals_component_init(int *num_btls,
|
2005-07-20 18:36:52 +04:00
|
|
|
bool has_progress_threads,
|
|
|
|
bool has_mpi_threads);
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
int mca_btl_portals_component_progress(void);
|
2005-06-27 23:24:04 +04:00
|
|
|
|
|
|
|
/*
|
2005-06-30 09:50:55 +04:00
|
|
|
* Compatibility functions (btl_portals_compat_{}.c)
|
2005-06-27 23:24:04 +04:00
|
|
|
*
|
2005-07-05 20:29:57 +04:00
|
|
|
* Not part of the BTL interface. Need to be implemented for every
|
2005-06-27 23:24:04 +04:00
|
|
|
* version of Portals
|
|
|
|
*/
|
2005-07-12 01:00:08 +04:00
|
|
|
int mca_btl_portals_init_compat(mca_btl_portals_component_t *comp);
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2005-07-06 01:14:29 +04:00
|
|
|
/* 4th argument is a ptl_peers array, as that's what we'll get back
|
|
|
|
from many of the access functions... */
|
2005-06-30 09:50:55 +04:00
|
|
|
int mca_btl_portals_add_procs_compat(mca_btl_portals_module_t* btl,
|
2005-06-27 23:24:04 +04:00
|
|
|
size_t nprocs, struct ompi_proc_t **procs,
|
2005-07-06 01:14:29 +04:00
|
|
|
ptl_process_id_t **ptl_peers);
|
2005-06-27 23:24:04 +04:00
|
|
|
|
|
|
|
/*
|
2005-06-30 09:50:55 +04:00
|
|
|
* Module configuration functions (btl_portals.c)
|
2005-06-27 23:24:04 +04:00
|
|
|
*/
|
2005-07-20 18:36:52 +04:00
|
|
|
int mca_btl_portals_finalize(struct mca_btl_base_module_t* btl_base);
|
|
|
|
|
|
|
|
int mca_btl_portals_add_procs(struct mca_btl_base_module_t* btl_base,
|
|
|
|
size_t nprocs,
|
|
|
|
struct ompi_proc_t **procs,
|
|
|
|
struct mca_btl_base_endpoint_t** peers,
|
|
|
|
ompi_bitmap_t* reachable);
|
|
|
|
|
|
|
|
int mca_btl_portals_del_procs(struct mca_btl_base_module_t* btl_base,
|
|
|
|
size_t nprocs,
|
|
|
|
struct ompi_proc_t **procs,
|
|
|
|
struct mca_btl_base_endpoint_t** peers);
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_base_descriptor_t*
|
2005-07-20 18:36:52 +04:00
|
|
|
mca_btl_portals_alloc(struct mca_btl_base_module_t* btl_base,
|
2007-12-09 17:00:42 +03:00
|
|
|
struct mca_btl_base_endpoint_t* endpoint,
|
2007-05-24 23:51:26 +04:00
|
|
|
uint8_t order,
|
2007-12-09 17:08:01 +03:00
|
|
|
size_t size,
|
|
|
|
uint32_t flags);
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2005-07-20 18:36:52 +04:00
|
|
|
int mca_btl_portals_free(struct mca_btl_base_module_t* btl_base,
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_base_descriptor_t* des);
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_base_descriptor_t*
|
2005-07-20 18:36:52 +04:00
|
|
|
mca_btl_portals_prepare_src(struct mca_btl_base_module_t* btl_base,
|
2005-06-30 09:50:55 +04:00
|
|
|
struct mca_btl_base_endpoint_t* peer,
|
2005-06-27 23:24:04 +04:00
|
|
|
mca_mpool_base_registration_t* registration,
|
|
|
|
struct ompi_convertor_t* convertor,
|
2007-05-24 23:51:26 +04:00
|
|
|
uint8_t order,
|
2005-06-27 23:24:04 +04:00
|
|
|
size_t reserve,
|
2007-12-09 17:08:01 +03:00
|
|
|
size_t* size,
|
|
|
|
uint32_t flags);
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_base_descriptor_t*
|
2005-07-20 18:36:52 +04:00
|
|
|
mca_btl_portals_prepare_dst(struct mca_btl_base_module_t* btl_base,
|
2005-06-30 09:50:55 +04:00
|
|
|
struct mca_btl_base_endpoint_t* peer,
|
2005-06-27 23:24:04 +04:00
|
|
|
mca_mpool_base_registration_t* registration,
|
|
|
|
struct ompi_convertor_t* convertor,
|
2007-05-24 23:51:26 +04:00
|
|
|
uint8_t order,
|
2005-06-27 23:24:04 +04:00
|
|
|
size_t reserve,
|
2007-12-09 17:08:01 +03:00
|
|
|
size_t* size,
|
|
|
|
uint32_t flags);
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2005-07-20 18:36:52 +04:00
|
|
|
int mca_btl_portals_send(struct mca_btl_base_module_t* btl_base,
|
2005-06-30 09:50:55 +04:00
|
|
|
struct mca_btl_base_endpoint_t* btl_peer,
|
|
|
|
struct mca_btl_base_descriptor_t* descriptor,
|
|
|
|
mca_btl_base_tag_t tag);
|
2005-06-27 23:24:04 +04:00
|
|
|
|
2008-05-30 07:58:39 +04:00
|
|
|
|
|
|
|
int mca_btl_portals_sendi(struct mca_btl_base_module_t* btl_base,
|
|
|
|
struct mca_btl_base_endpoint_t* endpoint,
|
|
|
|
struct ompi_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** des);
|
|
|
|
|
2005-07-20 18:36:52 +04:00
|
|
|
int mca_btl_portals_put(struct mca_btl_base_module_t* btl_base,
|
2005-06-30 09:50:55 +04:00
|
|
|
struct mca_btl_base_endpoint_t* btl_peer,
|
|
|
|
struct mca_btl_base_descriptor_t* decriptor);
|
2005-06-27 23:24:04 +04:00
|
|
|
|
|
|
|
|
2005-07-20 18:36:52 +04:00
|
|
|
int mca_btl_portals_get(struct mca_btl_base_module_t* btl_base,
|
2005-06-30 09:50:55 +04:00
|
|
|
struct mca_btl_base_endpoint_t* btl_peer,
|
|
|
|
struct mca_btl_base_descriptor_t* decriptor);
|
2005-06-27 23:24:04 +04:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* global structures
|
|
|
|
*/
|
2006-09-15 02:19:39 +04:00
|
|
|
OMPI_MODULE_DECLSPEC extern mca_btl_portals_component_t mca_btl_portals_component;
|
2005-06-30 09:50:55 +04:00
|
|
|
extern mca_btl_portals_module_t mca_btl_portals_module;
|
2005-06-27 23:24:04 +04:00
|
|
|
|
|
|
|
#endif
|