From: Arnaud Giersch Date: Mon, 4 Nov 2013 16:41:59 +0000 (+0100) Subject: Merge commit '78f0dd861a9bb479f33b9494a2b4ed7b977288a4' into v3_10_x X-Git-Tag: v3_10_rc1~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7813467a3119733f0598cb9957970a201efce965?hp=78f0dd861a9bb479f33b9494a2b4ed7b977288a4 Merge commit '78f0dd861a9bb479f33b9494a2b4ed7b977288a4' into v3_10_x --- diff --git a/buildtools/Cmake/Flags.cmake b/buildtools/Cmake/Flags.cmake index 68cae01b69..4c1178d63d 100644 --- a/buildtools/Cmake/Flags.cmake +++ b/buildtools/Cmake/Flags.cmake @@ -11,12 +11,12 @@ else() endif() if(enable_compile_warnings) - set(warnCFLAGS "-fno-common -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wclobbered -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror -Wno-error=clobbered ") - if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5") - set(warnCFLAGS "${warnCFLAGS}-Wno-error=unused-but-set-variable ") - endif() - if(CMAKE_C_COMPILER_ID STREQUAL "Clang") - string(REPLACE "-Wclobbered " "" warnCFLAGS "${warnCFLAGS}") + set(warnCFLAGS "-fno-common -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror ") + if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + set(warnCFLAGS "${warnCFLAGS}-Wclobbered -Wno-error=clobbered ") + if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5") + set(warnCFLAGS "${warnCFLAGS}-Wno-error=unused-but-set-variable ") + endif() endif() set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall") # FIXME: Q&D hack diff --git a/examples/smpi/MM/Summa.c b/examples/smpi/MM/Summa.c index a53ac43490..b2fb9aaa8a 100644 --- a/examples/smpi/MM/Summa.c +++ b/examples/smpi/MM/Summa.c @@ -11,16 +11,15 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(MM_Summa, "Messages specific for this msg example"); -inline double Summa( - double *a, double *b, double *c, - size_t lda, size_t ldb, size_t ldc, - size_t m, size_t k_a, size_t k_b, size_t n, - size_t Block_size, size_t start, size_t end, - size_t row, size_t col, size_t size_row, size_t size_col, - double *a_local, double *b_local, - MPI_Datatype Block_a, MPI_Datatype Block_a_local, - MPI_Datatype Block_b, - MPI_Comm row_comm, MPI_Comm col_comm, int subs) +double Summa(double *a, double *b, double *c, + size_t lda, size_t ldb, size_t ldc, + size_t m, size_t k_a, size_t k_b, size_t n, + size_t Block_size, size_t start, size_t end, + size_t row, size_t col, size_t size_row, size_t size_col, + double *a_local, double *b_local, + MPI_Datatype Block_a, MPI_Datatype Block_a_local, + MPI_Datatype Block_b, + MPI_Comm row_comm, MPI_Comm col_comm, int subs) { double *B_a , *B_b ; //matrix blocks size_t err; diff --git a/src/include/surf/maxmin.h b/src/include/surf/maxmin.h index 0db88a3b9d..acd57fb07e 100644 --- a/src/include/surf/maxmin.h +++ b/src/include/surf/maxmin.h @@ -33,7 +33,6 @@ static XBT_INLINE int double_equals(double value1, double value2) XBT_PUBLIC(lmm_system_t) lmm_system_new(int selective_update); XBT_PUBLIC(void) lmm_system_free(lmm_system_t sys); -void lmm_variable_disable(lmm_system_t sys, lmm_variable_t var); XBT_PUBLIC(lmm_constraint_t) lmm_constraint_new(lmm_system_t sys, void *id, double bound_value); diff --git a/src/simgrid/sg_config.c b/src/simgrid/sg_config.c index 58f791d43a..0f88330755 100644 --- a/src/simgrid/sg_config.c +++ b/src/simgrid/sg_config.c @@ -611,12 +611,12 @@ void sg_config_init(int *argc, char **argv) "Context factory to use in SIMIX. Possible values: thread"); const char *dflt_ctx_fact = "thread"; #ifdef CONTEXT_UCONTEXT - strcat(description, ", ucontext"); dflt_ctx_fact = "ucontext"; + strcat(strcat(description, ", "), dflt_ctx_fact); #endif #ifdef HAVE_RAWCTX - strcat(description, ", raw"); dflt_ctx_fact = "raw"; + strcat(strcat(description, ", "), dflt_ctx_fact); #endif strcat(description, "."); xbt_cfg_register(&_sg_cfg_set, "contexts/factory", description, diff --git a/src/simix/smx_context.c b/src/simix/smx_context.c index e638bb7e76..707cf7708d 100644 --- a/src/simix/smx_context.c +++ b/src/simix/smx_context.c @@ -127,7 +127,7 @@ XBT_INLINE int SIMIX_context_get_nthreads(void) { * * \param nb_threads the number of threads to use */ -XBT_INLINE void SIMIX_context_set_nthreads(int nb_threads) { +void SIMIX_context_set_nthreads(int nb_threads) { if (nb_threads<=0) { nb_threads = xbt_os_get_numcores(); XBT_INFO("Auto-setting contexts/nthreads to %d",nb_threads); diff --git a/src/simix/smx_network.c b/src/simix/smx_network.c index 0cb33eb894..7f9689a1c1 100644 --- a/src/simix/smx_network.c +++ b/src/simix/smx_network.c @@ -26,6 +26,7 @@ static smx_action_t SIMIX_fifo_get_comm(xbt_fifo_t fifo, e_smx_comm_type_t type, int (*match_fun)(void *, void *,smx_action_t), void *user_data, smx_action_t my_action); static void SIMIX_rdv_free(void *data); +static void SIMIX_comm_start(smx_action_t action); void SIMIX_network_init(void) { @@ -835,7 +836,7 @@ void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall) * \brief Starts the simulation of a communication action. * \param action the communication action */ -XBT_INLINE void SIMIX_comm_start(smx_action_t action) +static XBT_INLINE void SIMIX_comm_start(smx_action_t action) { /* If both the sender and the receiver are already there, start the communication */ if (action->state == SIMIX_READY) { diff --git a/src/simix/smx_network_private.h b/src/simix/smx_network_private.h index 72bcffa824..fecdd3e77a 100644 --- a/src/simix/smx_network_private.h +++ b/src/simix/smx_network_private.h @@ -34,7 +34,6 @@ int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host); smx_action_t SIMIX_rdv_get_head(smx_rdv_t rdv); void SIMIX_rdv_set_receiver(smx_rdv_t rdv, smx_process_t proc); smx_process_t SIMIX_rdv_get_receiver(smx_rdv_t rdv); -void SIMIX_comm_start(smx_action_t action); smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv, double task_size, double rate, void *src_buff, size_t src_buff_size, diff --git a/src/smpi/colls/allgatherv-mpich-rdb.c b/src/smpi/colls/allgatherv-mpich-rdb.c index 83918079cb..8094db08cc 100644 --- a/src/smpi/colls/allgatherv-mpich-rdb.c +++ b/src/smpi/colls/allgatherv-mpich-rdb.c @@ -1,211 +1,208 @@ /* Short or medium size message and power-of-two no. of processes. Use - * recursive doubling algorithm */ + * recursive doubling algorithm */ #include "colls_private.h" -int smpi_coll_tuned_allgatherv_mpich_rdb ( - void *sendbuf, - int sendcount, - MPI_Datatype sendtype, - void *recvbuf, - int *recvcounts, - int *displs, - MPI_Datatype recvtype, - MPI_Comm comm) +int smpi_coll_tuned_allgatherv_mpich_rdb ( + void *sendbuf, + int sendcount, + MPI_Datatype sendtype, + void *recvbuf, + int *recvcounts, + int *displs, + MPI_Datatype recvtype, + MPI_Comm comm) { - int comm_size, rank, j, i; - MPI_Status status; - MPI_Aint recvtype_extent, recvtype_true_extent, recvtype_true_lb; - int curr_cnt, dst, total_count; - void *tmp_buf; - int mask, dst_tree_root, my_tree_root, is_homogeneous, position, - send_offset, recv_offset, last_recv_cnt=0, nprocs_completed, k, - offset, tmp_mask, tree_root; - - comm_size = smpi_comm_size(comm); - rank = smpi_comm_rank(comm); - - total_count = 0; - for (i=0; i> i; + dst_tree_root <<= i; + + my_tree_root = rank >> i; + my_tree_root <<= i; + + if (dst < comm_size) { + send_offset = 0; + for (j=0; j> i; - dst_tree_root <<= i; - - my_tree_root = rank >> i; - my_tree_root <<= i; - - if (dst < comm_size) { - send_offset = 0; - for (j=0; j comm_size) { - nprocs_completed = comm_size - my_tree_root - mask; - /* nprocs_completed is the number of processes in this - subtree that have all the data. Send data to others - in a tree fashion. First find root of current tree - that is being divided into two. k is the number of - least-significant bits in this process's rank that - must be zeroed out to find the rank of the root */ - j = mask; - k = 0; - while (j) { - j >>= 1; - k++; - } - k--; - - tmp_mask = mask >> 1; - - while (tmp_mask) { - dst = rank ^ tmp_mask; - - tree_root = rank >> k; - tree_root <<= k; - - /* send only if this proc has data and destination - doesn't have data. at any step, multiple processes - can send if they have the data */ - if ((dst > rank) && - (rank < tree_root + nprocs_completed) - && (dst >= tree_root + nprocs_completed)) { - - offset = 0; - for (j=0; j<(my_tree_root+mask); j++) - offset += recvcounts[j]; - offset *= recvtype_extent; - - smpi_mpi_send(((char *)tmp_buf + offset), - last_recv_cnt, - recvtype, dst, - COLL_TAG_ALLGATHERV, comm); - /* last_recv_cnt was set in the previous - receive. that's the amount of data to be - sent now. */ - } - /* recv only if this proc. doesn't have data and sender - has data */ - else if ((dst < rank) && - (dst < tree_root + nprocs_completed) && - (rank >= tree_root + nprocs_completed)) { - - offset = 0; - for (j=0; j<(my_tree_root+mask); j++) - offset += recvcounts[j]; - - smpi_mpi_recv(((char *)tmp_buf + offset * recvtype_extent), - total_count - offset, recvtype, - dst, COLL_TAG_ALLGATHERV, - comm, &status); - /* for convenience, recv is posted for a - bigger amount than will be sent */ - last_recv_cnt=smpi_mpi_get_count(&status, recvtype); - curr_cnt += last_recv_cnt; - } - tmp_mask >>= 1; - k--; - } - } - /* --END EXPERIMENTAL-- */ - - mask <<= 1; - i++; - } - - /* copy data from tmp_buf to recvbuf */ - position = 0; - for (j=0; j comm_size) { + nprocs_completed = comm_size - my_tree_root - mask; + /* nprocs_completed is the number of processes in this + subtree that have all the data. Send data to others + in a tree fashion. First find root of current tree + that is being divided into two. k is the number of + least-significant bits in this process's rank that + must be zeroed out to find the rank of the root */ + j = mask; + k = 0; + while (j) { + j >>= 1; + k++; + } + k--; + + tmp_mask = mask >> 1; + + while (tmp_mask) { + dst = rank ^ tmp_mask; + + tree_root = rank >> k; + tree_root <<= k; + + /* send only if this proc has data and destination + doesn't have data. at any step, multiple processes + can send if they have the data */ + if ((dst > rank) && + (rank < tree_root + nprocs_completed) + && (dst >= tree_root + nprocs_completed)) { + + offset = 0; + for (j=0; j<(my_tree_root+mask); j++) + offset += recvcounts[j]; + offset *= recvtype_extent; + + smpi_mpi_send(((char *)tmp_buf + offset), + last_recv_cnt, + recvtype, dst, + COLL_TAG_ALLGATHERV, comm); + /* last_recv_cnt was set in the previous + receive. that's the amount of data to be + sent now. */ } + /* recv only if this proc. doesn't have data and sender + has data */ + else if ((dst < rank) && + (dst < tree_root + nprocs_completed) && + (rank >= tree_root + nprocs_completed)) { + + offset = 0; + for (j=0; j<(my_tree_root+mask); j++) + offset += recvcounts[j]; + + smpi_mpi_recv(((char *)tmp_buf + offset * recvtype_extent), + total_count - offset, recvtype, + dst, COLL_TAG_ALLGATHERV, + comm, &status); + /* for convenience, recv is posted for a + bigger amount than will be sent */ + last_recv_cnt=smpi_mpi_get_count(&status, recvtype); + curr_cnt += last_recv_cnt; + } + tmp_mask >>= 1; + k--; + } + } + /* --END EXPERIMENTAL-- */ + + mask <<= 1; + i++; + } + + /* copy data from tmp_buf to recvbuf */ + position = 0; + for (j=0; j= comm_size) { + else /* (count >= comm_size) */ { tmp_buf = (void *) xbt_malloc(count * extent); //if ((rank != root)) diff --git a/src/surf/maxmin.c b/src/surf/maxmin.c index feef80bb82..420695c010 100644 --- a/src/surf/maxmin.c +++ b/src/surf/maxmin.c @@ -93,7 +93,7 @@ void lmm_system_free(lmm_system_t sys) free(sys); } -XBT_INLINE void lmm_variable_disable(lmm_system_t sys, lmm_variable_t var) +static XBT_INLINE void lmm_variable_disable(lmm_system_t sys, lmm_variable_t var) { int i; int n; diff --git a/src/xbt/dict.c b/src/xbt/dict.c index be839e30f5..3984e4315c 100644 --- a/src/xbt/dict.c +++ b/src/xbt/dict.c @@ -171,8 +171,9 @@ XBT_INLINE void xbt_dict_set_ext(xbt_dict_t dict, xbt_dictelm_t current, previous = NULL; xbt_assert(dict); - XBT_DEBUG("ADD %.*s hash = %u, size = %d, & = %u", key_len, key, hash_code, - dict->table_size, hash_code & dict->table_size); + XBT_CDEBUG(xbt_dict, + "ADD %.*s hash = %u, size = %d, & = %u", key_len, key, hash_code, + dict->table_size, hash_code & dict->table_size); current = dict->table[hash_code & dict->table_size]; while (current != NULL && (hash_code != current->hash_code || key_len != current->key_len @@ -194,9 +195,9 @@ XBT_INLINE void xbt_dict_set_ext(xbt_dict_t dict, previous->next = current; } } else { - XBT_DEBUG("Replace %.*s by %.*s under key %.*s", - key_len, (char *) current->content, - key_len, (char *) data, key_len, (char *) key); + XBT_CDEBUG(xbt_dict, "Replace %.*s by %.*s under key %.*s", + key_len, (char *) current->content, + key_len, (char *) data, key_len, (char *) key); /* there is already an element with the same key: overwrite it */ xbt_dictelm_set_data(dict, current, data, free_ctn); } diff --git a/src/xbt/dict_cursor.c b/src/xbt/dict_cursor.c index 790536ced7..c39e65def6 100644 --- a/src/xbt/dict_cursor.c +++ b/src/xbt/dict_cursor.c @@ -81,9 +81,9 @@ XBT_INLINE void xbt_dict_cursor_rewind(xbt_dict_cursor_t cursor) XBT_INLINE void xbt_dict_cursor_first(const xbt_dict_t dict, xbt_dict_cursor_t * cursor) { - XBT_DEBUG("xbt_dict_cursor_first"); + XBT_CDEBUG(xbt_dict_cursor, "xbt_dict_cursor_first"); if (!*cursor) { - XBT_DEBUG("Create the cursor on first use"); + XBT_CDEBUG(xbt_dict_cursor, "Create the cursor on first use"); *cursor = xbt_dict_cursor_new(dict); } else { xbt_dict_cursor_rewind(*cursor); @@ -102,7 +102,7 @@ XBT_INLINE void xbt_dict_cursor_step(xbt_dict_cursor_t cursor) xbt_dictelm_t current; int line; - XBT_DEBUG("xbt_dict_cursor_step"); + XBT_CDEBUG(xbt_dict_cursor, "xbt_dict_cursor_step"); xbt_assert(cursor); current = cursor->current; @@ -111,17 +111,17 @@ XBT_INLINE void xbt_dict_cursor_step(xbt_dict_cursor_t cursor) if (cursor->dict != NULL) { if (current != NULL) { - XBT_DEBUG("current is not null, take the next element"); + XBT_CDEBUG(xbt_dict_cursor, "current is not null, take the next element"); current = current->next; - XBT_DEBUG("next element: %p", current); + XBT_CDEBUG(xbt_dict_cursor, "next element: %p", current); } while (current == NULL && ++line <= cursor->dict->table_size) { - XBT_DEBUG("current is NULL, take the next line"); + XBT_CDEBUG(xbt_dict_cursor, "current is NULL, take the next line"); current = cursor->dict->table[line]; - XBT_DEBUG("element in the next line: %p", current); + XBT_CDEBUG(xbt_dict_cursor, "element in the next line: %p", current); } - XBT_DEBUG("search finished, current = %p, line = %d", current, line); + XBT_CDEBUG(xbt_dict_cursor, "search finished, current = %p, line = %d", current, line); cursor->current = current; cursor->line = line; @@ -139,7 +139,7 @@ XBT_INLINE int xbt_dict_cursor_get_or_free(xbt_dict_cursor_t * cursor, xbt_dictelm_t current; - XBT_DEBUG("xbt_dict_get_or_free"); + XBT_CDEBUG(xbt_dict_cursor, "xbt_dict_get_or_free"); if (!cursor || !(*cursor)) diff --git a/src/xbt/dynar.c b/src/xbt/dynar.c index 7517190b53..d9e20b9250 100644 --- a/src/xbt/dynar.c +++ b/src/xbt/dynar.c @@ -149,7 +149,7 @@ XBT_INLINE void xbt_dynar_reset(xbt_dynar_t const dynar) { _sanity_check_dynar(dynar); - XBT_DEBUG("Reset the dynar %p", (void *) dynar); + XBT_CDEBUG(xbt_dyn, "Reset the dynar %p", (void *) dynar); if (dynar->free_f) { xbt_dynar_map(dynar, dynar->free_f); } @@ -557,7 +557,7 @@ XBT_INLINE void xbt_dynar_push(xbt_dynar_t const dynar, XBT_INLINE void *xbt_dynar_pop_ptr(xbt_dynar_t const dynar) { _check_populated_dynar(dynar); - XBT_DEBUG("Pop %p", (void *) dynar); + XBT_CDEBUG(xbt_dyn, "Pop %p", (void *) dynar); dynar->used--; return _xbt_dynar_elm(dynar, dynar->used); } @@ -567,7 +567,7 @@ XBT_INLINE void xbt_dynar_pop(xbt_dynar_t const dynar, void *const dst) { /* sanity checks done by remove_at */ - XBT_DEBUG("Pop %p", (void *) dynar); + XBT_CDEBUG(xbt_dyn, "Pop %p", (void *) dynar); xbt_dynar_remove_at(dynar, dynar->used - 1, dst); } @@ -707,7 +707,7 @@ XBT_INLINE void * xbt_dynar_to_array (xbt_dynar_t dynar) /* * Return 0 if d1 and d2 are equal and 1 if not equal */ -XBT_INLINE int xbt_dynar_compare(xbt_dynar_t d1, xbt_dynar_t d2, +int xbt_dynar_compare(xbt_dynar_t d1, xbt_dynar_t d2, int(*compar)(const void *, const void *)) { int i ; diff --git a/src/xbt/fifo.c b/src/xbt/fifo.c index e28cc7e02b..adaa88dc11 100644 --- a/src/xbt/fifo.c +++ b/src/xbt/fifo.c @@ -429,7 +429,7 @@ XBT_INLINE xbt_fifo_item_t xbt_fifo_new_item(void) */ XBT_INLINE xbt_fifo_item_t xbt_fifo_newitem(void) { - XBT_WARN("This function is deprecated. Use xbt_fifo_new_item."); + XBT_CWARN(xbt_fifo, "This function is deprecated. Use xbt_fifo_new_item."); return xbt_fifo_new_item(); } @@ -469,7 +469,7 @@ XBT_INLINE void xbt_fifo_free_item(xbt_fifo_item_t b) */ XBT_INLINE void xbt_fifo_freeitem(xbt_fifo_item_t b) { - XBT_WARN("This function is deprecated. Use xbt_fifo_free_item."); + XBT_CWARN(xbt_fifo, "This function is deprecated. Use xbt_fifo_free_item."); xbt_fifo_free_item(b); return; } @@ -509,7 +509,7 @@ XBT_INLINE xbt_fifo_item_t xbt_fifo_get_last_item(xbt_fifo_t l) */ XBT_INLINE xbt_fifo_item_t xbt_fifo_getFirstItem(xbt_fifo_t l) { - XBT_WARN("This function is deprecated. Use xbt_fifo_get_first_item."); + XBT_CWARN(xbt_fifo, "This function is deprecated. Use xbt_fifo_get_first_item."); return xbt_fifo_get_first_item(l); } @@ -530,7 +530,7 @@ XBT_INLINE xbt_fifo_item_t xbt_fifo_get_next_item(xbt_fifo_item_t i) */ xbt_fifo_item_t xbt_fifo_getNextItem(xbt_fifo_item_t i) { - XBT_WARN("This function is deprecated. Use xbt_fifo_get_next_item."); + XBT_CWARN(xbt_fifo, "This function is deprecated. Use xbt_fifo_get_next_item."); return xbt_fifo_get_next_item(i); } diff --git a/teshsuite/smpi/mpich3-test/datatype/large-count.c b/teshsuite/smpi/mpich3-test/datatype/large-count.c index 31f6a2d419..c27a31da7f 100644 --- a/teshsuite/smpi/mpich3-test/datatype/large-count.c +++ b/teshsuite/smpi/mpich3-test/datatype/large-count.c @@ -13,6 +13,8 @@ #include #include +#define equals(a, b) ((long long)(a) == (long long)(b)) + /* assert-like macro that bumps the err count and emits a message */ #define check(x_) \ do { \ @@ -95,89 +97,89 @@ int main(int argc, char *argv[]) /* MPI_Type_size */ MPI_Type_size(imax_contig, &size); - check(size == INT_MAX); + check(equals(size, INT_MAX)); MPI_Type_size(four_ints, &size); - check(size == 4*sizeof(int)); + check(equals(size, 4*sizeof(int))); MPI_Type_size(imx4i, &size); - check(size == MPI_UNDEFINED); /* should overflow an int */ + check(equals(size, MPI_UNDEFINED)); /* should overflow an int */ MPI_Type_size(imx4i_rsz, &size); - check(size == MPI_UNDEFINED); /* should overflow an int */ + check(equals(size, MPI_UNDEFINED)); /* should overflow an int */ /* MPI_Type_size_x */ MPI_Type_size_x(imax_contig, &size_x); - check(size_x == INT_MAX); + check(equals(size_x, INT_MAX)); MPI_Type_size_x(four_ints, &size_x); - check(size_x == 4*sizeof(int)); + check(equals(size_x, 4*sizeof(int))); MPI_Type_size_x(imx4i, &size_x); - check(size_x == 4LL*sizeof(int)*(INT_MAX/2)); /* should overflow an int */ + check(equals(size_x, 4LL*sizeof(int)*(INT_MAX/2))); /* should overflow an int */ MPI_Type_size_x(imx4i_rsz, &size_x); - check(size_x == 4LL*sizeof(int)*(INT_MAX/2)); /* should overflow an int */ + check(equals(size_x, 4LL*sizeof(int)*(INT_MAX/2))); /* should overflow an int */ /* MPI_Type_get_extent */ MPI_Type_get_extent(imax_contig, &lb, &extent); - check(lb == 0); - check(extent == INT_MAX); + check(equals(lb, 0)); + check(equals(extent, INT_MAX)); MPI_Type_get_extent(four_ints, &lb, &extent); - check(lb == 0); - check(extent == 4*sizeof(int)); + check(equals(lb, 0)); + check(equals(extent, 4*sizeof(int))); MPI_Type_get_extent(imx4i, &lb, &extent); - check(lb == 0); + check(equals(lb, 0)); if (sizeof(MPI_Aint) == sizeof(int)) - check(extent == MPI_UNDEFINED); + check(equals(extent, MPI_UNDEFINED)); else - check(extent == imx4i_true_extent); + check(equals(extent, imx4i_true_extent)); MPI_Type_get_extent(imx4i_rsz, &lb, &extent); - check(lb == INT_MAX); - check(extent == -1024); + check(equals(lb, INT_MAX)); + check(equals(extent, -1024)); /* MPI_Type_get_extent_x */ MPI_Type_get_extent_x(imax_contig, &lb_x, &extent_x); - check(lb_x == 0); - check(extent_x == INT_MAX); + check(equals(lb_x, 0)); + check(equals(extent_x, INT_MAX)); MPI_Type_get_extent_x(four_ints, &lb_x, &extent_x); - check(lb_x == 0); - check(extent_x == 4*sizeof(int)); + check(equals(lb_x, 0)); + check(equals(extent_x, 4*sizeof(int))); MPI_Type_get_extent_x(imx4i, &lb_x, &extent_x); - check(lb_x == 0); - check(extent_x == imx4i_true_extent); + check(equals(lb_x, 0)); + check(equals(extent_x, imx4i_true_extent)); MPI_Type_get_extent_x(imx4i_rsz, &lb_x, &extent_x); - check(lb_x == INT_MAX); - check(extent_x == -1024); + check(equals(lb_x, INT_MAX)); + check(equals(extent_x, -1024)); /* MPI_Type_get_true_extent */ MPI_Type_get_true_extent(imax_contig, &lb, &extent); - check(lb == 0); - check(extent == INT_MAX); + check(equals(lb, 0)); + check(equals(extent, INT_MAX)); MPI_Type_get_true_extent(four_ints, &lb, &extent); - check(lb == 0); - check(extent == 4*sizeof(int)); + check(equals(lb, 0)); + check(equals(extent, 4*sizeof(int))); MPI_Type_get_true_extent(imx4i, &lb, &extent); - check(lb == 0); + check(equals(lb, 0)); if (sizeof(MPI_Aint) == sizeof(int)) - check(extent == MPI_UNDEFINED); + check(equals(extent, MPI_UNDEFINED)); else - check(extent == imx4i_true_extent); + check(equals(extent, imx4i_true_extent)); MPI_Type_get_true_extent(imx4i_rsz, &lb, &extent); - check(lb == 0); + check(equals(lb, 0)); if (sizeof(MPI_Aint) == sizeof(int)) - check(extent == MPI_UNDEFINED); + check(equals(extent, MPI_UNDEFINED)); else - check(extent == imx4i_true_extent); + check(equals(extent, imx4i_true_extent)); /* MPI_Type_get_true_extent_x */ MPI_Type_get_true_extent_x(imax_contig, &lb_x, &extent_x); - check(lb_x == 0); - check(extent_x == INT_MAX); + check(equals(lb_x, 0)); + check(equals(extent_x, INT_MAX)); MPI_Type_get_true_extent_x(four_ints, &lb_x, &extent_x); - check(lb_x == 0); - check(extent_x == 4*sizeof(int)); + check(equals(lb_x, 0)); + check(equals(extent_x, 4*sizeof(int))); MPI_Type_get_true_extent_x(imx4i, &lb_x, &extent_x); - check(lb_x == 0); - check(extent_x == imx4i_true_extent); + check(equals(lb_x, 0)); + check(equals(extent_x, imx4i_true_extent)); MPI_Type_get_true_extent_x(imx4i_rsz, &lb_x, &extent_x); - check(lb_x == 0); - check(extent_x == imx4i_true_extent); + check(equals(lb_x, 0)); + check(equals(extent_x, imx4i_true_extent)); /* MPI_{Status_set_elements,Get_elements}{,_x} */ @@ -187,18 +189,18 @@ int main(int argc, char *argv[]) MPI_Get_elements(&status, MPI_INT, &elements); MPI_Get_elements_x(&status, MPI_INT, &elements_x); MPI_Get_count(&status, MPI_INT, &count); - check(elements == 10); - check(elements_x == 10); - check(count == 10); + check(equals(elements, 10)); + check(equals(elements_x, 10)); + check(equals(count, 10)); /* set_x simple */ MPI_Status_set_elements_x(&status, MPI_INT, 10); MPI_Get_elements(&status, MPI_INT, &elements); MPI_Get_elements_x(&status, MPI_INT, &elements_x); MPI_Get_count(&status, MPI_INT, &count); - check(elements == 10); - check(elements_x == 10); - check(count == 10); + check(equals(elements, 10)); + check(equals(elements_x, 10)); + check(equals(count, 10)); /* Sets elements corresponding to count=1 of the given MPI datatype, using * set_elements and set_elements_x. Checks expected values are returned by @@ -213,9 +215,9 @@ int main(int argc, char *argv[]) MPI_Get_elements(&status, (type_), &elements); \ MPI_Get_elements_x(&status, (type_), &elements_x); \ MPI_Get_count(&status, (type_), &count); \ - check(elements == (elts_)); \ - check(elements_x == (elts_)); \ - check(count == 1); \ + check(equals(elements, (elts_))); \ + check(equals(elements_x, (elts_))); \ + check(equals(count, 1)); \ } \ \ elements = elements_x = count = 0xfeedface; \ @@ -224,13 +226,13 @@ int main(int argc, char *argv[]) MPI_Get_elements_x(&status, (type_), &elements_x); \ MPI_Get_count(&status, (type_), &count); \ if ((elts_) > INT_MAX) { \ - check(elements == MPI_UNDEFINED); \ + check(equals(elements, MPI_UNDEFINED)); \ } \ else { \ - check(elements == (elts_)); \ + check(equals(elements, (elts_))); \ } \ - check(elements_x == (elts_)); \ - check(count == 1); \ + check(equals(elements_x, (elts_))); \ + check(equals(count, 1)); \ } while (0) \ check_set_elements(imax_contig, INT_MAX);