[C-mpi-commits] SF.net SVN: c-mpi:[18] test
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-04-20 16:14:25
|
Revision: 18
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=18&view=rev
Author: jmwozniak
Date: 2010-04-20 16:14:18 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Minors.
Modified Paths:
--------------
test/mpirpc/module.mk.in
test/mpirpc/test01.c
Added Paths:
-----------
test/gossip/test-do.c
Removed Paths:
-------------
test/gossip/test03.c
Copied: test/gossip/test-do.c (from rev 17, test/gossip/test03.c)
===================================================================
--- test/gossip/test-do.c (rev 0)
+++ test/gossip/test-do.c 2010-04-20 16:14:18 UTC (rev 18)
@@ -0,0 +1,36 @@
+/**
+ * Test gossip functionality.
+ * */
+
+#include <mpi.h>
+#include <gs-debug.h>
+#include <mpi_tools.h>
+
+int main(int argc, char* argv[])
+{
+ MPI_Init(&argc, &argv);
+
+ whoami();
+
+ printf(
+"This test program will print an example debugging message on the final\n"
+"line of output if the CMPI_DEBUG_MASK environment variable is set to include\n"
+"\"example\" or \"all\" in its comma seperated list of masks:\n"
+ );
+
+ gossip_debug_init();
+
+ gossip_do(MASK_EXAMPLE, printf("Hello\n"));
+
+ MPI_Finalize();
+ return 0;
+}
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
Property changes on: test/gossip/test-do.c
___________________________________________________________________
Added: svn:mergeinfo
+
Deleted: test/gossip/test03.c
===================================================================
--- test/gossip/test03.c 2010-04-20 16:07:29 UTC (rev 17)
+++ test/gossip/test03.c 2010-04-20 16:14:18 UTC (rev 18)
@@ -1,36 +0,0 @@
-/**
- * Test gossip functionality.
- * */
-
-#include <mpi.h>
-#include <gs-debug.h>
-#include <mpi_tools.h>
-
-int main(int argc, char* argv[])
-{
- MPI_Init(&argc, &argv);
-
- whoami();
-
- printf(
-"This test program will print an example debugging message on the final\n"
-"line of output if the CMPI_DEBUG_MASK environment variable is set to include\n"
-"\"example\" or \"all\" in its comma seperated list of masks:\n"
- );
-
- gossip_debug_init();
-
- gossip_do(MASK_EXAMPLE, printf("Hello\n"));
-
- MPI_Finalize();
- return 0;
-}
-
-/*
- * Local variables:
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
Modified: test/mpirpc/module.mk.in
===================================================================
--- test/mpirpc/module.mk.in 2010-04-20 16:07:29 UTC (rev 17)
+++ test/mpirpc/module.mk.in 2010-04-20 16:14:18 UTC (rev 18)
@@ -1,12 +1,10 @@
-DIR := test/mpirpc-2
+DIR := test/mpirpc
-ifeq (@USE_MPIRPC_2@,1)
-
TEST_MPIRPC_SRC += $(shell find $(DIR) -name "*.c" )
TEST_SRC += $(TEST_MPIRPC_SRC)
-test/mpirpc-2/test%.out: test/mpirpc-2/test%.x
+test/mpirpc/test%.out: test/mpirpc/test%.x
$(LAUNCH) -n $(NODES) $(<) -c "reps=$(REPS)" > $(@) 2>&1
cp -uv $(@) test/mpirpc/readable.txt
@@ -14,11 +12,3 @@
$(Q) " MPICC $(@) "
$(E)$(MPICC) $(MPE) $(<) $(CMPI) $(LIBS) -o $(@)
-else
-
-$(DIR)/test%.x: $(DIR)/test%.o $(CMPI)
- $(Q) " MPICC $(@) "
- $(E)$(MPICC) $(MPE) $(<) $(CMPI) $(LIBS) -o $(@)
-
-endif
-
Modified: test/mpirpc/test01.c
===================================================================
--- test/mpirpc/test01.c 2010-04-20 16:07:29 UTC (rev 17)
+++ test/mpirpc/test01.c 2010-04-20 16:14:18 UTC (rev 18)
@@ -1,28 +1,28 @@
/**
Simple two-processor ping pong test.
- No arguments or return values.
+ No arguments or return values.
*/
-#include <sys/stat.h>
+#include <sys/stat.h>
#include <mpirpc.h>
-#include "test_helpers.h"
+#include "test_helpers.h"
-int count = 0;
-bool running = true;
+int count = 0;
+bool running = true;
-char*
+char*
file_string(char* file)
{
intmax_t size;
- struct stat stats;
+ struct stat stats;
- stat(file, &stats);
- size = (intmax_t) stats.st_size;
- char* result = malloc(size+1);
-
+ stat(file, &stats);
+ size = (intmax_t) stats.st_size;
+ char* result = malloc(size+1);
+
FILE* f = fopen(file, "r");
fread(result, 1, size, f);
fclose(f);
@@ -33,18 +33,18 @@
handle_ping(MPIRPC_Node caller, int unique, char* args,
char* blob, int blob_length)
{
- NOTE_F;
+ NOTE_F;
SHOW_S(args);
- MPIRPC_Null(caller, unique);
+ MPIRPC_Null(caller, unique);
if (count++ < 3)
{
- MPIRPC_Call(caller, "ping", NULL, NULL, MPIRPC_Free);
+ MPIRPC_Call(caller, "ping", NULL, NULL, MPIRPC_Free);
}
else
{
MPIRPC_Flush_returns();
MPIRPC_Block(caller, "quit", NULL);
- running = false;
+ running = false;
}
}
@@ -52,29 +52,29 @@
handle_quit(MPIRPC_Node caller, int unique, char* args,
char* blob, int blob_length)
{
- NOTE_F;
+ NOTE_F;
SHOW_S(args);
- running = false;
+ running = false;
MPIRPC_Null(caller, unique);
}
int
main(int argc, char* argv[])
{
- printf("host: %s\n", file_string("/etc/hostname"));
-
+ 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);
+ 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)
{
@@ -83,24 +83,24 @@
}
else
{
- MPIRPC_Node_make(MPI_COMM_WORLD, 0, &neighbor);
+ MPIRPC_Node_make(MPI_COMM_WORLD, 0, &neighbor);
}
-
+
while (running)
{
MPIRPC_Check();
sleep(1);
}
- note("Normal exit.\n");
-
- MPIRPC_Finalize();
+ note("Normal exit.\n");
+
+ MPIRPC_Finalize();
MPI_Finalize();
DMALLOC_SETUP(if (mpi_rank == 0)
{
- SHOW_S(dmalloc_logpath);
+ SHOW_S(dmalloc_logpath);
dmalloc_shutdown();
});
- return 0;
+ return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|