Revert prior commits from last night that involved significant change to the GPR, along with cosmetic changes to the odls_default module pending review and test.
Reverts r14328, r14329, r14331, r14333, r14335, r14338, and r14336. This commit was SVN r14351. The following SVN revision numbers were found above: r14328 --> open-mpi/ompi@d1ce4a44ca r14329 --> open-mpi/ompi@604e79f2d2 r14331 --> open-mpi/ompi@b2b3417475 r14333 --> open-mpi/ompi@8882f355b4 r14335 --> open-mpi/ompi@10dfd534f6 r14336 --> open-mpi/ompi@5c65c55e59 r14338 --> open-mpi/ompi@579184cd72
Этот коммит содержится в:
родитель
51f286d737
Коммит
adb44c44b1
@ -3,7 +3,7 @@
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -21,10 +21,12 @@
|
||||
|
||||
headers += \
|
||||
class/orte_proc_table.h \
|
||||
class/orte_bitmap.h \
|
||||
class/orte_pointer_array.h \
|
||||
class/orte_value_array.h
|
||||
|
||||
libopen_rte_la_SOURCES += \
|
||||
class/orte_proc_table.c \
|
||||
class/orte_bitmap.c \
|
||||
class/orte_pointer_array.c \
|
||||
class/orte_value_array.c
|
||||
|
250
orte/class/orte_bitmap.c
Обычный файл
250
orte/class/orte_bitmap.c
Обычный файл
@ -0,0 +1,250 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright (c) 2004-2007 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 "orte_config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "orte/orte_constants.h"
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
|
||||
#include "orte/class/orte_bitmap.h"
|
||||
|
||||
|
||||
#define SIZE_OF_CHAR (sizeof(char) * 8)
|
||||
#define DEFAULT_BITMAP_SIZE 64
|
||||
|
||||
static void orte_bitmap_construct(orte_bitmap_t *bm);
|
||||
static void orte_bitmap_destruct(orte_bitmap_t *bm);
|
||||
|
||||
OBJ_CLASS_INSTANCE(
|
||||
orte_bitmap_t,
|
||||
opal_object_t,
|
||||
orte_bitmap_construct,
|
||||
orte_bitmap_destruct
|
||||
);
|
||||
|
||||
|
||||
static void
|
||||
orte_bitmap_construct(orte_bitmap_t *bm)
|
||||
{
|
||||
orte_std_cntr_t size;
|
||||
|
||||
size = DEFAULT_BITMAP_SIZE / SIZE_OF_CHAR;
|
||||
|
||||
bm->array_size = size + ((size % SIZE_OF_CHAR == 0) ? 0 : 1);
|
||||
bm->bitmap = (unsigned char *) malloc(bm->array_size);
|
||||
bm->legal_numbits = SIZE_OF_CHAR*bm->array_size;
|
||||
memset(bm->bitmap, 0, bm->array_size);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
orte_bitmap_destruct(orte_bitmap_t *bm)
|
||||
{
|
||||
if (NULL != bm->bitmap) {
|
||||
free(bm->bitmap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
orte_bitmap_resize(orte_bitmap_t *bm, orte_std_cntr_t bit)
|
||||
{
|
||||
orte_std_cntr_t index, new_size, i;
|
||||
|
||||
index = bit / SIZE_OF_CHAR;
|
||||
index += (bit % SIZE_OF_CHAR == 0) ? 0 : 1;
|
||||
|
||||
if (index >= bm->array_size) {
|
||||
|
||||
/* We need to allocate more space for the bitmap, since we are
|
||||
out of range. We dont throw any error here, because this is
|
||||
valid and we simply expand the bitmap */
|
||||
|
||||
new_size = (index / bm->array_size + 1 ) * bm->array_size;
|
||||
|
||||
/* New size is just a multiple of the original size to fit in
|
||||
the index. */
|
||||
|
||||
bm->bitmap = (unsigned char *) realloc(bm->bitmap, new_size);
|
||||
if (NULL == bm->bitmap) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
/* zero out the new elements */
|
||||
for (i = bm->array_size; i < new_size; ++i) {
|
||||
bm->bitmap[i] = 0;
|
||||
}
|
||||
|
||||
/* Update the array_size */
|
||||
bm->array_size = new_size;
|
||||
bm->legal_numbits = new_size*SIZE_OF_CHAR;
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
orte_bitmap_set_bit(orte_bitmap_t *bm, orte_std_cntr_t bit)
|
||||
{
|
||||
orte_std_cntr_t index, offset;
|
||||
int rc;
|
||||
|
||||
if (NULL == bm) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||
return ORTE_ERR_BAD_PARAM;
|
||||
}
|
||||
|
||||
/* make sure the bitmap covers the requested bit */
|
||||
if (ORTE_SUCCESS != (rc = orte_bitmap_resize(bm, bit))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
index = bit / SIZE_OF_CHAR;
|
||||
offset = bit % SIZE_OF_CHAR;
|
||||
|
||||
/* Now set the bit */
|
||||
bm->bitmap[index] |= (1 << offset);
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
orte_bitmap_clear_bit(orte_bitmap_t *bm, orte_std_cntr_t bit)
|
||||
{
|
||||
orte_std_cntr_t index, offset;
|
||||
int rc;
|
||||
|
||||
if (NULL == bm) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||
return ORTE_ERR_BAD_PARAM;
|
||||
}
|
||||
|
||||
/* make sure the bitmap covers the requested bit */
|
||||
if (ORTE_SUCCESS != (rc = orte_bitmap_resize(bm, bit))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
index = bit / SIZE_OF_CHAR;
|
||||
offset = bit % SIZE_OF_CHAR;
|
||||
|
||||
/* now clear the bit */
|
||||
bm->bitmap[index] &= ~(1 << offset);
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
orte_bitmap_is_set_bit(orte_bitmap_t *bm, orte_std_cntr_t bit)
|
||||
{
|
||||
orte_std_cntr_t index, offset;
|
||||
|
||||
if ((bit > bm->legal_numbits - 1) || (NULL == bm)) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||
return ORTE_ERR_BAD_PARAM;
|
||||
}
|
||||
|
||||
index = bit / SIZE_OF_CHAR;
|
||||
offset = bit % SIZE_OF_CHAR;
|
||||
|
||||
if (index >= bm->array_size) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||
return ORTE_ERR_BAD_PARAM;
|
||||
}
|
||||
|
||||
if (0 != (bm->bitmap[index] & (1 << offset))) {
|
||||
return (int) true;
|
||||
}
|
||||
|
||||
return (int) false;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
orte_bitmap_clear_all_bits(orte_bitmap_t *bm)
|
||||
{
|
||||
if (NULL == bm) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||
return ORTE_ERR_BAD_PARAM;
|
||||
}
|
||||
|
||||
memset(bm->bitmap, 0, bm->array_size);
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
orte_bitmap_set_all_bits(orte_bitmap_t *bm)
|
||||
{
|
||||
orte_std_cntr_t i;
|
||||
|
||||
if (NULL == bm) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||
return ORTE_ERR_BAD_PARAM;
|
||||
}
|
||||
|
||||
for (i = 0; i < bm->array_size; ++i) {
|
||||
bm->bitmap[i] = ~((char) 0);
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
orte_bitmap_find_and_set_first_unset_bit(orte_bitmap_t *bm, orte_std_cntr_t *position)
|
||||
{
|
||||
orte_std_cntr_t i = 0;
|
||||
unsigned char temp;
|
||||
unsigned char all_ones = 0xff;
|
||||
|
||||
if (NULL == bm || NULL == position) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||
return ORTE_ERR_BAD_PARAM;
|
||||
}
|
||||
|
||||
/* Neglect all which don't have an unset bit */
|
||||
*position = 0;
|
||||
while((i < bm->array_size) && (bm->bitmap[i] == all_ones)) {
|
||||
++i;
|
||||
}
|
||||
|
||||
if (i == bm->array_size) {
|
||||
/* increase the bitmap size then */
|
||||
*position = bm->array_size * SIZE_OF_CHAR;
|
||||
return orte_bitmap_set_bit(bm, *position);
|
||||
}
|
||||
|
||||
/* This one has an unset bit, find its bit number */
|
||||
|
||||
temp = bm->bitmap[i];
|
||||
while (temp & 0x1) {
|
||||
++(*position);
|
||||
temp >>= 1;
|
||||
}
|
||||
|
||||
/* Now set the bit number */
|
||||
bm->bitmap[i] |= (bm->bitmap[i] + 1);
|
||||
|
||||
(*position) += i * SIZE_OF_CHAR;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
166
orte/class/orte_bitmap.h
Обычный файл
166
orte/class/orte_bitmap.h
Обычный файл
@ -0,0 +1,166 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. 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
|
||||
*
|
||||
* See ompi_bitmap.h for an explanation of why there is a split
|
||||
* between OMPI and ORTE for this generic class.
|
||||
*
|
||||
* A bitmap implementation. The bits start off with 0, so this bitmap
|
||||
* has bits numbered as bit 0, bit 1, bit 2 and so on. This bitmap
|
||||
* has auto-expansion capabilities, that is once the size is set
|
||||
* during init, it can be automatically expanded by setting the bit
|
||||
* beyond the current size. But note, this is allowed just when the
|
||||
* bit is set -- so the valid functions are set_bit and
|
||||
* find_and_set_bit. Other functions like clear, if passed a bit
|
||||
* outside the initialized range will result in an error.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ORTE_BITMAP_H
|
||||
#define ORTE_BITMAP_H
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/orte_types.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "opal/types.h"
|
||||
#include "opal/class/opal_object.h"
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct orte_bitmap_t {
|
||||
opal_object_t super; /**< Subclass of opal_object_t */
|
||||
unsigned char *bitmap; /**< The actual bitmap array of characters */
|
||||
orte_std_cntr_t array_size; /**< The actual array size that maintains the bitmap */
|
||||
orte_std_cntr_t legal_numbits; /**< The number of bits which are legal (the
|
||||
actual bitmap may contain more bits, since
|
||||
it needs to be rounded to the nearest
|
||||
char */
|
||||
};
|
||||
|
||||
typedef struct orte_bitmap_t orte_bitmap_t;
|
||||
|
||||
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_bitmap_t);
|
||||
|
||||
|
||||
/**
|
||||
* Sizes the bitmap to ensure it has at least the specified number of
|
||||
* bits in it. If it already does, then nothing happens. However, if the
|
||||
* bitmap is too small, then it is resized to accommodate the bit, with
|
||||
* all bits in the new space "cleared"
|
||||
*
|
||||
* @param bitmap The input bitmap (IN)
|
||||
* @param bit The bit that must be "covered" by the bitmap (IN)
|
||||
* @return ORTE error code or success
|
||||
*
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_bitmap_resize(orte_bitmap_t *bm, orte_std_cntr_t bit);
|
||||
|
||||
|
||||
/**
|
||||
* Set a bit of the bitmap. If the bit asked for is beyond the current
|
||||
* size of the bitmap, then the bitmap is extended to accomodate the
|
||||
* bit
|
||||
*
|
||||
* @param bitmap The input bitmap (IN)
|
||||
* @param bit The bit which is to be set (IN)
|
||||
* @return OMPI error code or success
|
||||
*
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_bitmap_set_bit(orte_bitmap_t *bm, orte_std_cntr_t bit);
|
||||
|
||||
|
||||
/**
|
||||
* Clear/unset a bit of the bitmap. If the bit is beyond the current
|
||||
* size of the bitmap, an error is returned
|
||||
*
|
||||
* @param bitmap The input bitmap (IN)
|
||||
* @param bit The bit which is to be cleared (IN)
|
||||
* @return ORTE error code if the bit is out of range, else success
|
||||
*
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_bitmap_clear_bit(orte_bitmap_t *bm, orte_std_cntr_t bit);
|
||||
|
||||
|
||||
/**
|
||||
* Find out if a bit is set in the bitmap
|
||||
*
|
||||
* @param bitmap The input bitmap (IN)
|
||||
* @param bit The bit which is to be checked (IN)
|
||||
* @return ORTE error code if the bit is out of range
|
||||
* 1 if the bit is set
|
||||
* 0 if the bit is not set
|
||||
*
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_bitmap_is_set_bit(orte_bitmap_t *bm, orte_std_cntr_t bit);
|
||||
|
||||
|
||||
/**
|
||||
* Find the first clear bit in the bitmap and set it
|
||||
*
|
||||
* @param bitmap The input bitmap (IN)
|
||||
* @param position Position of the first clear bit (OUT)
|
||||
|
||||
* @return err ORTE_SUCCESS on success
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_bitmap_find_and_set_first_unset_bit(orte_bitmap_t *bm,
|
||||
orte_std_cntr_t *position);
|
||||
|
||||
|
||||
/**
|
||||
* Clear all bits in the bitmap
|
||||
*
|
||||
* @param bitmap The input bitmap (IN)
|
||||
* @return ORTE error code if bm is NULL
|
||||
*
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_bitmap_clear_all_bits(orte_bitmap_t *bm);
|
||||
|
||||
|
||||
/**
|
||||
* Set all bits in the bitmap
|
||||
* @param bitmap The input bitmap (IN)
|
||||
* @return ORTE error code if bm is NULL
|
||||
*
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_bitmap_set_all_bits(orte_bitmap_t *bm);
|
||||
|
||||
|
||||
/**
|
||||
* Gives the current size (number of bits) in the bitmap. This is the
|
||||
* legal (accessible) number of bits
|
||||
*
|
||||
* @param bitmap The input bitmap (IN)
|
||||
* @return ORTE error code if bm is NULL
|
||||
*
|
||||
*/
|
||||
static inline int orte_bitmap_size(orte_bitmap_t *bm)
|
||||
{
|
||||
return (NULL == bm) ? 0 : (int)bm->legal_numbits;
|
||||
}
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -60,20 +60,25 @@ int orte_gpr_replica_put(orte_std_cntr_t cnt, orte_gpr_value_t **values)
|
||||
/* first check for error - all keyvals must have a non-NULL string key */
|
||||
for (j=0; j < val->cnt; j++) {
|
||||
if (NULL == (val->keyvals[j])->key) {
|
||||
rc = ORTE_ERR_BAD_PARAM;
|
||||
goto CLEANUP;
|
||||
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||
OPAL_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return ORTE_ERR_BAD_PARAM;
|
||||
}
|
||||
}
|
||||
|
||||
/* find the segment */
|
||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_find_seg(&seg, true, val->segment))) {
|
||||
goto CLEANUP;
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OPAL_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* convert tokens to array of itags */
|
||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_get_itag_list(&itags, seg,
|
||||
val->tokens, &(val->num_tokens)))) {
|
||||
goto CLEANUP;
|
||||
val->tokens, &(val->num_tokens)))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OPAL_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_put_fn(val->addr_mode, seg, itags, val->num_tokens,
|
||||
@ -82,16 +87,17 @@ int orte_gpr_replica_put(orte_std_cntr_t cnt, orte_gpr_value_t **values)
|
||||
}
|
||||
|
||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_check_events())) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto CLEANUP;
|
||||
}
|
||||
|
||||
if (NULL != itags) {
|
||||
free(itags);
|
||||
itags = NULL;
|
||||
}
|
||||
itags = NULL;
|
||||
}
|
||||
|
||||
CLEANUP: /* or not ... */
|
||||
CLEANUP:
|
||||
/* release list of itags */
|
||||
if (NULL != itags) {
|
||||
free(itags);
|
||||
@ -99,13 +105,12 @@ int orte_gpr_replica_put(orte_std_cntr_t cnt, orte_gpr_value_t **values)
|
||||
|
||||
if (ORTE_SUCCESS == rc) {
|
||||
rc = orte_gpr_replica_process_callbacks();
|
||||
} else {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
|
||||
OPAL_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
return rc;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -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-2007 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -28,26 +28,29 @@
|
||||
#include "orte_config.h"
|
||||
|
||||
#include "opal/util/trace.h"
|
||||
|
||||
#include "orte/class/orte_bitmap.h"
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
|
||||
#include "orte/mca/gpr/replica/functional_layer/gpr_replica_fn.h"
|
||||
|
||||
/*
|
||||
*/
|
||||
bool orte_gpr_replica_check_itag_list( orte_gpr_replica_addr_mode_t addr_mode,
|
||||
orte_std_cntr_t num_itags_search,
|
||||
orte_gpr_replica_itag_t *itags,
|
||||
orte_std_cntr_t num_itags_entry,
|
||||
orte_gpr_replica_itag_t *entry_itags )
|
||||
bool orte_gpr_replica_check_itag_list(orte_gpr_replica_addr_mode_t addr_mode,
|
||||
orte_std_cntr_t num_itags_search,
|
||||
orte_gpr_replica_itag_t *itags,
|
||||
orte_std_cntr_t num_itags_entry,
|
||||
orte_gpr_replica_itag_t *entry_itags)
|
||||
{
|
||||
orte_std_cntr_t i, j;
|
||||
bool exclusive, match, not_set;
|
||||
int found_some;
|
||||
bool exclusive, match, found_one, not_set;
|
||||
int rc, bit_is_set;
|
||||
|
||||
OPAL_TRACE(3);
|
||||
|
||||
/* check for trivial case */
|
||||
if (NULL == itags || 0 == num_itags_search) { /* wildcard case - automatically true */
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ORTE_GPR_REPLICA_NOT & addr_mode) { /* NOT flag set */
|
||||
@ -62,26 +65,44 @@ bool orte_gpr_replica_check_itag_list( orte_gpr_replica_addr_mode_t addr_mode,
|
||||
exclusive = false;
|
||||
}
|
||||
|
||||
if (ORTE_SUCCESS != (rc = orte_bitmap_clear_all_bits(&(orte_gpr_replica_globals.srch_itag)))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* run the search - check the container's tags to see which search tags are found */
|
||||
found_some = 0;
|
||||
found_one = false;
|
||||
for (i=0; i < num_itags_entry; i++) { /* for each container tag */
|
||||
match = false;
|
||||
for (j=0; j < num_itags_search; j++) { /* check each search tag and see if it is present */
|
||||
if (entry_itags[i] == itags[j]) { /* found a match */
|
||||
if (ORTE_GPR_REPLICA_OR & addr_mode) { /* only need one match */
|
||||
return (!not_set);
|
||||
/* need to explicitly extend the bit array here to ensure
|
||||
* it covers the specified itags. Otherwise, when
|
||||
* we check to see if the bit was set (in the logic down
|
||||
* below), we could potentially go outside the range of
|
||||
* the array
|
||||
*/
|
||||
if (ORTE_SUCCESS != (rc = orte_bitmap_resize(&(orte_gpr_replica_globals.srch_itag), itags[j]))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return false;
|
||||
}
|
||||
if (entry_itags[i] == itags[j]) { /* found a match */
|
||||
if (ORTE_SUCCESS != (rc = orte_bitmap_set_bit(&(orte_gpr_replica_globals.srch_itag), itags[j]))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return false;
|
||||
}
|
||||
if (ORTE_GPR_REPLICA_OR & addr_mode) { /* only need one match */
|
||||
return (!not_set);
|
||||
}
|
||||
match = true;
|
||||
found_some++;
|
||||
break; /* we're done for this i */
|
||||
found_one = true;
|
||||
}
|
||||
}
|
||||
if (!match && exclusive) {
|
||||
/* if it was exclusive, then I'm not allowed to have any tags outside
|
||||
* of those in the search list. Since I checked the search list and
|
||||
* found at least one that didn't match, this violates the exclusive requirement.
|
||||
*/
|
||||
return (not_set);
|
||||
/* if it was exclusive, then I'm not allowed to have any tags outside
|
||||
* of those in the search list. Since I checked the search list and
|
||||
* found at least one that didn't match, this violates the exclusive requirement.
|
||||
*/
|
||||
return (not_set);
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,17 +110,21 @@ bool orte_gpr_replica_check_itag_list( orte_gpr_replica_addr_mode_t addr_mode,
|
||||
* that we would have already returned in the OR case. So, first check the XOR
|
||||
* case
|
||||
*/
|
||||
if ((ORTE_GPR_REPLICA_XOR & addr_mode) && (0 < found_some) ) {
|
||||
if ((ORTE_GPR_REPLICA_XOR & addr_mode) && found_one) {
|
||||
return (!not_set);
|
||||
}
|
||||
|
||||
/* Only thing we have left to check is AND */
|
||||
/* check if any search tag was not found */
|
||||
for (i=0; i < num_itags_search; i++) {
|
||||
if (0 > (bit_is_set = orte_bitmap_is_set_bit(&(orte_gpr_replica_globals.srch_itag), itags[i]))) {
|
||||
ORTE_ERROR_LOG(bit_is_set);
|
||||
return false;
|
||||
} else if (1 != bit_is_set) {
|
||||
/* this tag was NOT found - required to find them all */
|
||||
return (not_set);
|
||||
}
|
||||
}
|
||||
|
||||
/* As we counted the number of matched itags we can simply compare this
|
||||
* number with the total number of itags for the AND operation.
|
||||
*/
|
||||
if( found_some != num_itags_search ) {
|
||||
return (not_set);
|
||||
}
|
||||
|
||||
/* okay, all the tags are there, so we now passed the AND test */
|
||||
return (!not_set);
|
||||
}
|
||||
|
@ -139,7 +139,6 @@ int orte_gpr_replica_put_fn(orte_gpr_addr_mode_t addr_mode,
|
||||
for (i=0; i < num_tokens; i++) {
|
||||
orte_gpr_replica_dict_reverse_lookup(&tmp, seg, token_itags[i]);
|
||||
opal_output(0, "\t%s", tmp);
|
||||
free(tmp); /* We all enjoy allocating and releasing memory all over the code isn't it ? */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -23,14 +23,20 @@
|
||||
#ifndef ORTE_GPR_REPLICA_H
|
||||
#define ORTE_GPR_REPLICA_H
|
||||
|
||||
|
||||
#include "orte_config.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "orte/class/orte_bitmap.h"
|
||||
#include "orte/class/orte_pointer_array.h"
|
||||
#include "orte/class/orte_value_array.h"
|
||||
|
||||
#include "opal/threads/mutex.h"
|
||||
#include "opal/threads/condition.h"
|
||||
|
||||
#include "orte/class/orte_pointer_array.h"
|
||||
#include "orte/class/orte_value_array.h"
|
||||
#include "orte/mca/ns/ns_types.h"
|
||||
|
||||
#include "orte/mca/gpr/base/base.h"
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
@ -119,6 +125,7 @@ typedef struct {
|
||||
orte_pointer_array_t *srch_ival;
|
||||
orte_std_cntr_t num_acted_upon;
|
||||
orte_pointer_array_t *acted_upon;
|
||||
orte_bitmap_t srch_itag;
|
||||
} orte_gpr_replica_globals_t;
|
||||
|
||||
|
||||
@ -423,6 +430,21 @@ typedef struct orte_gpr_replica_write_invalidate_t orte_gpr_replica_write_invali
|
||||
extern orte_gpr_replica_t orte_gpr_replica;
|
||||
extern orte_gpr_replica_globals_t orte_gpr_replica_globals;
|
||||
|
||||
|
||||
/*
|
||||
* Module open / close
|
||||
*/
|
||||
int orte_gpr_replica_open(void);
|
||||
int orte_gpr_replica_close(void);
|
||||
|
||||
|
||||
/*
|
||||
* Startup / Shutdown
|
||||
*/
|
||||
orte_gpr_base_module_t *orte_gpr_replica_init(bool *allow_multi_user_threads, bool *have_hidden_threads, int *priority);
|
||||
int orte_gpr_replica_finalize(void);
|
||||
int orte_gpr_replica_module_init(void);
|
||||
|
||||
int orte_gpr_replica_ft_event(int state);
|
||||
|
||||
ORTE_MODULE_DECLSPEC extern mca_gpr_base_component_t mca_gpr_replica_component;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -25,6 +25,9 @@
|
||||
|
||||
#include "orte_config.h"
|
||||
|
||||
#include "orte/class/orte_bitmap.h"
|
||||
#include "opal/class/opal_object.h"
|
||||
|
||||
#include "gpr_replica.h"
|
||||
|
||||
/*
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -27,27 +27,20 @@
|
||||
*/
|
||||
#include "orte_config.h"
|
||||
|
||||
#include "orte/class/orte_bitmap.h"
|
||||
#include "opal/class/opal_object.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/util/trace.h"
|
||||
|
||||
#include "orte/util/proc_info.h"
|
||||
|
||||
#include "orte/mca/rml/rml.h"
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
|
||||
#include "orte/mca/gpr/replica/gpr_replica.h"
|
||||
#include "orte/mca/gpr/replica/api_layer/gpr_replica_api.h"
|
||||
#include "orte/mca/gpr/replica/communications/gpr_replica_comm.h"
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
|
||||
/*
|
||||
* Static functions.
|
||||
*/
|
||||
static orte_gpr_base_module_t*
|
||||
orte_gpr_replica_init(bool *allow_multi_user_threads, bool *have_hidden_threads,
|
||||
int *priority);
|
||||
static int orte_gpr_replica_finalize(void);
|
||||
static int orte_gpr_replica_open(void);
|
||||
static int orte_gpr_replica_close(void);
|
||||
static int orte_gpr_replica_module_init(void);
|
||||
|
||||
/*
|
||||
* Struct of function pointers that need to be initialized
|
||||
@ -148,7 +141,7 @@ orte_gpr_replica_globals_t orte_gpr_replica_globals;
|
||||
/* instantiate the classes */
|
||||
#include "orte/mca/gpr/replica/gpr_replica_class_instances.h"
|
||||
|
||||
static int orte_gpr_replica_open(void)
|
||||
int orte_gpr_replica_open(void)
|
||||
{
|
||||
int id, tmp;
|
||||
|
||||
@ -176,16 +169,14 @@ static int orte_gpr_replica_open(void)
|
||||
/*
|
||||
* close function
|
||||
*/
|
||||
static int orte_gpr_replica_close(void)
|
||||
int orte_gpr_replica_close(void)
|
||||
{
|
||||
OPAL_TRACE(5);
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static orte_gpr_base_module_t*
|
||||
orte_gpr_replica_init(bool *allow_multi_user_threads, bool *have_hidden_threads,
|
||||
int *priority)
|
||||
orte_gpr_base_module_t *orte_gpr_replica_init(bool *allow_multi_user_threads, bool *have_hidden_threads, int *priority)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -299,6 +290,8 @@ orte_gpr_replica_init(bool *allow_multi_user_threads, bool *have_hidden_threads,
|
||||
}
|
||||
orte_gpr_replica_globals.num_acted_upon = 0;
|
||||
|
||||
OBJ_CONSTRUCT(&(orte_gpr_replica_globals.srch_itag), orte_bitmap_t);
|
||||
|
||||
if (orte_gpr_replica_globals.debug) {
|
||||
opal_output(0, "nb receive setup");
|
||||
}
|
||||
@ -307,11 +300,13 @@ orte_gpr_replica_init(bool *allow_multi_user_threads, bool *have_hidden_threads,
|
||||
|
||||
initialized = true;
|
||||
return &orte_gpr_replica_module;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int orte_gpr_replica_module_init(void)
|
||||
|
||||
int orte_gpr_replica_module_init(void)
|
||||
{
|
||||
OPAL_TRACE(5);
|
||||
|
||||
@ -331,7 +326,7 @@ static int orte_gpr_replica_module_init(void)
|
||||
/*
|
||||
* finalize routine
|
||||
*/
|
||||
static int orte_gpr_replica_finalize(void)
|
||||
int orte_gpr_replica_finalize(void)
|
||||
{
|
||||
orte_std_cntr_t i;
|
||||
orte_gpr_subscription_id_t j;
|
||||
@ -437,6 +432,8 @@ static int orte_gpr_replica_finalize(void)
|
||||
OBJ_RELEASE(orte_gpr_replica_globals.acted_upon);
|
||||
}
|
||||
|
||||
OBJ_DESTRUCT(&(orte_gpr_replica_globals.srch_itag));
|
||||
|
||||
/* All done */
|
||||
if (orte_gpr_replica_globals.isolate) {
|
||||
return ORTE_SUCCESS;
|
||||
@ -446,4 +443,3 @@ static int orte_gpr_replica_finalize(void)
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,16 @@ orte_odls_base_module_t* orte_odls_default_component_init(int *priority);
|
||||
*/
|
||||
int orte_odls_default_finalize(void);
|
||||
|
||||
/*
|
||||
* Interface
|
||||
*/
|
||||
int orte_odls_default_subscribe_launch_data(orte_jobid_t job, orte_gpr_notify_cb_fn_t cbfunc);
|
||||
int orte_odls_default_get_add_procs_data(orte_gpr_notify_data_t **data, orte_job_map_t *map);
|
||||
int orte_odls_default_launch_local_procs(orte_gpr_notify_data_t *data, char **base_environ);
|
||||
int orte_odls_default_kill_local_procs(orte_jobid_t job, bool set_state);
|
||||
int orte_odls_default_signal_local_procs(const orte_process_name_t *proc,
|
||||
int32_t signal);
|
||||
|
||||
/**
|
||||
* ODLS Default globals
|
||||
*/
|
||||
|
@ -104,15 +104,7 @@ static int orte_pls_fork_preload_append_binary(orte_app_context_t* context,
|
||||
static int orte_pls_fork_preload_append_files(orte_app_context_t* context,
|
||||
orte_filem_base_request_t *filem_request);
|
||||
static bool is_preload_local_dup(char *local_ref, orte_filem_base_request_t *filem_request);
|
||||
/*
|
||||
* External Interface
|
||||
*/
|
||||
static int orte_odls_default_subscribe_launch_data(orte_jobid_t job, orte_gpr_notify_cb_fn_t cbfunc);
|
||||
static int orte_odls_default_get_add_procs_data(orte_gpr_notify_data_t **data, orte_job_map_t *map);
|
||||
static int orte_odls_default_launch_local_procs(orte_gpr_notify_data_t *data, char **base_environ);
|
||||
static int orte_odls_default_kill_local_procs(orte_jobid_t job, bool set_state);
|
||||
static int orte_odls_default_signal_local_procs(const orte_process_name_t *proc,
|
||||
int32_t signal);
|
||||
|
||||
|
||||
static void set_handler_default(int sig);
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user