[C-MPI-commits] SF.net SVN: c-mpi:[119] tools
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-05-14 19:41:31
|
Revision: 119
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=119&view=rev
Author: jmwozniak
Date: 2010-05-14 19:41:24 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Test fix to take into account use of CMPI_MODE
Modified Paths:
--------------
configure.ac
include/cmpi_mode.h
src/cmpi/mode_mono.c
src/cmpi/mode_rr.c
src/cmpi/module.mk.in
src/dense-1/cmpi_dense.c
test/cmpi/module.mk.in
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
tools/test-helpers.zsh
Modified: configure.ac
===================================================================
--- configure.ac 2010-05-14 18:59:07 UTC (rev 118)
+++ configure.ac 2010-05-14 19:41:24 UTC (rev 119)
@@ -323,6 +323,23 @@
AC_SUBST(USE_TABLE_KDA_2B)
AC_SUBST(USE_COMM_WORLD)
+dnl C-MPI mode selection:
+USE_CMPI_MODE=MONO
+AC_ARG_ENABLE([mode-mono],
+ AS_HELP_STRING(
+ [--enable-mode-mono],
+ [use mode-mono node/client topology]),
+ [AC_MSG_RESULT([using mode-mono...])
+ USE_CMPI_MODE=MONO])
+
+AC_ARG_ENABLE([mode-pairs],
+ AS_HELP_STRING(
+ [--enable-mode-pairs],
+ [use mode-pairs node/client topology]),
+ [AC_MSG_RESULT([using mode-mono...])
+ USE_CMPI_MODE=PAIRS])
+AC_SUBST(USE_CMPI_MODE)
+
AC_ARG_ENABLE([driver],
AS_HELP_STRING(
[--enable-driver],
Modified: include/cmpi_mode.h
===================================================================
--- include/cmpi_mode.h 2010-05-14 18:59:07 UTC (rev 118)
+++ include/cmpi_mode.h 2010-05-14 19:41:24 UTC (rev 119)
@@ -5,3 +5,4 @@
struct inlist* cmpi_mode_contacts(int rank, int size, int nodes);
int cmpi_mode_next(int rank, int size, int nodes);
int cmpi_mode_first_client(int rank, int size, int nodes);
+struct inlist* cmpi_shutdown_list(int rank, int size, int nodes);
Modified: src/cmpi/mode_mono.c
===================================================================
--- src/cmpi/mode_mono.c 2010-05-14 18:59:07 UTC (rev 118)
+++ src/cmpi/mode_mono.c 2010-05-14 19:41:24 UTC (rev 119)
@@ -53,3 +53,24 @@
{
return nodes;
}
+
+/**
+ Obtain the list of nodes that this rank is
+ responsible for instructing to quit.
+*/
+struct inlist* cmpi_shutdown_list(int rank, int size, int nodes)
+{
+ struct inlist* result = inlist_create();
+
+ int mode = cmpi_mode_select(rank, size, nodes);
+ assert(mode != CMPI_MODE_NODE);
+
+ 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/cmpi/mode_rr.c
===================================================================
--- src/cmpi/mode_rr.c 2010-05-14 18:59:07 UTC (rev 118)
+++ src/cmpi/mode_rr.c 2010-05-14 19:41:24 UTC (rev 119)
@@ -15,7 +15,7 @@
printf("MPI size must be even for mode_rr!\n");
exit(1);
}
-
+
if (rank >= size/2)
return CMPI_MODE_CLIENT;
return CMPI_MODE_NODE;
@@ -48,14 +48,14 @@
result = next;
}
else
- {
+ {
int next = rank+1;
if (next >= size)
result = -1;
else
result = next;
}
-
+
return result;
}
@@ -63,3 +63,14 @@
{
return size/2;
}
+
+/**
+ Obtain the list of nodes that this rank is
+ responsible for instructing to quit.
+*/
+struct inlist* cmpi_shutdown_list(int rank, int size, int nodes)
+{
+ struct inlist* result = cmpi_mode_contacts(rank, size, nodes);
+
+ return result;
+}
Modified: src/cmpi/module.mk.in
===================================================================
--- src/cmpi/module.mk.in 2010-05-14 18:59:07 UTC (rev 118)
+++ src/cmpi/module.mk.in 2010-05-14 19:41:24 UTC (rev 119)
@@ -7,8 +7,8 @@
CMPI_SRC += $(DIR)/driver.c
CMPI_SRC += $(DIR)/accessor.c
-#MODE = $(DIR)/mode_mono.c
-MODE = $(DIR)/mode_rr.c
+MODE = $(DIR)/mode_mono.c
+#MODE = $(DIR)/mode_rr.c
CMPI_SRC += $(MODE)
Modified: src/dense-1/cmpi_dense.c
===================================================================
--- src/dense-1/cmpi_dense.c 2010-05-14 18:59:07 UTC (rev 118)
+++ src/dense-1/cmpi_dense.c 2010-05-14 19:41:24 UTC (rev 119)
@@ -204,15 +204,19 @@
void
cmpi_shutdown()
{
- struct inlist_item* item;
NOTE_F;
+ struct inlist_item* item;
+ struct inlist* list =
+ cmpi_shutdown_list(mpi_rank, mpi_size, cmpi_nodes);
+
MPIRPC_Node node;
- for (item = contacts->head; item; item = item->next)
+ for (item = list->head; item; item = item->next)
{
MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
DENSE_Shutdown(node);
}
+ inlist_free(list);
DONE;
}
Modified: test/cmpi/module.mk.in
===================================================================
--- test/cmpi/module.mk.in 2010-05-14 18:59:07 UTC (rev 118)
+++ test/cmpi/module.mk.in 2010-05-14 19:41:24 UTC (rev 119)
@@ -3,7 +3,12 @@
TEST_CMPI_SRC += $(shell find test/cmpi -name "*.c" ! -name test_helpers.c)
TEST_CMPI_OBJS = $(patsubst %.c, %.o, $(TEST_CMPI_SRC))
-TEST_CMPI_OUTPUT = $(patsubst %.c, %.out, $(TEST_CMPI_SRC))
+TEST_CMPI_OUTPUT = test/cmpi/test-startup.out \
+ test/cmpi/test-tables.out \
+ test/cmpi/test-putget.out \
+ test/cmpi/test-manyputs.out \
+ test/cmpi/test-update01.out \
+ test/cmpi/test-update02.out
TEST_HELPER_SRC := test/cmpi/test_helpers.c
TEST_CMPI_OBJS += $(patsubst %.c, %.o, $(TEST_HELPER_SRC))
@@ -13,6 +18,14 @@
TEST_PROGS += $(patsubst %.c, %.x, $(TEST_CMPI_SRC))
TEST_OUTPUT += $(TEST_CMPI_OUTPUT)
+ifeq (@USE_CMPI_MODE@,MONO)
+ NODES := 5
+ CLIENTS := 1
+else
+ NODES := 3
+ CLIENTS := 3
+endif
+
ifeq (@USE_COMM_WORLD@,1)
$(DIR)/test%.x: $(DIR)/test%.o $(DIR)/test_helpers.o src/cmpi/node.o $(CMPI)
@@ -31,7 +44,7 @@
$(DIR)/test%.out: $(DIR)/test%.x $(DIR)/test%.zsh
$(E) $(MPDCHECK)
$(Q) " TEST $(@) "
- $(E) $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
+ $(E) $(patsubst %.x, %.zsh, $(<)) $(<) $(NODES) $(CLIENTS) $(LAUNCH)
$(DIR)/test-success.out: test/mpirpc/test-success.out \
$(TEST_CMPI_OUTPUT)
Modified: test/cmpi/test-manyputs.zsh
===================================================================
--- test/cmpi/test-manyputs.zsh 2010-05-14 18:59:07 UTC (rev 118)
+++ test/cmpi/test-manyputs.zsh 2010-05-14 19:41:24 UTC (rev 119)
@@ -7,16 +7,20 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUTPUT=${PROGRAM%.x}.out
-shift
+NODES=$2
+CLIENTS=$3
+shift 3
LAUNCH=${*}
+OUTPUT=${PROGRAM%.x}.out
+TOTAL=$(( NODES+CLIENTS ))
+
if (( USE_COMM_WORLD == 1 ))
then
# Monolithic execution (3 nodes, 3 clients):
- mpiexec -n 6 ${PROGRAM} -n 3 -p reps=10 >& ${OUTPUT}
+ mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -31,7 +35,6 @@
fi
# Should be 6 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == 6 )) || crash "N != 6"
+check_exits ${TOTAL} ${OUTPUT}
exit 0
Modified: test/cmpi/test-putget.zsh
===================================================================
--- test/cmpi/test-putget.zsh 2010-05-14 18:59:07 UTC (rev 118)
+++ test/cmpi/test-putget.zsh 2010-05-14 19:41:24 UTC (rev 119)
@@ -7,16 +7,20 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUTPUT=${PROGRAM%.x}.out
-shift
+NODES=$2
+CLIENTS=$3
+shift 3
LAUNCH=${*}
+OUTPUT=${PROGRAM%.x}.out
+TOTAL=$(( NODES+CLIENTS ))
+
if (( USE_COMM_WORLD == 1 ))
then
# Monolithic execution (3 nodes, 3 clients):
- mpiexec -n 6 ${PROGRAM} -n 3 >& ${OUTPUT}
+ mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -30,8 +34,7 @@
fi
-# Should be 5 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == 6 )) || crash "N != 6"
+# Should be TOTAL "Normal exit."s
+check_exits ${TOTAL} ${OUTPUT}
exit 0
Modified: test/cmpi/test-startup.zsh
===================================================================
--- test/cmpi/test-startup.zsh 2010-05-14 18:59:07 UTC (rev 118)
+++ test/cmpi/test-startup.zsh 2010-05-14 19:41:24 UTC (rev 119)
@@ -7,15 +7,19 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUTPUT=${PROGRAM%.x}.out
-shift
+NODES=$2
+CLIENTS=$3
+shift 3
LAUNCH=${*}
+OUTPUT=${PROGRAM%.x}.out
+TOTAL=$(( NODES+CLIENTS ))
+
if (( USE_COMM_WORLD == 1 ))
then
- # KDA-2A execution (3 nodes, 3 clients):
- mpiexec -n 6 ${PROGRAM} -n 3 >& ${OUTPUT}
+ # Monolithic execution (3 nodes, 3 clients):
+ mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -31,8 +35,8 @@
fi
-# Should be 6 "Normal exit."s
+# Should be TOTAL "Normal exit."s
N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == 6 )) || crash "N != 6"
+(( N == TOTAL )) || crash "N != ${TOTAL}"
exit 0
Modified: test/cmpi/test-tables.zsh
===================================================================
--- test/cmpi/test-tables.zsh 2010-05-14 18:59:07 UTC (rev 118)
+++ test/cmpi/test-tables.zsh 2010-05-14 19:41:24 UTC (rev 119)
@@ -7,15 +7,19 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUTPUT=${PROGRAM%.x}.out
-shift
+NODES=$2
+CLIENTS=$3
+shift 3
LAUNCH=${*}
+OUTPUT=${PROGRAM%.x}.out
+TOTAL=$(( NODES+CLIENTS ))
+
if (( USE_COMM_WORLD == 1 ))
then
- # KDA-2A execution (3 nodes, 3 clients):
- mpiexec -n 6 ${PROGRAM} -n 3 >& ${OUTPUT}
+ # Monolithic execution:
+ mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -29,8 +33,8 @@
fi
-# Should be 6 "Normal exit."s
+# Should be TOTAL "Normal exit."s
N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == 6 )) || crash "N != 6"
+(( N == TOTAL )) || crash "N != ${TOTAL}"
exit 0
Modified: test/cmpi/test-update01.zsh
===================================================================
--- test/cmpi/test-update01.zsh 2010-05-14 18:59:07 UTC (rev 118)
+++ test/cmpi/test-update01.zsh 2010-05-14 19:41:24 UTC (rev 119)
@@ -7,16 +7,19 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUTPUT=${PROGRAM%.x}.out
-shift
+NODES=$2
+CLIENTS=$3
+shift 3
LAUNCH=${*}
+OUTPUT=${PROGRAM%.x}.out
+TOTAL=$(( NODES+CLIENTS ))
+
if (( USE_COMM_WORLD == 1 ))
then
- # Monolithic execution (3 nodes, 3 clients):
-
- mpiexec -n 6 ${PROGRAM} -n 3 -p reps=10 >& ${OUTPUT}
+ # Monolithic execution:
+ mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -30,8 +33,6 @@
fi
-# Should be 6 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == 6 )) || crash "N != 6"
+check_exits ${TOTAL} ${OUTPUT}
exit 0
Modified: test/cmpi/test-update02.zsh
===================================================================
--- test/cmpi/test-update02.zsh 2010-05-14 18:59:07 UTC (rev 118)
+++ test/cmpi/test-update02.zsh 2010-05-14 19:41:24 UTC (rev 119)
@@ -7,16 +7,19 @@
source tools/test-helpers.zsh
PROGRAM=$1
+NODES=$2
+CLIENTS=$3
+shift 3
+LAUNCH=${*}
OUTPUT=${PROGRAM%.x}.out
-shift
-LAUNCH=${*}
+TOTAL=$(( NODES+CLIENTS ))
if (( USE_COMM_WORLD == 1 ))
then
- # Monolithic execution (3 nodes, 3 clients):
+ # Monolithic execution:
- mpiexec -n 6 ${PROGRAM} -n 3 -p reps=10 >& ${OUTPUT}
+ mpiexec -n ${TOTAL} ${PROGRAM} -n ${CLIENTS} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -30,8 +33,6 @@
fi
-# Should be 6 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == 6 )) || crash "N != 6"
+check_exits ${TOTAL} ${OUTPUT}
exit 0
Modified: tools/test-helpers.zsh
===================================================================
--- tools/test-helpers.zsh 2010-05-14 18:59:07 UTC (rev 118)
+++ tools/test-helpers.zsh 2010-05-14 19:41:24 UTC (rev 119)
@@ -26,3 +26,12 @@
mv -v ${OUTPUT} ${OUTPUT}.failed
exit 1
}
+
+check_exits()
+# Should be TOTAL "Normal exit."s
+{
+ TOTAL=$1
+ OUTPUT=$2
+ N=$( grep -c "Normal exit." ${OUTPUT} )
+ (( N == TOTAL )) || crash "N != ${TOTAL}"
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|