Fix a bunch of compiler warnings in the tests, including:
* Resolve set-but-not-used issues * Resolve incorrect const notation (I checked with George first to see what const notation he actually wanted) * Comment out unused code (didn't delete it because it's useful debugging code) * Resolve int<-->void* casting * Resolved signed / unsigned comparisons This commit was SVN r30225.
Этот коммит содержится в:
родитель
110c99af4f
Коммит
09f98cb165
@ -347,7 +347,7 @@ void test2(void)
|
|||||||
((ompi_test_rb_value_t *) new_value)->key.bottom = mem[i];
|
((ompi_test_rb_value_t *) new_value)->key.bottom = mem[i];
|
||||||
((ompi_test_rb_value_t *) new_value)->key.top =
|
((ompi_test_rb_value_t *) new_value)->key.top =
|
||||||
(void *) ((size_t) mem[i] + size - 1);
|
(void *) ((size_t) mem[i] + size - 1);
|
||||||
((ompi_test_rb_value_t *) new_value)->registered_mpools[0] = (void *) i;
|
((ompi_test_rb_value_t *) new_value)->registered_mpools[0] = (void *)(intptr_t) i;
|
||||||
rc = ompi_rb_tree_insert(&tree, &((ompi_test_rb_value_t *)new_value)->key,
|
rc = ompi_rb_tree_insert(&tree, &((ompi_test_rb_value_t *)new_value)->key,
|
||||||
new_value);
|
new_value);
|
||||||
if(OMPI_SUCCESS != rc)
|
if(OMPI_SUCCESS != rc)
|
||||||
@ -365,7 +365,7 @@ void test2(void)
|
|||||||
if(NULL == result)
|
if(NULL == result)
|
||||||
{
|
{
|
||||||
test_failure("lookup returned null!");
|
test_failure("lookup returned null!");
|
||||||
} else if(i != ((int) ((ompi_test_rb_value_t *) result)->registered_mpools[0]))
|
} else if(i != ((int)(intptr_t) ((ompi_test_rb_value_t *) result)->registered_mpools[0]))
|
||||||
{
|
{
|
||||||
test_failure("lookup returned wrong node!");
|
test_failure("lookup returned wrong node!");
|
||||||
}
|
}
|
||||||
@ -373,7 +373,7 @@ void test2(void)
|
|||||||
if(NULL == result)
|
if(NULL == result)
|
||||||
{
|
{
|
||||||
test_failure("lookup returned null!");
|
test_failure("lookup returned null!");
|
||||||
} else if(i != ((int) ((ompi_test_rb_value_t *) result)->registered_mpools[0]))
|
} else if(i != ((int)(intptr_t) ((ompi_test_rb_value_t *) result)->registered_mpools[0]))
|
||||||
{
|
{
|
||||||
test_failure("lookup returned wrong node!");
|
test_failure("lookup returned wrong node!");
|
||||||
}
|
}
|
||||||
|
@ -295,8 +295,10 @@ int find_and_set(opal_bitmap_t *bm, int bit)
|
|||||||
|
|
||||||
int clear_all(opal_bitmap_t *bm)
|
int clear_all(opal_bitmap_t *bm)
|
||||||
{
|
{
|
||||||
int i, err;
|
int i;
|
||||||
err = opal_bitmap_clear_all_bits(bm);
|
if (OPAL_SUCCESS != opal_bitmap_clear_all_bits(bm)) {
|
||||||
|
return ERR_CODE;
|
||||||
|
}
|
||||||
for (i = 0; i < bm->array_size; ++i)
|
for (i = 0; i < bm->array_size; ++i)
|
||||||
if (bm->bitmap[i] != 0) {
|
if (bm->bitmap[i] != 0) {
|
||||||
fprintf(error_out, "ERROR: clear_all for bitmap arry entry %d\n\n",
|
fprintf(error_out, "ERROR: clear_all for bitmap arry entry %d\n\n",
|
||||||
@ -309,8 +311,10 @@ int clear_all(opal_bitmap_t *bm)
|
|||||||
|
|
||||||
int set_all(opal_bitmap_t *bm)
|
int set_all(opal_bitmap_t *bm)
|
||||||
{
|
{
|
||||||
int i, err;
|
int i;
|
||||||
err = opal_bitmap_set_all_bits(bm);
|
if (OPAL_SUCCESS != opal_bitmap_set_all_bits(bm)) {
|
||||||
|
return ERR_CODE;
|
||||||
|
}
|
||||||
for (i = 0; i < bm->array_size; ++i)
|
for (i = 0; i < bm->array_size; ++i)
|
||||||
if (bm->bitmap[i] != 0xff) {
|
if (bm->bitmap[i] != 0xff) {
|
||||||
fprintf(error_out, "ERROR: set_all for bitmap arry entry %d\n\n", i);
|
fprintf(error_out, "ERROR: set_all for bitmap arry entry %d\n\n", i);
|
||||||
|
@ -76,10 +76,16 @@ static void validate_table(opal_hash_table_t *table, char *keys[], int is_numeri
|
|||||||
if ( 1 == is_numeric_keys ) {
|
if ( 1 == is_numeric_keys ) {
|
||||||
ret = opal_hash_table_get_value_uint32(table, atoi(keys[j]),
|
ret = opal_hash_table_get_value_uint32(table, atoi(keys[j]),
|
||||||
(void**) &value.uvalue);
|
(void**) &value.uvalue);
|
||||||
|
if (OPAL_SUCCESS != ret) {
|
||||||
|
test_failure("opal_hash_table_get_value_uint32 failed");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ret = opal_hash_table_get_value_ptr(table, keys[j],
|
ret = opal_hash_table_get_value_ptr(table, keys[j],
|
||||||
strlen(keys[j]),
|
strlen(keys[j]),
|
||||||
&value.vvalue);
|
&value.vvalue);
|
||||||
|
if (OPAL_SUCCESS != ret) {
|
||||||
|
test_failure("opal_hash_table_get_value_ptr failed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
test_verify_str(keys[j+1], value.vvalue);
|
test_verify_str(keys[j+1], value.vvalue);
|
||||||
}
|
}
|
||||||
|
@ -44,11 +44,11 @@ static void test(bool thread_usage){
|
|||||||
value_t *test_data;
|
value_t *test_data;
|
||||||
int len_test_data,i,test_len_in_array,error_cnt;
|
int len_test_data,i,test_len_in_array,error_cnt;
|
||||||
int ele_index;
|
int ele_index;
|
||||||
int use_threads,error_code;
|
int error_code;
|
||||||
value_t value;
|
value_t value;
|
||||||
|
|
||||||
/* initialize thread levels */
|
/* initialize thread levels */
|
||||||
use_threads=(int)opal_set_using_threads(thread_usage);
|
opal_set_using_threads(thread_usage);
|
||||||
|
|
||||||
array=OBJ_NEW(opal_pointer_array_t);
|
array=OBJ_NEW(opal_pointer_array_t);
|
||||||
assert(array);
|
assert(array);
|
||||||
|
@ -47,7 +47,7 @@ int main(int argc, char **argv)
|
|||||||
opal_tree_t tree, x;
|
opal_tree_t tree, x;
|
||||||
opal_buffer_t *serial_tree;
|
opal_buffer_t *serial_tree;
|
||||||
size_t i, j, tree_size, size_levels, size_elements, total_elements;
|
size_t i, j, tree_size, size_levels, size_elements, total_elements;
|
||||||
int err_order, err_ancestor, err_parent, rc;
|
int err_order, err_ancestor, rc;
|
||||||
unsigned key;
|
unsigned key;
|
||||||
test_data_t *elements;
|
test_data_t *elements;
|
||||||
opal_tree_item_t *item, *rm_item;
|
opal_tree_item_t *item, *rm_item;
|
||||||
@ -126,7 +126,6 @@ int main(int argc, char **argv)
|
|||||||
/* check that we have correct tree ordering */
|
/* check that we have correct tree ordering */
|
||||||
err_order = 0;
|
err_order = 0;
|
||||||
err_ancestor = 0;
|
err_ancestor = 0;
|
||||||
err_parent = 0;
|
|
||||||
if (!opal_tree_is_empty(&tree)) {
|
if (!opal_tree_is_empty(&tree)) {
|
||||||
item = opal_tree_get_root(&tree);
|
item = opal_tree_get_root(&tree);
|
||||||
i = 0;
|
i = 0;
|
||||||
@ -186,6 +185,9 @@ int main(int argc, char **argv)
|
|||||||
tree_size=opal_tree_get_size(&tree);
|
tree_size=opal_tree_get_size(&tree);
|
||||||
item = opal_tree_find_with(opal_tree_get_root(&tree), (void*)&key);
|
item = opal_tree_find_with(opal_tree_get_root(&tree), (void*)&key);
|
||||||
rm_item = opal_tree_remove_subtree(item);
|
rm_item = opal_tree_remove_subtree(item);
|
||||||
|
if (NULL == rm_item) {
|
||||||
|
test_failure(" rm_item should not be NULL");
|
||||||
|
}
|
||||||
/* validate the tree count adjusted */
|
/* validate the tree count adjusted */
|
||||||
if (5 != (tree_size - opal_tree_get_size(&tree))) {
|
if (5 != (tree_size - opal_tree_get_size(&tree))) {
|
||||||
test_failure(" failed subtree removal tree size test");
|
test_failure(" failed subtree removal tree size test");
|
||||||
|
@ -46,7 +46,7 @@ static int test_upper( unsigned int length )
|
|||||||
ompi_datatype_t *pdt;
|
ompi_datatype_t *pdt;
|
||||||
opal_convertor_t * pConv;
|
opal_convertor_t * pConv;
|
||||||
int rc = OMPI_SUCCESS;
|
int rc = OMPI_SUCCESS;
|
||||||
unsigned int i, iov_count, split_chunk, total_length;
|
unsigned int i, iov_count, total_length;
|
||||||
size_t max_data;
|
size_t max_data;
|
||||||
struct iovec iov[5];
|
struct iovec iov[5];
|
||||||
TIMER_DATA_TYPE start, end;
|
TIMER_DATA_TYPE start, end;
|
||||||
@ -65,8 +65,6 @@ static int test_upper( unsigned int length )
|
|||||||
}
|
}
|
||||||
|
|
||||||
GET_TIME( start );
|
GET_TIME( start );
|
||||||
split_chunk = (length + 1) * sizeof(double);
|
|
||||||
/* split_chunk = (total_length + 1) * sizeof(double); */
|
|
||||||
for( i = total_length; i > 0; ) {
|
for( i = total_length; i > 0; ) {
|
||||||
iov_count = 5;
|
iov_count = 5;
|
||||||
max_data = 0;
|
max_data = 0;
|
||||||
|
@ -118,7 +118,7 @@ static int test_upper( unsigned int length )
|
|||||||
* is not an easy task. Define a function to centralize the complexity in a
|
* is not an easy task. Define a function to centralize the complexity in a
|
||||||
* single location.
|
* single location.
|
||||||
*/
|
*/
|
||||||
size_t compute_buffer_length(ompi_datatype_t* pdt, int count)
|
static size_t compute_buffer_length(ompi_datatype_t* pdt, int count)
|
||||||
{
|
{
|
||||||
MPI_Aint extent, lb, true_extent, true_lb;
|
MPI_Aint extent, lb, true_extent, true_lb;
|
||||||
size_t length;
|
size_t length;
|
||||||
@ -151,7 +151,7 @@ static int local_copy_ddt_count( ompi_datatype_t* pdt, int count )
|
|||||||
pdst = malloc(length);
|
pdst = malloc(length);
|
||||||
psrc = malloc(length);
|
psrc = malloc(length);
|
||||||
|
|
||||||
for( int i = 0; i < length; i++ )
|
for( size_t i = 0; i < length; i++ )
|
||||||
((char*)psrc)[i] = i % 128 + 32;
|
((char*)psrc)[i] = i % 128 + 32;
|
||||||
memset(pdst, 0, length);
|
memset(pdst, 0, length);
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ local_copy_with_convertor_2datatypes( ompi_datatype_t* send_type, int send_count
|
|||||||
ptemp = malloc( chunk );
|
ptemp = malloc( chunk );
|
||||||
|
|
||||||
/* initialize the buffers to prevent valgrind from complaining */
|
/* initialize the buffers to prevent valgrind from complaining */
|
||||||
for( int i = 0; i < slength; i++ )
|
for( size_t i = 0; i < slength; i++ )
|
||||||
((char*)psrc)[i] = i % 128 + 32;
|
((char*)psrc)[i] = i % 128 + 32;
|
||||||
memset(pdst, 0, rlength);
|
memset(pdst, 0, rlength);
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ static int test_upper( unsigned int length )
|
|||||||
* - and one using 2 convertors created from different data-types.
|
* - and one using 2 convertors created from different data-types.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static int local_copy_ddt_count( const opal_datatype_t const* pdt, int count )
|
static int local_copy_ddt_count( opal_datatype_t const * const pdt, int count )
|
||||||
{
|
{
|
||||||
OPAL_PTRDIFF_TYPE extent;
|
OPAL_PTRDIFF_TYPE extent;
|
||||||
void *pdst, *psrc;
|
void *pdst, *psrc;
|
||||||
@ -160,8 +160,8 @@ static int local_copy_ddt_count( const opal_datatype_t const* pdt, int count )
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
local_copy_with_convertor_2datatypes( const opal_datatype_t const * send_type, int send_count,
|
local_copy_with_convertor_2datatypes( opal_datatype_t const * const send_type, int send_count,
|
||||||
const opal_datatype_t const * recv_type, int recv_count,
|
opal_datatype_t const * const recv_type, int recv_count,
|
||||||
int chunk )
|
int chunk )
|
||||||
{
|
{
|
||||||
OPAL_PTRDIFF_TYPE send_extent, recv_extent;
|
OPAL_PTRDIFF_TYPE send_extent, recv_extent;
|
||||||
@ -248,7 +248,7 @@ local_copy_with_convertor_2datatypes( const opal_datatype_t const * send_type, i
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int local_copy_with_convertor( const opal_datatype_t const* pdt, int count, int chunk )
|
static int local_copy_with_convertor( opal_datatype_t const * const pdt, int count, int chunk )
|
||||||
{
|
{
|
||||||
OPAL_PTRDIFF_TYPE extent;
|
OPAL_PTRDIFF_TYPE extent;
|
||||||
void *pdst = NULL, *psrc = NULL, *ptemp = NULL;
|
void *pdst = NULL, *psrc = NULL, *ptemp = NULL;
|
||||||
@ -430,7 +430,7 @@ int main( int argc, char* argv[] )
|
|||||||
printf( ">>--------------------------------------------<<\n" );
|
printf( ">>--------------------------------------------<<\n" );
|
||||||
printf( " Contiguous data-type (opal_datatype_float8)\n" );
|
printf( " Contiguous data-type (opal_datatype_float8)\n" );
|
||||||
if( outputFlags & CHECK_PACK_UNPACK ) {
|
if( outputFlags & CHECK_PACK_UNPACK ) {
|
||||||
const opal_datatype_t const* ddt = &opal_datatype_float8;
|
opal_datatype_t const * const ddt = &opal_datatype_float8;
|
||||||
local_copy_ddt_count( ddt, 4500);
|
local_copy_ddt_count( ddt, 4500);
|
||||||
local_copy_with_convertor( ddt, 4500, 12 );
|
local_copy_with_convertor( ddt, 4500, 12 );
|
||||||
local_copy_with_convertor_2datatypes( ddt, 4500, ddt, 4500, 12 );
|
local_copy_with_convertor_2datatypes( ddt, 4500, ddt, 4500, 12 );
|
||||||
|
@ -108,7 +108,7 @@ opal_datatype_t* test_create_blacs_type( void )
|
|||||||
return pdt;
|
return pdt;
|
||||||
}
|
}
|
||||||
|
|
||||||
opal_datatype_t* test_create_blacs_type1( const opal_datatype_t const* base_type )
|
opal_datatype_t* test_create_blacs_type1( opal_datatype_t const * const base_type )
|
||||||
{
|
{
|
||||||
opal_datatype_t *pdt;
|
opal_datatype_t *pdt;
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ opal_datatype_t* test_create_blacs_type1( const opal_datatype_t const* base_type
|
|||||||
return pdt;
|
return pdt;
|
||||||
}
|
}
|
||||||
|
|
||||||
opal_datatype_t* test_create_blacs_type2( const opal_datatype_t const* base_type )
|
opal_datatype_t* test_create_blacs_type2( opal_datatype_t const * const base_type )
|
||||||
{
|
{
|
||||||
opal_datatype_t *pdt;
|
opal_datatype_t *pdt;
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
extern uint32_t outputFlags;
|
extern uint32_t outputFlags;
|
||||||
|
|
||||||
extern void cache_trash( void );
|
extern void cache_trash( void );
|
||||||
extern opal_datatype_t* create_contiguous_type( const opal_datatype_t const* type, int length );
|
extern opal_datatype_t* create_contiguous_type( opal_datatype_t const * const type, int length );
|
||||||
extern opal_datatype_t* create_vector_type( const opal_datatype_t const* data, int count, int length, int stride );
|
extern opal_datatype_t* create_vector_type( opal_datatype_t const* const data, int count, int length, int stride );
|
||||||
extern opal_datatype_t* create_strange_dt( void );
|
extern opal_datatype_t* create_strange_dt( void );
|
||||||
extern opal_datatype_t* upper_matrix( unsigned int mat_size );
|
extern opal_datatype_t* upper_matrix( unsigned int mat_size );
|
||||||
extern opal_datatype_t* lower_matrix( unsigned int mat_size );
|
extern opal_datatype_t* lower_matrix( unsigned int mat_size );
|
||||||
@ -42,8 +42,8 @@ extern opal_datatype_t* test_struct_char_double( void );
|
|||||||
extern opal_datatype_t* test_create_twice_two_doubles( void );
|
extern opal_datatype_t* test_create_twice_two_doubles( void );
|
||||||
extern opal_datatype_t* test_struct( void );
|
extern opal_datatype_t* test_struct( void );
|
||||||
extern opal_datatype_t* test_create_blacs_type( void );
|
extern opal_datatype_t* test_create_blacs_type( void );
|
||||||
extern opal_datatype_t* test_create_blacs_type1( const opal_datatype_t const* base_type );
|
extern opal_datatype_t* test_create_blacs_type1( opal_datatype_t const * const base_type );
|
||||||
extern opal_datatype_t* test_create_blacs_type2( const opal_datatype_t const* base_type );
|
extern opal_datatype_t* test_create_blacs_type2( opal_datatype_t const * const base_type );
|
||||||
|
|
||||||
extern int mpich_typeub( void );
|
extern int mpich_typeub( void );
|
||||||
extern int mpich_typeub2( void );
|
extern int mpich_typeub2( void );
|
||||||
|
@ -181,6 +181,8 @@ typedef struct {
|
|||||||
int i;
|
int i;
|
||||||
} ddt_ldi_t;
|
} ddt_ldi_t;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* For debugging */
|
||||||
static void dump_ldi( ddt_ldi_t* buffer, int start_pos, int end_pos )
|
static void dump_ldi( ddt_ldi_t* buffer, int start_pos, int end_pos )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -190,6 +192,7 @@ static void dump_ldi( ddt_ldi_t* buffer, int start_pos, int end_pos )
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (OPAL_ENABLE_DEBUG == 1) && (OPAL_C_HAVE_VISIBILITY == 0)
|
#if (OPAL_ENABLE_DEBUG == 1) && (OPAL_C_HAVE_VISIBILITY == 0)
|
||||||
extern int opal_unpack_debug;
|
extern int opal_unpack_debug;
|
||||||
|
@ -158,7 +158,7 @@ static int isend_recv( int cycles,
|
|||||||
MPI_Datatype sdt, int scount, void* sbuf,
|
MPI_Datatype sdt, int scount, void* sbuf,
|
||||||
MPI_Datatype rdt, int rcount, void* rbuf )
|
MPI_Datatype rdt, int rcount, void* rbuf )
|
||||||
{
|
{
|
||||||
int sres, rres, myself, tag = 0, i, slength, rlength;
|
int myself, tag = 0, i, slength, rlength;
|
||||||
MPI_Status status;
|
MPI_Status status;
|
||||||
MPI_Request req;
|
MPI_Request req;
|
||||||
double tstart, tend;
|
double tstart, tend;
|
||||||
@ -173,13 +173,13 @@ static int isend_recv( int cycles,
|
|||||||
tstart = MPI_Wtime();
|
tstart = MPI_Wtime();
|
||||||
for( i = 0; i < cycles; i++ ) {
|
for( i = 0; i < cycles; i++ ) {
|
||||||
#ifndef FAST
|
#ifndef FAST
|
||||||
sres = MPI_Isend( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD, &req );
|
MPI_Isend( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD, &req );
|
||||||
rres = MPI_Recv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &status );
|
MPI_Recv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &status );
|
||||||
MPI_Wait( &req, &status );
|
MPI_Wait( &req, &status );
|
||||||
/*MPI_Request_free( &req );*/
|
/*MPI_Request_free( &req );*/
|
||||||
#else
|
#else
|
||||||
sres = ftmpi_mpi_isend( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD, &req );
|
ftmpi_mpi_isend( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD, &req );
|
||||||
rres = ftmpi_mpi_recv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &status );
|
ftmpi_mpi_recv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &status );
|
||||||
ftmpi_request_free( &req );
|
ftmpi_request_free( &req );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -192,7 +192,7 @@ static int irecv_send( int cycles,
|
|||||||
MPI_Datatype sdt, int scount, void* sbuf,
|
MPI_Datatype sdt, int scount, void* sbuf,
|
||||||
MPI_Datatype rdt, int rcount, void* rbuf )
|
MPI_Datatype rdt, int rcount, void* rbuf )
|
||||||
{
|
{
|
||||||
int sres, rres, myself, tag = 0, i, slength, rlength;
|
int myself, tag = 0, i, slength, rlength;
|
||||||
MPI_Request req;
|
MPI_Request req;
|
||||||
MPI_Status status;
|
MPI_Status status;
|
||||||
double tstart, tend;
|
double tstart, tend;
|
||||||
@ -207,13 +207,13 @@ static int irecv_send( int cycles,
|
|||||||
tstart = MPI_Wtime();
|
tstart = MPI_Wtime();
|
||||||
for( i = 0; i < cycles; i++ ) {
|
for( i = 0; i < cycles; i++ ) {
|
||||||
#ifndef FAST
|
#ifndef FAST
|
||||||
rres = MPI_Irecv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &req );
|
MPI_Irecv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &req );
|
||||||
sres = MPI_Send( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD );
|
MPI_Send( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD );
|
||||||
MPI_Wait( &req, &status );
|
MPI_Wait( &req, &status );
|
||||||
/*MPI_Request_free( &req );*/
|
/*MPI_Request_free( &req );*/
|
||||||
#else
|
#else
|
||||||
rres = ftmpi_mpi_irecv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &req );
|
ftmpi_mpi_irecv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &req );
|
||||||
sres = ftmpi_mpi_send( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD );
|
ftmpi_mpi_send( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD );
|
||||||
ftmpi_request_free( &req );
|
ftmpi_request_free( &req );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -226,7 +226,7 @@ static int isend_irecv_wait( int cycles,
|
|||||||
MPI_Datatype sdt, int scount, void* sbuf,
|
MPI_Datatype sdt, int scount, void* sbuf,
|
||||||
MPI_Datatype rdt, int rcount, void* rbuf )
|
MPI_Datatype rdt, int rcount, void* rbuf )
|
||||||
{
|
{
|
||||||
int sres, rres, myself, tag = 0, i, slength, rlength;
|
int myself, tag = 0, i, slength, rlength;
|
||||||
MPI_Request sreq, rreq;
|
MPI_Request sreq, rreq;
|
||||||
MPI_Status status;
|
MPI_Status status;
|
||||||
double tstart, tend;
|
double tstart, tend;
|
||||||
@ -241,15 +241,15 @@ static int isend_irecv_wait( int cycles,
|
|||||||
tstart = MPI_Wtime();
|
tstart = MPI_Wtime();
|
||||||
for( i = 0; i < cycles; i++ ) {
|
for( i = 0; i < cycles; i++ ) {
|
||||||
#ifndef FAST
|
#ifndef FAST
|
||||||
sres = MPI_Isend( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD, &sreq );
|
MPI_Isend( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD, &sreq );
|
||||||
rres = MPI_Irecv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &rreq );
|
MPI_Irecv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &rreq );
|
||||||
MPI_Wait( &sreq, &status );
|
MPI_Wait( &sreq, &status );
|
||||||
MPI_Wait( &rreq, &status );
|
MPI_Wait( &rreq, &status );
|
||||||
/*MPI_Request_free( &sreq );*/
|
/*MPI_Request_free( &sreq );*/
|
||||||
/*MPI_Request_free( &rreq );*/
|
/*MPI_Request_free( &rreq );*/
|
||||||
#else
|
#else
|
||||||
sres = ftmpi_mpi_isend( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD, &sreq );
|
ftmpi_mpi_isend( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD, &sreq );
|
||||||
rres = ftmpi_mpi_irecv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &rreq );
|
ftmpi_mpi_irecv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &rreq );
|
||||||
ftmpi_wait( &sreq, &status );
|
ftmpi_wait( &sreq, &status );
|
||||||
ftmpi_request_free( &sreq );
|
ftmpi_request_free( &sreq );
|
||||||
ftmpi_request_free( &rreq );
|
ftmpi_request_free( &rreq );
|
||||||
@ -264,7 +264,7 @@ static int irecv_isend_wait( int cycles,
|
|||||||
MPI_Datatype sdt, int scount, void* sbuf,
|
MPI_Datatype sdt, int scount, void* sbuf,
|
||||||
MPI_Datatype rdt, int rcount, void* rbuf )
|
MPI_Datatype rdt, int rcount, void* rbuf )
|
||||||
{
|
{
|
||||||
int sres, rres, myself, tag = 0, i, slength, rlength;
|
int myself, tag = 0, i, slength, rlength;
|
||||||
MPI_Request sreq, rreq;
|
MPI_Request sreq, rreq;
|
||||||
MPI_Status status;
|
MPI_Status status;
|
||||||
double tstart, tend;
|
double tstart, tend;
|
||||||
@ -279,15 +279,15 @@ static int irecv_isend_wait( int cycles,
|
|||||||
tstart = MPI_Wtime();
|
tstart = MPI_Wtime();
|
||||||
for( i = 0; i < cycles; i++ ) {
|
for( i = 0; i < cycles; i++ ) {
|
||||||
#ifndef FAST
|
#ifndef FAST
|
||||||
rres = MPI_Irecv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &rreq );
|
MPI_Irecv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &rreq );
|
||||||
sres = MPI_Isend( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD, &sreq );
|
MPI_Isend( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD, &sreq );
|
||||||
MPI_Wait( &sreq, &status );
|
MPI_Wait( &sreq, &status );
|
||||||
MPI_Wait( &rreq, &status );
|
MPI_Wait( &rreq, &status );
|
||||||
/*MPI_Request_free( &sreq );*/
|
/*MPI_Request_free( &sreq );*/
|
||||||
/*MPI_Request_free( &rreq );*/
|
/*MPI_Request_free( &rreq );*/
|
||||||
#else
|
#else
|
||||||
rres = ftmpi_mpi_irecv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &rreq );
|
ftmpi_mpi_irecv( rbuf, rcount, rdt, myself, tag, MPI_COMM_WORLD, &rreq );
|
||||||
sres = ftmpi_mpi_isend( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD, &sreq );
|
ftmpi_mpi_isend( sbuf, scount, sdt, myself, tag, MPI_COMM_WORLD, &sreq );
|
||||||
ftmpi_wait( &sreq, &status );
|
ftmpi_wait( &sreq, &status );
|
||||||
ftmpi_request_free( &sreq );
|
ftmpi_request_free( &sreq );
|
||||||
ftmpi_request_free( &rreq );
|
ftmpi_request_free( &rreq );
|
||||||
@ -335,17 +335,16 @@ static int do_test_for_ddt( MPI_Datatype sddt, MPI_Datatype rddt, int length )
|
|||||||
|
|
||||||
int main( int argc, char* argv[] )
|
int main( int argc, char* argv[] )
|
||||||
{
|
{
|
||||||
int rc;
|
|
||||||
int length = 1024 * 1024;
|
int length = 1024 * 1024;
|
||||||
int rank, size;
|
int rank, size;
|
||||||
MPI_Datatype ddt;
|
MPI_Datatype ddt;
|
||||||
int run_tests = DO_CONTIG | DO_CONSTANT_GAP | DO_INDEXED_GAP | DO_OPTIMIZED_INDEXED_GAP;
|
int run_tests = DO_CONTIG | DO_CONSTANT_GAP | DO_INDEXED_GAP | DO_OPTIMIZED_INDEXED_GAP;
|
||||||
/*int run_tests = DO_CONSTANT_GAP;*/
|
/*int run_tests = DO_CONSTANT_GAP;*/
|
||||||
|
|
||||||
rc = MPI_Init (&argc, &argv);
|
MPI_Init (&argc, &argv);
|
||||||
|
|
||||||
rc = MPI_Comm_rank (MPI_COMM_WORLD, &rank);
|
MPI_Comm_rank (MPI_COMM_WORLD, &rank);
|
||||||
rc = MPI_Comm_size (MPI_COMM_WORLD, &size);
|
MPI_Comm_size (MPI_COMM_WORLD, &size);
|
||||||
|
|
||||||
if( rank != 0 ) {
|
if( rank != 0 ) {
|
||||||
MPI_Finalize();
|
MPI_Finalize();
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user