[C-mpi-commits] SF.net SVN: c-mpi:[36] test/mpirpc
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-04-20 19:55:19
|
Revision: 36
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=36&view=rev
Author: jmwozniak
Date: 2010-04-20 19:55:13 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
test04 -> test-blob
Added Paths:
-----------
test/mpirpc/test-blob.c
Removed Paths:
-------------
test/mpirpc/test04.c
Copied: test/mpirpc/test-blob.c (from rev 35, test/mpirpc/test04.c)
===================================================================
--- test/mpirpc/test-blob.c (rev 0)
+++ test/mpirpc/test-blob.c 2010-04-20 19:55:13 UTC (rev 36)
@@ -0,0 +1,73 @@
+
+/**
+ Simple two-processor argument test
+ for non-0-length args and
+ for non-0-length blobs.
+*/
+
+#include <mpirpc.h>
+
+void
+handle_test(MPIRPC_Node caller, int unique, char* args,
+ char* blob, int blob_length)
+{
+ int a;
+ sscanf(args, "%i", &a);
+ show_fsi(args, a);
+
+ assert(blob[0] == '\n');
+ assert(blob[1] == '\0');
+ assert(blob[2] == '\t');
+ assert(blob[3] == '\n');
+
+ NOTE("asserts ok");
+
+ MPIRPC_Null(caller, unique);
+ if (args)
+ free(args);
+}
+
+int
+main(int argc, char* argv[])
+{
+ gossip_set_debug_mask(1, MASK_MPIRPC);
+
+ MPI_Init(&argc, &argv);
+ MPIRPC_Init();
+ whoami();
+
+ DMALLOC_SETUP(dmalloc_setup());
+
+ MPIRPC_Comm_add(MPI_COMM_WORLD);
+
+ MPIRPC_Node neighbor;
+ if (mpi_rank == 0)
+ {
+ char blob[4];
+ blob[0] = '\n';
+ blob[1] = '\0';
+ blob[2] = '\t';
+ blob[3] = '\n';
+ char* result;
+ MPIRPC_Node_make(MPI_COMM_WORLD, 1, &neighbor);
+ result = MPIRPC_Block_blob(neighbor, "test", "0", blob, 4);
+ show_s(result);
+ }
+ else
+ {
+ MPIRPC_Node_make(MPI_COMM_WORLD, 0, &neighbor);
+ MPIRPC_Register("test", handle_test);
+ while (! MPIRPC_Check());
+ }
+
+ NOTE("Normal exit.\n");
+ MPIRPC_Finalize();
+ MPI_Finalize();
+
+ DMALLOC_SETUP(if (mpi_rank == 0)
+ {
+ SHOW_S(dmalloc_logpath);
+ dmalloc_shutdown();
+ });
+ return 0;
+}
Property changes on: test/mpirpc/test-blob.c
___________________________________________________________________
Added: svn:mergeinfo
+
Deleted: test/mpirpc/test04.c
===================================================================
--- test/mpirpc/test04.c 2010-04-20 19:54:23 UTC (rev 35)
+++ test/mpirpc/test04.c 2010-04-20 19:55:13 UTC (rev 36)
@@ -1,73 +0,0 @@
-
-/**
- Simple two-processor argument test
- for non-0-length args and
- for non-0-length blobs.
-*/
-
-#include <mpirpc.h>
-
-void
-handle_test(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
-{
- int a;
- sscanf(args, "%i", &a);
- show_fsi(args, a);
-
- assert(blob[0] == '\n');
- assert(blob[1] == '\0');
- assert(blob[2] == '\t');
- assert(blob[3] == '\n');
-
- NOTE("asserts ok");
-
- MPIRPC_Null(caller, unique);
- if (args)
- free(args);
-}
-
-int
-main(int argc, char* argv[])
-{
- gossip_set_debug_mask(1, MASK_MPIRPC);
-
- MPI_Init(&argc, &argv);
- MPIRPC_Init();
- whoami();
-
- DMALLOC_SETUP(dmalloc_setup());
-
- MPIRPC_Comm_add(MPI_COMM_WORLD);
-
- MPIRPC_Node neighbor;
- if (mpi_rank == 0)
- {
- char blob[4];
- blob[0] = '\n';
- blob[1] = '\0';
- blob[2] = '\t';
- blob[3] = '\n';
- char* result;
- MPIRPC_Node_make(MPI_COMM_WORLD, 1, &neighbor);
- result = MPIRPC_Block_blob(neighbor, "test", "0", blob, 4);
- show_s(result);
- }
- else
- {
- MPIRPC_Node_make(MPI_COMM_WORLD, 0, &neighbor);
- MPIRPC_Register("test", handle_test);
- while (! MPIRPC_Check());
- }
-
- 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.
|