From 6ebbacb0549a921a57ded341b8bcb58a00b606f4 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Tue, 24 Jul 2012 00:22:22 +0000 Subject: [PATCH] Complete the dump function for the SM BTL. Now we can see all fragments in all the queues as long as the BTL is dump-friendly (only SM right now). This commit was SVN r26849. --- ompi/mca/btl/sm/btl_sm.c | 26 ++++++++++++++++++++++++-- ompi/mca/btl/sm/btl_sm.h | 10 +++++----- ompi/mca/btl/sm/btl_sm_endpoint.h | 4 ++-- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/ompi/mca/btl/sm/btl_sm.c b/ompi/mca/btl/sm/btl_sm.c index fea5a0075b..3da7eca619 100644 --- a/ompi/mca/btl/sm/btl_sm.c +++ b/ompi/mca/btl/sm/btl_sm.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2011 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2009 The University of Tennessee and The University + * Copyright (c) 2004-2012 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2007 High Performance Computing Center Stuttgart, @@ -93,7 +93,7 @@ mca_btl_sm_t mca_btl_sm = { mca_btl_sm_sendi, NULL, /* put */ NULL, /* get -- optionally filled during initialization */ - mca_btl_base_dump, + mca_btl_sm_dump, NULL, /* mpool */ mca_btl_sm_register_error_cb, /* register error */ mca_btl_sm_ft_event @@ -1138,6 +1138,28 @@ int mca_btl_sm_get_async(struct mca_btl_base_module_t* btl, } #endif /* OMPI_BTL_SM_HAVE_KNEM */ +/** + * + */ +void mca_btl_sm_dump(struct mca_btl_base_module_t* btl, + struct mca_btl_base_endpoint_t* endpoint, + int verbose) +{ + opal_list_item_t *item; + mca_btl_sm_frag_t* frag; + + mca_btl_base_err("BTL SM %p endpoint %p [smp_rank %d] [peer_rank %d]\n", + btl, endpoint, endpoint->my_smp_rank, endpoint->peer_smp_rank); + if( NULL != endpoint ) { + for(item = opal_list_get_first(&endpoint->pending_sends); + item != opal_list_get_end(&endpoint->pending_sends); + item = opal_list_get_next(item)) { + frag = (mca_btl_sm_frag_t*)item; + mca_btl_base_err(" | frag %p size %lu (hdr frag %p len %lu rank tag %d)\n", + frag, frag->size, frag->hdr->frag, frag->hdr->len, frag->hdr->my_smp_rank, frag->hdr->tag); + } + } +} #if OPAL_ENABLE_FT_CR == 0 int mca_btl_sm_ft_event(int state) { diff --git a/ompi/mca/btl/sm/btl_sm.h b/ompi/mca/btl/sm/btl_sm.h index d9f0f50201..2a02f543b4 100644 --- a/ompi/mca/btl/sm/btl_sm.h +++ b/ompi/mca/btl/sm/btl_sm.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2009 The University of Tennessee and The University + * Copyright (c) 2004-2012 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -239,10 +239,6 @@ struct mca_btl_sm_t { typedef struct mca_btl_sm_t mca_btl_sm_t; OMPI_MODULE_DECLSPEC extern mca_btl_sm_t mca_btl_sm; - - - - struct btl_sm_pending_send_item_t { opal_free_list_item_t super; @@ -528,6 +524,10 @@ extern int mca_btl_sm_get_async( #endif +extern void mca_btl_sm_dump(struct mca_btl_base_module_t* btl, + struct mca_btl_base_endpoint_t* endpoint, + int verbose); + /** * Fault Tolerance Event Notification Function * @param state Checkpoint Stae diff --git a/ompi/mca/btl/sm/btl_sm_endpoint.h b/ompi/mca/btl/sm/btl_sm_endpoint.h index 214d5b217f..096abf4ccd 100644 --- a/ompi/mca/btl/sm/btl_sm_endpoint.h +++ b/ompi/mca/btl/sm/btl_sm_endpoint.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2012 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -39,7 +39,7 @@ struct mca_btl_base_endpoint_t { opal_list_t pending_sends; /**< pending data to send */ /** lock for concurrent access to endpoint state */ - opal_mutex_t endpoint_lock; + opal_mutex_t endpoint_lock; };