Thread: [C-mpi-commits] SF.net SVN: c-mpi:[28] test/mpirpc
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-04-20 18:26:28
|
Revision: 28
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=28&view=rev
Author: jmwozniak
Date: 2010-04-20 18:26:19 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Improving MPIRPC tests...
Modified Paths:
--------------
Makefile.in
include/mpi_tools.h
src/mpi_tools/mpi_tools.c
test/mpirpc/module.mk.in
test/mpirpc/test01.c
test/mpirpc/test02.c
test/mpirpc/test_helpers.h
Added Paths:
-----------
test/mpirpc/test02.zsh
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-20 17:42:29 UTC (rev 27)
+++ Makefile.in 2010-04-20 18:26:19 UTC (rev 28)
@@ -426,6 +426,9 @@
tests: $(CMPI) $(TEST_PROGS)
+%.status: %.out
+ $(patsubst %.out, %.zsh, $(<)) $(<)
+
# Obsolete target: delete soon.
cmpi-io-test: $(CMPI_IO) src/cmpi/cmpi-io-test.o
$(Q) " MPICC cmpi-io-test"
Modified: include/mpi_tools.h
===================================================================
--- include/mpi_tools.h 2010-04-20 17:42:29 UTC (rev 27)
+++ include/mpi_tools.h 2010-04-20 18:26:19 UTC (rev 28)
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include <sys/stat.h>
#include <sys/time.h>
#include <mpi.h>
@@ -42,8 +43,9 @@
char* iheap(int i);
char* xheap(int i);
-/** Execute code line or block in rank order.
- */
+/**
+ Execute code line or block in rank order.
+*/
#define sequential(code) \
{ \
int sequential_i; \
@@ -331,6 +333,8 @@
#define DUMPSTACK DEBUG(dump_stack());
+char* file_string(char* file);
+
//// Memory usage debugging:
#ifdef DMALLOC
#include <dmalloc.h>
@@ -340,6 +344,22 @@
#endif
/**
+ Set up DMALLOC
+*/
+
+#ifdef DMALLOC
+void
+dmalloc_setup(void)
+{
+ dmalloc_logpath = malloc(100);
+ assert(dmalloc_logpath != NULL);
+ sprintf(dmalloc_logpath, "./dmalloc_%i.out", debug_rank);
+ printf("dmalloc_logpath: %s \n", dmalloc_logpath);
+ fflush(NULL);
+}
+#endif
+
+/**
Return a number in [0,n-1].
*/
int roll(int n);
Modified: src/mpi_tools/mpi_tools.c
===================================================================
--- src/mpi_tools/mpi_tools.c 2010-04-20 17:42:29 UTC (rev 27)
+++ src/mpi_tools/mpi_tools.c 2010-04-20 18:26:19 UTC (rev 28)
@@ -409,6 +409,27 @@
return d;
}
+/**
+ Read in a whole small file as a string.
+*/
+char*
+file_string(char* file)
+{
+ intmax_t size;
+ struct stat stats;
+
+ stat(file, &stats);
+ size = (intmax_t) stats.st_size;
+ char* result = malloc(size+1);
+
+ FILE* f = fopen(file, "r");
+ int r = fread(result, 1, size, f);
+ assert(r == size);
+ result[size] = '\0';
+ fclose(f);
+ return result;
+}
+
#ifdef ENABLE_DEBUG
#ifdef HAVE_EXEC_INFO_H
/**
Modified: test/mpirpc/module.mk.in
===================================================================
--- test/mpirpc/module.mk.in 2010-04-20 17:42:29 UTC (rev 27)
+++ test/mpirpc/module.mk.in 2010-04-20 18:26:19 UTC (rev 28)
@@ -1,14 +1,18 @@
DIR := test/mpirpc
+# Tests require NODES and REPS variables
+# Usage: make D=1 NODES=2 REPS=1 test/mpirpc/test01.out
+
TEST_MPIRPC_SRC += $(shell find $(DIR) -name "*.c" )
TEST_SRC += $(TEST_MPIRPC_SRC)
+TEST_STATUS += $(DIR)/test02.status
test/mpirpc/test%.out: test/mpirpc/test%.x
+ mpdlistjobs
$(LAUNCH) -n $(NODES) $(<) -c "reps=$(REPS)" > $(@) 2>&1
cp -uv $(@) test/mpirpc/readable.txt
$(DIR)/test%.x: $(DIR)/test%.o $(CMPI)
$(Q) " MPICC $(@) "
$(E)$(MPICC) $(MPE) $(<) $(CMPI) $(LIBS) -o $(@)
-
Modified: test/mpirpc/test01.c
===================================================================
--- test/mpirpc/test01.c 2010-04-20 17:42:29 UTC (rev 27)
+++ test/mpirpc/test01.c 2010-04-20 18:26:19 UTC (rev 28)
@@ -4,8 +4,6 @@
No arguments or return values.
*/
-#include <sys/stat.h>
-
#include <mpirpc.h>
#include "test_helpers.h"
@@ -13,22 +11,6 @@
int count = 0;
bool running = true;
-char*
-file_string(char* file)
-{
- intmax_t size;
- struct stat stats;
-
- 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);
- return result;
-}
-
void
handle_ping(MPIRPC_Node caller, int unique, char* args,
char* blob, int blob_length)
Modified: test/mpirpc/test02.c
===================================================================
--- test/mpirpc/test02.c 2010-04-20 17:42:29 UTC (rev 27)
+++ test/mpirpc/test02.c 2010-04-20 18:26:19 UTC (rev 28)
@@ -2,7 +2,7 @@
/**
Simple two-processor argument test
for NULL, 0-length, and non-0-length args.
- NULL return values.
+ NULL return values.
*/
#include <mpirpc.h>
@@ -13,48 +13,48 @@
{
show_fs(args);
if (args)
- free(args);
- MPIRPC_Null(caller, unique);
+ 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();
+ gossip_set_debug_mask(1, MASK_MPIRPC);
+
+ MPI_Init(&argc, &argv);
+ MPIRPC_Init();
whoami();
- DMALLOC_SETUP(dmalloc_setup());
-
- MPIRPC_Comm_add(MPI_COMM_WORLD);
-
+ 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");
+ MPIRPC_Block(neighbor, "test", "alpha");
}
else
{
- MPIRPC_Node_make(MPI_COMM_WORLD, 0, &neighbor);
- MPIRPC_Register("test", handle_test);
+ MPIRPC_Node_make(MPI_COMM_WORLD, 0, &neighbor);
+ MPIRPC_Register("test", handle_test);
while (! MPIRPC_Check());
while (! MPIRPC_Check());
- while (! MPIRPC_Check());
+ while (! MPIRPC_Check());
}
- printf("Normal exit.\n");
- MPIRPC_Finalize();
+ printf("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;
}
Added: test/mpirpc/test02.zsh
===================================================================
--- test/mpirpc/test02.zsh (rev 0)
+++ test/mpirpc/test02.zsh 2010-04-20 18:26:19 UTC (rev 28)
@@ -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/test02.zsh
___________________________________________________________________
Added: svn:executable
+ *
Modified: test/mpirpc/test_helpers.h
===================================================================
--- test/mpirpc/test_helpers.h 2010-04-20 17:42:29 UTC (rev 27)
+++ test/mpirpc/test_helpers.h 2010-04-20 18:26:19 UTC (rev 28)
@@ -1,14 +0,0 @@
-
-
-#ifdef DMALLOC
-void
-dmalloc_setup(void)
-{
- dmalloc_logpath = malloc(100);
- assert(dmalloc_logpath != NULL);
- sprintf(dmalloc_logpath, "./dmalloc_%i.out", debug_rank);
- printf("dmalloc_logpath: %s \n", dmalloc_logpath);
- fflush(NULL);
-}
-#endif
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <jmw...@us...> - 2010-04-20 19:02:43
|
Revision: 30
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=30&view=rev
Author: jmwozniak
Date: 2010-04-20 19:02:35 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
More test improvements.
Modified Paths:
--------------
Makefile.in
clean.zsh
test/mpirpc/module.mk.in
test/mpirpc/test03.c
Added Paths:
-----------
test/mpirpc/test-ping.c
test/mpirpc/test-ping.zsh
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-20 18:27:27 UTC (rev 29)
+++ Makefile.in 2010-04-20 19:02:35 UTC (rev 30)
@@ -426,9 +426,6 @@
tests: $(CMPI) $(TEST_PROGS)
-%.status: %.out
- $(patsubst %.out, %.zsh, $(<)) $(<)
-
# Obsolete target: delete soon.
cmpi-io-test: $(CMPI_IO) src/cmpi/cmpi-io-test.o
$(Q) " MPICC cmpi-io-test"
@@ -483,6 +480,7 @@
hex unhex hexord unpublish node driver \
$(TEST_OUTPUT) $(TEST_PROGS) $(TEST_OBJS) \
$(CMPI_PROGS) $(CMPI_CP_OBJS) splint.out
+ $(E)find . -name "*.failed" -exec rm -fv \{\} \;
# $(E)find . -name "*.avg" -exec rm -fv \{\} \;
# $(E)find . -name "*.per" -exec rm -fv \{\} \;
Modified: clean.zsh
===================================================================
--- clean.zsh 2010-04-20 18:27:27 UTC (rev 29)
+++ clean.zsh 2010-04-20 19:02:35 UTC (rev 30)
@@ -8,6 +8,7 @@
then
make clean
rm -fv ${MODULES}
+ rm -fv **/*.tmp
rm Makefile
fi
Modified: test/mpirpc/module.mk.in
===================================================================
--- test/mpirpc/module.mk.in 2010-04-20 18:27:27 UTC (rev 29)
+++ test/mpirpc/module.mk.in 2010-04-20 19:02:35 UTC (rev 30)
@@ -10,7 +10,7 @@
test/mpirpc/test%.out: test/mpirpc/test%.x
mpdlistjobs
- $(LAUNCH) -n $(NODES) $(<) -c "reps=$(REPS)" > $(@) 2>&1
+ $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
cp -uv $(@) test/mpirpc/readable.txt
$(DIR)/test%.x: $(DIR)/test%.o $(CMPI)
Added: test/mpirpc/test-ping.c
===================================================================
--- test/mpirpc/test-ping.c (rev 0)
+++ test/mpirpc/test-ping.c 2010-04-20 19:02:35 UTC (rev 30)
@@ -0,0 +1,88 @@
+
+/**
+ 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;
+}
Added: test/mpirpc/test-ping.zsh
===================================================================
--- test/mpirpc/test-ping.zsh (rev 0)
+++ test/mpirpc/test-ping.zsh 2010-04-20 19:02:35 UTC (rev 30)
@@ -0,0 +1,33 @@
+#!/bin/zsh
+
+set -x
+
+# Be sure to make tests with D=1
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+shift
+LAUNCH=${*}
+
+crash()
+{
+ print $1
+ mv ${OUT} ${OUT}.failed
+ exit 1
+}
+
+eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+# Should be 5 calls to handle_ping()...
+N=$( grep -c "handle_ping" ${OUT} )
+(( N == 5 )) || crash "N != 6"
+
+grep "handle_quit" ${OUT} || crash "No handle_quit!"
+
+# Should be 2 "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == 2 )) || crash "N != 2"
+
+exit 0
Property changes on: test/mpirpc/test-ping.zsh
___________________________________________________________________
Added: svn:executable
+ *
Modified: test/mpirpc/test03.c
===================================================================
--- test/mpirpc/test03.c 2010-04-20 18:27:27 UTC (rev 29)
+++ test/mpirpc/test03.c 2010-04-20 19:02:35 UTC (rev 30)
@@ -1,7 +1,7 @@
/**
Simple two-processor argument test
- for non-0-length args and
+ for non-0-length args and
for NULL, 0-length, and non-0-length return values.
*/
@@ -15,7 +15,7 @@
sscanf(args, "%i", &a);
show_fsi(args, a);
char* result = malloc(4);
-
+
if (a == 0)
{
MPIRPC_Null(caller, unique);
@@ -26,56 +26,56 @@
}
else if (a == 2)
{
- strcpy(result, "ok\n");
+ strcpy(result, "ok\n");
MPIRPC_Return(caller, unique, result, 4);
}
-
+
if (args)
- free(args);
+ free(args);
}
int
main(int argc, char* argv[])
{
- gossip_set_debug_mask(1, MASK_MPIRPC);
-
- MPI_Init(&argc, &argv);
- MPIRPC_Init();
+ gossip_set_debug_mask(1, MASK_MPIRPC);
+
+ MPI_Init(&argc, &argv);
+ MPIRPC_Init();
whoami();
- DMALLOC_SETUP(dmalloc_setup());
-
- MPIRPC_Comm_add(MPI_COMM_WORLD);
-
+ DMALLOC_SETUP(dmalloc_setup());
+
+ MPIRPC_Comm_add(MPI_COMM_WORLD);
+
MPIRPC_Node neighbor;
if (mpi_rank == 0)
{
- char* result;
+ char* result;
MPIRPC_Node_make(MPI_COMM_WORLD, 1, &neighbor);
result = MPIRPC_Block(neighbor, "test", "0");
- show_s(result);
+ show_s(result);
result = MPIRPC_Block(neighbor, "test", "1");
- show_s(result);
+ show_s(result);
result = MPIRPC_Block(neighbor, "test", "2");
- show_s(result);
+ show_s(result);
}
else
{
- MPIRPC_Node_make(MPI_COMM_WORLD, 0, &neighbor);
- MPIRPC_Register("test", handle_test);
+ MPIRPC_Node_make(MPI_COMM_WORLD, 0, &neighbor);
+ MPIRPC_Register("test", handle_test);
while (! MPIRPC_Check());
while (! MPIRPC_Check());
- while (! MPIRPC_Check());
+ while (! MPIRPC_Check());
}
- printf("Normal exit.\n");
- MPIRPC_Finalize();
+ printf("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.
|
|
From: <jmw...@us...> - 2010-04-20 19:25:59
|
Revision: 32
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=32&view=rev
Author: jmwozniak
Date: 2010-04-20 19:25:54 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Better name.
Added Paths:
-----------
test/mpirpc/test-returns.c
Removed Paths:
-------------
test/mpirpc/test03.c
Copied: test/mpirpc/test-returns.c (from rev 30, test/mpirpc/test03.c)
===================================================================
--- test/mpirpc/test-returns.c (rev 0)
+++ test/mpirpc/test-returns.c 2010-04-20 19:25:54 UTC (rev 32)
@@ -0,0 +1,81 @@
+
+/**
+ Simple two-processor argument test
+ for non-0-length args and
+ for NULL, 0-length, and non-0-length return values.
+*/
+
+#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);
+ char* result = malloc(4);
+
+ if (a == 0)
+ {
+ MPIRPC_Null(caller, unique);
+ }
+ else if (a == 1)
+ {
+ MPIRPC_Return(caller, unique, result, 0);
+ }
+ else if (a == 2)
+ {
+ strcpy(result, "ok\n");
+ MPIRPC_Return(caller, unique, result, 4);
+ }
+
+ 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* result;
+ MPIRPC_Node_make(MPI_COMM_WORLD, 1, &neighbor);
+ result = MPIRPC_Block(neighbor, "test", "0");
+ show_s(result);
+ result = MPIRPC_Block(neighbor, "test", "1");
+ show_s(result);
+ result = MPIRPC_Block(neighbor, "test", "2");
+ show_s(result);
+ }
+ 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-returns.c
___________________________________________________________________
Added: svn:mergeinfo
+
Deleted: test/mpirpc/test03.c
===================================================================
--- test/mpirpc/test03.c 2010-04-20 19:21:09 UTC (rev 31)
+++ test/mpirpc/test03.c 2010-04-20 19:25:54 UTC (rev 32)
@@ -1,81 +0,0 @@
-
-/**
- Simple two-processor argument test
- for non-0-length args and
- for NULL, 0-length, and non-0-length return values.
-*/
-
-#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);
- char* result = malloc(4);
-
- if (a == 0)
- {
- MPIRPC_Null(caller, unique);
- }
- else if (a == 1)
- {
- MPIRPC_Return(caller, unique, result, 0);
- }
- else if (a == 2)
- {
- strcpy(result, "ok\n");
- MPIRPC_Return(caller, unique, result, 4);
- }
-
- 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* result;
- MPIRPC_Node_make(MPI_COMM_WORLD, 1, &neighbor);
- result = MPIRPC_Block(neighbor, "test", "0");
- show_s(result);
- result = MPIRPC_Block(neighbor, "test", "1");
- show_s(result);
- result = MPIRPC_Block(neighbor, "test", "2");
- show_s(result);
- }
- 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;
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-20 20:27:24
|
Revision: 135
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=135&view=rev
Author: jmwozniak
Date: 2010-05-20 20:27:18 +0000 (Thu, 20 May 2010)
Log Message:
-----------
Put DMALLOC into a couple more tests
Modified Paths:
--------------
include/mpi_tools.h
test/adts/test-inlist.c
test/mpirpc/test-blob.c
Modified: include/mpi_tools.h
===================================================================
--- include/mpi_tools.h 2010-05-20 20:09:39 UTC (rev 134)
+++ include/mpi_tools.h 2010-05-20 20:27:18 UTC (rev 135)
@@ -343,6 +343,7 @@
void dmalloc_setup(void);
#else
#define DMALLOC_SETUP(x)
+#define dmalloc_setup(x)
#endif
/**
Modified: test/adts/test-inlist.c
===================================================================
--- test/adts/test-inlist.c 2010-05-20 20:09:39 UTC (rev 134)
+++ test/adts/test-inlist.c 2010-05-20 20:27:18 UTC (rev 135)
@@ -5,23 +5,27 @@
#include <inlist.h>
+#include "test_helpers.h"
+
int
main(int argc, char* argv[])
{
MPI_Init(&argc, &argv);
whoami();
- char* s = malloc(30);
- strcpy(s, " 1 4 2 ");
+ dmalloc_setup();
+ char* s = " 1 4 2 ";
+
struct inlist* L = inlist_parse(s);
inlist_printf(L);
inlist_free(L);
- free(s);
MPI_Finalize();
+ TEST_DMALLOC;
+
return 0;
}
Modified: test/mpirpc/test-blob.c
===================================================================
--- test/mpirpc/test-blob.c 2010-05-20 20:09:39 UTC (rev 134)
+++ test/mpirpc/test-blob.c 2010-05-20 20:27:18 UTC (rev 135)
@@ -7,6 +7,8 @@
#include <mpirpc.h>
+#include "test_helpers.h"
+
void
handle_test(MPIRPC_Node caller, int unique, char* args,
char* blob, int blob_length)
@@ -64,10 +66,7 @@
MPIRPC_Finalize();
MPI_Finalize();
- DMALLOC_SETUP(if (mpi_rank == 0)
- {
- SHOW_S(dmalloc_logpath);
- dmalloc_shutdown();
- });
+ TEST_DMALLOC;
+
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 19:54:29
|
Revision: 35
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=35&view=rev
Author: jmwozniak
Date: 2010-04-20 19:54:23 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Improve test04.c
Modified Paths:
--------------
test/mpirpc/module.mk.in
test/mpirpc/test04.c
Modified: test/mpirpc/module.mk.in
===================================================================
--- test/mpirpc/module.mk.in 2010-04-20 19:34:10 UTC (rev 34)
+++ test/mpirpc/module.mk.in 2010-04-20 19:54:23 UTC (rev 35)
@@ -7,7 +7,7 @@
TEST_MPIRPC_SRC += $(shell find $(DIR) -name "*.c" )
TEST_SRC += $(TEST_MPIRPC_SRC)
TEST_STATUS += $(DIR)/test02.status
-TEST_OUTPUT += $(patsubst %.x, %.out, $(TEST_MPIRPC_SRC))
+TEST_OUTPUT += $(patsubst %.c, %.out, $(TEST_MPIRPC_SRC))
test/mpirpc/test%.out: test/mpirpc/test%.x
mpdlistjobs
Modified: test/mpirpc/test04.c
===================================================================
--- test/mpirpc/test04.c 2010-04-20 19:34:10 UTC (rev 34)
+++ test/mpirpc/test04.c 2010-04-20 19:54:23 UTC (rev 35)
@@ -1,8 +1,8 @@
/**
Simple two-processor argument test
- for non-0-length args and
- for non-0-length blobs.
+ for non-0-length args and
+ for non-0-length blobs.
*/
#include <mpirpc.h>
@@ -14,33 +14,32 @@
int a;
sscanf(args, "%i", &a);
show_fsi(args, a);
- // char* result = malloc(4);
- char filename[30];
- sprintf(filename, "test04_%i.out", a);
+ assert(blob[0] == '\n');
+ assert(blob[1] == '\0');
+ assert(blob[2] == '\t');
+ assert(blob[3] == '\n');
- FILE* file = fopen(filename, "w");
- fwrite(blob, 1, blob_length, file);
- fclose(file);
-
+ NOTE("asserts ok");
+
MPIRPC_Null(caller, unique);
if (args)
- free(args);
+ free(args);
}
int
main(int argc, char* argv[])
{
- gossip_set_debug_mask(1, MASK_MPIRPC);
-
- MPI_Init(&argc, &argv);
- MPIRPC_Init();
+ gossip_set_debug_mask(1, MASK_MPIRPC);
+
+ MPI_Init(&argc, &argv);
+ MPIRPC_Init();
whoami();
- DMALLOC_SETUP(dmalloc_setup());
-
- MPIRPC_Comm_add(MPI_COMM_WORLD);
-
+ DMALLOC_SETUP(dmalloc_setup());
+
+ MPIRPC_Comm_add(MPI_COMM_WORLD);
+
MPIRPC_Node neighbor;
if (mpi_rank == 0)
{
@@ -48,29 +47,27 @@
blob[0] = '\n';
blob[1] = '\0';
blob[2] = '\t';
- blob[3] = '\n';
- char* result;
+ 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);
+ 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);
+ 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();
+ 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.
|
|
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.
|
|
From: <jmw...@us...> - 2010-04-20 19:58:28
|
Revision: 37
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=37&view=rev
Author: jmwozniak
Date: 2010-04-20 19:58:22 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Additional MPIRPC test processing.
Added Paths:
-----------
test/mpirpc/test-blob.zsh
test/mpirpc/test-returns.zsh
Added: test/mpirpc/test-blob.zsh
===================================================================
--- test/mpirpc/test-blob.zsh (rev 0)
+++ test/mpirpc/test-blob.zsh 2010-04-20 19:58:22 UTC (rev 37)
@@ -0,0 +1,35 @@
+#!/bin/zsh
+
+# set -x
+
+# Be sure to make tests with D=1
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+shift
+LAUNCH=${*}
+
+crash()
+{
+ print $1
+ mv ${OUT} ${OUT}.failed
+ exit 1
+}
+
+eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+TOKENS=("asserts ok"
+ "result: (null)" )
+
+for T in ${TOKENS}
+do
+ grep ${T} ${OUT} || crash "Not found: ${T}"
+done
+
+# Should be 2 "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == 2 )) || crash "N != 2"
+
+exit 0
Property changes on: test/mpirpc/test-blob.zsh
___________________________________________________________________
Added: svn:executable
+ *
Added: test/mpirpc/test-returns.zsh
===================================================================
--- test/mpirpc/test-returns.zsh (rev 0)
+++ test/mpirpc/test-returns.zsh 2010-04-20 19:58:22 UTC (rev 37)
@@ -0,0 +1,31 @@
+#!/bin/zsh
+
+set -x
+
+# Be sure to make tests with D=1
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+shift
+LAUNCH=${*}
+
+crash()
+{
+ print $1
+ mv ${OUT} ${OUT}.failed
+ exit 1
+}
+
+eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+TOKENS=("result: ok"
+ "result: (null)" )
+
+for T in ${TOKENS}
+do
+ grep ${T} ${OUT} || crash "Not found: ${T}"
+done
+
+exit 0
Property changes on: test/mpirpc/test-returns.zsh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-20 20:09:45
|
Revision: 134
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=134&view=rev
Author: jmwozniak
Date: 2010-05-20 20:09:39 +0000 (Thu, 20 May 2010)
Log Message:
-----------
Check for unfreed memory- correction to test-returns.c
Modified Paths:
--------------
test/mpirpc/test-ping.c
test/mpirpc/test-returns.c
test/mpirpc/test_helpers.h
Modified: test/mpirpc/test-ping.c
===================================================================
--- test/mpirpc/test-ping.c 2010-05-20 19:32:34 UTC (rev 133)
+++ test/mpirpc/test-ping.c 2010-05-20 20:09:39 UTC (rev 134)
@@ -80,11 +80,7 @@
MPIRPC_Finalize();
MPI_Finalize();
- DMALLOC_SETUP(if (mpi_rank == 0)
- {
- SHOW_S(dmalloc_logpath);
- dmalloc_shutdown();
- dmalloc_log_unfreed();
- });
+ TEST_DMALLOC;
+
return 0;
}
Modified: test/mpirpc/test-returns.c
===================================================================
--- test/mpirpc/test-returns.c 2010-05-20 19:32:34 UTC (rev 133)
+++ test/mpirpc/test-returns.c 2010-05-20 20:09:39 UTC (rev 134)
@@ -7,6 +7,8 @@
#include <mpirpc.h>
+#include "test_helpers.h"
+
void
handle_test(MPIRPC_Node caller, int unique, char* args,
char* blob, int blob_length)
@@ -54,10 +56,16 @@
MPIRPC_Node_make(MPI_COMM_WORLD, 1, &neighbor);
result = MPIRPC_Block(neighbor, "test", "0");
show_s(result);
+ if (result)
+ free(result);
result = MPIRPC_Block(neighbor, "test", "1");
show_s(result);
+ if (result)
+ free(result);
result = MPIRPC_Block(neighbor, "test", "2");
show_s(result);
+ if (result)
+ free(result);
}
else
{
@@ -72,10 +80,7 @@
MPIRPC_Finalize();
MPI_Finalize();
- DMALLOC_SETUP(if (mpi_rank == 0)
- {
- SHOW_S(dmalloc_logpath);
- dmalloc_shutdown();
- });
+ TEST_DMALLOC;
+
return 0;
}
Modified: test/mpirpc/test_helpers.h
===================================================================
--- test/mpirpc/test_helpers.h 2010-05-20 19:32:34 UTC (rev 133)
+++ test/mpirpc/test_helpers.h 2010-05-20 20:09:39 UTC (rev 134)
@@ -0,0 +1,8 @@
+
+#define TEST_DMALLOC DMALLOC_SETUP(if (mpi_rank == 0) \
+ { \
+ SHOW_S(dmalloc_logpath); \
+ dmalloc_shutdown(); \
+ /* free(dmalloc_logpath); */ \
+ dmalloc_log_unfreed(); \
+ });
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-24 03:33:56
|
Revision: 149
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=149&view=rev
Author: jmwozniak
Date: 2010-05-24 03:33:50 +0000 (Mon, 24 May 2010)
Log Message:
-----------
Bug fixes
Modified Paths:
--------------
src/dense-1/dense.c
src/mpirpc/mpirpc.c
test/cmpi/test-putget.c
test/mpirpc/test-blob.c
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2010-05-24 00:34:01 UTC (rev 148)
+++ src/dense-1/dense.c 2010-05-24 03:33:50 UTC (rev 149)
@@ -167,7 +167,7 @@
MPIRPC* rpc = MPIRPC_Call_blob(node, "store", key,
value, length,
- NULL, MPIRPC_Destroy);
+ NULL, MPIRPC_PROCEED_NULL);
return rpc;
}
@@ -185,7 +185,7 @@
MPIRPC* rpc = MPIRPC_Call_blob(node, "update", args,
value, length,
- NULL, MPIRPC_Destroy);
+ NULL, MPIRPC_PROCEED_NULL);
return rpc;
}
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2010-05-24 00:34:01 UTC (rev 148)
+++ src/mpirpc/mpirpc.c 2010-05-24 03:33:50 UTC (rev 149)
@@ -593,6 +593,7 @@
char*
MPIRPC_Wait(MPIRPC* rpc)
{
+ int unique = rpc->unique;
if (rpc->status == MPIRPC_STATUS_RETURNED)
return rpc->result;
do
@@ -600,7 +601,7 @@
while (! MPIRPC_Check())
MPIRPC_Snooze();
MPIRPC_Snooze_reset();
- if (rpc->status == MPIRPC_STATUS_RETURNED)
+ if (! itable_search(rpctable, unique))
return rpc->result;
else
NOTE("Wait(): handled, still waiting...");
@@ -700,19 +701,6 @@
void
MPIRPC_Value_free(MPIRPC_Value* value)
{
- // SHOW_FP(value);
-
- for (int i = 0; i < 3; i++)
- {
- // SHOW_FI(i);
- //NOTE_P("request : ", &value->request[i]);
- //MPI_Request_free(&value->request[i]);
- }
-
- NOTE("freeing last request:");
- if (value->length > 0)
- ;//MPI_Request_free(&value->request[3]);
-
if (value->result)
{
NOTE_S("Free result: ", value->result);
Modified: test/cmpi/test-putget.c
===================================================================
--- test/cmpi/test-putget.c 2010-05-24 00:34:01 UTC (rev 148)
+++ test/cmpi/test-putget.c 2010-05-24 03:33:50 UTC (rev 149)
@@ -9,7 +9,7 @@
cmpi_client_code()
{
NOTE_F;
-
+
wait_for_notification();
notify_next();
@@ -21,8 +21,6 @@
sleep(mpi_rank);
-
-
char value[30];
strcpy(value, "value1");
cmpi_put(key1, value, strlen(value)+1);
Modified: test/mpirpc/test-blob.c
===================================================================
--- test/mpirpc/test-blob.c 2010-05-24 00:34:01 UTC (rev 148)
+++ test/mpirpc/test-blob.c 2010-05-24 03:33:50 UTC (rev 149)
@@ -25,8 +25,6 @@
printf("asserts ok\n");
MPIRPC_Null(caller, unique);
- if (args)
- free(args);
}
int
@@ -36,7 +34,6 @@
MPI_Init(&argc, &argv);
MPIRPC_Init();
- whoami();
DMALLOC_SETUP(dmalloc_setup());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|