2005-05-04 17:08:08 +00:00
|
|
|
/*
|
2005-11-05 19:57:48 +00:00
|
|
|
* 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
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-05-04 17:08:08 +00:00
|
|
|
* 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.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "opal/sys/atomic.h"
|
2005-05-04 17:08:08 +00:00
|
|
|
#include "pml_uniq.h"
|
|
|
|
#include "pml_uniq_proc.h"
|
|
|
|
|
|
|
|
|
2005-08-12 02:41:14 +00:00
|
|
|
static void mca_pml_uniq_proc_construct(mca_pml_uniq_proc_t* proc)
|
2005-05-04 17:08:08 +00:00
|
|
|
{
|
2005-08-12 02:41:14 +00:00
|
|
|
proc->base.proc_ompi = NULL;
|
2005-05-04 17:08:08 +00:00
|
|
|
proc->proc_ptl_flags = 0;
|
2005-08-12 02:41:14 +00:00
|
|
|
OBJ_CONSTRUCT(&proc->base.proc_lock, opal_mutex_t);
|
2005-05-05 04:17:52 +00:00
|
|
|
|
|
|
|
proc->proc_ptl_first.ptl_peer = NULL;
|
|
|
|
proc->proc_ptl_first.ptl_base = NULL;
|
|
|
|
proc->proc_ptl_first.ptl = NULL;
|
2005-05-05 04:35:18 +00:00
|
|
|
#if PML_UNIQ_ACCEPT_NEXT_PTL
|
2005-05-05 04:17:52 +00:00
|
|
|
proc->proc_ptl_next.ptl_peer = NULL;
|
|
|
|
proc->proc_ptl_next.ptl_base = NULL;
|
|
|
|
proc->proc_ptl_next.ptl = NULL;
|
2005-05-05 04:35:18 +00:00
|
|
|
#endif /* PML_UNIQ_ACCEPT_NEXT_PTL */
|
2005-07-03 22:45:48 +00:00
|
|
|
OPAL_THREAD_LOCK(&mca_pml_uniq.uniq_lock);
|
2005-07-03 16:22:16 +00:00
|
|
|
opal_list_append(&mca_pml_uniq.uniq_procs, (opal_list_item_t*)proc);
|
2005-07-03 22:45:48 +00:00
|
|
|
OPAL_THREAD_UNLOCK(&mca_pml_uniq.uniq_lock);
|
2005-05-04 17:08:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-08-12 02:41:14 +00:00
|
|
|
static void mca_pml_uniq_proc_destruct(mca_pml_uniq_proc_t* proc)
|
2005-05-04 17:08:08 +00:00
|
|
|
{
|
2005-07-03 22:45:48 +00:00
|
|
|
OPAL_THREAD_LOCK(&mca_pml_uniq.uniq_lock);
|
2005-07-03 16:22:16 +00:00
|
|
|
opal_list_remove_item(&mca_pml_uniq.uniq_procs, (opal_list_item_t*)proc);
|
2005-07-03 22:45:48 +00:00
|
|
|
OPAL_THREAD_UNLOCK(&mca_pml_uniq.uniq_lock);
|
2005-05-04 17:08:08 +00:00
|
|
|
|
2005-08-12 02:41:14 +00:00
|
|
|
OBJ_DESTRUCT(&proc->base.proc_lock);
|
2005-05-04 17:08:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
mca_pml_uniq_proc_t,
|
2005-07-03 16:22:16 +00:00
|
|
|
opal_list_item_t,
|
2005-05-04 17:08:08 +00:00
|
|
|
mca_pml_uniq_proc_construct,
|
|
|
|
mca_pml_uniq_proc_destruct
|
|
|
|
);
|
|
|
|
|