[C-MPI-commits] SF.net SVN: c-mpi:[124]
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-05-14 20:34:58
|
Revision: 124
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=124&view=rev
Author: jmwozniak
Date: 2010-05-14 20:34:52 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Fix tests for test/cmpi-db
Modified Paths:
--------------
src/cmpi/driver.c
src/cmpi/mode_mono.c
src/dense-1/dense.c
test/cmpi-db/module.mk.in
test/cmpi-db/test-cp1.zsh
test/cmpi-db/test-loop.zsh
test/cmpi-db/test-quit.zsh
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-14 20:32:54 UTC (rev 123)
+++ src/cmpi/driver.c 2010-05-14 20:34:52 UTC (rev 124)
@@ -56,7 +56,7 @@
unlink(fifo_in);
unlink(fifo_out);
-
+
int error = mkfifo(fifo_in, S_IRUSR|S_IWUSR);
if (error != 0 &&
errno != EEXIST)
@@ -184,7 +184,6 @@
fprintf(driver->sink, "ok\n");
fflush(driver->sink);
- NOTE("sent ok");
sleep(1);
cmpi_shutdown();
@@ -257,7 +256,7 @@
*s = '\0';
driver_execute(driver);
}
- gossip_ldebug(MASK_DRIVER, "Closing driver...\n");
+ NOTE("Closing driver...");
fclose(driver->source);
fclose(driver->sink);
}
Modified: src/cmpi/mode_mono.c
===================================================================
--- src/cmpi/mode_mono.c 2010-05-14 20:32:54 UTC (rev 123)
+++ src/cmpi/mode_mono.c 2010-05-14 20:34:52 UTC (rev 124)
@@ -57,9 +57,12 @@
/**
Obtain the list of nodes that this rank is
responsible for instructing to quit.
+ Should only be called by clients.
*/
struct inlist* cmpi_shutdown_list(int rank, int size, int nodes)
{
+ NOTE_F;
+
struct inlist* result = inlist_create();
int mode = cmpi_mode_select(rank, size, nodes);
@@ -67,10 +70,8 @@
int first = cmpi_mode_first_client(rank, size, nodes);
if (rank == first)
- {
for (int i = 0; i < nodes; i++)
inlist_add(result, i);
- }
return result;
}
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2010-05-14 20:32:54 UTC (rev 123)
+++ src/dense-1/dense.c 2010-05-14 20:34:52 UTC (rev 124)
@@ -218,7 +218,8 @@
}
void
-handle_bootping(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length)
+handle_bootping(MPIRPC_Node caller, int unique, char* args,
+ char* blob, int blob_length)
{
MPIRPC_Null(caller, unique);
rpc_bootping();
@@ -344,4 +345,3 @@
dense_quitting = true;
// TODO: cleanup
}
-
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-14 20:32:54 UTC (rev 123)
+++ test/cmpi-db/module.mk.in 2010-05-14 20:34:52 UTC (rev 124)
@@ -10,10 +10,19 @@
CMPIDBQUIT = bin/cmpi-db-quit
CMPIDB_TOOLS = $(CMPIDB) $(CMPICP) $(CMPIDBQUIT)
+ifeq (@USE_CMPI_MODE@,MONO)
+ NODES := 5
+ CLIENTS := 1
+else
+ NODES := 3
+ CLIENTS := 3
+endif
+
+
test/cmpi-db/test-%.out: test/cmpi-db/test-%.zsh $(CMPIDB_TOOLS)
$(Q) " TEST $(@) "
$(E) $(MPDCHECK)
- $(E) $(<) $(@) 4 3
+ $(E) $(<) $(@) $(NODES) $(CLIENTS)
test/cmpi-db/test-success.out: test/driver/test-success.out \
$(TEST_CMPIDB_OUTPUT)
Modified: test/cmpi-db/test-cp1.zsh
===================================================================
--- test/cmpi-db/test-cp1.zsh 2010-05-14 20:32:54 UTC (rev 123)
+++ test/cmpi-db/test-cp1.zsh 2010-05-14 20:34:52 UTC (rev 124)
@@ -2,21 +2,23 @@
# Be sure to make tests with D=1
-# set -x
+#set -x
OUTPUT=$1
-PROCS=$2
-NODES=$3
+NODES=$2
+CLIENTS=$3
+TOTAL=$(( NODES+CLIENTS ))
+
source tools/test-helpers.zsh
-mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
+mpiexec -n ${TOTAL} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
DB_PID=${!}
-tools/timebomb.zsh ${DB_PID} $(( PROCS*4 )) ${OUTPUT} $0 &
+tools/timebomb.zsh ${DB_PID} $(( TOTAL*4 )) ${OUTPUT} $0 &
BOMB_PID=${!}
-sleep ${PROCS}
+sleep ${TOTAL}
echo "DATA" > test-cp1.input.data
echo "cmpi-cp insert" >& cmpi-cp.out
@@ -44,11 +46,10 @@
kill ${BOMB_PID}
-sleep ${PROCS}
+sleep ${TOTAL}
-# Should be ${PROCS} "Normal exit."s
-N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == PROCS )) || crash "N != ${PROCS}"
+# Should be ${TOTAL} "Normal exit."s
+check_exits ${TOTAL} ${OUTPUT}
rm -f cmpi-cp.out test-cp1.*.data
Modified: test/cmpi-db/test-loop.zsh
===================================================================
--- test/cmpi-db/test-loop.zsh 2010-05-14 20:32:54 UTC (rev 123)
+++ test/cmpi-db/test-loop.zsh 2010-05-14 20:34:52 UTC (rev 124)
@@ -5,20 +5,22 @@
# set -x
OUTPUT=$1
-PROCS=$2
-NODES=$3
+NODES=$2
+CLIENTS=$3
+TOTAL=$(( NODES+CLIENTS ))
+
LOOPS=10
source tools/test-helpers.zsh
-mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
+mpiexec -n ${TOTAL} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
DB_PID=${!}
-tools/timebomb.zsh ${DB_PID} $(( PROCS*4 + LOOPS )) ${OUTPUT} $0 &
+tools/timebomb.zsh ${DB_PID} $(( TOTAL*4 + LOOPS )) ${OUTPUT} $0 &
BOMB_PID=${!}
-sleep ${PROCS}
+sleep ${TOTAL}
print > cmpi-cp.out
for ((i=0 ; i<LOOPS ; i++))
@@ -53,11 +55,9 @@
kill ${BOMB_PID}
-sleep ${PROCS}
+sleep ${TOTAL}
-# Should be ${PROCS} "Normal exit."s
-N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == PROCS )) || crash "N != ${PROCS}"
+check_exits ${TOTAL} ${OUTPUT}
rm -f cmpi-cp.out test-cp1.*.data
Modified: test/cmpi-db/test-quit.zsh
===================================================================
--- test/cmpi-db/test-quit.zsh 2010-05-14 20:32:54 UTC (rev 123)
+++ test/cmpi-db/test-quit.zsh 2010-05-14 20:34:52 UTC (rev 124)
@@ -5,23 +5,22 @@
# set -x
OUTPUT=$1
-PROCS=$2
-NODES=$3
+NODES=$2
+CLIENTS=$3
+TOTAL=$(( NODES+CLIENTS ))
+
source tools/test-helpers.zsh
-mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
+mpiexec -n ${TOTAL} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
MPI_PROCESS=$!
-sleep ${PROCS}
+sleep ${TOTAL}
-bin/cmpi-db-quit >& /dev/null &
-QUIT_PROCESS=$!
+bin/cmpi-db-quit >& /dev/null
-sleep ${PROCS}
+sleep ${TOTAL}
-# Should be ${PROCS} "Normal exit."s
-N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == PROCS )) || crash "N != ${PROCS}"
+check_exits ${TOTAL} ${OUTPUT}
exit 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|