Revision: 33
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=33&view=rev
Author: jmwozniak
Date: 2010-04-20 19:31:04 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Rearranging tests.
Removed Paths:
-------------
test/mpirpc/test01.c
Deleted: test/mpirpc/test01.c
===================================================================
--- test/mpirpc/test01.c 2010-04-20 19:25:54 UTC (rev 32)
+++ test/mpirpc/test01.c 2010-04-20 19:31:04 UTC (rev 33)
@@ -1,88 +0,0 @@
-
-/**
- Simple two-processor ping pong test.
- No arguments or return values.
-*/
-
-#include <mpirpc.h>
-
-#include "test_helpers.h"
-
-int count = 0;
-bool running = true;
-
-void
-handle_ping(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
-{
- NOTE_F;
- SHOW_S(args);
- MPIRPC_Null(caller, unique);
- if (count++ < 3)
- {
- MPIRPC_Call(caller, "ping", NULL, NULL, MPIRPC_Free);
- }
- else
- {
- MPIRPC_Flush_returns();
- MPIRPC_Block(caller, "quit", NULL);
- running = false;
- }
-}
-
-void
-handle_quit(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
-{
- NOTE_F;
- SHOW_S(args);
- running = false;
- MPIRPC_Null(caller, unique);
-}
-
-int
-main(int argc, char* argv[])
-{
- printf("host: %s\n", file_string("/etc/hostname"));
-
- MPI_Init(&argc, &argv);
-
- MPIRPC_Init();
-
- SHOW_I(debug_rank);
-
- DMALLOC_SETUP(dmalloc_setup());
-
- MPIRPC_Comm_add(MPI_COMM_WORLD);
- MPIRPC_Register("ping", handle_ping);
- MPIRPC_Register("quit", handle_quit);
-
- MPIRPC_Node neighbor;
- if (mpi_rank == 0)
- {
- MPIRPC_Node_make(MPI_COMM_WORLD, 1, &neighbor);
- MPIRPC_Block(neighbor, "ping", NULL);
- }
- else
- {
- MPIRPC_Node_make(MPI_COMM_WORLD, 0, &neighbor);
- }
-
- while (running)
- {
- MPIRPC_Check();
- sleep(1);
- }
-
- note("Normal exit.\n");
-
- MPIRPC_Finalize();
- MPI_Finalize();
-
- DMALLOC_SETUP(if (mpi_rank == 0)
- {
- SHOW_S(dmalloc_logpath);
- dmalloc_shutdown();
- });
- return 0;
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|