More fixes. Remove useless files. Decrease the memory footprint for this PML.
This commit was SVN r5598.
Этот коммит содержится в:
родитель
6ef5b7283f
Коммит
cb509df2ee
@ -45,5 +45,5 @@ pml_uniq_la_sources = pml_uniq.c pml_uniq.h pml_uniq_cancel.c pml_uniq_component
|
||||
pml_uniq_component.h pml_uniq_iprobe.c pml_uniq_irecv.c pml_uniq_isend.c \
|
||||
pml_uniq_ptl.c pml_uniq_ptl.h pml_uniq_proc.c pml_uniq_proc.h pml_uniq_progress.c \
|
||||
pml_uniq_recvfrag.c pml_uniq_recvfrag.h pml_uniq_recvreq.c pml_uniq_recvreq.h \
|
||||
pml_uniq_sendreq.c pml_uniq_sendreq.h pml_uniq_start.c pml_ptl_array.c pml_ptl_array.h
|
||||
pml_uniq_sendreq.c pml_uniq_sendreq.h pml_uniq_start.c
|
||||
|
||||
|
@ -1,61 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "mca/pml/pml.h"
|
||||
#include "pml_ptl_array.h"
|
||||
|
||||
|
||||
static void mca_ptl_array_construct(mca_ptl_array_t* array)
|
||||
{
|
||||
array->ptl_procs = 0;
|
||||
array->ptl_size = 0;
|
||||
array->ptl_index = 0;
|
||||
array->ptl_reserve = 0;
|
||||
}
|
||||
|
||||
|
||||
static void mca_ptl_array_destruct(mca_ptl_array_t* array)
|
||||
{
|
||||
if(array->ptl_procs != 0)
|
||||
free(array->ptl_procs);
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE(
|
||||
mca_pml_uniq_ptl_array_t,
|
||||
ompi_object_t,
|
||||
mca_ptl_array_construct,
|
||||
mca_ptl_array_destruct
|
||||
);
|
||||
|
||||
int mca_ptl_array_reserve(mca_ptl_array_t* array, size_t size)
|
||||
{
|
||||
mca_ptl_proc_t *procs;
|
||||
if(array->ptl_reserve >= size)
|
||||
return OMPI_SUCCESS;
|
||||
|
||||
procs = (mca_ptl_proc_t *)realloc(array->ptl_procs, sizeof(mca_ptl_proc_t)*size);
|
||||
if(NULL == procs)
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
array->ptl_procs = procs;
|
||||
array->ptl_reserve = size;
|
||||
memset(array->ptl_procs+array->ptl_size, 0, (size-array->ptl_size)*sizeof(mca_ptl_proc_t));
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
@ -1,146 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
#ifndef OMPI_PTL_ARRAY_H
|
||||
#define OMPI_PTL_ARRAY_H
|
||||
|
||||
#include "util/output.h"
|
||||
#include "mca/ptl/ptl.h"
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern ompi_class_t mca_pml_uniq_ptl_array_t_class;
|
||||
|
||||
/**
|
||||
* A data structure associated with a ompi_proc_t that caches
|
||||
* addressing/scheduling attributes for a specific PTL instance
|
||||
* that can be used to reach the process.
|
||||
*/
|
||||
struct mca_ptl_proc_t {
|
||||
int ptl_weight; /**< PTL weight for scheduling */
|
||||
struct mca_ptl_base_peer_t* ptl_peer; /**< PTL addressing info */
|
||||
struct mca_pml_base_ptl_t* ptl_base; /**< PML specific PTL info */
|
||||
mca_ptl_base_module_t *ptl; /**< PTL module */
|
||||
};
|
||||
typedef struct mca_ptl_proc_t mca_ptl_proc_t;
|
||||
|
||||
/**
|
||||
* A dynamically growable array of mca_ptl_proc_t instances.
|
||||
* Maintains an index into the array that is used for round-robin
|
||||
* scheduling across contents.
|
||||
*/
|
||||
struct mca_ptl_array_t {
|
||||
ompi_object_t super;
|
||||
mca_ptl_proc_t* ptl_procs; /**< array of ptl procs */
|
||||
size_t ptl_size; /**< number available */
|
||||
size_t ptl_reserve; /**< size of allocated ptl_proc array */
|
||||
size_t ptl_index; /**< last used index*/
|
||||
};
|
||||
typedef struct mca_ptl_array_t mca_ptl_array_t;
|
||||
typedef struct mca_ptl_array_t mca_pml_uniq_ptl_array_t;
|
||||
|
||||
|
||||
/**
|
||||
* If required, reallocate (grow) the array to the indicate size.
|
||||
*
|
||||
* @param array (IN)
|
||||
* @param size (IN)
|
||||
*/
|
||||
int mca_ptl_array_reserve(mca_ptl_array_t*, size_t);
|
||||
|
||||
static inline size_t mca_ptl_array_get_size(mca_ptl_array_t* array)
|
||||
{
|
||||
return array->ptl_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grow the array if required, and set the size.
|
||||
*
|
||||
* @param array (IN)
|
||||
* @param size (IN)
|
||||
*/
|
||||
static inline void mca_ptl_array_set_size(mca_ptl_array_t* array, size_t size)
|
||||
{
|
||||
if(array->ptl_size > array->ptl_reserve)
|
||||
mca_ptl_array_reserve(array, size);
|
||||
array->ptl_size = size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grow the array size by one and return the item at that index.
|
||||
*
|
||||
* @param array (IN)
|
||||
*/
|
||||
static inline mca_ptl_proc_t* mca_ptl_array_insert(mca_ptl_array_t* array)
|
||||
{
|
||||
#if OMPI_ENABLE_DEBUG
|
||||
if(array->ptl_size >= array->ptl_reserve) {
|
||||
ompi_output(0, "mca_ptl_array_insert: invalid array index %d >= %d",
|
||||
array->ptl_size, array->ptl_reserve);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return &array->ptl_procs[array->ptl_size++];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array item at the specified index.
|
||||
*
|
||||
* @param array (IN)
|
||||
* @param index (IN)
|
||||
*/
|
||||
static inline mca_ptl_proc_t* mca_ptl_array_get_index(mca_ptl_array_t* array, size_t index)
|
||||
{
|
||||
#if OMPI_ENABLE_DEBUG
|
||||
if(index >= array->ptl_size) {
|
||||
ompi_output(0, "mca_ptl_array_get_index: invalid array index %d >= %d",
|
||||
index, array->ptl_size);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return &array->ptl_procs[index];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the next LRU index in the array.
|
||||
*
|
||||
* @param array (IN)
|
||||
* @param index (IN)
|
||||
*/
|
||||
static inline mca_ptl_proc_t* mca_ptl_array_get_next(mca_ptl_array_t* array)
|
||||
{
|
||||
mca_ptl_proc_t* ptl_proc;
|
||||
#if OMPI_ENABLE_DEBUG
|
||||
if(array->ptl_size == 0) {
|
||||
ompi_output(0, "mca_ptl_array_get_next: invalid array size");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
ptl_proc = &array->ptl_procs[array->ptl_index++];
|
||||
if(array->ptl_index == array->ptl_size)
|
||||
array->ptl_index = 0;
|
||||
return ptl_proc;
|
||||
}
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -27,9 +27,9 @@
|
||||
#include "mca/ptl/base/ptl_base_header.h"
|
||||
#include "mca/ptl/base/ptl_base_recvfrag.h"
|
||||
#include "mca/ptl/base/ptl_base_sendfrag.h"
|
||||
#include "pml_uniq_proc.h"
|
||||
#include "pml_uniq.h"
|
||||
#include "pml_uniq_component.h"
|
||||
#include "pml_uniq_proc.h"
|
||||
#include "pml_uniq_ptl.h"
|
||||
#include "pml_uniq_recvreq.h"
|
||||
#include "pml_uniq_sendreq.h"
|
||||
@ -235,8 +235,6 @@ int mca_pml_uniq_add_procs(ompi_proc_t** procs, size_t nprocs)
|
||||
for( p = 0; p < nprocs; p++) {
|
||||
ompi_proc_t *proc;
|
||||
mca_pml_proc_t* proc_pml;
|
||||
mca_ptl_proc_t* proc_ptl;
|
||||
size_t size;
|
||||
|
||||
if( !ompi_bitmap_is_set_bit(&reachable, p) ) continue;
|
||||
|
||||
@ -256,40 +254,32 @@ int mca_pml_uniq_add_procs(ompi_proc_t** procs, size_t nprocs)
|
||||
free(ptl_peers);
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
#ifdef TOTO
|
||||
/* preallocate space in array for max number of ptls */
|
||||
mca_ptl_array_reserve(&proc_pml->proc_ptl_first, mca_pml_uniq.uniq_num_ptl_modules);
|
||||
mca_ptl_array_reserve(&proc_pml->proc_ptl_next, mca_pml_uniq.uniq_num_ptl_modules);
|
||||
#endif /* TOTO */
|
||||
|
||||
proc_pml->proc_ompi = proc;
|
||||
proc->proc_pml = proc_pml;
|
||||
/* it's the first PTL so add it to both first and next */
|
||||
proc_pml->proc_ptl_flags |= ptl->ptl_flags;
|
||||
proc_pml->proc_ptl_first = proc_ptl;
|
||||
proc_pml->proc_ptl_next = proc_ptl;
|
||||
proc_pml->proc_ptl_first.ptl_peer = ptl_peers[p];
|
||||
proc_pml->proc_ptl_first.ptl_base = NULL;
|
||||
proc_pml->proc_ptl_first.ptl = ptl;
|
||||
proc_pml->proc_ptl_next.ptl_peer = ptl_peers[p];
|
||||
proc_pml->proc_ptl_next.ptl_base = NULL;
|
||||
proc_pml->proc_ptl_next.ptl = ptl;
|
||||
} else {
|
||||
/* choose the best for first and next. For the first look at the latency when
|
||||
* for the next at the maximum bandwidth.
|
||||
*/
|
||||
}
|
||||
/* dont allow an additional PTL with a lower exclusivity ranking */
|
||||
size = mca_ptl_array_get_size(&proc_pml->proc_ptl_next);
|
||||
if( size > 0 ) {
|
||||
proc_ptl = mca_ptl_array_get_index(&proc_pml->proc_ptl_next, size-1);
|
||||
/* skip this ptl if the exclusivity is less than the previous */
|
||||
if(proc_ptl->ptl->ptl_exclusivity > ptl->ptl_exclusivity) {
|
||||
if( NULL != proc_pml->proc_ptl_first.ptl ) {
|
||||
if( proc_pml->proc_ptl_first.ptl->ptl_exclusivity > ptl->ptl_exclusivity ) {
|
||||
/* skip this ptl if the exclusivity is less than the previous */
|
||||
if(ptl_peers[p] != NULL) {
|
||||
ptl->ptl_del_procs(ptl, 1, &proc, &ptl_peers[p]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* cache the ptl on the proc */
|
||||
proc_ptl = mca_ptl_array_insert(&proc_pml->proc_ptl_next);
|
||||
proc_ptl->ptl = ptl;
|
||||
proc_ptl->ptl_peer = ptl_peers[p];
|
||||
proc_ptl->ptl_weight = 0;
|
||||
proc_pml->proc_ptl_flags |= ptl->ptl_flags;
|
||||
}
|
||||
|
||||
@ -311,74 +301,6 @@ int mca_pml_uniq_add_procs(ompi_proc_t** procs, size_t nprocs)
|
||||
}
|
||||
free(ptl_peers);
|
||||
|
||||
/* iterate back through procs and compute metrics for registered ptls */
|
||||
for( p = 0; p < nprocs; p++ ) {
|
||||
ompi_proc_t *proc = procs[p];
|
||||
mca_pml_proc_t* proc_pml = proc->proc_pml;
|
||||
double total_bandwidth = 0;
|
||||
uint32_t latency = 0;
|
||||
size_t n_index;
|
||||
size_t n_size;
|
||||
|
||||
/* skip over procs w/ no ptls registered */
|
||||
if(NULL == proc_pml)
|
||||
continue;
|
||||
|
||||
/* (1) determine the total bandwidth available across all ptls
|
||||
* note that we need to do this here, as we may already have ptls configured
|
||||
* (2) determine the highest priority ranking for latency
|
||||
*/
|
||||
n_size = mca_ptl_array_get_size(&proc_pml->proc_ptl_next);
|
||||
for(n_index = 0; n_index < n_size; n_index++) {
|
||||
struct mca_ptl_proc_t* proc_ptl = mca_ptl_array_get_index(&proc_pml->proc_ptl_next, n_index);
|
||||
struct mca_ptl_base_module_t* ptl = proc_ptl->ptl;
|
||||
total_bandwidth += proc_ptl->ptl->ptl_bandwidth;
|
||||
if(ptl->ptl_latency > latency)
|
||||
latency = ptl->ptl_latency;
|
||||
}
|
||||
|
||||
/* (1) set the weight of each ptl as a percentage of overall bandwidth
|
||||
* (2) copy all ptl instances at the highest priority ranking into the
|
||||
* list of ptls used for first fragments
|
||||
*/
|
||||
|
||||
for(n_index = 0; n_index < n_size; n_index++) {
|
||||
struct mca_ptl_proc_t* proc_ptl = mca_ptl_array_get_index(&proc_pml->proc_ptl_next, n_index);
|
||||
struct mca_ptl_base_module_t *ptl = proc_ptl->ptl;
|
||||
double weight;
|
||||
|
||||
/* compute weighting factor for this ptl */
|
||||
if(ptl->ptl_bandwidth)
|
||||
weight = proc_ptl->ptl->ptl_bandwidth / total_bandwidth;
|
||||
else
|
||||
weight = 1.0 / n_size;
|
||||
proc_ptl->ptl_weight = (int)(weight * 100);
|
||||
|
||||
/*
|
||||
* save/create ptl extension for use by pml
|
||||
*/
|
||||
proc_ptl->ptl_base = ptl->ptl_base;
|
||||
if (NULL == proc_ptl->ptl_base &&
|
||||
ptl->ptl_cache_bytes > 0 &&
|
||||
NULL != ptl->ptl_request_init &&
|
||||
NULL != ptl->ptl_request_fini) {
|
||||
|
||||
mca_pml_base_ptl_t* ptl_base = OBJ_NEW(mca_pml_base_ptl_t);
|
||||
ptl_base->ptl = ptl;
|
||||
ptl_base->ptl_cache_size = ptl->ptl_cache_size;
|
||||
proc_ptl->ptl_base = ptl->ptl_base = ptl_base;
|
||||
}
|
||||
|
||||
/* check to see if this ptl is already in the array of ptls used for first
|
||||
* fragments - if not add it.
|
||||
*/
|
||||
if(ptl->ptl_latency == latency) {
|
||||
struct mca_ptl_proc_t* proc_new = mca_ptl_array_insert(&proc_pml->proc_ptl_first);
|
||||
*proc_new = *proc_ptl;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -401,14 +323,14 @@ int mca_pml_uniq_del_procs(ompi_proc_t** procs, size_t nprocs)
|
||||
* the same then we have to remove the processor from both of them.
|
||||
*/
|
||||
|
||||
ptl_proc = proc_pml->proc_ptl_first;
|
||||
ptl_proc = &(proc_pml->proc_ptl_first);
|
||||
ptl = ptl_proc->ptl;
|
||||
rc = ptl->ptl_del_procs( ptl, 1, &proc, &ptl_proc->ptl_peer );
|
||||
if( OMPI_SUCCESS != rc ) {
|
||||
return rc;
|
||||
}
|
||||
if( proc_pml->proc_ptl_first != proc_pml->proc_ptl_next ) {
|
||||
ptl_proc = proc_pml->proc_ptl_next;
|
||||
if( proc_pml->proc_ptl_first.ptl != proc_pml->proc_ptl_next.ptl ) {
|
||||
ptl_proc = &(proc_pml->proc_ptl_next);
|
||||
ptl = ptl_proc->ptl;
|
||||
rc = ptl->ptl_del_procs( ptl, 1, &proc, &ptl_proc->ptl_peer );
|
||||
if( OMPI_SUCCESS != rc ) {
|
||||
|
@ -27,12 +27,14 @@ static void mca_pml_uniq_proc_construct(mca_pml_proc_t* proc)
|
||||
proc->proc_ompi = NULL;
|
||||
proc->proc_ptl_flags = 0;
|
||||
OBJ_CONSTRUCT(&proc->proc_lock, ompi_mutex_t);
|
||||
#ifdef TOTO
|
||||
OBJ_CONSTRUCT(&proc->proc_ptl_first, mca_pml_uniq_ptl_array_t);
|
||||
OBJ_CONSTRUCT(&proc->proc_ptl_next, mca_pml_uniq_ptl_array_t);
|
||||
#endif /* TOTO */
|
||||
proc->proc_ptl_first = NULL;
|
||||
proc->proc_ptl_next = NULL;
|
||||
|
||||
proc->proc_ptl_first.ptl_peer = NULL;
|
||||
proc->proc_ptl_first.ptl_base = NULL;
|
||||
proc->proc_ptl_first.ptl = NULL;
|
||||
|
||||
proc->proc_ptl_next.ptl_peer = NULL;
|
||||
proc->proc_ptl_next.ptl_base = NULL;
|
||||
proc->proc_ptl_next.ptl = NULL;
|
||||
|
||||
OMPI_THREAD_LOCK(&mca_pml_uniq.uniq_lock);
|
||||
ompi_list_append(&mca_pml_uniq.uniq_procs, (ompi_list_item_t*)proc);
|
||||
@ -47,10 +49,6 @@ static void mca_pml_uniq_proc_destruct(mca_pml_proc_t* proc)
|
||||
OMPI_THREAD_UNLOCK(&mca_pml_uniq.uniq_lock);
|
||||
|
||||
OBJ_DESTRUCT(&proc->proc_lock);
|
||||
#ifdef TOTO
|
||||
OBJ_DESTRUCT(&proc->proc_ptl_first);
|
||||
OBJ_DESTRUCT(&proc->proc_ptl_next);
|
||||
#endif /* TOTO */
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE(
|
||||
|
@ -23,92 +23,90 @@
|
||||
#include "communicator/communicator.h"
|
||||
#include "group/group.h"
|
||||
#include "proc/proc.h"
|
||||
#include "pml_ptl_array.h"
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
/**
|
||||
* Structure associated w/ ompi_proc_t that contains data specific
|
||||
* to the PML. Note that this name is not PML specific.
|
||||
*/
|
||||
struct mca_pml_proc_t {
|
||||
ompi_list_item_t super;
|
||||
ompi_proc_t *proc_ompi; /**< back-pointer to ompi_proc_t */
|
||||
ompi_mutex_t proc_lock; /**< lock to protect against concurrent access */
|
||||
mca_ptl_proc_t* proc_ptl_first; /**< ptl for the first fragment */
|
||||
mca_ptl_proc_t* proc_ptl_next; /**< ptl for the remaining fragments */
|
||||
#ifdef TOTO
|
||||
mca_ptl_array_t proc_ptl_first; /**< array of ptls to use for first fragments */
|
||||
mca_ptl_array_t proc_ptl_next; /**< array of ptls to use for remaining fragments */
|
||||
#endif /* TOTO */
|
||||
uint32_t proc_ptl_flags; /**< aggregate ptl flags */
|
||||
};
|
||||
typedef struct mca_pml_proc_t mca_pml_proc_t;
|
||||
|
||||
/**
|
||||
* A data structure associated with a ompi_proc_t that caches
|
||||
* addressing/scheduling attributes for a specific PTL instance
|
||||
* that can be used to reach the process.
|
||||
*/
|
||||
struct mca_ptl_proc_t {
|
||||
struct mca_ptl_base_peer_t* ptl_peer; /**< PTL addressing info */
|
||||
struct mca_pml_base_ptl_t* ptl_base; /**< PML specific PTL info */
|
||||
mca_ptl_base_module_t *ptl; /**< PTL module */
|
||||
};
|
||||
typedef struct mca_ptl_proc_t mca_ptl_proc_t;
|
||||
|
||||
/**
|
||||
* Structure associated w/ ompi_proc_t that contains data specific
|
||||
* to the PML. Note that this name is not PML specific.
|
||||
*/
|
||||
struct mca_pml_proc_t {
|
||||
ompi_list_item_t super;
|
||||
ompi_proc_t *proc_ompi; /**< back-pointer to ompi_proc_t */
|
||||
ompi_mutex_t proc_lock; /**< lock to protect against concurrent access */
|
||||
mca_ptl_proc_t proc_ptl_first; /**< ptl for the first fragment */
|
||||
mca_ptl_proc_t proc_ptl_next; /**< ptl for the remaining fragments */
|
||||
uint32_t proc_ptl_flags; /**< aggregate ptl flags */
|
||||
};
|
||||
typedef struct mca_pml_proc_t mca_pml_proc_t;
|
||||
|
||||
|
||||
OMPI_COMP_EXPORT extern ompi_class_t mca_pml_uniq_proc_t_class;
|
||||
typedef struct mca_pml_proc_t mca_pml_uniq_proc_t;
|
||||
OMPI_COMP_EXPORT extern ompi_class_t mca_pml_uniq_proc_t_class;
|
||||
typedef struct mca_pml_proc_t mca_pml_uniq_proc_t;
|
||||
|
||||
/**
|
||||
* Return the mca_pml_proc_t instance cached in the communicators local group.
|
||||
*
|
||||
* @param comm Communicator
|
||||
* @param rank Peer rank
|
||||
* @return mca_pml_proc_t instance
|
||||
*/
|
||||
/**
|
||||
* Return the mca_pml_proc_t instance cached in the communicators local group.
|
||||
*
|
||||
* @param comm Communicator
|
||||
* @param rank Peer rank
|
||||
* @return mca_pml_proc_t instance
|
||||
*/
|
||||
|
||||
static inline mca_pml_proc_t* mca_pml_uniq_proc_lookup_local(ompi_communicator_t* comm, int rank)
|
||||
{
|
||||
ompi_proc_t* proc = comm->c_local_group->grp_proc_pointers[rank];
|
||||
return proc->proc_pml;
|
||||
}
|
||||
static inline mca_pml_proc_t* mca_pml_uniq_proc_lookup_local(ompi_communicator_t* comm, int rank)
|
||||
{
|
||||
ompi_proc_t* proc = comm->c_local_group->grp_proc_pointers[rank];
|
||||
return proc->proc_pml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the mca_pml_proc_t instance cached on the communicators remote group.
|
||||
*
|
||||
* @param comm Communicator
|
||||
* @param rank Peer rank
|
||||
* @return mca_pml_proc_t instance
|
||||
*/
|
||||
/**
|
||||
* Return the mca_pml_proc_t instance cached on the communicators remote group.
|
||||
*
|
||||
* @param comm Communicator
|
||||
* @param rank Peer rank
|
||||
* @return mca_pml_proc_t instance
|
||||
*/
|
||||
|
||||
static inline mca_pml_proc_t* mca_pml_uniq_proc_lookup_remote(ompi_communicator_t* comm, int rank)
|
||||
{
|
||||
ompi_proc_t* proc = comm->c_remote_group->grp_proc_pointers[rank];
|
||||
return proc->proc_pml;
|
||||
}
|
||||
static inline mca_pml_proc_t* mca_pml_uniq_proc_lookup_remote(ompi_communicator_t* comm, int rank)
|
||||
{
|
||||
ompi_proc_t* proc = comm->c_remote_group->grp_proc_pointers[rank];
|
||||
return proc->proc_pml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the mca_ptl_peer_t instance corresponding to the process/ptl combination.
|
||||
*
|
||||
* @param comm Communicator
|
||||
* @param rank Peer rank
|
||||
* @return mca_pml_proc_t instance
|
||||
*/
|
||||
/**
|
||||
* Return the mca_ptl_peer_t instance corresponding to the process/ptl combination.
|
||||
*
|
||||
* @param comm Communicator
|
||||
* @param rank Peer rank
|
||||
* @return mca_pml_proc_t instance
|
||||
*/
|
||||
|
||||
static inline struct mca_ptl_base_peer_t* mca_pml_uniq_proc_lookup_remote_peer(
|
||||
ompi_communicator_t* comm,
|
||||
int rank,
|
||||
struct mca_ptl_base_module_t* ptl)
|
||||
{
|
||||
ompi_proc_t* proc = comm->c_remote_group->grp_proc_pointers[rank];
|
||||
mca_pml_proc_t* proc_pml = proc->proc_pml;
|
||||
if( proc_pml->proc_ptl_first->ptl == ptl )
|
||||
return proc_pml->proc_ptl_first->ptl_peer;
|
||||
if( proc_pml->proc_ptl_next->ptl == ptl )
|
||||
return proc_pml->proc_ptl_next->ptl_peer;
|
||||
#ifdef TOTO
|
||||
size_t i, size = mca_ptl_array_get_size(&proc_pml->proc_ptl_first);
|
||||
mca_ptl_proc_t* proc_ptl = proc_pml->proc_ptl_first.ptl_procs;
|
||||
for(i = 0; i < size; i++) {
|
||||
if(proc_ptl->ptl == ptl) {
|
||||
return proc_ptl->ptl_peer;
|
||||
}
|
||||
proc_ptl++;
|
||||
}
|
||||
#endif /* TOTO */
|
||||
return NULL;
|
||||
}
|
||||
static inline struct mca_ptl_base_peer_t* mca_pml_uniq_proc_lookup_remote_peer(
|
||||
ompi_communicator_t* comm,
|
||||
int rank,
|
||||
struct mca_ptl_base_module_t* ptl)
|
||||
{
|
||||
ompi_proc_t* proc = comm->c_remote_group->grp_proc_pointers[rank];
|
||||
mca_pml_proc_t* proc_pml = proc->proc_pml;
|
||||
if( proc_pml->proc_ptl_first.ptl == ptl )
|
||||
return proc_pml->proc_ptl_first.ptl_peer;
|
||||
if( proc_pml->proc_ptl_next.ptl == ptl )
|
||||
return proc_pml->proc_ptl_next.ptl_peer;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ int mca_pml_uniq_send_request_schedule(mca_pml_base_send_request_t* req)
|
||||
* the scheduling logic once for every call.
|
||||
*/
|
||||
if(OMPI_THREAD_ADD32(&req->req_lock,1) == 1) {
|
||||
mca_ptl_proc_t* ptl_proc = proc_pml->proc_ptl_next;
|
||||
mca_ptl_proc_t* ptl_proc = &(proc_pml->proc_ptl_next);
|
||||
mca_ptl_base_module_t* ptl = ptl_proc->ptl;
|
||||
/* allocate remaining bytes to PTLs */
|
||||
bytes_remaining = req->req_bytes_packed - req->req_offset;
|
||||
|
@ -46,7 +46,7 @@ OBJ_CLASS_DECLARATION(mca_pml_uniq_send_request_t);
|
||||
if(NULL == proc) { \
|
||||
return OMPI_ERR_OUT_OF_RESOURCE; \
|
||||
} \
|
||||
ptl_base = proc->proc_ptl_first->ptl_base; \
|
||||
ptl_base = proc->proc_ptl_first.ptl_base; \
|
||||
/* \
|
||||
* check to see if there is a cache of send requests associated with \
|
||||
* this ptl - if so try the allocation from there. \
|
||||
@ -80,7 +80,7 @@ OBJ_CLASS_DECLARATION(mca_pml_uniq_send_request_t);
|
||||
OMPI_THREAD_UNLOCK(&ptl_base->ptl_cache_lock); \
|
||||
OMPI_FREE_LIST_WAIT(&mca_pml_uniq.uniq_send_requests, item, rc); \
|
||||
sendreq = (mca_pml_base_send_request_t*)item; \
|
||||
sendreq->req_ptl = proc->proc_ptl_first->ptl; \
|
||||
sendreq->req_ptl = proc->proc_ptl_first.ptl; \
|
||||
} \
|
||||
\
|
||||
/* otherwise - take the allocation from the global list */ \
|
||||
@ -88,10 +88,10 @@ OBJ_CLASS_DECLARATION(mca_pml_uniq_send_request_t);
|
||||
ompi_list_item_t* item; \
|
||||
OMPI_FREE_LIST_WAIT(&mca_pml_uniq.uniq_send_requests, item, rc); \
|
||||
sendreq = (mca_pml_base_send_request_t*)item; \
|
||||
sendreq->req_ptl = proc->proc_ptl_first->ptl; \
|
||||
sendreq->req_ptl = proc->proc_ptl_first.ptl; \
|
||||
} \
|
||||
/* update request to point to current peer */ \
|
||||
sendreq->req_peer = proc->proc_ptl_first->ptl_peer; \
|
||||
sendreq->req_peer = proc->proc_ptl_first.ptl_peer; \
|
||||
}
|
||||
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user