Thread: [C-mpi-commits] SF.net SVN: c-mpi:[11] test
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-04-20 04:21:21
|
Revision: 11
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=11&view=rev
Author: jmwozniak
Date: 2010-04-20 04:21:15 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Move to test/mpirpc .
Added Paths:
-----------
test/mpirpc/
Removed Paths:
-------------
test/mpirpc-2/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 16:01:30
|
Revision: 15
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=15&view=rev
Author: jmwozniak
Date: 2010-04-20 16:01:22 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Tests compile.
Modified Paths:
--------------
include/gossip.h
setup.sh
src/gossip/gossip.c
test/cmpi-io/module.mk.in
test/gossip/test02.c
test/gossip/test03.c
Modified: include/gossip.h
===================================================================
--- include/gossip.h 2010-04-20 04:38:49 UTC (rev 14)
+++ include/gossip.h 2010-04-20 16:01:22 UTC (rev 15)
@@ -20,6 +20,23 @@
#ifndef __GOSSIP_H
#define __GOSSIP_H
+#include <errno.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <time.h>
+#include <sys/time.h>
+#ifdef HAVE_EXECINFO_H
+#include <execinfo.h>
+#endif
+#ifdef __GOSSIP_ENABLE_MPI__
+#include <mpi.h>
+#endif
+
#ifndef __KERNEL__
#include <stdint.h>
#include <stdarg.h>
@@ -28,17 +45,19 @@
#include "cmpi-config.h"
// Masks...
-#define MASK_NONE ((uint64_t)0)
-#define MASK_DEBUG ((uint64_t)1 << 1)
-#define MASK_MPIRPC ((uint64_t)1 << 2)
-#define MASK_DHT ((uint64_t)1 << 3)
-#define MASK_ADTS ((uint64_t)1 << 4)
-#define MASK_DRIVER ((uint64_t)1 << 5)
-#define MASK_CMPI ((uint64_t)1 << 6)
-#define MASK_ARCH ((uint64_t)1 << 7)
-#define MASK_STORAGE ((uint64_t)1 << 8)
-#define MASK_KDA ((uint64_t)1 << 9)
-#define MASK_CLIENT ((uint64_t)1 << 12)
+#define MASK_ALL ((uint64_t) -1)
+#define MASK_NONE ((uint64_t) 0)
+#define MASK_DEBUG ((uint64_t) 1 << 1)
+#define MASK_MPIRPC ((uint64_t) 1 << 2)
+#define MASK_DHT ((uint64_t) 1 << 3)
+#define MASK_ADTS ((uint64_t) 1 << 4)
+#define MASK_DRIVER ((uint64_t) 1 << 5)
+#define MASK_CMPI ((uint64_t) 1 << 6)
+#define MASK_ARCH ((uint64_t) 1 << 7)
+#define MASK_STORAGE ((uint64_t) 1 << 8)
+#define MASK_KDA ((uint64_t) 1 << 9)
+#define MASK_EXAMPLE ((uint64_t) 1 << 10)
+#define MASK_CLIENT ((uint64_t) 1 << 12)
/********************************************************************
* Visible interface
@@ -57,6 +76,18 @@
};
#define GOSSIP_LOGSTAMP_DEFAULT GOSSIP_LOGSTAMP_MPI
+#define gossip_debug_init() \
+do {\
+ char* __mask_str; \
+ uint64_t __mask; \
+ __mask_str = getenv("CMPI_DEBUG_MASK"); \
+ __mask = (__mask_str ? gossip_set_debug_mask_human(__mask_str) : 0); \
+ gossip_set_debug_mask(1, __mask); \
+}while(0)
+
+uint64_t gossip_set_debug_mask_human(
+ const char *event_logging);
+
/* Keep a simplified version for the kmod */
#ifdef __KERNEL__
Modified: setup.sh
===================================================================
--- setup.sh 2010-04-20 04:38:49 UTC (rev 14)
+++ setup.sh 2010-04-20 16:01:22 UTC (rev 15)
@@ -4,9 +4,11 @@
mkdir -p maint/config
-if [[ -f configure &&
- ! configure.ac -nt configure ]]
+if [[ ! -f configure ||
+ configure.ac -nt configure ]]
then
+ echo "regenerating..."
+else
echo "CMPI configure is up-to-date"
exit 2
fi
Modified: src/gossip/gossip.c
===================================================================
--- src/gossip/gossip.c 2010-04-20 04:38:49 UTC (rev 14)
+++ src/gossip/gossip.c 2010-04-20 16:01:22 UTC (rev 15)
@@ -8,32 +8,11 @@
* \ingroup gossip
*
* Implementation of gossip interface.
+ * Handles debugging output.
*/
-// #include "cmpi-config.h"
+#include <gossip.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <errno.h>
-#include <syslog.h>
-#include <stdlib.h>
-#include <time.h>
-#include <sys/time.h>
-#ifdef HAVE_EXECINFO_H
-#include <execinfo.h>
-#endif
-#ifdef __GOSSIP_ENABLE_MPI__
-#include <mpi.h>
-#endif
-
-#include "gossip.h"
-
-#if 0
-#include "gen-locks.h"
-#endif
-
/** controls whether debugging is on or off */
int gossip_debug_on = 0;
@@ -200,7 +179,7 @@
return ret;
}
-/** Fills in args indicating whether debugging is on or off, and what the
+/** Fills in args indicating whether debugging is on or off, and what the
* mask level is.
*
* \return 0 on success, -errno on failure.
@@ -249,7 +228,7 @@
#ifndef __GNUC__
/* __gossip_debug_stub()
- *
+ *
* stub for gossip_debug that doesn't do anything; used when debugging
* is "compiled out" on non-gcc builds
*
@@ -267,7 +246,7 @@
/* __gossip_debug()
- *
+ *
* Logs a standard debugging message. It will not be printed unless the
* mask value matches (logical "and" operation) with the mask specified in
* gossip_set_debug_mask() and debugging is turned on.
@@ -300,7 +279,7 @@
int ret = -EINVAL;
/* NOTE: this check happens in the macro (before making a function call)
- * if we use gcc
+ * if we use gcc
*/
#ifndef __GNUC__
/* exit quietly if we aren't meant to print */
@@ -409,7 +388,7 @@
*/
/* gossip_debug_syslog()
- *
+ *
* This is the standard debugging message function for the syslog logging
* facility
*
@@ -440,7 +419,7 @@
return 0;
}
-int gossip_debug_fp(FILE *fp, char prefix,
+int gossip_debug_fp(FILE *fp, char prefix,
enum gossip_logstamp ts, const char *format, ...)
{
int ret;
@@ -454,7 +433,7 @@
}
/* gossip_debug_fp_va()
- *
+ *
* This is the standard debugging message function for the file logging
* facility or to stderr.
*
@@ -496,7 +475,7 @@
tp = tv.tv_sec;
strftime(bptr, 9, "%H:%M:%S", localtime(&tp));
#if 0
- sprintf(bptr+8, ".%06ld (%ld)] ", (long)tv.tv_usec,
+ sprintf(bptr+8, ".%06ld (%ld)] ", (long)tv.tv_usec,
gen_thread_self());
#endif
/* CUT OUT THREAD -- RBR, 12/18/2007 */
@@ -542,7 +521,7 @@
}
/* gossip_err_syslog()
- *
+ *
* error message function for the syslog logging facility
*
* returns 0 on success, -errno on failure
@@ -566,7 +545,7 @@
/* gossip_disable_stderr()
- *
+ *
* The shutdown function for the stderr logging facility.
*
* returns 0 on success, -errno on failure
@@ -579,7 +558,7 @@
}
/* gossip_disable_file()
- *
+ *
* The shutdown function for the file logging facility.
*
* returns 0 on success, -errno on failure
@@ -596,7 +575,7 @@
}
/* gossip_disable_syslog()
- *
+ *
* The shutdown function for the syslog logging facility.
*
* returns 0 on success, -errno on failure
@@ -608,7 +587,93 @@
return 0;
}
+
+/* a private internal type */
+typedef struct
+{
+ const char *keyword;
+ uint64_t mask_val;
+} __keyword_mask_t;
+
+
+
+/* map all config keywords to pvfs2 debug masks here */
+static __keyword_mask_t s_keyword_mask_map[] =
+{
+ /* example level until we have real masks */
+ { "example", MASK_EXAMPLE },
+
+ /* NOTE: add additional levels here */
+
+ /* No debug output */
+ { "none", MASK_NONE },
+ /* Everything */
+ { "all", MASK_ALL }
+};
+#undef __DEBUG_ALL
+
+static const int num_keyword_mask_map = (int) \
+(sizeof(s_keyword_mask_map) / sizeof(__keyword_mask_t));
+
+static uint64_t debug_to_mask(__keyword_mask_t *mask_map,
+ int num_mask_map, const char *event_logging)
+{
+ uint64_t mask = 0;
+ char *s = NULL, *t = NULL;
+ const char *toks = ", ";
+ int i = 0, negate = 0;
+
+ if (event_logging)
+ {
+ s = strdup(event_logging);
+ t = strtok(s, toks);
+
+ while(t)
+ {
+ if (*t == '-')
+ {
+ negate = 1;
+ ++t;
+ }
+
+ for(i = 0; i < num_mask_map; i++)
+ {
+ if (!strcmp(t, mask_map[i].keyword))
+ {
+ if (negate)
+ {
+ mask &= ~mask_map[i].mask_val;
+ }
+ else
+ {
+ mask |= mask_map[i].mask_val;
+ }
+ break;
+ }
+ }
+ t = strtok(NULL, toks);
+ }
+ free(s);
+ }
+ return mask;
+}
+
/*
+ * Based on human readable keywords, translate them into
+ * a mask value appropriate for the debugging level desired.
+ * The 'computed' mask is returned; 0 if no keywords are
+ * present or recognized.
+ *
+ * Prefix a keyword with "-" to turn it off. All keywords
+ * processed in specified order.
+ */
+uint64_t gossip_set_debug_mask_human(const char *event_logging)
+{
+ return debug_to_mask(s_keyword_mask_map,
+ num_keyword_mask_map, event_logging);
+}
+
+/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
Modified: test/cmpi-io/module.mk.in
===================================================================
--- test/cmpi-io/module.mk.in 2010-04-20 04:38:49 UTC (rev 14)
+++ test/cmpi-io/module.mk.in 2010-04-20 16:01:22 UTC (rev 15)
@@ -6,7 +6,6 @@
TEST_HELPER_OBJS += test/cmpi/test_helpers.o
-test/cmpi-io/test%.x: test/cmpi-io/test%.o $(CMPI) $(HELPERS)
+test/cmpi-io/test%.x: test/cmpi-io/test%.o $(CMPI) test/cmpi/test_helpers.o
$(Q) " MPICC $(@) "
- $(E)$(MPICC) $(MPE) $(<) $(CMPI) $(HELPERS) $(LIBS) -o $(@)
-
+ $(E)$(MPICC) $(MPE) $(<) $(CMPI) test/cmpi/test_helpers.o $(LIBS) -o $(@)
Modified: test/gossip/test02.c
===================================================================
--- test/gossip/test02.c 2010-04-20 04:38:49 UTC (rev 14)
+++ test/gossip/test02.c 2010-04-20 16:01:22 UTC (rev 15)
@@ -11,16 +11,16 @@
printf(
"This test program will print an example debugging message on the final\n"
-"line of output if the GS_DEBUG_MASK environment variable is set to include\n"
-"\"example\" or \"all\" in its comma seperated list of masks:\n"
+"line of output if the CMPI_DEBUG_MASK environment variable is set to include\n"
+"\"example\" or \"all\" in its comma separated list of masks:\n"
);
- gs_debug_init();
+ gossip_debug_init();
- gossip_debug(GS_D_EXAMPLE, "Example debugging message.\n");
+ gossip_debug(MASK_EXAMPLE, "Example debugging message.\n");
- MPI_Finalize();
- return 0;
+ MPI_Finalize();
+ return 0;
}
/*
Modified: test/gossip/test03.c
===================================================================
--- test/gossip/test03.c 2010-04-20 04:38:49 UTC (rev 14)
+++ test/gossip/test03.c 2010-04-20 16:01:22 UTC (rev 15)
@@ -4,26 +4,26 @@
#include <mpi.h>
#include <gs-debug.h>
-#include <mpi_tools.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 GS_DEBUG_MASK environment variable is set to include\n"
"\"example\" or \"all\" in its comma seperated list of masks:\n"
);
- gs_debug_init();
-
- gossip_do(GS_D_EXAMPLE, NOTE("Hello"));
+ gossip_debug_init();
- MPI_Finalize();
- return 0;
+ gossip_do(MASK_EXAMPLE, NOTE("Hello"));
+
+ MPI_Finalize();
+ 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 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.
|
|
From: <jmw...@us...> - 2010-04-20 17:40:51
|
Revision: 26
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=26&view=rev
Author: jmwozniak
Date: 2010-04-20 17:40:43 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Minor fixes.
Modified Paths:
--------------
Makefile.in
configure.ac
test/gossip/test-do.c
test/gossip/test-env.c
test/mpi_tools/module.mk.in
test/mpi_tools/test01.c
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-20 16:25:13 UTC (rev 25)
+++ Makefile.in 2010-04-20 17:40:43 UTC (rev 26)
@@ -9,16 +9,14 @@
# INPUT CONTROL VARIABLES
# D : if 1, turn on debugging output in CMPI programs
+# G : if 1, certain tests wait for GDB to attach
# T : if 1, turn on MPE printf debugging
# V : if 1, turn on normal make output
-# CONFIGURE OPTIONS
+# NOTABLE CONFIGURE OPTIONS
# 1) DMALLOC
# 2) DISKSIM
-# REQUIREMENTS
-# The current test functionality requires MPICH from SVN
-
# GENERAL DOCUMENTATION
#
# This is a single makefile that runs the entire build process.
@@ -173,7 +171,7 @@
endif
# Used by src/mpi_tools/mpi_tools.c:isqrt()
-LIBS += -l m
+LIBS += -lm
STRICT_CFLAGS = @STRICT_CFLAGS@
@@ -184,11 +182,6 @@
endif
# turn on large file support by default
CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
-# include current directory (for cmpi-config.h)
-# IFLAGS += -I include
-# include gossip directory
-# IFLAGS += -I $(srcdir)/src/common/gossip
-# include toplevel source dir
IFLAGS += -I $(srcdir)
# add selected include directories
IFLAGS += $(patsubst %,-I $(srcdir)/%,$(INCLUDES))
@@ -348,11 +341,6 @@
CMPI_DEPS := $(patsubst %.o,%.d,$(CMPI_OBJS))
-# DEPENDS is a global list of all of our dependency files.
-# NOTE: sort is just a trick to remove duplicates; the order
-# doesn't matter at all.
-# DEPENDS := $(sort $(CMPI_DEPS) $(TEST_DEPS))
-
####################################################################
# Rules and dependencies
@@ -396,69 +384,6 @@
$(E)$(INSTALL) -d lib
$(E)$(MPICC) -shared $< $(CMPI) $(LIBS) -o $@
-$(GOBS): $(GOBS_OBJS) $(GUM_OBJS)
- $(Q) " AR $@"
- $(E)$(INSTALL) -d lib
- $(E)ar rcs $(@) $(^)
-
-$(GACK): $(GACK_OBJS) $(GOBS_OBJS) $(SKULLFS_OBJS) $(GUM_OBJS)
- $(Q) " AR $@"
- $(E)$(INSTALL) -d lib
- $(E)ar rcs $(@) $(^)
-
-$(SKULLFS): $(GACK_OBJS) $(GOBS_OBJS) $(SKULLFS_OBJS) $(GUM_OBJS)
- $(Q) " AR $@"
- $(E)$(INSTALL) -d lib
- $(E)ar rcs $(@) $(^)
-
-# GSL
-GSLFLAGS = $(CFLAGS)
-GSLFLAGS += -Wno-unused-label -Wno-unused-variable -Wno-parentheses
-# GSLFLAGS += $(GSLPRETTY)
-# GSCC = src/gsl/parser/gscc
-GSPARSER = src/gsl/parser/gs-parser
-GSLINCLUDES = -I src/gsl -I src/gsl/resources
-GSLLIBS = -L src/gsl/lib -l gs -l gstest
-
-# default rule for GSL source code
-%.o: %.gs.s
- $(Q) " MPICC $@"
- $(E)$(MPICC) -x c -c -o $(@) $(GSLFLAGS) $(GSLINCLUDES) $(<)
-
-# %.o: %.gs.s
-# $(E)$(call MCC_GS,$<) -I$(srcdir)/include/ -x c -c -o $@ \
-# $(LIBCFLAGS) \
-# $(CFLAGS) $(CWARNS) $(call MODCFLAGS_GS,$<) $<
-
-%.gs.s: %.gs.i $(GSPARSER)
- $(Q) " GS-PARSER $(@)"
- $(E)$(GSPARSER) -o $@ -r $*.gs $(GSLPRETTY) $*.gs.i
-# $(E)rm $*.gs.i
-
-%.gs.i: %.gs %.gs.dummyobj
- $(Q) " CPP $(@)"
- $(E)$(MPICC) $(GSLINCLUDES) $(GSLFLAGS) -x c -E -o $(@) $(<)
-# $(E)rm $*.gs.dummyobj
-
-%.gs.dummyobj: %.gs
- $(Q) " MPICC $(@)"
- $(E)$(MPICC) -D DUMMYOBJ -D__blocking="" \
- -Dpwait="while(0)" -Dpbranch="" -Dpbreak="break"\
- $(GSLINCLUDES) -x c -c -o $(@) $(LIBCFLAGS) \
- -Wall -Wno-implicit -Wno-unused -Werror \
- $(CFLAGS) $(<)
-
-%.gs.flat: %.gs
- $(Q) " CPP $(@)"
- $(E)$(MPICC) -D__blocking="" \
- -Dpwait="while(0)" -Dpbranch="" -Dpbreak="break"\
- $(GSLINCLUDES) -x c -E $(LIBCFLAGS) \
- $(CFLAGS) $(<) > $(@)
-
-
-$(GSPARSER):
- cd src/gsl && ./setup-langc && make && cd ../..
-
## Tools...
driver: src/cmpi/driver.o $(CMPI)
@@ -524,15 +449,6 @@
# $(Q) " CC [PIC] $@"
# $(E)$(CC) $(LIBCFLAGS) $(CFLAGS) $(PICFLAGS) $(call modcflags,$<) $< -c -o $@
-# bison and yacc
-# %.c: %.y
-# $(Q) " BISON $@"
-# $(E)$(BISON) -d $< -o $@
-
-#%.c: %.l
-# $(Q) " FLEX $@"
-# $(E)$(FLEX) -o$@ $<
-
# handy rule to generate cpp-output file, for debugging
.PHONY: FORCE
%.i: %.c FORCE
@@ -542,14 +458,13 @@
tags: TAGS
# Generate TAGS based on only files used by CMPI as configured:
-TAGS: deps.config.txt
+TAGS: deps.txt
$(Q) " TAGS "
- $(E)etags $(ETAGS_FLAGS) `cat deps.config.txt`
-# $(E)etags `cat deps.txt`
+ $(E)etags $(ETAGS_FLAGS) `cat deps.txt`
# Extract all files from *.d files, format and sort:
# Formats to one file per line & extracts junk and extra files in *.d
-deps.config.txt: $(CMPI_DEPS)
+deps.txt: $(CMPI_DEPS)
$(Q) " DEPS.TXT "
$(E) cat $(CMPI_DEPS) | fmt -w 1 | cut -f 1 | \
sed 's/ //g;s/\\//g' | \
@@ -576,10 +491,8 @@
# some stuff that is cleaned in both distclean and dist targets
cleaner: clean
$(Q) " CLEANER"
- $(E)rm -fvr TAGS deps.config.txt \
+ $(E)rm -fvr TAGS deps.txt \
maint/mpi-depend.sh \
- examples/pvfs2-server.rc \
- /doxygen/pvfs2-doxygen.conf \
examples/fs.conf \
autom4te*.cache \
config.h.in~ \
@@ -589,7 +502,7 @@
config.h.in \
autoscan.log \
configure.scan \
- grayskull-config.h*
+ cmpi-config.h*
$(E)find . -name "*.i" -exec rm -fv \{\} \;
$(E)find . -name "*.d" -exec rm -fv \{\} \;
$(E)find . -name "module.mk" -exec rm -fv \{\} \;
@@ -627,12 +540,9 @@
SPLINTOPTS = +posixlib +gnuextensions # -preproc
SPLINT_GS_S := $(shell find . -name "*.gs.s")
-splint: $(ALL_GS_S)
+splint: $(CMPI_SRC)
$(Q) " SPLINT splint.out"
-# $(E) splint $(SPLINTOPTS) $(IFLAGS) -I $(MPI)/include $(CMPI_SRC) > splint.out
- echo $(ALL_GS)
- echo $(ALL_GS_S)
- $(E) splint $(SPLINTOPTS) $(IFLAGS) -I $(MPI)/include $(ALL_GS_S) > splint.out
+ $(E) splint $(SPLINTOPTS) $(IFLAGS) -I $(MPI)/include $(CMPI_SRC) > splint.out
%.p: %.c
$(Q) " CPP $@"
@@ -640,17 +550,11 @@
install:: all install_doc
install -d $(prefix)/include
-# install -m 644 $(srcdir)/include/pvfs2.h $(prefix)/include
-
install -d $(prefix)/lib
-# install -m 755 $(LIBRARIES) $(prefix)/lib
-
+ install -d $(prefix)/bin
ifdef TARGET_OS_DARWIN
# TOC needs to be regenerated in libs after they get moved
ranlib $(patsubst %,$(prefix)/%,$(LIBRARIES))
endif
- install -d $(prefix)/bin
-# install -m 755 $(ADMINTOOLS) $(prefix)/bin
-
null:
Modified: configure.ac
===================================================================
--- configure.ac 2010-04-20 16:25:13 UTC (rev 25)
+++ configure.ac 2010-04-20 17:40:43 UTC (rev 26)
@@ -222,79 +222,6 @@
AC_SUBST(QUIET_COMPILE)
-dnl dnl See if CC is a GNU compiler. This may require a real test in future
-dnl dnl versions of autoconf. In 2.13 it is a side-effect of AC_PROG_CC. First
-dnl dnl check if it is an Intel compiler; those lie and claim to be gcc but are
-dnl dnl not argument compatible
-dnl INTELC=
-dnl GNUC=
-dnl AC_MSG_CHECKING(whether cc is an Intel compiler)
-dnl AC_TRY_COMPILE([
-dnl #ifndef __ICC
-dnl choke me
-dnl #endif
-dnl ], [],
-dnl AC_MSG_RESULT(yes)
-dnl INTELC=1
-dnl ,
-dnl AC_MSG_RESULT(no)
-dnl )
-dnl if test "x$INTELC" = "x" ; then
-dnl if test "x$GCC" = "xyes" ; then
-dnl GNUC=1
-dnl fi
-dnl fi
-dnl AC_SUBST(INTELC)
-dnl AC_SUBST(GNUC)
-
-AC_ARG_WITH(efence,
-[ --with-efence=<path> Use electric fence for malloc debugging.],
- if test "x$withval" != "xyes" ; then
- LDFLAGS="${LDFLAGS} -L$withval"
- fi
- AC_CHECK_LIB(efence,malloc)
-)
-
-dnl Use compiled-in valgrind annotations? Give the header path if
-dnl is not in the usual location. It is common to install the header
-dnl in a subdirectory, so look for that too. Leave the include path
-dnl in CPPFLAGS if it is not a standard header.
-AC_ARG_WITH(valgrind,
-[ --with-valgrind[=<path>] Use valgrind annotations for debugging.], [
- found=no
- save_cppflags="$CPPFLAGS"
- AC_MSG_CHECKING(for valgrind.h usability)
- if test "x$withval" = xyes ; then
- AC_COMPILE_IFELSE([#include <valgrind.h>], found=yes)
- if test x$found = xno ; then
- CPPFLAGS="$CPPFLAGS -I/usr/include/valgrind"
- AC_COMPILE_IFELSE([#include <valgrind.h>], found=yes,
- CPPFLAGS="$save_cppflags")
- fi
- else
- for d in $withval $withval/include \
- $withval/valgrind $withval/include/valgrind
- do
- CPPFLAGS="$CPPFLAGS -I$d"
- AC_COMPILE_IFELSE([#include <valgrind.h>], found=yes,
- CPPFLAGS="$save_cppflags")
- if test x$found = xyes ; then
- break
- fi
- done
- fi
- AC_MSG_RESULT($found)
- if test x$found = xyes ; then
- AC_DEFINE(HAVE_VALGRIND_H, 1, Define if include file valgrind.h exists)
- fi
-])
-
-dnl create any missing subdirectories that wouldn't be created
-dnl by AC_OUTPUT below (which won't create intermediate dirs).
-for d in src/common test; do
- install -d $d;
-done
-
dnl Check if we are on a SLURM system
AC_CHECK_PROG(HAVE_SRUN, srun, yes, no)
AC_SUBST(HAVE_SRUN)
@@ -446,6 +373,8 @@
)
AC_GCC_SUPPORTS_RDYNAMIC([RDYNAMIC])
+
+dnl Temporarily allow writes to configure-controlled files:
find . -name module.mk -exec chmod u+w "{}" \;
test -f Makefile && chmod u+w Makefile
@@ -478,6 +407,7 @@
AC_OUTPUT
+dnl Disallow writes to configure-controlled files:
find . -name module.mk -exec chmod u-w "{}" \;
chmod u-w Makefile
Modified: test/gossip/test-do.c
===================================================================
--- test/gossip/test-do.c 2010-04-20 16:25:13 UTC (rev 25)
+++ test/gossip/test-do.c 2010-04-20 17:40:43 UTC (rev 26)
@@ -1,9 +1,10 @@
+
/**
- * Test gossip functionality.
+ * Test gossip_do() functionality.
* */
#include <mpi.h>
-#include <gs-debug.h>
+#include <gossip.h>
#include <mpi_tools.h>
int main(int argc, char* argv[])
@@ -28,8 +29,8 @@
/*
* Local variables:
- * c-indent-level: 4
- * c-basic-offset: 4
+ * c-indent-level: 2
+ * c-basic-offset: 2
* End:
*
* vim: ts=8 sts=4 sw=4 expandtab
Modified: test/gossip/test-env.c
===================================================================
--- test/gossip/test-env.c 2010-04-20 16:25:13 UTC (rev 25)
+++ test/gossip/test-env.c 2010-04-20 17:40:43 UTC (rev 26)
@@ -1,3 +1,4 @@
+
/**
* Test gossip functionality.
* */
@@ -3,5 +4,5 @@
#include <mpi.h>
-#include <gs-debug.h>
+#include <gossip.h>
int main(int argc, char* argv[])
Modified: test/mpi_tools/module.mk.in
===================================================================
--- test/mpi_tools/module.mk.in 2010-04-20 16:25:13 UTC (rev 25)
+++ test/mpi_tools/module.mk.in 2010-04-20 17:40:43 UTC (rev 26)
@@ -1,15 +1,12 @@
-ifeq (@USE_COMM_WORLD@,1)
-
TEST_MPITOOLS_SRC += $(shell find test/mpi_tools -name "*.c")
-TEST_SRC += $(TEST_MPITOOLS_SRCS)
+TEST_SRC += $(TEST_MPITOOLS_SRC)
test/mpi_tools/test%.out: test/mpi_tools/test%.x
$(LAUNCH) -n $(NODES) $(<) > $(@) 2>&1
test/mpi_tools/test%.x: test/mpi_tools/test%.o $(CMPI)
- $(Q) " MPICC $(@) "
+ $(Q) " MPICC $(@) "
$(E)$(MPICC) $(MPE) $(<) $(CMPI) $(LIBS) -o $(@)
-endif
Modified: test/mpi_tools/test01.c
===================================================================
--- test/mpi_tools/test01.c 2010-04-20 16:25:13 UTC (rev 25)
+++ test/mpi_tools/test01.c 2010-04-20 17:40:43 UTC (rev 26)
@@ -1,6 +1,6 @@
/**
- Test math functions.
+ Test math functions and simple output.
*/
#include <mpi_tools.h>
@@ -8,12 +8,18 @@
int
main(int argc, char* argv[])
{
+ MPI_Init(&argc, &argv);
+
+ whoami();
+
int i;
for (i = 0; i < 20; i++)
{
SHOW_II(i, ilog2(i));
SHOW_II(i, isqrt(i));
}
-
- return 0;
+
+ MPI_Finalize();
+
+ 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:21:16
|
Revision: 31
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=31&view=rev
Author: jmwozniak
Date: 2010-04-20 19:21:09 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Improve gossip tests.
Modified Paths:
--------------
Makefile.in
test/gossip/module.mk.in
test/gossip/test-do.c
test/gossip/test-env.c
test/mpirpc/module.mk.in
Added Paths:
-----------
test/gossip/test-do.zsh
test/gossip/test-env.zsh
test/gossip/test-masks.zsh
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-20 19:02:35 UTC (rev 30)
+++ Makefile.in 2010-04-20 19:21:09 UTC (rev 31)
@@ -480,7 +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 "*.failed" -exec rm -fv \{\} \;
# $(E)find . -name "*.avg" -exec rm -fv \{\} \;
# $(E)find . -name "*.per" -exec rm -fv \{\} \;
Modified: test/gossip/module.mk.in
===================================================================
--- test/gossip/module.mk.in 2010-04-20 19:02:35 UTC (rev 30)
+++ test/gossip/module.mk.in 2010-04-20 19:21:09 UTC (rev 31)
@@ -1,6 +1,11 @@
-TEST_SRC += $(shell find test/gossip -name "*.c")
+DIR := test/gossip
-test/gossip/test%.x: test/gossip/test%.o $(CMPI)
+TEST_SRC += $(shell find $(DIR) -name "*.c")
+
+$(DIR)/test%.x: $(DIR)/test%.o $(CMPI)
$(Q) " LINK $(@) "
$(E)$(MPICC) $(<) $(CMPI) $(LIBS) -o $(@)
+
+$(DIR)/test%.out: $(DIR)/test%.x
+ $(patsubst %.x, %.zsh, $(<)) $(<)
Modified: test/gossip/test-do.c
===================================================================
--- test/gossip/test-do.c 2010-04-20 19:02:35 UTC (rev 30)
+++ test/gossip/test-do.c 2010-04-20 19:21:09 UTC (rev 31)
@@ -16,12 +16,12 @@
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"
+"\"example\" or \"all\" in its comma separated list of masks:\n"
);
gossip_debug_init();
- gossip_do(MASK_EXAMPLE, printf("Hello\n"));
+ gossip_do(MASK_EXAMPLE, printf("EXAMPLE MESSAGE\n"));
MPI_Finalize();
return 0;
Added: test/gossip/test-do.zsh
===================================================================
--- test/gossip/test-do.zsh (rev 0)
+++ test/gossip/test-do.zsh 2010-04-20 19:21:09 UTC (rev 31)
@@ -0,0 +1,37 @@
+#!/bin/zsh
+
+set -x
+
+# Be sure to make tests with D=1
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+
+crash()
+{
+ print $1
+ mv ${OUT} ${OUT}.failed
+ exit 1
+}
+
+${PROGRAM} > ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+# Should be 3 "test program"s
+N=$( grep -c "test program" ${OUT} )
+(( N == 3 )) || crash "N != 3"
+
+# Should be 2 "EXAMPLE MESSAGE"s
+N=$( grep -c "EXAMPLE MESSAGE" ${OUT} )
+(( N == 2 )) || crash "N != 2"
+
+exit 0
Property changes on: test/gossip/test-do.zsh
___________________________________________________________________
Added: svn:executable
+ *
Modified: test/gossip/test-env.c
===================================================================
--- test/gossip/test-env.c 2010-04-20 19:02:35 UTC (rev 30)
+++ test/gossip/test-env.c 2010-04-20 19:21:09 UTC (rev 31)
@@ -18,7 +18,7 @@
gossip_debug_init();
- gossip_debug(MASK_EXAMPLE, "Example debugging message.\n");
+ gossip_debug(MASK_EXAMPLE, "EXAMPLE MESSAGE\n");
MPI_Finalize();
return 0;
Added: test/gossip/test-env.zsh
===================================================================
--- test/gossip/test-env.zsh (rev 0)
+++ test/gossip/test-env.zsh 2010-04-20 19:21:09 UTC (rev 31)
@@ -0,0 +1,37 @@
+#!/bin/zsh
+
+set -x
+
+# Be sure to make tests with D=1
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+
+crash()
+{
+ print $1
+ mv ${OUT} ${OUT}.failed
+ exit 1
+}
+
+${PROGRAM} > ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+# Should be 3 "test program"s
+N=$( grep -c "test program" ${OUT} )
+(( N == 3 )) || crash "N != 3"
+
+# Should be 2 "Example debugging message."s
+N=$( grep -c "Example debugging message." ${OUT} )
+(( N == 2 )) || crash "N != 2"
+
+exit 0
Property changes on: test/gossip/test-env.zsh
___________________________________________________________________
Added: svn:executable
+ *
Added: test/gossip/test-masks.zsh
===================================================================
--- test/gossip/test-masks.zsh (rev 0)
+++ test/gossip/test-masks.zsh 2010-04-20 19:21:09 UTC (rev 31)
@@ -0,0 +1,29 @@
+#!/bin/zsh
+
+set -x
+
+# Be sure to make tests with D=1
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+
+crash()
+{
+ print $1
+ mv ${OUT} ${OUT}.failed
+ exit 1
+}
+
+${PROGRAM} > ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+# Should be 4 "Debug mask"s
+N=$( grep -c "Debug mask" ${OUT} )
+(( N == 4 )) || crash "N != 4"
+
+# Should be 2 line outputs
+N=$( grep -c "test-masks.c main.*Debug mask" ${OUT} )
+(( N == 2 )) || crash "N != 2"
+
+exit 0
Property changes on: test/gossip/test-masks.zsh
___________________________________________________________________
Added: svn:executable
+ *
Modified: test/mpirpc/module.mk.in
===================================================================
--- test/mpirpc/module.mk.in 2010-04-20 19:02:35 UTC (rev 30)
+++ test/mpirpc/module.mk.in 2010-04-20 19:21:09 UTC (rev 31)
@@ -7,6 +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/mpirpc/test%.out: test/mpirpc/test%.x
mpdlistjobs
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-28 20:28:38
|
Revision: 42
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=42&view=rev
Author: jmwozniak
Date: 2010-04-28 20:28:31 +0000 (Wed, 28 Apr 2010)
Log Message:
-----------
Fixing test/cmpi/test06, add some docs.
Modified Paths:
--------------
include/mpirpc.h
src/mpirpc/mpirpc.c
test/adts/test-lru_table02.c
test/cmpi/module.mk.in
test/cmpi/test-startup.zsh
test/cmpi/test06.c
test/cmpi/test_helpers.c
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2010-04-28 20:27:32 UTC (rev 41)
+++ include/mpirpc.h 2010-04-28 20:28:31 UTC (rev 42)
@@ -48,7 +48,7 @@
char args[MPIRPC_MAX_ARGS];
char* blob;
int blob_length;
- char* result;
+ void* result;
int result_length;
void* extras;
void (*proceed) (struct mpirpc* rpc);
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2010-04-28 20:27:32 UTC (rev 41)
+++ src/mpirpc/mpirpc.c 2010-04-28 20:28:31 UTC (rev 42)
@@ -738,8 +738,8 @@
}
/**
- Free the RPC and its args
- except for the result and extras once it completes.
+ Frees: the RPC and args.
+ Does not free: the result, extras, and the blob.
Must be called by the user (usually in the proceed function).
*/
void
Modified: test/adts/test-lru_table02.c
===================================================================
--- test/adts/test-lru_table02.c 2010-04-28 20:27:32 UTC (rev 41)
+++ test/adts/test-lru_table02.c 2010-04-28 20:28:31 UTC (rev 42)
@@ -22,9 +22,9 @@
lru_table_printf("%s", table);
char* data1 = "data1";
char* data2 = "data2";
- lru_table_add(table, "key1", strdup(data1), strlen(data1)+1);
+ lru_table_add(table, "key1", heap(data1), strlen(data1)+1);
lru_table_printf("%s", table);
- lru_table_add(table, "key2", strdup(data2), strlen(data2)+1);
+ lru_table_add(table, "key2", heap(data2), strlen(data2)+1);
lru_table_printf("%s", table);
char* overwrite = "XJKLJKL";
Modified: test/cmpi/module.mk.in
===================================================================
--- test/cmpi/module.mk.in 2010-04-28 20:27:32 UTC (rev 41)
+++ test/cmpi/module.mk.in 2010-04-28 20:28:31 UTC (rev 42)
@@ -9,7 +9,7 @@
# is actually called.
TEST_CMPI_SRC += $(shell find test/cmpi -name "*.c" ! -name test_helpers.c)
-TEST_SRC += $(TEST_CMPI_SRCS)
+TEST_SRC += $(TEST_CMPI_SRC)
TEST_HELPER_SRC += test/cmpi/test_helpers.c
ifeq (@USE_COMM_WORLD@,1)
@@ -19,14 +19,14 @@
$(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
test/cmpi/test%.x: test/cmpi/test%.o test/cmpi/test_helpers.o src/cmpi/node.o $(CMPI)
- $(Q) " MPICC $(@) "
+ $(Q) " LINK $(@) "
$(E)$(MPICC) $(MPE) $(<) test/cmpi/test_helpers.o src/cmpi/node.o \
$(CMPI) $(LIBS) -o $(@)
else
test/cmpi/test%.x: test/cmpi/test%.o test/cmpi/test_helpers.o src/cmpi/client.o $(CMPI)
- $(Q) " MPICC $(@) "
+ $(Q) " LINK $(@) "
$(E)$(MPICC) $(MPE) $(<) test/cmpi/test_helpers.o src/cmpi/client.o $(CMPI) $(LIBS) -o $(@)
endif
Modified: test/cmpi/test-startup.zsh
===================================================================
--- test/cmpi/test-startup.zsh 2010-04-28 20:27:32 UTC (rev 41)
+++ test/cmpi/test-startup.zsh 2010-04-28 20:28:31 UTC (rev 42)
@@ -1,25 +1,16 @@
#!/bin/zsh
+# Be sure to make tests with D=1
+
# set -x
-# Be sure to make tests with D=1
+source tools/test-helpers.zsh
PROGRAM=$1
OUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
-crash()
-{
- print $1
- mv ${OUT} ${OUT}.failed
- exit 1
-}
-
-source tools/helpers.zsh
-
-USE_COMM_WORLD=$( grep USE_COMM_WORLD cmpi-config.h | col 3 )
-
if (( USE_COMM_WORLD == 1 ))
then
Modified: test/cmpi/test06.c
===================================================================
--- test/cmpi/test06.c 2010-04-28 20:27:32 UTC (rev 41)
+++ test/cmpi/test06.c 2010-04-28 20:28:31 UTC (rev 42)
@@ -1,42 +1,53 @@
/**
- Update two new keys, update those, and retrieve one.
+ Update two new keys, update those, and retrieve one.
*/
-#include "test_helpers.h"
+#include "test_helpers.h"
void
cmpi_client_code()
{
char key1[10];
char key2[10];
- char key3[10];
+ char key3[10];
sprintf(key1, "key1_%i", mpi_rank);
sprintf(key2, "key2_%i", mpi_rank);
sprintf(key3, "key3_%i", mpi_rank);
wait_for_notification();
- notify_next();
-
- cmpi_update(key1, "value1", 0);
- cmpi_update(key2, "value2", 0);
- cmpi_update(key2, "X", 3);
- cmpi_update(key3, "value3", 3);
- cmpi_update(key3, "X", 1);
- cmpi_update(key3, "X", 5);
-
- sleep(2);
+ notify_next();
+ char* value = malloc(64*sizeof(char));
+
+ sprintf(value, "value1");
+ cmpi_update(key1, value, strlen(value)+1, 0);
+ sprintf(value, "value2");
+ cmpi_update(key2, value, strlen(value)+1, 0);
+ sprintf(value, "X");
+ cmpi_update(key2, value, strlen(value)+1, 3);
+ sprintf(value, "value3");
+ cmpi_update(key3, value, strlen(value)+1, 0);
+ sprintf(value, "X");
+ cmpi_update(key3, "X", strlen(value)+1, 1);
+ sprintf(value, "value1");
+ cmpi_update(key3, "X", strlen(value)+1, 3);
+
+ free(value);
+
+ sleep(2);
+
char* result;
- cmpi_get(key1, &result);
- printf("RESULT_1: %s\n", result);
- cmpi_get(key2, &result);
+ int length;
+ cmpi_get(key1, &result, &length);
+ printf("RESULT_1: %s\n", result);
+ cmpi_get(key2, &result, &length);
printf("RESULT_2: %s\n", result);
- cmpi_get(key3, &result);
- printf("RESULT_3: %s\n", result);
- NOTE("GET SUCCEEDED");
-
- sleep(2);
-
- cmpi_shutdown();
+ cmpi_get(key3, &result, &length);
+ printf("RESULT_3: %s\n", result);
+ NOTE("GET SUCCEEDED");
+
+ sleep(2);
+
+ cmpi_shutdown();
}
Modified: test/cmpi/test_helpers.c
===================================================================
--- test/cmpi/test_helpers.c 2010-04-28 20:27:32 UTC (rev 41)
+++ test/cmpi/test_helpers.c 2010-04-28 20:28:31 UTC (rev 42)
@@ -29,6 +29,7 @@
{
int tmp;
MPI_Status status;
+ NOTE_F;
MPI_Recv(&tmp, 1, MPI_INT,
MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
assert(tmp == -2);
@@ -37,6 +38,7 @@
void
notify_next(void)
{
+ NOTE_F;
if (mpi_rank < mpi_size-1)
{
int msg = -2;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 20:56:41
|
Revision: 60
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=60&view=rev
Author: jmwozniak
Date: 2010-04-29 20:56:35 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Fixes for cmpi/test05
Modified Paths:
--------------
Makefile.in
test/adts/module.mk.in
test/adts/test-dpkm_list.c
test/adts/test-lru_table02.c
test/cmpi/test05.c
Added Paths:
-----------
test/cmpi/test05.zsh
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-29 20:55:41 UTC (rev 59)
+++ Makefile.in 2010-04-29 20:56:35 UTC (rev 60)
@@ -281,6 +281,7 @@
$(E)echo LIBS: $(LIBS)
$(E)echo DEPENDS: $(DEPENDS)
$(E)echo OPENSSL: $(OPENSSL_LOCATION)
+ $(E)echo ADT_OBJS: $(ADT_OBJS)
# $(E)echo USE_MPIRPC_1: @USE_MPIRPC_1@
# $(E)echo USE_MPIRPC_2: @USE_MPIRPC_2@
# $(E)echo USE_TABLE_KDA_1: @USE_TABLE_KDA_1@
@@ -338,7 +339,6 @@
TABLE_OBJS := $(KDA_OBJS) $(DENSE_OBJS)
CMPI_OBJS := $(patsubst %.c,%.o, $(filter %.c,$(CMPI_SRC)))
CMPI_OBJS += $(TABLE_OBJS) $(MPIRPC_OBJS) $(DISKSIM_OBJS)
-# CMPI_PICS += src/cmpi/cmpi-io.po
CMPI_DEPS := $(patsubst %.o,%.d,$(CMPI_OBJS))
Modified: test/adts/module.mk.in
===================================================================
--- test/adts/module.mk.in 2010-04-29 20:55:41 UTC (rev 59)
+++ test/adts/module.mk.in 2010-04-29 20:56:35 UTC (rev 60)
@@ -1,6 +1,6 @@
TEST_SRC += $(shell find test/adts -name "*.c")
-test/adts/test%.x: test/adts/test%.o src/mpi_tools/mpi_tools.o $(ADT_OBJS)
+test/adts/test%.x: test/adts/test%.o src/mpi_tools/mpi_tools.o $(CMPI)
$(Q) " LINK $(@) "
$(E)$(MPICC) $(MPE) $(<) src/mpi_tools/mpi_tools.o $(ADT_OBJS) $(LIBS) -o $(@)
Modified: test/adts/test-dpkm_list.c
===================================================================
--- test/adts/test-dpkm_list.c 2010-04-29 20:55:41 UTC (rev 59)
+++ test/adts/test-dpkm_list.c 2010-04-29 20:56:35 UTC (rev 60)
@@ -86,6 +86,11 @@
dpkm_list_tostring(s, 1000, "%i", L);
printf("From string: %s\n", s);
+ struct dpkm_list* L2 = dpkm_list_create(4);
+ char* binary = "data";
+ dpkm_list_add(L2, "binary", binary, strlen(binary)+1);
+ dpkm_list_printdata(L2);
+
/*
dpkm_list_printf("%i", L);
dpkm_list_poll(L);
Modified: test/adts/test-lru_table02.c
===================================================================
--- test/adts/test-lru_table02.c 2010-04-29 20:55:41 UTC (rev 59)
+++ test/adts/test-lru_table02.c 2010-04-29 20:56:35 UTC (rev 60)
@@ -27,9 +27,12 @@
lru_table_add(table, "key2", heap(data2), strlen(data2)+1);
lru_table_printf("%s", table);
- char* overwrite = "XJKLJKL";
+ char* overwrite = "_-_-_";
lru_table_update(table, "key2", overwrite, 3, strlen(overwrite)+1);
+ lru_table_printf("%s", table);
+ overwrite = "X";
+ lru_table_update(table, "key2", overwrite, 1, strlen(overwrite)+1);
lru_table_printf("%s", table);
while ((kv = lru_table_poll(table)))
Modified: test/cmpi/test05.c
===================================================================
--- test/cmpi/test05.c 2010-04-29 20:55:41 UTC (rev 59)
+++ test/cmpi/test05.c 2010-04-29 20:56:35 UTC (rev 60)
@@ -1,45 +1,45 @@
/**
- Put three keys, update one, and get the updated value.
+ Put three keys, update one, and get the updated value.
*/
-#include "test_helpers.h"
+#include "test_helpers.h"
void
cmpi_client_code()
{
char key1[10];
char key2[10];
- char key3[10];
+ char key3[10];
sprintf(key1, "key1_%i", mpi_rank);
sprintf(key2, "key2_%i", mpi_rank);
sprintf(key3, "key3_%i", mpi_rank);
wait_for_notification();
- notify_next();
+ notify_next();
char value[30];
sprintf(value, "value1");
- cmpi_put(key1, value, strlen(value)+1);
+ cmpi_put(key1, value, strlen(value)+1);
printf("FIRST PUT SUCCEEDED\n");
sprintf(value, "value2");
- cmpi_put(key2, value, strlen(value)+1);
+ cmpi_put(key2, value, strlen(value)+1);
printf("SECOND PUT SUCCEEDED\n");
sprintf(value, "value3");
- cmpi_put(key3, value, strlen(value)+1);
+ cmpi_put(key3, value, strlen(value)+1);
printf("THIRD PUT SUCCEEDED\n");
-
- sleep(2);
- cmpi_update(key2, "W", 1, 3);
-
+ sleep(2);
+
+ cmpi_update(key2, "X", 1, 3);
+
char* result;
- int length;
- cmpi_get(key2, &result, &length);
- printf("result: %s\n", result);
- printf("GET SUCCEEDED\n");
-
- sleep(2);
-
- cmpi_shutdown();
+ int length;
+ cmpi_get(key2, &result, &length);
+ printf("result: %s\n", result);
+ printf("GET SUCCEEDED\n");
+
+ sleep(2);
+
+ cmpi_shutdown();
}
Added: test/cmpi/test05.zsh
===================================================================
--- test/cmpi/test05.zsh (rev 0)
+++ test/cmpi/test05.zsh 2010-04-29 20:56:35 UTC (rev 60)
@@ -0,0 +1,37 @@
+#!/bin/zsh
+
+# Be sure to make tests with D=1
+
+# set -x
+
+source tools/test-helpers.zsh
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+shift
+LAUNCH=${*}
+
+if (( USE_COMM_WORLD == 1 ))
+then
+
+ # Monolithic execution (5 nodes, 1 client):
+
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ CODE=$?
+ [[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+else
+
+ # KDA-2B execution:
+
+ tools/startup_nodes.zsh $(( N-1 )) 100 &
+ mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ sleep $(( N+15 ))
+
+fi
+
+# Should be 6 "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == 6 )) || crash "N != 6"
+
+exit 0
Property changes on: test/cmpi/test05.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-05 15:56:31
|
Revision: 67
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=67&view=rev
Author: jmwozniak
Date: 2010-05-05 15:56:25 +0000 (Wed, 05 May 2010)
Log Message:
-----------
Test fixes.
Modified Paths:
--------------
Makefile.in
configure.ac
test/adts/module.mk.in
test/driver/module.mk.in
test/gossip/module.mk.in
test/gossip/test-do.zsh
test/gossip/test-env.zsh
test/gossip/test-masks.zsh
test/mpi_tools/module.mk.in
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-04 18:46:20 UTC (rev 66)
+++ Makefile.in 2010-05-05 15:56:25 UTC (rev 67)
@@ -6,6 +6,7 @@
# cleaner cleans up configure-created files
# distclean _really_ cleans up; returns to pristine tree
# tags generates etags file for use by editors
+# test_results run all tests
# INPUT CONTROL VARIABLES
# D : if 1, turn on debugging output in CMPI programs
@@ -428,9 +429,9 @@
tests: $(CMPI) $(TEST_PROGS)
# Obsolete target: delete soon.
-cmpi-io-test: $(CMPI_IO) src/cmpi/cmpi-io-test.o
- $(Q) " MPICC cmpi-io-test"
- $(E)$(MPICC) src/cmpi/cmpi-io-test.o $(CMPI) $(LIBS) -o cmpi-io-test
+#cmpi-io-test: $(CMPI_IO) src/cmpi/cmpi-io-test.o
+# $(Q) " MPICC cmpi-io-test"
+# $(E)$(MPICC) src/cmpi/cmpi-io-test.o $(CMPI) $(LIBS) -o cmpi-io-test
# override default rule for building objects
%.o : %.c
@@ -503,8 +504,8 @@
aclocal.m4 \
config.h.in \
autoscan.log \
- configure.scan \
- cmpi-config.h*
+ configure.scan \
+ Makefile
$(E)find . -name "*.i" -exec rm -fv \{\} \;
$(E)find . -name "*.d" -exec rm -fv \{\} \;
$(E)find . -name "module.mk" -exec rm -fv \{\} \;
@@ -514,9 +515,7 @@
# except, don't remove generated .c files if this is a distributed release
distclean: cleaner docsclean
$(Q) " DISTCLEAN"
- $(E)rm -fv Makefile config.h \
- src/server/simple.conf \
- src/apps/admin/pvfs2-config
+ $(E)rm -fv configure config.h cmpi-config.h*
$(E)find . -name "*.dat" -exec rm -fv \{\} \;
# this is where we include all of our automatic dependencies.
Modified: configure.ac
===================================================================
--- configure.ac 2010-05-04 18:46:20 UTC (rev 66)
+++ configure.ac 2010-05-05 15:56:25 UTC (rev 67)
@@ -380,28 +380,33 @@
dnl output final version of top level makefile and subdirectory
dnl makefile includes
-AC_CONFIG_FILES(Makefile
-src/gossip/module.mk
-src/adts/module.mk
-src/cmpi/module.mk
-src/cmpi-cp/module.mk
-src/cmpi-db/module.mk
-src/mpi_tools/module.mk
-src/mpirpc/module.mk
-src/dense-1/module.mk
-src/kda-2/module.mk
-)
+AC_CONFIG_FILES(
+ Makefile
+ src/gossip/module.mk
+ src/adts/module.mk
+ src/cmpi/module.mk
+ src/cmpi-cp/module.mk
+ src/cmpi-db/module.mk
+ src/mpi_tools/module.mk
+ src/mpirpc/module.mk
+ src/dense-1/module.mk
+ src/kda-2/module.mk
+ )
if test "x$ENABLE_TESTS" = "xyes" ; then
AC_CONFIG_FILES(
- test/adts/module.mk
- test/cmpi/module.mk
- test/cmpi-io/module.mk
- test/driver/module.mk
- test/gossip/module.mk
- test/mpirpc/module.mk
- test/mpi_tools/module.mk
- )
+ test/adts/module.mk
+ test/cmpi/module.mk
+ test/driver/module.mk
+ test/gossip/module.mk
+ test/mpirpc/module.mk
+ test/mpi_tools/module.mk
+ )
+ if test "x$USE_CMPI_IO" = "x1" ; then
+ AC_CONFIG_FILES(
+ test/cmpi-io/module.mk
+ )
+ fi
fi
AC_OUTPUT
Modified: test/adts/module.mk.in
===================================================================
--- test/adts/module.mk.in 2010-05-04 18:46:20 UTC (rev 66)
+++ test/adts/module.mk.in 2010-05-05 15:56:25 UTC (rev 67)
@@ -4,3 +4,7 @@
test/adts/test%.x: test/adts/test%.o src/mpi_tools/mpi_tools.o $(CMPI)
$(Q) " LINK $(@) "
$(E)$(MPICC) $(MPE) $(<) src/mpi_tools/mpi_tools.o $(ADT_OBJS) $(LIBS) -o $(@)
+
+test/adts/test%.out: test/adts/test%.x
+ $(Q) " TEST $(@) "
+ $(E)$(<) > $(@) 2>&1
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-04 18:46:20 UTC (rev 66)
+++ test/driver/module.mk.in 2010-05-05 15:56:25 UTC (rev 67)
@@ -11,6 +11,10 @@
$(Q) " MPICC $(@) "
$(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o $(CMPI) $(LIBS) -o $(@)
+test/driver/test%.out: test/driver/test%.x $(DRIVER)
+ $(Q) " TEST $(@) "
+ $(E)touch $(@)
+
$(DRIVER): $(DRIVER_IMPL) test/driver/test_helpers.o src/cmpi/node.o $(CMPI)
$(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o src/cmpi/node.o \
$(CMPI) $(LIBS) -o $(@)
Modified: test/gossip/module.mk.in
===================================================================
--- test/gossip/module.mk.in 2010-05-04 18:46:20 UTC (rev 66)
+++ test/gossip/module.mk.in 2010-05-05 15:56:25 UTC (rev 67)
@@ -8,4 +8,5 @@
$(E)$(MPICC) $(<) $(CMPI) $(LIBS) -o $(@)
$(DIR)/test%.out: $(DIR)/test%.x
- $(patsubst %.x, %.zsh, $(<)) $(<)
+ $(Q) " TEST $(@) "
+ $(E)$(patsubst %.x, %.zsh, $(<)) $(<)
Modified: test/gossip/test-do.zsh
===================================================================
--- test/gossip/test-do.zsh 2010-05-04 18:46:20 UTC (rev 66)
+++ test/gossip/test-do.zsh 2010-05-05 15:56:25 UTC (rev 67)
@@ -1,6 +1,6 @@
#!/bin/zsh
-set -x
+# set -x
# Be sure to make tests with D=1
Modified: test/gossip/test-env.zsh
===================================================================
--- test/gossip/test-env.zsh 2010-05-04 18:46:20 UTC (rev 66)
+++ test/gossip/test-env.zsh 2010-05-05 15:56:25 UTC (rev 67)
@@ -1,6 +1,6 @@
#!/bin/zsh
-set -x
+# set -x
# Be sure to make tests with D=1
@@ -31,7 +31,7 @@
(( N == 3 )) || crash "N != 3"
# Should be 2 "Example debugging message."s
-N=$( grep -c "Example debugging message." ${OUT} )
+N=$( grep -c "EXAMPLE MESSAGE" ${OUT} )
(( N == 2 )) || crash "N != 2"
exit 0
Modified: test/gossip/test-masks.zsh
===================================================================
--- test/gossip/test-masks.zsh 2010-05-04 18:46:20 UTC (rev 66)
+++ test/gossip/test-masks.zsh 2010-05-05 15:56:25 UTC (rev 67)
@@ -1,6 +1,6 @@
#!/bin/zsh
-set -x
+# set -x
# Be sure to make tests with D=1
Modified: test/mpi_tools/module.mk.in
===================================================================
--- test/mpi_tools/module.mk.in 2010-05-04 18:46:20 UTC (rev 66)
+++ test/mpi_tools/module.mk.in 2010-05-05 15:56:25 UTC (rev 67)
@@ -3,10 +3,9 @@
TEST_SRC += $(TEST_MPITOOLS_SRC)
test/mpi_tools/test%.out: test/mpi_tools/test%.x
- $(LAUNCH) -n $(NODES) $(<) > $(@) 2>&1
+ $(Q) " TEST $(@) "
+ $(E)$(LAUNCH) -n 3 $(<) > $(@) 2>&1
test/mpi_tools/test%.x: test/mpi_tools/test%.o $(CMPI)
$(Q) " MPICC $(@) "
$(E)$(MPICC) $(MPE) $(<) $(CMPI) $(LIBS) -o $(@)
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-07 21:57:29
|
Revision: 79
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=79&view=rev
Author: jmwozniak
Date: 2010-05-07 21:57:23 +0000 (Fri, 07 May 2010)
Log Message:
-----------
Minor fixes
Modified Paths:
--------------
src/adts/ilist.c
src/adts/llist.c
test/cmpi-db/module.mk.in
test/driver/module.mk.in
Added Paths:
-----------
test/cmpi/test-update02.zsh
Modified: src/adts/ilist.c
===================================================================
--- src/adts/ilist.c 2010-05-07 16:10:58 UTC (rev 78)
+++ src/adts/ilist.c 2010-05-07 21:57:23 UTC (rev 79)
@@ -1,33 +1,33 @@
-#include <stdbool.h>
+#include <stdbool.h>
#include <stdio.h>
-#include <string.h>
+#include <string.h>
-#include "ilist.h"
+#include "ilist.h"
struct ilist*
ilist_create()
{
- // NOTE_F;
+ // NOTE_F;
struct ilist* new_ilist = malloc(sizeof(struct ilist));
if (! new_ilist)
- return NULL;
+ return NULL;
new_ilist->head = NULL;
new_ilist->tail = NULL;
new_ilist->size = 0;
- return new_ilist;
+ return new_ilist;
}
-struct ilist_item*
+struct ilist_item*
ilist_add(struct ilist* target, int key, void* data)
{
struct ilist_item* new_item = malloc(sizeof(struct ilist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
- new_item->next = NULL;
+ new_item->next = NULL;
if (target->size == 0)
{
target->head = new_item;
@@ -37,15 +37,15 @@
{
target->tail->next = new_item;
}
- target->tail = new_item;
+ target->tail = new_item;
target->size++;
- return new_item;
+ return new_item;
}
/**
-
+
*/
-struct ilist_item*
+struct ilist_item*
ilist_replace(struct ilist* target, int key, void* data)
{
struct ilist_item* item;
@@ -53,7 +53,7 @@
if (item->key == key)
{
item->data = data;
- return item;
+ return item;
}
return ilist_add(target, key, data);
}
@@ -65,7 +65,7 @@
for (item = target->head; item; item = item->next)
if (item->key == key)
return true;
- return false;
+ return false;
}
bool
@@ -77,22 +77,22 @@
for (item = target->head; item; item = item->next)
if (cmp(item->data, data) == 0)
return true;
- return false;
+ return false;
}
/**
Insert into list so that keys are in order from smallest at head
to largest at tail.
*/
-struct ilist_item*
+struct ilist_item*
ilist_ordered_insert(struct ilist* target, int key, void* data)
{
- // NOTE_F;
-
+ // NOTE_F;
+
struct ilist_item* new_item = malloc(sizeof(struct ilist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
new_item->next = NULL;
@@ -104,44 +104,44 @@
else
{
struct ilist_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (key < target->head->key)
{
new_item->next = target->head;
- target->head = new_item;
+ target->head = new_item;
}
else
{
do
{
- // Are we inserting after this item?
+ // Are we inserting after this item?
if (item->next == NULL)
{
item->next = new_item;
target->tail = new_item;
- break;
+ break;
}
else
{
if (key < item->next->key)
{
- new_item->next = item->next;
+ new_item->next = item->next;
item->next = new_item;
- break;
+ break;
}
}
} while ((item = item->next));
}
}
target->size++;
- return new_item;
+ return new_item;
}
/**
Does nothing if the key/data pair are in the list.
- Ordered smallest to largest.
+ Ordered smallest to largest.
@return NULL iff the key/data pair are in the list.
- Could optimize to only malloc if insertion point is found.
+ Could optimize to only malloc if insertion point is found.
*/
struct ilist_item*
ilist_ordered_insert_unique(struct ilist* target,
@@ -151,7 +151,7 @@
struct ilist_item* new_item = malloc(sizeof(struct ilist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
new_item->next = NULL;
@@ -163,73 +163,73 @@
else
{
struct ilist_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (key < target->head->key)
{
new_item->next = target->head;
- target->head = new_item;
+ target->head = new_item;
}
- // Are we equal to the head?
+ // Are we equal to the head?
else if (key == target->head->key &&
cmp(data, target->head->data) == 0)
{
- free(new_item);
+ free(new_item);
return NULL;
}
else
{
do
{
- // Are we inserting after this item?
+ // Are we inserting after this item?
if (item->next == NULL)
{
item->next = new_item;
target->tail = new_item;
- break;
+ break;
}
else
{
- if (key == item->next->key &&
+ if (key == item->next->key &&
cmp(data, item->next->data) == 0)
{
- free(new_item);
+ free(new_item);
return NULL;
}
if (key < item->next->key)
{
- new_item->next = item->next;
+ new_item->next = item->next;
item->next = new_item;
- break;
+ break;
}
}
} while ((item = item->next));
}
}
target->size++;
- return new_item;
+ return new_item;
}
/**
This is expensive: singly linked list.
*/
-void*
+void*
ilist_pop(struct ilist* target)
{
- // NOTE_F;
-
- void* data;
+ // NOTE_F;
+
+ void* data;
if (target->size == 0)
return NULL;
if (target->size == 1)
{
- data = target->head->data;
- free(target->head);
+ data = target->head->data;
+ free(target->head);
target->head = NULL;
target->tail = NULL;
- target->size = 0;
- return data;
+ target->size = 0;
+ return data;
}
-
+
struct ilist_item* item;
for (item = target->head; item->next->next;
item = item->next);
@@ -237,35 +237,35 @@
free(item->next);
item->next = NULL;
target->tail = item;
- target->size--;
- return data;
+ target->size--;
+ return data;
}
/**
- Remove and return head of list.
+ Remove and return head of list.
*/
void*
ilist_poll(struct ilist* target)
{
- void* data;
+ void* data;
if (target->size == 0)
return NULL;
if (target->size == 1)
{
- data = target->head->data;
- free(target->head);
+ data = target->head->data;
+ free(target->head);
target->head = NULL;
target->tail = NULL;
- target->size = 0;
- return data;
+ target->size = 0;
+ return data;
}
- struct ilist_item* delendum = target->head;
+ struct ilist_item* delendum = target->head;
data = target->head->data;
target->head = target->head->next;
free(delendum);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
/**
@@ -275,20 +275,20 @@
ilist_get(struct ilist* target, int i)
{
struct ilist_item* item;
- int j = 0;
+ int j = 0;
for (item = target->head; item; item = item->next, j++)
- if (i == j)
+ if (i == j)
return (item->data);
return NULL;
}
/**
- @return The data or NULL if not found.
+ @return The data or NULL if not found.
*/
-void*
+void*
ilist_search(struct ilist* target, int key)
{
- struct ilist_item* item;
+ struct ilist_item* item;
for (item = target->head; item; item = item->next)
if (key == item->key)
return (item->data);
@@ -297,38 +297,38 @@
/**
Removes the ilist_item from the list.
- frees the ilist_item.
- @return The data item or NULL if not found.
+ frees the ilist_item.
+ @return The data item or NULL if not found.
*/
void*
ilist_remove(struct ilist* target, int key)
{
struct ilist_item* item;
- void* data;
+ void* data;
if (target->size == 0)
- return false;
+ return false;
if (target->head->key == key)
{
item = target->head;
target->head = item->next;
- data = item->data;
+ data = item->data;
free(item);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
for (item = target->head; item->next; item = item->next)
if (item->next->key == key)
{
struct ilist_item* delendum = item->next;
- data = delendum->data;
+ data = delendum->data;
if (item->next == target->tail)
- target->tail = item;
+ target->tail = item;
item->next = item->next->next;
free(delendum);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
- return NULL;
+ return NULL;
}
/**
@@ -340,11 +340,11 @@
struct ilist_item* item = target->head;
while (item)
{
- struct ilist_item* next = item->next;
+ struct ilist_item* next = item->next;
free(item);
- item = next;
+ item = next;
}
- free(target);
+ free(target);
}
/**
@@ -353,21 +353,21 @@
void
ilist_destroy(struct ilist* target)
{
- // NOTE_F;
+ // NOTE_F;
struct ilist_item* item = target->head;
while (item)
{
struct ilist_item* next = item->next;
free(item->data);
// free(item);
- item = next;
+ item = next;
}
free(target);
- // DONE;
+ // DONE;
}
/**
- @param format Specifies the output format for the data items.
+ @param format Specifies the output format for the data items.
*/
void
ilist_printf(char* format, struct ilist* target)
@@ -382,15 +382,15 @@
printf(format, item->data);
else if (strcmp(format, "%i") == 0)
printf(format, *((int*) (item->data)));
- printf(")");
+ printf(")");
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
/**
- @param format Specifies the output format for the data items.
+ @param format Specifies the output format for the data items.
*/
void
ilist_fprintf(FILE* file, char* format, struct ilist* target)
@@ -405,15 +405,15 @@
fprintf(file, format, item->data);
else if (strcmp(format, "%i") == 0)
fprintf(file, format, *((int*) (item->data)));
- fprintf(file, ")");
+ fprintf(file, ")");
if (item->next)
- fprintf(file, ",");
+ fprintf(file, ",");
}
fprintf(file, "]\n");
}
/**
- @param f Specifies the output format for the data items.
+ @param f Specifies the output format for the data items.
*/
void
ilist_fdump(FILE* file, char* (f)(void*), struct ilist* target)
@@ -425,15 +425,15 @@
{
fprintf(file, "(%i,", item->key);
fprintf(file, "%s", f(item->data));
- fprintf(file, ")");
+ fprintf(file, ")");
if (item->next)
- fprintf(file, ",");
+ fprintf(file, ",");
}
fprintf(file, "]\n");
}
/**
- Just dump the int keys.
+ Just dump the int keys.
*/
void
ilist_dumpkeys(struct ilist* target)
@@ -445,13 +445,13 @@
{
printf("(%i)", item->key);
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
/**
- Just dump the int keys.
+ Just dump the int keys.
*/
void
ilist_fdumpkeys(FILE* file, struct ilist* target)
@@ -463,13 +463,13 @@
{
fprintf(file, "(%i)", item->key);
if (item->next)
- fprintf(file, ",");
+ fprintf(file, ",");
}
fprintf(file, "]\n");
}
/**
- Dump the int keys in hex.
+ Dump the int keys in hex.
*/
void
ilist_xdumpkeys(struct ilist* target)
@@ -481,31 +481,31 @@
{
printf("(%x)", item->key);
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
/**
Just dump the data pointers.
- @return Allocated memory: 10 * target->size.
+ @return Allocated memory: 10 * target->size.
*/
-char*
-ilist_serialize_ptrs(struct ilist* target)
+char*
+ilist_serialize_ptrs(struct ilist* target)
{
- char* result = malloc(30*target->size);
+ char* result = malloc(30*target->size);
struct ilist_item* item;
- char* p = result;
+ char* p = result;
p += sprintf(p, "PTRS: [");
for (item = target->head;
item; item = item->next)
{
p += sprintf(p, "%p", item->data);
if (item->next)
- p += sprintf(p, " ");
+ p += sprintf(p, " ");
}
sprintf(p, "]\n");
- return result;
+ return result;
}
static char*
@@ -513,10 +513,10 @@
{
ptr += sprintf(ptr, "(%i,", item->key);
ptr += sprintf(ptr, "%s)", s);
-
+
if (item->next)
ptr += sprintf(ptr, ",");
- return ptr;
+ return ptr;
}
/**
@@ -531,10 +531,10 @@
item; item = item->next)
{
printf("(%i,", item->key);
- printf(f(item->data));
+ printf("%s", f(item->data));
printf(")");
if (item->next)
- printf(",");
+ printf(",");
}
printf("] \n");
}
@@ -543,73 +543,73 @@
size must be greater than 2.
format specifies the output format for the data items
returns int greater than size if size limits are exceeded
- indicating result is garbage
- */
+ indicating result is garbage
+ */
int ilist_snprintf(char* str, size_t size,
char* format, struct ilist* target)
{
- int error = size+1;
- char* ptr = str;
+ int error = size+1;
+ char* ptr = str;
struct ilist_item* item;
if (size <= 2)
- return error;
-
+ return error;
+
ptr += sprintf(ptr, "[");
char* s = (char*) malloc(sizeof(char)*ILIST_MAX_DATUM);
-
+
for (item = target->head; item && ptr-str < size;
- item = item->next)
+ item = item->next)
{
int r = snprintf(s, ILIST_MAX_DATUM, format, item->data);
if (r > ILIST_MAX_DATUM)
- return size+1;
+ return size+1;
if ((ptr-str) + 10 + r + 4 < size)
- ptr = append_pair(ptr, item, s);
+ ptr = append_pair(ptr, item, s);
else
- return error;
+ return error;
}
ptr += sprintf(ptr, "]");
- free(s);
- return (ptr-str);
+ free(s);
+ return (ptr-str);
}
/** Dump ilist to string a la snprintf()
size must be greater than 2.
format specifies the output format for the data items
returns int greater than size if size limits are exceeded
- indicating result is garbage
- */
+ indicating result is garbage
+ */
int ilist_marshal(char* str, size_t size,
char* (f)(void*), struct ilist* target)
{
- int error = size+1;
- char* ptr = str;
+ int error = size+1;
+ char* ptr = str;
struct ilist_item* item;
if (size <= 2)
- return error;
-
+ return error;
+
ptr += sprintf(ptr, "[");
for (item = target->head; item && ptr-str < size;
- item = item->next)
+ item = item->next)
{
- char* s = f(item->data);
+ char* s = f(item->data);
int r = sprintf(s, "%s", s);
if (r > ILIST_MAX_DATUM)
- return size+1;
+ return size+1;
if ((ptr-str) + 10 + r + 4 < size)
- ptr = append_pair(ptr, item, s);
+ ptr = append_pair(ptr, item, s);
else
- return error;
+ return error;
}
ptr += sprintf(ptr, "]");
- return (ptr-str);
+ return (ptr-str);
}
#ifdef DEBUG_ILIST
Modified: src/adts/llist.c
===================================================================
--- src/adts/llist.c 2010-05-07 16:10:58 UTC (rev 78)
+++ src/adts/llist.c 2010-05-07 21:57:23 UTC (rev 79)
@@ -1,28 +1,28 @@
-#include "llist.h"
+#include "llist.h"
struct llist*
llist_create()
{
struct llist* new_llist = malloc(sizeof(struct llist));
if (! new_llist)
- return NULL;
+ return NULL;
new_llist->head = NULL;
new_llist->tail = NULL;
new_llist->size = 0;
- return new_llist;
+ return new_llist;
}
-struct llist_item*
+struct llist_item*
llist_add(struct llist* target, long key, void* data)
{
struct llist_item* new_item = malloc(sizeof(struct llist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
- new_item->next = NULL;
+ new_item->next = NULL;
if (target->size == 0)
{
target->head = new_item;
@@ -32,22 +32,22 @@
{
target->tail->next = new_item;
}
- target->tail = new_item;
+ target->tail = new_item;
target->size++;
- return new_item;
+ return new_item;
}
/**
Insert into list so that keys are in order from smallest at head
to largest at tail.
*/
-struct llist_item*
+struct llist_item*
llist_ordered_insert(struct llist* target, long key, void* data)
{
struct llist_item* new_item = malloc(sizeof(struct llist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
new_item->next = NULL;
@@ -59,43 +59,43 @@
else
{
struct llist_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (key < target->head->key)
{
new_item->next = target->head;
- target->head = new_item;
+ target->head = new_item;
}
else
{
do
{
- // Are we inserting after this item?
+ // Are we inserting after this item?
if (item->next == NULL)
{
item->next = new_item;
target->tail = new_item;
- break;
+ break;
}
else
{
if (key < item->next->key)
{
- new_item->next = item->next;
+ new_item->next = item->next;
item->next = new_item;
- break;
+ break;
}
}
} while ((item = item->next));
}
}
target->size++;
- return new_item;
+ return new_item;
}
/**
- Does nothing if the key/data pair are in the list.
+ Does nothing if the key/data pair are in the list.
@return NULL iff the key/data pair are in the list.
- Could optimize to only malloc if insertion point is found.
+ Could optimize to only malloc if insertion point is found.
*/
struct llist_item*
llist_ordered_insertdata(struct llist* target,
@@ -105,7 +105,7 @@
struct llist_item* new_item = malloc(sizeof(struct llist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
new_item->next = NULL;
@@ -117,71 +117,71 @@
else
{
struct llist_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (key < target->head->key)
{
new_item->next = target->head;
- target->head = new_item;
+ target->head = new_item;
}
- // Are we equal to the head?
+ // Are we equal to the head?
else if (key == target->head->key &&
cmp(data, target->head->data))
{
- free(new_item);
+ free(new_item);
return NULL;
}
else
{
do
{
- // Are we inserting after this item?
+ // Are we inserting after this item?
if (item->next == NULL)
{
item->next = new_item;
target->tail = new_item;
- break;
+ break;
}
else
{
- if (key == item->next->key &&
+ if (key == item->next->key &&
cmp(data, item->next->data))
{
- free(new_item);
+ free(new_item);
return NULL;
}
if (key < item->next->key)
{
- new_item->next = item->next;
+ new_item->next = item->next;
item->next = new_item;
- break;
+ break;
}
}
} while ((item = item->next));
}
}
target->size++;
- return new_item;
+ return new_item;
}
/**
This is expensive: singly linked list.
*/
-void*
+void*
llist_pop(struct llist* target)
{
- void* data;
+ void* data;
if (target->size == 0)
return NULL;
if (target->size == 1)
{
- data = target->head->data;
- free(target->head);
+ data = target->head->data;
+ free(target->head);
target->head = NULL;
target->tail = NULL;
- target->size = 0;
- return data;
+ target->size = 0;
+ return data;
}
-
+
struct llist_item* item;
for (item = target->head; item->next->next;
item = item->next);
@@ -189,35 +189,35 @@
free(item->next);
item->next = NULL;
target->tail = item;
- target->size--;
- return data;
+ target->size--;
+ return data;
}
/**
- Remove and return head of list.
+ Remove and return head of list.
*/
void*
llist_poll(struct llist* target)
{
- void* data;
+ void* data;
if (target->size == 0)
return NULL;
if (target->size == 1)
{
- data = target->head->data;
- free(target->head);
+ data = target->head->data;
+ free(target->head);
target->head = NULL;
target->tail = NULL;
- target->size = 0;
- return data;
+ target->size = 0;
+ return data;
}
- struct llist_item* delendum = target->head;
+ struct llist_item* delendum = target->head;
data = target->head->data;
target->head = target->head->next;
free(delendum);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
/**
@@ -227,17 +227,17 @@
llist_get(struct llist* target, int i)
{
struct llist_item* item;
- int j = 0;
+ int j = 0;
for (item = target->head; item; item = item->next, j++)
- if (i == j)
+ if (i == j)
return (item->data);
return NULL;
}
-void*
+void*
llist_search(struct llist* target, long key)
{
- struct llist_item* item;
+ struct llist_item* item;
for (item = target->head; item; item = item->next)
if (key == item->key)
return (item->data);
@@ -247,37 +247,37 @@
/**
Removes the llist_item from the list.
frees the llist_item and the data pointer.
- @return The removed item or NULL if not found.
+ @return The removed item or NULL if not found.
*/
-void*
+void*
llist_remove(struct llist* target, long key)
{
struct llist_item* item;
- void* data;
+ void* data;
if (target->size == 0)
- return false;
+ return false;
if (target->head->key == key)
{
item = target->head;
target->head = item->next;
- data = item->data;
+ data = item->data;
free(item);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
for (item = target->head; item->next; item = item->next)
if (item->next->key == key)
{
struct llist_item* delendum = item->next;
- data = delendum->data;
+ data = delendum->data;
if (item->next == target->tail)
- target->tail = item;
+ target->tail = item;
item->next = item->next->next;
free(delendum);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
- return NULL;
+ return NULL;
}
/**
@@ -289,11 +289,11 @@
struct llist_item* item = target->head;
while (item)
{
- struct llist_item* next = item->next;
+ struct llist_item* next = item->next;
free(item);
- item = next;
+ item = next;
}
- free(target);
+ free(target);
}
/**
@@ -306,11 +306,11 @@
while (item)
{
struct llist_item* next = item->next;
- free(item->data);
+ free(item->data);
free(item);
- item = next;
+ item = next;
}
- free(target);
+ free(target);
}
/** format specifies the output format for the data items
@@ -328,14 +328,14 @@
printf(format, item->data);
else if (strcmp(format, "%li") == 0)
printf(format, *((long*) (item->data)));
- printf(")");
+ printf(")");
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
-/** Just dump the long keys.
+/** Just dump the long keys.
*/
void
llist_dumpkeys(struct llist* target)
@@ -347,12 +347,12 @@
{
printf("(%li)", item->key);
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
-/** Dump the long keys in hex.
+/** Dump the long keys in hex.
*/
void
llist_xdumpkeys(struct llist* target)
@@ -364,7 +364,7 @@
{
printf("(%lx)", item->key);
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
@@ -375,10 +375,10 @@
{
ptr += sprintf(ptr, "(%li,", item->key);
ptr += sprintf(ptr, "%s)", s);
-
+
if (item->next)
ptr += sprintf(ptr, ",");
- return ptr;
+ return ptr;
}
/**
@@ -392,10 +392,10 @@
item; item = item->next)
{
printf("(%li,", item->key);
- printf(f(item->data));
+ printf("%s", f(item->data));
printf(")");
if (item->next)
- printf(",");
+ printf(",");
}
printf("] \n");
}
@@ -404,38 +404,38 @@
size must be greater than 2.
format specifies the output format for the data items
returns int greater than size if size limits are exceeded
- indicating result is garbage
- */
+ indicating result is garbage
+ */
int llist_tostring(char* str, size_t size,
char* format, struct llist* target)
{
- int error = size+1;
- char* ptr = str;
+ int error = size+1;
+ char* ptr = str;
struct llist_item* item;
if (size <= 2)
- return error;
-
+ return error;
+
ptr += sprintf(ptr, "[");
char* s = (char*) malloc(sizeof(char)*LLIST_MAX_DATUM);
-
+
for (item = target->head; item && ptr-str < size;
- item = item->next)
+ item = item->next)
{
int r = snprintf(s, LLIST_MAX_DATUM, format, item->data);
if (r > LLIST_MAX_DATUM)
- return size+1;
+ return size+1;
if ((ptr-str) + 10 + r + 4 < size)
- ptr = append_pair(ptr, item, s);
+ ptr = append_pair(ptr, item, s);
else
- return error;
+ return error;
}
ptr += sprintf(ptr, "]");
- free(s);
- return (ptr-str);
+ free(s);
+ return (ptr-str);
}
#ifdef DEBUG_LLIST
@@ -443,13 +443,13 @@
int
main()
{
- int i;
+ int i;
char s[200];
char* d1 = malloc(50*sizeof(char));
- strcpy(d1, "okey-dokey");
+ strcpy(d1, "okey-dokey");
char* d2 = malloc(50*sizeof(char));
strcpy(d2, "okey-dokey30");
-
+
struct llist* list = llist_create();
llist_ordered_insert(list, 30, d2);
@@ -457,20 +457,20 @@
llist_remove(list, 30);
i = llist_tostring(s, 200, "%s", list);
printf("1: %s \n", s);
-
+
llist_ordered_insert(list, 31, "okey-dokey31");
- //
- llist_ordered_insert(list, 32, "okey-dokey32");
-
+ //
+ llist_ordered_insert(list, 32, "okey-dokey32");
+
i = llist_tostring(s, 200, "%s", list);
printf("2: %s \n", s);
-
+
llist_remove(list, 12);
llist_ordered_insert(list, 33, "okey-dokey33");
- // llist_remove(list, 30);
+ // llist_remove(list, 30);
llist_ordered_insert(list, 20, "okey-dokey20");
-
+
i = llist_tostring(s, 200, "%s", list);
printf("%s \n", s);
}
Added: test/cmpi/test-update02.zsh
===================================================================
--- test/cmpi/test-update02.zsh (rev 0)
+++ test/cmpi/test-update02.zsh 2010-05-07 21:57:23 UTC (rev 79)
@@ -0,0 +1,37 @@
+#!/bin/zsh
+
+# Be sure to make tests with D=1
+
+# set -x
+
+source tools/test-helpers.zsh
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+shift
+LAUNCH=${*}
+
+if (( USE_COMM_WORLD == 1 ))
+then
+
+ # Monolithic execution (5 nodes, 1 client):
+
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ CODE=$?
+ [[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+else
+
+ # KDA-2B execution:
+
+ tools/startup_nodes.zsh $(( N-1 )) 100 &
+ mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ sleep $(( N+15 ))
+
+fi
+
+# Should be 6 "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == 6 )) || crash "N != 6"
+
+exit 0
Property changes on: test/cmpi/test-update02.zsh
___________________________________________________________________
Added: svn:executable
+ *
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-07 16:10:58 UTC (rev 78)
+++ test/cmpi-db/module.mk.in 2010-05-07 21:57:23 UTC (rev 79)
@@ -1,7 +1,7 @@
-TEST_CMPI_DB_SRC += $(shell find test/driver -name "*.c" ! -name test_helpers.c)
+TEST_CMPI_DB_SRC += # $(shell find test/cmpi-db -name "*.c" ! -name test_helpers.c)
TEST_SRC += $(TEST_CMPI_DB_SRC)
-TEST_HELPER_SRC += test/driver/test_helpers.c
+TEST_HELPER_SRC += test/driver/test_helpers.c
CMPI_DB = bin/cmpi-db
CMPI_CP = bin/cmpi-cp
@@ -14,10 +14,10 @@
$(E) $(<) $(@) 4 3
# test/cmpi-db/test-quit.zsh
-test/cmpi-db/test%.out: test/driver/test%.x $(DRIVER)
- $(Q) " TEST $(@) "
- $(E)touch $(@)
+#test/cmpi-db/test%.out: test/cmpi-db/test%.x $(DRIVER)
+# $(Q) " TEST $(@) "
+# $(E)touch $(@)
-$(DRIVER): $(DRIVER_IMPL) test/driver/test_helpers.o src/cmpi/node.o $(CMPI)
- $(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o src/cmpi/node.o \
- $(CMPI) $(LIBS) -o $(@)
+# $(DRIVER): $(DRIVER_IMPL) test/driver/test_helpers.o src/cmpi/node.o $(CMPI)
+# $(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o src/cmpi/node.o \
+# $(CMPI) $(LIBS) -o $(@)
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-07 16:10:58 UTC (rev 78)
+++ test/driver/module.mk.in 2010-05-07 21:57:23 UTC (rev 79)
@@ -1,5 +1,5 @@
-TEST_DRIVER_SRC += $(shell find test/driver -name "*.c" ! -name test_helpers.c)
+TEST_DRIVER_SRC += # $(shell find test/driver -name "*.c" ! -name test_helpers.c)
TEST_SRC += $(TEST_DRIVER_SRC)
TEST_HELPER_SRC += test/driver/test_helpers.c
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-10 19:46:25
|
Revision: 80
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=80&view=rev
Author: jmwozniak
Date: 2010-05-10 19:46:14 +0000 (Mon, 10 May 2010)
Log Message:
-----------
Fixes to tests.
Modified Paths:
--------------
test/cmpi-db/test-quit.zsh
test/mpirpc/module.mk.in
test/mpirpc/test-args.zsh
test/mpirpc/test-blob.c
test/mpirpc/test-blob.zsh
test/mpirpc/test-ping.c
test/mpirpc/test-ping.zsh
test/mpirpc/test-returns.zsh
Modified: test/cmpi-db/test-quit.zsh
===================================================================
--- test/cmpi-db/test-quit.zsh 2010-05-07 21:57:23 UTC (rev 79)
+++ test/cmpi-db/test-quit.zsh 2010-05-10 19:46:14 UTC (rev 80)
@@ -2,7 +2,7 @@
# Be sure to make tests with D=1
-# set -x
+set -x
OUT=$1
PROCS=$2
Modified: test/mpirpc/module.mk.in
===================================================================
--- test/mpirpc/module.mk.in 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/module.mk.in 2010-05-10 19:46:14 UTC (rev 80)
@@ -10,9 +10,10 @@
TEST_OUTPUT += $(patsubst %.c, %.out, $(TEST_MPIRPC_SRC))
test/mpirpc/test%.out: test/mpirpc/test%.x
- mpdlistjobs
- $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
- cp -uv $(@) test/mpirpc/readable.txt
+ $(Q) " TEST $(@) "
+ $(E)mpdlistjobs
+ $(E) $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
+# cp -uv $(@) test/mpirpc/readable.txt
$(DIR)/test%.x: $(DIR)/test%.o $(CMPI)
$(Q) " MPICC $(@) "
Modified: test/mpirpc/test-args.zsh
===================================================================
--- test/mpirpc/test-args.zsh 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/test-args.zsh 2010-05-10 19:46:14 UTC (rev 80)
@@ -1,6 +1,6 @@
#!/bin/zsh
-set -x
+# set -x
# Be sure to make tests with D=1
@@ -30,7 +30,7 @@
for T in ${TOKENS}
do
- grep ${T} ${OUT} || crash "Not found: ${T}"
+ grep ${T} ${OUT} > /dev/null || crash "Not found: ${T}"
done
exit 0
Modified: test/mpirpc/test-blob.c
===================================================================
--- test/mpirpc/test-blob.c 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/test-blob.c 2010-05-10 19:46:14 UTC (rev 80)
@@ -20,7 +20,7 @@
assert(blob[2] == '\t');
assert(blob[3] == '\n');
- NOTE("asserts ok");
+ printf("asserts ok\n");
MPIRPC_Null(caller, unique);
if (args)
@@ -60,7 +60,7 @@
while (! MPIRPC_Check());
}
- NOTE("Normal exit.\n");
+ printf("Normal exit.\n");
MPIRPC_Finalize();
MPI_Finalize();
Modified: test/mpirpc/test-blob.zsh
===================================================================
--- test/mpirpc/test-blob.zsh 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/test-blob.zsh 2010-05-10 19:46:14 UTC (rev 80)
@@ -25,7 +25,7 @@
for T in ${TOKENS}
do
- grep ${T} ${OUT} || crash "Not found: ${T}"
+ grep ${T} ${OUT} > /dev/null || crash "Not found: ${T}"
done
# Should be 2 "Normal exit."s
Modified: test/mpirpc/test-ping.c
===================================================================
--- test/mpirpc/test-ping.c 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/test-ping.c 2010-05-10 19:46:14 UTC (rev 80)
@@ -43,7 +43,8 @@
int
main(int argc, char* argv[])
{
- printf("host: %s\n", file_string("/etc/hostname"));
+ printf("hello\n");
+ // printf("host: %s\n", file_string("/etc/hostname"));
MPI_Init(&argc, &argv);
Modified: test/mpirpc/test-ping.zsh
===================================================================
--- test/mpirpc/test-ping.zsh 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/test-ping.zsh 2010-05-10 19:46:14 UTC (rev 80)
@@ -1,6 +1,6 @@
#!/bin/zsh
-set -x
+# set -x
# Be sure to make tests with D=1
@@ -24,7 +24,7 @@
N=$( grep -c "handle_ping" ${OUT} )
(( N == 5 )) || crash "N != 6"
-grep "handle_quit" ${OUT} || crash "No handle_quit!"
+grep "handle_quit" ${OUT} > /dev/null || crash "No handle_quit!"
# Should be 2 "Normal exit."s
N=$( grep -c "Normal exit." ${OUT} )
Modified: test/mpirpc/test-returns.zsh
===================================================================
--- test/mpirpc/test-returns.zsh 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/test-returns.zsh 2010-05-10 19:46:14 UTC (rev 80)
@@ -1,6 +1,6 @@
#!/bin/zsh
-set -x
+# set -x
# Be sure to make tests with D=1
@@ -25,7 +25,7 @@
for T in ${TOKENS}
do
- grep ${T} ${OUT} || crash "Not found: ${T}"
+ grep ${T} ${OUT} > /dev/null || crash "Not found: ${T}"
done
exit 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-11 19:18:41
|
Revision: 83
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=83&view=rev
Author: jmwozniak
Date: 2010-05-11 19:18:30 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Improved testing framework.
Modified Paths:
--------------
Makefile.in
src/adts/module.mk.in
src/cmpi/driver.c
src/cmpi/module.mk.in
src/cmpi-cp/module.mk.in
src/dense-1/module.mk.in
src/gossip/module.mk.in
src/kda-2/module.mk.in
src/mpi_tools/module.mk.in
src/mpirpc/module.mk.in
test/adts/module.mk.in
test/cmpi/module.mk.in
test/gossip/module.mk.in
test/mpi_tools/module.mk.in
test/mpirpc/module.mk.in
Property Changed:
----------------
/
Property changes on:
___________________________________________________________________
Added: svn:ignore
+ .ignore
cmpi-config.h
cmpi-config.h.in
Makefile
lib
bin
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-11 19:13:24 UTC (rev 82)
+++ Makefile.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -129,8 +129,10 @@
# They are identified by the presence of module.mk files (makefile
# includes).
DIR :=
-MODULES := $(shell find . "(" -name gsl -prune -or -name "*.mk" ")" -a -type f )
+MODULES :=
+# $(shell find . "(" -name gsl -prune -or -name "*.mk" ")" -a -type f )
+
# List of directories to search for headers.
INCLUDES := include
@@ -254,16 +256,12 @@
# LIBSRC is source code for libcmpi
LIBSRC :=
-# Source code for MPIRPC
-MPIRPC_SRC :=
-# Source code for CMPI
-CMPI_SRC :=
# Source code for Kademlia
KDA_SRC :=
# Source code for Dense implementation
DENSE_SRC :=
# Source code for ADTs
-ADT_SRC :=
+ADTS_SRC :=
# Source code for DiskSim interface
DISKSIM_SRC :=
@@ -282,17 +280,17 @@
$(E)echo LIBS: $(LIBS)
$(E)echo DEPENDS: $(DEPENDS)
$(E)echo OPENSSL: $(OPENSSL_LOCATION)
- $(E)echo ADT_OBJS: $(ADT_OBJS)
-# $(E)echo USE_MPIRPC_1: @USE_MPIRPC_1@
-# $(E)echo USE_MPIRPC_2: @USE_MPIRPC_2@
-# $(E)echo USE_TABLE_KDA_1: @USE_TABLE_KDA_1@
+ $(E)echo GOSSIP_OBJS: $(GOSSIP_OBJS)
+ $(E)echo ADTS_OBJS: $(ADTS_OBJS)
+ $(E)echo MPITOOLS_OBJS: $(MPITOOLS_OBJS)
+ $(E)echo MPIRPC_OBJS: $(MPIRPC_OBJS)
# $(E)echo USE_TABLE_KDA_2A: @USE_TABLE_KDA_2A@
# $(E)echo USE_TABLE_KDA_2B: @USE_TABLE_KDA_2B@
-# $(E)echo USE_TABLE_DENSE_1: @USE_TABLE_DENSE_1@
+ $(E)echo USE_TABLE_DENSE_1: @USE_TABLE_DENSE_1@
# $(E)echo CMPI_SRC: $(CMPI_OBJS)
# $(E)echo CMPI_OBJS: $(CMPI_OBJS)
# $(E)echo TEST_CMPI_SRC: $(TEST_CMPI_SRC)
- $(E)echo TEST_DISKSIM_SRC: $(TEST_DISKSIM_SRC)
+# $(E)echo TEST_DISKSIM_SRC: $(TEST_DISKSIM_SRC)
# $(E)echo TEST_MPIRPC_SRC: $(TEST_MPIRPC_SRC)
$(E)echo TEST_SRC: $(TEST_SRC)
$(E)echo TEST_OBJS: $(TEST_OBJS)
@@ -302,8 +300,6 @@
$(Q) " "
# Shortcuts...
-CMPI := lib/libcmpi.a
-MPIRPC := lib/libmpirpc.a
CMPI_IO := lib/libcmpi-io.so
################################################################
@@ -311,14 +307,18 @@
# this is how we pull build information from all of the project
# subdirectories, make sure to catch top level module.mk as well
DIR :=
-include $(MODULES)
+# include $(MODULES)
-TEST_OBJS += $(patsubst %.c, %.o, $(TEST_SRC))
-TEST_PROGS += $(patsubst %.c, %.x, $(TEST_SRC))
-TEST_OUTPUT += $(patsubst %.c, %.out, $(TEST_SRC))
-TEST_DEPS += $(patsubst %.c, %.d, $(TEST_SRC))
-TEST_HELPER_OBJS += $(patsubst %.c, %.o, $(TEST_HELPER_SRC))
-TEST_DEPS += $(patsubst %.c, %.d, $(TEST_HELPER_SRC))
+# TABLE_OBJS :=
+include src/mpi_tools/module.mk
+include src/gossip/module.mk
+include src/adts/module.mk
+include src/mpirpc/module.mk
+include src/kda-2/module.mk
+include src/dense-1/module.mk
+include src/cmpi/module.mk
+#include src/cmpi-db/module.mk
+#include src/cmpi-cp/module.mk
################################################################
# Derived file lists
@@ -329,62 +329,66 @@
# by manipulating the lists of source files
# LIBOBJS is a list of objects to put in the client lib
-LIBOBJS := $(patsubst %.c,%.o, $(filter %.c,$(LIBSRC)))
+#LIBOBJS := $(patsubst %.c,%.o, $(filter %.c,$(LIBSRC)))
-ADT_OBJS := $(patsubst %.c,%.o, $(filter %.c,$(ADT_SRC)))
-DISKSIM_OBJS := $(patsubst %.c,%.o, $(filter %.c,$(DISKSIM_SRC)))
-MPIRPC_OBJS := $(patsubst %.c,%.o, $(filter %.c,$(MPIRPC_SRC)))
-MPIRPC_OBJS += $(ADT_OBJS)
-KDA_OBJS := $(patsubst %.c,%.o, $(filter %.c,$(KDA_SRC)))
-DENSE_OBJS := $(patsubst %.c,%.o, $(filter %.c,$(DENSE_SRC)))
-TABLE_OBJS := $(KDA_OBJS) $(DENSE_OBJS)
-CMPI_OBJS := $(patsubst %.c,%.o, $(filter %.c,$(CMPI_SRC)))
-CMPI_OBJS += $(TABLE_OBJS) $(MPIRPC_OBJS) $(DISKSIM_OBJS)
+#DISKSIM_OBJS := $(patsubst %.c,%.o, $(filter %.c,$(DISKSIM_SRC)))
+#TABLE_OBJS := $(KDA_OBJS) $(DENSE_OBJS)
+#CMPI_OBJS += $(TABLE_OBJS) $(MPIRPC_OBJS) $(DISKSIM_OBJS)
CMPI_DEPS := $(patsubst %.o,%.d,$(CMPI_OBJS))
+################################################################
+# Test cases
+# Test rules are heavily based on the definitions above
+
+TEST_SRC :=
+TEST_OBJS :=
+TEST_PROGS :=
+TEST_OUTPUT :=
+
+include test/mpi_tools/module.mk
+include test/gossip/module.mk
+include test/adts/module.mk
+include test/mpirpc/module.mk
+include test/cmpi/module.mk
+#include test/driver/module.mk.in
+#include test/cmpi-db/module.mk.in
+#include test/cmpi-io/module.mk.in
+
+#TEST_HELPER_OBJS += $(patsubst %.c, %.o, $(TEST_HELPER_SRC))
+TEST_DEPS += $(patsubst %.c, %.d, $(TEST_SRC))
+TEST_DEPS += $(patsubst %.c, %.d, $(TEST_HELPER_SRC))
+
####################################################################
# Rules and dependencies
# default rule builds server, library, and applications
# all:: # $(SERVER) $(LIBRARIES)
-cmpi: $(CMPI)
+mpirpc: $(MPIRPC)
+cmpi: $(CMPI)
-cmpi-io: $(CMPI_IO)
+#cmpi-io: $(CMPI_IO)
-mpirpc: $(MPIRPC)
-
# Just like dir, but strip the slash off the end, to be pretty.
-dirname = $(patsubst %/,%,$(dir $(1)))
+# dirname = $(patsubst %/,%,$(dir $(1)))
# Generate the canonical in-tree location of a file, given a possibly
# out-of-tree reference.
-canonname = $(patsubst $(srcdir)/%,%,$(call dirname,$(1)))
+# canonname = $(patsubst $(srcdir)/%,%,$(call dirname,$(1)))
# Grab any CFLAGS defined by the make stub for a particular file, and
# for the directory in which the source resides.
-modcflags = $(MODCFLAGS_$(call canonname,$(1))) \
- $(MODCFLAGS_$(patsubst $(srcdir)/%,%,$(1))) # -I$(srcdir)/$(call dirname,$(1))
-modldflags = $(MODLDFLAGS_$(call canonname,$(1))) \
- $(MODLDFLAGS_$(patsubst $(srcdir)/%,%,$(1)))
+# modcflags = $(MODCFLAGS_$(call canonname,$(1))) \
+# $(MODCFLAGS_$(patsubst $(srcdir)/%,%,$(1))) # -I$(srcdir)/$(call dirname,$(1))
+# modldflags = $(MODLDFLAGS_$(call canonname,$(1))) \
+# $(MODLDFLAGS_$(patsubst $(srcdir)/%,%,$(1)))
-$(CMPI): $(CMPI_OBJS) $(TABLE_OBJS)
- $(Q) " AR $@"
- $(E)$(INSTALL) -d lib
- $(E)ar rcs $(@) $(CMPI_OBJS) $(TABLE_OBJS)
-
-$(MPIRPC): $(MPIRPC_OBJS)
- $(Q) " AR $@"
- $(E)$(INSTALL) -d lib
- echo $(MODULES)
- $(E)ar crs $(@) $(MPIRPC_OBJS)
-
# CMPI-IO must be enabled in configure --enable-cmpi-io
-$(CMPI_IO): $(CMPI) src/cmpi/cmpi-io.po
- $(Q) " MPICC [PIC] $@"
- $(E)$(INSTALL) -d lib
- $(E)$(MPICC) -shared $< $(CMPI) $(LIBS) -o $@
+#$(CMPI_IO): $(CMPI) src/cmpi/cmpi-io.po
+# $(Q) " MPICC [PIC] $@"
+# $(E)$(INSTALL) -d lib
+# $(E)$(MPICC) -shared $< $(CMPI) $(LIBS) -o $@
## Tools...
@@ -477,12 +481,13 @@
clean::
$(Q) " CLEAN"
$(E)rm -fv $(CMPI_DEPS) $(TEST_DEPS) \
- $(MPIRPC) $(CMPI) $(MPIRPC_OBJS) $(CMPI_OBJS) \
+ $(MPIRPC) $(CMPI) $(ADTS_OBJS) $(MPIRPC_OBJS) $(CMPI_OBJS) \
$(KDA_OBJS) $(CMPI_IO) $(CMPI_PICS) \
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 "test-success.out" -exec rm -fv \{\} \;
# $(E)find . -name "*.avg" -exec rm -fv \{\} \;
# $(E)find . -name "*.per" -exec rm -fv \{\} \;
Modified: src/adts/module.mk.in
===================================================================
--- src/adts/module.mk.in 2010-05-11 19:13:24 UTC (rev 82)
+++ src/adts/module.mk.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -1,16 +1,19 @@
DIR := src/adts
-ADT_SRC += $(DIR)/hashtable.c
-ADT_SRC += $(DIR)/keyvalue.c
-ADT_SRC += $(DIR)/itable.c
-ADT_SRC += $(DIR)/ltable.c
-ADT_SRC += $(DIR)/list.c
-ADT_SRC += $(DIR)/ilist.c
-ADT_SRC += $(DIR)/klist.c
-ADT_SRC += $(DIR)/llist.c
-ADT_SRC += $(DIR)/inlist.c
-ADT_SRC += $(DIR)/lnlist.c
-ADT_SRC += $(DIR)/dpkm_list.c
-ADT_SRC += $(DIR)/lru_table.c
-ADT_SRC += $(DIR)/xtree.c
+ADTS_SRC += $(DIR)/hashtable.c
+ADTS_SRC += $(DIR)/keyvalue.c
+ADTS_SRC += $(DIR)/itable.c
+ADTS_SRC += $(DIR)/ltable.c
+ADTS_SRC += $(DIR)/list.c
+ADTS_SRC += $(DIR)/ilist.c
+ADTS_SRC += $(DIR)/klist.c
+ADTS_SRC += $(DIR)/llist.c
+ADTS_SRC += $(DIR)/inlist.c
+ADTS_SRC += $(DIR)/lnlist.c
+ADTS_SRC += $(DIR)/dpkm_list.c
+ADTS_SRC += $(DIR)/lru_table.c
+ADTS_SRC += $(DIR)/xtree.c
+
+ADTS_OBJS = $(patsubst %.c, %.o, $(ADTS_SRC))
+ADTS_OBJS += $(GOSSIP_OBJS)
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-11 19:13:24 UTC (rev 82)
+++ src/cmpi/driver.c 2010-05-11 19:18:30 UTC (rev 83)
@@ -142,7 +142,7 @@
int i;
sscanf(p, "%i", &i);
char* result = cmpi_info(i);
- printf(result);
+ printf("%s", result);
}
void
Modified: src/cmpi/module.mk.in
===================================================================
--- src/cmpi/module.mk.in 2010-05-11 19:13:24 UTC (rev 82)
+++ src/cmpi/module.mk.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -1,22 +1,23 @@
DIR := src/cmpi
+CMPI_SRC :=
CMPI_SRC += $(DIR)/cmpi.c
CMPI_SRC += $(DIR)/node.c
CMPI_SRC += $(DIR)/driver.c
CMPI_SRC += $(DIR)/accessor.c
ifeq (@USE_TABLE_DENSE@,1)
- CMPI_SRC += $(DIR)/dense.c
- CMPI_SRC += $(DIR)/driver.c
-endif
+ CMPI_SRC += $(DIR)/dense.c
+ CMPI_SRC += $(DIR)/driver.c
+endif
ifeq (@USE_DRIVER@,1)
- CMPI_SRC += $(DIR)/driver.c
+ CMPI_SRC += $(DIR)/driver.c
endif
ifeq (@USE_CMPI_IO@,1)
- CMPI_SRC += $(DIR)/cmpi-io.c
+ CMPI_SRC += $(DIR)/cmpi-io.c
endif
ifeq (@USE_COMM_WORLD@,0)
@@ -30,3 +31,13 @@
ifeq (@USE_DISK_VOID@,1)
CMPI_SRC += $(DIR)/cmpi_disk_void.c
endif
+
+CMPI_OBJS = $(patsubst %.c, %.o, $(CMPI_SRC))
+CMPI_OBJS += $(MPIRPC_OBJS)
+
+CMPI = lib/libcmpi.a
+
+$(CMPI): $(CMPI_OBJS) $(TABLE_OBJS)
+ $(Q) " AR $@"
+ $(E)$(INSTALL) -d lib
+ $(E)ar rcs $(@) $(CMPI_OBJS) $(TABLE_OBJS)
Modified: src/cmpi-cp/module.mk.in
===================================================================
--- src/cmpi-cp/module.mk.in 2010-05-11 19:13:24 UTC (rev 82)
+++ src/cmpi-cp/module.mk.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -1,19 +1,17 @@
-# CMPI-CP is not an MPI program
+# CMPI-CP is not an MPI program
DIR := src/cmpi-cp
-CMPI_PROGS += bin/cmpi-cp
-CMPI_CP_SRC += src/cmpi-cp/cmpi-cp.c
+CMPICP_PROGS += bin/cmpi-cp
+CMPICP_SRC += src/cmpi-cp/cmpi-cp.c
-CMPI_CP_OBJS = src/cmpi-cp/cmpi-cp.o src/cmpi/accessor.o src/mpi_tools/io_tools.o
+CMPICP_OBJS = src/cmpi-cp/cmpi-cp.o src/cmpi/accessor.o src/mpi_tools/io_tools.o
-CMPI_CP_LIBS :=
-
ifneq ($(DMALLOC_LIB),)
- CMPI_CP_LIBS += -L $(DMALLOC_LIB) -l dmalloc
+ CMPI_CP_LIBS += -L $(DMALLOC_LIB) -l dmalloc
endif
bin/cmpi-cp: $(CMPI_CP_OBJS) bin
- $(Q) " CC $(@) "
- $(E)$(CC) $(CMPI_CP_OBJS) $(CMPI_CP_LIBS) -o $(@)
+ $(Q) " CC $(@) "
+ $(E)$(CC) $(CMPI_CP_OBJS) -o $(@)
Modified: src/dense-1/module.mk.in
===================================================================
--- src/dense-1/module.mk.in 2010-05-11 19:13:24 UTC (rev 82)
+++ src/dense-1/module.mk.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -4,4 +4,7 @@
ifeq (@USE_TABLE_DENSE_1@,1)
DENSE_SRC += $(DIR)/dense.c
DENSE_SRC += $(DIR)/cmpi_dense.c
-endif
+endif
+
+DENSE_OBJS := $(patsubst %.c, %.o, $(DENSE_SRC))
+TABLE_OBJS += $(DENSE_OBJS)
Modified: src/gossip/module.mk.in
===================================================================
--- src/gossip/module.mk.in 2010-05-11 19:13:24 UTC (rev 82)
+++ src/gossip/module.mk.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -4,8 +4,11 @@
# outcome
DIR := src/gossip
-ADT_SRC += $(DIR)/gossip.c
+GOSSIP_SRC := $(DIR)/gossip.c
ifdef GOSSIP_ENABLE_BACKTRACE
MODCFLAGS_$(DIR)/gossip.c := -DGOSSIP_ENABLE_BACKTRACE
endif
+
+GOSSIP_OBJS = $(patsubst %.c, %.o, $(GOSSIP_SRC))
+GOSSIP_OBJS += $(MPITOOLS_OBJS)
Modified: src/kda-2/module.mk.in
===================================================================
--- src/kda-2/module.mk.in 2010-05-11 19:13:24 UTC (rev 82)
+++ src/kda-2/module.mk.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -22,3 +22,6 @@
ifeq (@USE_TABLE_KDA_2B@,1)
KDA_SRC += $(DIR)/conn-B.c
endif
+
+KDA_OBJS := $(patsubst %.c,%.o, $(KDA_SRC))
+TABLE_OBJS += $(KDA_OBJS)
Modified: src/mpi_tools/module.mk.in
===================================================================
--- src/mpi_tools/module.mk.in 2010-05-11 19:13:24 UTC (rev 82)
+++ src/mpi_tools/module.mk.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -1,5 +1,8 @@
DIR := src/mpi_tools
-MPIRPC_SRC += $(DIR)/mpi_tools.c
-MPIRPC_SRC += $(DIR)/io_tools.c
+MPITOOLS_SRC :=
+MPITOOLS_SRC += $(DIR)/mpi_tools.c
+MPITOOLS_SRC += $(DIR)/io_tools.c
+
+MPITOOLS_OBJS = $(patsubst %.c, %.o, $(MPITOOLS_SRC))
Modified: src/mpirpc/module.mk.in
===================================================================
--- src/mpirpc/module.mk.in 2010-05-11 19:13:24 UTC (rev 82)
+++ src/mpirpc/module.mk.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -1,4 +1,14 @@
DIR := src/mpirpc
-MPIRPC_SRC += $(DIR)/mpirpc.c
+MPIRPC_SRC := $(DIR)/mpirpc.c
+
+MPIRPC_OBJS := $(patsubst %.c, %.o, $(MPIRPC_SRC))
+MPIRPC_OBJS += $(ADTS_OBJS)
+
+MPIRPC = lib/libmpirpc.a
+
+lib/libmpirpc.a: $(MPIRPC_OBJS)
+ $(Q) " AR $@"
+ $(E)$(INSTALL) -d lib
+ $(E)ar crs $(@) $(MPIRPC_OBJS)
Modified: test/adts/module.mk.in
===================================================================
--- test/adts/module.mk.in 2010-05-11 19:13:24 UTC (rev 82)
+++ test/adts/module.mk.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -1,10 +1,24 @@
-TEST_SRC += $(shell find test/adts -name "*.c")
+DIR := test/adts
-test/adts/test%.x: test/adts/test%.o src/mpi_tools/mpi_tools.o $(CMPI)
+TEST_ADTS_SRC += $(shell find $(DIR) -name "*.c")
+TEST_ADTS_OBJS = $(patsubst %.c, %.o, $(TEST_ADTS_SRC))
+TEST_ADTS_OUTPUT = $(patsubst %.c, %.out, $(TEST_ADTS_SRC))
+
+TEST_SRC += $(TEST_ADTS_SRC)
+TEST_OBJS += $(TEST_ADTS_OBJS)
+TEST_OUTPUT += $(TEST_ADTS_OUTPUT)
+TEST_PROGS += $(patsubst %.c, %.x, $(TEST_ADTS_SRC))
+
+$(DIR)/test%.x: $(DIR)/test%.o $(ADTS_OBJS)
$(Q) " LINK $(@) "
- $(E)$(MPICC) $(MPE) $(<) src/mpi_tools/mpi_tools.o $(ADT_OBJS) $(LIBS) -o $(@)
+ $(E) $(MPICC) $(MPE) $(<) $(ADTS_OBJS) $(LIBS) -o $(@)
-test/adts/test%.out: test/adts/test%.x
+$(DIR)/test%.out: $(DIR)/test%.x
$(Q) " TEST $(@) "
- $(E)$(<) > $(@) 2>&1
+ $(E) test/adts/runtest.zsh $(<) $(@) 2>&1
+
+$(DIR)/test-success.out: test/gossip/test-success.out \
+ $(TEST_ADTS_OUTPUT)
+ $(Q) " TOUCH $(@) "
+ $(E) touch $(@)
Modified: test/cmpi/module.mk.in
===================================================================
--- test/cmpi/module.mk.in 2010-05-11 19:13:24 UTC (rev 82)
+++ test/cmpi/module.mk.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -1,33 +1,39 @@
-# Run tests with, e.g.,
-# make SIZE=4 NODES=3 REPS=5 test/cmpi/test01.out
-# SIZE is the size of the whole system (nodes+clients)
-# NODES is the number of nodes
-# REPS determines the length of tests that repeat operations
+DIR := test/cmpi
-# Be sure to include at least one client so that cmpi_client_code()
-# is actually called.
-
TEST_CMPI_SRC += $(shell find test/cmpi -name "*.c" ! -name test_helpers.c)
-TEST_SRC += $(TEST_CMPI_SRC)
-TEST_HELPER_SRC += test/cmpi/test_helpers.c
+TEST_CMPI_OBJS = $(patsubst %.c, %.o, $(TEST_CMPI_SRC))
+TEST_CMPI_OUTPUT = $(patsubst %.c, %.out, $(TEST_CMPI_SRC))
+TEST_HELPER_SRC := test/cmpi/test_helpers.c
+TEST_CMPI_OBJS += $(patsubst %.c, %.o, $(TEST_HELPER_SRC))
+
+TEST_SRC += $(TEST_CMPI_SRC)
+TEST_OBJS += $(TEST_CMPI_OBJS)
+TEST_PROGS += $(patsubst %.c, %.x, $(TEST_CMPI_SRC))
+TEST_OUTPUT += $(TEST_CMPI_OUTPUT)
+
ifeq (@USE_COMM_WORLD@,1)
-test/cmpi/test%.out: test/cmpi/test%.x test/cmpi/test%.zsh
- $(E) $(MPDCHECK)
- $(Q) " TEST $(@) "
- $(E) $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
-
-test/cmpi/test%.x: test/cmpi/test%.o test/cmpi/test_helpers.o src/cmpi/node.o $(CMPI)
+$(DIR)/test%.x: $(DIR)/test%.o $(DIR)/test_helpers.o src/cmpi/node.o $(CMPI)
$(Q) " LINK $(@) "
- $(E) $(MPICC) $(MPE) $(<) test/cmpi/test_helpers.o src/cmpi/node.o \
+ $(E) $(MPICC) $(MPE) $(<) $(DIR)/test_helpers.o src/cmpi/node.o \
$(CMPI) $(LIBS) -o $(@)
else
-test/cmpi/test%.x: test/cmpi/test%.o test/cmpi/test_helpers.o src/cmpi/client.o $(CMPI)
+$(DIR)/test%.x: $(DIR)/test%.o $(DIR)/test_helpers.o src/cmpi/client.o $(CMPI)
$(Q) " LINK $(@) "
- $(E)$(MPICC) $(MPE) $(<) test/cmpi/test_helpers.o src/cmpi/client.o $(CMPI) $(LIBS) -o $(@)
+ $(E)$(MPICC) $(MPE) $(<) $(DIR)/test_helpers.o src/cmpi/client.o $(CMPI) $(LIBS) -o $(@)
endif
+
+$(DIR)/test%.out: $(DIR)/test%.x $(DIR)/test%.zsh
+ $(E) $(MPDCHECK)
+ $(Q) " TEST $(@) "
+ $(E) $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
+
+$(DIR)/test-success.out: test/mpirpc/test-success.out \
+ $(TEST_CMPI_OUTPUT)
+ $(Q) " TOUCH $(@) "
+ $(E) touch $(@)
Modified: test/gossip/module.mk.in
===================================================================
--- test/gossip/module.mk.in 2010-05-11 19:13:24 UTC (rev 82)
+++ test/gossip/module.mk.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -1,12 +1,22 @@
DIR := test/gossip
-TEST_SRC += $(shell find $(DIR) -name "*.c")
+TEST_GOSSIP_SRC += $(shell find $(DIR) -name "*.c")
+TEST_GOSSIP_OBJS += $(patsubst %.c, %.o, $(TEST_GOSSIP_SRC))
+TEST_PROGS += $(patsubst %.c, %.x, $(TEST_GOSSIP_SRC))
+TEST_GOSSIP_OUTPUT = $(patsubst %.c, %.out, $(TEST_GOSSIP_SRC))
+TEST_OBJS += $(TEST_GOSSIP_OBJS)
+TEST_OUTPUT += $(TEST_GOSSIP_OUTPUT)
-$(DIR)/test%.x: $(DIR)/test%.o $(CMPI)
+$(DIR)/test%.x: $(DIR)/test%.o $(GOSSIP_OBJS)
$(Q) " LINK $(@) "
- $(E)$(MPICC) $(<) $(CMPI) $(LIBS) -o $(@)
+ $(E)$(MPICC) $(<) $(GOSSIP_OBJS) $(LIBS) -o $(@)
$(DIR)/test%.out: $(DIR)/test%.x
$(Q) " TEST $(@) "
$(E)$(patsubst %.x, %.zsh, $(<)) $(<)
+
+$(DIR)/test-success.out: test/mpi_tools/test-success.out \
+ $(TEST_GOSSIP_OUTPUT)
+ $(Q) " TOUCH $(@) "
+ $(E) touch $(@)
Modified: test/mpi_tools/module.mk.in
===================================================================
--- test/mpi_tools/module.mk.in 2010-05-11 19:13:24 UTC (rev 82)
+++ test/mpi_tools/module.mk.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -1,11 +1,23 @@
-TEST_MPITOOLS_SRC += $(shell find test/mpi_tools -name "*.c")
-TEST_SRC += $(TEST_MPITOOLS_SRC)
+DIR := test/mpi_tools
-test/mpi_tools/test%.out: test/mpi_tools/test%.x
+TEST_MPITOOLS_SRC = $(shell find $(DIR) -name "*.c")
+TEST_MPITOOLS_OBJS = $(patsubst %.c, %.o, $(TEST_MPITOOLS_SRC))
+TEST_MPITOOLS_OUTPUT = $(patsubst %.c, %.out, $(TEST_MPITOOLS_SRC))
+
+TEST_SRC += $(TEST_MPITOOLS_SRC)
+TEST_OBJS += $(TEST_MPITOOLS_OBJS)
+TEST_OUTPUT += $(TEST_MPITOOLS_OUTPUT)
+TEST_PROGS += $(patsubst %.c, %.x, $(TEST_MPITOOLS_SRC))
+
+$(DIR)/test%.out: test/mpi_tools/test%.x
$(Q) " TEST $(@) "
$(E)$(LAUNCH) -n 3 $(<) > $(@) 2>&1
-test/mpi_tools/test%.x: test/mpi_tools/test%.o $(CMPI)
+$(DIR)/test%.x: test/mpi_tools/test%.o $(MPITOOLS_OBJS)
$(Q) " MPICC $(@) "
- $(E)$(MPICC) $(MPE) $(<) $(CMPI) $(LIBS) -o $(@)
+ $(E)$(MPICC) $(MPE) $(<) $(MPITOOLS_OBJS) $(LIBS) -o $(@)
+
+$(DIR)/test-success.out: $(TEST_MPITOOLS_OUTPUT)
+ $(Q) " TOUCH $(@) "
+ $(E) touch $(@)
Modified: test/mpirpc/module.mk.in
===================================================================
--- test/mpirpc/module.mk.in 2010-05-11 19:13:24 UTC (rev 82)
+++ test/mpirpc/module.mk.in 2010-05-11 19:18:30 UTC (rev 83)
@@ -1,20 +1,25 @@
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_MPIRPC_OBJS = $(patsubst %.c, %.o, $(TEST_MPIRPC_SRC))
+TEST_MPIRPC_OUTPUT = $(patsubst %.c, %.out, $(TEST_MPIRPC_SRC))
-TEST_MPIRPC_SRC += $(shell find $(DIR) -name "*.c" )
-TEST_SRC += $(TEST_MPIRPC_SRC)
-TEST_STATUS += $(DIR)/test02.status
-TEST_OUTPUT += $(patsubst %.c, %.out, $(TEST_MPIRPC_SRC))
+TEST_SRC += $(TEST_MPIRPC_SRC)
+TEST_OBJS += $(TEST_MPIRPC_OBJS)
+TEST_PROGS += $(patsubst %.c, %.x, $(TEST_MPIRPC_SRC))
+TEST_OUTPUT += $(TEST_MPIRPC_OUTPUT)
-test/mpirpc/test%.out: test/mpirpc/test%.x
+$(DIR)/test%.x: $(DIR)/test%.o lib/libmpirpc.a
+ $(Q) " LINK $(@) "
+ $(E) $(MPICC) $(MPE) $(<) lib/libmpirpc.a $(LIBS) -o $(@)
+
+$(DIR)/test%.out: $(DIR)/test%.x
$(Q) " TEST $(@) "
$(E) $(MPDCHECK)
$(E) $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
-# cp -uv $(@) test/mpirpc/readable.txt
-$(DIR)/test%.x: $(DIR)/test%.o $(CMPI)
- $(Q) " MPICC $(@) "
- $(E)$(MPICC) $(MPE) $(<) $(CMPI) $(LIBS) -o $(@)
+$(DIR)/test-success.out: test/adts/test-success.out \
+ $(TEST_MPIRPC_OUTPUT)
+ $(Q) " TOUCH $(@) "
+ $(E) touch $(@)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-12 20:44:42
|
Revision: 108
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=108&view=rev
Author: jmwozniak
Date: 2010-05-12 20:44:33 +0000 (Wed, 12 May 2010)
Log Message:
-----------
New file_to_buffer()
Modified Paths:
--------------
Makefile.in
include/io_tools.h
src/mpi_tools/io_tools.c
test/driver/test-cmd-get.c
test/mpi_tools/module.mk.in
Added Paths:
-----------
test/mpi_tools/test-file.c
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-12 20:17:35 UTC (rev 107)
+++ Makefile.in 2010-05-12 20:44:33 UTC (rev 108)
@@ -63,11 +63,12 @@
MPI = @USE_MPI@
MPICC = @USE_MPI@/bin/mpicc
MPIEXEC = @USE_MPI@/bin/mpiexec -recvtimeout 10
+# MPIEXEC = @USE_MPI@/bin/mpiexec.hydra -f hosts
MPDCHECK = tools/mpd-available.zsh @USE_MPI@/bin/mpdlistjobs
# Job launch selection
ifeq (@HAVE_SRUN@,no)
- LAUNCH = $(MPIEXEC)
+ LAUNCH = $(MPIEXEC) $(MPIARGS)
else
LAUNCH = srun
endif
Modified: include/io_tools.h
===================================================================
--- include/io_tools.h 2010-05-12 20:17:35 UTC (rev 107)
+++ include/io_tools.h 2010-05-12 20:44:33 UTC (rev 108)
@@ -3,4 +3,5 @@
int stream_to_buffer(char* buffer, int length, FILE* stream);
void buffer_to_stream(char* buffer, int length, FILE* stream);
+int file_to_buffer(char** buffer, char* name);
void eat_whitespace(FILE* stream);
Modified: src/mpi_tools/io_tools.c
===================================================================
--- src/mpi_tools/io_tools.c 2010-05-12 20:17:35 UTC (rev 107)
+++ src/mpi_tools/io_tools.c 2010-05-12 20:44:33 UTC (rev 108)
@@ -1,7 +1,9 @@
#include <io_tools.h>
+#include <stdlib.h>
#include <unistd.h>
+#include <sys/stat.h>
/**
@return The total number of bytes stored in buffer.
@@ -34,6 +36,40 @@
}
}
+/**
+ @param name The file name
+ @return Number of bytes in buffer
+*/
+int
+file_to_buffer(char** buffer, char* name)
+{
+ struct stat stats;
+ int error = stat(name, &stats);
+ if (error)
+ return -1;
+ int length = stats.st_size;
+
+ FILE* file = fopen(name, "r");
+ if (!file)
+ {
+ return -1;
+ }
+
+ *buffer = malloc(length);
+
+ int total = 0;
+
+ while (total < length)
+ {
+ int chunk = length-total;
+ int actual = fread((*buffer)+total, 1, chunk, file);
+ total += actual;
+ }
+
+ return total;
+}
+
+
void
eat_whitespace(FILE* stream)
{
Modified: test/driver/test-cmd-get.c
===================================================================
--- test/driver/test-cmd-get.c 2010-05-12 20:17:35 UTC (rev 107)
+++ test/driver/test-cmd-get.c 2010-05-12 20:44:33 UTC (rev 108)
@@ -37,6 +37,7 @@
int length;
code = fscanf(from_cmpi, "%i\n", &length);
+ printf("length: %i\n");
if (code != 1)
crash("No response from driver!");
// printf("length: %i code: %i \n", length, code);
Modified: test/mpi_tools/module.mk.in
===================================================================
--- test/mpi_tools/module.mk.in 2010-05-12 20:17:35 UTC (rev 107)
+++ test/mpi_tools/module.mk.in 2010-05-12 20:44:33 UTC (rev 108)
@@ -12,7 +12,7 @@
$(DIR)/test%.out: test/mpi_tools/test%.x
$(Q) " TEST $(@) "
- $(E)$(LAUNCH) -n 3 $(<) > $(@) 2>&1
+ $(E) $(<) > $(@) 2>&1
$(DIR)/test%.x: test/mpi_tools/test%.o $(MPITOOLS_OBJS)
$(Q) " LINK $(@) "
Added: test/mpi_tools/test-file.c
===================================================================
--- test/mpi_tools/test-file.c (rev 0)
+++ test/mpi_tools/test-file.c 2010-05-12 20:44:33 UTC (rev 108)
@@ -0,0 +1,31 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <mpi.h>
+
+#include <io_tools.h>
+#include <mpi_tools.h>
+
+int
+main(int argc, char* argv[])
+{
+ MPI_Init(&argc, &argv);
+
+ char* buffer;
+
+ int total = file_to_buffer(&buffer, "setup.sh");
+
+ //printf("got buffer: %i\n", total);
+
+ if (total < 0)
+ exit(1);
+
+ fwrite(buffer, sizeof(char), total, stdout);
+ //printdata("data: ", buffer, 4);
+ //printf("\n");
+
+ MPI_Finalize();
+
+ 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-23 23:18:20
|
Revision: 147
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=147&view=rev
Author: jmwozniak
Date: 2010-05-23 23:18:14 +0000 (Sun, 23 May 2010)
Log Message:
-----------
More DMALLOC
Modified Paths:
--------------
Makefile.in
include/cmpi-cp.h
include/dpkm_list.h
include/lru_table.h
include/mpi_tools.h
src/adts/dpkm_list.c
src/adts/keyvalue.c
src/adts/lru_table.c
src/cmpi/cmpi.c
src/cmpi-cp/cmpi-cp.c
src/dense-1/dense.c
src/mpi_tools/mpi_tools.c
src/mpirpc/mpirpc.c
test/adts/test-dpkm_list.c
test/adts/test-inlist.c
test/adts/test-lru_table01.c
test/adts/test-lru_table02.c
test/adts/test_helpers.h
test/cmpi-db/test-loop.zsh
test/mpirpc/test-args.c
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-22 21:40:52 UTC (rev 146)
+++ Makefile.in 2010-05-23 23:18:14 UTC (rev 147)
@@ -477,23 +477,31 @@
# Formats to one file per line & extracts junk and extra files in *.d
deps.txt: $(CMPI_DEPS)
$(Q) " DEPS.TXT "
- $(E) cat $(CMPI_DEPS) | fmt -w 1 | cut -f 1 | \
- sed 's/ //g;s/\\//g' | \
- grep -v '.*\.o\>\|.*\.po\>\|.*\.d\>' | \
- sort -u > $(@)
+ $(E) cat $(CMPI_DEPS) | \
+ fmt -w 1 | cut -f 1 | \
+ sed 's/ //g;s/\\//g' | \
+ grep -v '.*\.o\>\|.*\.po\>\|.*\.d\>' | \
+ sort -u > $(@)
+RM_ALL = find . -name .svn -prune -o -name $(1) -exec rm -fv \{\} \;
+
# top rule for cleaning up tree
-clean::
+clean:
$(Q) " CLEAN"
$(E)rm -fv $(CMPI_DEPS) $(TEST_DEPS) \
- $(MPIRPC) $(CMPI) $(ADTS_OBJS) $(MPIRPC_OBJS) $(CMPI_OBJS) \
+ $(MPIRPC) $(CMPI) \
+ $(ADTS_OBJS) $(MPIRPC_OBJS) $(CMPI_OBJS) \
$(KDA_OBJS) $(CMPI_IO) $(CMPI_OBJS) $(TABLE_OBJS) \
hex unhex hexord unpublish node driver \
$(TEST_OUTPUT) $(TEST_PROGS) $(TEST_OBJS) \
$(PROGS) $(CMPICP_OBJS) $(CMPIDB_OBJS) splint.out
- $(E)find . -name "*.failed" -exec rm -fv \{\} \;
- $(E)find . -name "*.bombed" -exec rm -fv \{\} \;
- $(E)find . -name "test-success.out" -exec rm -fv \{\} \;
+ $(E) $(call RM_ALL, "*.failed" )
+ $(E) $(call RM_ALL, "*.bombed" )
+ $(E) $(call RM_ALL, "tool.out" )
+ $(E) $(call RM_ALL, "input.data" )
+ $(E) $(call RM_ALL, "output.data" )
+ $(E) $(call RM_ALL, "test-success.out" )
+ $(E) $(call RM_ALL, "dmalloc*.out" )
# $(E)find . -name "*.avg" -exec rm -fv \{\} \;
# $(E)find . -name "*.per" -exec rm -fv \{\} \;
Modified: include/cmpi-cp.h
===================================================================
--- include/cmpi-cp.h 2010-05-22 21:40:52 UTC (rev 146)
+++ include/cmpi-cp.h 2010-05-23 23:18:14 UTC (rev 147)
@@ -1,5 +1,11 @@
-// #include <node.h>
+/**
+ * CMPI-CP command-line tool
+ *
+ * This has to be as small and fast as possible.
+ * We do not compile with MPICC or any of our libs.
+ * */
+
#include <accessor.h>
#include <getopt.h>
Modified: include/dpkm_list.h
===================================================================
--- include/dpkm_list.h 2010-05-22 21:40:52 UTC (rev 146)
+++ include/dpkm_list.h 2010-05-23 23:18:14 UTC (rev 147)
@@ -102,10 +102,13 @@
void dpkm_list_printf(char* format, struct dpkm_list* target);
-void dpkm_list_fprintf(FILE* file, char* format, struct dpkm_list* target);
+void dpkm_list_fprintf(FILE* file, char* format,
+ struct dpkm_list* target);
void dpkm_list_printdata(struct dpkm_list* target);
+void dpkm_list_fprintdata(FILE* file, struct dpkm_list* target);
+
int dpkm_list_tostring(char* str, size_t size,
char* format, struct dpkm_list* target);
Modified: include/lru_table.h
===================================================================
--- include/lru_table.h 2010-05-22 21:40:52 UTC (rev 146)
+++ include/lru_table.h 2010-05-23 23:18:14 UTC (rev 147)
@@ -31,7 +31,7 @@
struct lru_table* lru_table_create(int capacity, int limit);
struct keyvalue* lru_table_add(struct lru_table *table,
- char* key, char* data, int length);
+ char* key, void* data, int length);
bool lru_table_update(struct lru_table *table,
char* key, char* data, int offset, int length);
@@ -48,4 +48,6 @@
void lru_table_printdata(struct lru_table* target);
+void lru_table_fprintdata(FILE* file, struct lru_table* target);
+
#endif
Modified: include/mpi_tools.h
===================================================================
--- include/mpi_tools.h 2010-05-22 21:40:52 UTC (rev 146)
+++ include/mpi_tools.h 2010-05-23 23:18:14 UTC (rev 147)
@@ -62,6 +62,7 @@
void printbinary(unsigned int number);
void printdata(char* tag, char* data, int length);
+void fprintdata(FILE* file, char* tag, char* data, int length);
int flip2(int i);
unsigned int ilog2(unsigned int j);
unsigned int isqrt(unsigned int j);
@@ -135,7 +136,7 @@
#define NOTE_I(m,i) DEBUG(note_i(m,i))
#define NOTE_II(m,i,j) DEBUG(note_ii(m,i,j))
#define NOTE_U(m,u) DEBUG(note_u(m,u))
-#define NOTE_P(m,p) DEBUG(note_p(m,p))
+#define NOTE_P(m,s) DEBUG(note_p(m,))
#define NOTE_S(m,s) DEBUG(note_s(m,s))
#define NOTE_SX(m,s,i) DEBUG(note_sx(m,s,i))
#define NOTE_SXI(m,s,x,i) DEBUG(note_sxi(m,s,x,i))
@@ -353,7 +354,6 @@
{ \
SHOW_S(dmalloc_logpath); \
dmalloc_shutdown(); \
- /* free(dmalloc_logpath); */ \
dmalloc_log_unfreed(); \
});
Modified: src/adts/dpkm_list.c
===================================================================
--- src/adts/dpkm_list.c 2010-05-22 21:40:52 UTC (rev 146)
+++ src/adts/dpkm_list.c 2010-05-23 23:18:14 UTC (rev 147)
@@ -199,10 +199,9 @@
}
*/
- /**
- Return list head data.
- */
-
+/**
+ Return list head data.
+*/
void*
dpkm_list_peek(struct dpkm_list* target)
{
@@ -864,14 +863,14 @@
Print list using printdata() for values.
*/
void
-dpkm_list_printdata(struct dpkm_list* target)
+dpkm_list_fprintdata(FILE* file, struct dpkm_list* target)
{
struct dpkm_list_item* item;
- printf("[");
+ fprintf(file, "[");
for (item = target->head; item; item = item->next)
{
- printf("(%s@%i,", item->key, item->length);
+ fprintf(file, "(%s@%i,", item->key, item->length);
printdata("", item->data, item->length);
printf(")");
if (item->next)
@@ -880,6 +879,12 @@
printf("]\n");
}
+void
+dpkm_list_printdata(struct dpkm_list* target)
+{
+ dpkm_list_fprintdata(stdout, target);
+}
+
/**
Free this dpkm_list but not its data.
*/
Modified: src/adts/keyvalue.c
===================================================================
--- src/adts/keyvalue.c 2010-05-22 21:40:52 UTC (rev 146)
+++ src/adts/keyvalue.c 2010-05-23 23:18:14 UTC (rev 147)
@@ -1,16 +1,17 @@
-#include <stdlib.h>
+#include <stdlib.h>
#include "keyvalue.h"
/**
- Free this keyvalue pair and its member data pointers.
+ Free this keyvalue pair and its member data pointers.
*/
void
keyvalue_destroy(struct keyvalue* kv)
{
- NOTE_F;
+ NOTE_F;
+ assert(kv);
free(kv->key);
free(kv->data);
- free(kv);
+ free(kv);
}
Modified: src/adts/lru_table.c
===================================================================
--- src/adts/lru_table.c 2010-05-22 21:40:52 UTC (rev 146)
+++ src/adts/lru_table.c 2010-05-23 23:18:14 UTC (rev 147)
@@ -73,15 +73,16 @@
Adds new item to end of table list and lru list.
Sets those two item ptrs to each other.
- @param key Must be on the heap.
- @param data Must be on the heap.
+ @param key
+ @param data
@return NULL if the table is not overfull or a
struct keyvalue* representing the key/data pair
that was LRU and selected as a victim.
*/
struct keyvalue*
-lru_table_add(struct lru_table* table, char* key, char* data, int length)
+lru_table_add(struct lru_table* table, char* key,
+ void* data, int length)
{
NOTE_FS(key);
@@ -101,7 +102,6 @@
if (victim == NULL)
{
- NOTE("no victim\n");
table->size++;
}
else
@@ -220,9 +220,6 @@
else
{
int oldest_index = hash_string(oldest->key, table->capacity);
- // SHOW_P((void*) oldest);
- // NOTE_S("OLDEST: ", oldest->key);
- // NOTE_S("OLDEST: ", ((struct dpkm_list_item*) oldest->ptr)->key);
dpkm_list_excise(table->array[oldest_index], oldest->ptr);
result = (struct keyvalue*) malloc(sizeof(struct keyvalue));
// SHOW_S(oldest->key);
@@ -231,6 +228,7 @@
result->length = oldest->length;
free(oldest->ptr);
free(oldest);
+ table->size--;
}
return result;
@@ -325,21 +323,28 @@
/**
*/
void
-lru_table_printdata(struct lru_table* target)
+lru_table_fprintdata(FILE* file, struct lru_table* target)
{
int i;
- printf("LRU_TABLE(%i) \n{\n", target->size);
- printf("LRU: ");
- dpkm_list_printdata(target->lru);
+ fprintf(file, "LRU_TABLE(%i) \n{\n", target->size);
+ fprintf(file, "LRU: ");
+ dpkm_list_fprintdata(file, target->lru);
for (i = 0; i < target->capacity; i++)
if (target->array[i]->size > 0)
{
- printf(" %i: ", i);
- dpkm_list_printdata(target->array[i]);
+ fprintf(file, " %i: ", i);
+ dpkm_list_fprintdata(file, target->array[i]);
}
- printf("}\n");
+ fprintf(file, "}\n");
}
+void
+lru_table_printdata(struct lru_table* target)
+{
+ lru_table_fprintdata(stdout, target);;
+}
+
+
/** Dump dpkm_list to string a la snprintf()
size must be greater than 2.
format specifies the output format for the data items
Modified: src/cmpi/cmpi.c
===================================================================
--- src/cmpi/cmpi.c 2010-05-22 21:40:52 UTC (rev 146)
+++ src/cmpi/cmpi.c 2010-05-23 23:18:14 UTC (rev 147)
@@ -115,7 +115,7 @@
int result;
NOTE_F;
- DEBUG(lru_table_fprintf(debug_file, "%s", cmpi_cache));
+ DEBUG(lru_table_fprintdata(debug_file, cmpi_cache));
struct keyvalue* found = lru_table_search(cmpi_cache, key);
if (found)
@@ -129,6 +129,7 @@
}
else
{
+ printf("LOADPAIR!\n");
result = cmpi_disk_loadpair(key, data);
if (*data != NULL)
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-05-22 21:40:52 UTC (rev 146)
+++ src/cmpi-cp/cmpi-cp.c 2010-05-23 23:18:14 UTC (rev 147)
@@ -23,12 +23,26 @@
int value_size;
void
+finish(char* msg, int code)
+{
+ if (msg)
+ printf("%s\n", msg);
+#ifdef DMALLOC
+ printf("dmalloc_logpath: %s\n", dmalloc_logpath); \
+ dmalloc_shutdown(); \
+ dmalloc_log_unfreed();
+#endif
+ exit(code);
+}
+
+
+void
cmpi_cp_args(int argc, char* argv[])
{
if (argc == 1)
{
printhelp();
- exit(1);
+ finish(NULL, 1);
}
target1 = argv[1];
target2 = argv[2];
@@ -81,6 +95,9 @@
char data[value_size];
char msg[100];
int count = 0;
+
+ debug(printf("cmpi_cmp_put()...\n"));
+
while (! feof(file))
{
int total = 0;
@@ -134,7 +151,7 @@
int count, c;
int length;
- printf("cmpi_cp_get()\n");
+ debug(printf("cmpi_cp_get()\n"));
// fflush(stdout);
fprintf(to_cmpi, "get %s\n", object);
@@ -143,7 +160,7 @@
// c = fscanf(from_cmpi, "%i\n", &length);
fgets(message, 64, from_cmpi);
//printf("message: %i\n", c);
- printf("message: %s\n", message);
+ debug(printf("message: %s\n", message));
sscanf(message, "%i", &length);
if (length == -1)
@@ -157,7 +174,7 @@
if (c != 1)
{
printf("bad response: %s\n", data);
- exit(1);
+ finish(NULL, 1);
}
printf("count: %i\n", count);
@@ -189,7 +206,7 @@
bad_file(char* filename)
{
printf("Could not open: %s\n", filename);
- exit(1);
+ finish(NULL, 1);
}
/**
@@ -243,7 +260,7 @@
int
main(int argc, char* argv[])
{
- // printf("\ncmpi-cp start\n\n");
+ debug(printf("\ncmpi-cp start\n\n"));
fflush(stdout);
@@ -261,13 +278,12 @@
if (target1_type == CMPI_CP_FILE &&
target2_type == CMPI_CP_FILE)
- {
- printf("cmpi-cp: given two files!\n");
- exit(1);
- }
+ finish("cmpi-cp: given two files!", 1);
driver_access_fifo_setup(NULL);
+ debug(printf("setup\n"));
driver_access_fifo();
+ debug(printf("access\n"));
int result =
cmpi_cp_case(target1_type, object1, target2_type, object2);
@@ -276,12 +292,10 @@
{
// cmpi_get could not find the dht:// target
printf("does not exist: %s\n", target1);
- exit(1);
+ finish(NULL, 1);
}
else if (result != CMPI_SUCCESS)
- {
- printf("error\n");
- exit(1);
- }
+ finish("error!\n", 1);
+
return 0;
}
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2010-05-22 21:40:52 UTC (rev 146)
+++ src/dense-1/dense.c 2010-05-23 23:18:14 UTC (rev 147)
@@ -275,7 +275,7 @@
char* key = heap(args);
cmpi_cached_store(key, blob, blob_length);
- DEBUG(lru_table_printf("%s", cmpi_cache));
+ DEBUG(lru_table_printdata(cmpi_cache));
MPIRPC_Null(caller, unique);
}
@@ -292,7 +292,7 @@
sscanf(args, "%s %i", key, &offset);
cmpi_cached_update(key, blob, offset, blob_length);
- // DEBUG(lru_table_printf("%s", cmpi_cache));
+ // DEBUG(lru_table_printdata("%s", cmpi_cache));
MPIRPC_Null(caller, unique);
}
@@ -331,7 +331,7 @@
{
MPIRPC_Null(caller, unique);
note("cmpi_cache:");
- lru_table_printf("%s", cmpi_cache);
+ lru_table_printdata(cmpi_cache);
}
void
Modified: src/mpi_tools/mpi_tools.c
===================================================================
--- src/mpi_tools/mpi_tools.c 2010-05-22 21:40:52 UTC (rev 146)
+++ src/mpi_tools/mpi_tools.c 2010-05-23 23:18:14 UTC (rev 147)
@@ -80,29 +80,35 @@
*/
void
-printdata(char* tag, char* data, int length)
+fprintdata(FILE* file, char* tag, char* data, int length)
{
int i;
int c;
- printf("%s[", tag);
+ fprintf(file, "%s[", tag);
for (i = 0; i < length; i++)
{
c = data[i];
if (c == '\0')
- printf("\\0");
+ fprintf(file, "\\0");
else if (c == '\n')
- printf("\\n");
+ fprintf(file, "\\n");
else if (c == '\t')
- printf("\\t");
+ fprintf(file, "\\t");
else if (c >= 32 && c <=126)
- printf("%c", c);
+ fprintf(file, "%c", c);
else
- printf("\\%i", (int) c);
+ fprintf(file, "\\%i", (int) c);
}
- printf("]");
+ fprintf(file, "]");
}
void
+printdata(char* tag, char* data, int length)
+{
+ fprintdata(stdout, tag, data, length);
+}
+
+void
printbinary(unsigned int number)
{
int x;
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2010-05-22 21:40:52 UTC (rev 146)
+++ src/mpirpc/mpirpc.c 2010-05-23 23:18:14 UTC (rev 147)
@@ -389,13 +389,13 @@
/* printf("\t [%i] %s(%s) for %i \n",
mpi_rank, name, args, caller); */
- char* (*f)(MPIRPC_Node,int,char*,char*,int) =
+ char* (*handler)(MPIRPC_Node,int,char*,char*,int) =
hashtable_search(portmap, name);
- if (f == NULL)
+ if (handler == NULL)
printf("No such method: %s \n", name);
else
- f(caller, unique, args, blob, blob_length);
+ handler(caller, unique, args, blob, blob_length);
}
/**
Modified: test/adts/test-dpkm_list.c
===================================================================
--- test/adts/test-dpkm_list.c 2010-05-22 21:40:52 UTC (rev 146)
+++ test/adts/test-dpkm_list.c 2010-05-23 23:18:14 UTC (rev 147)
@@ -5,6 +5,8 @@
#include <dpkm_list.h>
+#include "test_helpers.h"
+
void extra(struct dpkm_list_item* item)
{
if (item)
@@ -39,21 +41,6 @@
}
}
-void* makedata(int n)
-{
- char* result = malloc(n*sizeof(char));
- for (int i = 0; i < n; i++)
- result[i] = 'X';
- return (void*) result;
-}
-
-char* makekey(int i)
-{
- char* result = malloc(16);
- sprintf(result, "%i", i);
- return result;
-}
-
int
main(int argc, char* argv[])
{
Modified: test/adts/test-inlist.c
===================================================================
--- test/adts/test-inlist.c 2010-05-22 21:40:52 UTC (rev 146)
+++ test/adts/test-inlist.c 2010-05-23 23:18:14 UTC (rev 147)
@@ -25,7 +25,7 @@
MPI_Finalize();
- TEST_DMALLOC;
+ DMALLOC_COMPLETE;
return 0;
}
Modified: test/adts/test-lru_table01.c
===================================================================
--- test/adts/test-lru_table01.c 2010-05-22 21:40:52 UTC (rev 146)
+++ test/adts/test-lru_table01.c 2010-05-23 23:18:14 UTC (rev 147)
@@ -5,10 +5,35 @@
#include <lru_table.h>
+/*
#ifdef DMALLOC
#include "dmalloc.h"
#endif
+*/
+#include "test_helpers.h"
+
+void extra_kv(struct keyvalue* kv)
+{
+ if (kv)
+ {
+ printf("extra: %s \n", kv->key);
+ free(kv);
+ }
+}
+
+/**
+ Clean up extra keyvalue and its key and data.
+*/
+void extra_kv_kd(struct keyvalue* kv)
+{
+ if (kv)
+ {
+ printf("extra: %s \n", kv->key);
+ free(kv);
+ }
+}
+
int
main(int argc, char* argv[])
{
@@ -19,90 +44,83 @@
struct lru_table* table = lru_table_create(5, 4);
- int* zero = malloc(sizeof(int));
int* one = malloc(sizeof(int));
int* two = malloc(sizeof(int));
- int* three = malloc(sizeof(int));
- int* four = malloc(sizeof(int));
- int* five = malloc(sizeof(int));
- int* eight = malloc(sizeof(int));
- *zero = 0;
*one = 1;
*two = 2;
- *three = 3;
- *four = 4;
- *five = 5;
- *eight = 8;
struct keyvalue* kv;
- kv = lru_table_add(table, heap("two"), (char*) two, sizeof(int));
+ kv = lru_table_add(table, "one", one, sizeof(int));
lru_table_printf("%i", table);
- if (kv)
- printf("victim: %s \n", kv->key);
+ extra_kv(kv);
printf("\n");
- kv = lru_table_add(table, heap("one"), (char*) one, sizeof(int));
+ kv = lru_table_add(table, "two", two, sizeof(int));
lru_table_printf("%i", table);
- if (kv)
- printf("victim: %s \n", kv->key);
+ extra_kv(kv);
printf("\n");
- struct keyvalue* result;
+ kv = lru_table_search(table, "one");
+ assert(kv);
+ printf("data: %i\n", *(int*) kv->data);
+ free(kv);
- result = lru_table_search(table, "one");
- if (result == NULL)
- printf("one not found\n");
- else
- {
- printf("data: %i\n", (int) *result->data);
- free(result);
- }
+ kv = lru_table_search(table, "two");
+ assert(kv);
+ printf("data: %i\n", *(int*) kv->data);
+ free(kv);
- result = lru_table_search(table, "two");
- if (result == NULL)
- printf("two not found\n");
- else
- {
- printf("data: %i\n", (int) *result->data);
- free(result);
- }
+ kv = lru_table_search(table, "one");
+ assert(kv);
+ printf("data: %i\n", *(int*) kv->data);
+ free(kv);
- result = lru_table_search(table, "one");
- if (result == NULL)
- printf("one not found\n");
- else
+ while ((kv = lru_table_poll(table)))
{
- printf("data: %i\n", (int) *result->data);
- free(result);
+ printf("polled: %s %i\n", kv->key, *kv->data);
+ free(kv);
}
- result = lru_table_search(table, "two");
- if (result == NULL)
- printf("two not found\n");
- else
+ assert(table->size == 0);
+ lru_table_free(table);
+
+ free(one);
+ free(two);
+
+ note("loop...");
+ table = lru_table_create(6, 4);
+ for (int i = 0; i < 30; i++)
{
- printf("data: %i\n", (int) *result->data);
- free(result);
+ lru_table_printdata(table);
+ char* key = makekey(i);
+ if (rand() % 2)
+ {
+ void* data = makedata(i);
+ kv = lru_table_add(table, key, data, i);
+ extra_kv_kd(kv);
+ }
+ else
+ {
+ note_s("search: ", key);
+ kv = lru_table_search(table, key);
+ free(key);
+ extra_kv(kv);
+ }
}
- result = lru_table_search(table, "two");
- if (result == NULL)
- printf("two not found\n");
- else
+ note("draining...");
+ while ((kv = lru_table_poll(table)))
{
- printf("data: %i\n", (int) *result->data);
- free(result);
+ printf("polled: %s\n", kv->key, kv->data);
+ printdata("", kv->data, kv->length);
+ keyvalue_destroy(kv);
}
- while ((result = lru_table_poll(table)))
- {
- printf("polled: %s %i\n", result->key, *result->data);
- keyvalue_destroy(result);
- }
+ assert(table->size == 0);
lru_table_free(table);
/*
Modified: test/adts/test-lru_table02.c
===================================================================
--- test/adts/test-lru_table02.c 2010-05-22 21:40:52 UTC (rev 146)
+++ test/adts/test-lru_table02.c 2010-05-23 23:18:14 UTC (rev 147)
@@ -1,6 +1,6 @@
/**
- * Test lru_table functionality.
+ * Test lru_table update functionality.
* */
#include <lru_table.h>
Modified: test/adts/test_helpers.h
===================================================================
--- test/adts/test_helpers.h 2010-05-22 21:40:52 UTC (rev 146)
+++ test/adts/test_helpers.h 2010-05-23 23:18:14 UTC (rev 147)
@@ -1,9 +1,26 @@
+/*
#define TEST_DMALLOC \
DMALLOC_SETUP( \
{ \
SHOW_S(dmalloc_logpath); \
dmalloc_shutdown(); \
- /* free(dmalloc_logpath); */ \
dmalloc_log_unfreed(); \
});
+
+*/
+
+void* makedata(int n)
+{
+ char* result = malloc(n*sizeof(char));
+ for (int i = 0; i < n; i++)
+ result[i] = 'X';
+ return (void*) result;
+}
+
+char* makekey(int i)
+{
+ char* result = malloc(16);
+ sprintf(result, "%i", i);
+ return result;
+}
Modified: test/cmpi-db/test-loop.zsh
===================================================================
--- test/cmpi-db/test-loop.zsh 2010-05-22 21:40:52 UTC (rev 146)
+++ test/cmpi-db/test-loop.zsh 2010-05-23 23:18:14 UTC (rev 147)
@@ -2,7 +2,7 @@
# Be sure to make tests with D=1
-# set -x
+set -x
OUTPUT=$1
NODES=$2
@@ -12,17 +12,24 @@
LOOPS=10
-cmpicp_error()
+TOOL_OUT=tool.out
+INPUT_DATA=input.data
+OUTPUT_DATA=output.data
+
+tool_error()
{
- ERR=$1
+ TOOL=$1
+ ERR=$2
if [[ ${ERR} != 0 ]]
then
- cat cmpi-cp.out
- rm -v cmpi-cp.out
- print "cmpi-cp error: ${ERR}"
+ cat ${TOOL_OUT}
+ rm -v ${TOOL_OUT}
+ print "${TOOL}: error: ${ERR}"
kill ${DB_PID}
kill ${BOMB_PID}
crash "failed"
+ else
+ print "success"
fi
}
@@ -36,23 +43,27 @@
sleep ${TOTAL}
-print > cmpi-cp.out
+print > ${TOOL_OUT}
for ((i=0 ; i<LOOPS ; i++))
do
- echo "DATA_${i}" > test-cp.input.data
- echo "cmpi-cp insert" >>& cmpi-cp.out
- bin/cmpi-cp test-cp.input.data dht://test-${i} >>& cmpi-cp.out
- cmpicp_error ${?}
+ echo "DATA_${i}" > ${INPUT_DATA}
+ echo "cmpi-cp insert" >>& ${TOOL_OUT}
+ bin/cmpi-cp ${INPUT_DATA} dht://test-${i} >>& ${TOOL_OUT}
+ tool_error "cmpi-cp" ${?} >>& ${TOOL_OUT}
- echo "\n\ncmpi-cp retrieve" >>& cmpi-cp.out
- bin/cmpi-cp dht://test-${i} test-cp.output.data >>& cmpi-cp.out
- cmpicp_error ${?}
- echo "\n read: " >>& cmpi-cp.out
- cat test-cp.output.data >>& cmpi-cp.out
- echo "\n" >>& cmpi-cp.out
+ echo "\n\ncmpi-cp retrieve" >>& ${TOOL_OUT}
+ bin/cmpi-cp dht://test-${i} ${OUTPUT_DATA} >>& ${TOOL_OUT}
+ tool_error "cmpi-cp" ${?} >>& ${TOOL_OUT}
+ echo "\n read: " >>& ${TOOL_OUT}
+ cat ${OUTPUT_DATA} >>& ${TOOL_OUT}
+ echo "\n" >>& ${TOOL_OUT}
done
-bin/cmpi-db-quit >& /dev/null
+echo "quitting" >>& ${TOOL_OUT}
+bin/cmpi-db-quit >>& ${TOOL_OUT}
+tool_error "cmpi-db-quit" ${?} >>& ${TOOL_OUT}
+echo "quit" >>& ${TOOL_OUT}
+
# QUIT_PROCESS=${!}
wait ${DB_PID}
@@ -63,6 +74,4 @@
check_exits ${TOTAL} ${OUTPUT}
-rm -f cmpi-cp.out test-cp1.*.data
-
exit 0
Modified: test/mpirpc/test-args.c
===================================================================
--- test/mpirpc/test-args.c 2010-05-22 21:40:52 UTC (rev 146)
+++ test/mpirpc/test-args.c 2010-05-23 23:18:14 UTC (rev 147)
@@ -12,8 +12,6 @@
char* blob, int blob_length)
{
show_fs(args);
- if (args)
- free(args);
MPIRPC_Null(caller, unique);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-02-28 16:24:53
|
Revision: 157
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=157&view=rev
Author: jmwozniak
Date: 2011-02-28 16:24:47 +0000 (Mon, 28 Feb 2011)
Log Message:
-----------
Drop use of MPD (user can uncomment to re-enable)
Modified Paths:
--------------
test/cmpi/module.mk.in
test/mpirpc/module.mk.in
Modified: test/cmpi/module.mk.in
===================================================================
--- test/cmpi/module.mk.in 2011-02-28 16:24:03 UTC (rev 156)
+++ test/cmpi/module.mk.in 2011-02-28 16:24:47 UTC (rev 157)
@@ -43,7 +43,7 @@
endif
$(DIR)/test%.out: $(DIR)/test%.x $(DIR)/test%.zsh
- $(E) $(MPDCHECK)
+# $(E) $(MPDCHECK)
$(Q) " TEST $(@) "
$(E) $(patsubst %.x, %.zsh, $(<)) $(<) $(NODES) $(CLIENTS) $(LAUNCH)
Modified: test/mpirpc/module.mk.in
===================================================================
--- test/mpirpc/module.mk.in 2011-02-28 16:24:03 UTC (rev 156)
+++ test/mpirpc/module.mk.in 2011-02-28 16:24:47 UTC (rev 157)
@@ -16,7 +16,7 @@
$(DIR)/test%.out: $(DIR)/test%.x
$(Q) " TEST $(@) "
- $(E) $(MPDCHECK)
+# $(E) $(MPDCHECK)
$(E) $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
$(DIR)/test-success.out: test/adts/test-success.out \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-02-28 17:22:54
|
Revision: 161
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=161&view=rev
Author: jmwozniak
Date: 2011-02-28 17:22:48 +0000 (Mon, 28 Feb 2011)
Log Message:
-----------
Use ${LAUNCH} to select srun in tests
Modified Paths:
--------------
Makefile.in
test/adts/module.mk.in
test/adts/runtest.zsh
test/cmpi/test-manyputs.zsh
test/cmpi/test-putget.zsh
test/cmpi/test-tables.zsh
test/cmpi/test-update01.zsh
test/cmpi/test-update02.zsh
test/driver/test.zsh
test/gossip/module.mk.in
test/gossip/test-do.zsh
test/gossip/test-env.zsh
test/gossip/test-masks.zsh
Modified: Makefile.in
===================================================================
--- Makefile.in 2011-02-28 16:55:59 UTC (rev 160)
+++ Makefile.in 2011-02-28 17:22:48 UTC (rev 161)
@@ -1,4 +1,5 @@
+
# LIST OF TARGETS WHICH MAY BE USED WHEN RUNNING MAKE:
#
# all default rule; builds libs, server, and test programs
@@ -70,7 +71,7 @@
# MPIARGS = -f hosts
MPDCHECK = tools/mpd-available.zsh @USE_MPI@/bin/mpdlistjobs
-# Job launch selection
+# Job launch selection (mpiexec or srun)
ifeq (@HAVE_SRUN@,no)
LAUNCH = $(MPIEXEC) $(MPIARGS)
else
Modified: test/adts/module.mk.in
===================================================================
--- test/adts/module.mk.in 2011-02-28 16:55:59 UTC (rev 160)
+++ test/adts/module.mk.in 2011-02-28 17:22:48 UTC (rev 161)
@@ -16,7 +16,7 @@
$(DIR)/test%.out: $(DIR)/test%.x
$(Q) " TEST $(@) "
- $(E) test/adts/runtest.zsh $(<) $(@) 2>&1
+ $(E) LAUNCH=$(LAUNCH) ; test/adts/runtest.zsh $(<) $(@) 2>&1
$(DIR)/test-success.out: test/gossip/test-success.out \
$(TEST_ADTS_OUTPUT)
Modified: test/adts/runtest.zsh
===================================================================
--- test/adts/runtest.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/adts/runtest.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -3,7 +3,7 @@
PROG=$1
OUTPUT=$2
-${PROG} > ${OUTPUT}
+${LAUNCH} ${PROG} > ${OUTPUT}
if [[ $? != 0 ]]
then
mv -v ${OUTPUT} ${OUTPUT}.failed
Modified: test/cmpi/test-manyputs.zsh
===================================================================
--- test/cmpi/test-manyputs.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/cmpi/test-manyputs.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -20,7 +20,7 @@
# Monolithic execution (3 nodes, 3 clients):
- mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
+ ${LAUNCH} -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -29,7 +29,7 @@
# KDA-2B execution:
tools/startup_nodes.zsh $(( N-1 )) 100 &
- mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ ${LAUNCH} -n 1 test/cmpi/test01.x > CLIENT.out
sleep $(( N+15 ))
fi
Modified: test/cmpi/test-putget.zsh
===================================================================
--- test/cmpi/test-putget.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/cmpi/test-putget.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -20,7 +20,7 @@
# Monolithic execution (3 nodes, 3 clients):
- mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} >& ${OUTPUT}
+ ${LAUNCH} -n ${TOTAL} ${PROGRAM} -n ${NODES} >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -29,7 +29,7 @@
# KDA-2B execution:
tools/startup_nodes.zsh $(( N-1 )) 100 &
- mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ ${LAUNCH} -n 1 test/cmpi/test01.x > CLIENT.out
sleep $(( N+15 ))
fi
Modified: test/cmpi/test-tables.zsh
===================================================================
--- test/cmpi/test-tables.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/cmpi/test-tables.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -19,7 +19,7 @@
then
# Monolithic execution:
- mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
+ ${LAUNCH} -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -28,7 +28,7 @@
# KDA-2B execution:
tools/startup_nodes.zsh $(( N-1 )) 100 &
- mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ ${LAUNCH} -n 1 test/cmpi/test01.x > CLIENT.out
sleep $(( N+15 ))
fi
Modified: test/cmpi/test-update01.zsh
===================================================================
--- test/cmpi/test-update01.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/cmpi/test-update01.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -19,7 +19,7 @@
then
# Monolithic execution:
- mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
+ ${LAUNCH} -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -28,7 +28,7 @@
# KDA-2B execution:
tools/startup_nodes.zsh $(( N-1 )) 100 &
- mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ ${LAUNCH} -n 1 test/cmpi/test01.x > CLIENT.out
sleep $(( N+15 ))
fi
Modified: test/cmpi/test-update02.zsh
===================================================================
--- test/cmpi/test-update02.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/cmpi/test-update02.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -19,7 +19,7 @@
# Monolithic execution:
- mpiexec -n ${TOTAL} ${PROGRAM} -n ${CLIENTS} -p reps=10 >& ${OUTPUT}
+ ${LAUNCH} -n ${TOTAL} ${PROGRAM} -n ${CLIENTS} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -28,7 +28,7 @@
# KDA-2B execution:
tools/startup_nodes.zsh $(( N-1 )) 100 &
- mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ ${LAUNCH} -n 1 test/cmpi/test01.x > CLIENT.out
sleep $(( N+15 ))
fi
Modified: test/driver/test.zsh
===================================================================
--- test/driver/test.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/driver/test.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -25,7 +25,7 @@
CMPI_OPTS="-p driver_dir=${DRIVER_DIR}"
DRIVER=test/driver/test_driver.x
-mpiexec -n ${TOTAL} ${DRIVER} -n ${NODES} ${CMPI_OPTS} > ${OUTPUT} &
+${LAUNCH} -n ${TOTAL} ${DRIVER} -n ${NODES} ${CMPI_OPTS} > ${OUTPUT} &
DRIVER_PID=${!}
tools/timebomb.zsh ${$} 20 ${OUTPUT} $0 &
Modified: test/gossip/module.mk.in
===================================================================
--- test/gossip/module.mk.in 2011-02-28 16:55:59 UTC (rev 160)
+++ test/gossip/module.mk.in 2011-02-28 17:22:48 UTC (rev 161)
@@ -14,9 +14,9 @@
$(DIR)/test%.out: $(DIR)/test%.x
$(Q) " TEST $(@) "
- $(E)$(patsubst %.x, %.zsh, $(<)) $(<)
+ $(E)LAUNCH=$(LAUNCH) ; $(patsubst %.x, %.zsh, $(<)) $(<)
$(DIR)/test-success.out: test/mpi_tools/test-success.out \
$(TEST_GOSSIP_OUTPUT)
$(Q) " TOUCH $(@) "
- $(E) touch $(@)
+ $(E)touch $(@)
Modified: test/gossip/test-do.zsh
===================================================================
--- test/gossip/test-do.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/gossip/test-do.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -9,15 +9,15 @@
PROGRAM=$1
OUTPUT=${PROGRAM%.x}.out
-${PROGRAM} > ${OUTPUT} 2>&1
+${LAUNCH} ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUTPUT} 2>&1
+CMPI_DEBUG_MASK=example ${LAUNCH} ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUTPUT} 2>&1
+CMPI_DEBUG_MASK=all ${LAUNCH} ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
Modified: test/gossip/test-env.zsh
===================================================================
--- test/gossip/test-env.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/gossip/test-env.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -16,15 +16,15 @@
exit 1
}
-${PROGRAM} > ${OUTPUT} 2>&1
+${LAUNCH} ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUTPUT} 2>&1
+CMPI_DEBUG_MASK=example ${LAUNCH} ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUTPUT} 2>&1
+CMPI_DEBUG_MASK=all ${LAUNCH} ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
Modified: test/gossip/test-masks.zsh
===================================================================
--- test/gossip/test-masks.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/gossip/test-masks.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -9,7 +9,7 @@
PROGRAM=$1
OUTPUT=${PROGRAM%.x}.out
-${PROGRAM} > ${OUTPUT} 2>&1
+${LAUNCH} ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-28 19:53:24
|
Revision: 197
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=197&view=rev
Author: jmwozniak
Date: 2011-04-28 19:53:16 +0000 (Thu, 28 Apr 2011)
Log Message:
-----------
Overhaul to get Kademlia working again
Modified Paths:
--------------
docs/manual/manual.txt
include/cmpi.h
include/dense-1.h
include/kda-2.h
include/kda_conn-A.h
include/mpi_tools.h
include/mpirpc.h
include/xtree.h
src/adts/lru_table.c
src/adts/xtree.c
src/cmpi/cmpi.c
src/cmpi/driver.c
src/cmpi/mode_mono.c
src/cmpi/node.c
src/dense-1/cmpi_dense.c
src/dense-1/dense.c
src/kda-2/cmpi_kademlia.c
src/kda-2/conn-A.c
src/kda-2/conn-B.c
src/kda-2/kademlia.c
src/kda-2/neighbor.c
src/mpi_tools/mpi_tools.c
src/mpirpc/mpirpc.c
test/adts/test-dpkm_list.c
test/adts/test-lru_table01.c
test/cmpi/test-manyputs.c
test/cmpi/test-startup.c
test/driver/test-cmd-sleep.c
test/driver/test.zsh
test/mpi_tools/test-tools01.c
test/mpirpc/test-args.c
test/mpirpc/test-blob.c
test/mpirpc/test-ping.c
test/mpirpc/test-returns.c
Modified: docs/manual/manual.txt
===================================================================
--- docs/manual/manual.txt 2011-04-27 18:19:30 UTC (rev 196)
+++ docs/manual/manual.txt 2011-04-28 19:53:16 UTC (rev 197)
@@ -65,6 +65,8 @@
(+cmpi-db+) and the user connects to it via a cp-like tool
(+cmpi-cp+).
+image:cluster.png[Cluster mode operation]
+
Commands executed on submit host:
--------------------------------------------------------
#!/bin/sh
@@ -449,12 +451,12 @@
~~~~
The tests are defined for each component in +module.mk+. For each
-+test-*.c+, a +test-*.x+ executable is produced and launched. The
++test-\*.c+, a +test-\*.x+ executable is produced and launched. The
launcher is ; +assert()+s and output parsing are used to confirm
-correctness. Output is collected in +test-*.out+. If the test is run
-from a +test-*.zsh+, debugging output is collected and post-processed
+correctness. Output is collected in +test-\*.out+. If the test is run
+from a +test-\*.zsh+, debugging output is collected and post-processed
by the ZSH script. If the test fails, the output is moved to
-+test-*.out.failed+ (so make does not consider it).
++test-\*.out.failed+ (so make does not consider it).
make D=1 test_results
@@ -463,6 +465,8 @@
Components
----------
+image:cmpi-connections.png[C-MPI components outlined below.]
+
cmpi::
The C-MPI interface. Some reusable functionality is defined.
@@ -526,7 +530,7 @@
Abstract data types: lists, hash tables, etc.
-+gossip+;;
++gossip+::
A logging library from Phil Carns.
Modified: include/cmpi.h
===================================================================
--- include/cmpi.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/cmpi.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -124,9 +124,9 @@
void cmpi_params_add(char* key, char* value);
/**
- Copies out the result from the cache.
+ Obtain pointer to the result from the params table.
*/
-char* cmpi_params_search(char* key);
+char* cmpi_params_get(char* key);
//// Methods that the implementation must provide:
Modified: include/dense-1.h
===================================================================
--- include/dense-1.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/dense-1.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -33,25 +33,4 @@
void rpc_bootping(void);
void listen_loop(void);
-void handle_bootping(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_info(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_ping(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_query_id(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_query_id_k(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_store(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_update(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_retrieve(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_debug_cache(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_quit(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-
#endif
Modified: include/kda-2.h
===================================================================
--- include/kda-2.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/kda-2.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -78,19 +78,21 @@
//// Helpers...
+void KDA_Join(int other_id, int other_rank);
+
void KDA_Setup_node_port(void);
-void KDA_Serve(void);
-void KDA_Serve_id(KDA_ID other_id, MPIRPC_Node node);
-MPIRPC_Node KDA_Serve_accept(void);
-void KDA_Serve_client(MPIRPC_Node node);
-void KDA_Serve_handshake(MPIRPC_Node node,
- KDA_ID* other_id, int* msg);
-void KDA_Serve_neighbor(KDA_ID other_id, MPIRPC_Node node);
-void KDA_Setup_connector_port(void);
-void KDA_Connect_port(char* port);
-MPIRPC_Node* KDA_Attach(void);
-MPIRPC_Node* KDA_Attach_port(char* port);
-MPIRPC_Node* KDA_Register_hub(MPI_Comm comm);
+// void KDA_Serve(void);
+// void KDA_Serve_id(KDA_ID other_id, MPIRPC_Node node);
+// MPIRPC_Node KDA_Serve_accept(void);
+// void KDA_Serve_client(MPIRPC_Node node);
+//void KDA_Serve_handshake(MPIRPC_Node node,
+// KDA_ID* other_id, int* msg);
+//void KDA_Serve_neighbor(KDA_ID other_id, MPIRPC_Node node);
+// void KDA_Setup_connector_port(void);
+// void KDA_Connect_port(char* port);
+void KDA_Attach(struct list* contacts);
+// MPIRPC_Node* KDA_Attach_port(char* port);
+// MPIRPC_Node* KDA_Register_hub(MPI_Comm comm);
void KDA_Comm_set_name(KDA_Neighbor* neighbor);
@@ -103,7 +105,8 @@
// void KDA_Send_neighbor(MPI_Comm comm);
void KDA_Serve_shutdown(void);
void KDA_Detach(MPIRPC_Node node);
-void KDA_Shutdown(void);
+void KDA_Detach_hubs();
+void KDA_Shutdown(struct list* contacts);
void KDA_Shutdown_port(char* hub_port);
/**
@@ -144,10 +147,13 @@
MPIRPC* KDA_Lookup(MPIRPC_Node node, char* key);
MPIRPC* KDA_Lookup_k(MPIRPC_Node node, char* key);
-MPIRPC* KDA_Store(KDA_Neighbor* neighbor, char* key, char* value, int length);
-
+MPIRPC* KDA_Store(KDA_Neighbor* neighbor, char* key, char* value,
+ int length);
MPIRPC* KDA_Retrieve(KDA_Neighbor* neighbor, char* key);
+MPIRPC* KDA_Update(KDA_Neighbor* neighbor, char* key, char* value,
+ int length, int offset);
+
void listen_loop(void);
bool neighbor_add(KDA_Neighbor* neighbor);
Modified: include/kda_conn-A.h
===================================================================
--- include/kda_conn-A.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/kda_conn-A.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -10,9 +10,9 @@
/**
Translate a KDA_ID to a rank in MPI_COMM_WORLD.
*/
-void handle_get_rank(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length);
+MPIRPC_Handler(handle_get_rank);
/**
Return the local KDA_ID.
*/
-void handle_get_id(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length);
+MPIRPC_Handler(handle_get_id);
Modified: include/mpi_tools.h
===================================================================
--- include/mpi_tools.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/mpi_tools.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -94,6 +94,8 @@
#define OK NOTE("ok")
+void setup_debug_file(void);
+
/**
Simplify debugging statements.
*/
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/mpirpc.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -30,9 +30,9 @@
int status;
char name[MPIRPC_MAX_NAME];
char args[MPIRPC_MAX_ARGS];
- char* blob;
+ void* blob;
int blob_length;
- char* result;
+ void* result;
int result_length;
void* extras;
void (*proceed) (struct mpirpc* rpc);
@@ -67,6 +67,21 @@
MPI_Request request[4];
} MPIRPC_Value;
+/**
+ Defines MPIRPC handler "f"
+ Parameters:
+ the target node
+ the uniqifier
+ the args
+ the blob
+ the blob length
+ */
+#define MPIRPC_Handler_pointer(f) void \
+ (*f)(MPIRPC_Node,int,char*,void*,int)
+
+#define MPIRPC_Handler(f) void \
+ f(MPIRPC_Node caller, int unique, char* args, void* blob, int blob_length)
+
//// API...
void MPIRPC_Init(void);
@@ -75,8 +90,7 @@
void MPIRPC_Recv(MPI_Comm comm);
-void MPIRPC_Register(char* name,
- void (*f)(MPIRPC_Node,int,char*,char*,int));
+void MPIRPC_Register(char* name, MPIRPC_Handler_pointer(f));
bool MPIRPC_Comm_add(MPI_Comm comm);
@@ -86,20 +100,20 @@
void* extras, void (*proceed)(MPIRPC*));
MPIRPC* MPIRPC_Call_blob(MPIRPC_Node target, char* name, char* args,
- char* blob, int blob_length,
+ void* blob, int blob_length,
void* extras, void (*proceed)(MPIRPC*));
-char* MPIRPC_Block(MPIRPC_Node target, char* name, char* args);
+void* MPIRPC_Block(MPIRPC_Node target, char* name, char* args);
-char* MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
- char* blob, int blob_length);
+void* MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
+ void* blob, int blob_length);
-char* MPIRPC_Wait(MPIRPC* rpc);
+void* MPIRPC_Wait(MPIRPC* rpc);
void MPIRPC_Null(MPIRPC_Node caller, int unique);
void MPIRPC_Return(MPIRPC_Node caller, int unique,
- char* result, int rlength);
+ void* result, int rlength);
MPIRPC_Node* MPIRPC_Node_create(MPI_Comm comm, int rank);
Modified: include/xtree.h
===================================================================
--- include/xtree.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/xtree.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -6,73 +6,67 @@
#ifndef XTREE_H
#define XTREE_H
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <inlist.h>
-#include <ilist.h>
-#include <inlist.h>
-
-typedef int xtree_id;
+typedef int xtree_id;
#define XTREE_DEPTH (sizeof(xtree_id)*8)
-typedef struct xtree_object_s xtree_object;
+typedef struct xtree_object_s xtree_object;
typedef union xtree_thing_u xtree_thing;
-typedef enum
+typedef enum
{
XTREE_NODE,
XTREE_ITEM
-} xtree_tag;
+} xtree_tag;
typedef struct xtree_item_s
{
xtree_id id;
void* data;
xtree_object* smaller;
- xtree_object* bigger;
+ xtree_object* bigger;
} xtree_item;
typedef struct xtree_node_s
{
xtree_object* zero;
- xtree_object* one;
+ xtree_object* one;
} xtree_node;
union xtree_thing_u
{
xtree_node node;
- xtree_item item;
+ xtree_item item;
};
struct xtree_object_s
{
xtree_tag tag;
- xtree_thing thing;
+ xtree_thing thing;
};
struct xtree
{
- int size;
- xtree_object* root;
+ int size;
+ xtree_object* root;
};
struct xtree* xtree_create();
-void xtree_add(struct xtree* target, xtree_id id, void* data);
+void xtree_add(struct xtree* target, xtree_id id, void* data);
void* xtree_search(struct xtree* target, xtree_id id);
struct inlist* xtree_query(struct xtree* target,
- xtree_id id, int count);
+ xtree_id id, int count);
void xtree_printf(struct xtree* target);
-//// Internals:
+//// Internals:
-void xtree_replace(struct xtree* target, int depth,
+void xtree_replace(struct xtree* target, int depth,
xtree_object* old_object,
xtree_object* new_object);
-#endif
+#endif
Modified: src/adts/lru_table.c
===================================================================
--- src/adts/lru_table.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/adts/lru_table.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -7,11 +7,13 @@
return (i1>i2) ? i1 : i2;
}
+/*
static int
min(int i1, int i2)
{
return (i1<i2) ? i1 : i2;
}
+*/
struct lru_table*
lru_table_create(int capacity, int limit)
@@ -195,8 +197,6 @@
gossip_do(MASK_ADTS, lru_table_printf("%s", table));
DEBUG(printdata("old data: ", item->data, item->length));
- char* data = item->data;
-
int new_length = max(item->length, offset+length);
char* update = realloc(item->data, new_length);
Modified: src/adts/xtree.c
===================================================================
--- src/adts/xtree.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/adts/xtree.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -1,27 +1,34 @@
-#include <xtree.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <xtree.h>
+#include <ilist.h>
+
/**
@return The ith bit of id.
*/
int
bit(int i, xtree_id id)
{
- // printf("shift: %i\n", (1 << i));
+ // printf("shift: %i\n", (1 << i));
- return !! ((1 << i) & id);
+ return !! ((1 << i) & id);
}
struct xtree*
xtree_create()
{
struct xtree* result;
-
+
result = malloc(sizeof(struct xtree));
result->size = 0;
- result->root = NULL;
-
- return result;
+ result->root = NULL;
+
+ return result;
}
void
@@ -30,37 +37,37 @@
xtree_object* new_object;
xtree_object** p;
bool done;
- int depth;
+ int depth;
new_object = malloc(sizeof(xtree_object));
- new_object->tag = XTREE_ITEM;
+ new_object->tag = XTREE_ITEM;
new_object->thing.item.id = id;
new_object->thing.item.data = data;
if (target->size == 0)
{
- target->root = new_object;
- target->size++;
- return;
+ target->root = new_object;
+ target->size++;
+ return;
}
-
+
p = &(target->root);
- depth = XTREE_DEPTH-1;
+ depth = XTREE_DEPTH-1;
done = false;
while (!done)
{
if (*p == NULL)
{
- printf("inserting at NULL stub: depth: %i\n", depth);
- *p = new_object;
- target->size++;
- break;
+ printf("inserting at NULL stub: depth: %i\n", depth);
+ *p = new_object;
+ target->size++;
+ break;
}
else if ((*p)->tag == XTREE_ITEM)
{
xtree_replace(target, depth, *p, new_object);
- target->size++;
- break;
+ target->size++;
+ break;
}
else if ((*p)->tag == XTREE_NODE)
{
@@ -68,67 +75,65 @@
p = &((*p)->thing.node.zero);
else
p = &((*p)->thing.node.one);
- depth--;
+ depth--;
}
}
}
-#include <unistd.h>
-
void
-xtree_replace(struct xtree* target, int depth,
+xtree_replace(struct xtree* target, int depth,
xtree_object* old_object, xtree_object* new_object)
{
- xtree_item old_item;
+ xtree_item old_item = {0};
xtree_object* p;
xtree_id old_id;
- xtree_id new_id;
-
- xtree_object* new_node;
+ xtree_id new_id;
- // Shortcuts...
+ xtree_object* new_node;
+
+ // Shortcuts...
old_id = old_object->thing.item.id;
new_id = new_object->thing.item.id;
-
+
old_item.id = old_object->thing.item.id;
- old_item.data = old_object->thing.item.data;
+ old_item.data = old_object->thing.item.data;
- old_object->tag = XTREE_NODE;
+ old_object->tag = XTREE_NODE;
old_object->thing.node.zero = NULL;
- old_object->thing.node.one = NULL;
+ old_object->thing.node.one = NULL;
- printf("xtree_replace(%i)\n", depth);
+ printf("xtree_replace(%i)\n", depth);
printf("old %i: \n", old_id);
printf("new %i: \n", new_id);
-
+
p = old_object;
old_object = malloc(sizeof(xtree_object));
old_object->tag = XTREE_ITEM;
- old_object->thing.item = old_item;
-
+ old_object->thing.item = old_item;
+
while (true)
{
if (bit(depth,old_id) != bit(depth,new_id))
{
- printf("diff at: %i\n", depth);
-
+ printf("diff at: %i\n", depth);
+
if (bit(depth,old_id) == 0)
{
p->thing.node.zero = old_object;
- p->thing.node.one = new_object;
+ p->thing.node.one = new_object;
}
else
{
p->thing.node.zero = new_object;
- p->thing.node.one = old_object;
+ p->thing.node.one = old_object;
}
- break;
+ break;
}
else
{
- // printf("new_node\n");
+ // printf("new_node\n");
new_node = malloc(sizeof(xtree_object));
new_node->tag = XTREE_NODE;
new_node->thing.node.zero = NULL;
@@ -137,7 +142,7 @@
p->thing.node.zero = new_node;
else
p->thing.node.one = new_node;
- p = new_node;
+ p = new_node;
}
depth--;
}
@@ -145,19 +150,19 @@
/**
*/
-void
+void
xtree_find(xtree_object* p, xtree_id id, int count,
- int depth, struct ilist* objects)
+ int depth, struct ilist* objects)
{
if (p == NULL)
{
- return;
+ return;
}
-
+
if (p->tag == XTREE_ITEM)
{
- ilist_ordered_insert(objects, id ^ p->thing.item.id, p);
- return;
+ ilist_ordered_insert(objects, id ^ p->thing.item.id, p);
+ return;
}
if (bit(depth, id) == 0)
@@ -179,53 +184,53 @@
struct inlist*
xtree_query(struct xtree* target, xtree_id id, int count)
{
- struct inlist* result;
- struct ilist* objects;
+ struct inlist* result;
+ struct ilist* objects;
struct ilist_item* item;
- xtree_object* object;
-
+ xtree_object* object;
+
objects = ilist_create();
xtree_find(target->root, id, count, XTREE_DEPTH-1, objects);
- result = inlist_create();
+ result = inlist_create();
for (item = objects->head; item; item = item->next)
{
object = (xtree_object*) item->data;
inlist_add(result, object->thing.item.id);
}
- return result;
+ return result;
}
/**
- Return the data object for the matching id.
+ Return the data object for the matching id.
*/
void*
xtree_search(struct xtree* target, xtree_id id)
{
- void* result;
- struct ilist* objects;
- xtree_object* object;
+ void* result;
+ struct ilist* objects = ilist_create();
+ xtree_object* object;
result = NULL;
-
- xtree_find(target->root, id, 1, XTREE_DEPTH-1, objects);
+ xtree_find(target->root, id, 1, XTREE_DEPTH-1, objects);
+
if (objects->size > 0)
{
object = (xtree_object*) objects->head->data;
if (object->thing.item.id == id)
- result = object->thing.item.data;
+ result = object->thing.item.data;
}
-
- return result;
+
+ return result;
}
void
xtree_printf_item(xtree_item* item, int depth)
{
- printf(" %i", item->id);
+ printf(" %i", item->id);
}
void
@@ -234,27 +239,27 @@
char spaces[256];
memset(spaces, ' ', XTREE_DEPTH-depth);
- spaces[XTREE_DEPTH-depth] = '\0';
+ spaces[XTREE_DEPTH-depth] = '\0';
- // printf("depth: %i\n", depth)
-
+ // printf("depth: %i\n", depth)
+
if (object != NULL)
{
if (object->tag == XTREE_ITEM)
{
- printf("ITEM: ");
+ printf("ITEM: ");
xtree_printf_item(&(object->thing.item), depth);
}
else
{
if (object->thing.node.zero != NULL)
{
- printf("\n%s0 ", spaces);
+ printf("\n%s0 ", spaces);
xtree_printf_node(object->thing.node.zero, depth-1);
}
if (object->thing.node.one != NULL)
{
- printf("\n%s1 ", spaces);
+ printf("\n%s1 ", spaces);
xtree_printf_node(object->thing.node.one, depth-1);
}
}
@@ -264,10 +269,10 @@
void
xtree_printf(struct xtree* target)
{
- if (target->size > 0)
+ if (target->size > 0)
xtree_printf_node(target->root, XTREE_DEPTH-1);
else
printf("xtree: empty");
- printf("\n");
+ printf("\n");
}
Modified: src/cmpi/cmpi.c
===================================================================
--- src/cmpi/cmpi.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/cmpi/cmpi.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -48,9 +48,10 @@
Returns pointer to the matching value or NULL if not found.
*/
char*
-cmpi_params_search(char* key)
+cmpi_params_get(char* key)
{
char* result = hashtable_search(cmpi_params, key);
+ SHOW_FSS(key, result);
return result;
}
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/cmpi/driver.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -54,7 +54,7 @@
*/
void driver_setup_fifo_names()
{
- char* dir = cmpi_params_search("driver_dir");
+ char* dir = cmpi_params_get("driver_dir");
if (!dir)
dir = "/tmp";
Modified: src/cmpi/mode_mono.c
===================================================================
--- src/cmpi/mode_mono.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/cmpi/mode_mono.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -51,6 +51,7 @@
int cmpi_mode_first_client(int rank, int size, int nodes)
{
+ SHOW_FI(nodes);
return nodes;
}
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/cmpi/node.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -154,8 +154,8 @@
{
gossip_debug_init();
- //gossip_set_debug_mask(true,MASK_DEBUG|MASK_MPIRPC|MASK_ADTS|
- // MASK_CMPI|MASK_DRIVER);
+ gossip_set_debug_mask(true,MASK_DEBUG|MASK_MPIRPC|// MASK_ADTS|
+ MASK_CMPI|MASK_DRIVER);
gossip_enable_stdout();
@@ -171,12 +171,8 @@
whoami();
if (mpi_rank == 0)
- {
DEBUG(timestamp("START", NULL));
- }
- dmalloc_setup();
-
// Handle and store options...
options(argc, argv);
@@ -202,7 +198,7 @@
exit(1);
}
- char* tag = cmpi_params_search("tag");
+ char* tag = cmpi_params_get("tag");
if (tag)
note_s("tag: ", tag);
Modified: src/dense-1/cmpi_dense.c
===================================================================
--- src/dense-1/cmpi_dense.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/dense-1/cmpi_dense.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -255,7 +255,7 @@
DENSE_Read_params(void)
{
// NOTE_F;
- char* nodes_msg = cmpi_params_search("nodes");
+ char* nodes_msg = cmpi_params_get("nodes");
if (nodes_msg)
{
int n = sscanf(nodes_msg, "%i", &dense_nodes);
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/dense-1/dense.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -28,6 +28,17 @@
int k = 1;
+static MPIRPC_Handler(handle_bootping);
+static MPIRPC_Handler(handle_info);
+static MPIRPC_Handler(handle_ping);
+static MPIRPC_Handler(handle_query_id);
+static MPIRPC_Handler(handle_query_id_k);
+static MPIRPC_Handler(handle_store);
+static MPIRPC_Handler(handle_update);
+static MPIRPC_Handler(handle_retrieve);
+static MPIRPC_Handler(handle_debug_cache);
+static MPIRPC_Handler(handle_quit);
+
void
DENSE_Init(int k_in, MPI_Comm comm)
{
@@ -85,7 +96,7 @@
cmpi_mode_first_client(mpi_rank, mpi_size, dense_nodes);
NOTE("NOTIFYING");
int msg = -2;
- MPI_Send(&msg, 1, MPI_INT, client, 0, MPI_COMM_WORLD);
+ // MPI_Send(&msg, 1, MPI_INT, client, 0, MPI_COMM_WORLD);
}
}
@@ -217,31 +228,23 @@
MPIRPC_Block(node, "quit", NULL);
}
-void
-handle_bootping(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_bootping)
{
MPIRPC_Null(caller, unique);
rpc_bootping();
}
-void
-handle_info(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_info)
{
MPIRPC_Null(caller, unique);
}
-void
-handle_ping(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_ping)
{
MPIRPC_Null(caller, unique);
}
-void
-handle_query_id(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_query_id)
{
int object_id;
sscanf(args, "%X", &object_id);
@@ -251,9 +254,7 @@
MPIRPC_Return(caller, unique, result, length);
}
-void
-handle_query_id_k(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_query_id_k)
{
int i;
int object_id;
@@ -269,9 +270,7 @@
MPIRPC_Return(caller, unique, result, strlen(result)+1);
}
-void
-handle_store(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_store)
{
SHOW_FSI(args, blob_length);
@@ -283,9 +282,7 @@
DONE;
}
-void
-handle_update(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_update)
{
char* key = malloc(strlen(args)+1);
@@ -301,9 +298,7 @@
MPIRPC_Null(caller, unique);
}
-void
-handle_retrieve(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_retrieve)
{
NOTE_FS(args);
@@ -329,18 +324,14 @@
}
}
-void
-handle_debug_cache(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_debug_cache)
{
MPIRPC_Null(caller, unique);
puts("cmpi_cache:");
lru_table_printdata(cmpi_cache);
}
-void
-handle_quit(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_quit)
{
MPIRPC_Null(caller, unique);
sleep(1);
Modified: src/kda-2/cmpi_kademlia.c
===================================================================
--- src/kda-2/cmpi_kademlia.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/kda-2/cmpi_kademlia.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -6,10 +6,13 @@
*/
struct list* contacts;
+static void cmpi_impl_parameters(void);
+
CMPI_RETURN
cmpi_init_impl()
{
// NOTE_F;
+ cmpi_impl_parameters();
KDA_Init(3, 3);
return CMPI_SUCCESS;
@@ -18,9 +21,13 @@
CMPI_RETURN
cmpi_init_impl_client()
{
+ NOTE_F;
+
contacts = list_create();
KDA_Init_client(3,3);
+ KDA_Attach(contacts);
+
return CMPI_SUCCESS;
}
@@ -37,19 +44,30 @@
return CMPI_SUCCESS;
}
+static void
+cmpi_impl_parameters()
+{
+ char* value = cmpi_params_get("nodes");
+ assert(value);
+ cmpi_impl_parameter("nodes", value);
+}
+
CMPI_RETURN
cmpi_attach()
{
+ /*
CMPI_RETURN result;
if (KDA_Attach())
{
- add_contacts();
result = CMPI_SUCCESS;
}
else
result = CMPI_ERROR_SERVICENAME;
return result;
+ */
+ printf("cmpi_attach(): DEPRECATED!\n");
+ return CMPI_SUCCESS;
}
void
@@ -61,20 +79,19 @@
for (i = 0; i < KDA_SPACE_SIZE; i++)
for (item = k_bucket[i]->head;
item; item = item->next)
- {
- KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
- KDA_Neighbor_dump(neighbor);
- list_add_unique(contacts, KDA_Neighbor_cmp, neighbor);
- KDA_Comm_set_name(neighbor);
- }
+ {
+ KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
+ KDA_Neighbor_dump(neighbor);
+ list_add_unique(contacts, KDA_Neighbor_cmp, neighbor);
+ KDA_Comm_set_name(neighbor);
+ }
}
KDA_Neighbor*
contact_lookup(KDA_Neighbor* neighbor)
{
- struct list_item* item;
NOTE_FX(neighbor->id);
- for (item = contacts->head;
+ for (struct list_item* item = contacts->head;
item; item = item->next)
{
KDA_Neighbor* n = (KDA_Neighbor*) item->data;
@@ -82,8 +99,7 @@
return n;
}
- NOTE("CONTACT LOOKUP FAILED: LINKING");
- KDA_Harpoon(KDA_Random_neighbor()->node, neighbor->id);
+ KDA_Join(neighbor->id, neighbor->node.comm);
add_contacts();
return contact_lookup(neighbor);
@@ -118,7 +134,7 @@
MPIRPC_Wait(rpc);
- printf("cmpi_lookup()@%X -> %s \n", n->id, rpc->result);
+ printf("cmpi_lookup()@%X -> %s \n", n->id, (char*) rpc->result);
return 0;
}
@@ -159,12 +175,10 @@
for (item = neighbors->head;
item; item = item->next)
{
- KDA_Neighbor* neighbor =
- contact_lookup((KDA_Neighbor*) item->data);
+ KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
MPIRPC* rpc = KDA_Store(neighbor, key, value, length);
MPIRPC_Wait(rpc);
MPIRPC_Free(rpc);
- NOTE("freed");
}
list_destroy(neighbors);
@@ -208,7 +222,47 @@
return CMPI_SUCCESS;
}
+CMPI_RETURN
+cmpi_update(char* key, char* value, int length, int offset)
+{
+ struct list_item* item;
+ NOTE_FSS(key, value);
+
+ // printf("contacts: %i \n", contacts);
+
+ KDA_Neighbor* n = (KDA_Neighbor*) list_random(contacts);
+ MPIRPC* lookup = KDA_Lookup_k(n->node, key);
+ MPIRPC_Wait(lookup);
+
+ struct list* neighbors = KDA_Neighbor_node_list(lookup->result);
+
+ for (item = neighbors->head; item; item = item->next)
+ {
+ KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
+ MPIRPC* rpc = KDA_Update(neighbor, key, value, length, offset);
+ MPIRPC_Wait(rpc);
+ MPIRPC_Free(rpc);
+ }
+
+ list_destroy(neighbors);
+
+ DONE;
+ return CMPI_SUCCESS;
+}
+
void
+cmpi_debug_tables()
+{
+ puts("debug_tables()");
+}
+
+void
+cmpi_debug_caches()
+{
+ puts("debug_caches()");
+}
+
+void
cmpi_detach()
{
while (contacts->size > 0)
@@ -219,19 +273,21 @@
free(neighbor);
}
- while (hubs->size > 0)
- {
- MPIRPC_Node* hub = (MPIRPC_Node*) list_poll(hubs);
- KDA_Detach(*hub);
- free(hub);
- }
-
+ KDA_Detach_hubs();
NOTE("DETACHED");
}
+static void free_contacts();
+
void
cmpi_shutdown()
{
- KDA_Shutdown();
+ KDA_Shutdown(contacts);
+ free_contacts();
}
+void
+free_contacts()
+{
+ list_destroy(contacts);
+}
Modified: src/kda-2/conn-A.c
===================================================================
--- src/kda-2/conn-A.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/kda-2/conn-A.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -1,5 +1,7 @@
#include "kda_conn-A.h"
+#include "kda_neighbor-2.h"
+#include "cmpi_mode.h"
/**
Maps KDA_IDs to ints.
@@ -10,6 +12,7 @@
void
KDA_Init_conn()
{
+ NOTE_F;
// Add self to world_ra...
[truncated message content] |