[C-mpi-commits] SF.net SVN: c-mpi:[29] test/mpirpc
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-04-20 18:27:33
|
Revision: 29
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=29&view=rev
Author: jmwozniak
Date: 2010-04-20 18:27:27 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Rename args test.
Added Paths:
-----------
test/mpirpc/test-args.c
test/mpirpc/test-args.zsh
Removed Paths:
-------------
test/mpirpc/test02.c
test/mpirpc/test02.zsh
Copied: test/mpirpc/test-args.c (from rev 28, test/mpirpc/test02.c)
===================================================================
--- test/mpirpc/test-args.c (rev 0)
+++ test/mpirpc/test-args.c 2010-04-20 18:27:27 UTC (rev 29)
@@ -0,0 +1,60 @@
+
+/**
+ Simple two-processor argument test
+ for NULL, 0-length, and non-0-length args.
+ NULL return values.
+*/
+
+#include <mpirpc.h>
+
+void
+handle_test(MPIRPC_Node caller, int unique, char* args,
+ char* blob, int blob_length)
+{
+ show_fs(args);
+ if (args)
+ free(args);
+ MPIRPC_Null(caller, unique);
+}
+
+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)
+ {
+ MPIRPC_Node_make(MPI_COMM_WORLD, 1, &neighbor);
+ MPIRPC_Block(neighbor, "test", NULL);
+ MPIRPC_Block(neighbor, "test", "");
+ MPIRPC_Block(neighbor, "test", "alpha");
+ }
+ else
+ {
+ MPIRPC_Node_make(MPI_COMM_WORLD, 0, &neighbor);
+ MPIRPC_Register("test", handle_test);
+ while (! MPIRPC_Check());
+ while (! MPIRPC_Check());
+ while (! MPIRPC_Check());
+ }
+
+ printf("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-args.c
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: test/mpirpc/test-args.zsh (from rev 28, test/mpirpc/test02.zsh)
===================================================================
--- test/mpirpc/test-args.zsh (rev 0)
+++ test/mpirpc/test-args.zsh 2010-04-20 18:27:27 UTC (rev 29)
@@ -0,0 +1,29 @@
+#!/bin/zsh
+
+set -x
+
+# Be sure to make tests with D=1
+
+OUT=$1
+STATUS=${OUT%.out}.status
+
+crash()
+{
+ print $1
+ exit 1
+}
+
+# Should only be 3 calls to handle_test()...
+N=$( grep -c "handle_test(args=" ${OUT} )
+(( N == 3 )) || crash "N != 3"
+
+TOKENS=("handle_test(args=(null))"
+ "handle_test(args=)"
+ "handle_test(args=alpha)" )
+
+for T in ${TOKENS}
+do
+ grep ${T} ${OUT} || crash "Not found: ${T}"
+done
+
+print success > ${STATUS}
Property changes on: test/mpirpc/test-args.zsh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mergeinfo
+
Deleted: test/mpirpc/test02.c
===================================================================
--- test/mpirpc/test02.c 2010-04-20 18:26:19 UTC (rev 28)
+++ test/mpirpc/test02.c 2010-04-20 18:27:27 UTC (rev 29)
@@ -1,60 +0,0 @@
-
-/**
- Simple two-processor argument test
- for NULL, 0-length, and non-0-length args.
- NULL return values.
-*/
-
-#include <mpirpc.h>
-
-void
-handle_test(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
-{
- show_fs(args);
- if (args)
- free(args);
- MPIRPC_Null(caller, unique);
-}
-
-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)
- {
- MPIRPC_Node_make(MPI_COMM_WORLD, 1, &neighbor);
- MPIRPC_Block(neighbor, "test", NULL);
- MPIRPC_Block(neighbor, "test", "");
- MPIRPC_Block(neighbor, "test", "alpha");
- }
- else
- {
- MPIRPC_Node_make(MPI_COMM_WORLD, 0, &neighbor);
- MPIRPC_Register("test", handle_test);
- while (! MPIRPC_Check());
- while (! MPIRPC_Check());
- while (! MPIRPC_Check());
- }
-
- printf("Normal exit.\n");
- MPIRPC_Finalize();
- MPI_Finalize();
-
- DMALLOC_SETUP(if (mpi_rank == 0)
- {
- SHOW_S(dmalloc_logpath);
- dmalloc_shutdown();
- });
- return 0;
-}
Deleted: test/mpirpc/test02.zsh
===================================================================
--- test/mpirpc/test02.zsh 2010-04-20 18:26:19 UTC (rev 28)
+++ test/mpirpc/test02.zsh 2010-04-20 18:27:27 UTC (rev 29)
@@ -1,29 +0,0 @@
-#!/bin/zsh
-
-set -x
-
-# Be sure to make tests with D=1
-
-OUT=$1
-STATUS=${OUT%.out}.status
-
-crash()
-{
- print $1
- exit 1
-}
-
-# Should only be 3 calls to handle_test()...
-N=$( grep -c "handle_test(args=" ${OUT} )
-(( N == 3 )) || crash "N != 3"
-
-TOKENS=("handle_test(args=(null))"
- "handle_test(args=)"
- "handle_test(args=alpha)" )
-
-for T in ${TOKENS}
-do
- grep ${T} ${OUT} || crash "Not found: ${T}"
-done
-
-print success > ${STATUS}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|