2005-05-24 02:06:50 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2006-08-24 20:38:08 +04:00
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2015-06-24 06:59:57 +03: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.
|
|
|
|
* $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2005-05-24 02:06:50 +04:00
|
|
|
* Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2005-05-24 02:06:50 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "pml_ob1.h"
|
|
|
|
#include "pml_ob1_comm.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void mca_pml_ob1_comm_proc_construct(mca_pml_ob1_comm_proc_t* proc)
|
|
|
|
{
|
|
|
|
proc->expected_sequence = 1;
|
2006-09-21 02:14:46 +04:00
|
|
|
proc->ompi_proc = NULL;
|
2007-08-23 09:56:22 +04:00
|
|
|
proc->send_sequence = 0;
|
2005-07-03 20:22:16 +04:00
|
|
|
OBJ_CONSTRUCT(&proc->frags_cant_match, opal_list_t);
|
|
|
|
OBJ_CONSTRUCT(&proc->specific_receives, opal_list_t);
|
|
|
|
OBJ_CONSTRUCT(&proc->unexpected_frags, opal_list_t);
|
2005-05-24 02:06:50 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void mca_pml_ob1_comm_proc_destruct(mca_pml_ob1_comm_proc_t* proc)
|
|
|
|
{
|
|
|
|
OBJ_DESTRUCT(&proc->frags_cant_match);
|
|
|
|
OBJ_DESTRUCT(&proc->specific_receives);
|
|
|
|
OBJ_DESTRUCT(&proc->unexpected_frags);
|
2015-08-31 23:58:43 +03:00
|
|
|
if (proc->ompi_proc) {
|
|
|
|
OBJ_RELEASE(proc->ompi_proc);
|
|
|
|
}
|
2005-05-24 02:06:50 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-08-31 23:58:43 +03:00
|
|
|
OBJ_CLASS_INSTANCE(mca_pml_ob1_comm_proc_t, opal_object_t,
|
|
|
|
mca_pml_ob1_comm_proc_construct,
|
|
|
|
mca_pml_ob1_comm_proc_destruct);
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
|
|
|
|
static void mca_pml_ob1_comm_construct(mca_pml_ob1_comm_t* comm)
|
|
|
|
{
|
2005-07-03 20:22:16 +04:00
|
|
|
OBJ_CONSTRUCT(&comm->wild_receives, opal_list_t);
|
2005-07-04 02:45:48 +04:00
|
|
|
OBJ_CONSTRUCT(&comm->matching_lock, opal_mutex_t);
|
2005-05-24 02:06:50 +04:00
|
|
|
comm->recv_sequence = 0;
|
|
|
|
comm->procs = NULL;
|
2011-10-12 00:24:54 +04:00
|
|
|
comm->last_probed = 0;
|
2005-05-24 02:06:50 +04:00
|
|
|
comm->num_procs = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void mca_pml_ob1_comm_destruct(mca_pml_ob1_comm_t* comm)
|
|
|
|
{
|
2015-08-31 23:58:43 +03:00
|
|
|
if (NULL != comm->procs) {
|
|
|
|
for (size_t i = 0; i < comm->num_procs; ++i) {
|
|
|
|
if (comm->procs[i]) {
|
|
|
|
OBJ_RELEASE(comm->procs[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
free(comm->procs);
|
2015-08-31 23:58:43 +03:00
|
|
|
}
|
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
OBJ_DESTRUCT(&comm->wild_receives);
|
|
|
|
OBJ_DESTRUCT(&comm->matching_lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
mca_pml_ob1_comm_t,
|
2005-07-03 20:06:07 +04:00
|
|
|
opal_object_t,
|
2005-05-24 02:06:50 +04:00
|
|
|
mca_pml_ob1_comm_construct,
|
|
|
|
mca_pml_ob1_comm_destruct);
|
|
|
|
|
|
|
|
|
2015-08-31 23:58:43 +03:00
|
|
|
int mca_pml_ob1_comm_init_size (mca_pml_ob1_comm_t* comm, size_t size)
|
2005-05-24 02:06:50 +04:00
|
|
|
{
|
|
|
|
/* send message sequence-number support - sender side */
|
2015-08-31 23:58:43 +03:00
|
|
|
comm->procs = (mca_pml_ob1_comm_proc_t **) calloc(size, sizeof (mca_pml_ob1_comm_proc_t *));
|
2005-05-24 02:06:50 +04:00
|
|
|
if(NULL == comm->procs) {
|
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
comm->num_procs = size;
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|