c-mpi-commits Mailing List for C-MPI (Page 4)
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-20 18:19:32
|
Revision: 132
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=132&view=rev
Author: jmwozniak
Date: 2010-05-20 18:19:24 +0000 (Thu, 20 May 2010)
Log Message:
-----------
Enabling more user configuration in mpiexec call
Modified Paths:
--------------
Makefile.in
configure.ac
test/cmpi/test-startup.zsh
test/cmpi-db/module.mk.in
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-20 17:03:51 UTC (rev 131)
+++ Makefile.in 2010-05-20 18:19:24 UTC (rev 132)
@@ -62,8 +62,11 @@
# MPI location
MPI = @USE_MPI@
MPICC = @USE_MPI@/bin/mpicc
-MPIEXEC = @USE_MPI@/bin/mpiexec -recvtimeout 10
-# MPIEXEC = @USE_MPI@/bin/mpiexec.hydra -f hosts
+MPIEXEC = @USE_MPI@/bin/mpiexec
+MPIEXEC = @USE_MPI@/bin/@MPIEXEC@
+# MPIARGS = -recvtimeout 10
+MPIARGS = @MPIARGS@
+# MPIARGS = -f hosts
MPDCHECK = tools/mpd-available.zsh @USE_MPI@/bin/mpdlistjobs
# Job launch selection
Modified: configure.ac
===================================================================
--- configure.ac 2010-05-20 17:03:51 UTC (rev 131)
+++ configure.ac 2010-05-20 18:19:24 UTC (rev 132)
@@ -268,6 +268,22 @@
fi
AC_SUBST(USE_MPI)
+MPIEXEC=mpiexec
+AC_ARG_WITH(mpiexec,
+ AS_HELP_STRING([--with-mpiexec],
+ [name of mpiexec (e.g., mpiexec.hydra)]),
+ MPIEXEC="${withval}"
+)
+AC_SUBST(MPIEXEC)
+
+MPIARGS=
+AC_ARG_WITH(mpi-args,
+ AS_HELP_STRING([--with-mpi-args],
+ [arguments to mpiexec (e.g., -f hosts)]),
+ MPIARGS="${withval}"
+)
+AC_SUBST(MPIARGS)
+
dnl does the mpi compiler that we found actually work?
saveCC="$CC"
CC="$MPICC"
Modified: test/cmpi/test-startup.zsh
===================================================================
--- test/cmpi/test-startup.zsh 2010-05-20 17:03:51 UTC (rev 131)
+++ test/cmpi/test-startup.zsh 2010-05-20 18:19:24 UTC (rev 132)
@@ -18,8 +18,7 @@
if (( USE_COMM_WORLD == 1 ))
then
- # Monolithic execution (3 nodes, 3 clients):
- mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
+ eval ${LAUNCH} -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-20 17:03:51 UTC (rev 131)
+++ test/cmpi-db/module.mk.in 2010-05-20 18:19:24 UTC (rev 132)
@@ -18,7 +18,6 @@
CLIENTS := 3
endif
-
test/cmpi-db/test-%.out: test/cmpi-db/test-%.zsh $(CMPIDB_TOOLS)
$(Q) " TEST $(@) "
$(E) $(MPDCHECK)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-20 17:03:59
|
Revision: 131
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=131&view=rev
Author: jmwozniak
Date: 2010-05-20 17:03:51 +0000 (Thu, 20 May 2010)
Log Message:
-----------
Test mods to enable user selection of driver fifo dir
Modified Paths:
--------------
include/accessor.h
src/cmpi/accessor.c
src/cmpi-cp/cmpi-cp.c
src/cmpi-db/cmpi-db-fifo-quit.c
test/cmpi-db/test-quit.zsh
test/driver/module.mk.in
test/driver/test-cmd-get.c
test/driver/test-cmd-put.c
test/driver/test-cmd-quit.c
test/driver/test-cmd-sleep.c
test/driver/test-get.zsh
test/driver/test-put.zsh
test/driver/test-quit.zsh
test/driver/test-sleep.zsh
test/driver/test_helpers.h
tools/timebomb.zsh
Added Paths:
-----------
test/driver/test-cmd.c
test/driver/test-cmd.h
test/driver/test.zsh
Modified: include/accessor.h
===================================================================
--- include/accessor.h 2010-05-18 18:18:08 UTC (rev 130)
+++ include/accessor.h 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,11 +1,12 @@
#include <stdbool.h>
#include <stdio.h>
-#include <stdlib.h>
FILE* to_cmpi;
FILE* from_cmpi;
+void driver_access_fifo_setup(char* dir);
+
bool driver_access_fifo(void);
void driver_access_fifo_close(void);
Modified: src/cmpi/accessor.c
===================================================================
--- src/cmpi/accessor.c 2010-05-18 18:18:08 UTC (rev 130)
+++ src/cmpi/accessor.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,14 +1,42 @@
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+
#include <accessor.h>
+char* fifo_in = NULL;
+char* fifo_out = NULL;
+
+void
+driver_access_fifo_setup(char* dir)
+{
+ if (!dir)
+ dir = "/tmp";
+
+ fifo_in = malloc(1024*sizeof(char));
+ fifo_out = malloc(1024*sizeof(char));
+
+ fifo_in[0] = '\0';
+ fifo_out[0] = '\0';
+
+ strcat(fifo_in, dir);
+ strcat(fifo_in, "/cmpi.fifo.in");
+
+ strcat(fifo_out, dir);
+ strcat(fifo_out, "/cmpi.fifo.out");
+
+ // printf("fifo_in: %s\n", fifo_in);
+ // printf("fifo_out: %s\n", fifo_out);
+}
+
/**
@return True iff successfully access to fifos is made.
*/
bool
driver_access_fifo()
{
- char fifo_in[20] = "/tmp/cmpi.fifo.in";
- char fifo_out[20] = "/tmp/cmpi.fifo.out";
+ assert(fifo_in);
to_cmpi = fopen(fifo_in, "w");
if (to_cmpi == NULL)
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-05-18 18:18:08 UTC (rev 130)
+++ src/cmpi-cp/cmpi-cp.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -252,6 +252,7 @@
exit(1);
}
+ driver_access_fifo_setup(NULL);
driver_access_fifo();
int result =
Modified: src/cmpi-db/cmpi-db-fifo-quit.c
===================================================================
--- src/cmpi-db/cmpi-db-fifo-quit.c 2010-05-18 18:18:08 UTC (rev 130)
+++ src/cmpi-db/cmpi-db-fifo-quit.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,4 +1,5 @@
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -10,7 +11,9 @@
{
char msg[100];
- driver_access_fifo();
+ driver_access_fifo_setup(NULL);
+ bool success = driver_access_fifo();
+ assert(success);
fprintf(to_cmpi, "quit\n");
fflush(to_cmpi);
Modified: test/cmpi-db/test-quit.zsh
===================================================================
--- test/cmpi-db/test-quit.zsh 2010-05-18 18:18:08 UTC (rev 130)
+++ test/cmpi-db/test-quit.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -17,7 +17,7 @@
sleep ${TOTAL}
-bin/cmpi-db-quit >& /dev/null
+bin/cmpi-db-quit
sleep ${TOTAL}
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/module.mk.in 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,7 +1,10 @@
DIR := test/driver
-TEST_DRIVER_SRC += $(shell find test/driver -name "*.c" ! -name test_helpers.c)
+TEST_DRIVER_SRC += test-cmd-quit.c \
+ test-cmd-sleep.c \
+ test-cmd-put.c \
+ test-cmd-get.c
TEST_DRIVER_OBJS = $(patsubst %.c, %.o, $(TEST_DRIVER_SRC))
TEST_DRIVER_OUTPUT = test/driver/test-quit.out \
@@ -9,13 +12,13 @@
test/driver/test-put.out \
test/driver/test-get.out
-TEST_HELPER_SRC := test/driver/test_helpers.c
+TEST_HELPER_SRC := test/driver/test_helpers.c test/driver/test-cmd.c
TEST_DRIVER_OBJS += $(patsubst %.c, %.o, $(TEST_HELPER_SRC))
TEST_SRC += $(TEST_DRIVER_SRC)
TEST_OBJS += $(TEST_DRIVER_OBJS)
-TEST_DRIVER_CMDS = $(shell find test/driver -name test-cmd*.c )
+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)
@@ -37,13 +40,14 @@
$(CMPI) $(LIBS) -o $(@)
test/driver/test%.x: test/driver/test%.o test/driver/test_helpers.o \
- $(CMPI)
+ test/driver/test-cmd.o $(CMPI)
$(Q) " LINK $(@) "
- $(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o $(CMPI) $(LIBS) -o $(@)
+ $(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o \
+ test/driver/test-cmd.o $(CMPI) $(LIBS) -o $(@)
test/driver/test%.out: test/driver/test%.zsh $(TEST_PROGS) $(TEST_DRIVER)
$(Q) " TEST $(@) "
- $(E) test/driver/test.zsh $(@) $(NODES) $(CLIENTS) $(<) $(CMPI_OPTS)
+ $(E) test/driver/test.zsh $(@) $(NODES) $(CLIENTS) $(<) $(DRIVER_DIR)
test/driver/test-success.out: test/cmpi/test-success.out \
$(TEST_DRIVER_OUTPUT)
Modified: test/driver/test-cmd-get.c
===================================================================
--- test/driver/test-cmd-get.c 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-cmd-get.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -8,6 +8,8 @@
#include <mpi_tools.h>
#include <io_tools.h>
+#include "test-cmd.h"
+
void
crash(char* message)
{
@@ -21,17 +23,13 @@
{
int code;
- if (argc < 2)
- {
- printf("test-cmd-get: needs key argument!\n");
- exit(1);
- }
+ test_cmd_setup(argc, argv);
+ char* key = argv[optind];
+
code = driver_access_fifo();
assert(code);
- char* key = argv[1];
-
fprintf(to_cmpi, "get %s\n", key);
fflush(to_cmpi);
Modified: test/driver/test-cmd-put.c
===================================================================
--- test/driver/test-cmd-put.c 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-cmd-put.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,24 +1,24 @@
#include <assert.h>
+#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <accessor.h>
+#include "test-cmd.h"
+
int
main(int argc, char* argv[])
{
+ test_cmd_setup(argc, argv);
+
driver_access_fifo();
- if (argc < 2)
- {
- printf("test-cmd-put: needs key argument!\n");
- exit(1);
- }
+ char* key = argv[optind];
+ // printf("key: %s\n", key);
- char* key = argv[1];
-
char* data = "hello";
char output[32];
Modified: test/driver/test-cmd-quit.c
===================================================================
--- test/driver/test-cmd-quit.c 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-cmd-quit.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -5,11 +5,15 @@
#include <mpi_tools.h>
#include <accessor.h>
+#include "test-cmd.h"
+
int
main(int argc, char* argv[])
{
int error;
+ test_cmd_setup(argc, argv);
+
error = driver_access_fifo();
assert(error);
Modified: test/driver/test-cmd-sleep.c
===================================================================
--- test/driver/test-cmd-sleep.c 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-cmd-sleep.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -6,25 +6,19 @@
#include <accessor.h>
+#include "test-cmd.h"
+
int
main(int argc, char* argv[])
{
int code;
- int seconds;
- if (argc < 2)
- {
- printf("test-cmd-sleep: needs seconds argument!\n");
- exit(1);
- }
+ test_cmd_setup(argc, argv);
- code = sscanf(argv[1], "%i", &seconds);
- assert(code == 1);
-
code = driver_access_fifo();
assert(code);
- fprintf(to_cmpi, "sleep %i\n", seconds);
+ fprintf(to_cmpi, "sleep %i\n", sleep_time);
fflush(to_cmpi);
char output[32];
fscanf(from_cmpi, "%s", output);
Added: test/driver/test-cmd.c
===================================================================
--- test/driver/test-cmd.c (rev 0)
+++ test/driver/test-cmd.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -0,0 +1,57 @@
+
+#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <accessor.h>
+
+#include "test-cmd.h"
+
+int sleep_time;
+
+void test_cmd_setup(int argc, char* argv[])
+{
+ char* dir = NULL;
+
+ int c;
+ while ((c = getopt(argc, argv, "d:s:")) != -1)
+ {
+ int n;
+ switch (c)
+ {
+ case 'd':
+ {
+ // Set driver directory:
+ dir = malloc(1024);
+ n = sscanf(optarg, "%s", dir);
+ if (n == 0)
+ {
+ printf("test-cmd -d got no argument!\n");
+ exit(1);
+ }
+ break;
+ }
+ case 's':
+ {
+ // Set sleep interval for test-cmd-sleep
+ n = sscanf(optarg, "%i", &sleep_time);
+ if (n == 0)
+ {
+ printf("test-cmd -s got no argument!\n");
+ exit(1);
+ }
+ break;
+ }
+ default:
+ {
+ printf("test-cmd got bad argument!\n");
+ exit(1);
+ }
+ }
+ }
+
+ // printf("cmd -d %s\n", dir);
+
+ driver_access_fifo_setup(dir);
+}
Added: test/driver/test-cmd.h
===================================================================
--- test/driver/test-cmd.h (rev 0)
+++ test/driver/test-cmd.h 2010-05-20 17:03:51 UTC (rev 131)
@@ -0,0 +1,6 @@
+
+#include <getopt.h>
+
+extern int sleep_time;
+
+void test_cmd_setup(int argc, char* argv[]);
Modified: test/driver/test-get.zsh
===================================================================
--- test/driver/test-get.zsh 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-get.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,5 +1,5 @@
-test/driver/test-cmd-put.x sample-key
-test/driver/test-cmd-sleep.x 1
-test/driver/test-cmd-get.x sample-key
+test/driver/test-cmd-put.x -d ${DRIVER_DIR} sample-key
+test/driver/test-cmd-sleep.x -d ${DRIVER_DIR} -s 1
+test/driver/test-cmd-get.x -d ${DRIVER_DIR} sample-key
[[ $? == 0 ]] || bail "could not get: sample-key"
-test/driver/test-cmd-quit.x
+test/driver/test-cmd-quit.x -d ${DRIVER_DIR}
Modified: test/driver/test-put.zsh
===================================================================
--- test/driver/test-put.zsh 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-put.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,3 +1,3 @@
-test/driver/test-cmd-put.x sample-key
-test/driver/test-cmd-sleep.x 1
-test/driver/test-cmd-quit.x
+test/driver/test-cmd-put.x -d ${DRIVER_DIR} sample-key
+test/driver/test-cmd-sleep.x -d ${DRIVER_DIR} -s 1
+test/driver/test-cmd-quit.x -d ${DRIVER_DIR}
Modified: test/driver/test-quit.zsh
===================================================================
--- test/driver/test-quit.zsh 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-quit.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -1 +1 @@
-test/driver/test-cmd-quit.x
+test/driver/test-cmd-quit.x -d ${DRIVER_DIR}
Modified: test/driver/test-sleep.zsh
===================================================================
--- test/driver/test-sleep.zsh 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-sleep.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,4 +1,4 @@
-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
+test/driver/test-cmd-sleep.x -d ${DRIVER_DIR} 1
+test/driver/test-cmd-sleep.x -d ${DRIVER_DIR} 1
+test/driver/test-cmd-sleep.x -d ${DRIVER_DIR} 1
+test/driver/test-cmd-quit.x -d ${DRIVER_DIR}
Added: test/driver/test.zsh
===================================================================
--- test/driver/test.zsh (rev 0)
+++ test/driver/test.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -0,0 +1,43 @@
+#!/bin/zsh
+
+OUTPUT=$1
+NODES=$2
+CLIENTS=$3
+CMDS=$4
+DRIVER_DIR=$5
+
+TOTAL=$(( NODES+CLIENTS ))
+
+source tools/test-helpers.zsh
+
+bail()
+{
+ kill ${BOMB_PID}
+ crash $1
+}
+
+# set -x
+
+if [[ ${DRIVER_DIR} == "" ]]
+then
+ DRIVER_DIR="/tmp"
+fi
+CMPI_OPTS="-p driver_dir=${DRIVER_DIR}"
+
+DRIVER=test/driver/test_driver.x
+mpiexec -n ${TOTAL} ${DRIVER} -n ${NODES} ${CMPI_OPTS} > ${OUTPUT} &
+DRIVER_PID=${!}
+
+tools/timebomb.zsh ${$} 20 ${OUTPUT} $0 &
+BOMB_PID=${!}
+
+sleep 3
+
+source ${CMDS}
+
+wait ${DRIVER_PID}
+kill ${BOMB_PID}
+
+check_exits ${TOTAL} ${OUTPUT}
+
+return 0
Property changes on: test/driver/test.zsh
___________________________________________________________________
Added: svn:executable
+ *
Modified: test/driver/test_helpers.h
===================================================================
--- test/driver/test_helpers.h 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test_helpers.h 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,20 +1,20 @@
-// #include <stdio.h>
+// #include <stdio.h>
#ifndef TEST_HELPERS_H
#define TEST_HELPERS_H
#include <node.h>
-#include <gossip.h>
+#include <gossip.h>
/**
- Print debugging header using machine-specific information.
+ Print debugging header using machine-specific information.
*/
void print_header(void);
-char* useless_data(int size);
+char* useless_data(int size);
-void wait_for_notification(void);
-void notify_next(void);
+void wait_for_notification(void);
+void notify_next(void);
#endif
Modified: tools/timebomb.zsh
===================================================================
--- tools/timebomb.zsh 2010-05-18 18:18:08 UTC (rev 130)
+++ tools/timebomb.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -10,8 +10,8 @@
print "timebomb killing: ${LABEL} PID: ${TARGET}"
-cp -v ${DATA} ${DATA}.bombed
+mv -v ${DATA} ${DATA}.bombed
-sleep 3
+sleep 1
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-18 18:18:15
|
Revision: 130
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=130&view=rev
Author: jmwozniak
Date: 2010-05-18 18:18:08 +0000 (Tue, 18 May 2010)
Log Message:
-----------
Simplify test/driver framework
Modified Paths:
--------------
test/driver/module.mk.in
test/driver/test-get.zsh
test/driver/test-put.zsh
test/driver/test-quit.zsh
test/driver/test-sleep.zsh
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-18 18:17:40 UTC (rev 129)
+++ test/driver/module.mk.in 2010-05-18 18:18:08 UTC (rev 130)
@@ -43,7 +43,7 @@
test/driver/test%.out: test/driver/test%.zsh $(TEST_PROGS) $(TEST_DRIVER)
$(Q) " TEST $(@) "
- $(E) $(<) $(@) $(NODES) $(CLIENTS)
+ $(E) test/driver/test.zsh $(@) $(NODES) $(CLIENTS) $(<) $(CMPI_OPTS)
test/driver/test-success.out: test/cmpi/test-success.out \
$(TEST_DRIVER_OUTPUT)
Modified: test/driver/test-get.zsh
===================================================================
--- test/driver/test-get.zsh 2010-05-18 18:17:40 UTC (rev 129)
+++ test/driver/test-get.zsh 2010-05-18 18:18:08 UTC (rev 130)
@@ -1,38 +1,5 @@
-#!/bin/zsh
-
-# Put/get case
-
-OUTPUT=$1
-NODES=$2
-CLIENTS=$3
-
-TOTAL=$(( NODES+CLIENTS ))
-
-source tools/test-helpers.zsh
-
-bail()
-{
- kill ${BOMB_PID}
- crash $1
-}
-
-mpiexec -n ${TOTAL} test/driver/test_driver.x -n ${NODES} > ${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}
-
-check_exits ${TOTAL} ${OUTPUT}
-
-return 0
Modified: test/driver/test-put.zsh
===================================================================
--- test/driver/test-put.zsh 2010-05-18 18:17:40 UTC (rev 129)
+++ test/driver/test-put.zsh 2010-05-18 18:18:08 UTC (rev 130)
@@ -1,30 +1,3 @@
-#!/bin/zsh
-
-# Just do a put
-
-OUTPUT=$1
-NODES=$2
-CLIENTS=$3
-
-TOTAL=$(( NODES+CLIENTS ))
-
-source tools/test-helpers.zsh
-
-mpiexec -n ${TOTAL} test/driver/test_driver.x -n ${NODES} > ${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}
-
-check_exits ${TOTAL} ${OUTPUT}
-
-return 0
Modified: test/driver/test-quit.zsh
===================================================================
--- test/driver/test-quit.zsh 2010-05-18 18:17:40 UTC (rev 129)
+++ test/driver/test-quit.zsh 2010-05-18 18:18:08 UTC (rev 130)
@@ -1,26 +1 @@
-#!/bin/zsh
-
-OUTPUT=$1
-NODES=$2
-CLIENTS=$3
-
-TOTAL=$(( NODES+CLIENTS ))
-
-source tools/test-helpers.zsh
-
-mpiexec -n ${TOTAL} test/driver/test_driver.x -n ${NODES} > ${OUTPUT} &
-DRIVER_PID=${!}
-
-tools/timebomb.zsh ${$} 10 ${OUTPUT} $0 &
-BOMB_PID=${!}
-
-sleep 3
-
test/driver/test-cmd-quit.x
-
-wait ${DRIVER_PID}
-kill ${BOMB_PID}
-
-check_exits ${TOTAL} ${OUTPUT}
-
-return 0
Modified: test/driver/test-sleep.zsh
===================================================================
--- test/driver/test-sleep.zsh 2010-05-18 18:17:40 UTC (rev 129)
+++ test/driver/test-sleep.zsh 2010-05-18 18:18:08 UTC (rev 130)
@@ -1,31 +1,4 @@
-#!/bin/zsh
-
-# Flex driver by issuing simple commands
-
-OUTPUT=$1
-NODES=$2
-CLIENTS=$3
-
-TOTAL=$(( NODES+CLIENTS ))
-
-source tools/test-helpers.zsh
-
-mpiexec -n ${TOTAL} test/driver/test_driver.x -n ${NODES} > ${OUTPUT} &
-DRIVER_PID=${!}
-
-tools/timebomb.zsh ${$} 15 ${OUTPUT} $0 &
-BOMB_PID=${!}
-
-sleep 5
-
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 ${DRIVER_PID}
-kill ${BOMB_PID}
-
-check_exits ${TOTAL} ${OUTPUT}
-
-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-18 18:17:48
|
Revision: 129
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=129&view=rev
Author: jmwozniak
Date: 2010-05-18 18:17:40 +0000 (Tue, 18 May 2010)
Log Message:
-----------
Allow user to set CMPI fifo locations
Modified Paths:
--------------
src/cmpi/driver.c
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-18 18:16:51 UTC (rev 128)
+++ src/cmpi/driver.c 2010-05-18 18:17:40 UTC (rev 129)
@@ -15,6 +15,9 @@
bool driver_quitting = false;
+char* fifo_in = NULL;
+char* fifo_out = NULL;
+
cmpi_driver*
driver_create(void)
{
@@ -44,16 +47,41 @@
}
/**
+ Setup driver fifo locations.
+ Based on C-MPI parameter driver_dir
+*/
+void driver_setup_fifo_names()
+{
+ char* dir = cmpi_params_search("driver_dir");
+ if (!dir)
+ dir = "/tmp";
+
+ fifo_in = malloc(CMPI_BLOB_LENGTH*sizeof(char));
+ fifo_out = malloc(CMPI_BLOB_LENGTH*sizeof(char));
+
+ fifo_in[0] = '\0';
+ fifo_out[0] = '\0';
+
+ strcat(fifo_in, dir);
+ strcat(fifo_in, "/cmpi.fifo.in");
+
+ strcat(fifo_out, dir);
+ strcat(fifo_out, "/cmpi.fifo.out");
+
+ NOTE_FSS(fifo_in,fifo_out);
+
+ signal(SIGPIPE, SIG_IGN);
+}
+
+/**
@return True iff the fifos were set up and opened correctly.
*/
bool
driver_setup_fifo(cmpi_driver* driver)
{
- char fifo_in[20] = "/tmp/cmpi.fifo.in";
- char fifo_out[20] = "/tmp/cmpi.fifo.out";
+ if (!fifo_in)
+ driver_setup_fifo_names();
- signal(SIGPIPE, SIG_IGN);
-
unlink(fifo_in);
unlink(fifo_out);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-18 18:16:59
|
Revision: 128
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=128&view=rev
Author: jmwozniak
Date: 2010-05-18 18:16:51 +0000 (Tue, 18 May 2010)
Log Message:
-----------
Increase some constants
Modified Paths:
--------------
include/cmpi.h
include/list.h
Modified: include/cmpi.h
===================================================================
--- include/cmpi.h 2010-05-17 22:20:29 UTC (rev 127)
+++ include/cmpi.h 2010-05-18 18:16:51 UTC (rev 128)
@@ -46,7 +46,7 @@
//// Communication settings...
// Table size for outstanding asynchronous communication:
-#define CALL_TABLE_SIZE 3
+#define CALL_TABLE_SIZE 16
extern int cmpi_status;
Modified: include/list.h
===================================================================
--- include/list.h 2010-05-17 22:20:29 UTC (rev 127)
+++ include/list.h 2010-05-18 18:16:51 UTC (rev 128)
@@ -13,8 +13,8 @@
#include <mpi_tools.h>
-// Maximum size of a klist datum
-#define LIST_MAX_DATUM 100
+// Maximum size of a list datum
+#define LIST_MAX_DATUM 1024
struct list_item
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-17 22:20:37
|
Revision: 127
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=127&view=rev
Author: jmwozniak
Date: 2010-05-17 22:20:29 +0000 (Mon, 17 May 2010)
Log Message:
-----------
Quick note
Modified Paths:
--------------
docs/manual/manual.xml
Modified: docs/manual/manual.xml
===================================================================
--- docs/manual/manual.xml 2010-05-14 21:00:15 UTC (rev 126)
+++ docs/manual/manual.xml 2010-05-17 22:20:29 UTC (rev 127)
@@ -31,6 +31,8 @@
The fastest way to get a quick overview of provided features
is to just run:
<programlisting>
+ ./setup.sh
+ ./configure --config-cache --enable-table-dense-1 --enable-tests --with-mpi=${HOME}/sfw/mpich2-1.2.1p1
make D=1 test_results
</programlisting>
Then, just take a look at the test code and output to see
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-14 21:00:21
|
Revision: 126
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=126&view=rev
Author: jmwozniak
Date: 2010-05-14 21:00:15 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Add notes about C-MPI modes
Modified Paths:
--------------
docs/manual/manual.xml
Modified: docs/manual/manual.xml
===================================================================
--- docs/manual/manual.xml 2010-05-14 20:44:21 UTC (rev 125)
+++ docs/manual/manual.xml 2010-05-14 21:00:15 UTC (rev 126)
@@ -511,6 +511,27 @@
</variablelist>
</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term>--enable-mode-*</term>
+ <listitem><para>
+ The node layout scheme.
+ (see Components:<filename>mode*.c</filename>).
+ <variablelist>
+ <varlistentry>
+ <term>--enable-mode-mono</term>
+ <listitem><para>
+ The default.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>--enable-mode-pairs</term>
+ <listitem><para>
+ The default.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para></listitem>
+ </varlistentry>
<varlistentry>
<term>--enable-tests</term>
<listitem><para>
@@ -666,6 +687,37 @@
implementation.
</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term>mode_*.c</term>
+ <listitem><para>
+ C-MPI mode selection made at configure time.
+ <variablelist>
+ <varlistentry>
+ <term>mono</term>
+ <listitem><para>
+ Given <literal>mpiexec -n 6 cmpi-db -n 4</literal>,
+ creates 4 DHT nodes (ranks 0-3)
+ and 2 clients (ranks 4-5).
+ The clients will use all nodes as contacts.
+ Ideal for the SMP case.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>pairs</term>
+ <listitem><para>
+ Given <literal>mpiexec -n 6 cmpi-db -n 3</literal>,
+ creates 3 DHT nodes (ranks 0-2)
+ and 3 clients (ranks 3-5).
+ The clients connect to a single contact
+ (0:3, 1:4, 2:5).
+ Ideal for the cluster case: each physical node will
+ have one node process and one client process,
+ the client will only contact the local node.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para></listitem>
+ </varlistentry>
<varlistentry>
<term>node.c</term>
<listitem><para>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-14 20:44:28
|
Revision: 125
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=125&view=rev
Author: jmwozniak
Date: 2010-05-14 20:44:21 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Add date info to manual
Modified Paths:
--------------
docs/manual/Makefile
docs/manual/manual.xml
Modified: docs/manual/Makefile
===================================================================
--- docs/manual/Makefile 2010-05-14 20:34:52 UTC (rev 124)
+++ docs/manual/Makefile 2010-05-14 20:44:21 UTC (rev 125)
@@ -13,6 +13,7 @@
manual.inc.xml: manual.xml
xmllint --xinclude $(<) > $(@)
+ sed -i "s/INSERT_DATE/`date`/" $(@)
index.html: manual.inc.xml formatting/swiftsh_html.xsl
xsltproc --nonet formatting/swiftsh_html.xsl $(<)
Modified: docs/manual/manual.xml
===================================================================
--- docs/manual/manual.xml 2010-05-14 20:34:52 UTC (rev 124)
+++ docs/manual/manual.xml 2010-05-14 20:44:21 UTC (rev 125)
@@ -728,4 +728,12 @@
</variablelist>
</para>
</section>
+
+ <section id="appendix">
+ <title>Appendix
+ </title>
+ <para>
+ Updated: INSERT_DATE
+ </para>
+ </section>
</article>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <jmw...@us...> - 2010-05-14 20:33:00
|
Revision: 123
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=123&view=rev
Author: jmwozniak
Date: 2010-05-14 20:32:54 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Add note about test-success.out files
Modified Paths:
--------------
docs/manual/manual.xml
Modified: docs/manual/manual.xml
===================================================================
--- docs/manual/manual.xml 2010-05-14 20:00:27 UTC (rev 122)
+++ docs/manual/manual.xml 2010-05-14 20:32:54 UTC (rev 123)
@@ -597,6 +597,13 @@
</para></listitem>
</varlistentry>
<varlistentry>
+ <term>test/<module>/test-success.out</term>
+ <listitem><para>
+ Run all the tests for <literal>module</literal>
+ after all of the tests for its dependencies.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
<term>tags</term>
<listitem><para>
Make an etags file based on the configuration choices.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-14 20:00:33
|
Revision: 122
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=122&view=rev
Author: jmwozniak
Date: 2010-05-14 20:00:27 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Update driver tests based on new CMPI mode
Modified Paths:
--------------
test/driver/module.mk.in
test/driver/test-get.zsh
test/driver/test-put.zsh
test/driver/test-quit.zsh
test/driver/test-sleep.zsh
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-14 19:44:34 UTC (rev 121)
+++ test/driver/module.mk.in 2010-05-14 20:00:27 UTC (rev 122)
@@ -23,6 +23,14 @@
TEST_DRIVER = test/driver/test_driver.x
TEST_DRIVER_IMPL = test/driver/test_driver_fifo.o
+ifeq (@USE_CMPI_MODE@,MONO)
+ NODES := 5
+ CLIENTS := 1
+else
+ NODES := 3
+ CLIENTS := 3
+endif
+
$(TEST_DRIVER): $(TEST_DRIVER_IMPL) test/driver/test_helpers.o $(CMPI)
$(Q) " LINK $(@) "
$(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o \
@@ -35,7 +43,7 @@
test/driver/test%.out: test/driver/test%.zsh $(TEST_PROGS) $(TEST_DRIVER)
$(Q) " TEST $(@) "
- $(E) $(<) $(@)
+ $(E) $(<) $(@) $(NODES) $(CLIENTS)
test/driver/test-success.out: test/cmpi/test-success.out \
$(TEST_DRIVER_OUTPUT)
Modified: test/driver/test-get.zsh
===================================================================
--- test/driver/test-get.zsh 2010-05-14 19:44:34 UTC (rev 121)
+++ test/driver/test-get.zsh 2010-05-14 20:00:27 UTC (rev 122)
@@ -3,7 +3,11 @@
# Put/get case
OUTPUT=$1
+NODES=$2
+CLIENTS=$3
+TOTAL=$(( NODES+CLIENTS ))
+
source tools/test-helpers.zsh
bail()
@@ -12,7 +16,7 @@
crash $1
}
-mpiexec -n 5 test/driver/test_driver.x -n 4 > ${OUTPUT} &
+mpiexec -n ${TOTAL} test/driver/test_driver.x -n ${NODES} > ${OUTPUT} &
DRIVER_PID=${!}
tools/timebomb.zsh ${$} 10 ${OUTPUT} $0 &
@@ -29,11 +33,6 @@
wait ${DRIVER_PID}
kill ${BOMB_PID}
-N=$( grep -c "Normal exit" ${OUTPUT} )
-if (( N != 5 ))
-then
- mv -v ${OUTPUT} ${OUTPUT}.failed
- exit 1
-fi
+check_exits ${TOTAL} ${OUTPUT}
return 0
Modified: test/driver/test-put.zsh
===================================================================
--- test/driver/test-put.zsh 2010-05-14 19:44:34 UTC (rev 121)
+++ test/driver/test-put.zsh 2010-05-14 20:00:27 UTC (rev 122)
@@ -3,8 +3,14 @@
# Just do a put
OUTPUT=$1
+NODES=$2
+CLIENTS=$3
-mpiexec -n 5 test/driver/test_driver.x -n 4 > ${OUTPUT} &
+TOTAL=$(( NODES+CLIENTS ))
+
+source tools/test-helpers.zsh
+
+mpiexec -n ${TOTAL} test/driver/test_driver.x -n ${NODES} > ${OUTPUT} &
DRIVER_PID=${!}
tools/timebomb.zsh ${$} 10 ${OUTPUT} $0 &
@@ -19,11 +25,6 @@
wait ${DRIVER_PID}
kill ${BOMB_PID}
-N=$( grep -c "Normal exit" ${OUTPUT} )
-if (( N != 5 ))
-then
- mv -v ${OUTPUT} ${OUTPUT}.failed
- exit 1
-fi
+check_exits ${TOTAL} ${OUTPUT}
return 0
Modified: test/driver/test-quit.zsh
===================================================================
--- test/driver/test-quit.zsh 2010-05-14 19:44:34 UTC (rev 121)
+++ test/driver/test-quit.zsh 2010-05-14 20:00:27 UTC (rev 122)
@@ -1,8 +1,14 @@
#!/bin/zsh
OUTPUT=$1
+NODES=$2
+CLIENTS=$3
-mpiexec -n 6 test/driver/test_driver.x -n 3 > ${OUTPUT} &
+TOTAL=$(( NODES+CLIENTS ))
+
+source tools/test-helpers.zsh
+
+mpiexec -n ${TOTAL} test/driver/test_driver.x -n ${NODES} > ${OUTPUT} &
DRIVER_PID=${!}
tools/timebomb.zsh ${$} 10 ${OUTPUT} $0 &
@@ -15,11 +21,6 @@
wait ${DRIVER_PID}
kill ${BOMB_PID}
-N=$( grep -c "Normal exit" ${OUTPUT} )
-if (( N != 6 ))
-then
- mv -v ${OUTPUT} ${OUTPUT}.failed
- exit 1
-fi
+check_exits ${TOTAL} ${OUTPUT}
return 0
Modified: test/driver/test-sleep.zsh
===================================================================
--- test/driver/test-sleep.zsh 2010-05-14 19:44:34 UTC (rev 121)
+++ test/driver/test-sleep.zsh 2010-05-14 20:00:27 UTC (rev 122)
@@ -1,10 +1,16 @@
#!/bin/zsh
-# Flex driver by issuing multiple simple commands
+# Flex driver by issuing simple commands
OUTPUT=$1
+NODES=$2
+CLIENTS=$3
-mpiexec -n 5 test/driver/test_driver.x -n 4 > ${OUTPUT} &
+TOTAL=$(( NODES+CLIENTS ))
+
+source tools/test-helpers.zsh
+
+mpiexec -n ${TOTAL} test/driver/test_driver.x -n ${NODES} > ${OUTPUT} &
DRIVER_PID=${!}
tools/timebomb.zsh ${$} 15 ${OUTPUT} $0 &
@@ -20,11 +26,6 @@
wait ${DRIVER_PID}
kill ${BOMB_PID}
-N=$( grep -c "Normal exit" ${OUTPUT} )
-if (( N != 5 ))
-then
- mv -v ${OUTPUT} ${OUTPUT}.failed
- exit 1
-fi
+check_exits ${TOTAL} ${OUTPUT}
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-14 19:44:41
|
Revision: 121
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=121&view=rev
Author: jmwozniak
Date: 2010-05-14 19:44:34 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Automate selection of CMPI mode implementation
Modified Paths:
--------------
src/cmpi/module.mk.in
Added Paths:
-----------
src/cmpi/mode_pairs.c
Removed Paths:
-------------
src/cmpi/mode_rr.c
Copied: src/cmpi/mode_pairs.c (from rev 120, src/cmpi/mode_rr.c)
===================================================================
--- src/cmpi/mode_pairs.c (rev 0)
+++ src/cmpi/mode_pairs.c 2010-05-14 19:44:34 UTC (rev 121)
@@ -0,0 +1,76 @@
+
+#include <cmpi.h>
+#include <cmpi_mode.h>
+
+/**
+ Pairs:
+ Try to place one node and one client on each physical
+ compute node
+*/
+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;
+}
+
+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;
+}
+
+
+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;
+}
+
+/**
+ 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;
+}
Deleted: src/cmpi/mode_rr.c
===================================================================
--- src/cmpi/mode_rr.c 2010-05-14 19:42:54 UTC (rev 120)
+++ src/cmpi/mode_rr.c 2010-05-14 19:44:34 UTC (rev 121)
@@ -1,76 +0,0 @@
-
-#include <cmpi.h>
-#include <cmpi_mode.h>
-
-/**
- Pairs:
- Try to place one node and one client on each physical
- compute node
-*/
-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;
-}
-
-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;
-}
-
-
-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;
-}
-
-/**
- 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 19:42:54 UTC (rev 120)
+++ src/cmpi/module.mk.in 2010-05-14 19:44:34 UTC (rev 121)
@@ -7,8 +7,13 @@
CMPI_SRC += $(DIR)/driver.c
CMPI_SRC += $(DIR)/accessor.c
-MODE = $(DIR)/mode_mono.c
-#MODE = $(DIR)/mode_rr.c
+# Select CMPI mode:
+ifeq (@USE_CMPI_MODE@,MONO)
+ MODE := $(DIR)/mode_mono.c
+endif
+ifeq (@USE_CMPI_MODE@,PAIRS)
+ MODE := $(DIR)/mode_pairs.c
+endif
CMPI_SRC += $(MODE)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-14 19:43:00
|
Revision: 120
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=120&view=rev
Author: jmwozniak
Date: 2010-05-14 19:42:54 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Rename this mode to "pairs"
Modified Paths:
--------------
src/cmpi/mode_rr.c
Modified: src/cmpi/mode_rr.c
===================================================================
--- src/cmpi/mode_rr.c 2010-05-14 19:41:24 UTC (rev 119)
+++ src/cmpi/mode_rr.c 2010-05-14 19:42:54 UTC (rev 120)
@@ -3,7 +3,7 @@
#include <cmpi_mode.h>
/**
- Round-robin:
+ Pairs:
Try to place one node and one client on each physical
compute node
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <jmw...@us...> - 2010-05-14 18:59:13
|
Revision: 118
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=118&view=rev
Author: jmwozniak
Date: 2010-05-14 18:59:07 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Clarify FUSE integration
Modified Paths:
--------------
docs/manual/manual.xml
Modified: docs/manual/manual.xml
===================================================================
--- docs/manual/manual.xml 2010-05-14 18:55:21 UTC (rev 117)
+++ docs/manual/manual.xml 2010-05-14 18:59:07 UTC (rev 118)
@@ -119,7 +119,11 @@
</title>
<para>
A FUSE adapter could be built using functionality similar
- to the MPI-IO functionality.
+ to the techniques above.
+ The user would first instantiate the <literal>cmpi-db</literal>.
+ Then, the FUSE implementation would make calls using
+ the <literal>driver</literal> interface similar to the way
+ that <filename>cmpi-cp</filename> does.
</para>
</section>
</section>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-14 18:55:27
|
Revision: 117
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=117&view=rev
Author: jmwozniak
Date: 2010-05-14 18:55:21 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Add note about make tests
Modified Paths:
--------------
docs/manual/manual.xml
Modified: docs/manual/manual.xml
===================================================================
--- docs/manual/manual.xml 2010-05-14 18:48:03 UTC (rev 116)
+++ docs/manual/manual.xml 2010-05-14 18:55:21 UTC (rev 117)
@@ -587,6 +587,12 @@
</para></listitem>
</varlistentry>
<varlistentry>
+ <term>tests</term>
+ <listitem><para>
+ Build (but do not run) the test programs.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
<term>tags</term>
<listitem><para>
Make an etags file based on the configuration choices.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-14 18:48:09
|
Revision: 116
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=116&view=rev
Author: jmwozniak
Date: 2010-05-14 18:48:03 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Actually add shell function col()
Modified Paths:
--------------
tools/test-helpers.zsh
Modified: tools/test-helpers.zsh
===================================================================
--- tools/test-helpers.zsh 2010-05-14 18:42:38 UTC (rev 115)
+++ tools/test-helpers.zsh 2010-05-14 18:48:03 UTC (rev 116)
@@ -1,6 +1,23 @@
# Sourced by tests for reusable functionality
+col()
+# Select columns from input without awk
+{
+ local L
+ local -Z c
+ local A
+ while read L
+ do
+ A=( $( print ${L} ) )
+ for c in ${*}
+ do
+ printf "${A[c]} "
+ done
+ printf "\n"
+ done
+}
+
USE_COMM_WORLD=$( grep USE_COMM_WORLD cmpi-config.h | col 3 )
crash()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-14 18:42:44
|
Revision: 115
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=115&view=rev
Author: jmwozniak
Date: 2010-05-14 18:42:38 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Manual improvements.
Modified Paths:
--------------
docs/manual/manual.xml
Modified: docs/manual/manual.xml
===================================================================
--- docs/manual/manual.xml 2010-05-14 17:18:19 UTC (rev 114)
+++ docs/manual/manual.xml 2010-05-14 18:42:38 UTC (rev 115)
@@ -45,7 +45,15 @@
<title>MPI Library
</title>
<para>
- C-MPI can be used as an MPI library:
+ C-MPI can be used as an MPI library.
+ In this mode, the user allocates some number of DHT nodes
+ and DHT clients.
+ The nodes start up and begin listening for requests.
+ The clients call into <literal>cmpi_client_code()</literal>,
+ do work, and make C-MPI calls.
+ (User programs can link to <filename>libcmpi.a</filename>
+ directly as well by imitating
+ <filename>cmpi/client.c</filename>.)
</para>
<programlisting>
@@ -58,6 +66,12 @@
<title>Cluster database
</title>
<para>
+ In this mode, the DHT runs as a distributed background process
+ (<literal>cmpi-db</literal>) and the user connects to it
+ via a <literal>cp</literal>-like tool
+ (<literal>cmpi-cp</literal>).
+ </para>
+ <para>
Commands executed on submit host:
<programlisting><xi:include
href="login_shell.sh" parse="text"
@@ -68,6 +82,46 @@
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
</para>
</section>
+
+ <section>
+ <title>MPI-IO implementation
+ </title>
+ <para>
+ The CMPI-IO module is really only an sketch.
+ Here's the idea:
+ <orderedlist><listitem><para>
+ C-MPI provides a patch for MPICH.
+ The user applies the patch and recompiles MPICH.
+ </para></listitem></orderedlist>
+ <orderedlist><listitem><para>
+ The user writes a normal MPI/MPI-IO program but provides
+ <literal>cmpi:/</literal> pathnames to trigger the
+ CMPI-IO implementation.
+ </para></listitem></orderedlist>
+ <orderedlist><listitem><para>
+ The user launches the program with
+ <literal>mpiexec</literal>,
+ allocating extra processes for the DHT.
+ </para></listitem></orderedlist>
+ <orderedlist><listitem><para>
+ Calls like <literal>MPI_FILE_WRITE_AT()</literal>
+ are translated by ROMIO and implemented ultimately by calls
+ like <literal>ADIOI_CMPI_WriteContig()</literal>.
+ (The full list of what CMPI-IO needs to implement is in
+ <filename>ad_cmpi.h</filename>; it's actually not that bad.)
+ This method would be implemented via calls to
+ <literal>cmpi_put()</literal>/<literal>cmpi_get()</literal>.
+ </para></listitem></orderedlist>
+ </para>
+ </section>
+ <section>
+ <title>FUSE module
+ </title>
+ <para>
+ A FUSE adapter could be built using functionality similar
+ to the MPI-IO functionality.
+ </para>
+ </section>
</section>
<section id="mpirpc">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-14 17:18:25
|
Revision: 114
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=114&view=rev
Author: jmwozniak
Date: 2010-05-14 17:18:19 +0000 (Fri, 14 May 2010)
Log Message:
-----------
New cluster database documentation
Modified Paths:
--------------
docs/manual/Makefile
docs/manual/manual.xml
docs/manual/sf-post.zsh
Added Paths:
-----------
docs/manual/client_script.sh
docs/manual/login_shell.sh
Property Changed:
----------------
docs/manual/
Property changes on: docs/manual
___________________________________________________________________
Modified: svn:ignore
- fop
manual.html
index.html
+ .ignore
fop
manual.html
index.html
manual.inc.xml
Modified: docs/manual/Makefile
===================================================================
--- docs/manual/Makefile 2010-05-14 15:39:05 UTC (rev 113)
+++ docs/manual/Makefile 2010-05-14 17:18:19 UTC (rev 114)
@@ -14,11 +14,13 @@
manual.inc.xml: manual.xml
xmllint --xinclude $(<) > $(@)
-manual.html: manual.inc.xml formatting/swiftsh_html.xsl
- xsltproc --nonet formatting/swiftsh_html.xsl $<
+index.html: manual.inc.xml formatting/swiftsh_html.xsl
+ xsltproc --nonet formatting/swiftsh_html.xsl $(<)
+ chmod a+r $(@)
-index.html: manual.html
+manual.html: index.html
sed -e "s/index.html#/#/g" $(<) > $(@)
+ chmod a+r $(@)
#%.pdf: %.xml formatting/vdl2_fo.xsl
# fop/fop -xsl formatting/vdl2_fo.xsl -xml $< -pdf $@
Added: docs/manual/client_script.sh
===================================================================
--- docs/manual/client_script.sh (rev 0)
+++ docs/manual/client_script.sh 2010-05-14 17:18:19 UTC (rev 114)
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+id=$1
+nodes=$2
+
+for (( i=0 ; i<10 ; i++ ))
+do
+ # Do some useful work
+ do_work ${id} ${nodes} < input > output
+ # Post the results to the DHT
+ key=output_${id}_${i}
+ cmpi-cp output dht://${key}
+ # Read a neighbor's result
+ key=output_$(( id-1 % nodes ))_${i}
+ cmpi-cp dht://${key} input
+done
Added: docs/manual/login_shell.sh
===================================================================
--- docs/manual/login_shell.sh (rev 0)
+++ docs/manual/login_shell.sh 2010-05-14 17:18:19 UTC (rev 114)
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# Allocate 6 compute nodes
+qsub -t 1-6 ...
+
+# List node host names to file for mpiexec
+qstat | something > hosts
+
+# Create some initial conditions
+create_initial > input
+
+# Launch the DHT (12 processes on 6 nodes)
+mpiexec.hydra -f hosts -n 12 bin/cmpi-db -n 6 &
+
+# Spawn client scripts
+# (Could use Falkon here?)
+id=0
+total=$( wc -l hosts )
+for host in $( cat hosts )
+do
+ ssh ${host} client_script.sh $(( id++ )) ${total} &
+done
+
+wait
Modified: docs/manual/manual.xml
===================================================================
--- docs/manual/manual.xml 2010-05-14 15:39:05 UTC (rev 113)
+++ docs/manual/manual.xml 2010-05-14 17:18:19 UTC (rev 114)
@@ -24,6 +24,20 @@
</para>
</section>
+ <section id="quickstart">
+ <title>Quick Start
+ </title>
+ <para>
+ The fastest way to get a quick overview of provided features
+ is to just run:
+ <programlisting>
+ make D=1 test_results
+ </programlisting>
+ Then, just take a look at the test code and output to see
+ how things work.
+ </para>
+ </section>
+
<section id="usecases">
<title>Use Cases
</title>
@@ -35,34 +49,25 @@
</para>
<programlisting>
- <xi:include href="cmpi_client_code.c" parse="text"
- xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
-
-<!--
- <programlisting> <![CDATA[
-
- #include <cmpi.h>
-
- cmpi_client_code()
- {
- sprintf(key, "key_%i", mpi_rank);
- sprintf(value, "value_%i", mpi_rank);
- cmpi_put(key, value, strlen(value)+1);
-
- rank = (mpi_rank+1)%mpi_size;
- sprintf(key, "key_%i", rank);
- cmpi_get(key, &result, &length);
- printf("result(%i): %s\n", length, result);
-
- MPI_Finalize();
-
- cmpi_cleanup();
- }
- ]]>
+ <xi:include href="cmpi_client_code.c" parse="text"
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
--->
</section>
+ <section>
+ <title>Cluster database
+ </title>
+ <para>
+ Commands executed on submit host:
+ <programlisting><xi:include
+ href="login_shell.sh" parse="text"
+ xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <literal>client_script.sh</literal>:
+ <programlisting><xi:include
+ href="client_script.sh" parse="text"
+ xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ </para>
+ </section>
</section>
<section id="mpirpc">
@@ -506,6 +511,15 @@
Useful when debugging build process.
</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term>-j</term>
+ <listitem><para>
+ You can do <literal>make -j tests</literal> but you
+ cannot run the tests concurrently.
+ Doing this would create multiple conflicting MPI
+ executions.
+ </para></listitem>
+ </varlistentry>
<varlistentry>
<term>mpirpc</term>
<listitem><para>
Modified: docs/manual/sf-post.zsh
===================================================================
--- docs/manual/sf-post.zsh 2010-05-14 15:39:05 UTC (rev 113)
+++ docs/manual/sf-post.zsh 2010-05-14 17:18:19 UTC (rev 114)
@@ -2,8 +2,9 @@
# Post HTML to SourceForge
-USER=$1
-[[ ${USER} == "" ]] && print "No USER!" && exit 1
+# Input: SourceForge username:
+SF_USER=$1
+[[ ${SF_USER} == "" ]] && print "No SF_USER!" && exit 1
DIR=$( dirname $0 )
cd ${DIR}
@@ -11,4 +12,4 @@
HTML=( index.html manual.html )
IMG=( cmpi-connections.png )
FILES=( ${HTML} ${IMG} )
-scp -p ${FILES} ${USER},c-...@we...:htdocs
+scp -p ${FILES} ${SF_USER},c-...@we...:htdocs
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-14 15:39:11
|
Revision: 113
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=113&view=rev
Author: jmwozniak
Date: 2010-05-14 15:39:05 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Start using XInclude for code samples
Modified Paths:
--------------
docs/manual/Makefile
docs/manual/manual.xml
Added Paths:
-----------
docs/manual/cmpi_client_code.c
Modified: docs/manual/Makefile
===================================================================
--- docs/manual/Makefile 2010-05-14 15:05:52 UTC (rev 112)
+++ docs/manual/Makefile 2010-05-14 15:39:05 UTC (rev 113)
@@ -1,4 +1,3 @@
-#!/bin/sh
all: htmls
# phps pdfs
@@ -12,12 +11,21 @@
# chunked-userguide: userguide.xml
# ./build-chunked-userguide.sh
-%.php: %.xml formatting/swiftsh_html.xsl
+manual.inc.xml: manual.xml
+ xmllint --xinclude $(<) > $(@)
+
+manual.html: manual.inc.xml formatting/swiftsh_html.xsl
xsltproc --nonet formatting/swiftsh_html.xsl $<
- sed -e "s/index.html#/#/g" index.html >$@
+index.html: manual.html
+ sed -e "s/index.html#/#/g" $(<) > $(@)
+
#%.pdf: %.xml formatting/vdl2_fo.xsl
# fop/fop -xsl formatting/vdl2_fo.xsl -xml $< -pdf $@
%.html: %.php
cp $< $@
+
+clean:
+ rm -fv index.html manual.html manual.inc.xml
+
Added: docs/manual/cmpi_client_code.c
===================================================================
--- docs/manual/cmpi_client_code.c (rev 0)
+++ docs/manual/cmpi_client_code.c 2010-05-14 15:39:05 UTC (rev 113)
@@ -0,0 +1,14 @@
+
+#include <cmpi.h>
+
+cmpi_client_code()
+{
+ sprintf(key, "key_%i", mpi_rank);
+ sprintf(value, "value_%i", mpi_rank);
+ cmpi_put(key, value, strlen(value)+1);
+
+ rank = (mpi_rank+1)%mpi_size;
+ sprintf(key, "key_%i", rank);
+ cmpi_get(key, &result, &length);
+ printf("result(%i): %s\n", length, result);
+}
Modified: docs/manual/manual.xml
===================================================================
--- docs/manual/manual.xml 2010-05-14 15:05:52 UTC (rev 112)
+++ docs/manual/manual.xml 2010-05-14 15:39:05 UTC (rev 113)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [] >
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [] >
<article>
<articleinfo revision="0.1">
@@ -33,26 +34,18 @@
C-MPI can be used as an MPI library:
</para>
+ <programlisting>
+ <xi:include href="cmpi_client_code.c" parse="text"
+ xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+<!--
<programlisting> <![CDATA[
#include <cmpi.h>
- int main(int argc, char* argv[])
+ cmpi_client_code()
{
- int mpi_rank;
- int mpi_size;
- char key[10];
- char value[30];
- int length;
- char* result;
-
- MPI_Init(&argc, &argv);
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- MPI_Comm_size(MPI_COMM_WORLD, &size);
-
- cmpi_init();
-
- sprintf(key, "key_%i", mpi_rank);
+ sprintf(key, "key_%i", mpi_rank);
sprintf(value, "value_%i", mpi_rank);
cmpi_put(key, value, strlen(value)+1);
@@ -67,6 +60,8 @@
}
]]>
</programlisting>
+
+-->
</section>
</section>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-14 15:05:58
|
Revision: 112
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=112&view=rev
Author: jmwozniak
Date: 2010-05-14 15:05:52 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Add AC_CHECK_FUNCS(stat)
Modified Paths:
--------------
configure.ac
Modified: configure.ac
===================================================================
--- configure.ac 2010-05-13 04:44:33 UTC (rev 111)
+++ configure.ac 2010-05-14 15:05:52 UTC (rev 112)
@@ -80,6 +80,7 @@
AC_CHECK_FUNCS(mkfifo)
AC_CHECK_FUNCS(socket)
AC_CHECK_FUNCS(sqrt)
+AC_CHECK_FUNCS(stat)
AC_CHECK_FUNCS(strchr)
AC_CHECK_FUNCS(strdup)
AC_CHECK_FUNCS(strnlen)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-13 04:44:39
|
Revision: 111
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=111&view=rev
Author: jmwozniak
Date: 2010-05-13 04:44:33 +0000 (Thu, 13 May 2010)
Log Message:
-----------
Mostly works, some memory problem
Modified Paths:
--------------
src/cmpi/cmpi.c
src/cmpi/driver.c
src/cmpi/node.c
src/cmpi-cp/cmpi-cp.c
src/dense-1/dense.c
src/mpirpc/mpirpc.c
Modified: src/cmpi/cmpi.c
===================================================================
--- src/cmpi/cmpi.c 2010-05-13 01:16:17 UTC (rev 110)
+++ src/cmpi/cmpi.c 2010-05-13 04:44:33 UTC (rev 111)
@@ -158,7 +158,7 @@
cmpi_cached_store(char* key, char* data, int length)
{
struct keyvalue* kv;
- SHOW_FS(key);
+ SHOW_FSI(key, length);
kv = lru_table_add(cmpi_cache, key, data, length);
if (kv)
{
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-13 01:16:17 UTC (rev 110)
+++ src/cmpi/driver.c 2010-05-13 04:44:33 UTC (rev 111)
@@ -54,6 +54,9 @@
signal(SIGPIPE, SIG_IGN);
+ unlink(fifo_in);
+ unlink(fifo_out);
+
int error = mkfifo(fifo_in, S_IRUSR|S_IWUSR);
if (error != 0 &&
errno != EEXIST)
@@ -127,6 +130,7 @@
if (value == NULL)
{
fprintf(driver->sink, "-1\n");
+ printf("driver: doesn't exist\n");
}
else
{
@@ -236,14 +240,14 @@
void
driver_process(cmpi_driver* driver)
{
- gossip_ldebug(MASK_DRIVER, "driver_process()...\n");
+ // gossip_ldebug(MASK_DRIVER, "driver_process()...\n");
while (! driver->quitting)
{
char* result =
fgets(driver->command, CMPI_DRIVER_MAX_COMMAND, driver->source);
if (!result)
{
- gossip_ldebug(MASK_DRIVER, "Resetting driver...\n");
+ NOTE("Resetting driver...");
fclose(driver->source);
fclose(driver->sink);
driver_setup_fifo(driver);
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2010-05-13 01:16:17 UTC (rev 110)
+++ src/cmpi/node.c 2010-05-13 04:44:33 UTC (rev 111)
@@ -188,24 +188,32 @@
sleep(1);
+ char hostname[128];
/*
- 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);
*/
-
+ int error = gethostname(hostname, 128);
+ if (error)
+ {
+ printf("could not gethostname()!\n");
+ exit(1);
+ }
+
if (cmpi_mode_select(mpi_rank, mpi_size, cmpi_nodes) ==
CMPI_MODE_NODE)
{
NOTE("I am node");
+ printf("node: %i @ %s\n", mpi_rank, hostname);
cmpi_init();
}
else
{
NOTE("I am client");
+ printf("client: %i @ %s\n", mpi_size, hostname);
cmpi_init_client();
cmpi_client_code();
}
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-05-13 01:16:17 UTC (rev 110)
+++ src/cmpi-cp/cmpi-cp.c 2010-05-13 04:44:33 UTC (rev 111)
@@ -115,7 +115,7 @@
int
cmpi_cp_get(char* object, FILE* file)
{
- // char message[64];
+ char message[64];
char data[value_size];
int count, c;
int length;
@@ -126,10 +126,11 @@
fprintf(to_cmpi, "get %s\n", object);
fflush(to_cmpi);
- c = fscanf(from_cmpi, "%i\n", &length);
- // printf("message: %i\n", c);
- // printf("message: %s\n", message);
- // sscanf(message, "%i", &length);
+ // c = fscanf(from_cmpi, "%i\n", &length);
+ fgets(message, 64, from_cmpi);
+ //printf("message: %i\n", c);
+ printf("message: %s\n", message);
+ sscanf(message, "%i", &length);
if (length == -1)
return CMPI_DOESNT_EXIST;
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2010-05-13 01:16:17 UTC (rev 110)
+++ src/dense-1/dense.c 2010-05-13 04:44:33 UTC (rev 111)
@@ -150,7 +150,7 @@
DENSE_Translate_k(MPIRPC_Node node, DENSE_ID id)
{
MPIRPC* rpc =
- MPIRPC_Call(node, heap("query_id_k"), xheap(id),
+ MPIRPC_Call(node, "query_id_k", xheap(id),
NULL, MPIRPC_PROCEED_NULL);
return rpc;
}
@@ -164,10 +164,10 @@
{
SHOW_FSI(key, length);
int klength = strlen(key);
- int vlength = strlen(value);
- char* args = malloc((klength+vlength+5)*sizeof(char));
- assert(args);
- strcpy(args, key);
+ // int vlength = strlen(value);
+ // char* args = malloc((klength+vlength+5)*sizeof(char));
+ // assert(args);
+ // strcpy(args, key);
MPIRPC* rpc = MPIRPC_Call_blob(node, "store", key,
value, length,
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2010-05-13 01:16:17 UTC (rev 110)
+++ src/mpirpc/mpirpc.c 2010-05-13 04:44:33 UTC (rev 111)
@@ -69,7 +69,8 @@
Time in microseconds to snooze when MPIRPC_Check() finds nothing.
snooze() & reset_snooze() are called by MPIRPC_Wait().
*/
-unsigned int snooze_amount = 1;
+unsigned int snooze_amount_reset = 0;
+unsigned int snooze_amount = 0;
/**
The maximum amount of time to snooze in microseconds.
@@ -548,9 +549,9 @@
{
MPIRPC_Value* value = malloc(sizeof(MPIRPC_Value));
- value->unique = unique;
+ value->unique = unique;
value->length = length;
- value->result = result;
+ value->result = result;
return value;
}
@@ -761,11 +762,12 @@
void MPIRPC_Snooze_reset()
{
- snooze_amount = 1;
+ snooze_amount = snooze_amount_reset;
}
/**
Convenience method for MPI_Comm_get_name().
+ Places the name in a static location.
*/
char*
MPIRPC_Comm_get_name(MPI_Comm comm)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <jmw...@us...> - 2010-05-12 23:55:14
|
Revision: 109
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=109&view=rev
Author: jmwozniak
Date: 2010-05-12 23:55:08 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Test fixes
Modified Paths:
--------------
include/cmpi_mode.h
src/cmpi/driver.c
src/cmpi/mode_mono.c
src/cmpi/mode_rr.c
src/cmpi/module.mk.in
src/cmpi/node.c
src/cmpi-cp/cmpi-cp.c
src/cmpi-db/cmpi-db-fifo.c
src/dense-1/dense.c
src/mpirpc/mpirpc.c
test/driver/module.mk.in
test/driver/test-cmd-get.c
test/driver/test-cmd-put.c
test/driver/test-cmd-sleep.c
Modified: include/cmpi_mode.h
===================================================================
--- include/cmpi_mode.h 2010-05-12 20:44:33 UTC (rev 108)
+++ include/cmpi_mode.h 2010-05-12 23:55:08 UTC (rev 109)
@@ -3,3 +3,5 @@
int cmpi_mode_select(int rank, int size, int nodes);
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);
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi/driver.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -61,6 +61,7 @@
printf("Could not create fifo: %s\n", fifo_in);
return false;
}
+ NOTE_S("created fifo: ", fifo_in);
error = mkfifo(fifo_out, S_IRUSR|S_IWUSR);
if (error != 0 &&
errno != EEXIST)
@@ -68,6 +69,7 @@
printf("Could not create fifo: %s\n", fifo_in);
return false;
}
+ NOTE_S("created fifo: ", fifo_out);
driver->source = fopen(fifo_in, "r");
if (driver->source == NULL)
@@ -98,6 +100,7 @@
fprintf(driver->sink, "ok\n");
fflush(driver->sink);
+ OK;
NOTE("reading to buffer");
stream_to_buffer(value, length, driver->source);
NOTE("got buffer");
@@ -164,6 +167,7 @@
sleep(i);
fprintf(driver->sink, "ok\n");
fflush(driver->sink);
+ NOTE("awake");
}
void
@@ -220,7 +224,6 @@
}
else if (strncmp(optoken, "sleep", 5) == 0)
{
- printf("sleep\n");
driver_sleep(driver, tokens);
}
else if (strncmp(optoken, "quit", 4) == 0)
Modified: src/cmpi/mode_mono.c
===================================================================
--- src/cmpi/mode_mono.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi/mode_mono.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -24,3 +24,32 @@
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 > nodes-1)
+ 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 nodes;
+}
Modified: src/cmpi/mode_rr.c
===================================================================
--- src/cmpi/mode_rr.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi/mode_rr.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -9,7 +9,8 @@
*/
int cmpi_mode_select(int rank, int size, int nodes)
{
- if (rank > size/2)
+ NOTE("using mode_rr");
+ if (rank >= size/2)
return CMPI_MODE_CLIENT;
return CMPI_MODE_NODE;
}
Modified: src/cmpi/module.mk.in
===================================================================
--- src/cmpi/module.mk.in 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi/module.mk.in 2010-05-12 23:55:08 UTC (rev 109)
@@ -8,7 +8,7 @@
CMPI_SRC += $(DIR)/accessor.c
MODE = $(DIR)/mode_mono.c
-#MODE = $(DIR)/mode_db.c
+#MODE = $(DIR)/mode_rr.c
CMPI_SRC += $(MODE)
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi/node.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -12,6 +12,7 @@
#include <node.h>
#include <cmpi_mode.h>
+#include <io_tools.h>
int nodes;
MPI_Comm cmpi_comm_clients;
@@ -185,6 +186,15 @@
build_client_communicator();
+ 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)
{
NOTE("I am node");
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi-cp/cmpi-cp.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -228,7 +228,7 @@
int
main(int argc, char* argv[])
{
- printf("\ncmpi-cp start\n\n");
+ // printf("\ncmpi-cp start\n\n");
fflush(stdout);
Modified: src/cmpi-db/cmpi-db-fifo.c
===================================================================
--- src/cmpi-db/cmpi-db-fifo.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi-db/cmpi-db-fifo.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -11,7 +11,11 @@
MPI_Status status;
MPI_Recv(&tmp, 1, MPI_INT,
MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
- assert(tmp == -2);
+ if (tmp != -2)
+ {
+ NOTE("notification error!\n");
+ exit(1);
+ }
}
void
@@ -20,11 +24,12 @@
if (mpi_rank < mpi_size-1)
{
int msg = -2;
+ NOTE_I("notifying: ", mpi_rank+1);
MPI_Send(&msg, 1, MPI_INT, mpi_rank+1, 0, MPI_COMM_WORLD);
}
else
{
- // NOTE("NOTIFICATION COMPLETE");
+ NOTE("NOTIFICATION COMPLETE");
}
}
@@ -35,7 +40,6 @@
NOTE("CMPI-DB-FIFO...");
-
wait_for_notification();
notify_next();
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/dense-1/dense.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -1,5 +1,6 @@
#include <dense-1.h>
+#include <cmpi_mode.h>
/**
Number of service nodes.
@@ -70,17 +71,20 @@
void
rpc_bootping()
{
- if (mpi_rank < dense_nodes-1)
+ int next = cmpi_mode_next(mpi_rank, mpi_size, dense_nodes);
+ if (next > 0)
{
MPIRPC_Node node;
- MPIRPC_Node_make(MPI_COMM_WORLD, mpi_rank+1, &node);
+ MPIRPC_Node_make(MPI_COMM_WORLD, next, &node);
MPIRPC_Block(node, "bootping", NULL);
}
else
{
+ int client =
+ cmpi_mode_first_client(mpi_rank, mpi_size, dense_nodes);
NOTE("NOTIFYING");
int msg = -2;
- MPI_Send(&msg, 1, MPI_INT, mpi_rank+1, 0, MPI_COMM_WORLD);
+ MPI_Send(&msg, 1, MPI_INT, client, 0, MPI_COMM_WORLD);
}
}
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/mpirpc/mpirpc.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -733,6 +733,7 @@
MPIRPC_Disconnect(caller);
break;
default:
+ printf("bad msg from: %i\n", caller.rank);
assert(false);
}
}
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-12 20:44:33 UTC (rev 108)
+++ test/driver/module.mk.in 2010-05-12 23:55:08 UTC (rev 109)
@@ -24,13 +24,13 @@
TEST_DRIVER_IMPL = test/driver/test_driver_fifo.o
$(TEST_DRIVER): $(TEST_DRIVER_IMPL) test/driver/test_helpers.o $(CMPI)
- $(Q) " MPICC $(@) "
+ $(Q) " LINK $(@) "
$(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o \
$(CMPI) $(LIBS) -o $(@)
test/driver/test%.x: test/driver/test%.o test/driver/test_helpers.o \
$(CMPI)
- $(Q) " MPICC $(@) "
+ $(Q) " LINK $(@) "
$(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o $(CMPI) $(LIBS) -o $(@)
test/driver/test%.out: test/driver/test%.zsh $(TEST_PROGS) $(TEST_DRIVER)
Modified: test/driver/test-cmd-get.c
===================================================================
--- test/driver/test-cmd-get.c 2010-05-12 20:44:33 UTC (rev 108)
+++ test/driver/test-cmd-get.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -32,19 +32,23 @@
char* key = argv[1];
- fprintf(to_cmpi, "get %s\n", key);
+ fprintf(to_cmpi, "get %s\n", key);
fflush(to_cmpi);
int length;
- code = fscanf(from_cmpi, "%i\n", &length);
- printf("length: %i\n");
- if (code != 1)
- crash("No response from driver!");
+ char message[32];
+ fgets(message, 32, from_cmpi); // &length);
+ // printf("length: %s\n", message);
+ // if (code != 1)
+ // crash("No response from driver!");
// printf("length: %i code: %i \n", length, code);
+ sscanf(message, "%i", &length);
+
if (length == -1)
crash("Key not found!");
+ // printf("read stream\n");
char* result = malloc(length*sizeof(char));
memset(result, 0, length);
int total = stream_to_buffer(result, length, from_cmpi);
Modified: test/driver/test-cmd-put.c
===================================================================
--- test/driver/test-cmd-put.c 2010-05-12 20:44:33 UTC (rev 108)
+++ test/driver/test-cmd-put.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -21,14 +21,21 @@
char* data = "hello";
+ char output[32];
+ int tmp;
+
fprintf(to_cmpi, "put %s %i\n", key, (int) strlen(data)+1);
- fprintf(to_cmpi, "%s%c", data, '\0');
fflush(to_cmpi);
+ fgets(output, 128, from_cmpi);
+ assert(!strncmp(output, "ok", 2));
+ // printf("got ok\n");
- char output[32];
- fscanf(from_cmpi, "%s", output);
+ int i = fwrite(data, sizeof(char), strlen(data)+1, to_cmpi);
+ // printf("wrote: %i\n", i);
+ fflush(to_cmpi);
- assert(!strcmp(output, "ok"));
+ fgets(output, 128, from_cmpi);
+ assert(!strncmp(output, "ok", 2));
return 0;
}
Modified: test/driver/test-cmd-sleep.c
===================================================================
--- test/driver/test-cmd-sleep.c 2010-05-12 20:44:33 UTC (rev 108)
+++ test/driver/test-cmd-sleep.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -29,7 +29,12 @@
char output[32];
fscanf(from_cmpi, "%s", output);
- assert(!strcmp(output, "ok"));
+ if (!(output[0] == 'o' &&
+ output[1] == 'k'))
+ {
+ printf("bad output: %s\n", output);
+ exit(1);
+ }
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-12 20:44:42
|
Revision: 108
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=108&view=rev
Author: jmwozniak
Date: 2010-05-12 20:44:33 +0000 (Wed, 12 May 2010)
Log Message:
-----------
New file_to_buffer()
Modified Paths:
--------------
Makefile.in
include/io_tools.h
src/mpi_tools/io_tools.c
test/driver/test-cmd-get.c
test/mpi_tools/module.mk.in
Added Paths:
-----------
test/mpi_tools/test-file.c
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-12 20:17:35 UTC (rev 107)
+++ Makefile.in 2010-05-12 20:44:33 UTC (rev 108)
@@ -63,11 +63,12 @@
MPI = @USE_MPI@
MPICC = @USE_MPI@/bin/mpicc
MPIEXEC = @USE_MPI@/bin/mpiexec -recvtimeout 10
+# MPIEXEC = @USE_MPI@/bin/mpiexec.hydra -f hosts
MPDCHECK = tools/mpd-available.zsh @USE_MPI@/bin/mpdlistjobs
# Job launch selection
ifeq (@HAVE_SRUN@,no)
- LAUNCH = $(MPIEXEC)
+ LAUNCH = $(MPIEXEC) $(MPIARGS)
else
LAUNCH = srun
endif
Modified: include/io_tools.h
===================================================================
--- include/io_tools.h 2010-05-12 20:17:35 UTC (rev 107)
+++ include/io_tools.h 2010-05-12 20:44:33 UTC (rev 108)
@@ -3,4 +3,5 @@
int stream_to_buffer(char* buffer, int length, FILE* stream);
void buffer_to_stream(char* buffer, int length, FILE* stream);
+int file_to_buffer(char** buffer, char* name);
void eat_whitespace(FILE* stream);
Modified: src/mpi_tools/io_tools.c
===================================================================
--- src/mpi_tools/io_tools.c 2010-05-12 20:17:35 UTC (rev 107)
+++ src/mpi_tools/io_tools.c 2010-05-12 20:44:33 UTC (rev 108)
@@ -1,7 +1,9 @@
#include <io_tools.h>
+#include <stdlib.h>
#include <unistd.h>
+#include <sys/stat.h>
/**
@return The total number of bytes stored in buffer.
@@ -34,6 +36,40 @@
}
}
+/**
+ @param name The file name
+ @return Number of bytes in buffer
+*/
+int
+file_to_buffer(char** buffer, char* name)
+{
+ struct stat stats;
+ int error = stat(name, &stats);
+ if (error)
+ return -1;
+ int length = stats.st_size;
+
+ FILE* file = fopen(name, "r");
+ if (!file)
+ {
+ return -1;
+ }
+
+ *buffer = malloc(length);
+
+ int total = 0;
+
+ while (total < length)
+ {
+ int chunk = length-total;
+ int actual = fread((*buffer)+total, 1, chunk, file);
+ total += actual;
+ }
+
+ return total;
+}
+
+
void
eat_whitespace(FILE* stream)
{
Modified: test/driver/test-cmd-get.c
===================================================================
--- test/driver/test-cmd-get.c 2010-05-12 20:17:35 UTC (rev 107)
+++ test/driver/test-cmd-get.c 2010-05-12 20:44:33 UTC (rev 108)
@@ -37,6 +37,7 @@
int length;
code = fscanf(from_cmpi, "%i\n", &length);
+ printf("length: %i\n");
if (code != 1)
crash("No response from driver!");
// printf("length: %i code: %i \n", length, code);
Modified: test/mpi_tools/module.mk.in
===================================================================
--- test/mpi_tools/module.mk.in 2010-05-12 20:17:35 UTC (rev 107)
+++ test/mpi_tools/module.mk.in 2010-05-12 20:44:33 UTC (rev 108)
@@ -12,7 +12,7 @@
$(DIR)/test%.out: test/mpi_tools/test%.x
$(Q) " TEST $(@) "
- $(E)$(LAUNCH) -n 3 $(<) > $(@) 2>&1
+ $(E) $(<) > $(@) 2>&1
$(DIR)/test%.x: test/mpi_tools/test%.o $(MPITOOLS_OBJS)
$(Q) " LINK $(@) "
Added: test/mpi_tools/test-file.c
===================================================================
--- test/mpi_tools/test-file.c (rev 0)
+++ test/mpi_tools/test-file.c 2010-05-12 20:44:33 UTC (rev 108)
@@ -0,0 +1,31 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <mpi.h>
+
+#include <io_tools.h>
+#include <mpi_tools.h>
+
+int
+main(int argc, char* argv[])
+{
+ MPI_Init(&argc, &argv);
+
+ char* buffer;
+
+ int total = file_to_buffer(&buffer, "setup.sh");
+
+ //printf("got buffer: %i\n", total);
+
+ if (total < 0)
+ exit(1);
+
+ fwrite(buffer, sizeof(char), total, stdout);
+ //printdata("data: ", buffer, 4);
+ //printf("\n");
+
+ MPI_Finalize();
+
+ return 0;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|