c-mpi-commits Mailing List for C-MPI (Page 5)
Status: Pre-Alpha
Brought to you by:
jmwozniak
You can subscribe to this list here.
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
(64) |
May
(80) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2011 |
Jan
|
Feb
(7) |
Mar
(3) |
Apr
(33) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jmw...@us...> - 2010-05-12 20:17:41
|
Revision: 107
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=107&view=rev
Author: jmwozniak
Date: 2010-05-12 20:17:35 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Test multiple cmpi-cp's
Added Paths:
-----------
test/cmpi-db/test-loop.zsh
Added: test/cmpi-db/test-loop.zsh
===================================================================
--- test/cmpi-db/test-loop.zsh (rev 0)
+++ test/cmpi-db/test-loop.zsh 2010-05-12 20:17:35 UTC (rev 107)
@@ -0,0 +1,64 @@
+#!/bin/zsh
+
+# Be sure to make tests with D=1
+
+# set -x
+
+OUTPUT=$1
+PROCS=$2
+NODES=$3
+
+LOOPS=10
+
+source tools/test-helpers.zsh
+
+mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
+DB_PID=${!}
+
+tools/timebomb.zsh ${DB_PID} $(( PROCS*4 + LOOPS )) ${OUTPUT} $0 &
+BOMB_PID=${!}
+
+sleep ${PROCS}
+
+print > cmpi-cp.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
+ if [[ $? != 0 ]]
+ then
+ cat cmpi-cp.out
+ rm -v cmpi-cp.out
+ crash "cmpi-cp error!"
+ fi
+
+ echo "\n\ncmpi-cp retrieve" >>& cmpi-cp.out
+ bin/cmpi-cp dht://test-${i} test-cp.output.data >>& cmpi-cp.out
+ echo "\n read: " >>& cmpi-cp.out
+ cat test-cp.output.data >>& cmpi-cp.out
+ echo "\n" >>& cmpi-cp.out
+ if [[ $? != 0 ]]
+ then
+ cat cmpi-cp.out
+ rm -v cmpi-cp.out
+ crash "cmpi-cp error!"
+ fi
+done
+
+bin/cmpi-db-quit >& /dev/null
+QUIT_PROCESS=$!
+
+wait ${DB_PID}
+
+kill ${BOMB_PID}
+
+sleep ${PROCS}
+
+# Should be ${PROCS} "Normal exit."s
+N=$( grep -c "Normal exit." ${OUTPUT} )
+(( N == PROCS )) || crash "N != ${PROCS}"
+
+rm -f cmpi-cp.out test-cp1.*.data
+
+exit 0
Property changes on: test/cmpi-db/test-loop.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-12 20:17:06
|
Revision: 106
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=106&view=rev
Author: jmwozniak
Date: 2010-05-12 20:17:00 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Alternative CMPI mode for multi-physical-node cases
Added Paths:
-----------
src/cmpi/mode_rr.c
Added: src/cmpi/mode_rr.c
===================================================================
--- src/cmpi/mode_rr.c (rev 0)
+++ src/cmpi/mode_rr.c 2010-05-12 20:17:00 UTC (rev 106)
@@ -0,0 +1,27 @@
+
+#include <cmpi.h>
+#include <cmpi_mode.h>
+
+/**
+ Round-robin:
+ Try to place one node and one client on each physical
+ compute node
+*/
+int cmpi_mode_select(int rank, int size, int nodes)
+{
+ if (rank > size/2)
+ return CMPI_MODE_CLIENT;
+ return CMPI_MODE_NODE;
+}
+
+struct inlist* cmpi_mode_contacts(int rank, int size, int nodes)
+{
+ struct inlist* result = inlist_create();
+
+ int i = rank % (size/2);
+
+ NOTE_I("contact: ", i);
+ inlist_add(result, i);
+
+ return result;
+}
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:16:23
|
Revision: 105
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=105&view=rev
Author: jmwozniak
Date: 2010-05-12 20:16:17 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Select client contacts based on CMPI mode
Modified Paths:
--------------
include/cmpi_mode.h
src/cmpi/mode_mono.c
src/cmpi/node.c
src/dense-1/cmpi_dense.c
Modified: include/cmpi_mode.h
===================================================================
--- include/cmpi_mode.h 2010-05-12 19:59:36 UTC (rev 104)
+++ include/cmpi_mode.h 2010-05-12 20:16:17 UTC (rev 105)
@@ -1,2 +1,5 @@
-int select_mode(int rank, int size, int nodes);
+#include <inlist.h>
+
+int cmpi_mode_select(int rank, int size, int nodes);
+struct inlist* cmpi_mode_contacts(int rank, int size, int nodes);
Modified: src/cmpi/mode_mono.c
===================================================================
--- src/cmpi/mode_mono.c 2010-05-12 19:59:36 UTC (rev 104)
+++ src/cmpi/mode_mono.c 2010-05-12 20:16:17 UTC (rev 105)
@@ -5,9 +5,22 @@
/**
Original idea: if rank > nodes, I am client.
*/
-int select_mode(int rank, int size, int nodes)
+int cmpi_mode_select(int rank, int size, int nodes)
{
if (rank >= nodes)
return CMPI_MODE_CLIENT;
return CMPI_MODE_NODE;
}
+
+struct inlist* cmpi_mode_contacts(int rank, int size, int nodes)
+{
+ struct inlist* result = inlist_create();
+
+ for (int i = 0; i < nodes; i++)
+ {
+ NOTE_I("contact: ", i);
+ inlist_add(result, i);
+ }
+
+ return result;
+}
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2010-05-12 19:59:36 UTC (rev 104)
+++ src/cmpi/node.c 2010-05-12 20:16:17 UTC (rev 105)
@@ -185,7 +185,7 @@
build_client_communicator();
- if (select_mode(mpi_rank, mpi_size, nodes) == CMPI_MODE_NODE)
+ if (cmpi_mode_select(mpi_rank, mpi_size, nodes) == CMPI_MODE_NODE)
{
NOTE("I am node");
cmpi_init();
Modified: src/dense-1/cmpi_dense.c
===================================================================
--- src/dense-1/cmpi_dense.c 2010-05-12 19:59:36 UTC (rev 104)
+++ src/dense-1/cmpi_dense.c 2010-05-12 20:16:17 UTC (rev 105)
@@ -1,6 +1,8 @@
-#include "cmpi_dense-1.h"
+#include <cmpi_mode.h>
+#include <cmpi_dense-1.h>
+
/**
List of node ranks to contact for DENSE routines.
*/
@@ -29,14 +31,8 @@
DENSE_Init_client();
- contacts = inlist_create();
+ contacts = cmpi_mode_contacts(mpi_rank, mpi_size, dense_nodes);
- for (int i = 0; i < dense_nodes; i++)
- {
- gossip_debug(MASK_DHT, "contact: %i\n", i);
- inlist_add(contacts, i);
- }
-
return CMPI_SUCCESS;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-12 19:59:45
|
Revision: 104
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=104&view=rev
Author: jmwozniak
Date: 2010-05-12 19:59:36 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Bug fix to cmpi-cp
Modified Paths:
--------------
src/cmpi-cp/cmpi-cp.c
src/dense-1/dense.c
test/cmpi-db/module.mk.in
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-05-12 19:20:20 UTC (rev 103)
+++ src/cmpi-cp/cmpi-cp.c 2010-05-12 19:59:36 UTC (rev 104)
@@ -95,33 +95,48 @@
sprintf(data, "DHT: %i", count);
fprintf(to_cmpi, "put %s %i\n", object, (int) strlen(data));
fflush(to_cmpi);
+ fscanf(from_cmpi, "%s", msg);
+ if (strcmp(msg, "ok") != 0)
+ return CMPI_ERROR_UNKNOWN;
fprintf(to_cmpi, "%s", data);
fflush(to_cmpi);
char result[32];
fscanf(from_cmpi, "%s\n", result);
- if (strncmp(result, "ok", 2) != 0)
+ if (strncmp(result, "ok", 2))
return CMPI_ERROR_UNKNOWN;
+ // printf("cmpi_cp_put(): complete\n");
+
return CMPI_SUCCESS;
}
int
cmpi_cp_get(char* object, FILE* file)
{
+ // char message[64];
char data[value_size];
int count, c;
int length;
+ // printf("cmpi_cp_get()\n");
+ // fflush(stdout);
+
fprintf(to_cmpi, "get %s\n", object);
fflush(to_cmpi);
- fscanf(from_cmpi, "%i\n", &length);
+ c = fscanf(from_cmpi, "%i\n", &length);
+ // printf("message: %i\n", c);
+ // printf("message: %s\n", message);
+ // sscanf(message, "%i", &length);
if (length == -1)
return CMPI_DOESNT_EXIST;
+ // printf("metadata length: %i\n", length);
+ // fflush(stdout);
+
c = stream_to_buffer(data, length, from_cmpi);
c = sscanf(data, "DHT: %i\n", &count);
if (c != 1)
@@ -137,8 +152,8 @@
fprintf(to_cmpi, "get %s[%i]\n", object, c);
fflush(to_cmpi);
fscanf(from_cmpi, "%i", &length);
- printf("incoming length: %i\n", length);
- fgetc(from_cmpi);
+ // printf("incoming length: %i\n", length);
+ // fgetc(from_cmpi);
if (length == -1)
{
printf("not found: %s[%i]\n", object, c);
@@ -146,8 +161,12 @@
}
stream_to_buffer(data, length, from_cmpi);
+ // printf("got buffer\n");
buffer_to_stream(data, length, file);
}
+
+ // printf("cmpi_cp_get(): complete\n");
+
return CMPI_SUCCESS;
}
@@ -211,6 +230,8 @@
{
printf("\ncmpi-cp start\n\n");
+ fflush(stdout);
+
CMPI_CP_TYPE target1_type;
CMPI_CP_TYPE target2_type;
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2010-05-12 19:20:20 UTC (rev 103)
+++ src/dense-1/dense.c 2010-05-12 19:59:36 UTC (rev 104)
@@ -25,7 +25,7 @@
MPIRPC_Node* nodes;
-int k = 3;
+int k = 1;
void
DENSE_Init(int k_in, MPI_Comm comm)
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-12 19:20:20 UTC (rev 103)
+++ test/cmpi-db/module.mk.in 2010-05-12 19:59:36 UTC (rev 104)
@@ -1,6 +1,7 @@
TEST_CMPIDB_OUTPUT = test/cmpi-db/test-quit.out \
- test/cmpi-db/test-cp1.out
+ test/cmpi-db/test-cp1.out \
+ test/cmpi-db/test-loop.out
TEST_OUTPUT += $(TEST_CMPIDB_OUTPUT)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-12 19:20:26
|
Revision: 103
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=103&view=rev
Author: jmwozniak
Date: 2010-05-12 19:20:20 +0000 (Wed, 12 May 2010)
Log Message:
-----------
CMPI mode selection functionality
Modified Paths:
--------------
include/cmpi.h
src/cmpi/module.mk.in
src/cmpi/node.c
Added Paths:
-----------
include/cmpi_mode.h
src/cmpi/mode_mono.c
Modified: include/cmpi.h
===================================================================
--- include/cmpi.h 2010-05-12 18:34:31 UTC (rev 102)
+++ include/cmpi.h 2010-05-12 19:20:20 UTC (rev 103)
@@ -59,6 +59,12 @@
enum
{
+ CMPI_MODE_NODE,
+ CMPI_MODE_CLIENT
+};
+
+enum
+{
CMPI_STATUS_PROTO, // CMPI is starting up
CMPI_STATUS_READY, // CMPI is fully connected
CMPI_STATUS_SHUTDOWN // CMPI is shutting down
Added: include/cmpi_mode.h
===================================================================
--- include/cmpi_mode.h (rev 0)
+++ include/cmpi_mode.h 2010-05-12 19:20:20 UTC (rev 103)
@@ -0,0 +1,2 @@
+
+int select_mode(int rank, int size, int nodes);
Added: src/cmpi/mode_mono.c
===================================================================
--- src/cmpi/mode_mono.c (rev 0)
+++ src/cmpi/mode_mono.c 2010-05-12 19:20:20 UTC (rev 103)
@@ -0,0 +1,13 @@
+
+#include <cmpi.h>
+#include <cmpi_mode.h>
+
+/**
+ Original idea: if rank > nodes, I am client.
+*/
+int select_mode(int rank, int size, int nodes)
+{
+ if (rank >= nodes)
+ return CMPI_MODE_CLIENT;
+ return CMPI_MODE_NODE;
+}
Modified: src/cmpi/module.mk.in
===================================================================
--- src/cmpi/module.mk.in 2010-05-12 18:34:31 UTC (rev 102)
+++ src/cmpi/module.mk.in 2010-05-12 19:20:20 UTC (rev 103)
@@ -7,6 +7,11 @@
CMPI_SRC += $(DIR)/driver.c
CMPI_SRC += $(DIR)/accessor.c
+MODE = $(DIR)/mode_mono.c
+#MODE = $(DIR)/mode_db.c
+
+CMPI_SRC += $(MODE)
+
ifeq (@USE_TABLE_DENSE@,1)
CMPI_SRC += $(DIR)/dense.c
CMPI_SRC += $(DIR)/driver.c
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2010-05-12 18:34:31 UTC (rev 102)
+++ src/cmpi/node.c 2010-05-12 19:20:20 UTC (rev 103)
@@ -10,7 +10,8 @@
* -t <tag> symbolic tag number.
*/
-#include "node.h"
+#include <node.h>
+#include <cmpi_mode.h>
int nodes;
MPI_Comm cmpi_comm_clients;
@@ -184,12 +185,14 @@
build_client_communicator();
- if (mpi_rank < nodes)
+ if (select_mode(mpi_rank, mpi_size, nodes) == CMPI_MODE_NODE)
{
+ NOTE("I am node");
cmpi_init();
}
else
{
+ NOTE("I am client");
cmpi_init_client();
cmpi_client_code();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-12 18:34:37
|
Revision: 102
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=102&view=rev
Author: jmwozniak
Date: 2010-05-12 18:34:31 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Fix label
Modified Paths:
--------------
test/mpi_tools/module.mk.in
Modified: test/mpi_tools/module.mk.in
===================================================================
--- test/mpi_tools/module.mk.in 2010-05-12 15:01:23 UTC (rev 101)
+++ test/mpi_tools/module.mk.in 2010-05-12 18:34:31 UTC (rev 102)
@@ -15,7 +15,7 @@
$(E)$(LAUNCH) -n 3 $(<) > $(@) 2>&1
$(DIR)/test%.x: test/mpi_tools/test%.o $(MPITOOLS_OBJS)
- $(Q) " MPICC $(@) "
+ $(Q) " LINK $(@) "
$(E)$(MPICC) $(MPE) $(<) $(MPITOOLS_OBJS) $(LIBS) -o $(@)
$(DIR)/test-success.out: $(TEST_MPITOOLS_OUTPUT)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-12 15:01:29
|
Revision: 101
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=101&view=rev
Author: jmwozniak
Date: 2010-05-12 15:01:23 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Complete test-success chain
Modified Paths:
--------------
Makefile.in
src/adts/dpkm_list.c
test/adts/test-dpkm_list.c
test/cmpi-db/module.mk.in
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-12 14:44:42 UTC (rev 100)
+++ Makefile.in 2010-05-12 15:01:23 UTC (rev 101)
@@ -429,9 +429,9 @@
## Tests...
-test_results: $(CMPI) $(TEST_OUTPUT)
+test_results: test/cmpi-db/test-success.out
-tests: $(CMPI) $(TEST_PROGS)
+tests: $(TEST_PROGS)
# Obsolete target: delete soon.
#cmpi-io-test: $(CMPI_IO) src/cmpi/cmpi-io-test.o
Modified: src/adts/dpkm_list.c
===================================================================
--- src/adts/dpkm_list.c 2010-05-12 14:44:42 UTC (rev 100)
+++ src/adts/dpkm_list.c 2010-05-12 15:01:23 UTC (rev 101)
@@ -127,6 +127,9 @@
return item;
}
+/**
+ Cut the item out of target dpkm_list
+*/
void
dpkm_list_excise(struct dpkm_list* target,
struct dpkm_list_item* item)
Modified: test/adts/test-dpkm_list.c
===================================================================
--- test/adts/test-dpkm_list.c 2010-05-12 14:44:42 UTC (rev 100)
+++ test/adts/test-dpkm_list.c 2010-05-12 15:01:23 UTC (rev 101)
@@ -47,29 +47,25 @@
fflush(stdout);
dpkm_list_printf("%i", L);
- printf("size: %i \n", L->size);
+ printf("size: %i \n", L->size); // 4
dpkm_list_add(L, "five", &five, sizeof(int));
dpkm_list_excise(L, L->head);
dpkm_list_printf("%i", L);
- printf("size: %i \n", L->size);
+ printf("size: %i \n", L->size); // 3
item = dpkm_list_add(L, "eight", &eight, sizeof(int));
if (item)
printf("%s \n", item->key);
dpkm_list_printf("%i", L);
- printf("size: %i \n", L->size);
+ printf("size: %i \n", L->size); // 4
dpkm_list_tostring(s, 1000, "%i", L);
printf("From string: %s\n", s);
- //dpkm_list_search(L, "five");
- dpkm_list_printf("%i", L);
- printf("size: %i \n", L->size);
-
item = dpkm_list_poll(L);
dpkm_list_printf("%i", L);
- printf("size: %i \n", L->size);
+ printf("size: %i \n", L->size); // 3
item = dpkm_list_search(L, "zero");
dpkm_list_excise(L, item);
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-12 14:44:42 UTC (rev 100)
+++ test/cmpi-db/module.mk.in 2010-05-12 15:01:23 UTC (rev 101)
@@ -13,3 +13,8 @@
$(Q) " TEST $(@) "
$(E) $(MPDCHECK)
$(E) $(<) $(@) 4 3
+
+test/cmpi-db/test-success.out: test/driver/test-success.out \
+ $(TEST_CMPIDB_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 14:44:50
|
Revision: 100
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=100&view=rev
Author: jmwozniak
Date: 2010-05-12 14:44:42 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Cleanup fixes
Modified Paths:
--------------
Makefile.in
src/cmpi-cp/module.mk.in
src/cmpi-db/module.mk.in
test/cmpi-db/module.mk.in
test/driver/module.mk.in
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-12 02:59:18 UTC (rev 99)
+++ Makefile.in 2010-05-12 14:44:42 UTC (rev 100)
@@ -309,6 +309,7 @@
DIR :=
# include $(MODULES)
+PROGS :=
TABLE_OBJS :=
include src/mpi_tools/module.mk
include src/gossip/module.mk
@@ -482,10 +483,10 @@
$(Q) " CLEAN"
$(E)rm -fv $(CMPI_DEPS) $(TEST_DEPS) \
$(MPIRPC) $(CMPI) $(ADTS_OBJS) $(MPIRPC_OBJS) $(CMPI_OBJS) \
- $(KDA_OBJS) $(CMPI_IO) $(CMPI_PICS) \
+ $(KDA_OBJS) $(CMPI_IO) $(CMPI_OBJS) $(TABLE_OBJS) \
hex unhex hexord unpublish node driver \
$(TEST_OUTPUT) $(TEST_PROGS) $(TEST_OBJS) \
- $(CMPI_PROGS) $(CMPI_CP_OBJS) splint.out
+ $(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 \{\} \;
Modified: src/cmpi-cp/module.mk.in
===================================================================
--- src/cmpi-cp/module.mk.in 2010-05-12 02:59:18 UTC (rev 99)
+++ src/cmpi-cp/module.mk.in 2010-05-12 14:44:42 UTC (rev 100)
@@ -3,7 +3,7 @@
DIR := src/cmpi-cp
-CMPICP_PROGS += bin/cmpi-cp
+PROGS += bin/cmpi-cp
CMPICP_SRC += src/cmpi-cp/cmpi-cp.c
CMPICP_OBJS = src/cmpi-cp/cmpi-cp.o src/cmpi/accessor.o src/mpi_tools/io_tools.o
Modified: src/cmpi-db/module.mk.in
===================================================================
--- src/cmpi-db/module.mk.in 2010-05-12 02:59:18 UTC (rev 99)
+++ src/cmpi-db/module.mk.in 2010-05-12 14:44:42 UTC (rev 100)
@@ -3,7 +3,9 @@
PROGS += bin/cmpi-db
PROGS += bin/cmpi-db-quit
-CMPIDB_SRC += src/cmpi-db/cmpi-db-fifo-quit.c
+CMPIDB_SRC = src/cmpi-db/cmpi-db-fifo.c \
+ src/cmpi-db/cmpi-db-fifo-quit.c
+CMPIDB_OBJS = $(patsubst %.c, %.o, $(CMPIDB_SRC))
CMPIDB = bin/cmpi-db
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-12 02:59:18 UTC (rev 99)
+++ test/cmpi-db/module.mk.in 2010-05-12 14:44:42 UTC (rev 100)
@@ -1,6 +1,6 @@
-TEST_CMPIDB_ZSH = $(shell find test/cmpi-db -name "*.zsh")
-TEST_CMPIDB_OUTPUT = $(patsubst %.zsh, %.out, $(TEST_CMPIDB_ZSH))
+TEST_CMPIDB_OUTPUT = test/cmpi-db/test-quit.out \
+ test/cmpi-db/test-cp1.out
TEST_OUTPUT += $(TEST_CMPIDB_OUTPUT)
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-12 02:59:18 UTC (rev 99)
+++ test/driver/module.mk.in 2010-05-12 14:44:42 UTC (rev 100)
@@ -14,7 +14,10 @@
TEST_SRC += $(TEST_DRIVER_SRC)
TEST_OBJS += $(TEST_DRIVER_OBJS)
-TEST_PROGS += $(patsubst %.c, %.x, $(TEST_DRIVER_SRC))
+
+TEST_DRIVER_CMDS = $(shell find test/driver -name test-cmd*.c )
+TEST_PROGS += $(patsubst %.c, %.x, $(TEST_DRIVER_CMDS))
+TEST_PROGS += test/driver/test_driver.x
TEST_OUTPUT += $(TEST_DRIVER_OUTPUT)
TEST_DRIVER = test/driver/test_driver.x
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-12 02:59:24
|
Revision: 99
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=99&view=rev
Author: jmwozniak
Date: 2010-05-12 02:59:18 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Minor test fixes
Modified Paths:
--------------
Makefile.in
src/cmpi/driver.c
src/cmpi-cp/cmpi-cp.c
src/cmpi-cp/module.mk.in
test/cmpi-db/test-cp1.zsh
test/cmpi-db/test-quit.zsh
test/driver/test-cmd-get.c
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-12 02:03:12 UTC (rev 98)
+++ Makefile.in 2010-05-12 02:59:18 UTC (rev 99)
@@ -438,7 +438,7 @@
# $(E)$(MPICC) src/cmpi/cmpi-io-test.o $(CMPI) $(LIBS) -o cmpi-io-test
# override default rule for building objects
-%.o : %.c
+%.o: %.c
$(Q) " MPICC $@"
$(E)$(MPICC) $(LIBCFLAGS) $(CFLAGS) $(TEST_OPTIONS) \
$(call modcflags,$(<)) $(<) -c -o $(@)
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-12 02:03:12 UTC (rev 98)
+++ src/cmpi/driver.c 2010-05-12 02:59:18 UTC (rev 99)
@@ -133,6 +133,7 @@
buffer_to_stream(value, length, driver->sink);
}
fflush(driver->sink);
+ printf("driver: streamed\n");
DONE;
}
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-05-12 02:03:12 UTC (rev 98)
+++ src/cmpi-cp/cmpi-cp.c 2010-05-12 02:59:18 UTC (rev 99)
@@ -117,17 +117,21 @@
fprintf(to_cmpi, "get %s\n", object);
fflush(to_cmpi);
- printf("issued get\n");
+ fscanf(from_cmpi, "%i\n", &length);
- fscanf(from_cmpi, "%i", &length);
- fgetc(from_cmpi);
if (length == -1)
return CMPI_DOESNT_EXIST;
- stream_to_buffer(data, length, from_cmpi);
- sscanf(data, "DHT: %i", &count);
- // printf("count: %i\n", count);
+ c = stream_to_buffer(data, length, from_cmpi);
+ c = sscanf(data, "DHT: %i\n", &count);
+ if (c != 1)
+ {
+ printf("bad response: %s\n", data);
+ exit(1);
+ }
+ printf("count: %i\n", count);
+
for (c = 0; c < count; c++)
{
fprintf(to_cmpi, "get %s[%i]\n", object, c);
@@ -205,6 +209,8 @@
int
main(int argc, char* argv[])
{
+ printf("\ncmpi-cp start\n\n");
+
CMPI_CP_TYPE target1_type;
CMPI_CP_TYPE target2_type;
Modified: src/cmpi-cp/module.mk.in
===================================================================
--- src/cmpi-cp/module.mk.in 2010-05-12 02:03:12 UTC (rev 98)
+++ src/cmpi-cp/module.mk.in 2010-05-12 02:59:18 UTC (rev 99)
@@ -12,7 +12,11 @@
CMPI_CP_LIBS += -L $(DMALLOC_LIB) -l dmalloc
endif
+src/cmpi-cp/cmpi-cp.o: src/cmpi-cp/cmpi-cp.c
+ $(Q) " CC $(@) "
+ $(E) $(CC) -c $(CFLAGS) $(<) -o $(@)
+
bin/cmpi-cp: $(CMPICP_OBJS)
- $(Q) " CC $(@) "
+ $(Q) " LINK $(@) "
$(E) install -d bin
$(E) $(CC) $(CMPICP_OBJS) -o $(@)
Modified: test/cmpi-db/test-cp1.zsh
===================================================================
--- test/cmpi-db/test-cp1.zsh 2010-05-12 02:03:12 UTC (rev 98)
+++ test/cmpi-db/test-cp1.zsh 2010-05-12 02:59:18 UTC (rev 99)
@@ -13,7 +13,7 @@
mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
DB_PID=${!}
-tools/timebomb.zsh ${DB_PID} $(( PROCS*3 )) ${OUTPUT} $0 &
+tools/timebomb.zsh ${DB_PID} $(( PROCS*4 )) ${OUTPUT} $0 &
BOMB_PID=${!}
sleep ${PROCS}
@@ -37,17 +37,19 @@
crash "cmpi-cp error!"
fi
-bin/cmpi-db-quit >& /dev/null &
+bin/cmpi-db-quit >& /dev/null
QUIT_PROCESS=$!
+wait ${DB_PID}
+
+kill ${BOMB_PID}
+
sleep ${PROCS}
# Should be ${PROCS} "Normal exit."s
N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == PROCS )) || crash "N != ${PROCS}"
-kill ${BOMB_PID}
-
rm -f cmpi-cp.out test-cp1.*.data
exit 0
Modified: test/cmpi-db/test-quit.zsh
===================================================================
--- test/cmpi-db/test-quit.zsh 2010-05-12 02:03:12 UTC (rev 98)
+++ test/cmpi-db/test-quit.zsh 2010-05-12 02:59:18 UTC (rev 99)
@@ -2,7 +2,7 @@
# Be sure to make tests with D=1
-set -x
+# set -x
OUTPUT=$1
PROCS=$2
@@ -15,7 +15,7 @@
sleep ${PROCS}
-bin/cmpi-db-fifo-quit >& /dev/null &
+bin/cmpi-db-quit >& /dev/null &
QUIT_PROCESS=$!
sleep ${PROCS}
Modified: test/driver/test-cmd-get.c
===================================================================
--- test/driver/test-cmd-get.c 2010-05-12 02:03:12 UTC (rev 98)
+++ test/driver/test-cmd-get.c 2010-05-12 02:59:18 UTC (rev 99)
@@ -39,9 +39,10 @@
code = fscanf(from_cmpi, "%i\n", &length);
if (code != 1)
crash("No response from driver!");
+ // printf("length: %i code: %i \n", length, code);
if (length == -1)
- crash("key not found");
+ crash("Key not found!");
char* result = malloc(length*sizeof(char));
memset(result, 0, length);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-12 02:03:18
|
Revision: 98
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=98&view=rev
Author: jmwozniak
Date: 2010-05-12 02:03:12 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Set executable bit
Property Changed:
----------------
test/cmpi/test-tables.zsh
Property changes on: test/cmpi/test-tables.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-12 01:54:05
|
Revision: 97
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=97&view=rev
Author: jmwozniak
Date: 2010-05-12 01:53:59 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Fixes to driver and cmpi-db tests
Modified Paths:
--------------
configure.ac
src/cmpi/driver.c
src/cmpi-db/module.mk.in
test/cmpi-db/module.mk.in
test/cmpi-db/test-cp1.zsh
Modified: configure.ac
===================================================================
--- configure.ac 2010-05-12 00:16:31 UTC (rev 96)
+++ configure.ac 2010-05-12 01:53:59 UTC (rev 97)
@@ -398,6 +398,7 @@
test/adts/module.mk
test/cmpi/module.mk
test/cmpi-db/module.mk
+ test/driver/module.mk
test/gossip/module.mk
test/mpirpc/module.mk
test/mpi_tools/module.mk
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-12 00:16:31 UTC (rev 96)
+++ src/cmpi/driver.c 2010-05-12 01:53:59 UTC (rev 97)
@@ -127,6 +127,7 @@
}
else
{
+ printf("driver: length: %i\n", length);
fprintf(driver->sink, "%i\n", length);
fflush(driver->sink);
buffer_to_stream(value, length, driver->sink);
Modified: src/cmpi-db/module.mk.in
===================================================================
--- src/cmpi-db/module.mk.in 2010-05-12 00:16:31 UTC (rev 96)
+++ src/cmpi-db/module.mk.in 2010-05-12 01:53:59 UTC (rev 97)
@@ -8,11 +8,11 @@
CMPIDB = bin/cmpi-db
$(CMPIDB): src/cmpi-db/cmpi-db-fifo.o $(CMPI)
- $(Q) " MPICC $(@)"
+ $(Q) " LINK $(@)"
$(E) install -d bin
$(E) $(MPICC) $(MPE) src/cmpi/node.o src/cmpi/driver.o \
$(<) $(CMPI) $(LIBS) -o $(@)
bin/cmpi-db-quit: src/cmpi-db/cmpi-db-fifo-quit.o $(CMPI) bin
- $(Q) " MPICC $(@)"
+ $(Q) " LINK $(@)"
$(E) $(MPICC) $(<) $(CMPI) -o $(@)
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-12 00:16:31 UTC (rev 96)
+++ test/cmpi-db/module.mk.in 2010-05-12 01:53:59 UTC (rev 97)
@@ -13,11 +13,3 @@
$(Q) " TEST $(@) "
$(E) $(MPDCHECK)
$(E) $(<) $(@) 4 3
-
-#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 $(@)
Modified: test/cmpi-db/test-cp1.zsh
===================================================================
--- test/cmpi-db/test-cp1.zsh 2010-05-12 00:16:31 UTC (rev 96)
+++ test/cmpi-db/test-cp1.zsh 2010-05-12 01:53:59 UTC (rev 97)
@@ -11,8 +11,11 @@
source tools/test-helpers.zsh
mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
-MPI_PROCESS=$!
+DB_PID=${!}
+tools/timebomb.zsh ${DB_PID} $(( PROCS*3 )) ${OUTPUT} $0 &
+BOMB_PID=${!}
+
sleep ${PROCS}
echo "DATA" > test-cp1.input.data
@@ -25,8 +28,6 @@
crash "cmpi-cp error!"
fi
-echo inserted
-
echo "\n\ncmpi-cp retrieve" >>& cmpi-cp.out
bin/cmpi-cp dht://test-cp1 test-cp1.output.data >>& cmpi-cp.out
if [[ $? != 0 ]]
@@ -36,8 +37,6 @@
crash "cmpi-cp error!"
fi
-echo retrieved
-
bin/cmpi-db-quit >& /dev/null &
QUIT_PROCESS=$!
@@ -47,6 +46,8 @@
N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == PROCS )) || crash "N != ${PROCS}"
+kill ${BOMB_PID}
+
rm -f cmpi-cp.out test-cp1.*.data
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-12 00:16:38
|
Revision: 96
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=96&view=rev
Author: jmwozniak
Date: 2010-05-12 00:16:31 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Minor improvements to cmpi-db/cmpi-cp tests
Modified Paths:
--------------
Makefile.in
src/cmpi-cp/module.mk.in
src/cmpi-db/module.mk.in
test/cmpi-db/module.mk.in
test/cmpi-db/test-cp1.zsh
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-12 00:00:53 UTC (rev 95)
+++ Makefile.in 2010-05-12 00:16:31 UTC (rev 96)
@@ -309,7 +309,7 @@
DIR :=
# include $(MODULES)
-# TABLE_OBJS :=
+TABLE_OBJS :=
include src/mpi_tools/module.mk
include src/gossip/module.mk
include src/adts/module.mk
@@ -318,7 +318,7 @@
include src/dense-1/module.mk
include src/cmpi/module.mk
include src/cmpi-db/module.mk
-#include src/cmpi-cp/module.mk
+include src/cmpi-cp/module.mk
################################################################
# Derived file lists
@@ -351,9 +351,9 @@
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
+include test/driver/module.mk
+include test/cmpi-db/module.mk
+#include test/cmpi-io/module.mk
#TEST_HELPER_OBJS += $(patsubst %.c, %.o, $(TEST_HELPER_SRC))
TEST_DEPS += $(patsubst %.c, %.d, $(TEST_SRC))
Modified: src/cmpi-cp/module.mk.in
===================================================================
--- src/cmpi-cp/module.mk.in 2010-05-12 00:00:53 UTC (rev 95)
+++ src/cmpi-cp/module.mk.in 2010-05-12 00:16:31 UTC (rev 96)
@@ -12,6 +12,7 @@
CMPI_CP_LIBS += -L $(DMALLOC_LIB) -l dmalloc
endif
-bin/cmpi-cp: $(CMPI_CP_OBJS) bin
+bin/cmpi-cp: $(CMPICP_OBJS)
$(Q) " CC $(@) "
- $(E)$(CC) $(CMPI_CP_OBJS) -o $(@)
+ $(E) install -d bin
+ $(E) $(CC) $(CMPICP_OBJS) -o $(@)
Modified: src/cmpi-db/module.mk.in
===================================================================
--- src/cmpi-db/module.mk.in 2010-05-12 00:00:53 UTC (rev 95)
+++ src/cmpi-db/module.mk.in 2010-05-12 00:16:31 UTC (rev 96)
@@ -2,16 +2,17 @@
DIR := src/cmpi-db
PROGS += bin/cmpi-db
-PROGS += bin/cmpi-db-fifo-quit
-CMPIDB_SRC += src/cmpi-cp/cmpi-cp.c src/cmpi-db/cmpi-db-fifo-quit.c
+PROGS += bin/cmpi-db-quit
+CMPIDB_SRC += src/cmpi-db/cmpi-db-fifo-quit.c
CMPIDB = bin/cmpi-db
-$(CMPI_DB): src/cmpi-db/cmpi-db-fifo.o $(CMPI) bin
+$(CMPIDB): src/cmpi-db/cmpi-db-fifo.o $(CMPI)
$(Q) " MPICC $(@)"
- $(E)$(MPICC) $(MPE) src/cmpi/node.o src/cmpi/driver.o \
+ $(E) install -d bin
+ $(E) $(MPICC) $(MPE) src/cmpi/node.o src/cmpi/driver.o \
$(<) $(CMPI) $(LIBS) -o $(@)
-bin/cmpi-db-fifo-quit: src/cmpi-db/cmpi-db-fifo-quit.o $(CMPI) bin
+bin/cmpi-db-quit: src/cmpi-db/cmpi-db-fifo-quit.o $(CMPI) bin
$(Q) " MPICC $(@)"
- $(E)$(MPICC) $(<) $(CMPI) -o $(@)
+ $(E) $(MPICC) $(<) $(CMPI) -o $(@)
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-12 00:00:53 UTC (rev 95)
+++ test/cmpi-db/module.mk.in 2010-05-12 00:16:31 UTC (rev 96)
@@ -1,18 +1,18 @@
-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_CMPIDB_ZSH = $(shell find test/cmpi-db -name "*.zsh")
+TEST_CMPIDB_OUTPUT = $(patsubst %.zsh, %.out, $(TEST_CMPIDB_ZSH))
-CMPI_DB = bin/cmpi-db
-CMPI_CP = bin/cmpi-cp
-CMPI_DB_QUIT = bin/cmpi-db-fifo-quit
-CMPI_DB_TOOLS = $(CMPI_DB) $(CMPI_CP) $(CMPI_DB_QUIT)
+TEST_OUTPUT += $(TEST_CMPIDB_OUTPUT)
-test/cmpi-db/test-%.out: test/cmpi-db/test-%.zsh $(CMPI_DB_TOOLS)
+CMPIDB = bin/cmpi-db
+CMPICP = bin/cmpi-cp
+CMPIDBQUIT = bin/cmpi-db-quit
+CMPIDB_TOOLS = $(CMPIDB) $(CMPICP) $(CMPIDBQUIT)
+
+test/cmpi-db/test-%.out: test/cmpi-db/test-%.zsh $(CMPIDB_TOOLS)
$(Q) " TEST $(@) "
$(E) $(MPDCHECK)
$(E) $(<) $(@) 4 3
-# test/cmpi-db/test-quit.zsh
#test/cmpi-db/test%.out: test/cmpi-db/test%.x $(DRIVER)
# $(Q) " TEST $(@) "
Modified: test/cmpi-db/test-cp1.zsh
===================================================================
--- test/cmpi-db/test-cp1.zsh 2010-05-12 00:00:53 UTC (rev 95)
+++ test/cmpi-db/test-cp1.zsh 2010-05-12 00:16:31 UTC (rev 96)
@@ -38,7 +38,7 @@
echo retrieved
-bin/cmpi-db-fifo-quit >& /dev/null &
+bin/cmpi-db-quit >& /dev/null &
QUIT_PROCESS=$!
sleep ${PROCS}
@@ -47,6 +47,6 @@
N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == PROCS )) || crash "N != ${PROCS}"
-# rm cmpi-cp.out test-cp1.*.data
+rm -f cmpi-cp.out test-cp1.*.data
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-12 00:01:00
|
Revision: 95
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=95&view=rev
Author: jmwozniak
Date: 2010-05-12 00:00:53 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Better driver tests
Modified Paths:
--------------
include/accessor.h
include/io_tools.h
include/mpi_tools.h
src/cmpi/accessor.c
src/mpi_tools/io_tools.c
test/driver/test-cmd-put.c
Added Paths:
-----------
test/driver/test-cmd-get.c
test/driver/test-get.zsh
test/driver/test-put.zsh
Modified: include/accessor.h
===================================================================
--- include/accessor.h 2010-05-11 23:08:57 UTC (rev 94)
+++ include/accessor.h 2010-05-12 00:00:53 UTC (rev 95)
@@ -7,3 +7,5 @@
FILE* from_cmpi;
bool driver_access_fifo(void);
+
+void driver_access_fifo_close(void);
Modified: include/io_tools.h
===================================================================
--- include/io_tools.h 2010-05-11 23:08:57 UTC (rev 94)
+++ include/io_tools.h 2010-05-12 00:00:53 UTC (rev 95)
@@ -1,6 +1,6 @@
#include <stdio.h>
-void stream_to_buffer(char* buffer, int length, FILE* stream);
+int stream_to_buffer(char* buffer, int length, FILE* stream);
void buffer_to_stream(char* buffer, int length, FILE* stream);
void eat_whitespace(FILE* stream);
Modified: include/mpi_tools.h
===================================================================
--- include/mpi_tools.h 2010-05-11 23:08:57 UTC (rev 94)
+++ include/mpi_tools.h 2010-05-12 00:00:53 UTC (rev 95)
@@ -201,6 +201,7 @@
#define SHOW_S(s) DEBUG(show_s(s))
#define SHOW_X(x) DEBUG(show_x(#x, x))
#define SHOW_P(p) DEBUG(show_p(#p, p))
+#define SHOW SHOW_S
//// Functions...
#define show_fi(i) \
Modified: src/cmpi/accessor.c
===================================================================
--- src/cmpi/accessor.c 2010-05-11 23:08:57 UTC (rev 94)
+++ src/cmpi/accessor.c 2010-05-12 00:00:53 UTC (rev 95)
@@ -24,3 +24,10 @@
}
return true;
}
+
+void
+driver_access_fifo_close()
+{
+ fclose(to_cmpi);
+ fclose(from_cmpi);
+}
Modified: src/mpi_tools/io_tools.c
===================================================================
--- src/mpi_tools/io_tools.c 2010-05-11 23:08:57 UTC (rev 94)
+++ src/mpi_tools/io_tools.c 2010-05-12 00:00:53 UTC (rev 95)
@@ -3,7 +3,10 @@
#include <unistd.h>
-void
+/**
+ @return The total number of bytes stored in buffer.
+*/
+int
stream_to_buffer(char* buffer, int length, FILE* stream)
{
int total = 0;
@@ -14,6 +17,8 @@
int actual = fread(buffer+total, 1, chunk, stream);
total += actual;
}
+
+ return total;
}
void
Added: test/driver/test-cmd-get.c
===================================================================
--- test/driver/test-cmd-get.c (rev 0)
+++ test/driver/test-cmd-get.c 2010-05-12 00:00:53 UTC (rev 95)
@@ -0,0 +1,54 @@
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <accessor.h>
+#include <mpi_tools.h>
+#include <io_tools.h>
+
+void
+crash(char* message)
+{
+ printf("%s\n", message);
+ driver_access_fifo_close();
+ exit(1);
+}
+
+int
+main(int argc, char* argv[])
+{
+ int code;
+
+ if (argc < 2)
+ {
+ printf("test-cmd-get: needs key argument!\n");
+ exit(1);
+ }
+
+ code = driver_access_fifo();
+ assert(code);
+
+ char* key = argv[1];
+
+ fprintf(to_cmpi, "get %s\n", key);
+ fflush(to_cmpi);
+
+ int length;
+ code = fscanf(from_cmpi, "%i\n", &length);
+ if (code != 1)
+ crash("No response from driver!");
+
+ if (length == -1)
+ crash("key not found");
+
+ char* result = malloc(length*sizeof(char));
+ memset(result, 0, length);
+ int total = stream_to_buffer(result, length, from_cmpi);
+
+ if (strcmp(result, "hello"))
+ crash("wrong result!");
+
+ return 0;
+}
Modified: test/driver/test-cmd-put.c
===================================================================
--- test/driver/test-cmd-put.c 2010-05-11 23:08:57 UTC (rev 94)
+++ test/driver/test-cmd-put.c 2010-05-12 00:00:53 UTC (rev 95)
@@ -19,10 +19,10 @@
char* key = argv[1];
- char* data = "hello does this work";
+ char* data = "hello";
- fprintf(to_cmpi, "put %s %i\n", key, (int) strlen(data));
- fprintf(to_cmpi, "%s", data);
+ fprintf(to_cmpi, "put %s %i\n", key, (int) strlen(data)+1);
+ fprintf(to_cmpi, "%s%c", data, '\0');
fflush(to_cmpi);
char output[32];
Added: test/driver/test-get.zsh
===================================================================
--- test/driver/test-get.zsh (rev 0)
+++ test/driver/test-get.zsh 2010-05-12 00:00:53 UTC (rev 95)
@@ -0,0 +1,39 @@
+#!/bin/zsh
+
+# Put/get case
+
+OUTPUT=$1
+
+source tools/test-helpers.zsh
+
+bail()
+{
+ kill ${BOMB_PID}
+ crash $1
+}
+
+mpiexec -n 5 test/driver/test_driver.x -n 4 > ${OUTPUT} &
+DRIVER_PID=${!}
+
+tools/timebomb.zsh ${$} 10 ${OUTPUT} $0 &
+BOMB_PID=${!}
+
+sleep 5
+
+test/driver/test-cmd-put.x sample-key
+test/driver/test-cmd-sleep.x 1
+test/driver/test-cmd-get.x sample-key
+[[ $? == 0 ]] || bail "could not get: sample-key"
+test/driver/test-cmd-quit.x
+
+wait ${DRIVER_PID}
+kill ${BOMB_PID}
+
+N=$( grep -c "Normal exit" ${OUTPUT} )
+if (( N != 5 ))
+then
+ mv -v ${OUTPUT} ${OUTPUT}.failed
+ exit 1
+fi
+
+return 0
Property changes on: test/driver/test-get.zsh
___________________________________________________________________
Added: svn:executable
+ *
Added: test/driver/test-put.zsh
===================================================================
--- test/driver/test-put.zsh (rev 0)
+++ test/driver/test-put.zsh 2010-05-12 00:00:53 UTC (rev 95)
@@ -0,0 +1,29 @@
+#!/bin/zsh
+
+# Just do a put
+
+OUTPUT=$1
+
+mpiexec -n 5 test/driver/test_driver.x -n 4 > ${OUTPUT} &
+DRIVER_PID=${!}
+
+tools/timebomb.zsh ${$} 10 ${OUTPUT} $0 &
+BOMB_PID=${!}
+
+sleep 5
+
+test/driver/test-cmd-put.x sample-key
+test/driver/test-cmd-sleep.x 1
+test/driver/test-cmd-quit.x
+
+wait ${DRIVER_PID}
+kill ${BOMB_PID}
+
+N=$( grep -c "Normal exit" ${OUTPUT} )
+if (( N != 5 ))
+then
+ mv -v ${OUTPUT} ${OUTPUT}.failed
+ exit 1
+fi
+
+return 0
Property changes on: test/driver/test-put.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-11 23:09:03
|
Revision: 94
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=94&view=rev
Author: jmwozniak
Date: 2010-05-11 23:08:57 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Minor fix
Modified Paths:
--------------
test/cmpi/module.mk.in
Modified: test/cmpi/module.mk.in
===================================================================
--- test/cmpi/module.mk.in 2010-05-11 23:05:29 UTC (rev 93)
+++ test/cmpi/module.mk.in 2010-05-11 23:08:57 UTC (rev 94)
@@ -17,7 +17,7 @@
$(DIR)/test%.x: $(DIR)/test%.o $(DIR)/test_helpers.o src/cmpi/node.o $(CMPI)
$(Q) " LINK $(@) "
- $(E) $(MPICC) $(MPE) $(<) $(DIR)/test_helpers.o src/cmpi/node.o \
+ $(E) $(MPICC) $(MPE) $(<) test/cmpi/test_helpers.o src/cmpi/node.o \
$(CMPI) $(LIBS) -o $(@)
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-11 23:05:35
|
Revision: 93
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=93&view=rev
Author: jmwozniak
Date: 2010-05-11 23:05:29 +0000 (Tue, 11 May 2010)
Log Message:
-----------
OUTPUT cleanups.
Modified Paths:
--------------
test/cmpi/test-manyputs.zsh
test/cmpi/test-putget.zsh
test/cmpi/test-startup.zsh
test/cmpi/test-tables.zsh
test/cmpi/test-update01.zsh
test/cmpi/test-update02.zsh
test/cmpi-db/test-cp1.zsh
test/cmpi-db/test-quit.zsh
test/driver/module.mk.in
test/driver/test-cmd-put.c
test/gossip/test-do.zsh
test/gossip/test-env.zsh
test/gossip/test-masks.zsh
test/mpirpc/test-args.zsh
test/mpirpc/test-blob.zsh
test/mpirpc/test-ping.zsh
test/mpirpc/test-returns.zsh
tools/test-helpers.zsh
Removed Paths:
-------------
test/driver/test01.zsh
Modified: test/cmpi/test-manyputs.zsh
===================================================================
--- test/cmpi/test-manyputs.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi/test-manyputs.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -7,7 +7,7 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
@@ -16,7 +16,7 @@
# Monolithic execution (5 nodes, 1 client):
- mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -31,7 +31,7 @@
fi
# Should be 6 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 6 )) || crash "N != 6"
exit 0
Modified: test/cmpi/test-putget.zsh
===================================================================
--- test/cmpi/test-putget.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi/test-putget.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -7,7 +7,7 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
@@ -16,7 +16,7 @@
# Monolithic execution (3 nodes, 2 clients):
- mpiexec -n 6 ${PROGRAM} -n 5 >& ${OUT}
+ mpiexec -n 6 ${PROGRAM} -n 5 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -31,7 +31,7 @@
fi
# Should be 5 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 6 )) || crash "N != 6"
exit 0
Modified: test/cmpi/test-startup.zsh
===================================================================
--- test/cmpi/test-startup.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi/test-startup.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -7,7 +7,7 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
@@ -15,7 +15,7 @@
then
# KDA-2A execution (3 nodes, 2 clients):
- mpiexec -n 5 ${PROGRAM} -n 3 >& ${OUT}
+ mpiexec -n 5 ${PROGRAM} -n 3 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -32,7 +32,7 @@
fi
# Should be 5 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 5 )) || crash "N != 5"
exit 0
Modified: test/cmpi/test-tables.zsh
===================================================================
--- test/cmpi/test-tables.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi/test-tables.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -7,7 +7,7 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
@@ -15,7 +15,7 @@
then
# KDA-2A execution (3 nodes, 2 clients):
- mpiexec -n 5 ${PROGRAM} -n 3 >& ${OUT}
+ mpiexec -n 5 ${PROGRAM} -n 3 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -30,7 +30,7 @@
fi
# Should be 5 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 5 )) || crash "N != 5"
exit 0
Modified: test/cmpi/test-update01.zsh
===================================================================
--- test/cmpi/test-update01.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi/test-update01.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -7,7 +7,7 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
@@ -16,7 +16,7 @@
# Monolithic execution (5 nodes, 1 client):
- mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -31,7 +31,7 @@
fi
# Should be 6 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 6 )) || crash "N != 6"
exit 0
Modified: test/cmpi/test-update02.zsh
===================================================================
--- test/cmpi/test-update02.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi/test-update02.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -7,7 +7,7 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
@@ -16,7 +16,7 @@
# Monolithic execution (5 nodes, 1 client):
- mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -31,7 +31,7 @@
fi
# Should be 6 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 6 )) || crash "N != 6"
exit 0
Modified: test/cmpi-db/test-cp1.zsh
===================================================================
--- test/cmpi-db/test-cp1.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi-db/test-cp1.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -4,13 +4,13 @@
# set -x
-OUT=$1
+OUTPUT=$1
PROCS=$2
NODES=$3
source tools/test-helpers.zsh
-mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUT} &
+mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
MPI_PROCESS=$!
sleep ${PROCS}
@@ -44,7 +44,7 @@
sleep ${PROCS}
# Should be ${PROCS} "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == PROCS )) || crash "N != ${PROCS}"
# rm cmpi-cp.out test-cp1.*.data
Modified: test/cmpi-db/test-quit.zsh
===================================================================
--- test/cmpi-db/test-quit.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi-db/test-quit.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -4,13 +4,13 @@
set -x
-OUT=$1
+OUTPUT=$1
PROCS=$2
NODES=$3
source tools/test-helpers.zsh
-mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUT} &
+mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
MPI_PROCESS=$!
sleep ${PROCS}
@@ -21,7 +21,7 @@
sleep ${PROCS}
# Should be ${PROCS} "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == PROCS )) || crash "N != ${PROCS}"
exit 0
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-11 21:44:50 UTC (rev 92)
+++ test/driver/module.mk.in 2010-05-11 23:05:29 UTC (rev 93)
@@ -4,7 +4,10 @@
TEST_DRIVER_SRC += $(shell find test/driver -name "*.c" ! -name test_helpers.c)
TEST_DRIVER_OBJS = $(patsubst %.c, %.o, $(TEST_DRIVER_SRC))
-TEST_DRIVER_OUTPUT = $(patsubst %.c, %.out, $(TEST_DRIVER_SRC))
+TEST_DRIVER_OUTPUT = test/driver/test-quit.out \
+ test/driver/test-sleep.out \
+ test/driver/test-put.out \
+ test/driver/test-get.out
TEST_HELPER_SRC := test/driver/test_helpers.c
TEST_DRIVER_OBJS += $(patsubst %.c, %.o, $(TEST_HELPER_SRC))
@@ -30,3 +33,6 @@
test/driver/test%.out: test/driver/test%.zsh $(TEST_PROGS) $(TEST_DRIVER)
$(Q) " TEST $(@) "
$(E) $(<) $(@)
+
+test/driver/test-success.out: test/cmpi/test-success.out \
+ $(TEST_DRIVER_OUTPUT)
Modified: test/driver/test-cmd-put.c
===================================================================
--- test/driver/test-cmd-put.c 2010-05-11 21:44:50 UTC (rev 92)
+++ test/driver/test-cmd-put.c 2010-05-11 23:05:29 UTC (rev 93)
@@ -11,9 +11,17 @@
{
driver_access_fifo();
+ if (argc < 2)
+ {
+ printf("test-cmd-put: needs key argument!\n");
+ exit(1);
+ }
+
+ char* key = argv[1];
+
char* data = "hello does this work";
- fprintf(to_cmpi, "put key1 %i\n", (int) strlen(data));
+ fprintf(to_cmpi, "put %s %i\n", key, (int) strlen(data));
fprintf(to_cmpi, "%s", data);
fflush(to_cmpi);
Deleted: test/driver/test01.zsh
===================================================================
--- test/driver/test01.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/driver/test01.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,18 +0,0 @@
-#!/bin/zsh
-
-make -j 3 D=1 test/driver/test01.x test/driver/test02.x \
- test/driver/test_driver.x
-
-mpiexec -n 5 test/driver/test_driver.x -n 4 &
-DRIVER_PID=${!}
-
-sleep 5
-
-print "Launching tool 01..."
-test/driver/test01.x
-
-print "Launching tool 02..."
-test/driver/test02.x
-
-wait
-
Modified: test/gossip/test-do.zsh
===================================================================
--- test/gossip/test-do.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/gossip/test-do.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,37 +1,32 @@
#!/bin/zsh
-# set -x
-
# Be sure to make tests with D=1
-PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+source tools/test-helpers.zsh
-crash()
-{
- print $1
- mv ${OUT} ${OUT}.failed
- exit 1
-}
+# set -x
-${PROGRAM} > ${OUT} 2>&1
+PROGRAM=$1
+OUTPUT=${PROGRAM%.x}.out
+
+${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUT} 2>&1
+CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUT} 2>&1
+CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
# Should be 3 "test program"s
-N=$( grep -c "test program" ${OUT} )
+N=$( grep -c "test program" ${OUTPUT} )
(( N == 3 )) || crash "N != 3"
# Should be 2 "EXAMPLE MESSAGE"s
-N=$( grep -c "EXAMPLE MESSAGE" ${OUT} )
+N=$( grep -c "EXAMPLE MESSAGE" ${OUTPUT} )
(( N == 2 )) || crash "N != 2"
exit 0
Modified: test/gossip/test-env.zsh
===================================================================
--- test/gossip/test-env.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/gossip/test-env.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,37 +1,39 @@
#!/bin/zsh
+# Be sure to make tests with D=1
+
+source tools/test-helpers.zsh
+
# set -x
-# Be sure to make tests with D=1
-
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
crash()
{
print $1
- mv ${OUT} ${OUT}.failed
+ mv ${OUTPUT} ${OUT}.failed
exit 1
}
-${PROGRAM} > ${OUT} 2>&1
+${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUT} 2>&1
+CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUT} 2>&1
+CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
# Should be 3 "test program"s
-N=$( grep -c "test program" ${OUT} )
+N=$( grep -c "test program" ${OUTPUT} )
(( N == 3 )) || crash "N != 3"
# Should be 2 "Example debugging message."s
-N=$( grep -c "EXAMPLE MESSAGE" ${OUT} )
+N=$( grep -c "EXAMPLE MESSAGE" ${OUTPUT} )
(( N == 2 )) || crash "N != 2"
exit 0
Modified: test/gossip/test-masks.zsh
===================================================================
--- test/gossip/test-masks.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/gossip/test-masks.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,29 +1,24 @@
#!/bin/zsh
-# set -x
-
# Be sure to make tests with D=1
-PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+source tools/test-helpers.zsh
-crash()
-{
- print $1
- mv ${OUT} ${OUT}.failed
- exit 1
-}
+# set -x
-${PROGRAM} > ${OUT} 2>&1
+PROGRAM=$1
+OUTPUT=${PROGRAM%.x}.out
+
+${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
# Should be 4 "Debug mask"s
-N=$( grep -c "Debug mask" ${OUT} )
+N=$( grep -c "Debug mask" ${OUTPUT} )
(( N == 4 )) || crash "N != 4"
# Should be 2 line outputs
-N=$( grep -c "test-masks.c main.*Debug mask" ${OUT} )
+N=$( grep -c "test-masks.c main.*Debug mask" ${OUTPUT} )
(( N == 2 )) || crash "N != 2"
exit 0
Modified: test/mpirpc/test-args.zsh
===================================================================
--- test/mpirpc/test-args.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/mpirpc/test-args.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,27 +1,22 @@
#!/bin/zsh
-# set -x
-
# Be sure to make tests with D=1
+source tools/test-helpers.zsh
+
+# set -x
+
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
-crash()
-{
- print $1
- mv ${OUT} ${OUT}.failed
- exit 1
-}
-
-eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUT} 2>&1
+eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
# Should only be 3 calls to handle_test()...
-N=$( grep -c "handle_test(args=" ${OUT} )
+N=$( grep -c "handle_test(args=" ${OUTPUT} )
(( N == 3 )) || crash "N != 3"
TOKENS=("handle_test(args=(null))"
@@ -30,7 +25,7 @@
for T in ${TOKENS}
do
- grep ${T} ${OUT} > /dev/null || crash "Not found: ${T}"
+ grep ${T} ${OUTPUT} > /dev/null || crash "Not found: ${T}"
done
exit 0
Modified: test/mpirpc/test-blob.zsh
===================================================================
--- test/mpirpc/test-blob.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/mpirpc/test-blob.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,22 +1,17 @@
#!/bin/zsh
-# set -x
-
# Be sure to make tests with D=1
+source tools/test-helpers.zsh
+
+# set -x
+
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
-crash()
-{
- print $1
- mv ${OUT} ${OUT}.failed
- exit 1
-}
-
-eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUT} 2>&1
+eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -25,11 +20,11 @@
for T in ${TOKENS}
do
- grep ${T} ${OUT} > /dev/null || crash "Not found: ${T}"
+ grep ${T} ${OUTPUT} > /dev/null || crash "Not found: ${T}"
done
# Should be 2 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 2 )) || crash "N != 2"
exit 0
Modified: test/mpirpc/test-ping.zsh
===================================================================
--- test/mpirpc/test-ping.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/mpirpc/test-ping.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,33 +1,28 @@
#!/bin/zsh
-# set -x
-
# Be sure to make tests with D=1
+source tools/test-helpers.zsh
+
+# set -x
+
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
-crash()
-{
- print $1
- mv ${OUT} ${OUT}.failed
- exit 1
-}
-
-eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUT} 2>&1
+eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
# Should be 5 calls to handle_ping()...
-N=$( grep -c "handle_ping" ${OUT} )
+N=$( grep -c "handle_ping" ${OUTPUT} )
(( N == 5 )) || crash "N != 6"
-grep "handle_quit" ${OUT} > /dev/null || crash "No handle_quit!"
+grep "handle_quit" ${OUTPUT} > /dev/null || crash "No handle_quit!"
# Should be 2 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 2 )) || crash "N != 2"
exit 0
Modified: test/mpirpc/test-returns.zsh
===================================================================
--- test/mpirpc/test-returns.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/mpirpc/test-returns.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,22 +1,17 @@
#!/bin/zsh
-# set -x
-
# Be sure to make tests with D=1
+source tools/test-helpers.zsh
+
+# set -x
+
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
-crash()
-{
- print $1
- mv ${OUT} ${OUT}.failed
- exit 1
-}
-
-eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUT} 2>&1
+eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -25,7 +20,7 @@
for T in ${TOKENS}
do
- grep ${T} ${OUT} > /dev/null || crash "Not found: ${T}"
+ grep ${T} ${OUTPUT} > /dev/null || crash "Not found: ${T}"
done
exit 0
Modified: tools/test-helpers.zsh
===================================================================
--- tools/test-helpers.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ tools/test-helpers.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -6,6 +6,6 @@
crash()
{
print $1
- mv -v ${OUT} ${OUT}.failed
+ mv -v ${OUTPUT} ${OUTPUT}.failed
exit 1
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-11 21:44:56
|
Revision: 92
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=92&view=rev
Author: jmwozniak
Date: 2010-05-11 21:44:50 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Improve test-sleep case
Modified Paths:
--------------
Makefile.in
test/driver/test-cmd-sleep.c
test/driver/test-sleep.zsh
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-11 21:36:05 UTC (rev 91)
+++ Makefile.in 2010-05-11 21:44:50 UTC (rev 92)
@@ -486,7 +486,8 @@
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 "*.bombed" -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: test/driver/test-cmd-sleep.c
===================================================================
--- test/driver/test-cmd-sleep.c 2010-05-11 21:36:05 UTC (rev 91)
+++ test/driver/test-cmd-sleep.c 2010-05-11 21:44:50 UTC (rev 92)
@@ -9,14 +9,25 @@
int
main(int argc, char* argv[])
{
- int error;
+ int code;
+ int seconds;
- driver_access_fifo();
+ if (argc < 2)
+ {
+ printf("test-cmd-sleep: needs seconds argument!\n");
+ exit(1);
+ }
- fprintf(to_cmpi, "sleep 3\n");
+ code = sscanf(argv[1], "%i", &seconds);
+ assert(code == 1);
+
+ code = driver_access_fifo();
+ assert(code);
+
+ fprintf(to_cmpi, "sleep %i\n", seconds);
fflush(to_cmpi);
char output[32];
- error = fscanf(from_cmpi, "%s", output);
+ fscanf(from_cmpi, "%s", output);
assert(!strcmp(output, "ok"));
Modified: test/driver/test-sleep.zsh
===================================================================
--- test/driver/test-sleep.zsh 2010-05-11 21:36:05 UTC (rev 91)
+++ test/driver/test-sleep.zsh 2010-05-11 21:44:50 UTC (rev 92)
@@ -1,17 +1,24 @@
#!/bin/zsh
+# Flex driver by issuing multiple simple commands
+
+OUTPUT=$1
+
mpiexec -n 5 test/driver/test_driver.x -n 4 > ${OUTPUT} &
DRIVER_PID=${!}
-tools/timebomb.zsh ${$} 10 ${OUTPUT} $0
-BOMB1_PID=${!}
+tools/timebomb.zsh ${$} 15 ${OUTPUT} $0 &
+BOMB_PID=${!}
sleep 5
-print "Launching command quit..."
+test/driver/test-cmd-sleep.x 1
+test/driver/test-cmd-sleep.x 1
+test/driver/test-cmd-sleep.x 1
test/driver/test-cmd-quit.x
-wait
+wait ${DRIVER_PID}
+kill ${BOMB_PID}
N=$( grep -c "Normal exit" ${OUTPUT} )
if (( N != 5 ))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-11 21:36:11
|
Revision: 91
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=91&view=rev
Author: jmwozniak
Date: 2010-05-11 21:36:05 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Fix test-quit case
Modified Paths:
--------------
test/driver/module.mk.in
test/driver/test-quit.zsh
test/driver/test-sleep.zsh
tools/timebomb.zsh
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-11 21:25:17 UTC (rev 90)
+++ test/driver/module.mk.in 2010-05-11 21:36:05 UTC (rev 91)
@@ -15,7 +15,6 @@
TEST_OUTPUT += $(TEST_DRIVER_OUTPUT)
TEST_DRIVER = test/driver/test_driver.x
-
TEST_DRIVER_IMPL = test/driver/test_driver_fifo.o
$(TEST_DRIVER): $(TEST_DRIVER_IMPL) test/driver/test_helpers.o $(CMPI)
@@ -28,6 +27,6 @@
$(Q) " MPICC $(@) "
$(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o $(CMPI) $(LIBS) -o $(@)
-test/driver/test%.out: test/driver/test%.zsh test/driver/test02.x $(TEST_DRIVER)
+test/driver/test%.out: test/driver/test%.zsh $(TEST_PROGS) $(TEST_DRIVER)
$(Q) " TEST $(@) "
$(E) $(<) $(@)
Modified: test/driver/test-quit.zsh
===================================================================
--- test/driver/test-quit.zsh 2010-05-11 21:25:17 UTC (rev 90)
+++ test/driver/test-quit.zsh 2010-05-11 21:36:05 UTC (rev 91)
@@ -5,15 +5,15 @@
mpiexec -n 5 test/driver/test_driver.x -n 4 > ${OUTPUT} &
DRIVER_PID=${!}
-tools/timebomb.zsh ${$} 10 ${OUTPUT} $0
-BOMB1_PID=${!}
+tools/timebomb.zsh ${$} 10 ${OUTPUT} $0 &
+BOMB_PID=${!}
-sleep 5
+sleep 3
-print "Launching tool 02..."
-test/driver/test02.x
+test/driver/test-cmd-quit.x
-wait
+wait ${DRIVER_PID}
+kill ${BOMB_PID}
N=$( grep -c "Normal exit" ${OUTPUT} )
if (( N != 5 ))
Modified: test/driver/test-sleep.zsh
===================================================================
--- test/driver/test-sleep.zsh 2010-05-11 21:25:17 UTC (rev 90)
+++ test/driver/test-sleep.zsh 2010-05-11 21:36:05 UTC (rev 91)
@@ -1,20 +1,23 @@
#!/bin/zsh
-make -j 3 D=1 test/driver/test02.x test/driver/test03.x \
- test/driver/test_driver.x
-[[ $? != 0 ]] && exit
-sleep 1
-
-mpiexec -n 5 test/driver/test_driver.x -n 4 &
+mpiexec -n 5 test/driver/test_driver.x -n 4 > ${OUTPUT} &
DRIVER_PID=${!}
+tools/timebomb.zsh ${$} 10 ${OUTPUT} $0
+BOMB1_PID=${!}
+
sleep 5
-print "Launching tool 03..."
-test/driver/test03.x
+print "Launching command quit..."
+test/driver/test-cmd-quit.x
-print "Launching tool 02..."
-test/driver/test02.x
-
wait
+N=$( grep -c "Normal exit" ${OUTPUT} )
+if (( N != 5 ))
+then
+ mv -v ${OUTPUT} ${OUTPUT}.failed
+ exit 1
+fi
+
+return 0
Modified: tools/timebomb.zsh
===================================================================
--- tools/timebomb.zsh 2010-05-11 21:25:17 UTC (rev 90)
+++ tools/timebomb.zsh 2010-05-11 21:36:05 UTC (rev 91)
@@ -14,4 +14,4 @@
sleep 3
-kill ${TARGET}
+kill -9 ${TARGET}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-11 21:25:23
|
Revision: 90
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=90&view=rev
Author: jmwozniak
Date: 2010-05-11 21:25:17 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Rename to test-sleep
Added Paths:
-----------
test/driver/test-sleep.zsh
Removed Paths:
-------------
test/driver/test02.zsh
Copied: test/driver/test-sleep.zsh (from rev 89, test/driver/test02.zsh)
===================================================================
--- test/driver/test-sleep.zsh (rev 0)
+++ test/driver/test-sleep.zsh 2010-05-11 21:25:17 UTC (rev 90)
@@ -0,0 +1,20 @@
+#!/bin/zsh
+
+make -j 3 D=1 test/driver/test02.x test/driver/test03.x \
+ test/driver/test_driver.x
+[[ $? != 0 ]] && exit
+sleep 1
+
+mpiexec -n 5 test/driver/test_driver.x -n 4 &
+DRIVER_PID=${!}
+
+sleep 5
+
+print "Launching tool 03..."
+test/driver/test03.x
+
+print "Launching tool 02..."
+test/driver/test02.x
+
+wait
+
Deleted: test/driver/test02.zsh
===================================================================
--- test/driver/test02.zsh 2010-05-11 21:24:42 UTC (rev 89)
+++ test/driver/test02.zsh 2010-05-11 21:25:17 UTC (rev 90)
@@ -1,20 +0,0 @@
-#!/bin/zsh
-
-make -j 3 D=1 test/driver/test02.x test/driver/test03.x \
- test/driver/test_driver.x
-[[ $? != 0 ]] && exit
-sleep 1
-
-mpiexec -n 5 test/driver/test_driver.x -n 4 &
-DRIVER_PID=${!}
-
-sleep 5
-
-print "Launching tool 03..."
-test/driver/test03.x
-
-print "Launching tool 02..."
-test/driver/test02.x
-
-wait
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-11 21:24:48
|
Revision: 89
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=89&view=rev
Author: jmwozniak
Date: 2010-05-11 21:24:42 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Fix EOLs
Modified Paths:
--------------
test/driver/test02.zsh
Modified: test/driver/test02.zsh
===================================================================
--- test/driver/test02.zsh 2010-05-11 21:23:31 UTC (rev 88)
+++ test/driver/test02.zsh 2010-05-11 21:24:42 UTC (rev 89)
@@ -1,20 +1,20 @@
-#!/bin/zsh
+#!/bin/zsh
make -j 3 D=1 test/driver/test02.x test/driver/test03.x \
- test/driver/test_driver.x
-[[ $? != 0 ]] && exit
+ test/driver/test_driver.x
+[[ $? != 0 ]] && exit
sleep 1
-mpiexec -n 5 test/driver/test_driver.x -n 4 &
+mpiexec -n 5 test/driver/test_driver.x -n 4 &
DRIVER_PID=${!}
-sleep 5
+sleep 5
print "Launching tool 03..."
-test/driver/test03.x
+test/driver/test03.x
print "Launching tool 02..."
-test/driver/test02.x
+test/driver/test02.x
-wait
+wait
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-11 21:23:37
|
Revision: 88
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=88&view=rev
Author: jmwozniak
Date: 2010-05-11 21:23:31 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Better test names
Added Paths:
-----------
test/driver/test-cmd-put.c
test/driver/test-cmd-quit.c
test/driver/test-cmd-sleep.c
Removed Paths:
-------------
test/driver/test01.c
test/driver/test02.c
test/driver/test03.c
Copied: test/driver/test-cmd-put.c (from rev 87, test/driver/test03.c)
===================================================================
--- test/driver/test-cmd-put.c (rev 0)
+++ test/driver/test-cmd-put.c 2010-05-11 21:23:31 UTC (rev 88)
@@ -0,0 +1,26 @@
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <accessor.h>
+
+int
+main(int argc, char* argv[])
+{
+ driver_access_fifo();
+
+ char* data = "hello does this work";
+
+ fprintf(to_cmpi, "put key1 %i\n", (int) strlen(data));
+ fprintf(to_cmpi, "%s", data);
+ fflush(to_cmpi);
+
+ char output[32];
+ fscanf(from_cmpi, "%s", output);
+
+ assert(!strcmp(output, "ok"));
+
+ return 0;
+}
Copied: test/driver/test-cmd-quit.c (from rev 87, test/driver/test02.c)
===================================================================
--- test/driver/test-cmd-quit.c (rev 0)
+++ test/driver/test-cmd-quit.c 2010-05-11 21:23:31 UTC (rev 88)
@@ -0,0 +1,24 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <mpi_tools.h>
+#include <accessor.h>
+
+int
+main(int argc, char* argv[])
+{
+ int error;
+
+ error = driver_access_fifo();
+ assert(error);
+
+ fprintf(to_cmpi, "quit\n");
+ fflush(to_cmpi);
+ char output[32];
+ fscanf(from_cmpi, "%s", output);
+
+ assert(!strcmp(output, "ok"));
+
+ return 0;
+}
Copied: test/driver/test-cmd-sleep.c (from rev 85, test/driver/test01.c)
===================================================================
--- test/driver/test-cmd-sleep.c (rev 0)
+++ test/driver/test-cmd-sleep.c 2010-05-11 21:23:31 UTC (rev 88)
@@ -0,0 +1,24 @@
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <accessor.h>
+
+int
+main(int argc, char* argv[])
+{
+ int error;
+
+ driver_access_fifo();
+
+ fprintf(to_cmpi, "sleep 3\n");
+ fflush(to_cmpi);
+ char output[32];
+ error = fscanf(from_cmpi, "%s", output);
+
+ assert(!strcmp(output, "ok"));
+
+ return 0;
+}
Deleted: test/driver/test01.c
===================================================================
--- test/driver/test01.c 2010-05-11 21:22:09 UTC (rev 87)
+++ test/driver/test01.c 2010-05-11 21:23:31 UTC (rev 88)
@@ -1,24 +0,0 @@
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <accessor.h>
-
-int
-main(int argc, char* argv[])
-{
- int error;
-
- driver_access_fifo();
-
- fprintf(to_cmpi, "sleep 3\n");
- fflush(to_cmpi);
- char output[32];
- error = fscanf(from_cmpi, "%s", output);
-
- assert(!strcmp(output, "ok"));
-
- return 0;
-}
Deleted: test/driver/test02.c
===================================================================
--- test/driver/test02.c 2010-05-11 21:22:09 UTC (rev 87)
+++ test/driver/test02.c 2010-05-11 21:23:31 UTC (rev 88)
@@ -1,24 +0,0 @@
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <mpi_tools.h>
-#include <accessor.h>
-
-int
-main(int argc, char* argv[])
-{
- int error;
-
- error = driver_access_fifo();
- assert(error);
-
- fprintf(to_cmpi, "quit\n");
- fflush(to_cmpi);
- char output[32];
- fscanf(from_cmpi, "%s", output);
-
- assert(!strcmp(output, "ok"));
-
- return 0;
-}
Deleted: test/driver/test03.c
===================================================================
--- test/driver/test03.c 2010-05-11 21:22:09 UTC (rev 87)
+++ test/driver/test03.c 2010-05-11 21:23:31 UTC (rev 88)
@@ -1,26 +0,0 @@
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <accessor.h>
-
-int
-main(int argc, char* argv[])
-{
- driver_access_fifo();
-
- char* data = "hello does this work";
-
- fprintf(to_cmpi, "put key1 %i\n", (int) strlen(data));
- fprintf(to_cmpi, "%s", data);
- fflush(to_cmpi);
-
- char output[32];
- fscanf(from_cmpi, "%s", output);
-
- assert(!strcmp(output, "ok"));
-
- 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-11 21:22:15
|
Revision: 87
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=87&view=rev
Author: jmwozniak
Date: 2010-05-11 21:22:09 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Change bombed suffix
Modified Paths:
--------------
tools/timebomb.zsh
Modified: tools/timebomb.zsh
===================================================================
--- tools/timebomb.zsh 2010-05-11 21:20:43 UTC (rev 86)
+++ tools/timebomb.zsh 2010-05-11 21:22:09 UTC (rev 87)
@@ -10,7 +10,7 @@
print "timebomb killing: ${LABEL} PID: ${TARGET}"
-cp -v ${DATA} ${DATA}.bak
+cp -v ${DATA} ${DATA}.bombed
sleep 3
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-11 21:20:49
|
Revision: 86
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=86&view=rev
Author: jmwozniak
Date: 2010-05-11 21:20:43 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Minor cleanup
Modified Paths:
--------------
test/driver/module.mk.in
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-11 21:18:02 UTC (rev 85)
+++ test/driver/module.mk.in 2010-05-11 21:20:43 UTC (rev 86)
@@ -23,14 +23,10 @@
$(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o \
$(CMPI) $(LIBS) -o $(@)
-test/driver/test%.x: test/driver/test%.o test/driver/test_helpers.o $(DRIVER)
- $(Q) " MPICC $(@) "
- $(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o $(CMPI) $(LIBS) -o $(@)
-
-test/driver/test02.x: test/driver/test02.o test/driver/test_helpers.o \
+test/driver/test%.x: test/driver/test%.o test/driver/test_helpers.o \
$(CMPI)
$(Q) " MPICC $(@) "
- $(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o $(CMPI) $(LIBS) -o $(@)
+ $(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o $(CMPI) $(LIBS) -o $(@)
test/driver/test%.out: test/driver/test%.zsh test/driver/test02.x $(TEST_DRIVER)
$(Q) " TEST $(@) "
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-11 21:18:09
|
Revision: 85
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=85&view=rev
Author: jmwozniak
Date: 2010-05-11 21:18:02 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Better driver tests.
Modified Paths:
--------------
Makefile.in
include/driver.h
include/gossip.h
src/cmpi/driver.c
src/cmpi/module.mk.in
src/cmpi/node.c
src/cmpi-db/module.mk.in
src/gossip/gossip.c
src/mpirpc/module.mk.in
test/driver/module.mk.in
test/driver/test01.c
test/driver/test02.c
test/driver/test03.c
Added Paths:
-----------
test/driver/test-quit.zsh
tools/timebomb.zsh
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-11 19:31:33 UTC (rev 84)
+++ Makefile.in 2010-05-11 21:18:02 UTC (rev 85)
@@ -273,8 +273,8 @@
$(Q) " DEBUGGING VARIABLES "
$(Q) " "
$(E)echo MPICC: $(MPICC)
- $(E)echo MODULES: $(MODULES)
- $(E)echo DISKSIM: $(DISKSIM)
+# $(E)echo MODULES: $(MODULES)
+# $(E)echo DISKSIM: $(DISKSIM)
$(E)echo CFLAGS: $(CFLAGS)
$(E)echo IFLAGS: $(IFLAGS)
$(E)echo LIBS: $(LIBS)
@@ -287,8 +287,8 @@
# $(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 CMPI_SRC: $(CMPI_OBJS)
-# $(E)echo CMPI_OBJS: $(CMPI_OBJS)
+ $(E)echo TABLE_OBJS: $(TABLE_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_MPIRPC_SRC: $(TEST_MPIRPC_SRC)
@@ -317,7 +317,7 @@
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-db/module.mk
#include src/cmpi-cp/module.mk
################################################################
@@ -351,7 +351,7 @@
include test/adts/module.mk
include test/mpirpc/module.mk
include test/cmpi/module.mk
-#include test/driver/module.mk.in
+include test/driver/module.mk.in
#include test/cmpi-db/module.mk.in
#include test/cmpi-io/module.mk.in
@@ -409,11 +409,11 @@
unpublish: src/mpirpc/unpublish.o $(CMPI)
$(Q) " MPICC $(@)"
- $(E)$(MPICC) $(<) $(CMPI) $(LIBS) -o $(@)
+ $(E) $(MPICC) $(<) $(CMPI) $(LIBS) -o $(@)
bin:
$(Q) " MKDIR $(@)"
- $(E)mkdir -p $(@)
+ $(E) mkdir -p $(@)
## Development tools...
@@ -534,7 +534,7 @@
# add this as a make goal to disable rebuilding dependencies
.PHONY: nodep clean
.SECONDARY: $(TEST_OBJS) $(TEST_PROGS)
-.PRECIOUS: $(TEST_OUTPUT) %.gs.dummyobj %.gs.i %.gs.s %.o
+.PRECIOUS: $(TEST_OUTPUT) %.o
nodep:; @:
# default rule for generating dependency files
Modified: include/driver.h
===================================================================
--- include/driver.h 2010-05-11 19:31:33 UTC (rev 84)
+++ include/driver.h 2010-05-11 21:18:02 UTC (rev 85)
@@ -13,7 +13,7 @@
*/
#define CMPI_DRIVER_MAX_COMMAND (100+CMPI_KEY_LENGTH)
-typedef struct cmpi_driver_
+typedef struct
{
FILE* source;
FILE* sink;
Modified: include/gossip.h
===================================================================
--- include/gossip.h 2010-05-11 19:31:33 UTC (rev 84)
+++ include/gossip.h 2010-05-11 21:18:02 UTC (rev 85)
@@ -127,6 +127,8 @@
int gossip_enable_syslog(
int priority);
+int gossip_enable_stdout(
+ void);
int gossip_enable_stderr(
void);
int gossip_enable_file(
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-11 19:31:33 UTC (rev 84)
+++ src/cmpi/driver.c 2010-05-11 21:18:02 UTC (rev 85)
@@ -157,8 +157,8 @@
{
char* p = tokens->head->next->data;
int i;
- SHOW_I(i);
sscanf(p, "%i", &i);
+ SHOW_FI(i);
sleep(i);
fprintf(driver->sink, "ok\n");
fflush(driver->sink);
@@ -167,11 +167,16 @@
void
driver_quit(cmpi_driver* driver)
{
+ NOTE_F;
+
driver->quitting = true;
fprintf(driver->sink, "ok\n");
fflush(driver->sink);
+ NOTE("sent ok");
+ sleep(1);
+
cmpi_shutdown();
DONE;
}
@@ -183,8 +188,8 @@
struct list* tokens = list_parse(driver->command);
- gossip_ldebug(MASK_DRIVER, "got tokens: \n");
- gossip_do(MASK_DRIVER, list_printf("%s", tokens));
+ NOTE("got tokens: ");
+ DEBUG(list_printf("%s", tokens));
if (tokens->size == 0)
return;
Modified: src/cmpi/module.mk.in
===================================================================
--- src/cmpi/module.mk.in 2010-05-11 19:31:33 UTC (rev 84)
+++ src/cmpi/module.mk.in 2010-05-11 21:18:02 UTC (rev 85)
@@ -39,5 +39,5 @@
$(CMPI): $(CMPI_OBJS) $(TABLE_OBJS)
$(Q) " AR $@"
- $(E)$(INSTALL) -d lib
- $(E)ar rcs $(@) $(CMPI_OBJS) $(TABLE_OBJS)
+ $(E) install -d lib
+ $(E) ar rcs $(@) $(CMPI_OBJS) $(TABLE_OBJS)
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2010-05-11 19:31:33 UTC (rev 84)
+++ src/cmpi/node.c 2010-05-11 21:18:02 UTC (rev 85)
@@ -153,8 +153,10 @@
int
main(int argc, char* argv[])
{
- gossip_set_debug_mask(1,MASK_DEBUG|MASK_MPIRPC|MASK_ADTS|
- MASK_CMPI|MASK_DRIVER);
+ gossip_debug_init();
+ gossip_set_debug_mask(true,MASK_DEBUG|MASK_MPIRPC|MASK_ADTS|
+ MASK_CMPI|MASK_DRIVER);
+ gossip_enable_stdout();
// Comment out to achieve deterministic results:
// srand((unsigned int) time(NULL));
Modified: src/cmpi-db/module.mk.in
===================================================================
--- src/cmpi-db/module.mk.in 2010-05-11 19:31:33 UTC (rev 84)
+++ src/cmpi-db/module.mk.in 2010-05-11 21:18:02 UTC (rev 85)
@@ -1,17 +1,17 @@
DIR := src/cmpi-db
-CMPI_PROGS += bin/cmpi-db
-CMPI_PROGS += bin/cmpi-db-fifo-quit
-CMPI_SRC += src/cmpi-cp/cmpi-cp.c src/cmpi-db/cmpi-db-fifo-quit.c
+PROGS += bin/cmpi-db
+PROGS += bin/cmpi-db-fifo-quit
+CMPIDB_SRC += src/cmpi-cp/cmpi-cp.c src/cmpi-db/cmpi-db-fifo-quit.c
-CMPI_DB = bin/cmpi-db
+CMPIDB = bin/cmpi-db
-$(CMPI_DB): src/cmpi/node.o src/cmpi/driver.o src/cmpi-db/cmpi-db-fifo.o $(CMPI) bin
+$(CMPI_DB): src/cmpi-db/cmpi-db-fifo.o $(CMPI) bin
$(Q) " MPICC $(@)"
$(E)$(MPICC) $(MPE) src/cmpi/node.o src/cmpi/driver.o \
- src/cmpi-db/cmpi-db-fifo.o $(CMPI) $(LIBS) -o $(@)
+ $(<) $(CMPI) $(LIBS) -o $(@)
bin/cmpi-db-fifo-quit: src/cmpi-db/cmpi-db-fifo-quit.o $(CMPI) bin
$(Q) " MPICC $(@)"
- $(E)$(MPICC) src/cmpi-db/cmpi-db-fifo-quit.o $(CMPI) -o $(@)
+ $(E)$(MPICC) $(<) $(CMPI) -o $(@)
Modified: src/gossip/gossip.c
===================================================================
--- src/gossip/gossip.c 2010-05-11 19:31:33 UTC (rev 84)
+++ src/gossip/gossip.c 2010-05-11 21:18:02 UTC (rev 85)
@@ -11,6 +11,7 @@
* Handles debugging output.
*/
+#include <assert.h>
#include <strings.h>
#include <gossip.h>
@@ -23,15 +24,16 @@
enum
{
- GOSSIP_STDERR = 1,
- GOSSIP_FILE = 2,
+ GOSSIP_STDOUT = 1,
+ GOSSIP_STDERR = 2,
+ GOSSIP_FILE = 3,
GOSSIP_SYSLOG = 4
};
-/** determines which logging facility to use. Default to stderr to begin
+/** determines which logging facility to use. Default to stdout to begin
* with.
*/
-int gossip_facility = GOSSIP_STDERR;
+int gossip_facility = GOSSIP_STDOUT;
/* file handle used for file logging */
static FILE *internal_log_file = NULL;
@@ -45,6 +47,7 @@
/*****************************************************************
* prototypes
*/
+static int gossip_disable_stdout(void);
static int gossip_disable_stderr(void);
static int gossip_disable_file(void);
@@ -94,6 +97,29 @@
return 0;
}
+/** Turns on logging to stdout.
+ *
+ * \return 0 on success, -errno on failure.
+ */
+int gossip_enable_stdout(
+ void)
+{
+ /* keep up with the existing logging settings */
+ int tmp_debug_on = gossip_debug_on;
+ uint64_t tmp_debug_mask = gossip_debug_mask;
+
+ /* turn off any running facility */
+ gossip_disable();
+
+ gossip_facility = GOSSIP_STDOUT;
+
+ /* restore the logging settings */
+ gossip_debug_on = tmp_debug_on;
+ gossip_debug_mask = tmp_debug_mask;
+
+ return 0;
+}
+
/** Turns on logging to stderr.
*
* \return 0 on success, -errno on failure.
@@ -162,6 +188,9 @@
switch (gossip_facility)
{
+ case GOSSIP_STDOUT:
+ ret = gossip_disable_stdout();
+ break;
case GOSSIP_STDERR:
ret = gossip_disable_stderr();
break;
@@ -300,6 +329,9 @@
switch (gossip_facility)
{
+ case GOSSIP_STDOUT:
+ ret = gossip_debug_fp_va(stdout, prefix, format, ap, internal_logstamp);
+ break;
case GOSSIP_STDERR:
ret = gossip_debug_fp_va(stderr, prefix, format, ap, internal_logstamp);
break;
@@ -340,6 +372,9 @@
switch (gossip_facility)
{
+ case GOSSIP_STDOUT:
+ ret = gossip_debug_fp_va(stdout, 'E', format, ap, internal_logstamp);
+ break;
case GOSSIP_STDERR:
ret = gossip_debug_fp_va(stderr, 'E', format, ap, internal_logstamp);
break;
@@ -545,6 +580,18 @@
return 0;
}
+/* gossip_disable_stdout()
+ *
+ * The shutdown function for the stdout logging facility.
+ *
+ * returns 0 on success, -errno on failure
+ */
+static int gossip_disable_stdout(
+ void)
+{
+ /* this function doesn't need to do anything... */
+ return 0;
+}
/* gossip_disable_stderr()
*
Modified: src/mpirpc/module.mk.in
===================================================================
--- src/mpirpc/module.mk.in 2010-05-11 19:31:33 UTC (rev 84)
+++ src/mpirpc/module.mk.in 2010-05-11 21:18:02 UTC (rev 85)
@@ -10,5 +10,5 @@
lib/libmpirpc.a: $(MPIRPC_OBJS)
$(Q) " AR $@"
- $(E)$(INSTALL) -d lib
- $(E)ar crs $(@) $(MPIRPC_OBJS)
+ $(E) install -d lib
+ $(E) ar crs $(@) $(MPIRPC_OBJS)
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-11 19:31:33 UTC (rev 84)
+++ test/driver/module.mk.in 2010-05-11 21:18:02 UTC (rev 85)
@@ -1,20 +1,37 @@
-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
+DIR := test/driver
-DRIVER = test/driver/test_driver.x
+TEST_DRIVER_SRC += $(shell find test/driver -name "*.c" ! -name test_helpers.c)
-DRIVER_IMPL = test/driver/test_driver_fifo.o
+TEST_DRIVER_OBJS = $(patsubst %.c, %.o, $(TEST_DRIVER_SRC))
+TEST_DRIVER_OUTPUT = $(patsubst %.c, %.out, $(TEST_DRIVER_SRC))
-test/driver/test%.x: test/driver/test%.o $(DRIVER)
+TEST_HELPER_SRC := test/driver/test_helpers.c
+TEST_DRIVER_OBJS += $(patsubst %.c, %.o, $(TEST_HELPER_SRC))
+
+TEST_SRC += $(TEST_DRIVER_SRC)
+TEST_OBJS += $(TEST_DRIVER_OBJS)
+TEST_PROGS += $(patsubst %.c, %.x, $(TEST_DRIVER_SRC))
+TEST_OUTPUT += $(TEST_DRIVER_OUTPUT)
+
+TEST_DRIVER = test/driver/test_driver.x
+
+TEST_DRIVER_IMPL = test/driver/test_driver_fifo.o
+
+$(TEST_DRIVER): $(TEST_DRIVER_IMPL) test/driver/test_helpers.o $(CMPI)
$(Q) " MPICC $(@) "
+ $(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o \
+ $(CMPI) $(LIBS) -o $(@)
+
+test/driver/test%.x: test/driver/test%.o test/driver/test_helpers.o $(DRIVER)
+ $(Q) " MPICC $(@) "
$(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o $(CMPI) $(LIBS) -o $(@)
-test/driver/test%.out: test/driver/test%.x $(DRIVER)
+test/driver/test02.x: test/driver/test02.o test/driver/test_helpers.o \
+ $(CMPI)
+ $(Q) " MPICC $(@) "
+ $(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o $(CMPI) $(LIBS) -o $(@)
+
+test/driver/test%.out: test/driver/test%.zsh test/driver/test02.x $(TEST_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 $(@)
+ $(E) $(<) $(@)
Added: test/driver/test-quit.zsh
===================================================================
--- test/driver/test-quit.zsh (rev 0)
+++ test/driver/test-quit.zsh 2010-05-11 21:18:02 UTC (rev 85)
@@ -0,0 +1,25 @@
+#!/bin/zsh
+
+OUTPUT=$1
+
+mpiexec -n 5 test/driver/test_driver.x -n 4 > ${OUTPUT} &
+DRIVER_PID=${!}
+
+tools/timebomb.zsh ${$} 10 ${OUTPUT} $0
+BOMB1_PID=${!}
+
+sleep 5
+
+print "Launching tool 02..."
+test/driver/test02.x
+
+wait
+
+N=$( grep -c "Normal exit" ${OUTPUT} )
+if (( N != 5 ))
+then
+ mv -v ${OUTPUT} ${OUTPUT}.failed
+ exit 1
+fi
+
+return 0
Property changes on: test/driver/test-quit.zsh
___________________________________________________________________
Added: svn:executable
+ *
Modified: test/driver/test01.c
===================================================================
--- test/driver/test01.c 2010-05-11 19:31:33 UTC (rev 84)
+++ test/driver/test01.c 2010-05-11 21:18:02 UTC (rev 85)
@@ -1,21 +1,24 @@
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <accessor.h>
int
main(int argc, char* argv[])
{
+ int error;
+
driver_access_fifo();
fprintf(to_cmpi, "sleep 3\n");
fflush(to_cmpi);
- char output[30];
- fscanf(from_cmpi, "output: %s", output);
+ char output[32];
+ error = fscanf(from_cmpi, "%s", output);
- printf("%s\n", output);
+ assert(!strcmp(output, "ok"));
return 0;
}
-
Modified: test/driver/test02.c
===================================================================
--- test/driver/test02.c 2010-05-11 19:31:33 UTC (rev 84)
+++ test/driver/test02.c 2010-05-11 21:18:02 UTC (rev 85)
@@ -2,19 +2,23 @@
#include <stdio.h>
#include <stdlib.h>
+#include <mpi_tools.h>
#include <accessor.h>
int
main(int argc, char* argv[])
{
- driver_access_fifo();
+ int error;
+ error = driver_access_fifo();
+ assert(error);
+
fprintf(to_cmpi, "quit\n");
fflush(to_cmpi);
- char output[30];
- fscanf(from_cmpi, "output: %s", output);
+ char output[32];
+ fscanf(from_cmpi, "%s", output);
- printf("%s\n", output);
+ assert(!strcmp(output, "ok"));
return 0;
}
Modified: test/driver/test03.c
===================================================================
--- test/driver/test03.c 2010-05-11 19:31:33 UTC (rev 84)
+++ test/driver/test03.c 2010-05-11 21:18:02 UTC (rev 85)
@@ -1,25 +1,26 @@
-#include <stdio.h>
+#include <assert.h>
+#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
+#include <string.h>
-#include <accessor.h>
+#include <accessor.h>
int
main(int argc, char* argv[])
{
driver_access_fifo();
-
- char data[30] = "hello does this work";
-
+
+ char* data = "hello does this work";
+
fprintf(to_cmpi, "put key1 %i\n", (int) strlen(data));
fprintf(to_cmpi, "%s", data);
- fflush(to_cmpi);
-
- char output[30];
- fscanf(from_cmpi, "output: %s", output);
+ fflush(to_cmpi);
- printf("%s\n", output);
+ char output[32];
+ fscanf(from_cmpi, "%s", output);
- return 0;
+ assert(!strcmp(output, "ok"));
+
+ return 0;
}
Added: tools/timebomb.zsh
===================================================================
--- tools/timebomb.zsh (rev 0)
+++ tools/timebomb.zsh 2010-05-11 21:18:02 UTC (rev 85)
@@ -0,0 +1,17 @@
+#!/bin/zsh
+
+TARGET=$1
+DELAY=$2
+DATA=$3
+shift 3
+LABEL=${*}
+
+sleep ${DELAY}
+
+print "timebomb killing: ${LABEL} PID: ${TARGET}"
+
+cp -v ${DATA} ${DATA}.bak
+
+sleep 3
+
+kill ${TARGET}
Property changes on: tools/timebomb.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-11 21:15:52
|
Revision: 84
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=84&view=rev
Author: jmwozniak
Date: 2010-05-11 19:31:33 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Fix EOLs.
Modified Paths:
--------------
src/adts/list.c
Modified: src/adts/list.c
===================================================================
--- src/adts/list.c 2010-05-11 19:18:30 UTC (rev 83)
+++ src/adts/list.c 2010-05-11 19:31:33 UTC (rev 84)
@@ -1,24 +1,24 @@
-#include "list.h"
+#include "list.h"
-#include "unistd.h"
+#include "unistd.h"
struct list*
list_create()
{
struct list* new_list = malloc(sizeof(struct list));
if (! new_list)
- return NULL;
+ return NULL;
new_list->head = NULL;
new_list->tail = NULL;
new_list->size = 0;
- return new_list;
+ return new_list;
}
/**
@return The new list_item.
*/
-struct list_item*
+struct list_item*
list_add(struct list* target, void* data)
{
struct list_item* new_item = malloc(sizeof(struct list_item));
@@ -38,7 +38,7 @@
target->tail->next = new_item;
}
- target->tail = new_item;
+ target->tail = new_item;
target->size++;
return new_item;
@@ -52,59 +52,59 @@
{
if (! list_inspect(target, data, n))
return list_add(target, data);
- return NULL;
+ return NULL;
}
/**
Add this pre-formed list_item to target.
- Convenience: sets item->next to NULL.
- @return The added item.
-*/
+ Convenience: sets item->next to NULL.
+ @return The added item.
+*/
struct list_item*
list_append(struct list* target, struct list_item* item)
{
if (target->size == 0)
target->head = item;
else
- target->tail->next = item;
+ target->tail->next = item;
target->tail = item;
- item->next = NULL;
+ item->next = NULL;
target->size++;
- return item;
+ return item;
}
/**
- Create new list from string of words.
- Parse words separated by space or tab, insert each into list.
+ Create new list from string of words.
+ Parse words separated by space or tab, insert each into list.
*/
struct list*
list_parse(char* s)
{
- struct list* result = list_create();
+ struct list* result = list_create();
char* p = s;
- char* q;
+ char* q;
while (*p)
{
- // Set p to start of word, q to end of word...
+ // Set p to start of word, q to end of word...
while (*p == ' ' || *p == '\t')
p++;
if (!*p)
break;
- q = p+1;
+ q = p+1;
while (! (*q == ' ' || *q == '\t' || *q == '\0'))
q++;
- // Insert word into list...
+ // Insert word into list...
char* data = malloc(q-p+2);
strncpy(data, p, q-p);
data[q-p] = '\0';
list_add(result, data);
- // Step forward:
+ // Step forward:
p = q;
}
- return result;
+ return result;
}
/**
@@ -113,19 +113,19 @@
void*
list_pop(struct list* 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 list_item* item;
for (item = target->head; item->next->next;
item = item->next);
@@ -133,16 +133,16 @@
free(item->next);
item->next = NULL;
target->tail = item;
- target->size--;
- return data;
+ target->size--;
+ return data;
}
-void*
-list_peek(struct list* target)
+void*
+list_peek(struct list* target)
{
if (target->size == 0)
return NULL;
- return target->head->data;
+ return target->head->data;
}
/**
@@ -150,34 +150,34 @@
void*
list_poll(struct list* target)
{
- // NOTE_FI(target->size);
- void* data;
+ // NOTE_FI(target->size);
+ 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 list_item* delendum = target->head;
+ struct list_item* delendum = target->head;
data = target->head->data;
target->head = target->head->next;
free(delendum);
target->size--;
- return data;
+ return data;
}
void*
list_random(struct list* target)
{
int i;
- // printf("%s %i \n", "list size: ", target->size);
-
+ // printf("%s %i \n", "list size: ", target->size);
+
if (target->size == 0)
return NULL;
@@ -185,15 +185,15 @@
struct list_item* item = target->head;
for (i = 0; i < p; i++)
item = item->next;
-
- return item->data;
+
+ return item->data;
}
-struct list_item*
-list_ordered_insert(struct list* target,
- int (*cmp)(void*,void*), void* data)
+struct list_item*
+list_ordered_insert(struct list* target,
+ int (*cmp)(void*,void*), void* data)
{
- // NOTE_F;
+ // NOTE_F;
struct list_item* new_item = malloc(sizeof(struct list_item));
if (! new_item)
return NULL;
@@ -208,43 +208,43 @@
else
{
struct list_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (cmp(data, item->data) == -1)
{
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 (cmp(data, item->next->data) == -1)
{
- 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;
}
/**
- Untested.
+ Untested.
*/
-struct list_item*
+struct list_item*
list_ordered_insert_unique(struct list* target, int (*cmp)(void*,void*),
void* data)
{
@@ -262,70 +262,70 @@
else
{
struct list_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (cmp(data, item->data) == -1)
{
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
{
- int c = cmp(data, item->next->data);
+ int c = cmp(data, item->next->data);
if (c == 0)
{
- free(new_item);
+ free(new_item);
return NULL;
}
if (c == -1)
{
- 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;
}
-struct list_item*
-list_add_unique(struct list* target,
+struct list_item*
+list_add_unique(struct list* target,
int (*cmp)(void*,void*), void* data)
{
if (! list_contains(target, cmp, data))
return list_add(target, data);
- return NULL;
+ return NULL;
}
/**
*/
bool
list_contains(struct list* target,
- int (*cmp)(void*,void*), void* data)
+ int (*cmp)(void*,void*), void* data)
{
struct list_item* item;
for (item = target->head;
item; item = item->next)
if (cmp(item->data, data) == 0)
return true;
- return false;
+ return false;
}
/**
- Compare data pointer addresses for match.
+ Compare data pointer addresses for match.
@return An equal data pointer or NULL if not found.
*/
void*
@@ -336,41 +336,41 @@
item; item = item->next)
if (item->data == data)
return data;
- return NULL;
+ return NULL;
}
/**
Compare data contents for match.
- @return A pointer to an equivalent object or NULL if not found.
+ @return A pointer to an equivalent object or NULL if not found.
*/
-void*
+void*
list_inspect(struct list* target, void* data, size_t n)
{
struct list_item* item;
for (item = target->head;
item; item = item->next)
if (memcmp(item->data, data, n) == 0)
- return item->data;
- return NULL;
+ return item->data;
+ return NULL;
}
/**
- Empty the list.
+ Empty the list.
*/
void
list_clear(struct list* target)
{
struct list_item* item = target->head;
-
- while (item)
+
+ while (item)
{
- struct list_item* next = item->next;
- free(item);
- item = next;
+ struct list_item* next = item->next;
+ free(item);
+ item = next;
}
target->head = NULL;
target->tail = NULL;
- target->size = 0;
+ target->size = 0;
}
/**
@@ -380,44 +380,44 @@
list_clobber(struct list* target)
{
struct list_item* item = target->head;
-
- while (item)
+
+ while (item)
{
- struct list_item* next = item->next;
+ struct list_item* next = item->next;
free(item->data);
- free(item);
- item = next;
+ free(item);
+ item = next;
}
target->head = NULL;
- target->tail = NULL;
+ target->tail = NULL;
}
/**
- Removes only one item that points to given data.
+ Removes only one item that points to given data.
Does not free the item data.
@return True iff the data pointer was matched
- and the item was freed.
+ and the item was freed.
*/
bool
list_remove(struct list* target, void* data)
{
// NOTE_F;
-
+
if (target->size == 0)
- return false;
-
+ return false;
+
struct list_item* item = target->head;
if (data == item->data)
{
struct list_item* next = item->next;
- free(item);
+ free(item);
target->head = next;
if (target->tail == next)
target->tail = NULL;
- target->size--;
- return true;
+ target->size--;
+ return true;
}
while (item->next)
@@ -427,42 +427,42 @@
{
struct list_item* nextnext = item->next->next;
if (target->tail == item->next)
- target->tail = nextnext;
- free(item->next);
+ target->tail = nextnext;
+ free(item->next);
item->next = nextnext;
- target->size--;
- return true;
+ target->size--;
+ return true;
}
- item = item->next;
- }
- return false;
+ item = item->next;
+ }
+ return false;
}
/**
- Return all elements from the list where cmp(data,arg) == 0.
+ Return all elements from the list where cmp(data,arg) == 0.
*/
-struct list*
+struct list*
list_select(struct list* target,
int (*cmp)(void*,void*), void* arg)
{
- struct list* result = list_create();
+ struct list* result = list_create();
struct list_item* item;
- assert(target != NULL);
-
-
+ assert(target != NULL);
+
+
for (item = target->head;
item; item = item->next)
{
if (cmp(item->data, arg) == 0)
- list_add(result, item->data);
+ list_add(result, item->data);
}
- return result;
+ return result;
}
/**
Remove the elements from the list where cmp(data,arg) == 0.
- @return true if one or more items were deleted.
+ @return true if one or more items were deleted.
*/
bool
list_remove_where(struct list* target,
@@ -470,21 +470,21 @@
{
bool result = false;
struct list_item* item;
-
+
if (target->size == 0)
- return false;
+ return false;
- int old_size = target->size;
-
+ int old_size = target->size;
+
// Establish next good item in list...
- struct list_item* good = NULL;
+ struct list_item* good = NULL;
for (item = target->head;
item; item = item->next)
{
if (cmp(item->data, arg) != 0)
{
good = item;
- break;
+ break;
}
}
@@ -492,36 +492,36 @@
// List should be empty
{
if (target->size > 0)
- result = true;
+ result = true;
list_clear(target);
- return result;
+ return result;
}
-
- // Establish correct head...
+
+ // Establish correct head...
struct list_item* head = target->head;
while (head && head != good)
{
struct list_item* next = head->next;
printf("free: %i \n", *(int*) head->data);
free(head);
- target->size--;
- head = next;
+ target->size--;
+ head = next;
}
target->head = good;
-
- // Now current points to the first valid item in the list.
- struct list_item* current = target->head;
+
+ // Now current points to the first valid item in the list.
+ struct list_item* current = target->head;
while (good != NULL)
{
// Move to a good item or NULL...
- struct list_item* item = good->next;
- good = NULL;
+ struct list_item* item = good->next;
+ good = NULL;
while (item)
{
if (cmp(item->data, arg) != 0)
{
good = item;
- break;
+ break;
}
item = item->next;
}
@@ -532,85 +532,85 @@
target->tail = current;
}
- // Free items between current and good:
-
+ // Free items between current and good:
+
struct list_item* link = current;
- current = current->next;
+ current = current->next;
while (current != good)
{
struct list_item* next = current->next;
free(current);
- target->size--;
- current = next;
+ target->size--;
+ current = next;
}
- link->next = good;
+ link->next = good;
}
if (target->size != old_size)
- return true;
- return false;
+ return true;
+ return false;
}
/**
Remove and return all elements from the list where
cmp(data,arg) == 0.
- @return true if one or more items were deleted.
+ @return true if one or more items were deleted.
*/
-struct list*
+struct list*
list_pop_where(struct list* target,
int (*cmp)(void*,void*), void* arg)
{
- struct list* result = list_create();
+ struct list* result = list_create();
struct list_item* item;
-
+
if (target->size == 0)
- return result;
+ return result;
// Establish next good item in list...
- struct list_item* good = NULL;
+ struct list_item* good = NULL;
for (item = target->head;
item; item = item->next)
{
if (cmp(item->data, arg) != 0)
{
good = item;
- break;
+ break;
}
}
if (! good)
- // All elements should be moved
+ // All elements should be moved
{
- list_transplant(result, target);
- return result;
+ list_transplant(result, target);
+ return result;
}
-
- // Establish correct head...
+
+ // Establish correct head...
struct list_item* head = target->head;
while (head && head != good)
{
struct list_item* next = head->next;
printf("free: %i \n", *(int*) head->data);
- list_append(result, head);
- target->size--;
- head = next;
+ list_append(result, head);
+ target->size--;
+ head = next;
}
target->head = good;
-
- // Now current points to the first valid item in the list.
- struct list_item* current = target->head;
+
+ // Now current points to the first valid item in the list.
+ struct list_item* current = target->head;
while (good != NULL)
{
// Move to a good item or NULL...
- struct list_item* item = good->next;
- good = NULL;
+ struct list_item* item = good->next;
+ good = NULL;
while (item)
{
if (cmp(item->data, arg) != 0)
{
good = item;
- break;
+ break;
}
item = item->next;
}
@@ -619,34 +619,34 @@
// No more good items were found
target->tail = current;
- if (good != NULL)
- printf("good: %i \n", *(int*) good->data);
-
- // Free items between current and good:
-
+ if (good != NULL)
+ printf("good: %i \n", *(int*) good->data);
+
+ // Free items between current and good:
+
struct list_item* link = current;
- current = current->next;
+ current = current->next;
while (current != good)
{
struct list_item* next = current->next;
list_append(result, current);
- target->size--;
- current = next;
+ target->size--;
+ current = next;
}
- link->next = good;
+ link->next = good;
}
- return result;
+ return result;
}
/**
- Attach copy of tail to target.
-*/
+ Attach copy of tail to target.
+*/
void
list_attach(struct list* target, struct list* segment);
/**
- Moves all items from tail into target structure.
+ Moves all items from tail into target structure.
*/
void
list_transplant(struct list* target, struct list* segment)
@@ -655,34 +655,34 @@
{
target->head = segment->head;
}
- target->tail->next = segment->head;
- target->size += segment->size;
+ target->tail->next = segment->head;
+ target->size += segment->size;
target->tail = segment->tail;
segment->head = NULL;
segment->tail = NULL;
- segment->size = 0;
+ segment->size = 0;
}
/**
Does not free the item data.
@return True iff the data content was matched by memcmp
- and the item was freed.
+ and the item was freed.
*/
bool
list_erase(struct list* target, void* data, size_t n)
{
struct list_item* item = target->head;
- // Are we removing the head?
+ // Are we removing the head?
if (memcmp(data, item->data, n) == 0)
{
struct list_item* next = item->next;
- free(item);
+ free(item);
target->head = next;
if (target->tail == next)
target->tail = NULL;
- target->size--;
- return true;
+ target->size--;
+ return true;
}
do
{
@@ -691,19 +691,19 @@
{
struct list_item* nextnext = item->next->next;
if (target->tail == item->next)
- target->tail = nextnext;
- free(item->next);
+ target->tail = nextnext;
+ free(item->next);
item->next = nextnext;
- target->size--;
- return true;
- }
+ target->size--;
+ return true;
+ }
} while ((item = item->next));
- return false;
+ return false;
}
/**
Function specifies the output format for the data items
- Does not free return of f.
+ Does not free return of f.
*/
void
list_output(char* (*f)(void*), struct list* target)
@@ -713,9 +713,9 @@
printf("[");
for (item = target->head; item; item = item->next)
{
- printf("%s", f(item->data));
+ printf("%s", f(item->data));
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
@@ -736,7 +736,7 @@
else if (strcmp(format, "%i") == 0)
printf(format, *((int*) (item->data)));
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
@@ -750,11 +750,11 @@
struct list_item* item = target->head;
while (item)
{
- struct list_item* next = item->next;
+ struct list_item* next = item->next;
free(item);
- item = next;
+ item = next;
}
- free(target);
+ free(target);
}
/**
@@ -764,42 +764,42 @@
list_destroy(struct list* target)
{
// NOTE_F;
-
+
struct list_item* item = target->head;
while (item)
{
struct list_item* next = item->next;
- free(item->data);
+ free(item->data);
free(item);
- item = next;
+ item = next;
}
- free(target);
+ free(target);
}
int
int_cmp(void* i1, void* i2)
{
int j1 = *(int*) i1;
- int j2 = *(int*) i2;
-
+ int j2 = *(int*) i2;
+
if (j1 > j2)
return 1;
else if (j1 < j2)
return -1;
else
- return 0;
+ return 0;
}
/**
- Returns 0 iff i1 is divisible by i2.
+ Returns 0 iff i1 is divisible by i2.
*/
int
divides_cmp(void* i1, void* i2)
{
int j1 = *(int*) i1;
- int j2 = *(int*) i2;
+ int j2 = *(int*) i2;
- return (j1 % j2);
+ return (j1 % j2);
}
#ifdef DEBUG_LIST
@@ -811,7 +811,7 @@
{
struct list* L = list_create();
- int zero = 0;
+ int zero = 0;
int one = 1;
int two = 2;
int three = 3;
@@ -819,8 +819,8 @@
int four2 = 4;
int five = 5;
int six = 6;
- int seven = 7;
- int eight = 8;
+ int seven = 7;
+ int eight = 8;
list_ordered_insert(L, &two, int_cmp);
list_ordered_insert(L, &four, int_cmp);
@@ -833,11 +833,11 @@
list_ordered_insert(L, &four2, int_cmp);
list_ordered_insert(L, &five, int_cmp);
list_ordered_insert(L, &one, int_cmp);
-
- list_push(L, &eight);
+ list_push(L, &eight);
+
list_dump("%i", L);
- printf("size: %i \n", L->size);
+ printf("size: %i \n", L->size);
// struct list* matches = list_select(L, int_cmp, &four);
// list_remove_where(L, divides_cmp, &two);
@@ -845,12 +845,12 @@
struct list* K = list_pop_where(L, divides_cmp, &two);
list_dump("%i", L);
- printf("size: %i \n", L->size);
+ printf("size: %i \n", L->size);
list_dump("%i", K);
- printf("size: %i \n", L->size);
-
- /*
+ printf("size: %i \n", L->size);
+
+ /*
list_dump("%i", L);
list_poll(L);
list_dump("%i", L);
@@ -863,26 +863,26 @@
// list_clobber(L);
list_clear(L);
- printf("size(L): %i \n", L->size);
+ printf("size(L): %i \n", L->size);
list_clear(K);
- printf("size(K): %i \n", K->size);
-
- list_dump("%i", L);
+ printf("size(K): %i \n", K->size);
+
+ list_dump("%i", L);
}
-#endif
+#endif
-/*
+/*
char* append_pair(char* ptr, struct list_item* item, char* s)
{
ptr += sprintf(ptr, "(%s,", item->data);
ptr += sprintf(ptr, "%s)", s);
-
+
if (item->next)
ptr += sprintf(ptr, ",");
- return ptr;
+ return ptr;
}
** Dump list to string a la snprintf()
@@ -890,36 +890,36 @@
format specifies the output format for the data items
returns int greater than size if size limits are exceeded
indicating result is garbage
-
+
int list_tostring(char* str, size_t size,
char* format, struct list* target)
{
- int error = size+1;
- char* ptr = str;
+ int error = size+1;
+ char* ptr = str;
struct list_item* item;
if (size <= 2)
- return error;
-
+ return error;
+
ptr += sprintf(ptr, "[");
char* s = (char*) malloc(sizeof(char)*LIST_MAX_DATUM);
-
+
for (item = target->head; item; item = item->next,
item && ptr-str < size)
{
int r = snprintf(s, LIST_MAX_DATUM, format, item->data);
if (r > LIST_MAX_DATUM)
- return size+1;
+ return size+1;
if ((ptr-str) + strlen(item->data) + r + 4 < size)
- ptr = append_pair(ptr, item, s);
+ ptr = append_pair(ptr, item, s);
else
- return error;
+ return error;
}
sprintf(ptr, "]");
- // free(s);
- return (ptr-str);
+ // free(s);
+ return (ptr-str);
}
*/
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.
|