2004-10-12 08:17:29 +04:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
|
|
|
|
2004-07-19 23:45:06 +04:00
|
|
|
/*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004 The Ohio State University.
|
|
|
|
* All rights reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-07-19 23:45:06 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
2004-10-20 05:03:09 +04:00
|
|
|
#include "ompi_config.h"
|
2005-08-13 01:42:07 +04:00
|
|
|
#include "ompi/include/constants.h"
|
2005-07-04 03:31:27 +04:00
|
|
|
#include "opal/util/output.h"
|
2004-07-19 23:45:06 +04:00
|
|
|
#include "mca/ptl/ptl.h"
|
2005-07-03 04:52:18 +04:00
|
|
|
#include "mca/pml/base/pml_base_module_exchange.h"
|
2004-07-19 23:45:06 +04:00
|
|
|
#include "ptl_gm.h"
|
2004-08-13 03:37:37 +04:00
|
|
|
#include "ptl_gm_priv.h"
|
2004-11-05 17:53:38 +03:00
|
|
|
#include "ptl_gm_peer.h"
|
|
|
|
#include "ptl_gm_sendfrag.h"
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_ptl_gm_component_t mca_ptl_gm_component = {
|
2004-07-19 23:45:06 +04:00
|
|
|
{
|
2004-08-13 08:17:31 +04:00
|
|
|
/* First, the mca_base_component_t struct containing meta information
|
|
|
|
about the component itself */
|
|
|
|
{
|
|
|
|
/* Indicate that we are a pml v1.0.0 component (which also implies a
|
|
|
|
specific MCA version) */
|
|
|
|
MCA_PTL_BASE_VERSION_1_0_0,
|
|
|
|
"gm", /* MCA component name */
|
Major simplifications to component versioning:
- After long discussions and ruminations on how we run components in
LAM/MPI, made the decision that, by default, all components included
in Open MPI will use the version number of their parent project
(i.e., OMPI or ORTE). They are certaint free to use a different
number, but this simplification makes the common cases easy:
- components are only released when the parent project is released
- it is easy (trivial?) to distinguish which version component goes
with with version of the parent project
- removed all autogen/configure code for templating the version .h
file in components
- made all ORTE components use ORTE_*_VERSION for version numbers
- made all OMPI components use OMPI_*_VERSION for version numbers
- removed all VERSION files from components
- configure now displays OPAL, ORTE, and OMPI version numbers
- ditto for ompi_info
- right now, faking it -- OPAL and ORTE and OMPI will always have the
same version number (i.e., they all come from the same top-level
VERSION file). But this paves the way for the Great Configure
Reorganization, where, among other things, each project will have
its own version number.
So all in all, we went from a boatload of version numbers to
[effectively] three. That's pretty good. :-)
This commit was SVN r6344.
2005-07-05 00:12:36 +04:00
|
|
|
OMPI_MAJOR_VERSION, /* MCA component major version */
|
|
|
|
OMPI_MINOR_VERSION, /* MCA component minor version */
|
|
|
|
OMPI_RELEASE_VERSION, /* MCA component release version */
|
2004-08-13 08:17:31 +04:00
|
|
|
mca_ptl_gm_component_open, /* component open */
|
|
|
|
mca_ptl_gm_component_close /* component close */
|
|
|
|
}
|
|
|
|
,
|
|
|
|
/* Next the MCA v1.0.0 component meta data */
|
|
|
|
{
|
2004-10-04 22:21:44 +04:00
|
|
|
/* Whether the component is checkpointable or not */
|
2004-08-13 08:17:31 +04:00
|
|
|
false
|
|
|
|
},
|
|
|
|
mca_ptl_gm_component_init,
|
|
|
|
mca_ptl_gm_component_control,
|
|
|
|
mca_ptl_gm_component_progress
|
|
|
|
}
|
2004-07-19 23:45:06 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* utility routines for parameter registration
|
|
|
|
*/
|
|
|
|
|
|
|
|
static inline char *
|
2004-10-30 10:55:18 +04:00
|
|
|
mca_ptl_gm_param_register_string( const char *param_name,
|
|
|
|
const char *default_value )
|
2004-07-19 23:45:06 +04:00
|
|
|
{
|
2004-10-30 10:55:18 +04:00
|
|
|
char *param_value;
|
|
|
|
int id = mca_base_param_register_string( "ptl", "gm", param_name, NULL,
|
|
|
|
default_value) ;
|
2004-07-19 23:45:06 +04:00
|
|
|
mca_base_param_lookup_string (id, ¶m_value);
|
|
|
|
return param_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
2004-10-30 10:55:18 +04:00
|
|
|
mca_ptl_gm_param_register_int( const char *param_name, int default_value )
|
2004-07-19 23:45:06 +04:00
|
|
|
{
|
2004-10-30 10:55:18 +04:00
|
|
|
int id =
|
2004-07-19 23:45:06 +04:00
|
|
|
mca_base_param_register_int ("ptl", "gm", param_name, NULL,
|
|
|
|
default_value);
|
2004-10-30 10:55:18 +04:00
|
|
|
int param_value = default_value;
|
2004-07-19 23:45:06 +04:00
|
|
|
mca_base_param_lookup_int (id, ¶m_value);
|
|
|
|
return param_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Called by MCA framework to open the module, registers
|
|
|
|
* module parameters.
|
|
|
|
*/
|
|
|
|
|
|
|
|
int
|
2004-10-30 10:55:18 +04:00
|
|
|
mca_ptl_gm_component_open(void)
|
2004-07-19 23:45:06 +04:00
|
|
|
{
|
2005-04-02 03:03:50 +04:00
|
|
|
uint32_t default_first_frag_size;
|
|
|
|
|
2004-07-19 23:45:06 +04:00
|
|
|
/* initialize state */
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_ptl_gm_component.gm_ptl_modules = NULL;
|
|
|
|
mca_ptl_gm_component.gm_num_ptl_modules = 0;
|
2004-07-19 23:45:06 +04:00
|
|
|
|
|
|
|
/* initialize objects */
|
2005-07-04 02:45:48 +04:00
|
|
|
OBJ_CONSTRUCT (&mca_ptl_gm_component.gm_lock, opal_mutex_t);
|
2005-07-03 20:22:16 +04:00
|
|
|
OBJ_CONSTRUCT (&mca_ptl_gm_component.gm_procs, opal_list_t);
|
|
|
|
OBJ_CONSTRUCT (&mca_ptl_gm_component.gm_send_req, opal_list_t);
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
/* register GM component parameters */
|
2005-01-09 22:42:14 +03:00
|
|
|
mca_ptl_gm_component.gm_port_name =
|
|
|
|
mca_ptl_gm_param_register_string( "port_name", "OMPI_GM" );
|
|
|
|
mca_ptl_gm_component.gm_max_port_number =
|
|
|
|
mca_ptl_gm_param_register_int ("max_ports_number", 16 );
|
|
|
|
mca_ptl_gm_component.gm_max_boards_number =
|
|
|
|
mca_ptl_gm_param_register_int ("max_boards_number", 4 );
|
|
|
|
mca_ptl_gm_component.gm_max_ptl_modules =
|
|
|
|
mca_ptl_gm_param_register_int( "max_ptl_modules", 1 );
|
|
|
|
|
2005-01-06 11:20:45 +03:00
|
|
|
mca_ptl_gm_component.gm_segment_size =
|
2005-04-03 06:13:01 +04:00
|
|
|
mca_ptl_gm_param_register_int( "segment_size", 32 * 1024 );
|
2005-04-02 03:03:50 +04:00
|
|
|
default_first_frag_size = mca_ptl_gm_component.gm_segment_size - sizeof(mca_ptl_base_rendezvous_header_t);
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_ptl_gm_module.super.ptl_first_frag_size =
|
2005-04-02 03:03:50 +04:00
|
|
|
mca_ptl_gm_param_register_int ("first_frag_size", default_first_frag_size );
|
|
|
|
/* the first_frag_size should be always less than the gm_segment_size by at least the
|
|
|
|
* header sizeof.
|
|
|
|
*/
|
|
|
|
if( mca_ptl_gm_module.super.ptl_first_frag_size > default_first_frag_size ) {
|
|
|
|
mca_ptl_gm_module.super.ptl_first_frag_size = default_first_frag_size;
|
|
|
|
}
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_ptl_gm_module.super.ptl_min_frag_size =
|
2005-04-03 06:13:01 +04:00
|
|
|
mca_ptl_gm_param_register_int ("min_frag_size", 64 * 1024);
|
2004-08-31 00:48:13 +04:00
|
|
|
mca_ptl_gm_module.super.ptl_max_frag_size =
|
2004-12-21 09:23:42 +03:00
|
|
|
mca_ptl_gm_param_register_int ("max_frag_size", 256 * 1024 * 1024);
|
2004-10-30 10:55:18 +04:00
|
|
|
/* Parameters setting the message limits. */
|
2005-01-09 22:42:14 +03:00
|
|
|
mca_ptl_gm_component.gm_eager_limit =
|
2005-04-09 09:51:31 +04:00
|
|
|
mca_ptl_gm_param_register_int( "eager_limit", 128 * 1024 );
|
2005-04-13 01:50:26 +04:00
|
|
|
#if OMPI_MCA_PTL_GM_HAVE_RDMA_GET
|
2005-04-09 09:51:31 +04:00
|
|
|
mca_ptl_gm_component.gm_rndv_burst_limit =
|
|
|
|
mca_ptl_gm_param_register_int( "rndv_burst_limit", 512 * 1024 );
|
2005-01-09 22:42:14 +03:00
|
|
|
mca_ptl_gm_component.gm_rdma_frag_size =
|
2005-04-03 06:13:01 +04:00
|
|
|
mca_ptl_gm_param_register_int ("rdma_frag_size", 128 * 1024);
|
2005-04-14 00:15:17 +04:00
|
|
|
#endif /* OMPI_MCA_PTL_GM_HAVE_RDMA_GET */
|
2004-08-31 00:48:13 +04:00
|
|
|
|
2004-08-13 03:37:37 +04:00
|
|
|
mca_ptl_gm_component.gm_free_list_num =
|
2004-09-08 01:29:18 +04:00
|
|
|
mca_ptl_gm_param_register_int ("free_list_num", 256);
|
2004-08-13 03:37:37 +04:00
|
|
|
mca_ptl_gm_component.gm_free_list_inc =
|
2004-07-19 23:45:06 +04:00
|
|
|
mca_ptl_gm_param_register_int ("free_list_inc", 32);
|
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2004-08-02 04:24:22 +04:00
|
|
|
* component close
|
2004-07-19 23:45:06 +04:00
|
|
|
*/
|
2004-08-13 08:17:31 +04:00
|
|
|
int mca_ptl_gm_component_close (void)
|
2004-07-19 23:45:06 +04:00
|
|
|
{
|
2004-11-18 03:23:19 +03:00
|
|
|
uint32_t index;
|
|
|
|
mca_ptl_base_module_t* ptl;
|
|
|
|
|
|
|
|
for( index = 0; index < mca_ptl_gm_component.gm_num_ptl_modules; index++ ) {
|
|
|
|
ptl = (mca_ptl_base_module_t*)mca_ptl_gm_component.gm_ptl_modules[index];
|
|
|
|
if( NULL != ptl )
|
|
|
|
ptl->ptl_finalize( ptl );
|
|
|
|
}
|
|
|
|
mca_ptl_gm_component.gm_num_ptl_modules = 0;
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
if (NULL != mca_ptl_gm_component.gm_ptl_modules)
|
|
|
|
free (mca_ptl_gm_component.gm_ptl_modules);
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2005-03-26 21:49:16 +03:00
|
|
|
OBJ_DESTRUCT( &mca_ptl_gm_component.gm_procs );
|
|
|
|
OBJ_DESTRUCT( &mca_ptl_gm_component.gm_send_req );
|
|
|
|
OBJ_DESTRUCT( &mca_ptl_gm_component.gm_lock );
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-08-13 03:37:37 +04:00
|
|
|
return OMPI_SUCCESS;
|
2004-07-19 23:45:06 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2004-08-02 04:24:22 +04:00
|
|
|
* Create a ptl instance and add to components list.
|
2004-07-19 23:45:06 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
static int
|
2004-10-30 10:55:18 +04:00
|
|
|
mca_ptl_gm_create( mca_ptl_gm_module_t** pptl )
|
2004-07-19 23:45:06 +04:00
|
|
|
{
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_ptl_gm_module_t *ptl;
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
ptl = (mca_ptl_gm_module_t *)malloc( sizeof(mca_ptl_gm_module_t) );
|
2004-07-19 23:45:06 +04:00
|
|
|
if (NULL == ptl) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output( 0, " ran out of resource to allocate ptl_instance \n" );
|
2004-07-19 23:45:06 +04:00
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2004-10-30 10:55:18 +04:00
|
|
|
|
|
|
|
/* copy the basic informations in the new PTL */
|
2004-11-18 03:23:19 +03:00
|
|
|
memcpy (ptl, &mca_ptl_gm_module, sizeof(mca_ptl_gm_module_t) );
|
2004-11-05 17:53:38 +03:00
|
|
|
#if OMPI_HAVE_POSIX_THREADS
|
2004-10-30 10:55:18 +04:00
|
|
|
ptl->thread.t_handle = (pthread_t)-1;
|
2004-11-05 17:53:38 +03:00
|
|
|
#endif /* OMPI_HAVE_POSIX_THREADS */
|
2004-10-30 10:55:18 +04:00
|
|
|
*pptl = ptl;
|
|
|
|
|
2004-07-19 23:45:06 +04:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2004-08-02 04:24:22 +04:00
|
|
|
* Register GM component addressing information. The MCA framework
|
2004-07-19 23:45:06 +04:00
|
|
|
* will make this available to all peers.
|
|
|
|
*/
|
|
|
|
static int
|
|
|
|
mca_ptl_gm_module_store_data_toexchange (void)
|
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
size_t i;
|
|
|
|
size_t size;
|
|
|
|
mca_ptl_gm_addr_t *addrs;
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
size = mca_ptl_gm_component.gm_num_ptl_modules * sizeof (mca_ptl_gm_addr_t);
|
2004-10-04 22:21:44 +04:00
|
|
|
addrs = (mca_ptl_gm_addr_t *)malloc (size);
|
2004-07-19 23:45:06 +04:00
|
|
|
|
|
|
|
if (NULL == addrs) {
|
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
for (i = 0; i < mca_ptl_gm_component.gm_num_ptl_modules; i++) {
|
|
|
|
mca_ptl_gm_module_t *ptl = mca_ptl_gm_component.gm_ptl_modules[i];
|
2005-04-10 20:20:04 +04:00
|
|
|
addrs[i].local_id = ptl->local_addr.local_id;
|
|
|
|
#if GM_API_VERSION > 0x200
|
|
|
|
addrs[i].global_id = ptl->local_addr.global_id;
|
|
|
|
#else
|
|
|
|
strncpy( addrs[i].global_id, ptl->local_addr.global_id, GM_MAX_HOST_NAME_LEN );
|
|
|
|
#endif /* GM_API_VERSION > 0x200 */
|
|
|
|
addrs[i].port_id = ptl->local_addr.port_id;
|
2004-07-19 23:45:06 +04:00
|
|
|
}
|
2005-08-05 22:03:30 +04:00
|
|
|
rc = mca_pml_base_modex_send (&mca_ptl_gm_component.super.ptlm_version, addrs, size);
|
2004-07-19 23:45:06 +04:00
|
|
|
free (addrs);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2004-11-05 17:53:38 +03:00
|
|
|
#if OMPI_HAVE_POSIX_THREADS
|
2004-10-30 10:55:18 +04:00
|
|
|
static void*
|
2005-07-04 02:45:48 +04:00
|
|
|
mca_ptl_gm_thread_progress( opal_thread_t* thread )
|
2004-07-19 23:45:06 +04:00
|
|
|
{
|
2004-10-30 10:55:18 +04:00
|
|
|
gm_recv_event_t *event;
|
|
|
|
mca_ptl_gm_module_t* ptl = thread->t_arg;
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
/* This thread enter in a cancel enabled state */
|
|
|
|
pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, NULL );
|
|
|
|
pthread_setcanceltype( PTHREAD_CANCEL_ASYNCHRONOUS, NULL );
|
2004-08-13 03:37:37 +04:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
while(1) {
|
2005-06-06 22:42:24 +04:00
|
|
|
event = gm_blocking_receive(ptl->gm_port);
|
|
|
|
if( GM_NO_RECV_EVENT != gm_ntohc(event->recv.type) )
|
|
|
|
mca_ptl_gm_analyze_recv_event( ptl, event );
|
2004-08-02 04:24:22 +04:00
|
|
|
}
|
2004-10-30 10:55:18 +04:00
|
|
|
return PTHREAD_CANCELED;
|
|
|
|
}
|
2004-11-05 17:53:38 +03:00
|
|
|
#endif /* OMPI_HAVE_POSIX_THREADS */
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2005-06-06 22:42:24 +04:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
/* Scan all ports on the boards. As it's difficult to find the total number of boards
|
|
|
|
* we use a predefined maximum.
|
|
|
|
* Return the number of discovered boards where opening a port was a succesfull operation.
|
|
|
|
*/
|
|
|
|
static int32_t
|
|
|
|
mca_ptl_gm_discover_boards( mca_ptl_gm_module_t** pptl,
|
|
|
|
uint32_t max_ptls, uint32_t max_boards, uint32_t max_port )
|
|
|
|
{
|
2005-04-10 20:20:04 +04:00
|
|
|
uint32_t board_no, port_no, index = 0, local_id;
|
2004-10-30 10:55:18 +04:00
|
|
|
struct gm_port* gm_port;
|
2005-04-10 20:20:04 +04:00
|
|
|
#if GM_API_VERSION > 0x200
|
2005-04-11 23:13:37 +04:00
|
|
|
uint32_t global_id;
|
2005-04-10 20:20:04 +04:00
|
|
|
#else
|
|
|
|
char global_id[GM_MAX_HOST_NAME_LEN];
|
|
|
|
#endif /* GM_API_VERSION > 0x200 */
|
2004-10-30 10:55:18 +04:00
|
|
|
|
|
|
|
for( board_no = 0; board_no < max_boards; board_no++ ) {
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
/* open the first available gm port for this board */
|
2004-10-30 10:55:18 +04:00
|
|
|
for( port_no = 2; port_no < max_port; port_no++ ) {
|
2005-03-19 02:58:36 +03:00
|
|
|
if (3 == port_no) {
|
|
|
|
continue; /* port 0,1,3 reserved */
|
|
|
|
} else if (GM_SUCCESS ==
|
|
|
|
gm_open(&gm_port, board_no, port_no,
|
|
|
|
mca_ptl_gm_component.gm_port_name,
|
2005-04-09 10:12:49 +04:00
|
|
|
OMPI_MCA_PTL_GM_API_VERSION) ) {
|
2004-10-30 10:55:18 +04:00
|
|
|
break;
|
2005-03-19 02:58:36 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if( port_no == max_port ) {
|
|
|
|
continue;
|
2004-10-30 10:55:18 +04:00
|
|
|
}
|
|
|
|
|
2004-07-19 23:45:06 +04:00
|
|
|
/* Get node local Id */
|
2004-10-30 10:55:18 +04:00
|
|
|
if( GM_SUCCESS != gm_get_node_id( gm_port, &local_id) ) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output (0, " failure to get local_id \n");
|
2004-10-30 10:55:18 +04:00
|
|
|
continue;
|
2004-07-19 23:45:06 +04:00
|
|
|
}
|
2005-04-10 20:20:04 +04:00
|
|
|
/* Gather an unique id for the node */
|
|
|
|
#if GM_API_VERSION > 0x200
|
2004-10-30 10:55:18 +04:00
|
|
|
if (GM_SUCCESS != gm_node_id_to_global_id( gm_port, local_id, &global_id) ) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output (0, " Error: Unable to get my GM global unique id \n");
|
2005-04-10 20:20:04 +04:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
{
|
|
|
|
if( GM_SUCCESS != gm_get_host_name( gm_port, global_id ) ) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output( 0, "Error: Unable to get the GM host name\n" );
|
2005-04-10 20:20:04 +04:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* GM_API_VERSION > 0x200 */
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
/* Create the ptl. If fail return the number of already created */
|
2005-03-19 02:58:36 +03:00
|
|
|
if( OMPI_SUCCESS != mca_ptl_gm_create( &(pptl[index]) ) ) {
|
2004-10-30 10:55:18 +04:00
|
|
|
return index;
|
2005-03-19 02:58:36 +03:00
|
|
|
}
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2005-04-10 20:20:04 +04:00
|
|
|
pptl[index]->gm_port = gm_port;
|
|
|
|
pptl[index]->local_addr.port_id = port_no;
|
|
|
|
pptl[index]->local_addr.local_id = local_id;
|
|
|
|
#if GM_API_VERSION > 0x200
|
|
|
|
pptl[index]->local_addr.global_id = global_id;
|
|
|
|
#else
|
|
|
|
strncpy( pptl[index]->local_addr.global_id, global_id, GM_MAX_HOST_NAME_LEN );
|
|
|
|
#endif /* GM_API_VERSION > 0x200 */
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
/* everything is OK let's mark it as usable and go to the next one */
|
2005-03-19 02:58:36 +03:00
|
|
|
if( (++index) >= max_ptls ) {
|
|
|
|
break;
|
|
|
|
}
|
2004-10-30 10:55:18 +04:00
|
|
|
}
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
return index;
|
|
|
|
}
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2005-03-19 02:58:36 +03:00
|
|
|
static int
|
2004-10-30 10:55:18 +04:00
|
|
|
mca_ptl_gm_init_sendrecv (mca_ptl_gm_module_t * ptl)
|
2004-07-19 23:45:06 +04:00
|
|
|
{
|
2004-10-30 10:55:18 +04:00
|
|
|
uint32_t i;
|
2004-08-13 03:37:37 +04:00
|
|
|
mca_ptl_gm_send_frag_t *sfragment;
|
2004-08-13 08:17:31 +04:00
|
|
|
mca_ptl_gm_recv_frag_t *free_rfragment;
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
ptl->num_send_tokens = gm_num_send_tokens (ptl->gm_port);
|
2004-11-18 03:23:19 +03:00
|
|
|
ptl->max_send_tokens = ptl->num_send_tokens;
|
2004-10-30 10:55:18 +04:00
|
|
|
ptl->num_send_tokens -= PTL_GM_ADMIN_SEND_TOKENS;
|
|
|
|
ptl->num_recv_tokens = gm_num_receive_tokens (ptl->gm_port);
|
2004-11-18 03:23:19 +03:00
|
|
|
ptl->max_recv_tokens = ptl->num_recv_tokens;
|
2004-10-30 10:55:18 +04:00
|
|
|
ptl->num_recv_tokens -= PTL_GM_ADMIN_RECV_TOKENS;
|
|
|
|
|
|
|
|
/****************SEND****************************/
|
|
|
|
/* construct a list of send fragments */
|
|
|
|
OBJ_CONSTRUCT (&(ptl->gm_send_frags), ompi_free_list_t);
|
2004-11-20 01:27:03 +03:00
|
|
|
OBJ_CONSTRUCT (&(ptl->gm_send_dma_frags), ompi_free_list_t);
|
2005-07-03 20:22:16 +04:00
|
|
|
OBJ_CONSTRUCT (&(ptl->gm_send_frags_queue), opal_list_t);
|
2004-10-30 10:55:18 +04:00
|
|
|
|
2004-11-18 23:21:25 +03:00
|
|
|
/* We need a free list just to handle the send fragment that we provide.
|
2004-11-20 01:27:03 +03:00
|
|
|
* Just to make sure that we dont waste memory, we dont allow this list to
|
|
|
|
* grow anymore.
|
2004-11-18 23:21:25 +03:00
|
|
|
*/
|
|
|
|
ompi_free_list_init( &(ptl->gm_send_frags),
|
2004-11-20 01:27:03 +03:00
|
|
|
sizeof (mca_ptl_gm_send_frag_t),
|
|
|
|
OBJ_CLASS (mca_ptl_gm_send_frag_t),
|
|
|
|
0, /* do not allocate any items I'll provide them */
|
|
|
|
0, /* maximum number of list allocated elements will be zero */
|
|
|
|
0,
|
|
|
|
NULL ); /* not using mpool */
|
|
|
|
/* A free list containing all DMA allocate memory.
|
|
|
|
* This free list does not have the right to allocate any new item
|
|
|
|
* as they should be allocated with a special GM function.
|
|
|
|
*/
|
|
|
|
ompi_free_list_init( &(ptl->gm_send_dma_frags),
|
2005-01-06 11:20:45 +03:00
|
|
|
mca_ptl_gm_component.gm_segment_size,
|
2005-07-03 20:22:16 +04:00
|
|
|
OBJ_CLASS (opal_list_item_t),
|
2004-11-20 01:27:03 +03:00
|
|
|
0, /* do not allocate any items I'll provide them */
|
2004-11-18 23:21:25 +03:00
|
|
|
0, /* maximum number of list allocated elements will be zero */
|
|
|
|
0,
|
|
|
|
NULL ); /* not using mpool */
|
2004-10-30 10:55:18 +04:00
|
|
|
|
|
|
|
/* allocate the elements */
|
2004-11-05 17:53:38 +03:00
|
|
|
sfragment = (mca_ptl_gm_send_frag_t *)calloc( ptl->num_send_tokens, sizeof(mca_ptl_gm_send_frag_t) );
|
2004-11-18 03:23:19 +03:00
|
|
|
ptl->gm_send_fragments = sfragment;
|
2004-10-30 10:55:18 +04:00
|
|
|
/* allocate the registered memory */
|
2004-11-18 03:23:19 +03:00
|
|
|
ptl->gm_send_dma_memory = gm_dma_malloc( ptl->gm_port,
|
2005-01-06 11:20:45 +03:00
|
|
|
(mca_ptl_gm_component.gm_segment_size * ptl->num_send_tokens) + GM_PAGE_LEN );
|
2004-11-18 03:23:19 +03:00
|
|
|
if( NULL == ptl->gm_send_dma_memory ) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output( 0, "unable to allocate registered memory\n" );
|
2005-03-26 21:49:16 +03:00
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
2004-10-30 10:55:18 +04:00
|
|
|
}
|
|
|
|
for (i = 0; i < ptl->num_send_tokens; i++) {
|
2005-03-26 21:49:16 +03:00
|
|
|
sfragment->send_buf = NULL;
|
2005-07-03 20:22:16 +04:00
|
|
|
OMPI_GM_FREE_LIST_RETURN( &(ptl->gm_send_frags), (opal_list_item_t*)sfragment );
|
2005-04-10 20:20:04 +04:00
|
|
|
OMPI_GM_FREE_LIST_RETURN( &(ptl->gm_send_dma_frags),
|
2005-07-03 20:22:16 +04:00
|
|
|
(opal_list_item_t*)((char*)ptl->gm_send_dma_memory +
|
2005-04-10 20:20:04 +04:00
|
|
|
i * mca_ptl_gm_component.gm_segment_size) );
|
2005-03-26 21:49:16 +03:00
|
|
|
sfragment++;
|
2004-10-30 10:55:18 +04:00
|
|
|
}
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
/*****************RECEIVE*****************************/
|
2004-11-20 01:27:03 +03:00
|
|
|
/* allow remote memory access */
|
2004-11-05 17:53:38 +03:00
|
|
|
if( GM_SUCCESS != gm_allow_remote_memory_access (ptl->gm_port) ) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output (0, "unable to allow remote memory access\n");
|
2004-10-30 10:55:18 +04:00
|
|
|
}
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2005-07-03 20:22:16 +04:00
|
|
|
OBJ_CONSTRUCT (&(ptl->gm_recv_outstanding_queue), opal_list_t);
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
/* construct the list of recv fragments free */
|
2005-04-11 22:10:42 +04:00
|
|
|
OBJ_CONSTRUCT (&(ptl->gm_recv_frags_free), ompi_free_list_t);
|
2004-11-18 03:23:19 +03:00
|
|
|
ompi_free_list_init( &(ptl->gm_recv_frags_free),
|
2005-03-26 21:49:16 +03:00
|
|
|
sizeof (mca_ptl_gm_recv_frag_t),
|
|
|
|
OBJ_CLASS (mca_ptl_gm_recv_frag_t),
|
|
|
|
0, /* by default I will provide all items */
|
2004-11-18 23:21:25 +03:00
|
|
|
ptl->num_recv_tokens * 10, /* the maximum number of items in the free list */
|
|
|
|
ptl->num_recv_tokens, /* if it need to allocate some more */
|
|
|
|
NULL );
|
2004-09-08 01:29:18 +04:00
|
|
|
|
2004-11-18 03:23:19 +03:00
|
|
|
/* allocate the elements */
|
2004-10-30 10:55:18 +04:00
|
|
|
free_rfragment = (mca_ptl_gm_recv_frag_t *)
|
2004-11-05 17:53:38 +03:00
|
|
|
calloc( ptl->num_recv_tokens, sizeof(mca_ptl_gm_recv_frag_t) );
|
2004-11-18 03:23:19 +03:00
|
|
|
ptl->gm_recv_fragments = free_rfragment;
|
2004-08-13 03:37:37 +04:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
/*allocate the registered memory */
|
2004-11-18 03:23:19 +03:00
|
|
|
ptl->gm_recv_dma_memory =
|
2005-03-26 21:49:16 +03:00
|
|
|
gm_dma_malloc( ptl->gm_port, (mca_ptl_gm_component.gm_segment_size * ptl->num_recv_tokens) + GM_PAGE_LEN );
|
2004-11-18 03:23:19 +03:00
|
|
|
if( NULL == ptl->gm_recv_dma_memory ) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output( 0, "unable to allocate registered memory for receive\n" );
|
2005-03-26 21:49:16 +03:00
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
2004-10-30 10:55:18 +04:00
|
|
|
}
|
2004-10-04 22:21:44 +04:00
|
|
|
|
2005-01-13 07:19:33 +03:00
|
|
|
for( i = 0; i < 2; i++ ) {
|
2005-07-03 20:22:16 +04:00
|
|
|
OMPI_GM_FREE_LIST_RETURN( &(ptl->gm_recv_frags_free), (opal_list_item_t *)free_rfragment );
|
2005-03-26 21:49:16 +03:00
|
|
|
free_rfragment++;
|
2005-01-13 07:19:33 +03:00
|
|
|
|
2005-03-26 21:49:16 +03:00
|
|
|
gm_provide_receive_buffer( ptl->gm_port, (char*)ptl->gm_recv_dma_memory + i * mca_ptl_gm_component.gm_segment_size,
|
|
|
|
GM_SIZE, GM_HIGH_PRIORITY );
|
2005-01-13 07:19:33 +03:00
|
|
|
}
|
|
|
|
for( i = 2; i < ptl->num_recv_tokens; i++ ) {
|
2005-07-03 20:22:16 +04:00
|
|
|
OMPI_GM_FREE_LIST_RETURN( &(ptl->gm_recv_frags_free), (opal_list_item_t *)free_rfragment );
|
2005-03-26 21:49:16 +03:00
|
|
|
free_rfragment++;
|
2004-10-04 22:21:44 +04:00
|
|
|
|
2005-03-26 21:49:16 +03:00
|
|
|
gm_provide_receive_buffer( ptl->gm_port, (char*)ptl->gm_recv_dma_memory + i * mca_ptl_gm_component.gm_segment_size,
|
|
|
|
GM_SIZE, GM_LOW_PRIORITY );
|
2004-07-19 23:45:06 +04:00
|
|
|
}
|
|
|
|
|
2005-07-03 20:22:16 +04:00
|
|
|
OBJ_CONSTRUCT( &(ptl->gm_pending_acks), opal_list_t );
|
2004-11-18 03:23:19 +03:00
|
|
|
|
2004-07-19 23:45:06 +04:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
2004-08-13 03:37:37 +04:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
static int
|
|
|
|
mca_ptl_gm_init( mca_ptl_gm_component_t * gm )
|
|
|
|
{
|
|
|
|
uint32_t index;
|
|
|
|
mca_ptl_gm_module_t* ptl;
|
2004-11-20 01:33:30 +03:00
|
|
|
uint32_t save_counter;
|
2004-10-30 10:55:18 +04:00
|
|
|
|
|
|
|
/* let's try to find if GM is available */
|
2004-12-22 10:20:05 +03:00
|
|
|
if( GM_SUCCESS != gm_init() ) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output( 0, "[%s:%d] error in initializing the gm library\n", __FILE__, __LINE__ );
|
2005-03-26 21:49:16 +03:00
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
2004-12-22 10:20:05 +03:00
|
|
|
}
|
2004-10-30 10:55:18 +04:00
|
|
|
/* First discover all available boards. For each board we will create a unique PTL */
|
|
|
|
mca_ptl_gm_component.gm_ptl_modules = calloc( mca_ptl_gm_component.gm_max_ptl_modules,
|
|
|
|
sizeof (mca_ptl_gm_module_t *));
|
2004-12-22 10:20:05 +03:00
|
|
|
if (NULL == mca_ptl_gm_component.gm_ptl_modules) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output( 0, "[%s:%d] error in initializing the gm PTL's.\n", __FILE__, __LINE__ );
|
2004-10-30 10:55:18 +04:00
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
2004-12-22 10:20:05 +03:00
|
|
|
}
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
mca_ptl_gm_component.gm_num_ptl_modules =
|
|
|
|
mca_ptl_gm_discover_boards( mca_ptl_gm_component.gm_ptl_modules,
|
2005-04-13 22:25:07 +04:00
|
|
|
mca_ptl_gm_component.gm_max_ptl_modules,
|
|
|
|
mca_ptl_gm_component.gm_max_boards_number,
|
|
|
|
mca_ptl_gm_component.gm_max_port_number );
|
2004-10-30 10:55:18 +04:00
|
|
|
|
2005-03-19 02:58:36 +03:00
|
|
|
/* In the case when we are in a multi-threaded environment each
|
|
|
|
* PTL will have its own thread. At this point all structures are
|
|
|
|
* correctly initialized, each thread will grab one and use it.
|
2004-10-30 10:55:18 +04:00
|
|
|
*/
|
2004-11-20 01:33:30 +03:00
|
|
|
for( index = 0; index < mca_ptl_gm_component.gm_num_ptl_modules; index++ ) {
|
|
|
|
ptl = mca_ptl_gm_component.gm_ptl_modules[index];
|
2005-03-19 02:58:36 +03:00
|
|
|
/* Now prepost some received and allocate some sends. After
|
|
|
|
* this step the PTL is fully initialized.
|
2004-11-20 01:33:30 +03:00
|
|
|
*/
|
|
|
|
if( OMPI_SUCCESS != mca_ptl_gm_init_sendrecv( ptl ) )
|
|
|
|
break;
|
2005-07-04 02:45:48 +04:00
|
|
|
if( opal_using_threads() ) {
|
2004-11-05 17:53:38 +03:00
|
|
|
#if OMPI_HAVE_POSIX_THREADS
|
2005-07-04 02:45:48 +04:00
|
|
|
ptl->thread.t_run = (opal_thread_fn_t)mca_ptl_gm_thread_progress;
|
2005-03-26 21:49:16 +03:00
|
|
|
ptl->thread.t_arg = (void*)ptl;
|
2004-11-05 17:53:38 +03:00
|
|
|
#endif /* OMPI_HAVE_POSIX_THREADS */
|
2005-07-04 02:45:48 +04:00
|
|
|
if( OMPI_SUCCESS != opal_thread_start( &(ptl->thread) ) ) {
|
2004-10-30 10:55:18 +04:00
|
|
|
break;
|
2005-03-19 02:58:36 +03:00
|
|
|
}
|
2004-11-20 01:33:30 +03:00
|
|
|
}
|
2004-10-30 10:55:18 +04:00
|
|
|
}
|
2004-11-20 01:33:30 +03:00
|
|
|
save_counter = index;
|
|
|
|
/* If we are unable to start all the required threads we update the total
|
|
|
|
* number of threads and call finalize for the others PTLs.
|
|
|
|
*/
|
|
|
|
for( ; index < mca_ptl_gm_component.gm_num_ptl_modules; index++ ) {
|
|
|
|
mca_ptl_base_module_t* ptl = (mca_ptl_base_module_t*)mca_ptl_gm_component.gm_ptl_modules[index];
|
|
|
|
ptl->ptl_finalize( ptl );
|
|
|
|
}
|
|
|
|
mca_ptl_gm_component.gm_num_ptl_modules = save_counter;
|
2004-10-30 10:55:18 +04:00
|
|
|
|
2005-03-26 21:49:16 +03:00
|
|
|
/* A free list containing all memory used for keep data for unexpected requests. */
|
2005-04-11 23:13:37 +04:00
|
|
|
OBJ_CONSTRUCT( &(mca_ptl_gm_component.gm_unexpected_frags_data), ompi_free_list_t );
|
2005-03-26 21:49:16 +03:00
|
|
|
ompi_free_list_init( &(mca_ptl_gm_component.gm_unexpected_frags_data),
|
|
|
|
mca_ptl_gm_component.gm_segment_size,
|
2005-07-03 20:22:16 +04:00
|
|
|
OBJ_CLASS (opal_list_item_t),
|
2005-06-06 22:42:24 +04:00
|
|
|
16, /* keep is small in the begining */
|
|
|
|
128, /* maximum number of list elements */
|
|
|
|
16, /* Number of elements to grow by per allocation */
|
2005-03-26 21:49:16 +03:00
|
|
|
NULL ); /* not using mpool */
|
2005-04-09 09:51:31 +04:00
|
|
|
#if OMPI_MCA_PTL_GM_CACHE_ENABLE
|
2005-04-10 04:31:23 +04:00
|
|
|
mca_ptl_gm_regcache_init();
|
2005-04-09 09:51:31 +04:00
|
|
|
#endif /* OMPI_MCA_PTL_GM_CACHE_ENABLE */
|
2004-10-30 10:55:18 +04:00
|
|
|
return (mca_ptl_gm_component.gm_num_ptl_modules > 0 ? OMPI_SUCCESS : OMPI_ERR_OUT_OF_RESOURCE);
|
|
|
|
}
|
2004-07-19 23:45:06 +04:00
|
|
|
|
|
|
|
/*
|
2004-08-02 04:24:22 +04:00
|
|
|
* Initialize the GM component,
|
2004-07-19 23:45:06 +04:00
|
|
|
* check how many boards are available and open ports on them.
|
|
|
|
*/
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_ptl_base_module_t **
|
|
|
|
mca_ptl_gm_component_init (int *num_ptl_modules,
|
2005-03-27 17:05:23 +04:00
|
|
|
bool enable_progress_threads,
|
|
|
|
bool enable_mpi_threads)
|
2004-07-19 23:45:06 +04:00
|
|
|
{
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_ptl_base_module_t **ptls;
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
*num_ptl_modules = 0;
|
2004-11-20 01:33:30 +03:00
|
|
|
|
2004-10-30 10:55:18 +04:00
|
|
|
if (OMPI_SUCCESS != mca_ptl_gm_init (&mca_ptl_gm_component)) {
|
2005-07-04 03:31:27 +04:00
|
|
|
/*opal_output( 0, "[%s:%d] error in initializing gm state and PTL's. (%d PTL's)\n",
|
2005-04-10 04:31:23 +04:00
|
|
|
__FILE__, __LINE__, mca_ptl_gm_component.gm_num_ptl_modules );*/
|
2004-07-19 23:45:06 +04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2004-08-13 03:37:37 +04:00
|
|
|
/* publish GM parameters with the MCA framework */
|
|
|
|
if (OMPI_SUCCESS != mca_ptl_gm_module_store_data_toexchange ())
|
|
|
|
return 0;
|
|
|
|
|
2004-07-19 23:45:06 +04:00
|
|
|
/* return array of PTLs */
|
2004-08-13 03:37:37 +04:00
|
|
|
ptls = (mca_ptl_base_module_t**) malloc (
|
2004-08-13 08:17:31 +04:00
|
|
|
mca_ptl_gm_component.gm_num_ptl_modules * sizeof(mca_ptl_base_module_t *));
|
2004-08-02 04:24:22 +04:00
|
|
|
if (NULL == ptls) {
|
2004-07-19 23:45:06 +04:00
|
|
|
return NULL;
|
2004-08-02 04:24:22 +04:00
|
|
|
}
|
2004-07-19 23:45:06 +04:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
memcpy (ptls, mca_ptl_gm_component.gm_ptl_modules,
|
2004-08-13 08:17:31 +04:00
|
|
|
mca_ptl_gm_component.gm_num_ptl_modules * sizeof(mca_ptl_gm_module_t *));
|
2004-08-02 04:24:22 +04:00
|
|
|
*num_ptl_modules = mca_ptl_gm_component.gm_num_ptl_modules;
|
2004-07-19 23:45:06 +04:00
|
|
|
return ptls;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* GM module control
|
|
|
|
*/
|
|
|
|
|
|
|
|
int
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_ptl_gm_component_control (int param, void *value, size_t size)
|
2004-07-19 23:45:06 +04:00
|
|
|
{
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2004-12-22 03:14:31 +03:00
|
|
|
char* gm_get_local_buffer( void )
|
|
|
|
{
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_item_t* item;
|
2005-03-26 21:49:16 +03:00
|
|
|
int rc;
|
|
|
|
|
|
|
|
OMPI_FREE_LIST_WAIT( &(mca_ptl_gm_component.gm_unexpected_frags_data), item, rc );
|
|
|
|
return (char*)item;
|
2004-12-22 03:14:31 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void gm_release_local_buffer( char* ptr )
|
|
|
|
{
|
2005-07-03 20:22:16 +04:00
|
|
|
OMPI_GM_FREE_LIST_RETURN( &(mca_ptl_gm_component.gm_unexpected_frags_data), (opal_list_item_t*)ptr );
|
2004-12-22 03:14:31 +03:00
|
|
|
}
|
2004-07-19 23:45:06 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* GM module progress.
|
|
|
|
*/
|
2004-11-18 03:23:19 +03:00
|
|
|
|
2004-07-19 23:45:06 +04:00
|
|
|
int
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_ptl_gm_component_progress (mca_ptl_tstamp_t tstamp)
|
2004-07-19 23:45:06 +04:00
|
|
|
{
|
2004-11-18 03:23:19 +03:00
|
|
|
uint32_t i;
|
|
|
|
gm_recv_event_t *event;
|
|
|
|
mca_ptl_gm_module_t *ptl;
|
|
|
|
|
2005-04-16 01:22:46 +04:00
|
|
|
for( i = 0; i < mca_ptl_gm_component.gm_num_ptl_modules;) {
|
2004-11-18 03:23:19 +03:00
|
|
|
ptl = mca_ptl_gm_component.gm_ptl_modules[i];
|
|
|
|
event = gm_receive(ptl->gm_port);
|
|
|
|
/* If there are no receive events just skip the function call */
|
|
|
|
if( GM_NO_RECV_EVENT != gm_ntohc(event->recv.type) ) {
|
2005-06-06 22:42:24 +04:00
|
|
|
if( 1 == mca_ptl_gm_analyze_recv_event( ptl, event ) ) {
|
|
|
|
/* we try to empty the GM event queue */
|
|
|
|
continue;
|
|
|
|
}
|
2004-11-18 03:23:19 +03:00
|
|
|
}
|
2005-04-16 01:22:46 +04:00
|
|
|
i++;
|
2004-11-18 03:23:19 +03:00
|
|
|
}
|
|
|
|
return OMPI_SUCCESS;
|
2004-07-19 23:45:06 +04:00
|
|
|
}
|