Allow the convertor to select between pack/unpack with or without
checksum. Specify CONVERTOR_WITH_CHECKSUM when the convertor is created and all the pack/unpack functions attached to this convertor will be checksum aware. This commit was SVN r9325.
Этот коммит содержится в:
родитель
6babf2f874
Коммит
0fe57bb44c
@ -28,8 +28,12 @@ headers = \
|
||||
convertor.h
|
||||
|
||||
noinst_LTLIBRARIES = \
|
||||
libdatatype.la \
|
||||
libdatatype_reliable.la
|
||||
libdatatype_reliable.la \
|
||||
libdatatype.la
|
||||
|
||||
# these sources will be compiled with the special -D
|
||||
libdatatype_reliable_la_SOURCES = datatype_pack.c datatype_unpack.c
|
||||
libdatatype_reliable_la_CFLAGS = -DCHECKSUM $(AM_CFLAGS)
|
||||
|
||||
# these sources will be compiled with the normal CFLAGS only
|
||||
libdatatype_la_SOURCES = \
|
||||
@ -54,9 +58,7 @@ libdatatype_la_SOURCES = \
|
||||
convertor.c position.c \
|
||||
datatype_memcpy.c copy_functions.c get_count.c
|
||||
|
||||
# these sources will be compiled with the special -D
|
||||
libdatatype_reliable_la_SOURCES = datatype_pack.c datatype_unpack.c
|
||||
libdatatype_reliable_la_CFLAGS = -DCHECKSUM $(AM_CFLAGS)
|
||||
libdatatype_la_LIBADD = libdatatype_reliable.la
|
||||
|
||||
# Conditionally install the header files
|
||||
if WANT_INSTALL_HEADERS
|
||||
|
@ -368,14 +368,21 @@ ompi_convertor_prepare_for_recv( ompi_convertor_t* convertor,
|
||||
|
||||
convertor->flags |= CONVERTOR_RECV;
|
||||
convertor->memAlloc_fn = NULL;
|
||||
convertor->fAdvance = ompi_unpack_general; /* TODO: just stop complaining */
|
||||
convertor->fAdvance = ompi_unpack_homogeneous; /* default behaviour */
|
||||
convertor->fAdvance = ompi_generic_simple_unpack;
|
||||
|
||||
/* TODO: work only on homogeneous architectures */
|
||||
if( convertor->pDesc->flags & DT_FLAG_CONTIGUOUS ) {
|
||||
assert( convertor->flags & DT_FLAG_CONTIGUOUS );
|
||||
convertor->fAdvance = ompi_unpack_homogeneous_contig;
|
||||
if( convertor->flags & CONVERTOR_WITH_CHECKSUM ) {
|
||||
if( convertor->pDesc->flags & DT_FLAG_CONTIGUOUS ) {
|
||||
assert( convertor->flags & DT_FLAG_CONTIGUOUS );
|
||||
convertor->fAdvance = ompi_unpack_homogeneous_contig_checksum;
|
||||
} else {
|
||||
convertor->fAdvance = ompi_generic_simple_unpack_checksum;
|
||||
}
|
||||
} else {
|
||||
if( convertor->pDesc->flags & DT_FLAG_CONTIGUOUS ) {
|
||||
assert( convertor->flags & DT_FLAG_CONTIGUOUS );
|
||||
convertor->fAdvance = ompi_unpack_homogeneous_contig;
|
||||
} else {
|
||||
convertor->fAdvance = ompi_generic_simple_unpack;
|
||||
}
|
||||
}
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
@ -393,22 +400,31 @@ ompi_convertor_prepare_for_send( ompi_convertor_t* convertor,
|
||||
|
||||
convertor->flags |= CONVERTOR_SEND;
|
||||
convertor->memAlloc_fn = NULL;
|
||||
/* Just to avoid complaint from the compiler */
|
||||
convertor->fAdvance = ompi_pack_general;
|
||||
convertor->fAdvance = ompi_pack_homogeneous_with_memcpy;
|
||||
convertor->fAdvance = ompi_pack_no_conversion;
|
||||
convertor->fAdvance = ompi_generic_simple_pack;
|
||||
|
||||
if( datatype->flags & DT_FLAG_CONTIGUOUS ) {
|
||||
assert( convertor->flags & DT_FLAG_CONTIGUOUS );
|
||||
if( ((datatype->ub - datatype->lb) == (long)datatype->size) )
|
||||
convertor->fAdvance = ompi_pack_no_conv_contig;
|
||||
else if( 1 >= convertor->count ) /* gaps or no gaps */
|
||||
convertor->fAdvance = ompi_pack_no_conv_contig;
|
||||
else
|
||||
convertor->fAdvance = ompi_pack_no_conv_contig_with_gaps;
|
||||
if( convertor->flags & CONVERTOR_WITH_CHECKSUM ) {
|
||||
if( datatype->flags & DT_FLAG_CONTIGUOUS ) {
|
||||
assert( convertor->flags & DT_FLAG_CONTIGUOUS );
|
||||
if( ((datatype->ub - datatype->lb) == (long)datatype->size) )
|
||||
convertor->fAdvance = ompi_pack_no_conv_contig_checksum;
|
||||
else if( 1 >= convertor->count ) /* gaps or no gaps */
|
||||
convertor->fAdvance = ompi_pack_no_conv_contig_checksum;
|
||||
else
|
||||
convertor->fAdvance = ompi_pack_no_conv_contig_with_gaps_checksum;
|
||||
} else {
|
||||
convertor->fAdvance = ompi_generic_simple_pack_checksum;
|
||||
}
|
||||
} else {
|
||||
if( datatype->flags & DT_FLAG_CONTIGUOUS ) {
|
||||
assert( convertor->flags & DT_FLAG_CONTIGUOUS );
|
||||
if( ((datatype->ub - datatype->lb) == (long)datatype->size) )
|
||||
convertor->fAdvance = ompi_pack_no_conv_contig;
|
||||
else if( 1 >= convertor->count ) /* gaps or no gaps */
|
||||
convertor->fAdvance = ompi_pack_no_conv_contig;
|
||||
else
|
||||
convertor->fAdvance = ompi_pack_no_conv_contig_with_gaps;
|
||||
} else {
|
||||
convertor->fAdvance = ompi_generic_simple_pack;
|
||||
}
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "ompi/datatype/datatype_internal.h"
|
||||
|
||||
#if OMPI_ENABLE_DEBUG
|
||||
int ompi_pack_debug = 0;
|
||||
extern int ompi_pack_debug;
|
||||
#define DO_DEBUG(INST) if( ompi_pack_debug ) { INST }
|
||||
#else
|
||||
#define DO_DEBUG(INST)
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "ompi/datatype/datatype_internal.h"
|
||||
|
||||
#if OMPI_ENABLE_DEBUG
|
||||
int ompi_unpack_debug = 0;
|
||||
extern int ompi_unpack_debug;
|
||||
#define DO_DEBUG(INST) if( ompi_unpack_debug ) { INST }
|
||||
#else
|
||||
#define DO_DEBUG(INST)
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#if OMPI_ENABLE_DEBUG
|
||||
int ompi_copy_debug = 0;
|
||||
extern int ompi_copy_debug;
|
||||
#define DO_DEBUG(INST) if( ompi_copy_debug ) { INST }
|
||||
#else
|
||||
#define DO_DEBUG(INST)
|
||||
|
@ -23,10 +23,10 @@
|
||||
|
||||
#if OMPI_ENABLE_DEBUG
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
extern int ompi_unpack_debug;
|
||||
extern int ompi_pack_debug;
|
||||
extern int ompi_copy_debug;
|
||||
extern int ompi_position_debug;
|
||||
int ompi_unpack_debug = 0;
|
||||
int ompi_pack_debug = 0;
|
||||
int ompi_copy_debug = 0;
|
||||
int ompi_position_debug = 0;
|
||||
#endif /* OMPI_ENABLE_DEBUG */
|
||||
|
||||
extern size_t ompi_datatype_memcpy_block_size;
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#if OMPI_ENABLE_DEBUG
|
||||
int32_t ompi_position_debug = 0;
|
||||
extern int ompi_position_debug;
|
||||
#define DO_DEBUG(INST) if( ompi_position_debug ) { INST }
|
||||
#else
|
||||
#define DO_DEBUG(INST)
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user