[C-MPI-commits] SF.net SVN: c-mpi:[110] test/driver
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-05-13 01:16:24
|
Revision: 110
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=110&view=rev
Author: jmwozniak
Date: 2010-05-13 01:16:17 +0000 (Thu, 13 May 2010)
Log Message:
-----------
Fixed tests
Modified Paths:
--------------
include/cmpi.h
src/cmpi/mode_rr.c
src/cmpi/module.mk.in
src/cmpi/node.c
src/dense-1/dense.c
src/mpirpc/mpirpc.c
test/cmpi/test-manyputs.c
test/cmpi/test-manyputs.zsh
test/cmpi/test-putget.c
test/cmpi/test-putget.zsh
test/cmpi/test-startup.c
test/cmpi/test-startup.zsh
test/cmpi/test-tables.c
test/cmpi/test-tables.zsh
test/cmpi/test-update01.zsh
test/cmpi/test-update02.zsh
test/cmpi/test_helpers.c
test/driver/test-quit.zsh
Modified: include/cmpi.h
===================================================================
--- include/cmpi.h 2010-05-12 23:55:08 UTC (rev 109)
+++ include/cmpi.h 2010-05-13 01:16:17 UTC (rev 110)
@@ -38,6 +38,8 @@
*/
extern int cmpi_cache_limit;
+extern int cmpi_nodes;
+
#define CMPI_BLOB_LENGTH LIST_MAX_DATUM
extern struct lru_table* cmpi_cache;
Modified: src/cmpi/mode_rr.c
===================================================================
--- src/cmpi/mode_rr.c 2010-05-12 23:55:08 UTC (rev 109)
+++ src/cmpi/mode_rr.c 2010-05-13 01:16:17 UTC (rev 110)
@@ -10,6 +10,12 @@
int cmpi_mode_select(int rank, int size, int nodes)
{
NOTE("using mode_rr");
+ if (size%2 == 1)
+ {
+ printf("MPI size must be even for mode_rr!\n");
+ exit(1);
+ }
+
if (rank >= size/2)
return CMPI_MODE_CLIENT;
return CMPI_MODE_NODE;
@@ -26,3 +32,34 @@
return result;
}
+
+
+int cmpi_mode_next(int rank, int size, int nodes)
+{
+ int result;
+ int mode = cmpi_mode_select(rank, size, nodes);
+
+ if (mode == CMPI_MODE_NODE)
+ {
+ int next = rank+1;
+ if (next >= size/2)
+ result = -1;
+ else
+ result = next;
+ }
+ else
+ {
+ int next = rank+1;
+ if (next >= size)
+ result = -1;
+ else
+ result = next;
+ }
+
+ return result;
+}
+
+int cmpi_mode_first_client(int rank, int size, int nodes)
+{
+ return size/2;
+}
Modified: src/cmpi/module.mk.in
===================================================================
--- src/cmpi/module.mk.in 2010-05-12 23:55:08 UTC (rev 109)
+++ src/cmpi/module.mk.in 2010-05-13 01:16:17 UTC (rev 110)
@@ -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/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2010-05-12 23:55:08 UTC (rev 109)
+++ src/cmpi/node.c 2010-05-13 01:16:17 UTC (rev 110)
@@ -14,7 +14,7 @@
#include <cmpi_mode.h>
#include <io_tools.h>
-int nodes;
+int cmpi_nodes;
MPI_Comm cmpi_comm_clients;
#ifdef DMALLOC
@@ -48,7 +48,7 @@
cmpi_cache_limit = 10000;
snooze_max = 500000;
debug_rank = mpi_rank;
- nodes = mpi_size;
+ cmpi_nodes = mpi_size;
cmpi_params_init();
while ((c =
@@ -73,7 +73,7 @@
exit(EXIT_FAILURE);
}
cmpi_params_add("nodes", optarg);
- nodes = t;
+ cmpi_nodes = t;
break;
case 'p':
p = strchr(optarg, '=');
@@ -137,13 +137,13 @@
// gossip_debug(MASK_CMPI, ":\n");
- if (mpi_size == nodes)
+ if (mpi_size == cmpi_nodes)
{
cmpi_comm_clients = MPI_COMM_NULL;
return;
}
- ranges[0][0] = nodes;
+ ranges[0][0] = cmpi_nodes;
ranges[0][1] = mpi_size-1;
ranges[0][2] = 1;
@@ -188,14 +188,17 @@
sleep(1);
+ /*
char hostname[128];
char* buffer;
int length = file_to_buffer(&buffer, "/etc/hostname");
memset(hostname, 0, 128);
memcpy(hostname, buffer, length);
NOTE_S("hostname: ", hostname);
-
- if (cmpi_mode_select(mpi_rank, mpi_size, nodes) == CMPI_MODE_NODE)
+ */
+
+ if (cmpi_mode_select(mpi_rank, mpi_size, cmpi_nodes) ==
+ CMPI_MODE_NODE)
{
NOTE("I am node");
cmpi_init();
@@ -220,7 +223,7 @@
#if USE_COMM_WORLD == 1
- if (mpi_rank < nodes)
+ if (mpi_rank < cmpi_nodes)
cmpi_cleanup();
else
cmpi_client_cleanup();
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2010-05-12 23:55:08 UTC (rev 109)
+++ src/dense-1/dense.c 2010-05-13 01:16:17 UTC (rev 110)
@@ -72,6 +72,7 @@
rpc_bootping()
{
int next = cmpi_mode_next(mpi_rank, mpi_size, dense_nodes);
+ NOTE_FI(next);
if (next > 0)
{
MPIRPC_Node node;
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2010-05-12 23:55:08 UTC (rev 109)
+++ src/mpirpc/mpirpc.c 2010-05-13 01:16:17 UTC (rev 110)
@@ -193,7 +193,7 @@
char* blob, int blob_length,
void* extras, void (*proceed)(MPIRPC*))
{
- gossip_do(MASK_MPIRPC, NOTE_F);
+ // gossip_do(MASK_MPIRPC, NOTE_F);
if (!name)
{
printf("MPIRPC_Call(): name was NULL. \n");
@@ -219,7 +219,7 @@
rpc->cancelled = false;
rpc->status = MPIRPC_STATUS_PROTO;
- gossip_do(MASK_MPIRPC, DONE);
+ // gossip_do(MASK_MPIRPC, DONE);
return rpc;
}
@@ -309,7 +309,7 @@
char*
MPIRPC_Block(MPIRPC_Node target, char* name, char* args)
{
- gossip_do(MASK_MPIRPC, NOTE_FS(name));
+ //gossip_do(MASK_MPIRPC, NOTE_FS(name));
return MPIRPC_Block_blob(target, name, args, NULL, 0);
}
Modified: test/cmpi/test-manyputs.c
===================================================================
--- test/cmpi/test-manyputs.c 2010-05-12 23:55:08 UTC (rev 109)
+++ test/cmpi/test-manyputs.c 2010-05-13 01:16:17 UTC (rev 110)
@@ -41,6 +41,8 @@
sleep((mpi_size-mpi_rank)*3+10);
+ cmpi_shutdown();
+ /*
int client_rank;
MPI_Comm_rank(cmpi_comm_clients, &client_rank);
if (client_rank == 0)
@@ -48,4 +50,5 @@
note("Shutting down...");
cmpi_shutdown();
}
+ */
}
Modified: test/cmpi/test-manyputs.zsh
===================================================================
--- test/cmpi/test-manyputs.zsh 2010-05-12 23:55:08 UTC (rev 109)
+++ test/cmpi/test-manyputs.zsh 2010-05-13 01:16:17 UTC (rev 110)
@@ -14,9 +14,9 @@
if (( USE_COMM_WORLD == 1 ))
then
- # Monolithic execution (5 nodes, 1 client):
+ # Monolithic execution (3 nodes, 3 clients):
- mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUTPUT}
+ mpiexec -n 6 ${PROGRAM} -n 3 -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
Modified: test/cmpi/test-putget.c
===================================================================
--- test/cmpi/test-putget.c 2010-05-12 23:55:08 UTC (rev 109)
+++ test/cmpi/test-putget.c 2010-05-13 01:16:17 UTC (rev 110)
@@ -8,14 +8,21 @@
void
cmpi_client_code()
{
+ NOTE_F;
+
+ wait_for_notification();
+ notify_next();
+
char key1[10];
char key2[10];
+
sprintf(key1, "key1_%i", mpi_rank);
sprintf(key2, "key2_%i", mpi_rank);
- wait_for_notification();
- notify_next();
+ sleep(mpi_rank);
+
+
char value[30];
strcpy(value, "value1");
cmpi_put(key1, value, strlen(value)+1);
Modified: test/cmpi/test-putget.zsh
===================================================================
--- test/cmpi/test-putget.zsh 2010-05-12 23:55:08 UTC (rev 109)
+++ test/cmpi/test-putget.zsh 2010-05-13 01:16:17 UTC (rev 110)
@@ -14,9 +14,9 @@
if (( USE_COMM_WORLD == 1 ))
then
- # Monolithic execution (3 nodes, 2 clients):
+ # Monolithic execution (3 nodes, 3 clients):
- mpiexec -n 6 ${PROGRAM} -n 5 >& ${OUTPUT}
+ mpiexec -n 6 ${PROGRAM} -n 3 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
Modified: test/cmpi/test-startup.c
===================================================================
--- test/cmpi/test-startup.c 2010-05-12 23:55:08 UTC (rev 109)
+++ test/cmpi/test-startup.c 2010-05-13 01:16:17 UTC (rev 110)
@@ -16,6 +16,6 @@
wait_for_notification();
notify_next();
- if (mpi_rank == mpi_size-1)
- cmpi_shutdown();
+ // if (mpi_rank == mpi_size-1)
+ cmpi_shutdown();
}
Modified: test/cmpi/test-startup.zsh
===================================================================
--- test/cmpi/test-startup.zsh 2010-05-12 23:55:08 UTC (rev 109)
+++ test/cmpi/test-startup.zsh 2010-05-13 01:16:17 UTC (rev 110)
@@ -14,8 +14,8 @@
if (( USE_COMM_WORLD == 1 ))
then
- # KDA-2A execution (3 nodes, 2 clients):
- mpiexec -n 5 ${PROGRAM} -n 3 >& ${OUTPUT}
+ # KDA-2A execution (3 nodes, 3 clients):
+ mpiexec -n 6 ${PROGRAM} -n 3 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -31,8 +31,8 @@
fi
-# Should be 5 "Normal exit."s
+# Should be 6 "Normal exit."s
N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == 5 )) || crash "N != 5"
+(( N == 6 )) || crash "N != 6"
exit 0
Modified: test/cmpi/test-tables.c
===================================================================
--- test/cmpi/test-tables.c 2010-05-12 23:55:08 UTC (rev 109)
+++ test/cmpi/test-tables.c 2010-05-13 01:16:17 UTC (rev 110)
@@ -19,6 +19,6 @@
sleep(mpi_rank);
- if (mpi_rank == mpi_size-1)
- cmpi_shutdown();
+ //if (mpi_rank == mpi_size-1)
+ cmpi_shutdown();
}
Modified: test/cmpi/test-tables.zsh
===================================================================
--- test/cmpi/test-tables.zsh 2010-05-12 23:55:08 UTC (rev 109)
+++ test/cmpi/test-tables.zsh 2010-05-13 01:16:17 UTC (rev 110)
@@ -14,8 +14,8 @@
if (( USE_COMM_WORLD == 1 ))
then
- # KDA-2A execution (3 nodes, 2 clients):
- mpiexec -n 5 ${PROGRAM} -n 3 >& ${OUTPUT}
+ # KDA-2A execution (3 nodes, 3 clients):
+ mpiexec -n 6 ${PROGRAM} -n 3 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -29,8 +29,8 @@
fi
-# Should be 5 "Normal exit."s
+# Should be 6 "Normal exit."s
N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == 5 )) || crash "N != 5"
+(( N == 6 )) || crash "N != 6"
exit 0
Modified: test/cmpi/test-update01.zsh
===================================================================
--- test/cmpi/test-update01.zsh 2010-05-12 23:55:08 UTC (rev 109)
+++ test/cmpi/test-update01.zsh 2010-05-13 01:16:17 UTC (rev 110)
@@ -14,9 +14,9 @@
if (( USE_COMM_WORLD == 1 ))
then
- # Monolithic execution (5 nodes, 1 client):
+ # Monolithic execution (3 nodes, 3 clients):
- mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUTPUT}
+ mpiexec -n 6 ${PROGRAM} -n 3 -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
Modified: test/cmpi/test-update02.zsh
===================================================================
--- test/cmpi/test-update02.zsh 2010-05-12 23:55:08 UTC (rev 109)
+++ test/cmpi/test-update02.zsh 2010-05-13 01:16:17 UTC (rev 110)
@@ -14,9 +14,9 @@
if (( USE_COMM_WORLD == 1 ))
then
- # Monolithic execution (5 nodes, 1 client):
+ # Monolithic execution (3 nodes, 3 clients):
- mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUTPUT}
+ mpiexec -n 6 ${PROGRAM} -n 3 -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
Modified: test/cmpi/test_helpers.c
===================================================================
--- test/cmpi/test_helpers.c 2010-05-12 23:55:08 UTC (rev 109)
+++ test/cmpi/test_helpers.c 2010-05-13 01:16:17 UTC (rev 110)
@@ -1,5 +1,6 @@
#include "test_helpers.h"
+#include <cmpi_mode.h>
/**
Print debugging header using machine-specific information.
@@ -39,7 +40,8 @@
notify_next(void)
{
NOTE_F;
- if (mpi_rank < mpi_size-1)
+ int next = cmpi_mode_next(mpi_rank, mpi_size, cmpi_nodes);
+ if (next >= 0)
{
int msg = -2;
MPI_Send(&msg, 1, MPI_INT,
Modified: test/driver/test-quit.zsh
===================================================================
--- test/driver/test-quit.zsh 2010-05-12 23:55:08 UTC (rev 109)
+++ test/driver/test-quit.zsh 2010-05-13 01:16:17 UTC (rev 110)
@@ -2,7 +2,7 @@
OUTPUT=$1
-mpiexec -n 5 test/driver/test_driver.x -n 4 > ${OUTPUT} &
+mpiexec -n 6 test/driver/test_driver.x -n 3 > ${OUTPUT} &
DRIVER_PID=${!}
tools/timebomb.zsh ${$} 10 ${OUTPUT} $0 &
@@ -16,7 +16,7 @@
kill ${BOMB_PID}
N=$( grep -c "Normal exit" ${OUTPUT} )
-if (( N != 5 ))
+if (( N != 6 ))
then
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.
|