Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill 2 SMPI examples with unclear license
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 27 Nov 2010 18:24:08 +0000 (18:24 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 27 Nov 2010 18:24:08 +0000 (18:24 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8699 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/smpi/CMakeLists.txt
examples/smpi/first.c [deleted file]
examples/smpi/second.c [deleted file]

index 1cac773..3b47512 100644 (file)
@@ -17,9 +17,7 @@ add_executable(bcbench bcbench.c)
 add_executable(compute compute.c)
 add_executable(compute2 compute2.c)
 add_executable(compute3 compute3.c)
-add_executable(first mvmul.c)
 add_executable(pingpong pingpong.c)
-add_executable(second second.c)
 add_executable(scatter scatter.c)
 add_executable(reduce reduce.c)
 add_executable(split split.c)
@@ -37,9 +35,7 @@ target_link_libraries(bcbench m simgrid smpi )
 target_link_libraries(compute m simgrid smpi )
 target_link_libraries(compute2 m simgrid smpi )
 target_link_libraries(compute3 m simgrid smpi )
-target_link_libraries(first m simgrid smpi )
 target_link_libraries(pingpong m simgrid smpi )
-target_link_libraries(second m simgrid smpi )
 target_link_libraries(scatter m simgrid smpi )
 target_link_libraries(reduce m simgrid smpi )
 target_link_libraries(split m simgrid smpi )
diff --git a/examples/smpi/first.c b/examples/smpi/first.c
deleted file mode 100644 (file)
index 8ff6e4c..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <stdio.h>
-#include <mpi.h>
-
-int main(int argc, char *argv[])
-{
-  int rank, size, err;
-
-  err = MPI_Init(&argc, &argv); /* Initialize MPI */
-  if (err != MPI_SUCCESS) {
-    printf("MPI initialization failed!\n");
-    exit(1);
-  }
-
-  err = MPI_Comm_size(MPI_COMM_WORLD, &size);
-  if (err != MPI_SUCCESS) {
-    printf("MPI Get Communicator Size Failed!\n");
-  }
-
-  err = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-  if (err != MPI_SUCCESS) {
-    printf("MPI Get Communicator Rank Failed!\n");
-  }
-
-  if (0 == rank) {
-    printf("root node believes there are %d nodes in world.\n", size);
-  }
-
-  sleep(20);
-
-  err = MPI_Finalize();         /* Terminate MPI */
-  return 0;
-}
diff --git a/examples/smpi/second.c b/examples/smpi/second.c
deleted file mode 100644 (file)
index e34a212..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* A first simple SPMD example program using MPI                  */
-
-/* The program consists of on receiver process and N-1 sender     */
-/* processes. The sender processes send a message consisting      */
-/* of their process identifier (id) and the total number of       */
-/* processes (ntasks) to the receiver. The receiver process       */
-/* prints out the values it receives in the messeges from the     */
-/* senders.                                                       */
-
-/* Compile the program with 'mpicc first.c -o first'              */
-/* To run the program, using four of the computers specified in   */
-/* your hostfile, do 'mpirun -machinefile hostfile -np 4 first    */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <mpi.h>
-
-int main(int argc, char *argv[])
-{
-  const int tag = 42;           /* Message tag */
-  int id, ntasks, source_id, dest_id, err, i;
-  MPI_Status status;
-  int msg[2];                   /* Message array */
-
-  err = MPI_Init(&argc, &argv); /* Initialize MPI */
-  if (err != MPI_SUCCESS) {
-    printf("MPI initialization failed!\n");
-    exit(1);
-  }
-  err = MPI_Comm_size(MPI_COMM_WORLD, &ntasks); /* Get nr of tasks */
-  err = MPI_Comm_rank(MPI_COMM_WORLD, &id);     /* Get id of this process */
-  if (ntasks < 2) {
-    printf("You have to use at least 2 processors to run this program\n");
-    MPI_Finalize();             /* Quit if there is only one processor */
-    exit(0);
-  }
-
-  if (id == 0) {                /* Process 0 (the receiver) does this */
-    for (i = 1; i < ntasks; i++) {
-      err = MPI_Recv(msg, 2, MPI_INT, MPI_ANY_SOURCE, tag, MPI_COMM_WORLD, &status);    /* Receive a message */
-      source_id = status.MPI_SOURCE;    /* Get id of sender */
-      printf("Received message %d %d from process %d\n", msg[0], msg[1],
-             source_id);
-    }
-  } else {                      /* Processes 1 to N-1 (the senders) do this */
-    msg[0] = id;                /* Put own identifier in the message */
-    msg[1] = ntasks;            /* and total number of processes */
-    dest_id = 0;                /* Destination address */
-    sleep(3);
-    err = MPI_Send(msg, 2, MPI_INT, dest_id, tag, MPI_COMM_WORLD);
-  }
-
-  err = MPI_Finalize();         /* Terminate MPI */
-  if (id == 0)
-    printf("Ready\n");
-  return 0;
-}