Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix dead assignments.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 9 May 2014 12:09:41 +0000 (14:09 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 12 May 2014 08:39:54 +0000 (10:39 +0200)
That's when a value stored in a variable is never used.

31 files changed:
examples/smpi/mc/bugged1.c
examples/smpi/mc/bugged1_liveness.c
examples/smpi/mc/bugged2.c
examples/smpi/mc/mutual_exclusion.c
examples/smpi/mc/non_deterministic.c
examples/smpi/mc/send_deterministic.c
src/mc/mc_compare.c
src/msg/instr_msg_vm.c
src/smpi/colls/allgatherv-ompi-bruck.c
src/smpi/colls/allreduce-rab1.c
src/smpi/colls/allreduce-smp-rsag-rab.c
src/smpi/colls/alltoall-2dmesh.c
src/smpi/colls/alltoall-3dmesh.c
src/smpi/colls/alltoallv-bruck.c
src/smpi/colls/gather-ompi.c
src/smpi/colls/reduce-arrival-pattern-aware.c
src/smpi/colls/scatter-ompi.c
src/smpi/smpi_coll.c
src/smpi/smpi_topo.c
src/surf/instr_routing.c
src/surf/lagrange.cpp
src/surf/platf_generator.c
src/surf/surf_interface.cpp
src/xbt/cunit.c
teshsuite/mc/dwarf/dwarf.c
teshsuite/smpi/bcast/bcast_coll.c
teshsuite/smpi/mpich3-test/comm/dup.c
teshsuite/smpi/mpich3-test/comm/dup_with_info.c
teshsuite/smpi/mpich3-test/group/groupcreate.c
teshsuite/smpi/mpich3-test/pt2pt/sendall.c
teshsuite/smpi/pingpong/pingpong.c

index b319f0f..92ddaea 100644 (file)
@@ -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();
index 7305370..68a5ef4 100644 (file)
@@ -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){
index 42de583..1af27be 100644 (file)
@@ -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();
index 8c7ab75..7ed894b 100644 (file)
@@ -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){
index b5fbcc0..4a0c7dc 100644 (file)
@@ -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();
index fe42106..048d75c 100644 (file)
@@ -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();
index 5a6eb58..5bc8380 100644 (file)
@@ -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)){
index 481d26b..3171f4d 100644 (file)
@@ -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));
index d554938..dc5d2fb 100644 (file)
@@ -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;
index 2e80e45..2cfab0a 100644 (file)
@@ -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
index 3709357..ff92115 100644 (file)
@@ -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;
index 4ac0575..287014f 100644 (file)
@@ -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++) {
index e0224b2..6f43a42 100644 (file)
@@ -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,
index f7ca532..d7d0c37 100644 (file)
@@ -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,
index fdaa1d7..7b4bd61 100644 (file)
@@ -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 */
index 3c20887..920a15c 100644 (file)
@@ -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);
       }
index 130ec40..2d3dacd 100644 (file)
@@ -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++) {
index 688121e..3bca49d 100644 (file)
@@ -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, 
index 56622b8..fdc5f77 100644 (file)
@@ -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;
index 50c5769..0b0a772 100644 (file)
@@ -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);
     }
   }
 
index 64fc0ad..ad8eabc 100644 (file)
@@ -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) {
index fadf745..feaf4ff 100644 (file)
@@ -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);
index 7cf6ef8..a4d47c2 100644 (file)
@@ -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 {
index 0a603bf..08f52bb 100644 (file)
@@ -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
index 059062d..513e2ed 100644 (file)
@@ -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);
index c9d898e..bceaf40 100644 (file)
@@ -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++)
index a30975f..c9a06e6 100644 (file)
@@ -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;
index e63acaa..c0472c0 100644 (file)
@@ -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;
index c8952d8..5e3a2f3 100644 (file)
@@ -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 );
index 2f87e47..d344e24 100644 (file)
@@ -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 );
        }
     }
index ab3f440..7adb6ae 100644 (file)
@@ -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;
 }