* allow direct calling to work with the MX MTL. Had to move some types
around so that the myriexpress.h header wasn't included in the same header as the interface declarations This commit was SVN r10817.
Этот коммит содержится в:
родитель
e0ed41f6ef
Коммит
d3c6035ea9
@ -16,11 +16,8 @@
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# Use the top-level Makefile.options
|
||||
|
||||
EXTRA_DIST = post_configure.sh
|
||||
|
||||
|
||||
AM_CPPFLAGS = $(mtl_mx_CPPFLAGS)
|
||||
|
||||
mtl_mx_sources = \
|
||||
@ -33,7 +30,8 @@ mtl_mx_sources = \
|
||||
mtl_mx_probe.c \
|
||||
mtl_mx_recv.c \
|
||||
mtl_mx_request.h \
|
||||
mtl_mx_send.c
|
||||
mtl_mx_send.c \
|
||||
mtl_mx_types.h
|
||||
|
||||
# Make the output library in this directory, and name it either
|
||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
||||
|
@ -19,11 +19,13 @@
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "ompi/mca/mtl/mtl.h"
|
||||
#include "mtl_mx.h"
|
||||
#include "ompi/communicator/communicator.h"
|
||||
#include "opal/class/opal_list.h"
|
||||
#include "ompi/mca/pml/base/pml_base_module_exchange.h"
|
||||
#include "ompi/mca/mtl/base/mtl_base_datatype.h"
|
||||
|
||||
#include "mtl_mx.h"
|
||||
#include "mtl_mx_types.h"
|
||||
#include "mtl_mx_endpoint.h"
|
||||
#include "mtl_mx_request.h"
|
||||
|
||||
|
@ -28,9 +28,6 @@
|
||||
#include "ompi/mca/mtl/base/base.h"
|
||||
#include "ompi/datatype/datatype.h"
|
||||
#include "ompi/datatype/convertor.h"
|
||||
#include "mtl_mx_endpoint.h"
|
||||
|
||||
#include "myriexpress.h"
|
||||
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
@ -88,96 +85,6 @@ extern int ompi_mtl_mx_cancel(struct mca_mtl_base_module_t* mtl,
|
||||
extern int ompi_mtl_mx_finalize(struct mca_mtl_base_module_t* mtl);
|
||||
|
||||
int ompi_mtl_mx_module_init(void);
|
||||
|
||||
/**
|
||||
* MTL Module Interface
|
||||
*/
|
||||
struct mca_mtl_mx_module_t {
|
||||
mca_mtl_base_module_t super; /**< base MTL interface */
|
||||
int32_t mx_unexp_queue_max; /**< maximium size of the MX unexpected message queue */
|
||||
int32_t mx_filter; /**< user assigned value used to filter incomming messages */
|
||||
int32_t mx_timeout;
|
||||
int32_t mx_retries;
|
||||
int32_t mx_support_sharedmem;
|
||||
mx_endpoint_t mx_endpoint; /**< mx data structure for local endpoint */
|
||||
mx_endpoint_addr_t mx_endpoint_addr; /**< mx data structure for local endpoint address */
|
||||
mca_mtl_mx_addr_t mx_addr;
|
||||
};
|
||||
typedef struct mca_mtl_mx_module_t mca_mtl_mx_module_t;
|
||||
|
||||
extern mca_mtl_mx_module_t ompi_mtl_mx;
|
||||
|
||||
struct mca_mtl_mx_component_t{
|
||||
mca_mtl_base_component_1_0_0_t super; /**< base MTL component */
|
||||
};
|
||||
typedef struct mca_mtl_mx_component_t mca_mtl_mx_component_t;
|
||||
|
||||
extern mca_mtl_mx_component_t mca_mtl_mx_component;
|
||||
|
||||
|
||||
/* match/ignore bit manipulation
|
||||
*
|
||||
* 01234567 01234567 01234567 01234567 01234567 01234567 01234567 01234567
|
||||
* | |
|
||||
* context id | source | message tag
|
||||
* | |
|
||||
*/
|
||||
|
||||
#define MX_SOURCE_MASK 0x0000FFFF00000000
|
||||
#define MX_TAG_MASK 0x00000000FFFFFFFF
|
||||
|
||||
#define MX_SOURCE_IGNR ~MX_SOURCE_MASK
|
||||
/* we need to keep top bit (sign bit) of the tag
|
||||
collectives use this to distinguish the message */
|
||||
#define MX_TAG_IGNR 0xFFFFFFFF80000000
|
||||
|
||||
/* get the tag from the bits */
|
||||
#define MX_GET_TAG(match_bits, tag) \
|
||||
{ \
|
||||
tag = (int) (match_bits & MX_TAG_MASK); \
|
||||
}
|
||||
|
||||
|
||||
/* get the tag from the bits */
|
||||
#define MX_GET_SRC(match_bits, src) \
|
||||
{ \
|
||||
src = (int) ((match_bits & MX_SOURCE_MASK) >> 32); \
|
||||
}
|
||||
|
||||
/* send posting */
|
||||
#define MX_SET_SEND_BITS(match_bits, contextid, source, tag) \
|
||||
{ \
|
||||
match_bits = contextid; \
|
||||
match_bits = (match_bits << 16); \
|
||||
match_bits |= source; \
|
||||
match_bits = (match_bits << 32); \
|
||||
match_bits |= (MX_TAG_MASK & tag); \
|
||||
}
|
||||
|
||||
/* receive posting */
|
||||
#define MX_SET_RECV_BITS(match_bits, mask_bits, contextid, source, tag) \
|
||||
{ \
|
||||
match_bits = 0; \
|
||||
mask_bits = ~match_bits; \
|
||||
match_bits = contextid; \
|
||||
match_bits = (match_bits << 16); \
|
||||
\
|
||||
if (MPI_ANY_SOURCE == source) { \
|
||||
match_bits = (match_bits << 32); \
|
||||
mask_bits &= MX_SOURCE_IGNR; \
|
||||
} else { \
|
||||
match_bits |= source; \
|
||||
match_bits = (match_bits << 32); \
|
||||
} \
|
||||
\
|
||||
if (MPI_ANY_TAG == tag) { \
|
||||
mask_bits &= MX_TAG_IGNR; \
|
||||
} else { \
|
||||
match_bits |= (MX_TAG_MASK & tag); \
|
||||
} \
|
||||
\
|
||||
mask_bits = mask_bits; \
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "ompi/datatype/convertor.h"
|
||||
|
||||
#include "mtl_mx.h"
|
||||
#include "mtl_mx_types.h"
|
||||
#include "mtl_mx_request.h"
|
||||
|
||||
#include "myriexpress.h"
|
||||
@ -112,6 +113,13 @@ ompi_mtl_mx_component_init(bool enable_progress_threads,
|
||||
bool enable_mpi_threads)
|
||||
{
|
||||
mx_return_t mx_return;
|
||||
|
||||
/* set the MX error handle to always return. This function is the
|
||||
* only MX function allowed to be called before mx_init in order
|
||||
* to make sure that if the MX is not up and running the MX
|
||||
* library does not exit the application.
|
||||
*/
|
||||
mx_set_error_handler(MX_ERRORS_RETURN);
|
||||
|
||||
/* initialize the mx library */
|
||||
mx_return = mx_init();
|
||||
@ -120,7 +128,6 @@ ompi_mtl_mx_component_init(bool enable_progress_threads,
|
||||
opal_output(0, "Error in mx_init (error %s)\n", mx_strerror(mx_return));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
ompi_mtl_mx_module_init();
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "mtl_mx.h"
|
||||
#include "mtl_mx_types.h"
|
||||
#include "mtl_mx_endpoint.h"
|
||||
#include "ompi/mca/pml/base/pml_base_module_exchange.h"
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "ompi/mca/mtl/base/mtl_base_datatype.h"
|
||||
|
||||
#include "mtl_mx.h"
|
||||
#include "mtl_mx_types.h"
|
||||
#include "mtl_mx_request.h"
|
||||
|
||||
int
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "ompi/datatype/convertor.h"
|
||||
|
||||
#include "mtl_mx.h"
|
||||
#include "mtl_mx_types.h"
|
||||
#include "mtl_mx_request.h"
|
||||
#include "ompi/mca/mtl/base/mtl_base_datatype.h"
|
||||
|
||||
|
139
ompi/mca/mtl/mx/mtl_mx_types.h
Обычный файл
139
ompi/mca/mtl/mx/mtl_mx_types.h
Обычный файл
@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2006 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.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef MTL_MX_TYPES_H_HAS_BEEN_INCLUDED
|
||||
#define MTL_MX_TYPS_H_HAS_BEEN_INCLUDED
|
||||
|
||||
#include "mtl_mx.h"
|
||||
|
||||
#include "opal/threads/threads.h"
|
||||
#include "opal/threads/condition.h"
|
||||
#include "ompi/class/ompi_free_list.h"
|
||||
#include "opal/util/cmd_line.h"
|
||||
#include "ompi/request/request.h"
|
||||
#include "ompi/mca/mtl/mtl.h"
|
||||
#include "ompi/mca/mtl/base/base.h"
|
||||
#include "ompi/datatype/datatype.h"
|
||||
#include "ompi/datatype/convertor.h"
|
||||
#include "mtl_mx_endpoint.h"
|
||||
|
||||
#include "myriexpress.h"
|
||||
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MTL Module Interface
|
||||
*/
|
||||
struct mca_mtl_mx_module_t {
|
||||
mca_mtl_base_module_t super; /**< base MTL interface */
|
||||
int32_t mx_unexp_queue_max; /**< maximium size of the MX unexpected message queue */
|
||||
int32_t mx_filter; /**< user assigned value used to filter incomming messages */
|
||||
int32_t mx_timeout;
|
||||
int32_t mx_retries;
|
||||
int32_t mx_support_sharedmem;
|
||||
mx_endpoint_t mx_endpoint; /**< mx data structure for local endpoint */
|
||||
mx_endpoint_addr_t mx_endpoint_addr; /**< mx data structure for local endpoint address */
|
||||
mca_mtl_mx_addr_t mx_addr;
|
||||
};
|
||||
typedef struct mca_mtl_mx_module_t mca_mtl_mx_module_t;
|
||||
|
||||
extern mca_mtl_mx_module_t ompi_mtl_mx;
|
||||
|
||||
struct mca_mtl_mx_component_t{
|
||||
mca_mtl_base_component_1_0_0_t super; /**< base MTL component */
|
||||
};
|
||||
typedef struct mca_mtl_mx_component_t mca_mtl_mx_component_t;
|
||||
|
||||
extern mca_mtl_mx_component_t mca_mtl_mx_component;
|
||||
|
||||
|
||||
/* match/ignore bit manipulation
|
||||
*
|
||||
* 01234567 01234567 01234567 01234567 01234567 01234567 01234567 01234567
|
||||
* | |
|
||||
* context id | source | message tag
|
||||
* | |
|
||||
*/
|
||||
|
||||
#define MX_SOURCE_MASK 0x0000FFFF00000000
|
||||
#define MX_TAG_MASK 0x00000000FFFFFFFF
|
||||
|
||||
#define MX_SOURCE_IGNR ~MX_SOURCE_MASK
|
||||
/* we need to keep top bit (sign bit) of the tag
|
||||
collectives use this to distinguish the message */
|
||||
#define MX_TAG_IGNR 0xFFFFFFFF80000000
|
||||
|
||||
/* get the tag from the bits */
|
||||
#define MX_GET_TAG(match_bits, tag) \
|
||||
{ \
|
||||
tag = (int) (match_bits & MX_TAG_MASK); \
|
||||
}
|
||||
|
||||
|
||||
/* get the tag from the bits */
|
||||
#define MX_GET_SRC(match_bits, src) \
|
||||
{ \
|
||||
src = (int) ((match_bits & MX_SOURCE_MASK) >> 32); \
|
||||
}
|
||||
|
||||
/* send posting */
|
||||
#define MX_SET_SEND_BITS(match_bits, contextid, source, tag) \
|
||||
{ \
|
||||
match_bits = contextid; \
|
||||
match_bits = (match_bits << 16); \
|
||||
match_bits |= source; \
|
||||
match_bits = (match_bits << 32); \
|
||||
match_bits |= (MX_TAG_MASK & tag); \
|
||||
}
|
||||
|
||||
/* receive posting */
|
||||
#define MX_SET_RECV_BITS(match_bits, mask_bits, contextid, source, tag) \
|
||||
{ \
|
||||
match_bits = 0; \
|
||||
mask_bits = ~match_bits; \
|
||||
match_bits = contextid; \
|
||||
match_bits = (match_bits << 16); \
|
||||
\
|
||||
if (MPI_ANY_SOURCE == source) { \
|
||||
match_bits = (match_bits << 32); \
|
||||
mask_bits &= MX_SOURCE_IGNR; \
|
||||
} else { \
|
||||
match_bits |= source; \
|
||||
match_bits = (match_bits << 32); \
|
||||
} \
|
||||
\
|
||||
if (MPI_ANY_TAG == tag) { \
|
||||
mask_bits &= MX_TAG_IGNR; \
|
||||
} else { \
|
||||
match_bits |= (MX_TAG_MASK & tag); \
|
||||
} \
|
||||
\
|
||||
mask_bits = mask_bits; \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MTL_MX_TYPES_H_HAS_BEEN_INCLUDED */
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user