From: Arnaud Giersch Date: Fri, 9 May 2014 12:09:41 +0000 (+0200) Subject: Fix dead assignments. X-Git-Tag: v3_11~83^2~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/cc63d7b267be4c20633a0be7db63b3d88030bee6 Fix dead assignments. That's when a value stored in a variable is never used. --- diff --git a/examples/smpi/mc/bugged1.c b/examples/smpi/mc/bugged1.c index b319f0f460..92ddaea16e 100644 --- a/examples/smpi/mc/bugged1.c +++ b/examples/smpi/mc/bugged1.c @@ -23,8 +23,8 @@ int main(int argc, char **argv) exit(1); } - err = MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get nr of tasks */ - err = MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */ + MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get nr of tasks */ + MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */ if (size < 2) { printf("run this program with exactly 2 processes (-np 2)\n"); MPI_Finalize(); diff --git a/examples/smpi/mc/bugged1_liveness.c b/examples/smpi/mc/bugged1_liveness.c index 7305370368..68a5ef4671 100644 --- a/examples/smpi/mc/bugged1_liveness.c +++ b/examples/smpi/mc/bugged1_liveness.c @@ -53,9 +53,9 @@ int main(int argc, char **argv){ MC_ignore(&(status.count), sizeof(status.count)); /* Get number of processes */ - err = MPI_Comm_size(MPI_COMM_WORLD, &size); + MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get id of this process */ - err = MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); if(rank == 0){ /* Coordinator */ while(1){ diff --git a/examples/smpi/mc/bugged2.c b/examples/smpi/mc/bugged2.c index 42de583df8..1af27bea2e 100644 --- a/examples/smpi/mc/bugged2.c +++ b/examples/smpi/mc/bugged2.c @@ -23,8 +23,8 @@ int main(int argc, char **argv) exit(1); } - err = MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get nr of tasks */ - err = MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */ + MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get nr of tasks */ + MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */ if (size % 3 != 0) { printf("run this program with exactly 3*N processes \n"); MPI_Finalize(); diff --git a/examples/smpi/mc/mutual_exclusion.c b/examples/smpi/mc/mutual_exclusion.c index 8c7ab75f58..7ed894bb60 100644 --- a/examples/smpi/mc/mutual_exclusion.c +++ b/examples/smpi/mc/mutual_exclusion.c @@ -30,9 +30,9 @@ int main(int argc, char **argv){ MC_ignore(&(status.count), sizeof(status.count)); /* Get number of processes */ - err = MPI_Comm_size(MPI_COMM_WORLD, &size); + MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get id of this process */ - err = MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); if(rank == 0){ /* Coordinator */ while(1){ diff --git a/examples/smpi/mc/non_deterministic.c b/examples/smpi/mc/non_deterministic.c index b5fbcc000c..4a0c7dc7c3 100644 --- a/examples/smpi/mc/non_deterministic.c +++ b/examples/smpi/mc/non_deterministic.c @@ -23,8 +23,8 @@ int main(int argc, char **argv) exit(1); } - err = MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get nr of tasks */ - err = MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */ + MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get nr of tasks */ + MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */ if (size < 2) { printf("run this program with at least 2 processes \n"); MPI_Finalize(); diff --git a/examples/smpi/mc/send_deterministic.c b/examples/smpi/mc/send_deterministic.c index fe421068d4..048d75c508 100644 --- a/examples/smpi/mc/send_deterministic.c +++ b/examples/smpi/mc/send_deterministic.c @@ -23,8 +23,8 @@ int main(int argc, char **argv) exit(1); } - err = MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get nr of tasks */ - err = MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */ + MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get nr of tasks */ + MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */ if (size < 2) { printf("run this program with at least 2 processes \n"); MPI_Finalize(); diff --git a/src/mc/mc_compare.c b/src/mc/mc_compare.c index 5a6eb587e4..5bc8380dc4 100644 --- a/src/mc/mc_compare.c +++ b/src/mc/mc_compare.c @@ -453,7 +453,9 @@ int snapshot_compare(void *state1, void *state2){ /* Stacks comparison */ unsigned int cursor = 0; int diff_local = 0; +#ifdef MC_DEBUG is_diff = 0; +#endif mc_snapshot_stack_t stack1, stack2; while(cursor < xbt_dynar_length(s1->stacks)){ diff --git a/src/msg/instr_msg_vm.c b/src/msg/instr_msg_vm.c index 481d26bba2..3171f4d5b1 100644 --- a/src/msg/instr_msg_vm.c +++ b/src/msg/instr_msg_vm.c @@ -46,7 +46,7 @@ void TRACE_msg_vm_change_host(msg_vm_t vm, msg_host_t old_host, msg_host_t new_h PJ_container_free(existing_container); //create new container on the new_host location - msg = PJ_container_new(instr_vm_id(vm, str, len), INSTR_MSG_VM, PJ_container_get(SIMIX_host_get_name(new_host))); + PJ_container_new(instr_vm_id(vm, str, len), INSTR_MSG_VM, PJ_container_get(SIMIX_host_get_name(new_host))); //end link msg = PJ_container_get(instr_vm_id(vm, str, len)); diff --git a/src/smpi/colls/allgatherv-ompi-bruck.c b/src/smpi/colls/allgatherv-ompi-bruck.c index d554938460..dc5d2fb477 100644 --- a/src/smpi/colls/allgatherv-ompi-bruck.c +++ b/src/smpi/colls/allgatherv-ompi-bruck.c @@ -123,9 +123,6 @@ int smpi_coll_tuned_allgatherv_ompi_bruck(void *sbuf, int scount, - blockcount doubles until the last step when only the remaining data is exchanged. */ - blockcount = 1; - tmpsend = (char*) rbuf; - new_rcounts = (int*) calloc(4*size, sizeof(int)); new_rdispls = new_rcounts + size; new_scounts = new_rdispls + size; diff --git a/src/smpi/colls/allreduce-rab1.c b/src/smpi/colls/allreduce-rab1.c index 2e80e45f6f..2cfab0a9fb 100644 --- a/src/smpi/colls/allreduce-rab1.c +++ b/src/smpi/colls/allreduce-rab1.c @@ -32,7 +32,6 @@ int smpi_coll_tuned_allreduce_rab1(void *sbuff, void *rbuff, pof2 <<= 1; pof2 >>= 1; - mask = 1; send_idx = recv_idx = 0; // uneven count diff --git a/src/smpi/colls/allreduce-smp-rsag-rab.c b/src/smpi/colls/allreduce-smp-rsag-rab.c index 370935777d..ff921155ab 100644 --- a/src/smpi/colls/allreduce-smp-rsag-rab.c +++ b/src/smpi/colls/allreduce-smp-rsag-rab.c @@ -91,19 +91,14 @@ int smpi_coll_tuned_allreduce_smp_rsag_rab(void *sbuf, void *rbuf, int count, recv_chunk = extent * count / (comm_size / num_core); mask = 1; - i = 0; curr_count = count / 2; int phase = 0; base_offset = 0; - send_base_offset = 0; - recv_base_offset = 0; while (mask < (comm_size / num_core)) { dst = inter_rank ^ mask; // compute offsets - send_base_offset = base_offset; - // right-handside if (inter_rank & mask) { recv_base_offset = base_offset + curr_count; diff --git a/src/smpi/colls/alltoall-2dmesh.c b/src/smpi/colls/alltoall-2dmesh.c index 4ac05755ee..287014f875 100644 --- a/src/smpi/colls/alltoall-2dmesh.c +++ b/src/smpi/colls/alltoall-2dmesh.c @@ -92,8 +92,6 @@ int smpi_coll_tuned_alltoall_2dmesh(void *send_buff, int send_count, req_ptr = reqs; - send_offset = recv_offset = (rank % Y) * block_size * num_procs; - count = send_count * num_procs; for (i = 0; i < Y; i++) { diff --git a/src/smpi/colls/alltoall-3dmesh.c b/src/smpi/colls/alltoall-3dmesh.c index e0224b2106..6f43a425a4 100644 --- a/src/smpi/colls/alltoall-3dmesh.c +++ b/src/smpi/colls/alltoall-3dmesh.c @@ -90,7 +90,7 @@ int smpi_coll_tuned_alltoall_3dmesh(void *send_buff, int send_count, req_ptr = reqs; - send_offset = recv_offset = (rank % two_dsize) * block_size * num_procs; + recv_offset = (rank % two_dsize) * block_size * num_procs; smpi_mpi_sendrecv(send_buff, send_count * num_procs, send_type, rank, tag, tmp_buff1 + recv_offset, num_procs * recv_count, diff --git a/src/smpi/colls/alltoallv-bruck.c b/src/smpi/colls/alltoallv-bruck.c index f7ca532f73..d7d0c37a76 100644 --- a/src/smpi/colls/alltoallv-bruck.c +++ b/src/smpi/colls/alltoallv-bruck.c @@ -30,8 +30,8 @@ int smpi_coll_tuned_alltoallv_bruck(void *sendbuf, int *sendcounts, int *senddis size = smpi_comm_size(comm); XBT_DEBUG("<%d> algorithm alltoall_bruck() called.", rank); - err = smpi_datatype_extent(sendtype, &lb, &sendext); - err = smpi_datatype_extent(recvtype, &lb, &recvext); + smpi_datatype_extent(sendtype, &lb, &sendext); + smpi_datatype_extent(recvtype, &lb, &recvext); /* Local copy from self */ err = smpi_datatype_copy((char *)sendbuf + senddisps[rank] * sendext, diff --git a/src/smpi/colls/gather-ompi.c b/src/smpi/colls/gather-ompi.c index fdaa1d7316..7b4bd61fa0 100644 --- a/src/smpi/colls/gather-ompi.c +++ b/src/smpi/colls/gather-ompi.c @@ -280,7 +280,6 @@ smpi_coll_tuned_gather_ompi_linear_sync(void *sbuf, int scount, COLL_TUNED_COMPUTED_SEGCOUNT( (size_t)first_segment_size, typelng, first_segment_count ); - ptmp = (char *) rbuf; for (i = 0; i < size; ++i) { if (i == rank) { /* skip myself */ diff --git a/src/smpi/colls/reduce-arrival-pattern-aware.c b/src/smpi/colls/reduce-arrival-pattern-aware.c index 3c20887666..920a15c836 100644 --- a/src/smpi/colls/reduce-arrival-pattern-aware.c +++ b/src/smpi/colls/reduce-arrival-pattern-aware.c @@ -179,8 +179,7 @@ int smpi_coll_tuned_reduce_arrival_pattern_aware(void *buf, void *rbuf, to = header_buf[myordering + 1]; } from = header_buf[myordering - 1]; - smpi_mpi_recv(tmp_buf, count, datatype, header_buf[myordering - 1], tag, - comm, &status); + smpi_mpi_recv(tmp_buf, count, datatype, from, tag, comm, &status); smpi_op_apply(op, tmp_buf, rbuf, &count, &datatype); smpi_mpi_send(rbuf, count, datatype, to, tag, comm); } diff --git a/src/smpi/colls/scatter-ompi.c b/src/smpi/colls/scatter-ompi.c index 130ec40932..2d3dacd2cf 100644 --- a/src/smpi/colls/scatter-ompi.c +++ b/src/smpi/colls/scatter-ompi.c @@ -127,8 +127,7 @@ smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount, smpi_mpi_recv(ptmp, rcount*size, rdtype, bmtree->tree_prev, COLL_TAG_SCATTER, comm, &status); /* local copy to rbuf */ - err = smpi_datatype_copy(ptmp, scount, sdtype, - rbuf, rcount, rdtype); + smpi_datatype_copy(ptmp, scount, sdtype, rbuf, rcount, rdtype); } /* send to children on all non-leaf */ for (i = 0; i < bmtree->tree_nextsize; i++) { diff --git a/src/smpi/smpi_coll.c b/src/smpi/smpi_coll.c index 688121eacd..3bca49dbb4 100644 --- a/src/smpi/smpi_coll.c +++ b/src/smpi/smpi_coll.c @@ -403,8 +403,8 @@ int smpi_coll_tuned_alltoall_bruck(void *sendbuf, int sendcount, rank = smpi_comm_rank(comm); size = smpi_comm_size(comm); XBT_DEBUG("<%d> algorithm alltoall_bruck() called.", rank); - err = smpi_datatype_extent(sendtype, &lb, &sendext); - err = smpi_datatype_extent(recvtype, &lb, &recvext); + smpi_datatype_extent(sendtype, &lb, &sendext); + smpi_datatype_extent(recvtype, &lb, &recvext); /* Local copy from self */ err = smpi_datatype_copy((char *)sendbuf + rank * sendcount * sendext, @@ -469,8 +469,8 @@ int smpi_coll_tuned_alltoall_basic_linear(void *sendbuf, int sendcount, rank = smpi_comm_rank(comm); size = smpi_comm_size(comm); XBT_DEBUG("<%d> algorithm alltoall_basic_linear() called.", rank); - err = smpi_datatype_extent(sendtype, &lb, &sendext); - err = smpi_datatype_extent(recvtype, &lb, &recvext); + smpi_datatype_extent(sendtype, &lb, &sendext); + smpi_datatype_extent(recvtype, &lb, &recvext); /* simple optimization */ err = smpi_datatype_copy((char *)sendbuf + rank * sendcount * sendext, sendcount, sendtype, @@ -525,8 +525,8 @@ int smpi_coll_basic_alltoallv(void *sendbuf, int *sendcounts, rank = smpi_comm_rank(comm); size = smpi_comm_size(comm); XBT_DEBUG("<%d> algorithm basic_alltoallv() called.", rank); - err = smpi_datatype_extent(sendtype, &lb, &sendext); - err = smpi_datatype_extent(recvtype, &lb, &recvext); + smpi_datatype_extent(sendtype, &lb, &sendext); + smpi_datatype_extent(recvtype, &lb, &recvext); /* Local copy from self */ err = smpi_datatype_copy((char *)sendbuf + senddisps[rank] * sendext, diff --git a/src/smpi/smpi_topo.c b/src/smpi/smpi_topo.c index 56622b867e..fdc5f7709d 100644 --- a/src/smpi/smpi_topo.c +++ b/src/smpi/smpi_topo.c @@ -453,7 +453,6 @@ getfactors(int num, int *nfactors, int **factors) { (*factors)[i++] = 2; } /* determine all occurences of uneven prime numbers up to sqrt(num) */ - d = 3; for(d = 3; (num > 1) && (d < sqrtnum); d += 2) { while((num % d) == 0) { num /= d; diff --git a/src/surf/instr_routing.c b/src/surf/instr_routing.c index 50c5769720..0b0a772363 100644 --- a/src/surf/instr_routing.c +++ b/src/surf/instr_routing.c @@ -245,7 +245,7 @@ static void instr_routing_parse_start_link (sg_platf_link_cbarg_t link) if (TRACE_uncategorized()){ type_t bandwidth_used = PJ_type_get_or_null ("bandwidth_used", new->type); if (bandwidth_used == NULL){ - bandwidth_used = PJ_type_variable_new ("bandwidth_used", "0.5 0.5 0.5", new->type); + PJ_type_variable_new ("bandwidth_used", "0.5 0.5 0.5", new->type); } } } @@ -271,7 +271,7 @@ static void instr_routing_parse_start_host (sg_platf_host_cbarg_t host) if (TRACE_uncategorized()){ type_t power_used = PJ_type_get_or_null ("power_used", new->type); if (power_used == NULL){ - power_used = PJ_type_variable_new ("power_used", "0.5 0.5 0.5", new->type); + PJ_type_variable_new ("power_used", "0.5 0.5 0.5", new->type); } } diff --git a/src/surf/lagrange.cpp b/src/surf/lagrange.cpp index 64fc0ad39a..ad8eabcc46 100644 --- a/src/surf/lagrange.cpp +++ b/src/surf/lagrange.cpp @@ -397,7 +397,6 @@ static double dichotomy(double init, double diff(double, void *), min = max = 0.5; } - min_diff = max_diff = middle_diff = 0.0; overall_error = 1; if ((diff_0 = diff(1e-16, var_cnst)) >= 0) { diff --git a/src/surf/platf_generator.c b/src/surf/platf_generator.c index fadf745abb..feaf4ff09f 100644 --- a/src/surf/platf_generator.c +++ b/src/surf/platf_generator.c @@ -399,7 +399,6 @@ int platf_graph_is_connected(void) { do { //Get the next node xbt_dynar_get_cpy(connected_nodes, iterator, &graph_node); - node_data = xbt_graph_node_get_data(graph_node); //add all the linked nodes to the connected node array outgoing_edges = xbt_graph_node_get_outedges(graph_node); diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 7cf6ef8b67..a4d47c207b 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -520,7 +520,7 @@ double Model::shareResourcesLazy(double now) { ActionPtr action = NULL; double min = -1; - double share, time_to_completion; + double share; XBT_DEBUG ("Before share resources, the size of modified actions set is %zd", @@ -547,10 +547,10 @@ double Model::shareResourcesLazy(double now) action->updateRemainingLazy(now); min = -1; - time_to_completion = -1; share = lmm_variable_getvalue(action->getVariable()); if (share > 0) { + double time_to_completion; if (action->getRemains() > 0) { time_to_completion = action->getRemainsNoUpdate() / share; } else { diff --git a/src/xbt/cunit.c b/src/xbt/cunit.c index 0a603bf564..08f52bb112 100644 --- a/src/xbt/cunit.c +++ b/src/xbt/cunit.c @@ -444,7 +444,6 @@ static int xbt_test_suite_run(xbt_test_suite_t suite, int verbosity) if (suite->unit_disabled) { fprintf(stderr, "%s%d disabled", (first ? "" : ", "), suite->unit_disabled); - first = 0; } fprintf(stderr, ")\n Tests: %.0f%% ok (%d tests: ", suite->nb_tests @@ -471,7 +470,6 @@ static int xbt_test_suite_run(xbt_test_suite_t suite, int verbosity) if (suite->test_expect) { fprintf(stderr, "%s%d expected to fail", (first ? "" : "; "), suite->test_expect); - first = 0; } fprintf(stderr, ")\n"); } @@ -647,7 +645,6 @@ int xbt_test_run(char *selection, int verbosity) if (_xbt_test_suite_ignore) { fprintf(stderr, "%s%d ignored", (first ? "" : ", "), _xbt_test_suite_ignore); - first = 0; } fprintf(stderr, ")\n Units: %.0f%% ok (%d units: ", _xbt_test_nb_units @@ -669,7 +666,6 @@ int xbt_test_run(char *selection, int verbosity) if (_xbt_test_unit_ignore) { fprintf(stderr, "%s%d ignored", (first ? "" : ", "), _xbt_test_unit_ignore); - first = 0; } fprintf(stderr, ")\n Tests: %.0f%% ok (%d tests: ", _xbt_test_nb_tests diff --git a/teshsuite/mc/dwarf/dwarf.c b/teshsuite/mc/dwarf/dwarf.c index 059062d589..513e2ed772 100644 --- a/teshsuite/mc/dwarf/dwarf.c +++ b/teshsuite/mc/dwarf/dwarf.c @@ -129,7 +129,7 @@ int main(int argc, char** argv) { dw_variable_t var; dw_type_t type; - var = test_global_variable(mc_binary_info, "some_local_variable", &some_local_variable, sizeof(int)); + test_global_variable(mc_binary_info, "some_local_variable", &some_local_variable, sizeof(int)); var = test_global_variable(mc_binary_info, "test_some_array", &test_some_array, sizeof(test_some_array)); type = xbt_dict_get_or_null(mc_binary_info->types, var->type_origin); diff --git a/teshsuite/smpi/bcast/bcast_coll.c b/teshsuite/smpi/bcast/bcast_coll.c index c9d898e391..bceaf4087c 100644 --- a/teshsuite/smpi/bcast/bcast_coll.c +++ b/teshsuite/smpi/bcast/bcast_coll.c @@ -23,7 +23,7 @@ int main(int argc, char **argv) for (i = 0; i < count; i++) values[i] = (0 == rank) ? 17 : 3; - status = MPI_Bcast(values, count, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast(values, count, MPI_INT, 0, MPI_COMM_WORLD); int good = 0; for (i = 0; i < count; i++) diff --git a/teshsuite/smpi/mpich3-test/comm/dup.c b/teshsuite/smpi/mpich3-test/comm/dup.c index a30975fb40..c9a06e6e79 100644 --- a/teshsuite/smpi/mpich3-test/comm/dup.c +++ b/teshsuite/smpi/mpich3-test/comm/dup.c @@ -33,7 +33,6 @@ int main( int argc, char **argv ) } /* Can we communicate with this new communicator? */ - dest = MPI_PROC_NULL; if (rank == 0) { dest = size - 1; a = rank; diff --git a/teshsuite/smpi/mpich3-test/comm/dup_with_info.c b/teshsuite/smpi/mpich3-test/comm/dup_with_info.c index e63acaaa94..c0472c0b4c 100644 --- a/teshsuite/smpi/mpich3-test/comm/dup_with_info.c +++ b/teshsuite/smpi/mpich3-test/comm/dup_with_info.c @@ -28,7 +28,6 @@ int run_tests(MPI_Comm comm) MPI_Barrier(comm); /* Can we communicate with this new communicator? */ - dest = MPI_PROC_NULL; if (rank == 0) { dest = size - 1; a = rank; diff --git a/teshsuite/smpi/mpich3-test/group/groupcreate.c b/teshsuite/smpi/mpich3-test/group/groupcreate.c index c8952d84e1..5e3a2f3b66 100644 --- a/teshsuite/smpi/mpich3-test/group/groupcreate.c +++ b/teshsuite/smpi/mpich3-test/group/groupcreate.c @@ -41,7 +41,7 @@ int main( int argc, char **argv ) else { /* Check that the group was created (and that any errors were caught) */ - rc = MPI_Group_size( group_array[i], &group_size ); + MPI_Group_size( group_array[i], &group_size ); if (group_size != size) { fprintf( stderr, "Group number %d not correct (size = %d)\n", i, size ); diff --git a/teshsuite/smpi/mpich3-test/pt2pt/sendall.c b/teshsuite/smpi/mpich3-test/pt2pt/sendall.c index 2f87e47eb0..d344e24f61 100644 --- a/teshsuite/smpi/mpich3-test/pt2pt/sendall.c +++ b/teshsuite/smpi/mpich3-test/pt2pt/sendall.c @@ -28,7 +28,6 @@ int main ( int argc, char *argv[] ) int i; int count, size; int self, npes; - double secs; MPI_Request request[MAXPES]; MPI_Status status; @@ -44,7 +43,6 @@ int main ( int argc, char *argv[] ) } for (size = 1; size <= MYBUFSIZE ; size += size) { - secs = -MPI_Wtime (); for (count = 0; count < NUM_RUNS; count++) { MPI_Barrier (MPI_COMM_WORLD); @@ -66,10 +64,8 @@ int main ( int argc, char *argv[] ) } MPI_Barrier (MPI_COMM_WORLD); - secs += MPI_Wtime (); if (self == 0) { - secs = secs / (double) NUM_RUNS; MTestPrintfMsg( 1, "length = %d ints\n", size ); } } diff --git a/teshsuite/smpi/pingpong/pingpong.c b/teshsuite/smpi/pingpong/pingpong.c index ab3f440761..7adb6aea1f 100644 --- a/teshsuite/smpi/pingpong/pingpong.c +++ b/teshsuite/smpi/pingpong/pingpong.c @@ -24,8 +24,8 @@ int main(int argc, char *argv[]) printf("MPI initialization failed!\n"); exit(1); } - err = MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get nr of tasks */ - err = MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */ + MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get nr of tasks */ + MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */ if (size < 2) { printf("run this program with exactly 2 processes (-np 2)\n"); MPI_Finalize(); @@ -45,25 +45,25 @@ int main(int argc, char *argv[]) int dst = rank + 1; printf("[%d] About to send 1st message '%d' to process [%d]\n", rank, msg, dst); - err = MPI_Send(&msg, 1, MPI_INT, dst, tag1, MPI_COMM_WORLD); + MPI_Send(&msg, 1, MPI_INT, dst, tag1, MPI_COMM_WORLD); - err = MPI_Recv(&msg, 1, MPI_INT, dst, tag2, MPI_COMM_WORLD, &status); /* Receive a message */ + MPI_Recv(&msg, 1, MPI_INT, dst, tag2, MPI_COMM_WORLD, &status); /* Receive a message */ printf("[%d] Received reply message '%d' from process [%d]\n", rank, msg, dst); } if ((pivot + 1) == rank) { int src = rank - 1; - err = MPI_Recv(&msg, 1, MPI_INT, src, tag1, MPI_COMM_WORLD, &status); /* Receive a message */ + MPI_Recv(&msg, 1, MPI_INT, src, tag1, MPI_COMM_WORLD, &status); /* Receive a message */ printf("[%d] Received 1st message '%d' from process [%d]\n", rank, msg, src); msg++; printf("[%d] increment message's value to '%d'\n", rank, msg); printf("[%d] About to send back message '%d' to process [%d]\n", rank, msg, src); - err = MPI_Send(&msg, 1, MPI_INT, src, tag2, MPI_COMM_WORLD); + MPI_Send(&msg, 1, MPI_INT, src, tag2, MPI_COMM_WORLD); } } - err = MPI_Finalize(); /* Terminate MPI */ + MPI_Finalize(); /* Terminate MPI */ return 0; }