2012-04-25 00:19:06 +04:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2005-05-24 02:06:50 +04:00
|
|
|
/*
|
2010-03-13 02:57:50 +03:00
|
|
|
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
|
2005-11-05 22:57:48 +03:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2012-07-24 04:20:24 +04:00
|
|
|
* Copyright (c) 2004-2012 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-09-10 08:06:49 +04:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2005-05-24 02:06:50 +04:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2008-05-30 05:29:09 +04:00
|
|
|
* Copyright (c) 2008 UT-Battelle, LLC. All rights reserved.
|
2008-11-05 00:58:06 +03:00
|
|
|
* Copyright (c) 2006-2008 University of Houston. All rights reserved.
|
2010-09-18 03:04:06 +04:00
|
|
|
* Copyright (c) 2009-2010 Oracle and/or its affiliates. All rights reserved
|
2012-02-06 21:35:21 +04:00
|
|
|
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
|
2012-04-25 00:19:15 +04:00
|
|
|
* Copyright (c) 2011-2012 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2012-07-24 17:03:55 +04:00
|
|
|
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
2005-05-24 02:06:50 +04:00
|
|
|
* $COPYRIGHT$
|
2005-09-10 08:06:49 +04:00
|
|
|
*
|
2005-05-24 02:06:50 +04:00
|
|
|
* Additional copyrights may follow
|
2005-09-10 08:06:49 +04:00
|
|
|
*
|
2005-05-24 02:06:50 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2009-03-04 01:25:13 +03:00
|
|
|
#include "opal/class/opal_bitmap.h"
|
2010-09-21 01:22:33 +04:00
|
|
|
#include "opal/util/output.h"
|
2013-02-13 01:10:11 +04:00
|
|
|
#include "opal/util/show_help.h"
|
2012-07-24 17:47:24 +04:00
|
|
|
#include "opal_stdint.h"
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 04:47:28 +04:00
|
|
|
#include "opal/mca/btl/btl.h"
|
|
|
|
#include "opal/mca/btl/base/base.h"
|
2010-09-21 01:22:33 +04:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/mca/pml/pml.h"
|
2007-03-17 02:11:45 +03:00
|
|
|
#include "ompi/mca/pml/base/base.h"
|
2007-02-09 19:38:16 +03:00
|
|
|
#include "ompi/mca/pml/base/base.h"
|
2010-09-21 01:22:33 +04:00
|
|
|
#include "ompi/mca/bml/base/base.h"
|
|
|
|
#include "ompi/runtime/ompi_cr.h"
|
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
#include "pml_ob1.h"
|
|
|
|
#include "pml_ob1_component.h"
|
|
|
|
#include "pml_ob1_comm.h"
|
|
|
|
#include "pml_ob1_hdr.h"
|
2005-06-02 01:09:43 +04:00
|
|
|
#include "pml_ob1_recvfrag.h"
|
2005-07-12 09:40:56 +04:00
|
|
|
#include "pml_ob1_sendreq.h"
|
|
|
|
#include "pml_ob1_recvreq.h"
|
|
|
|
#include "pml_ob1_rdmafrag.h"
|
2007-04-19 07:05:12 +04:00
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
mca_pml_ob1_t mca_pml_ob1 = {
|
|
|
|
{
|
2007-07-11 03:45:23 +04:00
|
|
|
mca_pml_ob1_add_procs,
|
|
|
|
mca_pml_ob1_del_procs,
|
|
|
|
mca_pml_ob1_enable,
|
|
|
|
mca_pml_ob1_progress,
|
|
|
|
mca_pml_ob1_add_comm,
|
|
|
|
mca_pml_ob1_del_comm,
|
|
|
|
mca_pml_ob1_irecv_init,
|
|
|
|
mca_pml_ob1_irecv,
|
|
|
|
mca_pml_ob1_recv,
|
|
|
|
mca_pml_ob1_isend_init,
|
|
|
|
mca_pml_ob1_isend,
|
|
|
|
mca_pml_ob1_send,
|
|
|
|
mca_pml_ob1_iprobe,
|
|
|
|
mca_pml_ob1_probe,
|
|
|
|
mca_pml_ob1_start,
|
2012-02-06 21:35:21 +04:00
|
|
|
mca_pml_ob1_improbe,
|
|
|
|
mca_pml_ob1_mprobe,
|
|
|
|
mca_pml_ob1_imrecv,
|
|
|
|
mca_pml_ob1_mrecv,
|
2007-07-11 03:45:23 +04:00
|
|
|
mca_pml_ob1_dump,
|
|
|
|
mca_pml_ob1_ft_event,
|
2009-08-22 09:21:01 +04:00
|
|
|
65535,
|
2007-07-11 03:45:23 +04:00
|
|
|
INT_MAX
|
2005-05-24 02:06:50 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-11-01 16:19:40 +04:00
|
|
|
#if OPAL_CUDA_SUPPORT
|
2013-08-22 01:00:09 +04:00
|
|
|
void mca_pml_ob1_cuda_add_ipc_support(struct mca_btl_base_module_t* btl,
|
|
|
|
int32_t flags, ompi_proc_t* errproc,
|
|
|
|
char* btlinfo);
|
2013-11-01 16:19:40 +04:00
|
|
|
#endif /* OPAL_CUDA_SUPPORT */
|
2006-08-17 00:56:22 +04:00
|
|
|
|
2007-07-11 03:45:23 +04:00
|
|
|
void mca_pml_ob1_error_handler( struct mca_btl_base_module_t* btl,
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 04:47:28 +04:00
|
|
|
int32_t flags, opal_proc_t* errproc,
|
2010-05-19 15:55:45 +04:00
|
|
|
char* btlinfo );
|
2006-08-17 00:56:22 +04:00
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
int mca_pml_ob1_enable(bool enable)
|
|
|
|
{
|
2009-02-12 00:48:11 +03:00
|
|
|
if( false == enable ) {
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
2007-07-11 03:45:23 +04:00
|
|
|
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_ob1.lock, opal_mutex_t);
|
|
|
|
|
|
|
|
/* fragments */
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_ob1.rdma_frags, ompi_free_list_t);
|
2007-11-02 02:38:50 +03:00
|
|
|
ompi_free_list_init_new( &mca_pml_ob1.rdma_frags,
|
2007-07-11 03:45:23 +04:00
|
|
|
sizeof(mca_pml_ob1_rdma_frag_t),
|
2010-07-06 18:33:36 +04:00
|
|
|
opal_cache_line_size,
|
2007-07-11 03:45:23 +04:00
|
|
|
OBJ_CLASS(mca_pml_ob1_rdma_frag_t),
|
2010-07-06 18:33:36 +04:00
|
|
|
0,opal_cache_line_size,
|
2007-07-11 03:45:23 +04:00
|
|
|
mca_pml_ob1.free_list_num,
|
|
|
|
mca_pml_ob1.free_list_max,
|
|
|
|
mca_pml_ob1.free_list_inc,
|
|
|
|
NULL );
|
|
|
|
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_ob1.recv_frags, ompi_free_list_t);
|
|
|
|
|
2007-11-02 02:38:50 +03:00
|
|
|
ompi_free_list_init_new( &mca_pml_ob1.recv_frags,
|
2007-07-11 03:45:23 +04:00
|
|
|
sizeof(mca_pml_ob1_recv_frag_t) + mca_pml_ob1.unexpected_limit,
|
2010-07-06 18:33:36 +04:00
|
|
|
opal_cache_line_size,
|
2007-07-11 03:45:23 +04:00
|
|
|
OBJ_CLASS(mca_pml_ob1_recv_frag_t),
|
2010-07-06 18:33:36 +04:00
|
|
|
0,opal_cache_line_size,
|
2007-07-11 03:45:23 +04:00
|
|
|
mca_pml_ob1.free_list_num,
|
|
|
|
mca_pml_ob1.free_list_max,
|
|
|
|
mca_pml_ob1.free_list_inc,
|
|
|
|
NULL );
|
|
|
|
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_ob1.pending_pckts, ompi_free_list_t);
|
2007-11-02 02:38:50 +03:00
|
|
|
ompi_free_list_init_new( &mca_pml_ob1.pending_pckts,
|
2007-07-11 03:45:23 +04:00
|
|
|
sizeof(mca_pml_ob1_pckt_pending_t),
|
2010-07-06 18:33:36 +04:00
|
|
|
opal_cache_line_size,
|
2007-07-11 03:45:23 +04:00
|
|
|
OBJ_CLASS(mca_pml_ob1_pckt_pending_t),
|
2010-07-06 18:33:36 +04:00
|
|
|
0,opal_cache_line_size,
|
2007-07-11 03:45:23 +04:00
|
|
|
mca_pml_ob1.free_list_num,
|
|
|
|
mca_pml_ob1.free_list_max,
|
|
|
|
mca_pml_ob1.free_list_inc,
|
|
|
|
NULL );
|
|
|
|
|
|
|
|
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_ob1.buffers, ompi_free_list_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_ob1.send_ranges, ompi_free_list_t);
|
2007-11-02 02:38:50 +03:00
|
|
|
ompi_free_list_init_new( &mca_pml_ob1.send_ranges,
|
2007-07-11 03:45:23 +04:00
|
|
|
sizeof(mca_pml_ob1_send_range_t) +
|
|
|
|
(mca_pml_ob1.max_send_per_range - 1) * sizeof(mca_pml_ob1_com_btl_t),
|
2010-07-06 18:33:36 +04:00
|
|
|
opal_cache_line_size,
|
2007-07-11 03:45:23 +04:00
|
|
|
OBJ_CLASS(mca_pml_ob1_send_range_t),
|
2010-07-06 18:33:36 +04:00
|
|
|
0,opal_cache_line_size,
|
2007-07-11 03:45:23 +04:00
|
|
|
mca_pml_ob1.free_list_num,
|
|
|
|
mca_pml_ob1.free_list_max,
|
|
|
|
mca_pml_ob1.free_list_inc,
|
|
|
|
NULL );
|
|
|
|
|
|
|
|
/* pending operations */
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_ob1.send_pending, opal_list_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_ob1.recv_pending, opal_list_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_ob1.pckt_pending, opal_list_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_ob1.rdma_pending, opal_list_t);
|
2012-04-25 00:18:56 +04:00
|
|
|
|
2008-09-16 03:04:18 +04:00
|
|
|
/* missing communicator pending list */
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_ob1.non_existing_communicator_pending, opal_list_t);
|
2007-07-11 03:45:23 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If we get here this is the PML who get selected for the run. We
|
|
|
|
* should get ownership for the send and receive requests list, and
|
|
|
|
* initialize them with the size of our own requests.
|
|
|
|
*/
|
2007-11-02 02:38:50 +03:00
|
|
|
ompi_free_list_init_new( &mca_pml_base_send_requests,
|
2007-08-20 16:06:27 +04:00
|
|
|
sizeof(mca_pml_ob1_send_request_t) +
|
|
|
|
(mca_pml_ob1.max_rdma_per_request - 1) *
|
|
|
|
sizeof(mca_pml_ob1_com_btl_t),
|
2010-07-06 18:33:36 +04:00
|
|
|
opal_cache_line_size,
|
2007-07-11 03:45:23 +04:00
|
|
|
OBJ_CLASS(mca_pml_ob1_send_request_t),
|
2010-07-06 18:33:36 +04:00
|
|
|
0,opal_cache_line_size,
|
2007-07-11 03:45:23 +04:00
|
|
|
mca_pml_ob1.free_list_num,
|
|
|
|
mca_pml_ob1.free_list_max,
|
|
|
|
mca_pml_ob1.free_list_inc,
|
|
|
|
NULL );
|
|
|
|
|
2007-11-02 02:38:50 +03:00
|
|
|
ompi_free_list_init_new( &mca_pml_base_recv_requests,
|
2007-08-20 16:06:27 +04:00
|
|
|
sizeof(mca_pml_ob1_recv_request_t) +
|
|
|
|
(mca_pml_ob1.max_rdma_per_request - 1) *
|
|
|
|
sizeof(mca_pml_ob1_com_btl_t),
|
2010-07-06 18:33:36 +04:00
|
|
|
opal_cache_line_size,
|
2007-07-11 03:45:23 +04:00
|
|
|
OBJ_CLASS(mca_pml_ob1_recv_request_t),
|
2010-07-06 18:33:36 +04:00
|
|
|
0,opal_cache_line_size,
|
2007-07-11 03:45:23 +04:00
|
|
|
mca_pml_ob1.free_list_num,
|
|
|
|
mca_pml_ob1.free_list_max,
|
|
|
|
mca_pml_ob1.free_list_inc,
|
|
|
|
NULL );
|
|
|
|
|
2005-09-10 08:06:49 +04:00
|
|
|
mca_pml_ob1.enabled = true;
|
2005-05-24 02:06:50 +04:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
int mca_pml_ob1_add_comm(ompi_communicator_t* comm)
|
|
|
|
{
|
|
|
|
/* allocate pml specific comm data */
|
|
|
|
mca_pml_ob1_comm_t* pml_comm = OBJ_NEW(mca_pml_ob1_comm_t);
|
2008-11-05 00:58:06 +03:00
|
|
|
opal_list_item_t *item, *next_item;
|
2008-09-16 03:04:18 +04:00
|
|
|
mca_pml_ob1_recv_frag_t* frag;
|
|
|
|
mca_pml_ob1_comm_proc_t* pml_proc;
|
|
|
|
mca_pml_ob1_match_hdr_t* hdr;
|
2005-05-24 02:06:50 +04:00
|
|
|
int i;
|
|
|
|
|
|
|
|
if (NULL == pml_comm) {
|
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2009-04-30 23:23:57 +04:00
|
|
|
|
|
|
|
/* should never happen, but it was, so check */
|
|
|
|
if (comm->c_contextid > mca_pml_ob1.super.pml_max_contextid) {
|
|
|
|
OBJ_RELEASE(pml_comm);
|
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
mca_pml_ob1_comm_init_size(pml_comm, comm->c_remote_group->grp_proc_count);
|
|
|
|
comm->c_pml_comm = pml_comm;
|
|
|
|
|
2006-09-21 02:14:46 +04:00
|
|
|
for( i = 0; i < comm->c_remote_group->grp_proc_count; i++ ) {
|
2007-08-04 04:41:26 +04:00
|
|
|
pml_comm->procs[i].ompi_proc = ompi_group_peer_lookup(comm->c_remote_group,i);
|
2010-04-23 19:14:55 +04:00
|
|
|
OBJ_RETAIN(pml_comm->procs[i].ompi_proc);
|
2005-08-12 06:41:14 +04:00
|
|
|
}
|
2008-09-16 03:04:18 +04:00
|
|
|
/* Grab all related messages from the non_existing_communicator pending queue */
|
|
|
|
for( item = opal_list_get_first(&mca_pml_ob1.non_existing_communicator_pending);
|
|
|
|
item != opal_list_get_end(&mca_pml_ob1.non_existing_communicator_pending);
|
2008-11-05 00:58:06 +03:00
|
|
|
item = next_item ) {
|
2008-09-16 03:04:18 +04:00
|
|
|
frag = (mca_pml_ob1_recv_frag_t*)item;
|
2008-11-05 00:58:06 +03:00
|
|
|
next_item = opal_list_get_next(item);
|
2008-09-16 03:04:18 +04:00
|
|
|
hdr = &frag->hdr.hdr_match;
|
|
|
|
|
|
|
|
/* Is this fragment for the current communicator ? */
|
|
|
|
if( frag->hdr.hdr_match.hdr_ctx != comm->c_contextid )
|
|
|
|
continue;
|
|
|
|
|
2009-01-03 18:15:42 +03:00
|
|
|
/* As we now know we work on a fragment for this communicator
|
|
|
|
* we should remove it from the
|
|
|
|
* non_existing_communicator_pending list. */
|
|
|
|
opal_list_remove_item( &mca_pml_ob1.non_existing_communicator_pending,
|
|
|
|
item );
|
2008-09-16 03:04:18 +04:00
|
|
|
|
|
|
|
add_fragment_to_unexpected:
|
2008-11-05 00:58:06 +03:00
|
|
|
|
2008-09-16 03:04:18 +04:00
|
|
|
/* We generate the MSG_ARRIVED event as soon as the PML is aware
|
|
|
|
* of a matching fragment arrival. Independing if it is received
|
|
|
|
* on the correct order or not. This will allow the tools to
|
|
|
|
* figure out if the messages are not received in the correct
|
|
|
|
* order (if multiple network interfaces).
|
|
|
|
*/
|
|
|
|
PERUSE_TRACE_MSG_EVENT(PERUSE_COMM_MSG_ARRIVED, comm,
|
|
|
|
hdr->hdr_src, hdr->hdr_tag, PERUSE_RECV);
|
|
|
|
|
|
|
|
/* There is no matching to be done, and no lock to be held on the communicator as
|
|
|
|
* we know at this point that the communicator has not yet been returned to the user.
|
|
|
|
* The only required protection is around the non_existing_communicator_pending queue.
|
|
|
|
* We just have to push the fragment into the unexpected list of the corresponding
|
|
|
|
* proc, or into the out-of-order (cant_match) list.
|
|
|
|
*/
|
|
|
|
pml_proc = &(pml_comm->procs[hdr->hdr_src]);
|
|
|
|
|
|
|
|
if( ((uint16_t)hdr->hdr_seq) == ((uint16_t)pml_proc->expected_sequence) ) {
|
|
|
|
/* We're now expecting the next sequence number. */
|
|
|
|
pml_proc->expected_sequence++;
|
|
|
|
opal_list_append( &pml_proc->unexpected_frags, (opal_list_item_t*)frag );
|
|
|
|
PERUSE_TRACE_MSG_EVENT(PERUSE_COMM_MSG_INSERT_IN_UNEX_Q, comm,
|
|
|
|
hdr->hdr_src, hdr->hdr_tag, PERUSE_RECV);
|
|
|
|
/* And now the ugly part. As some fragments can be inserted in the cant_match list,
|
|
|
|
* every time we succesfully add a fragment in the unexpected list we have to make
|
|
|
|
* sure the next one is not in the cant_match. Otherwise, we will endup in a deadlock
|
|
|
|
* situation as the cant_match is only checked when a new fragment is received from
|
|
|
|
* the network.
|
|
|
|
*/
|
|
|
|
for(frag = (mca_pml_ob1_recv_frag_t *)opal_list_get_first(&pml_proc->frags_cant_match);
|
|
|
|
frag != (mca_pml_ob1_recv_frag_t *)opal_list_get_end(&pml_proc->frags_cant_match);
|
|
|
|
frag = (mca_pml_ob1_recv_frag_t *)opal_list_get_next(frag)) {
|
|
|
|
hdr = &frag->hdr.hdr_match;
|
|
|
|
/* If the message has the next expected seq from that proc... */
|
|
|
|
if(hdr->hdr_seq != pml_proc->expected_sequence)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
opal_list_remove_item(&pml_proc->frags_cant_match, (opal_list_item_t*)frag);
|
|
|
|
goto add_fragment_to_unexpected;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
opal_list_append( &pml_proc->frags_cant_match, (opal_list_item_t*)frag );
|
|
|
|
}
|
|
|
|
}
|
2005-05-24 02:06:50 +04:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
int mca_pml_ob1_del_comm(ompi_communicator_t* comm)
|
|
|
|
{
|
2009-04-10 20:32:02 +04:00
|
|
|
mca_pml_ob1_comm_t* pml_comm = comm->c_pml_comm;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for( i = 0; i < comm->c_remote_group->grp_proc_count; i++ ) {
|
|
|
|
OBJ_RELEASE(pml_comm->procs[i].ompi_proc);
|
|
|
|
}
|
2005-05-24 02:06:50 +04:00
|
|
|
OBJ_RELEASE(comm->c_pml_comm);
|
|
|
|
comm->c_pml_comm = NULL;
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2008-09-30 19:47:43 +04:00
|
|
|
* For each proc setup a datastructure that indicates the BTLs
|
2005-05-24 02:06:50 +04:00
|
|
|
* that can be used to reach the destination.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
int mca_pml_ob1_add_procs(ompi_proc_t** procs, size_t nprocs)
|
|
|
|
{
|
2009-03-04 01:25:13 +03:00
|
|
|
opal_bitmap_t reachable;
|
2005-05-24 02:06:50 +04:00
|
|
|
int rc;
|
2009-08-10 16:46:20 +04:00
|
|
|
opal_list_item_t *item;
|
2005-09-10 08:06:49 +04:00
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
if(nprocs == 0)
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
|
2009-03-04 01:25:13 +03:00
|
|
|
OBJ_CONSTRUCT(&reachable, opal_bitmap_t);
|
|
|
|
rc = opal_bitmap_init(&reachable, (int)nprocs);
|
2005-05-24 02:06:50 +04:00
|
|
|
if(OMPI_SUCCESS != rc)
|
|
|
|
return rc;
|
|
|
|
|
2007-03-17 02:11:45 +03:00
|
|
|
/*
|
|
|
|
* JJH: Disable this in FT enabled builds since
|
|
|
|
* we use a wrapper PML. It will cause this check to
|
|
|
|
* return failure as all processes will return the wrapper PML
|
|
|
|
* component in use instead of the wrapped PML component underneath.
|
|
|
|
*/
|
2010-03-13 02:57:50 +03:00
|
|
|
#if OPAL_ENABLE_FT_CR == 0
|
2007-02-09 19:38:16 +03:00
|
|
|
/* make sure remote procs are using the same PML as us */
|
|
|
|
if (OMPI_SUCCESS != (rc = mca_pml_base_pml_check_selected("ob1",
|
|
|
|
procs,
|
|
|
|
nprocs))) {
|
|
|
|
return rc;
|
|
|
|
}
|
2007-03-17 02:11:45 +03:00
|
|
|
#endif
|
2007-02-09 19:38:16 +03:00
|
|
|
|
2007-07-01 20:17:43 +04:00
|
|
|
rc = mca_bml.bml_add_procs( nprocs,
|
|
|
|
procs,
|
|
|
|
&reachable );
|
2005-09-10 08:06:49 +04:00
|
|
|
if(OMPI_SUCCESS != rc)
|
2007-07-01 20:17:43 +04:00
|
|
|
goto cleanup_and_return;
|
2005-09-10 08:06:49 +04:00
|
|
|
|
2009-08-10 16:46:20 +04:00
|
|
|
/* Check that values supplied by all initialized btls will work
|
|
|
|
for us. Note that this is the list of all initialized BTLs,
|
|
|
|
not the ones used for the just added procs. This is a little
|
|
|
|
overkill and inaccurate, as we may end up not using the BTL in
|
|
|
|
question and all add_procs calls after the first one are
|
|
|
|
duplicating an already completed check. But the final
|
|
|
|
initialization of the PML occurs before the final
|
|
|
|
initialization of the BTLs, and iterating through the in-use
|
|
|
|
BTLs requires iterating over the procs, as the BML does not
|
|
|
|
expose all currently in use btls. */
|
|
|
|
|
|
|
|
for (item = opal_list_get_first(&mca_btl_base_modules_initialized) ;
|
|
|
|
item != opal_list_get_end(&mca_btl_base_modules_initialized) ;
|
|
|
|
item = opal_list_get_next(item)) {
|
|
|
|
mca_btl_base_selected_module_t *sm =
|
|
|
|
(mca_btl_base_selected_module_t*) item;
|
|
|
|
if (sm->btl_module->btl_eager_limit < sizeof(mca_pml_ob1_hdr_t)) {
|
2013-02-13 01:10:11 +04:00
|
|
|
opal_show_help("help-mpi-pml-ob1.txt", "eager_limit_too_small",
|
2012-04-25 00:18:45 +04:00
|
|
|
true,
|
|
|
|
sm->btl_component->btl_version.mca_component_name,
|
2013-01-28 03:25:10 +04:00
|
|
|
ompi_process_info.nodename,
|
2012-04-25 00:18:45 +04:00
|
|
|
sm->btl_component->btl_version.mca_component_name,
|
|
|
|
sm->btl_module->btl_eager_limit,
|
|
|
|
sm->btl_component->btl_version.mca_component_name,
|
|
|
|
sizeof(mca_pml_ob1_hdr_t),
|
|
|
|
sm->btl_component->btl_version.mca_component_name);
|
2009-08-10 16:46:20 +04:00
|
|
|
rc = OMPI_ERR_BAD_PARAM;
|
|
|
|
goto cleanup_and_return;
|
|
|
|
}
|
2013-12-06 18:35:10 +04:00
|
|
|
#if OPAL_CUDA_GDR_SUPPORT
|
2013-11-13 17:22:39 +04:00
|
|
|
/* If size is SIZE_MAX, then we know we want to set this to the minimum possible
|
|
|
|
* value which is the size of the PML header. */
|
|
|
|
if (SIZE_MAX == sm->btl_module->btl_cuda_eager_limit) {
|
|
|
|
sm->btl_module->btl_cuda_eager_limit = sizeof(mca_pml_ob1_hdr_t);
|
|
|
|
}
|
2013-12-14 01:25:07 +04:00
|
|
|
/* If size is 0, then this value is unused. If it is non-zero then do some
|
|
|
|
* extra checking of it. */
|
2013-11-13 17:22:39 +04:00
|
|
|
if (0 != sm->btl_module->btl_cuda_eager_limit) {
|
|
|
|
if (sm->btl_module->btl_cuda_eager_limit < sizeof(mca_pml_ob1_hdr_t)) {
|
|
|
|
opal_show_help("help-mpi-pml-ob1.txt", "cuda_eager_limit_too_small",
|
|
|
|
true,
|
|
|
|
sm->btl_component->btl_version.mca_component_name,
|
|
|
|
ompi_process_info.nodename,
|
|
|
|
sm->btl_component->btl_version.mca_component_name,
|
|
|
|
sm->btl_module->btl_cuda_eager_limit,
|
|
|
|
sm->btl_component->btl_version.mca_component_name,
|
|
|
|
sizeof(mca_pml_ob1_hdr_t),
|
|
|
|
sm->btl_component->btl_version.mca_component_name);
|
|
|
|
rc = OMPI_ERR_BAD_PARAM;
|
|
|
|
goto cleanup_and_return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (0 == sm->btl_module->btl_cuda_rdma_limit) {
|
|
|
|
/* All is fine. 0 means to ignore value so set to SIZE_MAX */
|
|
|
|
sm->btl_module->btl_cuda_rdma_limit = SIZE_MAX;
|
|
|
|
} else {
|
|
|
|
if (sm->btl_module->btl_cuda_rdma_limit < sm->btl_module->btl_cuda_eager_limit) {
|
|
|
|
opal_show_help("help-mpi-pml-ob1.txt", "cuda_rdma_limit_too_small",
|
|
|
|
true,
|
|
|
|
sm->btl_component->btl_version.mca_component_name,
|
|
|
|
ompi_process_info.nodename,
|
|
|
|
sm->btl_component->btl_version.mca_component_name,
|
|
|
|
sm->btl_module->btl_cuda_rdma_limit,
|
|
|
|
sm->btl_component->btl_version.mca_component_name,
|
|
|
|
sm->btl_module->btl_cuda_eager_limit,
|
|
|
|
sm->btl_component->btl_version.mca_component_name);
|
|
|
|
rc = OMPI_ERR_BAD_PARAM;
|
|
|
|
goto cleanup_and_return;
|
|
|
|
}
|
|
|
|
}
|
2013-12-06 18:35:10 +04:00
|
|
|
#endif /* OPAL_CUDA_GDR_SUPPORT */
|
2009-08-10 16:46:20 +04:00
|
|
|
}
|
|
|
|
|
2010-09-21 01:22:33 +04:00
|
|
|
|
2009-04-10 20:32:02 +04:00
|
|
|
/* TODO: Move these callback registration to another place */
|
2008-05-30 05:29:09 +04:00
|
|
|
rc = mca_bml.bml_register( MCA_PML_OB1_HDR_TYPE_MATCH,
|
|
|
|
mca_pml_ob1_recv_frag_callback_match,
|
|
|
|
NULL );
|
|
|
|
if(OMPI_SUCCESS != rc)
|
|
|
|
goto cleanup_and_return;
|
|
|
|
|
|
|
|
rc = mca_bml.bml_register( MCA_PML_OB1_HDR_TYPE_RNDV,
|
|
|
|
mca_pml_ob1_recv_frag_callback_rndv,
|
|
|
|
NULL );
|
|
|
|
if(OMPI_SUCCESS != rc)
|
|
|
|
goto cleanup_and_return;
|
|
|
|
|
|
|
|
rc = mca_bml.bml_register( MCA_PML_OB1_HDR_TYPE_RGET,
|
|
|
|
mca_pml_ob1_recv_frag_callback_rget,
|
|
|
|
NULL );
|
|
|
|
if(OMPI_SUCCESS != rc)
|
|
|
|
goto cleanup_and_return;
|
|
|
|
|
|
|
|
rc = mca_bml.bml_register( MCA_PML_OB1_HDR_TYPE_ACK,
|
|
|
|
mca_pml_ob1_recv_frag_callback_ack,
|
|
|
|
NULL );
|
|
|
|
if(OMPI_SUCCESS != rc)
|
|
|
|
goto cleanup_and_return;
|
|
|
|
|
|
|
|
rc = mca_bml.bml_register( MCA_PML_OB1_HDR_TYPE_FRAG,
|
|
|
|
mca_pml_ob1_recv_frag_callback_frag,
|
|
|
|
NULL );
|
|
|
|
if(OMPI_SUCCESS != rc)
|
|
|
|
goto cleanup_and_return;
|
|
|
|
|
|
|
|
rc = mca_bml.bml_register( MCA_PML_OB1_HDR_TYPE_PUT,
|
|
|
|
mca_pml_ob1_recv_frag_callback_put,
|
|
|
|
NULL );
|
|
|
|
if(OMPI_SUCCESS != rc)
|
|
|
|
goto cleanup_and_return;
|
|
|
|
|
|
|
|
rc = mca_bml.bml_register( MCA_PML_OB1_HDR_TYPE_FIN,
|
|
|
|
mca_pml_ob1_recv_frag_callback_fin,
|
2007-07-01 20:17:43 +04:00
|
|
|
NULL );
|
|
|
|
if(OMPI_SUCCESS != rc)
|
|
|
|
goto cleanup_and_return;
|
2006-08-17 00:56:22 +04:00
|
|
|
|
|
|
|
/* register error handlers */
|
|
|
|
rc = mca_bml.bml_register_error(mca_pml_ob1_error_handler);
|
2007-07-01 20:17:43 +04:00
|
|
|
if(OMPI_SUCCESS != rc)
|
|
|
|
goto cleanup_and_return;
|
2006-08-17 00:56:22 +04:00
|
|
|
|
2007-07-01 20:17:43 +04:00
|
|
|
cleanup_and_return:
|
2006-02-27 14:06:01 +03:00
|
|
|
OBJ_DESTRUCT(&reachable);
|
2007-07-01 20:17:43 +04:00
|
|
|
|
2005-09-10 08:06:49 +04:00
|
|
|
return rc;
|
2005-05-24 02:06:50 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* iterate through each proc and notify any PTLs associated
|
|
|
|
* with the proc that it is/has gone away
|
|
|
|
*/
|
|
|
|
|
|
|
|
int mca_pml_ob1_del_procs(ompi_proc_t** procs, size_t nprocs)
|
|
|
|
{
|
2005-08-12 06:41:14 +04:00
|
|
|
return mca_bml.bml_del_procs(nprocs, procs);
|
2005-05-24 02:06:50 +04:00
|
|
|
}
|
|
|
|
|
2006-03-17 21:46:48 +03:00
|
|
|
/*
|
|
|
|
* diagnostics
|
|
|
|
*/
|
|
|
|
|
2012-07-24 04:19:18 +04:00
|
|
|
static void mca_pml_ob1_dump_hdr(mca_pml_ob1_hdr_t* hdr)
|
|
|
|
{
|
|
|
|
char *type, header[128];
|
|
|
|
|
|
|
|
switch(hdr->hdr_common.hdr_type) {
|
|
|
|
case MCA_PML_OB1_HDR_TYPE_MATCH:
|
|
|
|
type = "MATCH";
|
|
|
|
snprintf( header, 128, "ctx %5d src %d tag %d seq %d",
|
|
|
|
hdr->hdr_match.hdr_ctx, hdr->hdr_match.hdr_src,
|
|
|
|
hdr->hdr_match.hdr_tag, hdr->hdr_match.hdr_seq);
|
|
|
|
break;
|
|
|
|
case MCA_PML_OB1_HDR_TYPE_RNDV:
|
|
|
|
type = "RNDV";
|
2012-07-24 17:03:55 +04:00
|
|
|
snprintf( header, 128, "ctx %5d src %d tag %d seq %d msg_length %" PRIu64,
|
2012-07-24 04:19:18 +04:00
|
|
|
hdr->hdr_rndv.hdr_match.hdr_ctx, hdr->hdr_rndv.hdr_match.hdr_src,
|
|
|
|
hdr->hdr_rndv.hdr_match.hdr_tag, hdr->hdr_rndv.hdr_match.hdr_seq,
|
|
|
|
hdr->hdr_rndv.hdr_msg_length);
|
|
|
|
break;
|
|
|
|
case MCA_PML_OB1_HDR_TYPE_RGET:
|
|
|
|
type = "RGET";
|
2012-07-24 17:03:55 +04:00
|
|
|
snprintf( header, 128, "ctx %5d src %d tag %d seq %d msg_length %" PRIu64
|
|
|
|
"seg_cnt %d hdr_des %" PRIu64,
|
2012-07-24 04:19:18 +04:00
|
|
|
hdr->hdr_rndv.hdr_match.hdr_ctx, hdr->hdr_rndv.hdr_match.hdr_src,
|
|
|
|
hdr->hdr_rndv.hdr_match.hdr_tag, hdr->hdr_rndv.hdr_match.hdr_seq,
|
|
|
|
hdr->hdr_rndv.hdr_msg_length,
|
|
|
|
hdr->hdr_rget.hdr_seg_cnt, hdr->hdr_rget.hdr_des.lval);
|
|
|
|
break;
|
|
|
|
case MCA_PML_OB1_HDR_TYPE_ACK:
|
|
|
|
type = "ACK";
|
2012-07-24 17:03:55 +04:00
|
|
|
snprintf( header, 128, "src_req %p dst_req %p offset %" PRIu64,
|
2012-07-24 04:19:18 +04:00
|
|
|
hdr->hdr_ack.hdr_src_req.pval, hdr->hdr_ack.hdr_dst_req.pval,
|
|
|
|
hdr->hdr_ack.hdr_send_offset);
|
|
|
|
break;
|
|
|
|
case MCA_PML_OB1_HDR_TYPE_FRAG:
|
|
|
|
type = "FRAG";
|
2012-07-24 17:03:55 +04:00
|
|
|
snprintf( header, 128, "offset %" PRIu64 " src_req %p dst_req %p",
|
2012-07-24 04:19:18 +04:00
|
|
|
hdr->hdr_frag.hdr_frag_offset,
|
|
|
|
hdr->hdr_frag.hdr_src_req.pval, hdr->hdr_frag.hdr_dst_req.pval);
|
|
|
|
break;
|
|
|
|
case MCA_PML_OB1_HDR_TYPE_PUT:
|
|
|
|
type = "PUT";
|
2012-07-24 17:03:55 +04:00
|
|
|
snprintf( header, 128, "seg_cnt %d dst_req %p src_des %p recv_req %p offset %" PRIu64 " [%p %" PRIu64 "]",
|
2012-07-24 04:19:18 +04:00
|
|
|
hdr->hdr_rdma.hdr_seg_cnt, hdr->hdr_rdma.hdr_req.pval, hdr->hdr_rdma.hdr_des.pval,
|
|
|
|
hdr->hdr_rdma.hdr_recv_req.pval, hdr->hdr_rdma.hdr_rdma_offset,
|
|
|
|
hdr->hdr_rdma.hdr_segs[0].seg_addr.pval, hdr->hdr_rdma.hdr_segs[0].seg_len);
|
|
|
|
break;
|
|
|
|
case MCA_PML_OB1_HDR_TYPE_FIN:
|
|
|
|
type = "FIN";
|
2012-09-26 13:44:46 +04:00
|
|
|
header[0] = '\0';
|
2012-07-24 04:19:18 +04:00
|
|
|
break;
|
|
|
|
default:
|
2012-09-26 13:44:46 +04:00
|
|
|
type = "UNKWN";
|
|
|
|
header[0] = '\0';
|
2012-07-24 04:19:18 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
opal_output(0,"hdr %s [%s] %s", type,
|
|
|
|
(hdr->hdr_common.hdr_flags & MCA_PML_OB1_HDR_FLAGS_NBO ? "nbo" : " "),
|
|
|
|
header);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mca_pml_ob1_dump_frag_list(opal_list_t* queue, bool is_req)
|
|
|
|
{
|
|
|
|
opal_list_item_t* item;
|
|
|
|
char cpeer[64], ctag[64];
|
|
|
|
|
|
|
|
for( item = opal_list_get_first(queue);
|
|
|
|
item != opal_list_get_end(queue);
|
|
|
|
item = opal_list_get_next(item) ) {
|
|
|
|
|
|
|
|
if( is_req ) {
|
|
|
|
mca_pml_base_request_t *req = &(((mca_pml_ob1_recv_request_t*)item)->req_recv.req_base);
|
|
|
|
|
|
|
|
if( OMPI_ANY_SOURCE == req->req_peer ) snprintf(cpeer, 64, "%s", "ANY_SOURCE");
|
|
|
|
else snprintf(cpeer, 64, "%d", req->req_peer);
|
|
|
|
|
|
|
|
if( OMPI_ANY_TAG == req->req_tag ) snprintf(ctag, 64, "%s", "ANY_TAG");
|
|
|
|
else snprintf(ctag, 64, "%d", req->req_tag);
|
|
|
|
|
2012-07-24 17:03:55 +04:00
|
|
|
opal_output(0, "req %p peer %s tag %s addr %p count %lu datatype %s [%p] [%s %s] req_seq %" PRIu64,
|
|
|
|
(void*) req, cpeer, ctag,
|
|
|
|
(void*) req->req_addr, req->req_count,
|
|
|
|
(0 != req->req_count ? req->req_datatype->name : "N/A"),
|
|
|
|
(void*) req->req_datatype,
|
2012-07-24 04:19:18 +04:00
|
|
|
(req->req_pml_complete ? "pml_complete" : ""),
|
|
|
|
(req->req_free_called ? "freed" : ""),
|
|
|
|
req->req_sequence);
|
|
|
|
} else {
|
|
|
|
mca_pml_ob1_recv_frag_t* frag = (mca_pml_ob1_recv_frag_t*)item;
|
|
|
|
mca_pml_ob1_dump_hdr( &frag->hdr );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-03-20 18:41:45 +03:00
|
|
|
int mca_pml_ob1_dump(struct ompi_communicator_t* comm, int verbose)
|
2006-03-17 21:46:48 +03:00
|
|
|
{
|
|
|
|
struct mca_pml_comm_t* pml_comm = comm->c_pml_comm;
|
2007-02-02 09:47:35 +03:00
|
|
|
int i;
|
2006-03-17 21:46:48 +03:00
|
|
|
|
2012-07-24 04:19:18 +04:00
|
|
|
/* TODO: don't forget to dump mca_pml_ob1.non_existing_communicator_pending */
|
|
|
|
|
|
|
|
opal_output(0, "Communicator %s [%p](%d) rank %d recv_seq %d num_procs %lu last_probed %lu\n",
|
2012-07-24 17:03:55 +04:00
|
|
|
comm->c_name, (void*) comm, comm->c_contextid, comm->c_my_rank,
|
2012-07-24 04:19:18 +04:00
|
|
|
pml_comm->recv_sequence, pml_comm->num_procs, pml_comm->last_probed);
|
|
|
|
if( opal_list_get_size(&pml_comm->wild_receives) ) {
|
|
|
|
opal_output(0, "expected MPI_ANY_SOURCE fragments\n");
|
|
|
|
mca_pml_ob1_dump_frag_list(&pml_comm->wild_receives, true);
|
|
|
|
}
|
|
|
|
|
2006-03-17 21:46:48 +03:00
|
|
|
/* iterate through all procs on communicator */
|
2007-02-02 09:47:35 +03:00
|
|
|
for( i = 0; i < (int)pml_comm->num_procs; i++ ) {
|
2006-03-17 21:46:48 +03:00
|
|
|
mca_pml_ob1_comm_proc_t* proc = &pml_comm->procs[i];
|
2013-08-30 20:54:55 +04:00
|
|
|
mca_bml_base_endpoint_t* ep = (mca_bml_base_endpoint_t*)proc->ompi_proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_BML];
|
2006-03-17 21:46:48 +03:00
|
|
|
size_t n;
|
|
|
|
|
2012-07-24 04:19:18 +04:00
|
|
|
opal_output(0, "[Rank %d] expected_seq %d ompi_proc %p send_seq %d\n",
|
2012-07-24 17:03:55 +04:00
|
|
|
i, proc->expected_sequence, (void*) proc->ompi_proc,
|
|
|
|
proc->send_sequence);
|
2006-03-17 21:46:48 +03:00
|
|
|
/* dump all receive queues */
|
2012-07-24 04:19:18 +04:00
|
|
|
if( opal_list_get_size(&proc->specific_receives) ) {
|
|
|
|
opal_output(0, "expected specific receives\n");
|
|
|
|
mca_pml_ob1_dump_frag_list(&proc->specific_receives, true);
|
|
|
|
}
|
|
|
|
if( opal_list_get_size(&proc->frags_cant_match) ) {
|
|
|
|
opal_output(0, "out of sequence\n");
|
|
|
|
mca_pml_ob1_dump_frag_list(&proc->frags_cant_match, false);
|
|
|
|
}
|
|
|
|
if( opal_list_get_size(&proc->unexpected_frags) ) {
|
|
|
|
opal_output(0, "unexpected frag\n");
|
|
|
|
mca_pml_ob1_dump_frag_list(&proc->unexpected_frags, false);
|
|
|
|
}
|
|
|
|
/* dump all btls used for eager messages */
|
|
|
|
for( n = 0; n < ep->btl_eager.arr_size; n++ ) {
|
2006-03-21 21:18:22 +03:00
|
|
|
mca_bml_base_btl_t* bml_btl = &ep->btl_eager.bml_btls[n];
|
2006-03-17 21:46:48 +03:00
|
|
|
bml_btl->btl->btl_dump(bml_btl->btl, bml_btl->btl_endpoint, verbose);
|
|
|
|
}
|
|
|
|
}
|
2006-03-20 18:41:45 +03:00
|
|
|
return OMPI_SUCCESS;
|
2006-03-17 21:46:48 +03:00
|
|
|
}
|
|
|
|
|
2007-07-11 03:45:23 +04:00
|
|
|
static void mca_pml_ob1_fin_completion( mca_btl_base_module_t* btl,
|
|
|
|
struct mca_btl_base_endpoint_t* ep,
|
|
|
|
struct mca_btl_base_descriptor_t* des,
|
|
|
|
int status )
|
2006-07-20 18:44:35 +04:00
|
|
|
{
|
|
|
|
|
|
|
|
mca_bml_base_btl_t* bml_btl = (mca_bml_base_btl_t*) des->des_context;
|
|
|
|
|
|
|
|
/* check for pending requests */
|
|
|
|
MCA_PML_OB1_PROGRESS_PENDING(bml_btl);
|
|
|
|
}
|
|
|
|
|
2009-04-07 20:48:58 +04:00
|
|
|
/**
|
|
|
|
* Send an FIN to the peer. If we fail to send this ack (no more available
|
|
|
|
* fragments or the send failed) this function automatically add the FIN
|
|
|
|
* to the list of pending FIN, Which guarantee that the FIN will be sent
|
|
|
|
* later.
|
|
|
|
*/
|
2007-07-11 03:45:23 +04:00
|
|
|
int mca_pml_ob1_send_fin( ompi_proc_t* proc,
|
|
|
|
mca_bml_base_btl_t* bml_btl,
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 04:47:28 +04:00
|
|
|
opal_ptr_t hdr_des,
|
2007-07-11 03:45:23 +04:00
|
|
|
uint8_t order,
|
|
|
|
uint32_t status )
|
2006-07-20 18:44:35 +04:00
|
|
|
{
|
|
|
|
mca_btl_base_descriptor_t* fin;
|
|
|
|
mca_pml_ob1_fin_hdr_t* hdr;
|
|
|
|
int rc;
|
|
|
|
|
2007-12-09 17:08:01 +03:00
|
|
|
mca_bml_base_alloc(bml_btl, &fin, order, sizeof(mca_pml_ob1_fin_hdr_t),
|
2008-10-23 00:13:33 +04:00
|
|
|
MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
|
2007-12-09 16:58:17 +03:00
|
|
|
|
2006-07-20 18:44:35 +04:00
|
|
|
if(NULL == fin) {
|
2007-06-03 12:31:58 +04:00
|
|
|
MCA_PML_OB1_ADD_FIN_TO_PENDING(proc, hdr_des, bml_btl, order, status);
|
2006-07-20 18:44:35 +04:00
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
fin->des_cbfunc = mca_pml_ob1_fin_completion;
|
|
|
|
fin->des_cbdata = NULL;
|
|
|
|
|
|
|
|
/* fill in header */
|
2014-07-10 20:31:15 +04:00
|
|
|
hdr = (mca_pml_ob1_fin_hdr_t*)fin->des_local->seg_addr.pval;
|
2006-07-20 18:44:35 +04:00
|
|
|
hdr->hdr_common.hdr_flags = 0;
|
|
|
|
hdr->hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_FIN;
|
2010-04-23 19:14:55 +04:00
|
|
|
hdr->hdr_des = hdr_des;
|
2007-06-03 12:31:58 +04:00
|
|
|
hdr->hdr_fail = status;
|
2006-07-20 18:44:35 +04:00
|
|
|
|
2007-12-16 11:45:44 +03:00
|
|
|
ob1_hdr_hton(hdr, MCA_PML_OB1_HDR_TYPE_FIN, proc);
|
2006-07-20 18:44:35 +04:00
|
|
|
|
|
|
|
/* queue request */
|
2008-05-30 05:29:09 +04:00
|
|
|
rc = mca_bml_base_send( bml_btl,
|
|
|
|
fin,
|
|
|
|
MCA_PML_OB1_HDR_TYPE_FIN );
|
2008-05-30 07:58:39 +04:00
|
|
|
if( OPAL_LIKELY( rc >= 0 ) ) {
|
|
|
|
if( OPAL_LIKELY( 1 == rc ) ) {
|
|
|
|
MCA_PML_OB1_PROGRESS_PENDING(bml_btl);
|
|
|
|
}
|
|
|
|
return OMPI_SUCCESS;
|
2006-07-20 18:44:35 +04:00
|
|
|
}
|
2008-05-30 07:58:39 +04:00
|
|
|
mca_bml_base_free(bml_btl, fin);
|
|
|
|
MCA_PML_OB1_ADD_FIN_TO_PENDING(proc, hdr_des, bml_btl, order, status);
|
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
2006-07-20 18:44:35 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void mca_pml_ob1_process_pending_packets(mca_bml_base_btl_t* bml_btl)
|
|
|
|
{
|
|
|
|
mca_pml_ob1_pckt_pending_t *pckt;
|
2006-10-20 07:57:44 +04:00
|
|
|
int32_t i, rc, s = (int32_t)opal_list_get_size(&mca_pml_ob1.pckt_pending);
|
2006-07-20 18:44:35 +04:00
|
|
|
|
|
|
|
for(i = 0; i < s; i++) {
|
2006-12-03 13:12:09 +03:00
|
|
|
mca_bml_base_btl_t *send_dst = NULL;
|
2006-07-20 18:44:35 +04:00
|
|
|
OPAL_THREAD_LOCK(&mca_pml_ob1.lock);
|
|
|
|
pckt = (mca_pml_ob1_pckt_pending_t*)
|
|
|
|
opal_list_remove_first(&mca_pml_ob1.pckt_pending);
|
|
|
|
OPAL_THREAD_UNLOCK(&mca_pml_ob1.lock);
|
|
|
|
if(NULL == pckt)
|
|
|
|
break;
|
2006-12-03 13:12:09 +03:00
|
|
|
if(pckt->bml_btl != NULL &&
|
|
|
|
pckt->bml_btl->btl == bml_btl->btl) {
|
|
|
|
send_dst = pckt->bml_btl;
|
|
|
|
} else {
|
2013-08-30 20:54:55 +04:00
|
|
|
mca_bml_base_endpoint_t* endpoint =
|
|
|
|
(mca_bml_base_endpoint_t*) pckt->proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_BML];
|
2006-12-03 13:12:09 +03:00
|
|
|
send_dst = mca_bml_base_btl_array_find(
|
2013-08-30 20:54:55 +04:00
|
|
|
&endpoint->btl_eager, bml_btl->btl);
|
2006-12-03 13:12:09 +03:00
|
|
|
}
|
2006-10-26 17:21:47 +04:00
|
|
|
if(NULL == send_dst) {
|
|
|
|
OPAL_THREAD_LOCK(&mca_pml_ob1.lock);
|
|
|
|
opal_list_append(&mca_pml_ob1.pckt_pending,
|
2009-04-07 20:48:58 +04:00
|
|
|
(opal_list_item_t*)pckt);
|
2006-10-26 17:21:47 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&mca_pml_ob1.lock);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2006-07-20 18:44:35 +04:00
|
|
|
switch(pckt->hdr.hdr_common.hdr_type) {
|
|
|
|
case MCA_PML_OB1_HDR_TYPE_ACK:
|
|
|
|
rc = mca_pml_ob1_recv_request_ack_send_btl(pckt->proc,
|
2006-10-26 17:21:47 +04:00
|
|
|
send_dst,
|
2007-01-05 01:07:37 +03:00
|
|
|
pckt->hdr.hdr_ack.hdr_src_req.lval,
|
|
|
|
pckt->hdr.hdr_ack.hdr_dst_req.pval,
|
2008-03-27 11:56:43 +03:00
|
|
|
pckt->hdr.hdr_ack.hdr_send_offset,
|
|
|
|
pckt->hdr.hdr_common.hdr_flags & MCA_PML_OB1_HDR_FLAGS_NORDMA);
|
2012-04-06 18:23:13 +04:00
|
|
|
if( OPAL_UNLIKELY(OMPI_ERR_OUT_OF_RESOURCE == rc) ) {
|
2009-04-07 01:45:08 +04:00
|
|
|
OPAL_THREAD_LOCK(&mca_pml_ob1.lock);
|
|
|
|
opal_list_append(&mca_pml_ob1.pckt_pending,
|
|
|
|
(opal_list_item_t*)pckt);
|
|
|
|
OPAL_THREAD_UNLOCK(&mca_pml_ob1.lock);
|
2006-07-20 18:44:35 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MCA_PML_OB1_HDR_TYPE_FIN:
|
2007-05-28 10:51:12 +04:00
|
|
|
rc = mca_pml_ob1_send_fin(pckt->proc, send_dst,
|
2010-04-23 19:14:55 +04:00
|
|
|
pckt->hdr.hdr_fin.hdr_des,
|
2007-06-03 12:31:58 +04:00
|
|
|
pckt->order,
|
|
|
|
pckt->hdr.hdr_fin.hdr_fail);
|
2012-04-06 18:23:13 +04:00
|
|
|
if( OPAL_UNLIKELY(OMPI_ERR_OUT_OF_RESOURCE == rc) ) {
|
2009-04-07 01:45:08 +04:00
|
|
|
return;
|
|
|
|
}
|
2006-07-20 18:44:35 +04:00
|
|
|
break;
|
|
|
|
default:
|
2008-06-09 18:53:58 +04:00
|
|
|
opal_output(0, "[%s:%d] wrong header type\n",
|
2009-04-07 01:45:08 +04:00
|
|
|
__FILE__, __LINE__);
|
2006-07-20 18:44:35 +04:00
|
|
|
break;
|
|
|
|
}
|
2009-04-07 01:45:08 +04:00
|
|
|
/* We're done with this packet, return it back to the free list */
|
|
|
|
MCA_PML_OB1_PCKT_PENDING_RETURN(pckt);
|
2006-07-20 18:44:35 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void mca_pml_ob1_process_pending_rdma(void)
|
|
|
|
{
|
|
|
|
mca_pml_ob1_rdma_frag_t* frag;
|
2006-10-20 07:57:44 +04:00
|
|
|
int32_t i, rc, s = (int32_t)opal_list_get_size(&mca_pml_ob1.rdma_pending);
|
2006-07-20 18:44:35 +04:00
|
|
|
|
|
|
|
for(i = 0; i < s; i++) {
|
|
|
|
OPAL_THREAD_LOCK(&mca_pml_ob1.lock);
|
|
|
|
frag = (mca_pml_ob1_rdma_frag_t*)
|
|
|
|
opal_list_remove_first(&mca_pml_ob1.rdma_pending);
|
|
|
|
OPAL_THREAD_UNLOCK(&mca_pml_ob1.lock);
|
|
|
|
if(NULL == frag)
|
|
|
|
break;
|
2012-04-25 00:18:56 +04:00
|
|
|
|
|
|
|
frag->retries++;
|
|
|
|
|
2006-07-20 18:44:35 +04:00
|
|
|
if(frag->rdma_state == MCA_PML_OB1_RDMA_PUT) {
|
|
|
|
rc = mca_pml_ob1_send_request_put_frag(frag);
|
|
|
|
} else {
|
|
|
|
rc = mca_pml_ob1_recv_request_get_frag(frag);
|
|
|
|
}
|
2012-04-06 18:23:13 +04:00
|
|
|
if(OMPI_ERR_OUT_OF_RESOURCE == rc)
|
2006-07-20 18:44:35 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2006-08-17 00:56:22 +04:00
|
|
|
|
|
|
|
|
2009-08-06 02:23:26 +04:00
|
|
|
void mca_pml_ob1_error_handler(
|
2010-05-19 15:55:45 +04:00
|
|
|
struct mca_btl_base_module_t* btl, int32_t flags,
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 04:47:28 +04:00
|
|
|
opal_proc_t* errproc, char* btlinfo ) {
|
2013-11-01 16:19:40 +04:00
|
|
|
#if OPAL_CUDA_SUPPORT
|
2013-08-22 01:00:09 +04:00
|
|
|
if (flags & MCA_BTL_ERROR_FLAGS_ADD_CUDA_IPC) {
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 04:47:28 +04:00
|
|
|
mca_pml_ob1_cuda_add_ipc_support(btl, flags, (struct ompi_proc_t*)errproc, btlinfo);
|
2013-08-22 01:00:09 +04:00
|
|
|
return;
|
|
|
|
}
|
2013-11-01 16:19:40 +04:00
|
|
|
#endif /* OPAL_CUDA_SUPPORT */
|
2014-02-28 20:20:54 +04:00
|
|
|
ompi_rte_abort(-1, btlinfo);
|
2006-08-17 00:56:22 +04:00
|
|
|
}
|
2007-04-05 17:52:05 +04:00
|
|
|
|
2010-03-13 02:57:50 +03:00
|
|
|
#if OPAL_ENABLE_FT_CR == 0
|
2008-10-16 19:09:00 +04:00
|
|
|
int mca_pml_ob1_ft_event( int state ) {
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
#else
|
2007-04-05 17:52:05 +04:00
|
|
|
int mca_pml_ob1_ft_event( int state )
|
|
|
|
{
|
2008-10-16 19:09:00 +04:00
|
|
|
static bool first_continue_pass = false;
|
2007-06-19 04:46:16 +04:00
|
|
|
ompi_proc_t** procs = NULL;
|
2007-04-19 07:05:12 +04:00
|
|
|
size_t num_procs;
|
|
|
|
int ret, p;
|
2013-01-28 03:25:10 +04:00
|
|
|
ompi_rte_collective_t *coll, *modex;
|
2007-04-05 17:52:05 +04:00
|
|
|
|
2013-01-28 03:25:10 +04:00
|
|
|
coll = OBJ_NEW(ompi_rte_collective_t);
|
|
|
|
coll->id = ompi_process_info.peer_init_barrier;
|
2007-04-05 17:52:05 +04:00
|
|
|
if(OPAL_CRS_CHECKPOINT == state) {
|
2008-10-16 19:09:00 +04:00
|
|
|
if( opal_cr_timing_barrier_enabled ) {
|
|
|
|
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_CRCPBR1);
|
2013-01-28 03:25:10 +04:00
|
|
|
ompi_rte_barrier(coll);
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
OMPI_WAIT_FOR_COMPLETION(coll->active);
|
2008-10-16 19:09:00 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2P0);
|
2007-04-05 17:52:05 +04:00
|
|
|
}
|
|
|
|
else if(OPAL_CRS_CONTINUE == state) {
|
2008-10-16 19:09:00 +04:00
|
|
|
first_continue_pass = !first_continue_pass;
|
|
|
|
|
|
|
|
if( !first_continue_pass ) {
|
|
|
|
if( opal_cr_timing_barrier_enabled ) {
|
|
|
|
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_COREBR0);
|
2013-01-28 03:25:10 +04:00
|
|
|
ompi_rte_barrier(coll);
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
OMPI_WAIT_FOR_COMPLETION(coll->active);
|
2008-10-16 19:09:00 +04:00
|
|
|
}
|
|
|
|
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2P2);
|
|
|
|
}
|
|
|
|
|
2012-06-27 05:28:28 +04:00
|
|
|
if( orte_cr_continue_like_restart && !first_continue_pass ) {
|
2008-10-16 19:09:00 +04:00
|
|
|
/*
|
|
|
|
* Get a list of processes
|
|
|
|
*/
|
|
|
|
procs = ompi_proc_all(&num_procs);
|
|
|
|
if(NULL == procs) {
|
2012-07-10 03:34:13 +04:00
|
|
|
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
goto clean;
|
2008-10-16 19:09:00 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Refresh the proc structure, and publish our proc info in the modex.
|
|
|
|
* NOTE: Do *not* call ompi_proc_finalize as there are many places in
|
|
|
|
* the code that point to indv. procs in this strucutre. For our
|
|
|
|
* needs here we only need to fix up the modex, bml and pml
|
|
|
|
* references.
|
|
|
|
*/
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_proc_refresh())) {
|
|
|
|
opal_output(0,
|
|
|
|
"pml:ob1: ft_event(Restart): proc_refresh Failed %d",
|
|
|
|
ret);
|
2009-02-12 00:48:11 +03:00
|
|
|
for(p = 0; p < (int)num_procs; ++p) {
|
|
|
|
OBJ_RELEASE(procs[p]);
|
|
|
|
}
|
2008-10-16 19:09:00 +04:00
|
|
|
free (procs);
|
2012-07-10 03:34:13 +04:00
|
|
|
goto clean;
|
2008-10-16 19:09:00 +04:00
|
|
|
}
|
|
|
|
}
|
2007-04-05 17:52:05 +04:00
|
|
|
}
|
2008-04-24 21:54:22 +04:00
|
|
|
else if(OPAL_CRS_RESTART_PRE == state ) {
|
|
|
|
/* Nothing here */
|
|
|
|
}
|
|
|
|
else if(OPAL_CRS_RESTART == state ) {
|
2007-04-19 07:05:12 +04:00
|
|
|
/*
|
|
|
|
* Get a list of processes
|
|
|
|
*/
|
|
|
|
procs = ompi_proc_all(&num_procs);
|
|
|
|
if(NULL == procs) {
|
2012-07-10 03:34:13 +04:00
|
|
|
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
goto clean;
|
2007-04-19 07:05:12 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Clean out the modex information since it is invalid now.
|
2013-01-28 03:25:10 +04:00
|
|
|
* ompi_rte_purge_proc_attrs();
|
2012-06-27 05:28:28 +04:00
|
|
|
* This happens at the ORTE level, so doing it again here will cause
|
2008-04-23 04:17:12 +04:00
|
|
|
* some issues with socket caching.
|
2007-04-19 07:05:12 +04:00
|
|
|
*/
|
2008-04-23 04:17:12 +04:00
|
|
|
|
2007-04-19 07:05:12 +04:00
|
|
|
|
These changes were mostly captured in a prior RFC (except for #2 below) and are aimed specifically at improving startup performance and setting up the remaining modifications described in that RFC.
The commit has been tested for C/R and Cray operations, and on Odin (SLURM, rsh) and RoadRunner (TM). I tried to update all environments, but obviously could not test them. I know that Windows needs some work, and have highlighted what is know to be needed in the odls process component.
This represents a lot of work by Brian, Tim P, Josh, and myself, with much advice from Jeff and others. For posterity, I have appended a copy of the email describing the work that was done:
As we have repeatedly noted, the modex operation in MPI_Init is the single greatest consumer of time during startup. To-date, we have executed that operation as an ORTE stage gate that held the process until a startup message containing all required modex (and OOB contact info - see #3 below) info could be sent to it. Each process would send its data to the HNP's registry, which assembled and sent the message when all processes had reported in.
In addition, ORTE had taken responsibility for monitoring process status as it progressed through a series of "stage gates". The process reported its status at each gate, and ORTE would then send a "release" message once all procs had reported in.
The incoming changes revamp these procedures in three ways:
1. eliminating the ORTE stage gate system and cleanly delineating responsibility between the OMPI and ORTE layers for MPI init/finalize. The modex stage gate (STG1) has been replaced by a collective operation in the modex itself that performs an allgather on the required modex info. The allgather is implemented using the orte_grpcomm framework since the BTL's are not active at that point. At the moment, the grpcomm framework only has a "basic" component analogous to OMPI's "basic" coll framework - I would recommend that the MPI team create additional, more advanced components to improve performance of this step.
The other stage gates have been replaced by orte_grpcomm barrier functions. We tried to use MPI barriers instead (since the BTL's are active at that point), but - as we discussed on the telecon - these are not currently true barriers so the job would hang when we fell through while messages were still in process. Note that the grpcomm barrier doesn't actually resolve that problem, but Brian has pointed out that we are unlikely to ever see it violated. Again, you might want to spend a little time on an advanced barrier algorithm as the one in "basic" is very simplistic.
Summarizing this change: ORTE no longer tracks process state nor has direct responsibility for synchronizing jobs. This is now done via collective operations within the MPI layer, albeit using ORTE collective communication services. I -strongly- urge the MPI team to implement advanced collective algorithms to improve the performance of this critical procedure.
2. reducing the volume of data exchanged during modex. Data in the modex consisted of the process name, the name of the node where that process is located (expressed as a string), plus a string representation of all contact info. The nodename was required in order for the modex to determine if the process was local or not - in addition, some people like to have it to print pretty error messages when a connection failed.
The size of this data has been reduced in three ways:
(a) reducing the size of the process name itself. The process name consisted of two 32-bit fields for the jobid and vpid. This is far larger than any current system, or system likely to exist in the near future, can support. Accordingly, the default size of these fields has been reduced to 16-bits, which means you can have 32k procs in each of 32k jobs. Since the daemons must have a vpid, and we require one daemon/node, this also restricts the default configuration to 32k nodes.
To support any future "mega-clusters", a configuration option --enable-jumbo-apps has been added. This option increases the jobid and vpid field sizes to 32-bits. Someday, if necessary, someone can add yet another option to increase them to 64-bits, I suppose.
(b) replacing the string nodename with an integer nodeid. Since we have one daemon/node, the nodeid corresponds to the local daemon's vpid. This replaces an often lengthy string with only 2 (or at most 4) bytes, a substantial reduction.
(c) when the mca param requesting that nodenames be sent to support pretty error messages, a second mca param is now used to request FQDN - otherwise, the domain name is stripped (by default) from the message to save space. If someone wants to combine those into a single param somehow (perhaps with an argument?), they are welcome to do so - I didn't want to alter what people are already using.
While these may seem like small savings, they actually amount to a significant impact when aggregated across the entire modex operation. Since every proc must receive the modex data regardless of the collective used to send it, just reducing the size of the process name removes nearly 400MBytes of communication from a 32k proc job (admittedly, much of this comm may occur in parallel). So it does add up pretty quickly.
3. routing RML messages to reduce connections. The default messaging system remains point-to-point - i.e., each proc opens a socket to every proc it communicates with and sends its messages directly. A new option uses the orteds as routers - i.e., each proc only opens a single socket to its local orted. All messages are sent from the proc to the orted, which forwards the message to the orted on the node where the intended recipient proc is located - that orted then forwards the message to its local proc (the recipient). This greatly reduces the connection storm we have encountered during startup.
It also has the benefit of removing the sharing of every proc's OOB contact with every other proc. The orted routing tables are populated during launch since every orted gets a map of where every proc is being placed. Each proc, therefore, only needs to know the contact info for its local daemon, which is passed in via the environment when the proc is fork/exec'd by the daemon. This alone removes ~50 bytes/process of communication that was in the current STG1 startup message - so for our 32k proc job, this saves us roughly 32k*50 = 1.6MBytes sent to 32k procs = 51GBytes of messaging.
Note that you can use the new routing method by specifying -mca routed tree - if you so desire. This mode will become the default at some point in the future.
There are a few minor additional changes in the commit that I'll just note in passing:
* propagation of command line mca params to the orteds - fixes ticket #1073. See note there for details.
* requiring of "finalize" prior to "exit" for MPI procs - fixes ticket #1144. See note there for details.
* cleanup of some stale header files
This commit was SVN r16364.
2007-10-05 23:48:23 +04:00
|
|
|
/*
|
2008-02-28 04:57:57 +03:00
|
|
|
* Refresh the proc structure, and publish our proc info in the modex.
|
|
|
|
* NOTE: Do *not* call ompi_proc_finalize as there are many places in
|
|
|
|
* the code that point to indv. procs in this strucutre. For our
|
|
|
|
* needs here we only need to fix up the modex, bml and pml
|
|
|
|
* references.
|
These changes were mostly captured in a prior RFC (except for #2 below) and are aimed specifically at improving startup performance and setting up the remaining modifications described in that RFC.
The commit has been tested for C/R and Cray operations, and on Odin (SLURM, rsh) and RoadRunner (TM). I tried to update all environments, but obviously could not test them. I know that Windows needs some work, and have highlighted what is know to be needed in the odls process component.
This represents a lot of work by Brian, Tim P, Josh, and myself, with much advice from Jeff and others. For posterity, I have appended a copy of the email describing the work that was done:
As we have repeatedly noted, the modex operation in MPI_Init is the single greatest consumer of time during startup. To-date, we have executed that operation as an ORTE stage gate that held the process until a startup message containing all required modex (and OOB contact info - see #3 below) info could be sent to it. Each process would send its data to the HNP's registry, which assembled and sent the message when all processes had reported in.
In addition, ORTE had taken responsibility for monitoring process status as it progressed through a series of "stage gates". The process reported its status at each gate, and ORTE would then send a "release" message once all procs had reported in.
The incoming changes revamp these procedures in three ways:
1. eliminating the ORTE stage gate system and cleanly delineating responsibility between the OMPI and ORTE layers for MPI init/finalize. The modex stage gate (STG1) has been replaced by a collective operation in the modex itself that performs an allgather on the required modex info. The allgather is implemented using the orte_grpcomm framework since the BTL's are not active at that point. At the moment, the grpcomm framework only has a "basic" component analogous to OMPI's "basic" coll framework - I would recommend that the MPI team create additional, more advanced components to improve performance of this step.
The other stage gates have been replaced by orte_grpcomm barrier functions. We tried to use MPI barriers instead (since the BTL's are active at that point), but - as we discussed on the telecon - these are not currently true barriers so the job would hang when we fell through while messages were still in process. Note that the grpcomm barrier doesn't actually resolve that problem, but Brian has pointed out that we are unlikely to ever see it violated. Again, you might want to spend a little time on an advanced barrier algorithm as the one in "basic" is very simplistic.
Summarizing this change: ORTE no longer tracks process state nor has direct responsibility for synchronizing jobs. This is now done via collective operations within the MPI layer, albeit using ORTE collective communication services. I -strongly- urge the MPI team to implement advanced collective algorithms to improve the performance of this critical procedure.
2. reducing the volume of data exchanged during modex. Data in the modex consisted of the process name, the name of the node where that process is located (expressed as a string), plus a string representation of all contact info. The nodename was required in order for the modex to determine if the process was local or not - in addition, some people like to have it to print pretty error messages when a connection failed.
The size of this data has been reduced in three ways:
(a) reducing the size of the process name itself. The process name consisted of two 32-bit fields for the jobid and vpid. This is far larger than any current system, or system likely to exist in the near future, can support. Accordingly, the default size of these fields has been reduced to 16-bits, which means you can have 32k procs in each of 32k jobs. Since the daemons must have a vpid, and we require one daemon/node, this also restricts the default configuration to 32k nodes.
To support any future "mega-clusters", a configuration option --enable-jumbo-apps has been added. This option increases the jobid and vpid field sizes to 32-bits. Someday, if necessary, someone can add yet another option to increase them to 64-bits, I suppose.
(b) replacing the string nodename with an integer nodeid. Since we have one daemon/node, the nodeid corresponds to the local daemon's vpid. This replaces an often lengthy string with only 2 (or at most 4) bytes, a substantial reduction.
(c) when the mca param requesting that nodenames be sent to support pretty error messages, a second mca param is now used to request FQDN - otherwise, the domain name is stripped (by default) from the message to save space. If someone wants to combine those into a single param somehow (perhaps with an argument?), they are welcome to do so - I didn't want to alter what people are already using.
While these may seem like small savings, they actually amount to a significant impact when aggregated across the entire modex operation. Since every proc must receive the modex data regardless of the collective used to send it, just reducing the size of the process name removes nearly 400MBytes of communication from a 32k proc job (admittedly, much of this comm may occur in parallel). So it does add up pretty quickly.
3. routing RML messages to reduce connections. The default messaging system remains point-to-point - i.e., each proc opens a socket to every proc it communicates with and sends its messages directly. A new option uses the orteds as routers - i.e., each proc only opens a single socket to its local orted. All messages are sent from the proc to the orted, which forwards the message to the orted on the node where the intended recipient proc is located - that orted then forwards the message to its local proc (the recipient). This greatly reduces the connection storm we have encountered during startup.
It also has the benefit of removing the sharing of every proc's OOB contact with every other proc. The orted routing tables are populated during launch since every orted gets a map of where every proc is being placed. Each proc, therefore, only needs to know the contact info for its local daemon, which is passed in via the environment when the proc is fork/exec'd by the daemon. This alone removes ~50 bytes/process of communication that was in the current STG1 startup message - so for our 32k proc job, this saves us roughly 32k*50 = 1.6MBytes sent to 32k procs = 51GBytes of messaging.
Note that you can use the new routing method by specifying -mca routed tree - if you so desire. This mode will become the default at some point in the future.
There are a few minor additional changes in the commit that I'll just note in passing:
* propagation of command line mca params to the orteds - fixes ticket #1073. See note there for details.
* requiring of "finalize" prior to "exit" for MPI procs - fixes ticket #1144. See note there for details.
* cleanup of some stale header files
This commit was SVN r16364.
2007-10-05 23:48:23 +04:00
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
if (OMPI_SUCCESS != (ret = ompi_proc_refresh())) {
|
2008-06-09 18:53:58 +04:00
|
|
|
opal_output(0,
|
2008-02-28 04:57:57 +03:00
|
|
|
"pml:ob1: ft_event(Restart): proc_refresh Failed %d",
|
These changes were mostly captured in a prior RFC (except for #2 below) and are aimed specifically at improving startup performance and setting up the remaining modifications described in that RFC.
The commit has been tested for C/R and Cray operations, and on Odin (SLURM, rsh) and RoadRunner (TM). I tried to update all environments, but obviously could not test them. I know that Windows needs some work, and have highlighted what is know to be needed in the odls process component.
This represents a lot of work by Brian, Tim P, Josh, and myself, with much advice from Jeff and others. For posterity, I have appended a copy of the email describing the work that was done:
As we have repeatedly noted, the modex operation in MPI_Init is the single greatest consumer of time during startup. To-date, we have executed that operation as an ORTE stage gate that held the process until a startup message containing all required modex (and OOB contact info - see #3 below) info could be sent to it. Each process would send its data to the HNP's registry, which assembled and sent the message when all processes had reported in.
In addition, ORTE had taken responsibility for monitoring process status as it progressed through a series of "stage gates". The process reported its status at each gate, and ORTE would then send a "release" message once all procs had reported in.
The incoming changes revamp these procedures in three ways:
1. eliminating the ORTE stage gate system and cleanly delineating responsibility between the OMPI and ORTE layers for MPI init/finalize. The modex stage gate (STG1) has been replaced by a collective operation in the modex itself that performs an allgather on the required modex info. The allgather is implemented using the orte_grpcomm framework since the BTL's are not active at that point. At the moment, the grpcomm framework only has a "basic" component analogous to OMPI's "basic" coll framework - I would recommend that the MPI team create additional, more advanced components to improve performance of this step.
The other stage gates have been replaced by orte_grpcomm barrier functions. We tried to use MPI barriers instead (since the BTL's are active at that point), but - as we discussed on the telecon - these are not currently true barriers so the job would hang when we fell through while messages were still in process. Note that the grpcomm barrier doesn't actually resolve that problem, but Brian has pointed out that we are unlikely to ever see it violated. Again, you might want to spend a little time on an advanced barrier algorithm as the one in "basic" is very simplistic.
Summarizing this change: ORTE no longer tracks process state nor has direct responsibility for synchronizing jobs. This is now done via collective operations within the MPI layer, albeit using ORTE collective communication services. I -strongly- urge the MPI team to implement advanced collective algorithms to improve the performance of this critical procedure.
2. reducing the volume of data exchanged during modex. Data in the modex consisted of the process name, the name of the node where that process is located (expressed as a string), plus a string representation of all contact info. The nodename was required in order for the modex to determine if the process was local or not - in addition, some people like to have it to print pretty error messages when a connection failed.
The size of this data has been reduced in three ways:
(a) reducing the size of the process name itself. The process name consisted of two 32-bit fields for the jobid and vpid. This is far larger than any current system, or system likely to exist in the near future, can support. Accordingly, the default size of these fields has been reduced to 16-bits, which means you can have 32k procs in each of 32k jobs. Since the daemons must have a vpid, and we require one daemon/node, this also restricts the default configuration to 32k nodes.
To support any future "mega-clusters", a configuration option --enable-jumbo-apps has been added. This option increases the jobid and vpid field sizes to 32-bits. Someday, if necessary, someone can add yet another option to increase them to 64-bits, I suppose.
(b) replacing the string nodename with an integer nodeid. Since we have one daemon/node, the nodeid corresponds to the local daemon's vpid. This replaces an often lengthy string with only 2 (or at most 4) bytes, a substantial reduction.
(c) when the mca param requesting that nodenames be sent to support pretty error messages, a second mca param is now used to request FQDN - otherwise, the domain name is stripped (by default) from the message to save space. If someone wants to combine those into a single param somehow (perhaps with an argument?), they are welcome to do so - I didn't want to alter what people are already using.
While these may seem like small savings, they actually amount to a significant impact when aggregated across the entire modex operation. Since every proc must receive the modex data regardless of the collective used to send it, just reducing the size of the process name removes nearly 400MBytes of communication from a 32k proc job (admittedly, much of this comm may occur in parallel). So it does add up pretty quickly.
3. routing RML messages to reduce connections. The default messaging system remains point-to-point - i.e., each proc opens a socket to every proc it communicates with and sends its messages directly. A new option uses the orteds as routers - i.e., each proc only opens a single socket to its local orted. All messages are sent from the proc to the orted, which forwards the message to the orted on the node where the intended recipient proc is located - that orted then forwards the message to its local proc (the recipient). This greatly reduces the connection storm we have encountered during startup.
It also has the benefit of removing the sharing of every proc's OOB contact with every other proc. The orted routing tables are populated during launch since every orted gets a map of where every proc is being placed. Each proc, therefore, only needs to know the contact info for its local daemon, which is passed in via the environment when the proc is fork/exec'd by the daemon. This alone removes ~50 bytes/process of communication that was in the current STG1 startup message - so for our 32k proc job, this saves us roughly 32k*50 = 1.6MBytes sent to 32k procs = 51GBytes of messaging.
Note that you can use the new routing method by specifying -mca routed tree - if you so desire. This mode will become the default at some point in the future.
There are a few minor additional changes in the commit that I'll just note in passing:
* propagation of command line mca params to the orteds - fixes ticket #1073. See note there for details.
* requiring of "finalize" prior to "exit" for MPI procs - fixes ticket #1144. See note there for details.
* cleanup of some stale header files
This commit was SVN r16364.
2007-10-05 23:48:23 +04:00
|
|
|
ret);
|
2009-02-12 00:48:11 +03:00
|
|
|
for(p = 0; p < (int)num_procs; ++p) {
|
|
|
|
OBJ_RELEASE(procs[p]);
|
|
|
|
}
|
2008-08-06 12:04:27 +04:00
|
|
|
free (procs);
|
2012-07-10 03:34:13 +04:00
|
|
|
goto clean;
|
These changes were mostly captured in a prior RFC (except for #2 below) and are aimed specifically at improving startup performance and setting up the remaining modifications described in that RFC.
The commit has been tested for C/R and Cray operations, and on Odin (SLURM, rsh) and RoadRunner (TM). I tried to update all environments, but obviously could not test them. I know that Windows needs some work, and have highlighted what is know to be needed in the odls process component.
This represents a lot of work by Brian, Tim P, Josh, and myself, with much advice from Jeff and others. For posterity, I have appended a copy of the email describing the work that was done:
As we have repeatedly noted, the modex operation in MPI_Init is the single greatest consumer of time during startup. To-date, we have executed that operation as an ORTE stage gate that held the process until a startup message containing all required modex (and OOB contact info - see #3 below) info could be sent to it. Each process would send its data to the HNP's registry, which assembled and sent the message when all processes had reported in.
In addition, ORTE had taken responsibility for monitoring process status as it progressed through a series of "stage gates". The process reported its status at each gate, and ORTE would then send a "release" message once all procs had reported in.
The incoming changes revamp these procedures in three ways:
1. eliminating the ORTE stage gate system and cleanly delineating responsibility between the OMPI and ORTE layers for MPI init/finalize. The modex stage gate (STG1) has been replaced by a collective operation in the modex itself that performs an allgather on the required modex info. The allgather is implemented using the orte_grpcomm framework since the BTL's are not active at that point. At the moment, the grpcomm framework only has a "basic" component analogous to OMPI's "basic" coll framework - I would recommend that the MPI team create additional, more advanced components to improve performance of this step.
The other stage gates have been replaced by orte_grpcomm barrier functions. We tried to use MPI barriers instead (since the BTL's are active at that point), but - as we discussed on the telecon - these are not currently true barriers so the job would hang when we fell through while messages were still in process. Note that the grpcomm barrier doesn't actually resolve that problem, but Brian has pointed out that we are unlikely to ever see it violated. Again, you might want to spend a little time on an advanced barrier algorithm as the one in "basic" is very simplistic.
Summarizing this change: ORTE no longer tracks process state nor has direct responsibility for synchronizing jobs. This is now done via collective operations within the MPI layer, albeit using ORTE collective communication services. I -strongly- urge the MPI team to implement advanced collective algorithms to improve the performance of this critical procedure.
2. reducing the volume of data exchanged during modex. Data in the modex consisted of the process name, the name of the node where that process is located (expressed as a string), plus a string representation of all contact info. The nodename was required in order for the modex to determine if the process was local or not - in addition, some people like to have it to print pretty error messages when a connection failed.
The size of this data has been reduced in three ways:
(a) reducing the size of the process name itself. The process name consisted of two 32-bit fields for the jobid and vpid. This is far larger than any current system, or system likely to exist in the near future, can support. Accordingly, the default size of these fields has been reduced to 16-bits, which means you can have 32k procs in each of 32k jobs. Since the daemons must have a vpid, and we require one daemon/node, this also restricts the default configuration to 32k nodes.
To support any future "mega-clusters", a configuration option --enable-jumbo-apps has been added. This option increases the jobid and vpid field sizes to 32-bits. Someday, if necessary, someone can add yet another option to increase them to 64-bits, I suppose.
(b) replacing the string nodename with an integer nodeid. Since we have one daemon/node, the nodeid corresponds to the local daemon's vpid. This replaces an often lengthy string with only 2 (or at most 4) bytes, a substantial reduction.
(c) when the mca param requesting that nodenames be sent to support pretty error messages, a second mca param is now used to request FQDN - otherwise, the domain name is stripped (by default) from the message to save space. If someone wants to combine those into a single param somehow (perhaps with an argument?), they are welcome to do so - I didn't want to alter what people are already using.
While these may seem like small savings, they actually amount to a significant impact when aggregated across the entire modex operation. Since every proc must receive the modex data regardless of the collective used to send it, just reducing the size of the process name removes nearly 400MBytes of communication from a 32k proc job (admittedly, much of this comm may occur in parallel). So it does add up pretty quickly.
3. routing RML messages to reduce connections. The default messaging system remains point-to-point - i.e., each proc opens a socket to every proc it communicates with and sends its messages directly. A new option uses the orteds as routers - i.e., each proc only opens a single socket to its local orted. All messages are sent from the proc to the orted, which forwards the message to the orted on the node where the intended recipient proc is located - that orted then forwards the message to its local proc (the recipient). This greatly reduces the connection storm we have encountered during startup.
It also has the benefit of removing the sharing of every proc's OOB contact with every other proc. The orted routing tables are populated during launch since every orted gets a map of where every proc is being placed. Each proc, therefore, only needs to know the contact info for its local daemon, which is passed in via the environment when the proc is fork/exec'd by the daemon. This alone removes ~50 bytes/process of communication that was in the current STG1 startup message - so for our 32k proc job, this saves us roughly 32k*50 = 1.6MBytes sent to 32k procs = 51GBytes of messaging.
Note that you can use the new routing method by specifying -mca routed tree - if you so desire. This mode will become the default at some point in the future.
There are a few minor additional changes in the commit that I'll just note in passing:
* propagation of command line mca params to the orteds - fixes ticket #1073. See note there for details.
* requiring of "finalize" prior to "exit" for MPI procs - fixes ticket #1144. See note there for details.
* cleanup of some stale header files
This commit was SVN r16364.
2007-10-05 23:48:23 +04:00
|
|
|
}
|
2007-04-05 17:52:05 +04:00
|
|
|
}
|
|
|
|
else if(OPAL_CRS_TERM == state ) {
|
|
|
|
;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Call the BML
|
|
|
|
* BML is expected to call ft_event in
|
|
|
|
* - BTL(s)
|
|
|
|
* - MPool(s)
|
|
|
|
*/
|
|
|
|
if( OMPI_SUCCESS != (ret = mca_bml.bml_ft_event(state))) {
|
2008-06-09 18:53:58 +04:00
|
|
|
opal_output(0, "pml:base: ft_event: BML ft_event function failed: %d\n",
|
2007-04-05 17:52:05 +04:00
|
|
|
ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(OPAL_CRS_CHECKPOINT == state) {
|
2008-10-16 19:09:00 +04:00
|
|
|
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2P1);
|
|
|
|
|
|
|
|
if( opal_cr_timing_barrier_enabled ) {
|
|
|
|
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2PBR0);
|
2013-01-28 03:25:10 +04:00
|
|
|
/* JJH Cannot barrier here due to progress engine -- ompi_rte_barrier();*/
|
2008-10-16 19:09:00 +04:00
|
|
|
}
|
2007-04-05 17:52:05 +04:00
|
|
|
}
|
|
|
|
else if(OPAL_CRS_CONTINUE == state) {
|
2008-10-16 19:09:00 +04:00
|
|
|
if( !first_continue_pass ) {
|
|
|
|
if( opal_cr_timing_barrier_enabled ) {
|
|
|
|
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2PBR1);
|
2013-01-28 03:25:10 +04:00
|
|
|
ompi_rte_barrier(coll);
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
OMPI_WAIT_FOR_COMPLETION(coll->active);
|
2008-10-16 19:09:00 +04:00
|
|
|
}
|
|
|
|
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2P3);
|
|
|
|
}
|
|
|
|
|
2012-06-27 05:28:28 +04:00
|
|
|
if( orte_cr_continue_like_restart && !first_continue_pass ) {
|
2008-10-16 19:09:00 +04:00
|
|
|
/*
|
|
|
|
* Exchange the modex information once again.
|
|
|
|
* BTLs will have republished their modex information.
|
|
|
|
*/
|
2013-01-28 03:25:10 +04:00
|
|
|
modex = OBJ_NEW(ompi_rte_collective_t);
|
|
|
|
modex->id = ompi_process_info.peer_modex;
|
2012-07-10 03:34:13 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = orte_grpcomm.modex(modex))) {
|
2008-10-16 19:09:00 +04:00
|
|
|
opal_output(0,
|
2012-06-27 05:28:28 +04:00
|
|
|
"pml:ob1: ft_event(Restart): Failed orte_grpcomm.modex() = %d",
|
2008-10-16 19:09:00 +04:00
|
|
|
ret);
|
2012-07-10 03:34:13 +04:00
|
|
|
OBJ_RELEASE(modex);
|
|
|
|
goto clean;
|
2008-10-16 19:09:00 +04:00
|
|
|
}
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
OMPI_WAIT_FOR_COMPLETION(modex->active);
|
2012-07-10 03:34:13 +04:00
|
|
|
OBJ_RELEASE(modex);
|
2008-10-16 19:09:00 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Startup the PML stack now that the modex is running again
|
|
|
|
* Add the new procs (BTLs redo modex recv's)
|
|
|
|
*/
|
|
|
|
if( OMPI_SUCCESS != (ret = mca_pml_ob1_add_procs(procs, num_procs) ) ) {
|
|
|
|
opal_output(0, "pml:ob1: ft_event(Restart): Failed in add_procs (%d)", ret);
|
2012-07-10 03:34:13 +04:00
|
|
|
goto clean;
|
2008-10-16 19:09:00 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Is this barrier necessary ? JJH */
|
2013-01-28 03:25:10 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = ompi_rte_barrier(coll))) {
|
|
|
|
opal_output(0, "pml:ob1: ft_event(Restart): Failed in ompi_rte_barrier (%d)", ret);
|
2012-07-10 03:34:13 +04:00
|
|
|
goto clean;
|
|
|
|
}
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
OMPI_WAIT_FOR_COMPLETION(coll->active);
|
2008-10-16 19:09:00 +04:00
|
|
|
|
|
|
|
if( NULL != procs ) {
|
|
|
|
for(p = 0; p < (int)num_procs; ++p) {
|
|
|
|
OBJ_RELEASE(procs[p]);
|
|
|
|
}
|
|
|
|
free(procs);
|
|
|
|
procs = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( !first_continue_pass ) {
|
|
|
|
if( opal_cr_timing_barrier_enabled ) {
|
|
|
|
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2PBR2);
|
2013-01-28 03:25:10 +04:00
|
|
|
ompi_rte_barrier(coll);
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
OMPI_WAIT_FOR_COMPLETION(coll->active);
|
2008-10-16 19:09:00 +04:00
|
|
|
}
|
|
|
|
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_CRCP1);
|
|
|
|
}
|
2007-04-05 17:52:05 +04:00
|
|
|
}
|
2008-04-24 21:54:22 +04:00
|
|
|
else if(OPAL_CRS_RESTART_PRE == state ) {
|
|
|
|
/* Nothing here */
|
|
|
|
}
|
|
|
|
else if(OPAL_CRS_RESTART == state ) {
|
2007-04-19 07:05:12 +04:00
|
|
|
/*
|
2008-02-28 04:57:57 +03:00
|
|
|
* Exchange the modex information once again.
|
|
|
|
* BTLs will have republished their modex information.
|
These changes were mostly captured in a prior RFC (except for #2 below) and are aimed specifically at improving startup performance and setting up the remaining modifications described in that RFC.
The commit has been tested for C/R and Cray operations, and on Odin (SLURM, rsh) and RoadRunner (TM). I tried to update all environments, but obviously could not test them. I know that Windows needs some work, and have highlighted what is know to be needed in the odls process component.
This represents a lot of work by Brian, Tim P, Josh, and myself, with much advice from Jeff and others. For posterity, I have appended a copy of the email describing the work that was done:
As we have repeatedly noted, the modex operation in MPI_Init is the single greatest consumer of time during startup. To-date, we have executed that operation as an ORTE stage gate that held the process until a startup message containing all required modex (and OOB contact info - see #3 below) info could be sent to it. Each process would send its data to the HNP's registry, which assembled and sent the message when all processes had reported in.
In addition, ORTE had taken responsibility for monitoring process status as it progressed through a series of "stage gates". The process reported its status at each gate, and ORTE would then send a "release" message once all procs had reported in.
The incoming changes revamp these procedures in three ways:
1. eliminating the ORTE stage gate system and cleanly delineating responsibility between the OMPI and ORTE layers for MPI init/finalize. The modex stage gate (STG1) has been replaced by a collective operation in the modex itself that performs an allgather on the required modex info. The allgather is implemented using the orte_grpcomm framework since the BTL's are not active at that point. At the moment, the grpcomm framework only has a "basic" component analogous to OMPI's "basic" coll framework - I would recommend that the MPI team create additional, more advanced components to improve performance of this step.
The other stage gates have been replaced by orte_grpcomm barrier functions. We tried to use MPI barriers instead (since the BTL's are active at that point), but - as we discussed on the telecon - these are not currently true barriers so the job would hang when we fell through while messages were still in process. Note that the grpcomm barrier doesn't actually resolve that problem, but Brian has pointed out that we are unlikely to ever see it violated. Again, you might want to spend a little time on an advanced barrier algorithm as the one in "basic" is very simplistic.
Summarizing this change: ORTE no longer tracks process state nor has direct responsibility for synchronizing jobs. This is now done via collective operations within the MPI layer, albeit using ORTE collective communication services. I -strongly- urge the MPI team to implement advanced collective algorithms to improve the performance of this critical procedure.
2. reducing the volume of data exchanged during modex. Data in the modex consisted of the process name, the name of the node where that process is located (expressed as a string), plus a string representation of all contact info. The nodename was required in order for the modex to determine if the process was local or not - in addition, some people like to have it to print pretty error messages when a connection failed.
The size of this data has been reduced in three ways:
(a) reducing the size of the process name itself. The process name consisted of two 32-bit fields for the jobid and vpid. This is far larger than any current system, or system likely to exist in the near future, can support. Accordingly, the default size of these fields has been reduced to 16-bits, which means you can have 32k procs in each of 32k jobs. Since the daemons must have a vpid, and we require one daemon/node, this also restricts the default configuration to 32k nodes.
To support any future "mega-clusters", a configuration option --enable-jumbo-apps has been added. This option increases the jobid and vpid field sizes to 32-bits. Someday, if necessary, someone can add yet another option to increase them to 64-bits, I suppose.
(b) replacing the string nodename with an integer nodeid. Since we have one daemon/node, the nodeid corresponds to the local daemon's vpid. This replaces an often lengthy string with only 2 (or at most 4) bytes, a substantial reduction.
(c) when the mca param requesting that nodenames be sent to support pretty error messages, a second mca param is now used to request FQDN - otherwise, the domain name is stripped (by default) from the message to save space. If someone wants to combine those into a single param somehow (perhaps with an argument?), they are welcome to do so - I didn't want to alter what people are already using.
While these may seem like small savings, they actually amount to a significant impact when aggregated across the entire modex operation. Since every proc must receive the modex data regardless of the collective used to send it, just reducing the size of the process name removes nearly 400MBytes of communication from a 32k proc job (admittedly, much of this comm may occur in parallel). So it does add up pretty quickly.
3. routing RML messages to reduce connections. The default messaging system remains point-to-point - i.e., each proc opens a socket to every proc it communicates with and sends its messages directly. A new option uses the orteds as routers - i.e., each proc only opens a single socket to its local orted. All messages are sent from the proc to the orted, which forwards the message to the orted on the node where the intended recipient proc is located - that orted then forwards the message to its local proc (the recipient). This greatly reduces the connection storm we have encountered during startup.
It also has the benefit of removing the sharing of every proc's OOB contact with every other proc. The orted routing tables are populated during launch since every orted gets a map of where every proc is being placed. Each proc, therefore, only needs to know the contact info for its local daemon, which is passed in via the environment when the proc is fork/exec'd by the daemon. This alone removes ~50 bytes/process of communication that was in the current STG1 startup message - so for our 32k proc job, this saves us roughly 32k*50 = 1.6MBytes sent to 32k procs = 51GBytes of messaging.
Note that you can use the new routing method by specifying -mca routed tree - if you so desire. This mode will become the default at some point in the future.
There are a few minor additional changes in the commit that I'll just note in passing:
* propagation of command line mca params to the orteds - fixes ticket #1073. See note there for details.
* requiring of "finalize" prior to "exit" for MPI procs - fixes ticket #1144. See note there for details.
* cleanup of some stale header files
This commit was SVN r16364.
2007-10-05 23:48:23 +04:00
|
|
|
*/
|
2013-01-28 03:25:10 +04:00
|
|
|
modex = OBJ_NEW(ompi_rte_collective_t);
|
|
|
|
modex->id = ompi_process_info.peer_modex;
|
2012-07-10 03:34:13 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = orte_grpcomm.modex(modex))) {
|
2008-06-09 18:53:58 +04:00
|
|
|
opal_output(0,
|
2012-06-27 05:28:28 +04:00
|
|
|
"pml:ob1: ft_event(Restart): Failed orte_grpcomm.modex() = %d",
|
2007-04-19 07:05:12 +04:00
|
|
|
ret);
|
2012-07-10 03:34:13 +04:00
|
|
|
OBJ_RELEASE(modex);
|
|
|
|
goto clean;
|
|
|
|
}
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
OMPI_WAIT_FOR_COMPLETION(modex->active);
|
2012-07-10 03:34:13 +04:00
|
|
|
OBJ_RELEASE(modex);
|
2008-05-01 21:48:13 +04:00
|
|
|
|
2007-04-19 07:05:12 +04:00
|
|
|
/*
|
These changes were mostly captured in a prior RFC (except for #2 below) and are aimed specifically at improving startup performance and setting up the remaining modifications described in that RFC.
The commit has been tested for C/R and Cray operations, and on Odin (SLURM, rsh) and RoadRunner (TM). I tried to update all environments, but obviously could not test them. I know that Windows needs some work, and have highlighted what is know to be needed in the odls process component.
This represents a lot of work by Brian, Tim P, Josh, and myself, with much advice from Jeff and others. For posterity, I have appended a copy of the email describing the work that was done:
As we have repeatedly noted, the modex operation in MPI_Init is the single greatest consumer of time during startup. To-date, we have executed that operation as an ORTE stage gate that held the process until a startup message containing all required modex (and OOB contact info - see #3 below) info could be sent to it. Each process would send its data to the HNP's registry, which assembled and sent the message when all processes had reported in.
In addition, ORTE had taken responsibility for monitoring process status as it progressed through a series of "stage gates". The process reported its status at each gate, and ORTE would then send a "release" message once all procs had reported in.
The incoming changes revamp these procedures in three ways:
1. eliminating the ORTE stage gate system and cleanly delineating responsibility between the OMPI and ORTE layers for MPI init/finalize. The modex stage gate (STG1) has been replaced by a collective operation in the modex itself that performs an allgather on the required modex info. The allgather is implemented using the orte_grpcomm framework since the BTL's are not active at that point. At the moment, the grpcomm framework only has a "basic" component analogous to OMPI's "basic" coll framework - I would recommend that the MPI team create additional, more advanced components to improve performance of this step.
The other stage gates have been replaced by orte_grpcomm barrier functions. We tried to use MPI barriers instead (since the BTL's are active at that point), but - as we discussed on the telecon - these are not currently true barriers so the job would hang when we fell through while messages were still in process. Note that the grpcomm barrier doesn't actually resolve that problem, but Brian has pointed out that we are unlikely to ever see it violated. Again, you might want to spend a little time on an advanced barrier algorithm as the one in "basic" is very simplistic.
Summarizing this change: ORTE no longer tracks process state nor has direct responsibility for synchronizing jobs. This is now done via collective operations within the MPI layer, albeit using ORTE collective communication services. I -strongly- urge the MPI team to implement advanced collective algorithms to improve the performance of this critical procedure.
2. reducing the volume of data exchanged during modex. Data in the modex consisted of the process name, the name of the node where that process is located (expressed as a string), plus a string representation of all contact info. The nodename was required in order for the modex to determine if the process was local or not - in addition, some people like to have it to print pretty error messages when a connection failed.
The size of this data has been reduced in three ways:
(a) reducing the size of the process name itself. The process name consisted of two 32-bit fields for the jobid and vpid. This is far larger than any current system, or system likely to exist in the near future, can support. Accordingly, the default size of these fields has been reduced to 16-bits, which means you can have 32k procs in each of 32k jobs. Since the daemons must have a vpid, and we require one daemon/node, this also restricts the default configuration to 32k nodes.
To support any future "mega-clusters", a configuration option --enable-jumbo-apps has been added. This option increases the jobid and vpid field sizes to 32-bits. Someday, if necessary, someone can add yet another option to increase them to 64-bits, I suppose.
(b) replacing the string nodename with an integer nodeid. Since we have one daemon/node, the nodeid corresponds to the local daemon's vpid. This replaces an often lengthy string with only 2 (or at most 4) bytes, a substantial reduction.
(c) when the mca param requesting that nodenames be sent to support pretty error messages, a second mca param is now used to request FQDN - otherwise, the domain name is stripped (by default) from the message to save space. If someone wants to combine those into a single param somehow (perhaps with an argument?), they are welcome to do so - I didn't want to alter what people are already using.
While these may seem like small savings, they actually amount to a significant impact when aggregated across the entire modex operation. Since every proc must receive the modex data regardless of the collective used to send it, just reducing the size of the process name removes nearly 400MBytes of communication from a 32k proc job (admittedly, much of this comm may occur in parallel). So it does add up pretty quickly.
3. routing RML messages to reduce connections. The default messaging system remains point-to-point - i.e., each proc opens a socket to every proc it communicates with and sends its messages directly. A new option uses the orteds as routers - i.e., each proc only opens a single socket to its local orted. All messages are sent from the proc to the orted, which forwards the message to the orted on the node where the intended recipient proc is located - that orted then forwards the message to its local proc (the recipient). This greatly reduces the connection storm we have encountered during startup.
It also has the benefit of removing the sharing of every proc's OOB contact with every other proc. The orted routing tables are populated during launch since every orted gets a map of where every proc is being placed. Each proc, therefore, only needs to know the contact info for its local daemon, which is passed in via the environment when the proc is fork/exec'd by the daemon. This alone removes ~50 bytes/process of communication that was in the current STG1 startup message - so for our 32k proc job, this saves us roughly 32k*50 = 1.6MBytes sent to 32k procs = 51GBytes of messaging.
Note that you can use the new routing method by specifying -mca routed tree - if you so desire. This mode will become the default at some point in the future.
There are a few minor additional changes in the commit that I'll just note in passing:
* propagation of command line mca params to the orteds - fixes ticket #1073. See note there for details.
* requiring of "finalize" prior to "exit" for MPI procs - fixes ticket #1144. See note there for details.
* cleanup of some stale header files
This commit was SVN r16364.
2007-10-05 23:48:23 +04:00
|
|
|
* Startup the PML stack now that the modex is running again
|
2008-02-28 04:57:57 +03:00
|
|
|
* Add the new procs (BTLs redo modex recv's)
|
2007-04-19 07:05:12 +04:00
|
|
|
*/
|
These changes were mostly captured in a prior RFC (except for #2 below) and are aimed specifically at improving startup performance and setting up the remaining modifications described in that RFC.
The commit has been tested for C/R and Cray operations, and on Odin (SLURM, rsh) and RoadRunner (TM). I tried to update all environments, but obviously could not test them. I know that Windows needs some work, and have highlighted what is know to be needed in the odls process component.
This represents a lot of work by Brian, Tim P, Josh, and myself, with much advice from Jeff and others. For posterity, I have appended a copy of the email describing the work that was done:
As we have repeatedly noted, the modex operation in MPI_Init is the single greatest consumer of time during startup. To-date, we have executed that operation as an ORTE stage gate that held the process until a startup message containing all required modex (and OOB contact info - see #3 below) info could be sent to it. Each process would send its data to the HNP's registry, which assembled and sent the message when all processes had reported in.
In addition, ORTE had taken responsibility for monitoring process status as it progressed through a series of "stage gates". The process reported its status at each gate, and ORTE would then send a "release" message once all procs had reported in.
The incoming changes revamp these procedures in three ways:
1. eliminating the ORTE stage gate system and cleanly delineating responsibility between the OMPI and ORTE layers for MPI init/finalize. The modex stage gate (STG1) has been replaced by a collective operation in the modex itself that performs an allgather on the required modex info. The allgather is implemented using the orte_grpcomm framework since the BTL's are not active at that point. At the moment, the grpcomm framework only has a "basic" component analogous to OMPI's "basic" coll framework - I would recommend that the MPI team create additional, more advanced components to improve performance of this step.
The other stage gates have been replaced by orte_grpcomm barrier functions. We tried to use MPI barriers instead (since the BTL's are active at that point), but - as we discussed on the telecon - these are not currently true barriers so the job would hang when we fell through while messages were still in process. Note that the grpcomm barrier doesn't actually resolve that problem, but Brian has pointed out that we are unlikely to ever see it violated. Again, you might want to spend a little time on an advanced barrier algorithm as the one in "basic" is very simplistic.
Summarizing this change: ORTE no longer tracks process state nor has direct responsibility for synchronizing jobs. This is now done via collective operations within the MPI layer, albeit using ORTE collective communication services. I -strongly- urge the MPI team to implement advanced collective algorithms to improve the performance of this critical procedure.
2. reducing the volume of data exchanged during modex. Data in the modex consisted of the process name, the name of the node where that process is located (expressed as a string), plus a string representation of all contact info. The nodename was required in order for the modex to determine if the process was local or not - in addition, some people like to have it to print pretty error messages when a connection failed.
The size of this data has been reduced in three ways:
(a) reducing the size of the process name itself. The process name consisted of two 32-bit fields for the jobid and vpid. This is far larger than any current system, or system likely to exist in the near future, can support. Accordingly, the default size of these fields has been reduced to 16-bits, which means you can have 32k procs in each of 32k jobs. Since the daemons must have a vpid, and we require one daemon/node, this also restricts the default configuration to 32k nodes.
To support any future "mega-clusters", a configuration option --enable-jumbo-apps has been added. This option increases the jobid and vpid field sizes to 32-bits. Someday, if necessary, someone can add yet another option to increase them to 64-bits, I suppose.
(b) replacing the string nodename with an integer nodeid. Since we have one daemon/node, the nodeid corresponds to the local daemon's vpid. This replaces an often lengthy string with only 2 (or at most 4) bytes, a substantial reduction.
(c) when the mca param requesting that nodenames be sent to support pretty error messages, a second mca param is now used to request FQDN - otherwise, the domain name is stripped (by default) from the message to save space. If someone wants to combine those into a single param somehow (perhaps with an argument?), they are welcome to do so - I didn't want to alter what people are already using.
While these may seem like small savings, they actually amount to a significant impact when aggregated across the entire modex operation. Since every proc must receive the modex data regardless of the collective used to send it, just reducing the size of the process name removes nearly 400MBytes of communication from a 32k proc job (admittedly, much of this comm may occur in parallel). So it does add up pretty quickly.
3. routing RML messages to reduce connections. The default messaging system remains point-to-point - i.e., each proc opens a socket to every proc it communicates with and sends its messages directly. A new option uses the orteds as routers - i.e., each proc only opens a single socket to its local orted. All messages are sent from the proc to the orted, which forwards the message to the orted on the node where the intended recipient proc is located - that orted then forwards the message to its local proc (the recipient). This greatly reduces the connection storm we have encountered during startup.
It also has the benefit of removing the sharing of every proc's OOB contact with every other proc. The orted routing tables are populated during launch since every orted gets a map of where every proc is being placed. Each proc, therefore, only needs to know the contact info for its local daemon, which is passed in via the environment when the proc is fork/exec'd by the daemon. This alone removes ~50 bytes/process of communication that was in the current STG1 startup message - so for our 32k proc job, this saves us roughly 32k*50 = 1.6MBytes sent to 32k procs = 51GBytes of messaging.
Note that you can use the new routing method by specifying -mca routed tree - if you so desire. This mode will become the default at some point in the future.
There are a few minor additional changes in the commit that I'll just note in passing:
* propagation of command line mca params to the orteds - fixes ticket #1073. See note there for details.
* requiring of "finalize" prior to "exit" for MPI procs - fixes ticket #1144. See note there for details.
* cleanup of some stale header files
This commit was SVN r16364.
2007-10-05 23:48:23 +04:00
|
|
|
if( OMPI_SUCCESS != (ret = mca_pml_ob1_add_procs(procs, num_procs) ) ) {
|
2008-06-09 18:53:58 +04:00
|
|
|
opal_output(0, "pml:ob1: ft_event(Restart): Failed in add_procs (%d)", ret);
|
2012-07-10 03:34:13 +04:00
|
|
|
goto clean;
|
2007-04-19 07:05:12 +04:00
|
|
|
}
|
|
|
|
|
These changes were mostly captured in a prior RFC (except for #2 below) and are aimed specifically at improving startup performance and setting up the remaining modifications described in that RFC.
The commit has been tested for C/R and Cray operations, and on Odin (SLURM, rsh) and RoadRunner (TM). I tried to update all environments, but obviously could not test them. I know that Windows needs some work, and have highlighted what is know to be needed in the odls process component.
This represents a lot of work by Brian, Tim P, Josh, and myself, with much advice from Jeff and others. For posterity, I have appended a copy of the email describing the work that was done:
As we have repeatedly noted, the modex operation in MPI_Init is the single greatest consumer of time during startup. To-date, we have executed that operation as an ORTE stage gate that held the process until a startup message containing all required modex (and OOB contact info - see #3 below) info could be sent to it. Each process would send its data to the HNP's registry, which assembled and sent the message when all processes had reported in.
In addition, ORTE had taken responsibility for monitoring process status as it progressed through a series of "stage gates". The process reported its status at each gate, and ORTE would then send a "release" message once all procs had reported in.
The incoming changes revamp these procedures in three ways:
1. eliminating the ORTE stage gate system and cleanly delineating responsibility between the OMPI and ORTE layers for MPI init/finalize. The modex stage gate (STG1) has been replaced by a collective operation in the modex itself that performs an allgather on the required modex info. The allgather is implemented using the orte_grpcomm framework since the BTL's are not active at that point. At the moment, the grpcomm framework only has a "basic" component analogous to OMPI's "basic" coll framework - I would recommend that the MPI team create additional, more advanced components to improve performance of this step.
The other stage gates have been replaced by orte_grpcomm barrier functions. We tried to use MPI barriers instead (since the BTL's are active at that point), but - as we discussed on the telecon - these are not currently true barriers so the job would hang when we fell through while messages were still in process. Note that the grpcomm barrier doesn't actually resolve that problem, but Brian has pointed out that we are unlikely to ever see it violated. Again, you might want to spend a little time on an advanced barrier algorithm as the one in "basic" is very simplistic.
Summarizing this change: ORTE no longer tracks process state nor has direct responsibility for synchronizing jobs. This is now done via collective operations within the MPI layer, albeit using ORTE collective communication services. I -strongly- urge the MPI team to implement advanced collective algorithms to improve the performance of this critical procedure.
2. reducing the volume of data exchanged during modex. Data in the modex consisted of the process name, the name of the node where that process is located (expressed as a string), plus a string representation of all contact info. The nodename was required in order for the modex to determine if the process was local or not - in addition, some people like to have it to print pretty error messages when a connection failed.
The size of this data has been reduced in three ways:
(a) reducing the size of the process name itself. The process name consisted of two 32-bit fields for the jobid and vpid. This is far larger than any current system, or system likely to exist in the near future, can support. Accordingly, the default size of these fields has been reduced to 16-bits, which means you can have 32k procs in each of 32k jobs. Since the daemons must have a vpid, and we require one daemon/node, this also restricts the default configuration to 32k nodes.
To support any future "mega-clusters", a configuration option --enable-jumbo-apps has been added. This option increases the jobid and vpid field sizes to 32-bits. Someday, if necessary, someone can add yet another option to increase them to 64-bits, I suppose.
(b) replacing the string nodename with an integer nodeid. Since we have one daemon/node, the nodeid corresponds to the local daemon's vpid. This replaces an often lengthy string with only 2 (or at most 4) bytes, a substantial reduction.
(c) when the mca param requesting that nodenames be sent to support pretty error messages, a second mca param is now used to request FQDN - otherwise, the domain name is stripped (by default) from the message to save space. If someone wants to combine those into a single param somehow (perhaps with an argument?), they are welcome to do so - I didn't want to alter what people are already using.
While these may seem like small savings, they actually amount to a significant impact when aggregated across the entire modex operation. Since every proc must receive the modex data regardless of the collective used to send it, just reducing the size of the process name removes nearly 400MBytes of communication from a 32k proc job (admittedly, much of this comm may occur in parallel). So it does add up pretty quickly.
3. routing RML messages to reduce connections. The default messaging system remains point-to-point - i.e., each proc opens a socket to every proc it communicates with and sends its messages directly. A new option uses the orteds as routers - i.e., each proc only opens a single socket to its local orted. All messages are sent from the proc to the orted, which forwards the message to the orted on the node where the intended recipient proc is located - that orted then forwards the message to its local proc (the recipient). This greatly reduces the connection storm we have encountered during startup.
It also has the benefit of removing the sharing of every proc's OOB contact with every other proc. The orted routing tables are populated during launch since every orted gets a map of where every proc is being placed. Each proc, therefore, only needs to know the contact info for its local daemon, which is passed in via the environment when the proc is fork/exec'd by the daemon. This alone removes ~50 bytes/process of communication that was in the current STG1 startup message - so for our 32k proc job, this saves us roughly 32k*50 = 1.6MBytes sent to 32k procs = 51GBytes of messaging.
Note that you can use the new routing method by specifying -mca routed tree - if you so desire. This mode will become the default at some point in the future.
There are a few minor additional changes in the commit that I'll just note in passing:
* propagation of command line mca params to the orteds - fixes ticket #1073. See note there for details.
* requiring of "finalize" prior to "exit" for MPI procs - fixes ticket #1144. See note there for details.
* cleanup of some stale header files
This commit was SVN r16364.
2007-10-05 23:48:23 +04:00
|
|
|
/* Is this barrier necessary ? JJH */
|
2013-01-28 03:25:10 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = ompi_rte_barrier(coll))) {
|
|
|
|
opal_output(0, "pml:ob1: ft_event(Restart): Failed in ompi_rte_barrier (%d)", ret);
|
2012-07-10 03:34:13 +04:00
|
|
|
goto clean;
|
|
|
|
}
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
OMPI_WAIT_FOR_COMPLETION(coll->active);
|
2007-04-19 07:05:12 +04:00
|
|
|
|
|
|
|
if( NULL != procs ) {
|
|
|
|
for(p = 0; p < (int)num_procs; ++p) {
|
|
|
|
OBJ_RELEASE(procs[p]);
|
|
|
|
}
|
|
|
|
free(procs);
|
|
|
|
procs = NULL;
|
|
|
|
}
|
2007-04-05 17:52:05 +04:00
|
|
|
}
|
|
|
|
else if(OPAL_CRS_TERM == state ) {
|
|
|
|
;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
2012-07-10 03:34:13 +04:00
|
|
|
ret = OMPI_SUCCESS;
|
|
|
|
|
|
|
|
clean:
|
|
|
|
OBJ_RELEASE(coll);
|
|
|
|
return ret;
|
2007-04-05 17:52:05 +04:00
|
|
|
}
|
2010-03-13 02:57:50 +03:00
|
|
|
#endif /* OPAL_ENABLE_FT_CR */
|
2007-07-01 15:34:23 +04:00
|
|
|
|
|
|
|
int mca_pml_ob1_com_btl_comp(const void *v1, const void *v2)
|
|
|
|
{
|
2007-09-12 19:29:58 +04:00
|
|
|
const mca_pml_ob1_com_btl_t *b1 = (const mca_pml_ob1_com_btl_t *) v1;
|
|
|
|
const mca_pml_ob1_com_btl_t *b2 = (const mca_pml_ob1_com_btl_t *) v2;
|
2007-07-01 15:34:23 +04:00
|
|
|
|
|
|
|
if(b1->bml_btl->btl_weight < b2->bml_btl->btl_weight)
|
|
|
|
return 1;
|
|
|
|
if(b1->bml_btl->btl_weight > b2->bml_btl->btl_weight)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2008-10-23 00:13:33 +04:00
|
|
|
|