2006-01-28 15:38:37 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2007-05-23 20:31:25 +00:00
|
|
|
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2006-01-28 15:38:37 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
|
|
|
#include "osc_pt2pt.h"
|
|
|
|
#include "osc_pt2pt_sendreq.h"
|
|
|
|
|
2007-05-21 16:06:14 +00:00
|
|
|
#include "ompi/mca/osc/base/base.h"
|
2006-01-28 15:38:37 +00:00
|
|
|
#include "opal/threads/mutex.h"
|
|
|
|
#include "ompi/win/win.h"
|
|
|
|
#include "ompi/communicator/communicator.h"
|
2009-03-13 02:10:32 +00:00
|
|
|
#include "ompi/request/request.h"
|
2006-01-28 15:38:37 +00:00
|
|
|
#include "mpi.h"
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
ompi_osc_pt2pt_module_free(ompi_win_t *win)
|
|
|
|
{
|
|
|
|
int ret = OMPI_SUCCESS;
|
|
|
|
ompi_osc_pt2pt_module_t *module = P2P_MODULE(win);
|
2007-05-21 16:06:14 +00:00
|
|
|
|
2013-03-27 21:17:31 +00:00
|
|
|
opal_output_verbose(1, ompi_osc_base_framework.framework_output,
|
2007-05-21 16:06:14 +00:00
|
|
|
"pt2pt component destroying window with id %d",
|
2007-07-11 17:16:06 +00:00
|
|
|
ompi_comm_get_cid(module->p2p_comm));
|
2006-01-28 15:38:37 +00:00
|
|
|
|
|
|
|
/* finish with a barrier */
|
|
|
|
if (ompi_group_size(win->w_group) > 1) {
|
2007-08-19 03:37:49 +00:00
|
|
|
ret = module->p2p_comm->c_coll.coll_barrier(module->p2p_comm,
|
|
|
|
module->p2p_comm->c_coll.coll_barrier_module);
|
2006-01-28 15:38:37 +00:00
|
|
|
}
|
|
|
|
|
2007-05-21 02:21:25 +00:00
|
|
|
win->w_osc_module = NULL;
|
2006-01-28 15:38:37 +00:00
|
|
|
|
2007-05-21 02:21:25 +00:00
|
|
|
OBJ_DESTRUCT(&module->p2p_unlocks_pending);
|
|
|
|
OBJ_DESTRUCT(&module->p2p_locks_pending);
|
|
|
|
OBJ_DESTRUCT(&module->p2p_copy_pending_sendreqs);
|
|
|
|
OBJ_DESTRUCT(&module->p2p_pending_sendreqs);
|
|
|
|
OBJ_DESTRUCT(&module->p2p_acc_lock);
|
|
|
|
OBJ_DESTRUCT(&module->p2p_cond);
|
|
|
|
OBJ_DESTRUCT(&module->p2p_lock);
|
2006-01-28 15:38:37 +00:00
|
|
|
|
2007-05-21 02:21:25 +00:00
|
|
|
if (NULL != module->p2p_sc_remote_ranks) {
|
|
|
|
free(module->p2p_sc_remote_ranks);
|
|
|
|
}
|
|
|
|
if (NULL != module->p2p_sc_remote_active_ranks) {
|
|
|
|
free(module->p2p_sc_remote_active_ranks);
|
|
|
|
}
|
|
|
|
if (NULL != module->p2p_fence_coll_counts) {
|
|
|
|
free(module->p2p_fence_coll_counts);
|
|
|
|
}
|
|
|
|
if (NULL != module->p2p_copy_num_pending_sendreqs) {
|
|
|
|
free(module->p2p_copy_num_pending_sendreqs);
|
|
|
|
}
|
|
|
|
if (NULL != module->p2p_num_pending_sendreqs) {
|
|
|
|
free(module->p2p_num_pending_sendreqs);
|
|
|
|
}
|
|
|
|
if (NULL != module->p2p_comm) ompi_comm_free(&module->p2p_comm);
|
2006-01-28 15:38:37 +00:00
|
|
|
|
2009-05-06 20:11:28 +00:00
|
|
|
#if OPAL_ENABLE_DEBUG
|
2007-05-21 02:21:25 +00:00
|
|
|
memset(module, 0, sizeof(ompi_osc_base_module_t));
|
|
|
|
#endif
|
|
|
|
if (NULL != module) free(module);
|
2006-01-28 15:38:37 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|