Triton-commits
Threads by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
March 2012
- 1 participants
- 118 discussions
Triton Repository branch, master, updated. 562fb9724ca3d57a00e8c803692b8c70f7e5bce9
by noreply@mcs.anl.gov 05 Mar '12
by noreply@mcs.anl.gov 05 Mar '12
05 Mar '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Triton Repository".
The branch, master has been updated
via 562fb9724ca3d57a00e8c803692b8c70f7e5bce9 (commit)
via 98a79cf8205216d99887e62bb05860e8fede06f7 (commit)
from 5abd6398b0c74a3bbf76826446d6262a03f683ee (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 562fb9724ca3d57a00e8c803692b8c70f7e5bce9
Author: Justin M Wozniak <wozniak(a)mcs.anl.gov>
Date: Mon Mar 5 15:46:51 2012 -0600
Fix note
commit 98a79cf8205216d99887e62bb05860e8fede06f7
Author: Justin M Wozniak <wozniak(a)mcs.anl.gov>
Date: Mon Mar 5 15:45:03 2012 -0600
Rename "test" directories to "tests" (#185)
-----------------------------------------------------------------------
Summary of changes:
code/Makefile.in | 16 +-
code/configure.ac | 26 +-
.../asciidoc-8.6.3/tests/data/testcases.txt | 2 +-
code/maint/check.sh | 13 +
code/maint/collect.sh | 18 +
code/maint/ditaa/ditaa0_9.jar | Bin 186095 -> 186103 bytes
.../common/resources/aesocket/test/module.mk.in | 4 -
.../common/resources/aesocket/tests/module.mk.in | 4 +
.../resources/aesocket/{test => tests}/simple.ae | 0
.../resources/branch-threader/test/module.mk.in | 4 -
.../branch-threader/{test => tests}/abt-example.ae | 0
.../resources/branch-threader/tests/module.mk.in | 4 +
.../common/resources/scheduling/test/module.mk.in | 11 -
.../scheduling/{test => tests}/coalesce.ae | 0
.../scheduling/{test => tests}/limitqueue.ae | 0
.../common/resources/scheduling/tests/module.mk.in | 11 +
.../scheduling/{test => tests}/pthread-compare.ae | 0
.../scheduling/{test => tests}/sched-cancel.ae | 0
code/src/common/resources/signal/test/module.mk.in | 5 -
.../src/common/resources/signal/tests/module.mk.in | 5 +
.../resources/signal/{test => tests}/simple.ae | 0
code/src/common/resources/timer/test/module.mk.in | 8 -
code/src/common/resources/timer/tests/module.mk.in | 8 +
.../timer/{test => tests}/pthread-compare.ae | 0
.../timer/{test => tests}/timer-cancel.ae | 0
.../resources/timer/{test => tests}/timer1.ae | 0
.../resources/timer/{test => tests}/timer2.ae | 0
code/src/fakess/test/engine1.sh | 19 -
code/src/fakess/test/module.mk.in | 48 --
code/src/fakess/test/post-global.sh | 19 -
code/src/fakess/test/shutdown.ae | 79 ---
code/src/fakess/test/shutdown.sh | 21 -
code/src/fakess/{test => tests}/announce.ae | 0
code/src/fakess/{test => tests}/announce1.ae | 0
code/src/fakess/{test => tests}/announce2.ae | 0
code/src/fakess/{test => tests}/engine1.ae | 0
code/src/fakess/tests/engine1.sh | 19 +
.../src/fakess/{test => tests}/hostlist-contains.c | 0
code/src/fakess/{test => tests}/hostlist1.c | 0
code/src/fakess/{test => tests}/hostlist2.c | 0
code/src/fakess/{test => tests}/hosts.txt | 0
code/src/fakess/{test => tests}/hosts1.txt | 0
code/src/fakess/{test => tests}/hosts2.txt | 0
code/src/fakess/{test => tests}/local.ae | 0
code/src/fakess/{test => tests}/local.sh | 0
code/src/fakess/tests/module.mk.in | 48 ++
code/src/fakess/{test => tests}/observer.ae | 0
code/src/fakess/{test => tests}/post-global.ae | 0
code/src/fakess/tests/post-global.sh | 19 +
code/src/fakess/tests/shutdown.ae | 79 +++
code/src/fakess/tests/shutdown.sh | 21 +
code/src/fakess/{test => tests}/testbqueue1.ae | 0
code/src/fakess/{test => tests}/testbqueue2.ae | 0
code/src/kv/test/kvtest.c | 595 --------------------
code/src/kv/test/module.mk.in | 31 -
code/src/kv/tests/kvtest.c | 595 ++++++++++++++++++++
code/src/kv/tests/module.mk.in | 31 +
code/src/kv/{test => tests}/nb-barrier.c | 0
code/src/kv/{test => tests}/nb-barrier.h | 0
code/src/kv/{test => tests}/simpletest.c | 0
code/src/kv/{test => tests}/stats.c | 0
code/src/kv/{test => tests}/stats.h | 0
code/src/kv/{test => tests}/test-common.c | 0
code/src/kv/{test => tests}/test-common.h | 0
code/src/mapping/test/module.mk.in | 27 -
code/src/mapping/{test => tests}/dump.ae | 0
code/src/mapping/{test => tests}/dump.sh | 0
code/src/mapping/{test => tests}/faulty2.txt | 0
code/src/mapping/{test => tests}/hostmap1.ae | 0
code/src/mapping/{test => tests}/hosts1a.txt | 0
code/src/mapping/{test => tests}/hosts1b.txt | 0
code/src/mapping/{test => tests}/hosts2.txt | 0
code/src/mapping/{test => tests}/hosts8-s.txt | 0
code/src/mapping/{test => tests}/hosts8.txt | 0
code/src/mapping/tests/module.mk.in | 27 +
code/src/net/mpi/test/module.mk.in | 30 -
.../src/net/mpi/{test => tests}/aesop-mpi-bench.ae | 0
code/src/net/mpi/tests/module.mk.in | 30 +
code/src/net/mpi/{test => tests}/mpi-bench.h | 0
code/src/net/mpi/{test => tests}/noop-bench.ae | 0
.../src/net/mpi/{test => tests}/pthread-compare.ae | 0
code/src/net/mpi/{test => tests}/send-recv.ae | 0
code/src/net/test/module.mk.in | 17 -
code/src/net/{test => tests}/mock-client-server.ae | 0
code/src/net/tests/module.mk.in | 17 +
code/src/net/{test => tests}/mpi-client-server.ae | 0
code/src/net/{test => tests}/mpi-server.ae | 0
code/src/placement/test/hostmap2.sh | 46 --
code/src/placement/test/module.mk.in | 54 --
code/src/placement/{test => tests}/exchange-ids.ae | 0
code/src/placement/{test => tests}/hostmap1.c | 0
code/src/placement/{test => tests}/hostmap2.ae | 0
code/src/placement/tests/hostmap2.sh | 46 ++
code/src/placement/tests/module.mk.in | 54 ++
code/src/placement/{test => tests}/post-node-id.ae | 0
code/src/placement/{test => tests}/query.ae | 0
code/src/placement/{test => tests}/subtract.ae | 0
code/src/placement/{test => tests}/testhash.c | 0
code/src/socket/test/echo-server.ae | 237 --------
code/src/socket/test/module.mk.in | 6 -
code/src/socket/tests/echo-server.ae | 237 ++++++++
code/src/socket/{test => tests}/echo-server.h | 0
code/src/socket/tests/module.mk.in | 6 +
code/src/state/state.ae | 6 -
code/src/state/test/engine1.sh | 19 -
code/src/state/test/module.mk.in | 106 ----
code/src/state/test/post-global.sh | 19 -
code/src/state/test/rosd-recover.sh | 24 -
code/src/state/test/rosd-test-funcs.ae | 134 -----
code/src/state/test/rpc-global.sh | 22 -
code/src/state/test/rpc-list.sh | 28 -
code/src/state/test/rpc-size.sh | 20 -
code/src/state/test/shutdown.ae | 132 -----
code/src/state/test/shutdown.sh | 19 -
code/src/state/{test => tests}/engine1.ae | 0
code/src/state/tests/engine1.sh | 19 +
code/src/state/{test => tests}/local.ae | 0
code/src/state/{test => tests}/local.sh | 0
code/src/state/tests/module.mk.in | 106 ++++
code/src/state/{test => tests}/post-global.ae | 0
code/src/state/tests/post-global.sh | 19 +
code/src/state/{test => tests}/rosd-injection.ae | 0
code/src/state/{test => tests}/rosd-injection.sh | 0
code/src/state/{test => tests}/rosd-recover.ae | 0
code/src/state/tests/rosd-recover.sh | 24 +
code/src/state/{test => tests}/rosd-start.ae | 0
code/src/state/{test => tests}/rosd-start.sh | 0
code/src/state/{test => tests}/rpc-global.ae | 0
code/src/state/tests/rpc-global.sh | 22 +
code/src/state/{test => tests}/rpc-list.ae | 0
code/src/state/tests/rpc-list.sh | 28 +
code/src/state/{test => tests}/rpc-size.ae | 0
code/src/state/tests/rpc-size.sh | 20 +
code/src/state/tests/shutdown.ae | 132 +++++
code/src/state/tests/shutdown.sh | 19 +
code/src/state/{test => tests}/state-client.ae | 0
136 files changed, 1710 insertions(+), 1805 deletions(-)
create mode 100755 code/maint/check.sh
create mode 100755 code/maint/collect.sh
delete mode 100644 code/src/common/resources/aesocket/test/module.mk.in
create mode 100644 code/src/common/resources/aesocket/tests/module.mk.in
rename code/src/common/resources/aesocket/{test => tests}/simple.ae (100%)
delete mode 100644 code/src/common/resources/branch-threader/test/module.mk.in
rename code/src/common/resources/branch-threader/{test => tests}/abt-example.ae (100%)
create mode 100644 code/src/common/resources/branch-threader/tests/module.mk.in
delete mode 100644 code/src/common/resources/scheduling/test/module.mk.in
rename code/src/common/resources/scheduling/{test => tests}/coalesce.ae (100%)
rename code/src/common/resources/scheduling/{test => tests}/limitqueue.ae (100%)
create mode 100644 code/src/common/resources/scheduling/tests/module.mk.in
rename code/src/common/resources/scheduling/{test => tests}/pthread-compare.ae (100%)
rename code/src/common/resources/scheduling/{test => tests}/sched-cancel.ae (100%)
delete mode 100644 code/src/common/resources/signal/test/module.mk.in
create mode 100644 code/src/common/resources/signal/tests/module.mk.in
rename code/src/common/resources/signal/{test => tests}/simple.ae (100%)
delete mode 100644 code/src/common/resources/timer/test/module.mk.in
create mode 100644 code/src/common/resources/timer/tests/module.mk.in
rename code/src/common/resources/timer/{test => tests}/pthread-compare.ae (100%)
rename code/src/common/resources/timer/{test => tests}/timer-cancel.ae (100%)
rename code/src/common/resources/timer/{test => tests}/timer1.ae (100%)
rename code/src/common/resources/timer/{test => tests}/timer2.ae (100%)
delete mode 100755 code/src/fakess/test/engine1.sh
delete mode 100644 code/src/fakess/test/module.mk.in
delete mode 100755 code/src/fakess/test/post-global.sh
delete mode 100644 code/src/fakess/test/shutdown.ae
delete mode 100755 code/src/fakess/test/shutdown.sh
rename code/src/fakess/{test => tests}/announce.ae (100%)
rename code/src/fakess/{test => tests}/announce1.ae (100%)
rename code/src/fakess/{test => tests}/announce2.ae (100%)
rename code/src/fakess/{test => tests}/engine1.ae (100%)
create mode 100755 code/src/fakess/tests/engine1.sh
rename code/src/fakess/{test => tests}/hostlist-contains.c (100%)
rename code/src/fakess/{test => tests}/hostlist1.c (100%)
rename code/src/fakess/{test => tests}/hostlist2.c (100%)
rename code/src/fakess/{test => tests}/hosts.txt (100%)
rename code/src/fakess/{test => tests}/hosts1.txt (100%)
rename code/src/fakess/{test => tests}/hosts2.txt (100%)
rename code/src/fakess/{test => tests}/local.ae (100%)
rename code/src/fakess/{test => tests}/local.sh (100%)
create mode 100644 code/src/fakess/tests/module.mk.in
rename code/src/fakess/{test => tests}/observer.ae (100%)
rename code/src/fakess/{test => tests}/post-global.ae (100%)
create mode 100755 code/src/fakess/tests/post-global.sh
create mode 100644 code/src/fakess/tests/shutdown.ae
create mode 100755 code/src/fakess/tests/shutdown.sh
rename code/src/fakess/{test => tests}/testbqueue1.ae (100%)
rename code/src/fakess/{test => tests}/testbqueue2.ae (100%)
delete mode 100644 code/src/kv/test/kvtest.c
delete mode 100644 code/src/kv/test/module.mk.in
create mode 100644 code/src/kv/tests/kvtest.c
create mode 100644 code/src/kv/tests/module.mk.in
rename code/src/kv/{test => tests}/nb-barrier.c (100%)
rename code/src/kv/{test => tests}/nb-barrier.h (100%)
rename code/src/kv/{test => tests}/simpletest.c (100%)
rename code/src/kv/{test => tests}/stats.c (100%)
rename code/src/kv/{test => tests}/stats.h (100%)
rename code/src/kv/{test => tests}/test-common.c (100%)
rename code/src/kv/{test => tests}/test-common.h (100%)
delete mode 100644 code/src/mapping/test/module.mk.in
rename code/src/mapping/{test => tests}/dump.ae (100%)
rename code/src/mapping/{test => tests}/dump.sh (100%)
rename code/src/mapping/{test => tests}/faulty2.txt (100%)
rename code/src/mapping/{test => tests}/hostmap1.ae (100%)
rename code/src/mapping/{test => tests}/hosts1a.txt (100%)
rename code/src/mapping/{test => tests}/hosts1b.txt (100%)
rename code/src/mapping/{test => tests}/hosts2.txt (100%)
rename code/src/mapping/{test => tests}/hosts8-s.txt (100%)
rename code/src/mapping/{test => tests}/hosts8.txt (100%)
create mode 100644 code/src/mapping/tests/module.mk.in
delete mode 100644 code/src/net/mpi/test/module.mk.in
rename code/src/net/mpi/{test => tests}/aesop-mpi-bench.ae (100%)
create mode 100644 code/src/net/mpi/tests/module.mk.in
rename code/src/net/mpi/{test => tests}/mpi-bench.h (100%)
rename code/src/net/mpi/{test => tests}/noop-bench.ae (100%)
rename code/src/net/mpi/{test => tests}/pthread-compare.ae (100%)
rename code/src/net/mpi/{test => tests}/send-recv.ae (100%)
delete mode 100644 code/src/net/test/module.mk.in
rename code/src/net/{test => tests}/mock-client-server.ae (100%)
create mode 100644 code/src/net/tests/module.mk.in
rename code/src/net/{test => tests}/mpi-client-server.ae (100%)
rename code/src/net/{test => tests}/mpi-server.ae (100%)
delete mode 100755 code/src/placement/test/hostmap2.sh
delete mode 100644 code/src/placement/test/module.mk.in
rename code/src/placement/{test => tests}/exchange-ids.ae (100%)
rename code/src/placement/{test => tests}/hostmap1.c (100%)
rename code/src/placement/{test => tests}/hostmap2.ae (100%)
create mode 100755 code/src/placement/tests/hostmap2.sh
create mode 100644 code/src/placement/tests/module.mk.in
rename code/src/placement/{test => tests}/post-node-id.ae (100%)
rename code/src/placement/{test => tests}/query.ae (100%)
rename code/src/placement/{test => tests}/subtract.ae (100%)
rename code/src/placement/{test => tests}/testhash.c (100%)
delete mode 100644 code/src/socket/test/echo-server.ae
delete mode 100644 code/src/socket/test/module.mk.in
create mode 100644 code/src/socket/tests/echo-server.ae
rename code/src/socket/{test => tests}/echo-server.h (100%)
create mode 100644 code/src/socket/tests/module.mk.in
delete mode 100755 code/src/state/test/engine1.sh
delete mode 100644 code/src/state/test/module.mk.in
delete mode 100755 code/src/state/test/post-global.sh
delete mode 100755 code/src/state/test/rosd-recover.sh
delete mode 100644 code/src/state/test/rosd-test-funcs.ae
delete mode 100755 code/src/state/test/rpc-global.sh
delete mode 100755 code/src/state/test/rpc-list.sh
delete mode 100755 code/src/state/test/rpc-size.sh
delete mode 100644 code/src/state/test/shutdown.ae
delete mode 100755 code/src/state/test/shutdown.sh
rename code/src/state/{test => tests}/engine1.ae (100%)
create mode 100755 code/src/state/tests/engine1.sh
rename code/src/state/{test => tests}/local.ae (100%)
rename code/src/state/{test => tests}/local.sh (100%)
create mode 100644 code/src/state/tests/module.mk.in
rename code/src/state/{test => tests}/post-global.ae (100%)
create mode 100755 code/src/state/tests/post-global.sh
rename code/src/state/{test => tests}/rosd-injection.ae (100%)
rename code/src/state/{test => tests}/rosd-injection.sh (100%)
rename code/src/state/{test => tests}/rosd-recover.ae (100%)
create mode 100755 code/src/state/tests/rosd-recover.sh
rename code/src/state/{test => tests}/rosd-start.ae (100%)
rename code/src/state/{test => tests}/rosd-start.sh (100%)
rename code/src/state/{test => tests}/rpc-global.ae (100%)
create mode 100755 code/src/state/tests/rpc-global.sh
rename code/src/state/{test => tests}/rpc-list.ae (100%)
create mode 100755 code/src/state/tests/rpc-list.sh
rename code/src/state/{test => tests}/rpc-size.ae (100%)
create mode 100755 code/src/state/tests/rpc-size.sh
create mode 100644 code/src/state/tests/shutdown.ae
create mode 100755 code/src/state/tests/shutdown.sh
rename code/src/state/{test => tests}/state-client.ae (100%)
Diff of changes:
diff --git a/code/Makefile.in b/code/Makefile.in
index a174290..f9ab3f6 100644
--- a/code/Makefile.in
+++ b/code/Makefile.in
@@ -663,7 +663,8 @@ clean::
$(E)rm -f $(AEOBJS) $(LIBOBJS) $(GENLIBOBJS) $(AETEST) $(AEPROGRAM) $(TEST) $(PROGRAM) \
$(AESOP_TRHDR) $(TESTLIBOBJS) \
$(LIBRARIES) $(TEST_LIBRARIES) $(DEPENDS) $(TEST_RESULTS) $(TEST_OUT) \
- $(REMOTE_MOD_GENFILES) $(REMOTE_OBJS) $(INTERM) $(REMOTE_MODULES_DUMMIES)
+ $(REMOTE_MOD_GENFILES) $(REMOTE_OBJS) $(INTERM) $(REMOTE_MODULES_DUMMIES) \
+ deps_contents.txt
parserclean::
$(Q) " PARSER CLEAN"
@@ -695,6 +696,19 @@ etags:
-regex ".*\.\(c\|h\|ae\|hae\|aer\|haer\)" -print \
| xargs etags
+# check_includes: Checks your *.d files for missing/mistyped file names
+# Always do a make clean to remove *.d before using check_includes
+
+EXISTING_D = $(shell find . -name *.d)
+
+check_includes: deps_contents.txt
+ $(Q) " CHECK.SH"
+ $(E) $(srcdir)/maint/check.sh deps_contents.txt
+
+deps_contents.txt:
+ $(Q) " SH $(@)"
+ $(E) $(srcdir)/maint/collect.sh $(@) $(EXISTING_D)
+
#%.txt: %.doc
# $(srcdir)/maint/handle-ditaa.py -j $(srcdir)/maint/ditaa/ditaa.jar -d $(dir $@) $< > $@
#
diff --git a/code/configure.ac b/code/configure.ac
index 6206e32..a6574e8 100644
--- a/code/configure.ac
+++ b/code/configure.ac
@@ -374,18 +374,18 @@ AC_OUTPUT([Makefile
src/common/module.mk
src/common/libev/module.mk
src/common/tests/module.mk
-src/common/resources/timer/test/module.mk
+src/common/resources/timer/tests/module.mk
src/common/resources/timer/module.mk
src/common/resources/scheduling/module.mk
-src/common/resources/scheduling/test/module.mk
+src/common/resources/scheduling/tests/module.mk
src/common/resources/aesocket/module.mk
-src/common/resources/aesocket/test/module.mk
+src/common/resources/aesocket/tests/module.mk
src/common/resources/branch-threader/module.mk
-src/common/resources/branch-threader/test/module.mk
+src/common/resources/branch-threader/tests/module.mk
src/net/module.mk
-src/net/test/module.mk
+src/net/tests/module.mk
src/net/mpi/module.mk
-src/net/mpi/test/module.mk
+src/net/mpi/tests/module.mk
src/net/fault-injector/module.mk
src/remote/module.mk
src/remote/tests/module.mk
@@ -400,24 +400,24 @@ src/transactional-osd/tests/module.mk
src/common/resources/bdb/module.mk
src/common/resources/file/module.mk
src/common/resources/signal/module.mk
-src/common/resources/signal/test/module.mk
+src/common/resources/signal/tests/module.mk
src/replicated-osd/module.mk
src/replicated-osd/tests/module.mk
src/mapping/module.mk
-src/mapping/test/module.mk
+src/mapping/tests/module.mk
src/state/module.mk
-src/state/test/module.mk
+src/state/tests/module.mk
src/fakess/module.mk
-src/fakess/test/module.mk
+src/fakess/tests/module.mk
src/placement/module.mk
-src/placement/test/module.mk
+src/placement/tests/module.mk
src/rebuild/module.mk
src/zeroconf/module.mk
src/net/mock/module.mk
src/kv/module.mk
-src/kv/test/module.mk
+src/kv/tests/module.mk
src/socket/module.mk
-src/socket/test/module.mk
+src/socket/tests/module.mk
doc/module.mk
doc/resilience/module.mk
doc/resilience/resilience-book.txt
diff --git a/code/maint/asciidoc/asciidoc-8.6.3/tests/data/testcases.txt b/code/maint/asciidoc/asciidoc-8.6.3/tests/data/testcases.txt
index 3555f2b..214095d 100644
--- a/code/maint/asciidoc/asciidoc-8.6.3/tests/data/testcases.txt
+++ b/code/maint/asciidoc/asciidoc-8.6.3/tests/data/testcases.txt
@@ -175,7 +175,7 @@ Link to <<X3>> anchor.
An example link to a bibliography entry <<Test::Unit>>.
[horizontal]
-[[[Test::Unit]]]:: http://ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html
+[[[Test::Unit]]]:: http://ruby-doc.org/stdlib/libdoc/tests/unit/rdoc/classes/Test/Unit.html
== Titles ==
diff --git a/code/maint/check.sh b/code/maint/check.sh
new file mode 100755
index 0000000..02824c3
--- /dev/null
+++ b/code/maint/check.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# Input: FILE containing list of file names
+# Output: Warning for each file name that does not exist
+
+# Used to check for the presence of include files
+
+FILE=$1
+
+for f in $( cat ${FILE} )
+do
+ test -e ${f} || echo "Not found: ${f}"
+done
diff --git a/code/maint/collect.sh b/code/maint/collect.sh
new file mode 100755
index 0000000..33482dc
--- /dev/null
+++ b/code/maint/collect.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Take the single-word tokens from the given *.d files
+# one per line in an output file
+
+OUTPUT=$1
+shift
+INPUT=${*}
+
+# Puts one word per line; strip spaces, backslash, colon
+# Strip out object files *.o, *.po, and dependency files *.d
+# Make unique
+
+cat ${INPUT} | \
+ fmt -w 1 | cut -f 1 | \
+ sed 's/ //g;s/\\//g;s/://g' | \
+ grep -v '.*\.o\>\|.*\.po\>\|.*\.d\>' | \
+ sort -u > ${OUTPUT}
diff --git a/code/maint/ditaa/ditaa0_9.jar b/code/maint/ditaa/ditaa0_9.jar
index 5894de4..ef7f9aa 100644
Binary files a/code/maint/ditaa/ditaa0_9.jar and b/code/maint/ditaa/ditaa0_9.jar differ
diff --git a/code/src/common/resources/aesocket/test/module.mk.in b/code/src/common/resources/aesocket/test/module.mk.in
deleted file mode 100644
index 4377688..0000000
--- a/code/src/common/resources/aesocket/test/module.mk.in
+++ /dev/null
@@ -1,4 +0,0 @@
-DIR := src/common/resources/aesocket/test
-
-AETESTSRC += $(DIR)/simple.ae
-
diff --git a/code/src/common/resources/aesocket/tests/module.mk.in b/code/src/common/resources/aesocket/tests/module.mk.in
new file mode 100644
index 0000000..d2fe840
--- /dev/null
+++ b/code/src/common/resources/aesocket/tests/module.mk.in
@@ -0,0 +1,4 @@
+DIR := src/common/resources/aesocket/tests
+
+AETESTSRC += $(DIR)/simple.ae
+
diff --git a/code/src/common/resources/aesocket/test/simple.ae b/code/src/common/resources/aesocket/tests/simple.ae
similarity index 100%
rename from code/src/common/resources/aesocket/test/simple.ae
rename to code/src/common/resources/aesocket/tests/simple.ae
diff --git a/code/src/common/resources/branch-threader/test/module.mk.in b/code/src/common/resources/branch-threader/test/module.mk.in
deleted file mode 100644
index 49c0a95..0000000
--- a/code/src/common/resources/branch-threader/test/module.mk.in
+++ /dev/null
@@ -1,4 +0,0 @@
-DIR := src/common/resources/branch-threader/test
-
-AETESTSRC += $(DIR)/abt-example.ae
-
diff --git a/code/src/common/resources/branch-threader/test/abt-example.ae b/code/src/common/resources/branch-threader/tests/abt-example.ae
similarity index 100%
rename from code/src/common/resources/branch-threader/test/abt-example.ae
rename to code/src/common/resources/branch-threader/tests/abt-example.ae
diff --git a/code/src/common/resources/branch-threader/tests/module.mk.in b/code/src/common/resources/branch-threader/tests/module.mk.in
new file mode 100644
index 0000000..6412e5c
--- /dev/null
+++ b/code/src/common/resources/branch-threader/tests/module.mk.in
@@ -0,0 +1,4 @@
+DIR := src/common/resources/branch-threader/tests
+
+AETESTSRC += $(DIR)/abt-example.ae
+
diff --git a/code/src/common/resources/scheduling/test/module.mk.in b/code/src/common/resources/scheduling/test/module.mk.in
deleted file mode 100644
index 4c44f76..0000000
--- a/code/src/common/resources/scheduling/test/module.mk.in
+++ /dev/null
@@ -1,11 +0,0 @@
-DIR := src/common/resources/scheduling/test
-
-AETESTSRC += $(DIR)/coalesce.ae \
- $(DIR)/limitqueue.ae \
- $(DIR)/pthread-compare.ae \
- $(DIR)/sched-cancel.ae
-
-MODLIBS_$(DIR)/pthread-compare = -lpthread
-MODLIBS_$(DIR)/coalesce = -lpthread
-MODLIBS_$(DIR)/limitqueue = -lpthread
-MODLIBS_$(DIR)/sched-cancel = -lpthread
diff --git a/code/src/common/resources/scheduling/test/coalesce.ae b/code/src/common/resources/scheduling/tests/coalesce.ae
similarity index 100%
rename from code/src/common/resources/scheduling/test/coalesce.ae
rename to code/src/common/resources/scheduling/tests/coalesce.ae
diff --git a/code/src/common/resources/scheduling/test/limitqueue.ae b/code/src/common/resources/scheduling/tests/limitqueue.ae
similarity index 100%
rename from code/src/common/resources/scheduling/test/limitqueue.ae
rename to code/src/common/resources/scheduling/tests/limitqueue.ae
diff --git a/code/src/common/resources/scheduling/tests/module.mk.in b/code/src/common/resources/scheduling/tests/module.mk.in
new file mode 100644
index 0000000..8ee3c4a
--- /dev/null
+++ b/code/src/common/resources/scheduling/tests/module.mk.in
@@ -0,0 +1,11 @@
+DIR := src/common/resources/scheduling/tests
+
+AETESTSRC += $(DIR)/coalesce.ae \
+ $(DIR)/limitqueue.ae \
+ $(DIR)/pthread-compare.ae \
+ $(DIR)/sched-cancel.ae
+
+MODLIBS_$(DIR)/pthread-compare = -lpthread
+MODLIBS_$(DIR)/coalesce = -lpthread
+MODLIBS_$(DIR)/limitqueue = -lpthread
+MODLIBS_$(DIR)/sched-cancel = -lpthread
diff --git a/code/src/common/resources/scheduling/test/pthread-compare.ae b/code/src/common/resources/scheduling/tests/pthread-compare.ae
similarity index 100%
rename from code/src/common/resources/scheduling/test/pthread-compare.ae
rename to code/src/common/resources/scheduling/tests/pthread-compare.ae
diff --git a/code/src/common/resources/scheduling/test/sched-cancel.ae b/code/src/common/resources/scheduling/tests/sched-cancel.ae
similarity index 100%
rename from code/src/common/resources/scheduling/test/sched-cancel.ae
rename to code/src/common/resources/scheduling/tests/sched-cancel.ae
diff --git a/code/src/common/resources/signal/test/module.mk.in b/code/src/common/resources/signal/test/module.mk.in
deleted file mode 100644
index 50e4453..0000000
--- a/code/src/common/resources/signal/test/module.mk.in
+++ /dev/null
@@ -1,5 +0,0 @@
-DIR := src/common/resources/signal/test
-
-AETESTSRC += $(DIR)/simple.ae
-
-
diff --git a/code/src/common/resources/signal/tests/module.mk.in b/code/src/common/resources/signal/tests/module.mk.in
new file mode 100644
index 0000000..e88e3d6
--- /dev/null
+++ b/code/src/common/resources/signal/tests/module.mk.in
@@ -0,0 +1,5 @@
+DIR := src/common/resources/signal/tests
+
+AETESTSRC += $(DIR)/simple.ae
+
+
diff --git a/code/src/common/resources/signal/test/simple.ae b/code/src/common/resources/signal/tests/simple.ae
similarity index 100%
rename from code/src/common/resources/signal/test/simple.ae
rename to code/src/common/resources/signal/tests/simple.ae
diff --git a/code/src/common/resources/timer/test/module.mk.in b/code/src/common/resources/timer/test/module.mk.in
deleted file mode 100644
index 40b9fdf..0000000
--- a/code/src/common/resources/timer/test/module.mk.in
+++ /dev/null
@@ -1,8 +0,0 @@
-DIR := src/common/resources/timer/test
-
-AETESTSRC += $(DIR)/timer1.ae \
- $(DIR)/pthread-compare.ae \
- $(DIR)/timer2.ae \
- $(DIR)/timer-cancel.ae
-
-MODLIBS_$(DIR)/pthread-compare = -lpthread
diff --git a/code/src/common/resources/timer/tests/module.mk.in b/code/src/common/resources/timer/tests/module.mk.in
new file mode 100644
index 0000000..cb88cde
--- /dev/null
+++ b/code/src/common/resources/timer/tests/module.mk.in
@@ -0,0 +1,8 @@
+DIR := src/common/resources/timer/tests
+
+AETESTSRC += $(DIR)/timer1.ae \
+ $(DIR)/pthread-compare.ae \
+ $(DIR)/timer2.ae \
+ $(DIR)/timer-cancel.ae
+
+MODLIBS_$(DIR)/pthread-compare = -lpthread
diff --git a/code/src/common/resources/timer/test/pthread-compare.ae b/code/src/common/resources/timer/tests/pthread-compare.ae
similarity index 100%
rename from code/src/common/resources/timer/test/pthread-compare.ae
rename to code/src/common/resources/timer/tests/pthread-compare.ae
diff --git a/code/src/common/resources/timer/test/timer-cancel.ae b/code/src/common/resources/timer/tests/timer-cancel.ae
similarity index 100%
rename from code/src/common/resources/timer/test/timer-cancel.ae
rename to code/src/common/resources/timer/tests/timer-cancel.ae
diff --git a/code/src/common/resources/timer/test/timer1.ae b/code/src/common/resources/timer/tests/timer1.ae
similarity index 100%
rename from code/src/common/resources/timer/test/timer1.ae
rename to code/src/common/resources/timer/tests/timer1.ae
diff --git a/code/src/common/resources/timer/test/timer2.ae b/code/src/common/resources/timer/tests/timer2.ae
similarity index 100%
rename from code/src/common/resources/timer/test/timer2.ae
rename to code/src/common/resources/timer/tests/timer2.ae
diff --git a/code/src/fakess/test/engine1.sh b/code/src/fakess/test/engine1.sh
deleted file mode 100755
index 2d776f1..0000000
--- a/code/src/fakess/test/engine1.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-# Test with sorted input...
-mpiexec -l -n 4 ${BIN} ${SRCDIR}/src/mapping/test/hosts2.txt > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-LINES=$( grep "done" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 4 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/fakess/test/module.mk.in b/code/src/fakess/test/module.mk.in
deleted file mode 100644
index e3e8e19..0000000
--- a/code/src/fakess/test/module.mk.in
+++ /dev/null
@@ -1,48 +0,0 @@
-DIR := src/fakess/test
-
-FAKESS_TEST_SRC :=
-FAKESS_TEST_SRC += $(DIR)/local.ae
-FAKESS_TEST_SRC += $(DIR)/shutdown.ae
-FAKESS_TEST_SRC += $(DIR)/post-global.ae
-FAKESS_TEST_SRC += $(DIR)/engine1.ae
-
-FAKESS_TESTS = $(patsubst %.ae,%,$(FAKESS_TEST_SRC))
-
-fakess_tests: $(FAKESS_TESTS)
-
-AETESTSRC += $(FAKESS_TEST_SRC)
-
-FAKESS_TEST_RESULTS :=
-FAKESS_TEST_RESULTS += $(DIR)/local.result
-FAKESS_TEST_RESULTS += $(DIR)/shutdown.result
-FAKESS_TEST_RESULTS += $(DIR)/post-global.result
-FAKESS_TEST_RESULTS += $(DIR)/engine1.result
-
-TEST_RESULTS += $(FAKESS_TEST_RESULTS)
-
-fakess_test_results: $(FAKESS_TEST_RESULTS)
-
-TEST_OUT += $(patsubst %.result,%.out,$(FAKESS_TEST_RESULTS))
-
-MODLIBS_$(DIR)/testbqueue1 = -lpthread
-MODLIBS_$(DIR)/testbqueue2 = -lpthread
-
-MODCFLAGS_$(DIR)/local = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/local = $(MPILDFLAGS)
-MODLIBS_$(DIR)/local = $(MPILIBS)
-MODCC_$(DIR)/local = $(MPICC)
-
-MODCFLAGS_$(DIR)/shutdown = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/shutdown = $(MPILDFLAGS)
-MODLIBS_$(DIR)/shutdown = $(MPILIBS)
-MODCC_$(DIR)/shutdown = $(MPICC)
-
-MODCFLAGS_$(DIR)/post-global = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/post-global = $(MPILDFLAGS)
-MODLIBS_$(DIR)/post-global = $(MPILIBS)
-MODCC_$(DIR)/post-global = $(MPICC)
-
-MODCFLAGS_$(DIR)/engine1 = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/engine1 = $(MPILDFLAGS)
-MODLIBS_$(DIR)/engine1 = $(MPILIBS)
-MODCC_$(DIR)/engine1 = $(MPICC)
diff --git a/code/src/fakess/test/post-global.sh b/code/src/fakess/test/post-global.sh
deleted file mode 100755
index 2d776f1..0000000
--- a/code/src/fakess/test/post-global.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-# Test with sorted input...
-mpiexec -l -n 4 ${BIN} ${SRCDIR}/src/mapping/test/hosts2.txt > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-LINES=$( grep "done" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 4 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/fakess/test/shutdown.ae b/code/src/fakess/test/shutdown.ae
deleted file mode 100644
index 623b76c..0000000
--- a/code/src/fakess/test/shutdown.ae
+++ /dev/null
@@ -1,79 +0,0 @@
-
-/**
- Test fakess_shutdown()
- Example:
- mpiexec -l -n 3 src/fakess/test/shutdown src/mapping/test/hosts2.txt
-*/
-
-#include <stdbool.h>
-#include <stdio.h>
-#include "src/aesop/aesop.h"
-#include "src/common/triton-notify.h"
-#include "src/common/resources/timer/timer.hae"
-#include "src/net/mpi/mpi.hae"
-#include "src/fakess/fakess.hae"
-#include "src/mapping/mapping.hae"
-
-#include <sys/types.h>
-#include <unistd.h>
-
-static __blocking void sender()
-{
- printf("sender()...\n");
- printf("shutdown...\n");
- triton_fakess_shutdown();
-}
-
-static __blocking void receiver()
-{
- printf("receiver():\n");
- while (triton_fakess_running())
- {
- triton_fakess_recv();
- }
-}
-
-static __blocking int dostuff(char *hostlist)
-{
- int rank;
-
- triton_map_file(hostlist);
- triton_fakess_load_map();
-
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
- if (rank == 0)
- {
- sender();
- }
- else if (rank == 1)
- {
- receiver();
- }
- else
- {
- printf("client\n");
- }
-
- return 0;
-}
-
-__blocking int aesop_main(int argc, char **argv)
-{
- char *hostlist = NULL;
- assert(argc == 2);
- hostlist = argv[1];
- dostuff(hostlist);
- printf("done\n");
- return 0;
-}
-aesop_main_set_with_init(NULL, "triton.fakess", aesop_main,
- "sched", "timer", "mpi");
-
-/*
- * Local Variables:
- * c-basic-offset: 4
- * End:
- *
- * vim: ft=c ts=8 sts=4 sw=4 expandtab
- */
diff --git a/code/src/fakess/test/shutdown.sh b/code/src/fakess/test/shutdown.sh
deleted file mode 100755
index 170799f..0000000
--- a/code/src/fakess/test/shutdown.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-# Test with sorted input...
-HOSTS=${SRCDIR}/src/mapping/test/hosts2.txt
-mpiexec -l -n 3 ${VALGRIND} ${BIN} ${HOSTS} > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-LINES=$( tr ' ' '\n' < ${OUT} | grep "done" | wc -l )
-[[ ${?} == 0 ]] || exit 1
-[[ ${LINES} == 3 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/fakess/test/announce.ae b/code/src/fakess/tests/announce.ae
similarity index 100%
rename from code/src/fakess/test/announce.ae
rename to code/src/fakess/tests/announce.ae
diff --git a/code/src/fakess/test/announce1.ae b/code/src/fakess/tests/announce1.ae
similarity index 100%
rename from code/src/fakess/test/announce1.ae
rename to code/src/fakess/tests/announce1.ae
diff --git a/code/src/fakess/test/announce2.ae b/code/src/fakess/tests/announce2.ae
similarity index 100%
rename from code/src/fakess/test/announce2.ae
rename to code/src/fakess/tests/announce2.ae
diff --git a/code/src/fakess/test/engine1.ae b/code/src/fakess/tests/engine1.ae
similarity index 100%
rename from code/src/fakess/test/engine1.ae
rename to code/src/fakess/tests/engine1.ae
diff --git a/code/src/fakess/tests/engine1.sh b/code/src/fakess/tests/engine1.sh
new file mode 100755
index 0000000..bc388bc
--- /dev/null
+++ b/code/src/fakess/tests/engine1.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
+
+shopt -s extglob
+SCRIPT=$0
+BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
+OUT=${BIN}.out
+
+# Test with sorted input...
+mpiexec -l -n 4 ${BIN} ${SRCDIR}/src/mapping/tests/hosts2.txt > ${OUT} 2>&1
+[[ $? == 0 ]] || exit 1
+
+LINES=$( grep "done" ${OUT} | wc -l )
+[[ $? == 0 ]] || exit 1
+[[ ${LINES} == 4 ]] || exit 1
+
+echo OK
+exit 0
diff --git a/code/src/fakess/test/hostlist-contains.c b/code/src/fakess/tests/hostlist-contains.c
similarity index 100%
rename from code/src/fakess/test/hostlist-contains.c
rename to code/src/fakess/tests/hostlist-contains.c
diff --git a/code/src/fakess/test/hostlist1.c b/code/src/fakess/tests/hostlist1.c
similarity index 100%
rename from code/src/fakess/test/hostlist1.c
rename to code/src/fakess/tests/hostlist1.c
diff --git a/code/src/fakess/test/hostlist2.c b/code/src/fakess/tests/hostlist2.c
similarity index 100%
rename from code/src/fakess/test/hostlist2.c
rename to code/src/fakess/tests/hostlist2.c
diff --git a/code/src/fakess/test/hosts.txt b/code/src/fakess/tests/hosts.txt
similarity index 100%
rename from code/src/fakess/test/hosts.txt
rename to code/src/fakess/tests/hosts.txt
diff --git a/code/src/fakess/test/hosts1.txt b/code/src/fakess/tests/hosts1.txt
similarity index 100%
rename from code/src/fakess/test/hosts1.txt
rename to code/src/fakess/tests/hosts1.txt
diff --git a/code/src/fakess/test/hosts2.txt b/code/src/fakess/tests/hosts2.txt
similarity index 100%
rename from code/src/fakess/test/hosts2.txt
rename to code/src/fakess/tests/hosts2.txt
diff --git a/code/src/fakess/test/local.ae b/code/src/fakess/tests/local.ae
similarity index 100%
rename from code/src/fakess/test/local.ae
rename to code/src/fakess/tests/local.ae
diff --git a/code/src/fakess/test/local.sh b/code/src/fakess/tests/local.sh
similarity index 100%
rename from code/src/fakess/test/local.sh
rename to code/src/fakess/tests/local.sh
diff --git a/code/src/fakess/tests/module.mk.in b/code/src/fakess/tests/module.mk.in
new file mode 100644
index 0000000..5f49cc1
--- /dev/null
+++ b/code/src/fakess/tests/module.mk.in
@@ -0,0 +1,48 @@
+DIR := src/fakess/tests
+
+FAKESS_TEST_SRC :=
+FAKESS_TEST_SRC += $(DIR)/local.ae
+FAKESS_TEST_SRC += $(DIR)/shutdown.ae
+FAKESS_TEST_SRC += $(DIR)/post-global.ae
+FAKESS_TEST_SRC += $(DIR)/engine1.ae
+
+FAKESS_TESTS = $(patsubst %.ae,%,$(FAKESS_TEST_SRC))
+
+fakess_tests: $(FAKESS_TESTS)
+
+AETESTSRC += $(FAKESS_TEST_SRC)
+
+FAKESS_TEST_RESULTS :=
+FAKESS_TEST_RESULTS += $(DIR)/local.result
+FAKESS_TEST_RESULTS += $(DIR)/shutdown.result
+FAKESS_TEST_RESULTS += $(DIR)/post-global.result
+FAKESS_TEST_RESULTS += $(DIR)/engine1.result
+
+TEST_RESULTS += $(FAKESS_TEST_RESULTS)
+
+fakess_test_results: $(FAKESS_TEST_RESULTS)
+
+TEST_OUT += $(patsubst %.result,%.out,$(FAKESS_TEST_RESULTS))
+
+MODLIBS_$(DIR)/testbqueue1 = -lpthread
+MODLIBS_$(DIR)/testbqueue2 = -lpthread
+
+MODCFLAGS_$(DIR)/local = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/local = $(MPILDFLAGS)
+MODLIBS_$(DIR)/local = $(MPILIBS)
+MODCC_$(DIR)/local = $(MPICC)
+
+MODCFLAGS_$(DIR)/shutdown = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/shutdown = $(MPILDFLAGS)
+MODLIBS_$(DIR)/shutdown = $(MPILIBS)
+MODCC_$(DIR)/shutdown = $(MPICC)
+
+MODCFLAGS_$(DIR)/post-global = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/post-global = $(MPILDFLAGS)
+MODLIBS_$(DIR)/post-global = $(MPILIBS)
+MODCC_$(DIR)/post-global = $(MPICC)
+
+MODCFLAGS_$(DIR)/engine1 = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/engine1 = $(MPILDFLAGS)
+MODLIBS_$(DIR)/engine1 = $(MPILIBS)
+MODCC_$(DIR)/engine1 = $(MPICC)
diff --git a/code/src/fakess/test/observer.ae b/code/src/fakess/tests/observer.ae
similarity index 100%
rename from code/src/fakess/test/observer.ae
rename to code/src/fakess/tests/observer.ae
diff --git a/code/src/fakess/test/post-global.ae b/code/src/fakess/tests/post-global.ae
similarity index 100%
rename from code/src/fakess/test/post-global.ae
rename to code/src/fakess/tests/post-global.ae
diff --git a/code/src/fakess/tests/post-global.sh b/code/src/fakess/tests/post-global.sh
new file mode 100755
index 0000000..bc388bc
--- /dev/null
+++ b/code/src/fakess/tests/post-global.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
+
+shopt -s extglob
+SCRIPT=$0
+BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
+OUT=${BIN}.out
+
+# Test with sorted input...
+mpiexec -l -n 4 ${BIN} ${SRCDIR}/src/mapping/tests/hosts2.txt > ${OUT} 2>&1
+[[ $? == 0 ]] || exit 1
+
+LINES=$( grep "done" ${OUT} | wc -l )
+[[ $? == 0 ]] || exit 1
+[[ ${LINES} == 4 ]] || exit 1
+
+echo OK
+exit 0
diff --git a/code/src/fakess/tests/shutdown.ae b/code/src/fakess/tests/shutdown.ae
new file mode 100644
index 0000000..967615d
--- /dev/null
+++ b/code/src/fakess/tests/shutdown.ae
@@ -0,0 +1,79 @@
+
+/**
+ Test fakess_shutdown()
+ Example:
+ mpiexec -l -n 3 src/fakess/tests/shutdown src/mapping/tests/hosts2.txt
+*/
+
+#include <stdbool.h>
+#include <stdio.h>
+#include "src/aesop/aesop.h"
+#include "src/common/triton-notify.h"
+#include "src/common/resources/timer/timer.hae"
+#include "src/net/mpi/mpi.hae"
+#include "src/fakess/fakess.hae"
+#include "src/mapping/mapping.hae"
+
+#include <sys/types.h>
+#include <unistd.h>
+
+static __blocking void sender()
+{
+ printf("sender()...\n");
+ printf("shutdown...\n");
+ triton_fakess_shutdown();
+}
+
+static __blocking void receiver()
+{
+ printf("receiver():\n");
+ while (triton_fakess_running())
+ {
+ triton_fakess_recv();
+ }
+}
+
+static __blocking int dostuff(char *hostlist)
+{
+ int rank;
+
+ triton_map_file(hostlist);
+ triton_fakess_load_map();
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+ if (rank == 0)
+ {
+ sender();
+ }
+ else if (rank == 1)
+ {
+ receiver();
+ }
+ else
+ {
+ printf("client\n");
+ }
+
+ return 0;
+}
+
+__blocking int aesop_main(int argc, char **argv)
+{
+ char *hostlist = NULL;
+ assert(argc == 2);
+ hostlist = argv[1];
+ dostuff(hostlist);
+ printf("done\n");
+ return 0;
+}
+aesop_main_set_with_init(NULL, "triton.fakess", aesop_main,
+ "sched", "timer", "mpi");
+
+/*
+ * Local Variables:
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ft=c ts=8 sts=4 sw=4 expandtab
+ */
diff --git a/code/src/fakess/tests/shutdown.sh b/code/src/fakess/tests/shutdown.sh
new file mode 100755
index 0000000..7f2df69
--- /dev/null
+++ b/code/src/fakess/tests/shutdown.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
+
+shopt -s extglob
+shopt -s extglob
+SCRIPT=$0
+BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
+OUT=${BIN}.out
+
+# Test with sorted input...
+HOSTS=${SRCDIR}/src/mapping/tests/hosts2.txt
+mpiexec -l -n 3 ${VALGRIND} ${BIN} ${HOSTS} > ${OUT} 2>&1
+[[ $? == 0 ]] || exit 1
+
+LINES=$( tr ' ' '\n' < ${OUT} | grep "done" | wc -l )
+[[ ${?} == 0 ]] || exit 1
+[[ ${LINES} == 3 ]] || exit 1
+
+echo OK
+exit 0
diff --git a/code/src/fakess/test/testbqueue1.ae b/code/src/fakess/tests/testbqueue1.ae
similarity index 100%
rename from code/src/fakess/test/testbqueue1.ae
rename to code/src/fakess/tests/testbqueue1.ae
diff --git a/code/src/fakess/test/testbqueue2.ae b/code/src/fakess/tests/testbqueue2.ae
similarity index 100%
rename from code/src/fakess/test/testbqueue2.ae
rename to code/src/fakess/tests/testbqueue2.ae
diff --git a/code/src/kv/test/kvtest.c b/code/src/kv/test/kvtest.c
deleted file mode 100644
index 1d30e2f..0000000
--- a/code/src/kv/test/kvtest.c
+++ /dev/null
@@ -1,595 +0,0 @@
-#include <stdio.h>
-#include <mpi.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "src/common/triton-init.h"
-#include "src/kv/test/test-common.h"
-#include "src/kv/test/nb-barrier.h"
-#include "src/kv/test/stats.h"
-
-#include "src/kv/kv.h"
-
-/* TODO: for now use some small range number
- value like 1024 creates out of memory error */
-size_t opt_loops = 128;
-
-static size_t opt_servers = 1;
-static int opt_verbose = 0;
-static int opt_hybrid = 0;
-static int opt_benchmark_value_len = 256;
-
-static void error (const char * str)
-{
- fprintf (stderr, "%s", str);
- MPI_Abort (MPI_COMM_WORLD, 1);
-}
-
-void write0 (int rank, const char * str, ...);
-
-
-void write0 (int rank, const char * str, ...)
-{
- if (rank)
- return;
-
- va_list va;
- va_start (va, str);
- vfprintf (stdout, str, va);
- va_end (va);
- fflush (stdout);
-}
-
-void write0v (int rank, const char * str, ...);
-
-void write0v (int rank, const char * str, ...)
-{
- if (rank || !opt_verbose)
- return;
-
- va_list va;
- va_start (va, str);
- vfprintf (stdout, str, va);
- va_end (va);
- fflush (stdout);
-}
-
-void writev (const char * str, ...);
-void writev (const char * str, ...)
-{
- if (!opt_verbose)
- return;
-
- va_list va;
- va_start (va, str);
- vfprintf (stdout, str, va);
- va_end (va);
- fflush (stdout);
-}
-
-/**
- * One node puts a key, and as soon as the put call returns another node tries
- * to read.
- */
-static void strong_consistency_test (MPI_Comm comm, int commrank, int commsize)
-{
- char key[128];
- char data[1024];
- char data2[1024];
-
- size_t keysize;
- generateKV (0, 1, &key[0], sizeof(key), &keysize, &data[0], sizeof(data));
-
- write0 (commrank, "Starting consistency test...");
-
- size_t i;
- size_t loops;
- for (loops = 0; loops < opt_loops; ++loops)
- {
- for (i=0; i<commsize; ++i)
- {
- MPI_Barrier (comm);
- if (i==commrank)
- {
- check_triton_ret (triton_kv_put (&key[0], &data[0], sizeof(data)));
- }
-
- MPI_Barrier (comm);
-
- size_t getsize = sizeof(data);
- check_triton_ret (triton_kv_get (&key[0], &data2[0], &getsize));
-
- if (getsize != sizeof(data))
- error ("Keyval was truncated in consistency test?");
-
- if (memcmp (&data2[0], &data[0], sizeof(data)))
- error ("Data corrupted in consistency test");
-
- MPI_Barrier (comm);
-
- if (i == commrank)
- {
- triton_kv_remove (&key[0]);
- }
- }
- write0 (commrank, ".");
- }
-
- write0 (commrank, "done\n");
-}
-
-static void do_correctness_test (MPI_Comm comm, int commrank, int commsize)
-{
- write0 (commrank, "Testing if there is strong consistency");
-
- char key[128];
- char data[1024];
- size_t i;
-
- MPI_Barrier (comm);
-
- for (i=0; i<opt_loops; ++i)
- {
- size_t keysize;
- generateKV (commrank, i, &key[0], sizeof(key), &keysize, &data[0], sizeof(data));
- triton_kv_put (&key[0], &data[0], sizeof(data));
-
- }
-
- MPI_Barrier (comm);
-
-}
-
-static void mt_test (MPI_Comm comm, int commrank, int commsize)
-{
- write0 (commrank, "Testing if interface is multithread safe...\n");
-}
-
-static void atomic_put_test (MPI_Comm comm, int commrank, int commsize)
-{
- char key[128];
- char data[1024];
- size_t i;
-
- write0 (commrank, "Testing if kv_put is atomic\n");
-
- MPI_Barrier (comm);
-
- for (i=0; i<opt_loops; ++i)
- {
- size_t keysize;
- size_t getsize = sizeof(data);
-
- generateKV (commrank, i, &key[0], sizeof(key), &keysize, &data[0],
- sizeof(data));
- check_triton_ret (triton_kv_put (&key[0], &data[0], sizeof(data)));
- check_triton_ret (triton_kv_get (&key[0], &data[0], &getsize));
- }
-
- MPI_Barrier (comm);
-}
-
-static void simple_test (MPI_Comm comm, int commrank, int commsize)
-{
- char key[128];
- char data[1024];
- char data2[1024];
- size_t data2size;
- size_t keysize;
- size_t i;
-
- MPI_Barrier (comm);
- write0 (commrank, "Simple basic functionality test...\n");
- MPI_Barrier (comm);
- write0 (commrank, "Testing if kv_put works... ");
- MPI_Barrier (comm);
-
- for (i=0; i<opt_loops; ++i)
- {
- generateKV (commrank, i, &key[0], sizeof(key), &keysize, &data[0],
- sizeof(data));
- check_triton_ret (triton_kv_put (&key[0], &data[0], sizeof(data)));
- }
-
- MPI_Barrier (comm);
- write0 (commrank, "done\n");
- MPI_Barrier (comm);
- write0 (commrank, "Testing if kv_get works... ");
- MPI_Barrier (comm);
-
- for (i=0; i<opt_loops; ++i)
- {
- generateKV (commrank, i, &key[0], sizeof(key), &keysize, &data[0],
- sizeof(data));
- data2size = sizeof(data2);
- check_triton_ret (triton_kv_get (&key[0], &data2[0], &data2size));
- if (data2size != sizeof(data2))
- {
- error ("kv_get returned truncated data");
- }
- if (memcmp (&data[0], &data2[0], sizeof(data)))
- {
- error ("kv_get returned incorrect data");
- }
- }
-
- MPI_Barrier (comm);
- write0 (commrank, "done\n");
-
- write0 (commrank, "Testing if kv_remove works... ");
-
- for (i=0; i<opt_loops; ++i)
- {
- generateKV (commrank, i, &key[0], sizeof(key), &keysize, &data[0],
- sizeof(data));
- check_triton_ret (triton_kv_remove (&key[0]));
-
- // Check if we can remove the same key twice
- if (triton_kv_remove (&key[0]) == TRITON_SUCCESS)
- {
- error ("triton_kv_remove removed failed");
- }
-
- // Check if we can read a removed key
- data2size = sizeof (data2);
- if (triton_kv_get (&key[0], &data[0], &data2size) == TRITON_SUCCESS)
- {
- error ("triton_kv_get retrieved nonexistent key");
- }
- }
-
- write0 (commrank, "done\n");
-
- MPI_Barrier (comm);
-}
-
-static void dotest (MPI_Comm comm)
-{
-}
-
-static void server_main (MPI_Comm globalcomm, MPI_Comm comm)
-{
- MPI_Barrier (globalcomm);
-
- int commrank;
- int commsize;
-
- MPI_Comm_rank (comm, &commrank);
- MPI_Comm_size (comm, &commsize);
-
- writev ("Rank %i server starting\n", commrank);
-
- triton_kv_server_start_and_wait();
-
- writev ("Rank %i server done\n", commrank);
- MPI_Barrier (globalcomm);
-}
-
-static void client_main (MPI_Comm globalcomm, MPI_Comm comm)
-{
- MPI_Barrier (globalcomm);
-
- int commrank;
- int commsize;
-
- MPI_Comm_rank (comm, &commrank);
- MPI_Comm_size (comm, &commsize);
-
- simple_test (comm, commrank, commsize);
- strong_consistency_test (comm, commrank, commsize);
- atomic_put_test (comm, commrank, commsize);
- mt_test (comm, commrank, commsize);
-
- if(commrank == 0)
- {
- write0v (commrank, "Shutting down KV servers...");
- triton_kv_server_stop();
- }
-
- MPI_Barrier (globalcomm);
-}
-
-static void test_nb_barrier (MPI_Comm comm)
-{
- nb_barrier_handle nbh;
- int commrank;
- int signal = 0;
-
- MPI_Comm_rank (comm, &commrank);
-
- write0 (commrank, "Testing nb barrier... ");
-
- nb_barrier_init (&nbh, comm);
-
- while (!nb_barrier_test (nbh))
- {
- if (!signal)
- {
- if (rand () % 10000 == 0)
- {
- writev ("S%i ", commrank);
- nb_barrier_signal (nbh);
- signal = 1;
- }
- else
- usleep (1000);
- }
- }
-
- writev ("C%i ", commrank);
-
- nb_barrier_destroy (&nbh);
-
- fflush (stdout);
- fflush (stderr);
-
- MPI_Barrier (comm);
- write0 (commrank, "ok!\n");
-
-}
-
-inline static unsigned int safe_store (void * buf, unsigned int val)
-{
- char * ptr = (char*) buf;
- unsigned int i;
- for (i=0; i<sizeof(val)*2; ++i)
- {
- *ptr++ = 0xf0 | (val & 0x0f);
- val >>= 4;
- }
- return ptr - (char*) buf;
-}
-
-static unsigned int fast_generate_key (unsigned int seed, unsigned int iter, void *
- buf, unsigned int bufsize)
-{
- assert (bufsize >= (sizeof(int)*4));
- char * ptr = (char*) buf;
- ptr += safe_store (ptr, seed);
- ptr += safe_store (ptr, iter);
- return ((char*) ptr - (char*) buf);
-}
-
-static void fast_generate_data (void * data, unsigned int size)
-{
- memset (data, 1, size);
-}
-
-static void speedtest (MPI_Comm comm, int commrank, int commsize)
-{
- char key[128];
- const int datalen = opt_benchmark_value_len;
- char * data = malloc (datalen);
- double start, stop;
-
- unsigned int keylen = fast_generate_key (0, 0, &key[0], sizeof(key));
- fast_generate_data (data, datalen);
-
- MPI_Barrier (comm);
- write0 (commrank, "Starting benchmark...\n");
- write0 (commrank, "key length = %i\n", keylen);
- write0 (commrank, "value length = %i\n", opt_benchmark_value_len);
-
- stats_handle s_put;
- stats_handle s_get;
- stats_handle s_remove;
-
- stats_create (&s_put, "put", comm);
- stats_create (&s_get, "get", comm);
- stats_create (&s_remove, "remove", comm);
-
- MPI_Barrier (comm);
- write0 (commrank, "Benchmarking kv_put... ");
-
- unsigned int i;
- for (i=0; i<opt_loops; ++i)
- {
- fast_generate_key (commrank, i, &key[0], sizeof(key));
- start = MPI_Wtime ();
- check_triton_ret (triton_kv_put (&key[0], data, datalen));
- stop = MPI_Wtime ();
- stats_report (s_put, stop-start);
- }
-
- MPI_Barrier (comm);
- write0 (commrank, "done\n");
-
- MPI_Barrier (comm);
- write0 (commrank, "Benchmarking kv_get... ");
-
- size_t getlen = datalen;
- for (i=0; i<opt_loops; ++i)
- {
- fast_generate_key (commrank, i, &key[0], sizeof(key));
- start = MPI_Wtime ();
- check_triton_ret (triton_kv_get (&key[0], data, &getlen));
- stop = MPI_Wtime ();
- assert (getlen == datalen);
- stats_report (s_get, stop-start);
- }
-
- MPI_Barrier (comm);
- write0 (commrank, "done\n");
-
-
- MPI_Barrier (comm);
- write0 (commrank, "Benchmarking kv_remove... ");
-
- for (i=0; i<opt_loops; ++i)
- {
- fast_generate_key (commrank, i, &key[0], sizeof(key));
- start = MPI_Wtime ();
- check_triton_ret (triton_kv_remove (&key[0]));
- stop = MPI_Wtime ();
- stats_report (s_remove, stop-start);
- }
-
- MPI_Barrier (comm);
- write0 (commrank, "done\n");
-
- free (data);
-
- write0 (commrank, "Benchmark results:\n");
- stats_finalize (s_put);
- stats_finalize (s_get);
- stats_finalize (s_remove);
- if (!commrank)
- {
- stats_show_header (s_put);
- stats_show (s_put);
- stats_show (s_get);
- stats_show (s_remove);
- }
- write0 (commrank, "\n");
- MPI_Barrier (comm);
- stats_destroy(&s_put);
- stats_destroy(&s_get);
- stats_destroy(&s_remove);
-}
-
-static void hybridtest ()
-{
- int commrank;
- int commsize;
- kv_op_id id;
- triton_ret_t ret;
-
- MPI_Comm_rank (MPI_COMM_WORLD, &commrank);
- MPI_Comm_size (MPI_COMM_WORLD, &commsize);
-
- char buf[256];
- sprintf (buf, "/tmp/tosd-%i", commrank);
- triton_kv_init (commsize, buf);
-
- ret = triton_kv_server_start(&id);
- assert(ret == TRITON_SUCCESS);
-
- simple_test (MPI_COMM_WORLD, commrank, commsize);
- speedtest (MPI_COMM_WORLD, commrank, commsize);
-
- if(commrank == 0)
- {
- write0v (commrank, "Shutting down KV servers...");
- triton_kv_server_stop();
- }
-
- ret = triton_kv_server_wait(id);
- assert(ret == TRITON_SUCCESS);
-}
-
-int main (int argc, char ** args)
-{
- int flags, opt;
- int nsecs, tfnd;
-
- nsecs = 0;
- tfnd = 0;
- flags = 0;
- while ((opt = getopt(argc, args, "l:mvs:")) != -1)
- {
- switch (opt)
- {
- case 'l':
- opt_loops = atoi(optarg);
- break;
- case 's':
- opt_servers = atoi(optarg);
- break;
- case 'v':
- opt_verbose = 1;
- break;
- case 'm':
- opt_hybrid = 1;
- break;
- default: /* '?' */
- fprintf(stderr, "Usage: %s [-s servers] [-v] [-m]\n",
- args[0]);
- fprintf(stderr, " -v verbose\n");
- fprintf(stderr, " -m hybrid mode (client=server)\n");
- exit(EXIT_FAILURE);
- }
- }
-
- if (optind < argc)
- {
- fprintf (stderr, "Extra arguments on commandline??\n");
- exit (EXIT_FAILURE);
- }
-
- int level;
- MPI_Init_thread (0, 0, MPI_THREAD_MULTIPLE, &level);
- assert (level == MPI_THREAD_MULTIPLE);
-
- //test_nb_barrier (MPI_COMM_WORLD);
-
- int commsize;
- int commrank;
- MPI_Comm_size (MPI_COMM_WORLD, &commsize);
- MPI_Comm_rank (MPI_COMM_WORLD, &commrank);
-
- if (commsize == 1 || opt_hybrid)
- {
- if (commsize == 1)
- {
- write0 (commrank, "Only one process; Forcing hybrid mode\n");
- }
- write0 (commrank, "Hybrid mode: each client is also a server\n");
- hybridtest ();
-
- /* ============================================= */
- triton_kv_finalize ();
- /* ============================================= */
-
- MPI_Barrier (MPI_COMM_WORLD);
- }
- else
- {
- if (!opt_servers || ((opt_servers) >= commsize))
- {
- error ("Invalid number of servers specified!"
- " (or not enough ranks available)\n");
- }
-
- /* ===================================================================== */
-
- write0v (commrank, "Running in verbose mode\n");
- write0v (commrank, "Running with %u ranks, %u server(s), %u client(s)\n",
- commsize, opt_servers, commsize-opt_servers);
-
- int is_server = (commrank < opt_servers);
- MPI_Comm splitcomm;
- MPI_Comm_split (MPI_COMM_WORLD, (is_server ? 0 : 1), commrank, &splitcomm);
-
- /* ============================================= */
- write0v (commrank, "Initializing KV store...\n");
- char buf[128];
- sprintf (buf, "/tmp/tosd-%u", commrank);
- triton_kv_init (opt_servers, buf);
- /* ============================================= */
-
- MPI_Barrier (MPI_COMM_WORLD);
- write0 (commrank, "Starting test...\n");
- MPI_Barrier (MPI_COMM_WORLD);
-
- if (is_server)
- server_main (MPI_COMM_WORLD, splitcomm);
- else
- client_main (MPI_COMM_WORLD, splitcomm);
-
- MPI_Barrier (MPI_COMM_WORLD);
- write0 (commrank, "Test ended...\n");
- MPI_Barrier (MPI_COMM_WORLD);
-
- /* ============================================= */
- triton_kv_finalize ();
- /* ============================================= */
-
- MPI_Barrier (splitcomm);
-
- MPI_Comm_free (&splitcomm);
-
- }
- MPI_Finalize ();
-
- return EXIT_SUCCESS;
-}
diff --git a/code/src/kv/test/module.mk.in b/code/src/kv/test/module.mk.in
deleted file mode 100644
index aff1343..0000000
--- a/code/src/kv/test/module.mk.in
+++ /dev/null
@@ -1,31 +0,0 @@
-DIR := src/kv/test
-
-KV_TESTS :=
-KV_TEST_SRC :=
-
-TESTLIBSRC += $(DIR)/test-common.c
-
-KV_TESTS += $(DIR)/simpletest.c
-MODCFLAGS_$(DIR)/simpletest = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/simpletest = $(MPILDFLAGS)
-MODLIBS_$(DIR)/simpletest = $(MPILIBS) -lpthread
-MODCC_$(DIR)/simpletest = $(MPICC)
-
-
-ifeq ($(BUILD_MPI),1)
-
-TESTLIBSRC += $(DIR)/nb-barrier.c $(DIR)/stats.c
-
-KV_TESTS += $(DIR)/kvtest.c
-MODCFLAGS_$(DIR)/kvtest = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/kvtest = $(MPILDFLAGS)
-MODLIBS_$(DIR)/kvtest = $(MPILIBS) -lpthread
-MODCC_$(DIR)/kvtest = $(MPICC)
-
-endif
-
-TESTSRC += $(KV_TESTS)
-
-.phony: kv_tests
-kv_tests: $(DIR)/simpletest $(DIR)/kvtest
-
diff --git a/code/src/kv/tests/kvtest.c b/code/src/kv/tests/kvtest.c
new file mode 100644
index 0000000..0ece6bc
--- /dev/null
+++ b/code/src/kv/tests/kvtest.c
@@ -0,0 +1,595 @@
+#include <stdio.h>
+#include <mpi.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "src/common/triton-init.h"
+#include "src/kv/tests/test-common.h"
+#include "src/kv/tests/nb-barrier.h"
+#include "src/kv/tests/stats.h"
+
+#include "src/kv/kv.h"
+
+/* TODO: for now use some small range number
+ value like 1024 creates out of memory error */
+size_t opt_loops = 128;
+
+static size_t opt_servers = 1;
+static int opt_verbose = 0;
+static int opt_hybrid = 0;
+static int opt_benchmark_value_len = 256;
+
+static void error (const char * str)
+{
+ fprintf (stderr, "%s", str);
+ MPI_Abort (MPI_COMM_WORLD, 1);
+}
+
+void write0 (int rank, const char * str, ...);
+
+
+void write0 (int rank, const char * str, ...)
+{
+ if (rank)
+ return;
+
+ va_list va;
+ va_start (va, str);
+ vfprintf (stdout, str, va);
+ va_end (va);
+ fflush (stdout);
+}
+
+void write0v (int rank, const char * str, ...);
+
+void write0v (int rank, const char * str, ...)
+{
+ if (rank || !opt_verbose)
+ return;
+
+ va_list va;
+ va_start (va, str);
+ vfprintf (stdout, str, va);
+ va_end (va);
+ fflush (stdout);
+}
+
+void writev (const char * str, ...);
+void writev (const char * str, ...)
+{
+ if (!opt_verbose)
+ return;
+
+ va_list va;
+ va_start (va, str);
+ vfprintf (stdout, str, va);
+ va_end (va);
+ fflush (stdout);
+}
+
+/**
+ * One node puts a key, and as soon as the put call returns another node tries
+ * to read.
+ */
+static void strong_consistency_test (MPI_Comm comm, int commrank, int commsize)
+{
+ char key[128];
+ char data[1024];
+ char data2[1024];
+
+ size_t keysize;
+ generateKV (0, 1, &key[0], sizeof(key), &keysize, &data[0], sizeof(data));
+
+ write0 (commrank, "Starting consistency test...");
+
+ size_t i;
+ size_t loops;
+ for (loops = 0; loops < opt_loops; ++loops)
+ {
+ for (i=0; i<commsize; ++i)
+ {
+ MPI_Barrier (comm);
+ if (i==commrank)
+ {
+ check_triton_ret (triton_kv_put (&key[0], &data[0], sizeof(data)));
+ }
+
+ MPI_Barrier (comm);
+
+ size_t getsize = sizeof(data);
+ check_triton_ret (triton_kv_get (&key[0], &data2[0], &getsize));
+
+ if (getsize != sizeof(data))
+ error ("Keyval was truncated in consistency test?");
+
+ if (memcmp (&data2[0], &data[0], sizeof(data)))
+ error ("Data corrupted in consistency test");
+
+ MPI_Barrier (comm);
+
+ if (i == commrank)
+ {
+ triton_kv_remove (&key[0]);
+ }
+ }
+ write0 (commrank, ".");
+ }
+
+ write0 (commrank, "done\n");
+}
+
+static void do_correctness_test (MPI_Comm comm, int commrank, int commsize)
+{
+ write0 (commrank, "Testing if there is strong consistency");
+
+ char key[128];
+ char data[1024];
+ size_t i;
+
+ MPI_Barrier (comm);
+
+ for (i=0; i<opt_loops; ++i)
+ {
+ size_t keysize;
+ generateKV (commrank, i, &key[0], sizeof(key), &keysize, &data[0], sizeof(data));
+ triton_kv_put (&key[0], &data[0], sizeof(data));
+
+ }
+
+ MPI_Barrier (comm);
+
+}
+
+static void mt_test (MPI_Comm comm, int commrank, int commsize)
+{
+ write0 (commrank, "Testing if interface is multithread safe...\n");
+}
+
+static void atomic_put_test (MPI_Comm comm, int commrank, int commsize)
+{
+ char key[128];
+ char data[1024];
+ size_t i;
+
+ write0 (commrank, "Testing if kv_put is atomic\n");
+
+ MPI_Barrier (comm);
+
+ for (i=0; i<opt_loops; ++i)
+ {
+ size_t keysize;
+ size_t getsize = sizeof(data);
+
+ generateKV (commrank, i, &key[0], sizeof(key), &keysize, &data[0],
+ sizeof(data));
+ check_triton_ret (triton_kv_put (&key[0], &data[0], sizeof(data)));
+ check_triton_ret (triton_kv_get (&key[0], &data[0], &getsize));
+ }
+
+ MPI_Barrier (comm);
+}
+
+static void simple_test (MPI_Comm comm, int commrank, int commsize)
+{
+ char key[128];
+ char data[1024];
+ char data2[1024];
+ size_t data2size;
+ size_t keysize;
+ size_t i;
+
+ MPI_Barrier (comm);
+ write0 (commrank, "Simple basic functionality test...\n");
+ MPI_Barrier (comm);
+ write0 (commrank, "Testing if kv_put works... ");
+ MPI_Barrier (comm);
+
+ for (i=0; i<opt_loops; ++i)
+ {
+ generateKV (commrank, i, &key[0], sizeof(key), &keysize, &data[0],
+ sizeof(data));
+ check_triton_ret (triton_kv_put (&key[0], &data[0], sizeof(data)));
+ }
+
+ MPI_Barrier (comm);
+ write0 (commrank, "done\n");
+ MPI_Barrier (comm);
+ write0 (commrank, "Testing if kv_get works... ");
+ MPI_Barrier (comm);
+
+ for (i=0; i<opt_loops; ++i)
+ {
+ generateKV (commrank, i, &key[0], sizeof(key), &keysize, &data[0],
+ sizeof(data));
+ data2size = sizeof(data2);
+ check_triton_ret (triton_kv_get (&key[0], &data2[0], &data2size));
+ if (data2size != sizeof(data2))
+ {
+ error ("kv_get returned truncated data");
+ }
+ if (memcmp (&data[0], &data2[0], sizeof(data)))
+ {
+ error ("kv_get returned incorrect data");
+ }
+ }
+
+ MPI_Barrier (comm);
+ write0 (commrank, "done\n");
+
+ write0 (commrank, "Testing if kv_remove works... ");
+
+ for (i=0; i<opt_loops; ++i)
+ {
+ generateKV (commrank, i, &key[0], sizeof(key), &keysize, &data[0],
+ sizeof(data));
+ check_triton_ret (triton_kv_remove (&key[0]));
+
+ // Check if we can remove the same key twice
+ if (triton_kv_remove (&key[0]) == TRITON_SUCCESS)
+ {
+ error ("triton_kv_remove removed failed");
+ }
+
+ // Check if we can read a removed key
+ data2size = sizeof (data2);
+ if (triton_kv_get (&key[0], &data[0], &data2size) == TRITON_SUCCESS)
+ {
+ error ("triton_kv_get retrieved nonexistent key");
+ }
+ }
+
+ write0 (commrank, "done\n");
+
+ MPI_Barrier (comm);
+}
+
+static void dotest (MPI_Comm comm)
+{
+}
+
+static void server_main (MPI_Comm globalcomm, MPI_Comm comm)
+{
+ MPI_Barrier (globalcomm);
+
+ int commrank;
+ int commsize;
+
+ MPI_Comm_rank (comm, &commrank);
+ MPI_Comm_size (comm, &commsize);
+
+ writev ("Rank %i server starting\n", commrank);
+
+ triton_kv_server_start_and_wait();
+
+ writev ("Rank %i server done\n", commrank);
+ MPI_Barrier (globalcomm);
+}
+
+static void client_main (MPI_Comm globalcomm, MPI_Comm comm)
+{
+ MPI_Barrier (globalcomm);
+
+ int commrank;
+ int commsize;
+
+ MPI_Comm_rank (comm, &commrank);
+ MPI_Comm_size (comm, &commsize);
+
+ simple_test (comm, commrank, commsize);
+ strong_consistency_test (comm, commrank, commsize);
+ atomic_put_test (comm, commrank, commsize);
+ mt_test (comm, commrank, commsize);
+
+ if(commrank == 0)
+ {
+ write0v (commrank, "Shutting down KV servers...");
+ triton_kv_server_stop();
+ }
+
+ MPI_Barrier (globalcomm);
+}
+
+static void test_nb_barrier (MPI_Comm comm)
+{
+ nb_barrier_handle nbh;
+ int commrank;
+ int signal = 0;
+
+ MPI_Comm_rank (comm, &commrank);
+
+ write0 (commrank, "Testing nb barrier... ");
+
+ nb_barrier_init (&nbh, comm);
+
+ while (!nb_barrier_test (nbh))
+ {
+ if (!signal)
+ {
+ if (rand () % 10000 == 0)
+ {
+ writev ("S%i ", commrank);
+ nb_barrier_signal (nbh);
+ signal = 1;
+ }
+ else
+ usleep (1000);
+ }
+ }
+
+ writev ("C%i ", commrank);
+
+ nb_barrier_destroy (&nbh);
+
+ fflush (stdout);
+ fflush (stderr);
+
+ MPI_Barrier (comm);
+ write0 (commrank, "ok!\n");
+
+}
+
+inline static unsigned int safe_store (void * buf, unsigned int val)
+{
+ char * ptr = (char*) buf;
+ unsigned int i;
+ for (i=0; i<sizeof(val)*2; ++i)
+ {
+ *ptr++ = 0xf0 | (val & 0x0f);
+ val >>= 4;
+ }
+ return ptr - (char*) buf;
+}
+
+static unsigned int fast_generate_key (unsigned int seed, unsigned int iter, void *
+ buf, unsigned int bufsize)
+{
+ assert (bufsize >= (sizeof(int)*4));
+ char * ptr = (char*) buf;
+ ptr += safe_store (ptr, seed);
+ ptr += safe_store (ptr, iter);
+ return ((char*) ptr - (char*) buf);
+}
+
+static void fast_generate_data (void * data, unsigned int size)
+{
+ memset (data, 1, size);
+}
+
+static void speedtest (MPI_Comm comm, int commrank, int commsize)
+{
+ char key[128];
+ const int datalen = opt_benchmark_value_len;
+ char * data = malloc (datalen);
+ double start, stop;
+
+ unsigned int keylen = fast_generate_key (0, 0, &key[0], sizeof(key));
+ fast_generate_data (data, datalen);
+
+ MPI_Barrier (comm);
+ write0 (commrank, "Starting benchmark...\n");
+ write0 (commrank, "key length = %i\n", keylen);
+ write0 (commrank, "value length = %i\n", opt_benchmark_value_len);
+
+ stats_handle s_put;
+ stats_handle s_get;
+ stats_handle s_remove;
+
+ stats_create (&s_put, "put", comm);
+ stats_create (&s_get, "get", comm);
+ stats_create (&s_remove, "remove", comm);
+
+ MPI_Barrier (comm);
+ write0 (commrank, "Benchmarking kv_put... ");
+
+ unsigned int i;
+ for (i=0; i<opt_loops; ++i)
+ {
+ fast_generate_key (commrank, i, &key[0], sizeof(key));
+ start = MPI_Wtime ();
+ check_triton_ret (triton_kv_put (&key[0], data, datalen));
+ stop = MPI_Wtime ();
+ stats_report (s_put, stop-start);
+ }
+
+ MPI_Barrier (comm);
+ write0 (commrank, "done\n");
+
+ MPI_Barrier (comm);
+ write0 (commrank, "Benchmarking kv_get... ");
+
+ size_t getlen = datalen;
+ for (i=0; i<opt_loops; ++i)
+ {
+ fast_generate_key (commrank, i, &key[0], sizeof(key));
+ start = MPI_Wtime ();
+ check_triton_ret (triton_kv_get (&key[0], data, &getlen));
+ stop = MPI_Wtime ();
+ assert (getlen == datalen);
+ stats_report (s_get, stop-start);
+ }
+
+ MPI_Barrier (comm);
+ write0 (commrank, "done\n");
+
+
+ MPI_Barrier (comm);
+ write0 (commrank, "Benchmarking kv_remove... ");
+
+ for (i=0; i<opt_loops; ++i)
+ {
+ fast_generate_key (commrank, i, &key[0], sizeof(key));
+ start = MPI_Wtime ();
+ check_triton_ret (triton_kv_remove (&key[0]));
+ stop = MPI_Wtime ();
+ stats_report (s_remove, stop-start);
+ }
+
+ MPI_Barrier (comm);
+ write0 (commrank, "done\n");
+
+ free (data);
+
+ write0 (commrank, "Benchmark results:\n");
+ stats_finalize (s_put);
+ stats_finalize (s_get);
+ stats_finalize (s_remove);
+ if (!commrank)
+ {
+ stats_show_header (s_put);
+ stats_show (s_put);
+ stats_show (s_get);
+ stats_show (s_remove);
+ }
+ write0 (commrank, "\n");
+ MPI_Barrier (comm);
+ stats_destroy(&s_put);
+ stats_destroy(&s_get);
+ stats_destroy(&s_remove);
+}
+
+static void hybridtest ()
+{
+ int commrank;
+ int commsize;
+ kv_op_id id;
+ triton_ret_t ret;
+
+ MPI_Comm_rank (MPI_COMM_WORLD, &commrank);
+ MPI_Comm_size (MPI_COMM_WORLD, &commsize);
+
+ char buf[256];
+ sprintf (buf, "/tmp/tosd-%i", commrank);
+ triton_kv_init (commsize, buf);
+
+ ret = triton_kv_server_start(&id);
+ assert(ret == TRITON_SUCCESS);
+
+ simple_test (MPI_COMM_WORLD, commrank, commsize);
+ speedtest (MPI_COMM_WORLD, commrank, commsize);
+
+ if(commrank == 0)
+ {
+ write0v (commrank, "Shutting down KV servers...");
+ triton_kv_server_stop();
+ }
+
+ ret = triton_kv_server_wait(id);
+ assert(ret == TRITON_SUCCESS);
+}
+
+int main (int argc, char ** args)
+{
+ int flags, opt;
+ int nsecs, tfnd;
+
+ nsecs = 0;
+ tfnd = 0;
+ flags = 0;
+ while ((opt = getopt(argc, args, "l:mvs:")) != -1)
+ {
+ switch (opt)
+ {
+ case 'l':
+ opt_loops = atoi(optarg);
+ break;
+ case 's':
+ opt_servers = atoi(optarg);
+ break;
+ case 'v':
+ opt_verbose = 1;
+ break;
+ case 'm':
+ opt_hybrid = 1;
+ break;
+ default: /* '?' */
+ fprintf(stderr, "Usage: %s [-s servers] [-v] [-m]\n",
+ args[0]);
+ fprintf(stderr, " -v verbose\n");
+ fprintf(stderr, " -m hybrid mode (client=server)\n");
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (optind < argc)
+ {
+ fprintf (stderr, "Extra arguments on commandline??\n");
+ exit (EXIT_FAILURE);
+ }
+
+ int level;
+ MPI_Init_thread (0, 0, MPI_THREAD_MULTIPLE, &level);
+ assert (level == MPI_THREAD_MULTIPLE);
+
+ //test_nb_barrier (MPI_COMM_WORLD);
+
+ int commsize;
+ int commrank;
+ MPI_Comm_size (MPI_COMM_WORLD, &commsize);
+ MPI_Comm_rank (MPI_COMM_WORLD, &commrank);
+
+ if (commsize == 1 || opt_hybrid)
+ {
+ if (commsize == 1)
+ {
+ write0 (commrank, "Only one process; Forcing hybrid mode\n");
+ }
+ write0 (commrank, "Hybrid mode: each client is also a server\n");
+ hybridtest ();
+
+ /* ============================================= */
+ triton_kv_finalize ();
+ /* ============================================= */
+
+ MPI_Barrier (MPI_COMM_WORLD);
+ }
+ else
+ {
+ if (!opt_servers || ((opt_servers) >= commsize))
+ {
+ error ("Invalid number of servers specified!"
+ " (or not enough ranks available)\n");
+ }
+
+ /* ===================================================================== */
+
+ write0v (commrank, "Running in verbose mode\n");
+ write0v (commrank, "Running with %u ranks, %u server(s), %u client(s)\n",
+ commsize, opt_servers, commsize-opt_servers);
+
+ int is_server = (commrank < opt_servers);
+ MPI_Comm splitcomm;
+ MPI_Comm_split (MPI_COMM_WORLD, (is_server ? 0 : 1), commrank, &splitcomm);
+
+ /* ============================================= */
+ write0v (commrank, "Initializing KV store...\n");
+ char buf[128];
+ sprintf (buf, "/tmp/tosd-%u", commrank);
+ triton_kv_init (opt_servers, buf);
+ /* ============================================= */
+
+ MPI_Barrier (MPI_COMM_WORLD);
+ write0 (commrank, "Starting test...\n");
+ MPI_Barrier (MPI_COMM_WORLD);
+
+ if (is_server)
+ server_main (MPI_COMM_WORLD, splitcomm);
+ else
+ client_main (MPI_COMM_WORLD, splitcomm);
+
+ MPI_Barrier (MPI_COMM_WORLD);
+ write0 (commrank, "Test ended...\n");
+ MPI_Barrier (MPI_COMM_WORLD);
+
+ /* ============================================= */
+ triton_kv_finalize ();
+ /* ============================================= */
+
+ MPI_Barrier (splitcomm);
+
+ MPI_Comm_free (&splitcomm);
+
+ }
+ MPI_Finalize ();
+
+ return EXIT_SUCCESS;
+}
diff --git a/code/src/kv/tests/module.mk.in b/code/src/kv/tests/module.mk.in
new file mode 100644
index 0000000..fc1fffa
--- /dev/null
+++ b/code/src/kv/tests/module.mk.in
@@ -0,0 +1,31 @@
+DIR := src/kv/tests
+
+KV_TESTS :=
+KV_TEST_SRC :=
+
+TESTLIBSRC += $(DIR)/test-common.c
+
+KV_TESTS += $(DIR)/simpletest.c
+MODCFLAGS_$(DIR)/simpletest = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/simpletest = $(MPILDFLAGS)
+MODLIBS_$(DIR)/simpletest = $(MPILIBS) -lpthread
+MODCC_$(DIR)/simpletest = $(MPICC)
+
+
+ifeq ($(BUILD_MPI),1)
+
+TESTLIBSRC += $(DIR)/nb-barrier.c $(DIR)/stats.c
+
+KV_TESTS += $(DIR)/kvtest.c
+MODCFLAGS_$(DIR)/kvtest = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/kvtest = $(MPILDFLAGS)
+MODLIBS_$(DIR)/kvtest = $(MPILIBS) -lpthread
+MODCC_$(DIR)/kvtest = $(MPICC)
+
+endif
+
+TESTSRC += $(KV_TESTS)
+
+.phony: kv_tests
+kv_tests: $(DIR)/simpletest $(DIR)/kvtest
+
diff --git a/code/src/kv/test/nb-barrier.c b/code/src/kv/tests/nb-barrier.c
similarity index 100%
rename from code/src/kv/test/nb-barrier.c
rename to code/src/kv/tests/nb-barrier.c
diff --git a/code/src/kv/test/nb-barrier.h b/code/src/kv/tests/nb-barrier.h
similarity index 100%
rename from code/src/kv/test/nb-barrier.h
rename to code/src/kv/tests/nb-barrier.h
diff --git a/code/src/kv/test/simpletest.c b/code/src/kv/tests/simpletest.c
similarity index 100%
rename from code/src/kv/test/simpletest.c
rename to code/src/kv/tests/simpletest.c
diff --git a/code/src/kv/test/stats.c b/code/src/kv/tests/stats.c
similarity index 100%
rename from code/src/kv/test/stats.c
rename to code/src/kv/tests/stats.c
diff --git a/code/src/kv/test/stats.h b/code/src/kv/tests/stats.h
similarity index 100%
rename from code/src/kv/test/stats.h
rename to code/src/kv/tests/stats.h
diff --git a/code/src/kv/test/test-common.c b/code/src/kv/tests/test-common.c
similarity index 100%
rename from code/src/kv/test/test-common.c
rename to code/src/kv/tests/test-common.c
diff --git a/code/src/kv/test/test-common.h b/code/src/kv/tests/test-common.h
similarity index 100%
rename from code/src/kv/test/test-common.h
rename to code/src/kv/tests/test-common.h
diff --git a/code/src/mapping/test/module.mk.in b/code/src/mapping/test/module.mk.in
deleted file mode 100644
index 4ac93bc..0000000
--- a/code/src/mapping/test/module.mk.in
+++ /dev/null
@@ -1,27 +0,0 @@
-DIR := src/mapping/test
-
-MAPPING_TEST_SRC_AE :=
-MAPPING_TEST_SRC_C :=
-
-MAPPING_TEST_SRC_AE += $(DIR)/hostmap1.ae $(DIR)/dump.ae
-
-MAPPING_TESTS := $(patsubst %.ae,%,$(MAPPING_TEST_SRC_AE))
-
-MAPPING_TEST_RESULTS := $(DIR)/dump.result
-
-TEST_RESULTS += $(MAPPING_TEST_RESULTS)
-
-AETESTSRC += $(MAPPING_TEST_SRC_AE)
-
-TEST_OUT += $(DIR)/dump.out
-
-MODLIBS_$(DIR) = -lpthread
-
-MODCFLAGS_$(DIR)/hostmap1 = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/hostmap1 = $(MPILDFLAGS)
-MODLIBS_$(DIR)/hostmap1 = $(MPILIBS)
-MODCC_$(DIR)/hostmap1 = $(MPICC)
-
-mapping_tests: $(MAPPING_TESTS)
-
-mapping_test_results: $(MAPPING_TEST_RESULTS)
diff --git a/code/src/mapping/test/dump.ae b/code/src/mapping/tests/dump.ae
similarity index 100%
rename from code/src/mapping/test/dump.ae
rename to code/src/mapping/tests/dump.ae
diff --git a/code/src/mapping/test/dump.sh b/code/src/mapping/tests/dump.sh
similarity index 100%
rename from code/src/mapping/test/dump.sh
rename to code/src/mapping/tests/dump.sh
diff --git a/code/src/mapping/test/faulty2.txt b/code/src/mapping/tests/faulty2.txt
similarity index 100%
rename from code/src/mapping/test/faulty2.txt
rename to code/src/mapping/tests/faulty2.txt
diff --git a/code/src/mapping/test/hostmap1.ae b/code/src/mapping/tests/hostmap1.ae
similarity index 100%
rename from code/src/mapping/test/hostmap1.ae
rename to code/src/mapping/tests/hostmap1.ae
diff --git a/code/src/mapping/test/hosts1a.txt b/code/src/mapping/tests/hosts1a.txt
similarity index 100%
rename from code/src/mapping/test/hosts1a.txt
rename to code/src/mapping/tests/hosts1a.txt
diff --git a/code/src/mapping/test/hosts1b.txt b/code/src/mapping/tests/hosts1b.txt
similarity index 100%
rename from code/src/mapping/test/hosts1b.txt
rename to code/src/mapping/tests/hosts1b.txt
diff --git a/code/src/mapping/test/hosts2.txt b/code/src/mapping/tests/hosts2.txt
similarity index 100%
rename from code/src/mapping/test/hosts2.txt
rename to code/src/mapping/tests/hosts2.txt
diff --git a/code/src/mapping/test/hosts8-s.txt b/code/src/mapping/tests/hosts8-s.txt
similarity index 100%
rename from code/src/mapping/test/hosts8-s.txt
rename to code/src/mapping/tests/hosts8-s.txt
diff --git a/code/src/mapping/test/hosts8.txt b/code/src/mapping/tests/hosts8.txt
similarity index 100%
rename from code/src/mapping/test/hosts8.txt
rename to code/src/mapping/tests/hosts8.txt
diff --git a/code/src/mapping/tests/module.mk.in b/code/src/mapping/tests/module.mk.in
new file mode 100644
index 0000000..22d868b
--- /dev/null
+++ b/code/src/mapping/tests/module.mk.in
@@ -0,0 +1,27 @@
+DIR := src/mapping/tests
+
+MAPPING_TEST_SRC_AE :=
+MAPPING_TEST_SRC_C :=
+
+MAPPING_TEST_SRC_AE += $(DIR)/hostmap1.ae $(DIR)/dump.ae
+
+MAPPING_TESTS := $(patsubst %.ae,%,$(MAPPING_TEST_SRC_AE))
+
+MAPPING_TEST_RESULTS := $(DIR)/dump.result
+
+TEST_RESULTS += $(MAPPING_TEST_RESULTS)
+
+AETESTSRC += $(MAPPING_TEST_SRC_AE)
+
+TEST_OUT += $(DIR)/dump.out
+
+MODLIBS_$(DIR) = -lpthread
+
+MODCFLAGS_$(DIR)/hostmap1 = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/hostmap1 = $(MPILDFLAGS)
+MODLIBS_$(DIR)/hostmap1 = $(MPILIBS)
+MODCC_$(DIR)/hostmap1 = $(MPICC)
+
+mapping_tests: $(MAPPING_TESTS)
+
+mapping_test_results: $(MAPPING_TEST_RESULTS)
diff --git a/code/src/net/mpi/test/module.mk.in b/code/src/net/mpi/test/module.mk.in
deleted file mode 100644
index 5b03224..0000000
--- a/code/src/net/mpi/test/module.mk.in
+++ /dev/null
@@ -1,30 +0,0 @@
-DIR := src/net/mpi/test
-
-ifneq (,$(BUILD_MPI))
-
-AETESTSRC += $(DIR)/send-recv.ae \
- $(DIR)/pthread-compare.ae \
- $(DIR)/noop-bench.ae \
- $(DIR)/aesop-mpi-bench.ae
-
-MODCFLAGS_$(DIR)/send-recv = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/send-recv = $(MPILDFLAGS)
-MODLIBS_$(DIR)/send-recv = $(MPILIBS)
-MODCC_$(DIR)/send-recv = $(MPICC)
-
-MODCFLAGS_$(DIR)/pthread-compare = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/pthread-compare = $(MPILDFLAGS)
-MODLIBS_$(DIR)/pthread-compare = $(MPILIBS) -lpthread
-MODCC_$(DIR)/pthread-compare = $(MPICC)
-
-MODCFLAGS_$(DIR)/noop-bench = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/noop-bench = $(MPILDFLAGS)
-MODLIBS_$(DIR)/noop-bench = $(MPILIBS)
-MODCC_$(DIR)/noop-bench = $(MPICC)
-
-MODCFLAGS_$(DIR)/aesop-mpi-bench = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/aesop-mpi-bench = $(MPILDFLAGS)
-MODLIBS_$(DIR)/aesop-mpi-bench = $(MPILIBS)
-MODCC_$(DIR)/aesop-mpi-bench = $(MPICC)
-
-endif # BUILD_MPI
diff --git a/code/src/net/mpi/test/aesop-mpi-bench.ae b/code/src/net/mpi/tests/aesop-mpi-bench.ae
similarity index 100%
rename from code/src/net/mpi/test/aesop-mpi-bench.ae
rename to code/src/net/mpi/tests/aesop-mpi-bench.ae
diff --git a/code/src/net/mpi/tests/module.mk.in b/code/src/net/mpi/tests/module.mk.in
new file mode 100644
index 0000000..ca0f493
--- /dev/null
+++ b/code/src/net/mpi/tests/module.mk.in
@@ -0,0 +1,30 @@
+DIR := src/net/mpi/tests
+
+ifneq (,$(BUILD_MPI))
+
+AETESTSRC += $(DIR)/send-recv.ae \
+ $(DIR)/pthread-compare.ae \
+ $(DIR)/noop-bench.ae \
+ $(DIR)/aesop-mpi-bench.ae
+
+MODCFLAGS_$(DIR)/send-recv = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/send-recv = $(MPILDFLAGS)
+MODLIBS_$(DIR)/send-recv = $(MPILIBS)
+MODCC_$(DIR)/send-recv = $(MPICC)
+
+MODCFLAGS_$(DIR)/pthread-compare = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/pthread-compare = $(MPILDFLAGS)
+MODLIBS_$(DIR)/pthread-compare = $(MPILIBS) -lpthread
+MODCC_$(DIR)/pthread-compare = $(MPICC)
+
+MODCFLAGS_$(DIR)/noop-bench = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/noop-bench = $(MPILDFLAGS)
+MODLIBS_$(DIR)/noop-bench = $(MPILIBS)
+MODCC_$(DIR)/noop-bench = $(MPICC)
+
+MODCFLAGS_$(DIR)/aesop-mpi-bench = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/aesop-mpi-bench = $(MPILDFLAGS)
+MODLIBS_$(DIR)/aesop-mpi-bench = $(MPILIBS)
+MODCC_$(DIR)/aesop-mpi-bench = $(MPICC)
+
+endif # BUILD_MPI
diff --git a/code/src/net/mpi/test/mpi-bench.h b/code/src/net/mpi/tests/mpi-bench.h
similarity index 100%
rename from code/src/net/mpi/test/mpi-bench.h
rename to code/src/net/mpi/tests/mpi-bench.h
diff --git a/code/src/net/mpi/test/noop-bench.ae b/code/src/net/mpi/tests/noop-bench.ae
similarity index 100%
rename from code/src/net/mpi/test/noop-bench.ae
rename to code/src/net/mpi/tests/noop-bench.ae
diff --git a/code/src/net/mpi/test/pthread-compare.ae b/code/src/net/mpi/tests/pthread-compare.ae
similarity index 100%
rename from code/src/net/mpi/test/pthread-compare.ae
rename to code/src/net/mpi/tests/pthread-compare.ae
diff --git a/code/src/net/mpi/test/send-recv.ae b/code/src/net/mpi/tests/send-recv.ae
similarity index 100%
rename from code/src/net/mpi/test/send-recv.ae
rename to code/src/net/mpi/tests/send-recv.ae
diff --git a/code/src/net/test/module.mk.in b/code/src/net/test/module.mk.in
deleted file mode 100644
index 5c92e34..0000000
--- a/code/src/net/test/module.mk.in
+++ /dev/null
@@ -1,17 +0,0 @@
-
-DIR := src/net/test
-
-ifneq (,$(BUILD_MPI))
-
-AETESTSRC += $(DIR)/mpi-client-server.ae
-
-MODCFLAGS_$(DIR)/mpi-client-server = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/mpi-client-server = $(MPILDFLAGS)
-MODLIBS_$(DIR)/mpi-client-server = $(MPILIBS)
-MODCC_$(DIR)/mpi-client-server = $(MPICC)
-
-endif # BUILD_MPI
-
-AETESTSRC += $(DIR)/mock-client-server.ae
-
-MODLIBS_$(DIR)/mock-client-server = -lpthread
diff --git a/code/src/net/test/mock-client-server.ae b/code/src/net/tests/mock-client-server.ae
similarity index 100%
rename from code/src/net/test/mock-client-server.ae
rename to code/src/net/tests/mock-client-server.ae
diff --git a/code/src/net/tests/module.mk.in b/code/src/net/tests/module.mk.in
new file mode 100644
index 0000000..02fbd36
--- /dev/null
+++ b/code/src/net/tests/module.mk.in
@@ -0,0 +1,17 @@
+
+DIR := src/net/tests
+
+ifneq (,$(BUILD_MPI))
+
+AETESTSRC += $(DIR)/mpi-client-server.ae
+
+MODCFLAGS_$(DIR)/mpi-client-server = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/mpi-client-server = $(MPILDFLAGS)
+MODLIBS_$(DIR)/mpi-client-server = $(MPILIBS)
+MODCC_$(DIR)/mpi-client-server = $(MPICC)
+
+endif # BUILD_MPI
+
+AETESTSRC += $(DIR)/mock-client-server.ae
+
+MODLIBS_$(DIR)/mock-client-server = -lpthread
diff --git a/code/src/net/test/mpi-client-server.ae b/code/src/net/tests/mpi-client-server.ae
similarity index 100%
rename from code/src/net/test/mpi-client-server.ae
rename to code/src/net/tests/mpi-client-server.ae
diff --git a/code/src/net/test/mpi-server.ae b/code/src/net/tests/mpi-server.ae
similarity index 100%
rename from code/src/net/test/mpi-server.ae
rename to code/src/net/tests/mpi-server.ae
diff --git a/code/src/placement/test/hostmap2.sh b/code/src/placement/test/hostmap2.sh
deleted file mode 100755
index 26e82a3..0000000
--- a/code/src/placement/test/hostmap2.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-
-# Runs three tests
-
-check()
-{
- local OUT=$1
- local NODES=$2
- local CLOSEST=$3
-
- N=$( grep "map: node:" ${OUT} | wc -l )
- [[ ${N} == ${NODES} ]] || exit 1
-
- # Check lookup result:
- # sed command to find first line after "results:"
- FIRST_RESULT=$( sed -n '/results:/{n;p;}' ${OUT} )
- # sed command to strip white space from that line
- FIRST_RESULT=$( echo ${FIRST_RESULT} | sed -e 's/ //g' )
- [[ "${FIRST_RESULT}" == "${CLOSEST}" ]] || return 1
-
- return 0
-}
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-# Test with sorted input...
-${BIN} ${SRCDIR}/src/mapping/test/hosts8.txt > ${OUT} 2>&1 || exit 1
-check ${OUT} 8 0000000000000001.0000000000000000 || exit 1
-
-# Test with shuffled input...
-${BIN} ${SRCDIR}/src/mapping/test/hosts8-s.txt > ${OUT} 2>&1 || exit 1
-check ${OUT} 8 0000000000000001.0000000000000000 || exit 1
-
-# Test with insufficient input...
-${BIN} ${SRCDIR}/src/mapping/test/hosts1b.txt > ${OUT} 2>&1 || exit 1
-check ${OUT} 1 0000000000000001.0000000000000000 || exit 1
-grep TRITON_ERR_NO_SERVERS ${OUT} > /dev/null 2>&1 || exit 1
-
-echo OK
-
-exit 0
diff --git a/code/src/placement/test/module.mk.in b/code/src/placement/test/module.mk.in
deleted file mode 100644
index ca67c71..0000000
--- a/code/src/placement/test/module.mk.in
+++ /dev/null
@@ -1,54 +0,0 @@
-DIR := src/placement/test
-
-PLACEMENT_TEST_SRC += $(DIR)/subtract.ae
-PLACEMENT_TEST_SRC += $(DIR)/hostmap2.ae
-##PLACEMENT_TEST_SRC += $(DIR)/query.ae
-#PLACEMENT_TEST_SRC += $(DIR)/post-node-id.ae
-#PLACEMENT_TEST_SRC += $(DIR)/exchange-ids.ae
-
-PLACEMENT_TESTS = $(patsubst %.ae,%,$(PLACEMENT_TEST_SRC))
-
-placement_tests: $(PLACEMENT_TESTS)
-
-AETESTSRC += $(PLACEMENT_TEST_SRC)
-
-TESTSRC += $(DIR)/testhash.c
-
-PLACEMENT_TEST_RESULTS := $(DIR)/hostmap2.result
-TEST_RESULTS += $(PLACEMENT_TEST_RESULTS)
-
-placement_test_results: $(PLACEMENT_TEST_RESULTS)
-
-TEST_OUT += $(DIR)/hostmap2.out
-
-MODLIBS_$(DIR) = -lcrypto -lpthread
-
-MODCFLAGS_$(DIR)/query = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/query = $(MPILDFLAGS)
-MODLIBS_$(DIR)/query = $(MPILIBS)
-MODCC_$(DIR)/query = $(MPICC)
-
-MODCFLAGS_$(DIR)/subtract = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/subtract = $(MPILDFLAGS)
-MODLIBS_$(DIR)/subtract = $(MPILIBS)
-MODCC_$(DIR)/subtract = $(MPICC)
-
-MODCFLAGS_$(DIR)/post-node-id = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/post-node-id = $(MPILDFLAGS)
-MODLIBS_$(DIR)/post-node-id = $(MPILIBS)
-MODCC_$(DIR)/post-node-id = $(MPICC)
-
-MODCFLAGS_$(DIR)/exchange-ids = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/exchange-ids = $(MPILDFLAGS)
-MODLIBS_$(DIR)/exchange-ids = $(MPILIBS)
-MODCC_$(DIR)/exchange-ids = $(MPICC)
-
-MODCFLAGS_$(DIR)/hostmap1 = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/hostmap1 = $(MPILDFLAGS)
-MODLIBS_$(DIR)/hostmap1 = $(MPILIBS)
-MODCC_$(DIR)/hostmap1 = $(MPICC)
-
-MODCFLAGS_$(DIR)/hostmap2 = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/hostmap2 = $(MPILDFLAGS)
-MODLIBS_$(DIR)/hostmap2 = $(MPILIBS)
-MODCC_$(DIR)/hostmap2 = $(MPICC)
diff --git a/code/src/placement/test/exchange-ids.ae b/code/src/placement/tests/exchange-ids.ae
similarity index 100%
rename from code/src/placement/test/exchange-ids.ae
rename to code/src/placement/tests/exchange-ids.ae
diff --git a/code/src/placement/test/hostmap1.c b/code/src/placement/tests/hostmap1.c
similarity index 100%
rename from code/src/placement/test/hostmap1.c
rename to code/src/placement/tests/hostmap1.c
diff --git a/code/src/placement/test/hostmap2.ae b/code/src/placement/tests/hostmap2.ae
similarity index 100%
rename from code/src/placement/test/hostmap2.ae
rename to code/src/placement/tests/hostmap2.ae
diff --git a/code/src/placement/tests/hostmap2.sh b/code/src/placement/tests/hostmap2.sh
new file mode 100755
index 0000000..c6c393b
--- /dev/null
+++ b/code/src/placement/tests/hostmap2.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# Runs three tests
+
+check()
+{
+ local OUT=$1
+ local NODES=$2
+ local CLOSEST=$3
+
+ N=$( grep "map: node:" ${OUT} | wc -l )
+ [[ ${N} == ${NODES} ]] || exit 1
+
+ # Check lookup result:
+ # sed command to find first line after "results:"
+ FIRST_RESULT=$( sed -n '/results:/{n;p;}' ${OUT} )
+ # sed command to strip white space from that line
+ FIRST_RESULT=$( echo ${FIRST_RESULT} | sed -e 's/ //g' )
+ [[ "${FIRST_RESULT}" == "${CLOSEST}" ]] || return 1
+
+ return 0
+}
+
+[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
+
+shopt -s extglob
+SCRIPT=$0
+BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
+OUT=${BIN}.out
+
+# Test with sorted input...
+${BIN} ${SRCDIR}/src/mapping/tests/hosts8.txt > ${OUT} 2>&1 || exit 1
+check ${OUT} 8 0000000000000001.0000000000000000 || exit 1
+
+# Test with shuffled input...
+${BIN} ${SRCDIR}/src/mapping/tests/hosts8-s.txt > ${OUT} 2>&1 || exit 1
+check ${OUT} 8 0000000000000001.0000000000000000 || exit 1
+
+# Test with insufficient input...
+${BIN} ${SRCDIR}/src/mapping/tests/hosts1b.txt > ${OUT} 2>&1 || exit 1
+check ${OUT} 1 0000000000000001.0000000000000000 || exit 1
+grep TRITON_ERR_NO_SERVERS ${OUT} > /dev/null 2>&1 || exit 1
+
+echo OK
+
+exit 0
diff --git a/code/src/placement/tests/module.mk.in b/code/src/placement/tests/module.mk.in
new file mode 100644
index 0000000..1bca47d
--- /dev/null
+++ b/code/src/placement/tests/module.mk.in
@@ -0,0 +1,54 @@
+DIR := src/placement/tests
+
+PLACEMENT_TEST_SRC += $(DIR)/subtract.ae
+PLACEMENT_TEST_SRC += $(DIR)/hostmap2.ae
+##PLACEMENT_TEST_SRC += $(DIR)/query.ae
+#PLACEMENT_TEST_SRC += $(DIR)/post-node-id.ae
+#PLACEMENT_TEST_SRC += $(DIR)/exchange-ids.ae
+
+PLACEMENT_TESTS = $(patsubst %.ae,%,$(PLACEMENT_TEST_SRC))
+
+placement_tests: $(PLACEMENT_TESTS)
+
+AETESTSRC += $(PLACEMENT_TEST_SRC)
+
+TESTSRC += $(DIR)/testhash.c
+
+PLACEMENT_TEST_RESULTS := $(DIR)/hostmap2.result
+TEST_RESULTS += $(PLACEMENT_TEST_RESULTS)
+
+placement_test_results: $(PLACEMENT_TEST_RESULTS)
+
+TEST_OUT += $(DIR)/hostmap2.out
+
+MODLIBS_$(DIR) = -lcrypto -lpthread
+
+MODCFLAGS_$(DIR)/query = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/query = $(MPILDFLAGS)
+MODLIBS_$(DIR)/query = $(MPILIBS)
+MODCC_$(DIR)/query = $(MPICC)
+
+MODCFLAGS_$(DIR)/subtract = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/subtract = $(MPILDFLAGS)
+MODLIBS_$(DIR)/subtract = $(MPILIBS)
+MODCC_$(DIR)/subtract = $(MPICC)
+
+MODCFLAGS_$(DIR)/post-node-id = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/post-node-id = $(MPILDFLAGS)
+MODLIBS_$(DIR)/post-node-id = $(MPILIBS)
+MODCC_$(DIR)/post-node-id = $(MPICC)
+
+MODCFLAGS_$(DIR)/exchange-ids = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/exchange-ids = $(MPILDFLAGS)
+MODLIBS_$(DIR)/exchange-ids = $(MPILIBS)
+MODCC_$(DIR)/exchange-ids = $(MPICC)
+
+MODCFLAGS_$(DIR)/hostmap1 = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/hostmap1 = $(MPILDFLAGS)
+MODLIBS_$(DIR)/hostmap1 = $(MPILIBS)
+MODCC_$(DIR)/hostmap1 = $(MPICC)
+
+MODCFLAGS_$(DIR)/hostmap2 = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/hostmap2 = $(MPILDFLAGS)
+MODLIBS_$(DIR)/hostmap2 = $(MPILIBS)
+MODCC_$(DIR)/hostmap2 = $(MPICC)
diff --git a/code/src/placement/test/post-node-id.ae b/code/src/placement/tests/post-node-id.ae
similarity index 100%
rename from code/src/placement/test/post-node-id.ae
rename to code/src/placement/tests/post-node-id.ae
diff --git a/code/src/placement/test/query.ae b/code/src/placement/tests/query.ae
similarity index 100%
rename from code/src/placement/test/query.ae
rename to code/src/placement/tests/query.ae
diff --git a/code/src/placement/test/subtract.ae b/code/src/placement/tests/subtract.ae
similarity index 100%
rename from code/src/placement/test/subtract.ae
rename to code/src/placement/tests/subtract.ae
diff --git a/code/src/placement/test/testhash.c b/code/src/placement/tests/testhash.c
similarity index 100%
rename from code/src/placement/test/testhash.c
rename to code/src/placement/tests/testhash.c
diff --git a/code/src/socket/test/echo-server.ae b/code/src/socket/test/echo-server.ae
deleted file mode 100644
index 622a14b..0000000
--- a/code/src/socket/test/echo-server.ae
+++ /dev/null
@@ -1,237 +0,0 @@
-#define _GNU_SOURCE
-
-#include "src/aesop/aesop.h"
-#include "src/socket/triton-socket.hae"
-#include "src/common/resources/aesocket/aesocket.hae"
-#include "src/common/resources/timer/timer.hae"
-#include "src/socket/test/echo-server.h"
-#include "src/common/resources/file/file-resource.hae"
-#include "src/common/triton-debug.h"
-
-#include <getopt.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <signal.h>
-#include <netinet/tcp.h>
-
-void usage(char *progname);
-void parse_args (int argc, char **argv, int *port);
-static __blocking void handleConnection(
- int fd);
-static __blocking int dotest(int argc, char** argv);
-
-void usage(char *progname)
-{
- fprintf(stderr,
- "usage: %s [--port <port>] [--help]\n",
- progname);
- fprintf(stderr, "\t--port : port to use\n");
- exit(1);
- return;
-}
-
-void parse_args (int argc, char **argv,
- int *port)
-{
- struct option options[] =
- {
- { "port", required_argument, NULL, 'p' },
- { "help", no_argument, NULL, 'h' }
- };
- int choice;
-
- while ((choice = getopt_long(argc, argv, "", options, NULL)) != -1)
- {
- switch(choice)
- {
- case 'p':
- *port = atoi(optarg);
- break;
- case '?':
- case 'h':
- default:
- usage(argv[0]);
- break;
- }
- }
-
- return;
-}
-
-
-static __blocking void handleConnection(
- int fd)
-{
- triton_ret_t ret;
- void* buffer;
- int len;
- int rc;
- int written;
- struct test_request req;
- struct test_response resp;
- int file_fd;
-
- resp.error_code = 42;
-
- triton_socket_prepare (fd);
-
-
- pbranch
- {
-
- while(1)
- {
- /* read request */
- ret = triton_read(fd, &req, sizeof(req), &len);
- if (ret != TRITON_SUCCESS)
- {
- /* connection closed */
- break;
- }
-
- /* allocate a buffer for moving data */
-
- rc = posix_memalign(&buffer, 4096, req.size);
- assert(rc == 0);
-
- /* perform whatever operation was requested by client */
- switch(req.type)
- {
- case TEST_READ_NULL:
- ret = triton_write(fd, buffer, req.size, &written);
- assert(ret == TRITON_SUCCESS);
- break;
-
- case TEST_WRITE_NULL:
- ret = triton_read(fd, buffer, req.size, &len);
- assert(ret == TRITON_SUCCESS);
- break;
-
- case TEST_READ:
- ret = file_open(&file_fd,
- req.filename,
- (O_RDONLY|O_DIRECT),
- 0644);
- assert(ret == TRITON_SUCCESS);
-
- ret = file_pread(file_fd,
- buffer,
- req.size,
- 0);
- assert(ret == TRITON_SUCCESS);
-
- ret = triton_write(fd, buffer, req.size, &written);
- assert(ret == TRITON_SUCCESS);
-
- ret = file_close(file_fd);
- assert(ret == TRITON_SUCCESS);
- break;
-
- case TEST_WRITE:
- ret = triton_read(fd, buffer, req.size, &len);
- assert(ret == TRITON_SUCCESS);
-
- ret = file_open(&file_fd,
- req.filename,
- (O_CREAT|O_TRUNC|O_WRONLY|O_DIRECT),
- 0644);
- assert(ret == TRITON_SUCCESS);
-
- ret = file_pwrite(file_fd,
- buffer,
- req.size,
- 0);
- assert(ret == TRITON_SUCCESS);
-
- ret = file_close(file_fd);
- assert(ret == TRITON_SUCCESS);
-
- break;
-
- default:
- assert(0 && "Unknown request type!");
- }
- ret = triton_write(fd, &resp, sizeof(resp), &written);
- assert(ret == TRITON_SUCCESS);
- free(buffer);
- };
-
- close(fd);
- }
-}
-
-static __blocking int dotest(int argc, char** argv)
-{
- int listensocket;
- struct sockaddr_in addr;
- triton_ret_t ret;
- int newsocket;
- int value = 1;
- int rc;
- int opt_port = 10888;
-
- struct sigaction new_action;
- sigset_t sigset;
- new_action.sa_handler = handler;
- sigemptyset(&new_action.sa_mask);
- new_action.sa_flags = SA_RESETHAND;
- sigaction(SIGTERM, &new_action, NULL);
- sigaction(SIGINT, &new_action, NULL);
- sigaction(SIGQUIT, &new_action, NULL);
- sigemptyset(&sigset);
- sigaddset(&sigset, SIGTERM);
- sigaddset(&sigset, SIGINT);
- sigaddset(&sigset, SIGQUIT);
- sigprocmask(SIG_UNBLOCK, &sigset, NULL);
-
- parse_args(argc, argv, &opt_port);
-
- listensocket = socket(AF_INET, SOCK_STREAM, 0);
- assert(listensocket >= 0);
-
- // Prepare socket for use with the triton-socket module
- triton_socket_prepare (listensocket);
-
- memset(&addr, 0, sizeof(addr));
- addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = htonl(INADDR_ANY);
- addr.sin_port = htons(opt_port);
-
- /* allow address to be reused quickly */
- rc = setsockopt(listensocket, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(value));
- assert(rc == 0);
-
- rc = bind(listensocket, (struct sockaddr *) &addr, sizeof(addr));
- assert(rc == 0);
-
- rc = listen(listensocket, SOMAXCONN);
- assert(rc == 0);
-
- while (1)
- {
- ret = triton_accept(listensocket, 0, 0, &newsocket);
- assert(ret == TRITON_SUCCESS);
-
- rc = setsockopt(newsocket, IPPROTO_TCP, TCP_NODELAY, &value,
- sizeof(value));
- assert(rc == 0);
-
- handleConnection(newsocket);
- }
-
- return 0;
-}
-
-aesop_main_set_with_init(NULL, "triton.echo-server", dotest, "timer", "aesocket", "file");
-
-/*
- * Local variables:
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
diff --git a/code/src/socket/test/module.mk.in b/code/src/socket/test/module.mk.in
deleted file mode 100644
index bbe912e..0000000
--- a/code/src/socket/test/module.mk.in
+++ /dev/null
@@ -1,6 +0,0 @@
-DIR := src/socket/test
-
-AETESTSRC += $(DIR)/echo-server.ae
-
-src/socket/test/echo-server-lite: src/socket/test/echo-server.o src/socket/triton-socket.o src/common/resources/file/file-resource.o src/common/libev/ev.o src/common/resources/aesocket/aesocket.o src/common/resources/timer/timer.o src/common/triton-error.o src/common/triton-debug.o src/common/triton-log.o src/common/triton-string.o src/common/lookup3.o src/common/triton-init.o src/common/triton-init-registry-lite.o src/zeroconf/zeroconf.o src/aesop/opcache.o src/aesop/aesop.o src/aesop/resource.o src/aesop/hints.o src/aesop/ae-ctl.o src/common/triton-error-defs.o src/net/triton-message.o src/remote/message.o src/common/resources/signal/signal.o
- gcc $(LDFLAGS) $^ -lpthread -lm -o $@
diff --git a/code/src/socket/tests/echo-server.ae b/code/src/socket/tests/echo-server.ae
new file mode 100644
index 0000000..605812c
--- /dev/null
+++ b/code/src/socket/tests/echo-server.ae
@@ -0,0 +1,237 @@
+#define _GNU_SOURCE
+
+#include "src/aesop/aesop.h"
+#include "src/socket/triton-socket.hae"
+#include "src/common/resources/aesocket/aesocket.hae"
+#include "src/common/resources/timer/timer.hae"
+#include "src/socket/tests/echo-server.h"
+#include "src/common/resources/file/file-resource.hae"
+#include "src/common/triton-debug.h"
+
+#include <getopt.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <signal.h>
+#include <netinet/tcp.h>
+
+void usage(char *progname);
+void parse_args (int argc, char **argv, int *port);
+static __blocking void handleConnection(
+ int fd);
+static __blocking int dotest(int argc, char** argv);
+
+void usage(char *progname)
+{
+ fprintf(stderr,
+ "usage: %s [--port <port>] [--help]\n",
+ progname);
+ fprintf(stderr, "\t--port : port to use\n");
+ exit(1);
+ return;
+}
+
+void parse_args (int argc, char **argv,
+ int *port)
+{
+ struct option options[] =
+ {
+ { "port", required_argument, NULL, 'p' },
+ { "help", no_argument, NULL, 'h' }
+ };
+ int choice;
+
+ while ((choice = getopt_long(argc, argv, "", options, NULL)) != -1)
+ {
+ switch(choice)
+ {
+ case 'p':
+ *port = atoi(optarg);
+ break;
+ case '?':
+ case 'h':
+ default:
+ usage(argv[0]);
+ break;
+ }
+ }
+
+ return;
+}
+
+
+static __blocking void handleConnection(
+ int fd)
+{
+ triton_ret_t ret;
+ void* buffer;
+ int len;
+ int rc;
+ int written;
+ struct test_request req;
+ struct test_response resp;
+ int file_fd;
+
+ resp.error_code = 42;
+
+ triton_socket_prepare (fd);
+
+
+ pbranch
+ {
+
+ while(1)
+ {
+ /* read request */
+ ret = triton_read(fd, &req, sizeof(req), &len);
+ if (ret != TRITON_SUCCESS)
+ {
+ /* connection closed */
+ break;
+ }
+
+ /* allocate a buffer for moving data */
+
+ rc = posix_memalign(&buffer, 4096, req.size);
+ assert(rc == 0);
+
+ /* perform whatever operation was requested by client */
+ switch(req.type)
+ {
+ case TEST_READ_NULL:
+ ret = triton_write(fd, buffer, req.size, &written);
+ assert(ret == TRITON_SUCCESS);
+ break;
+
+ case TEST_WRITE_NULL:
+ ret = triton_read(fd, buffer, req.size, &len);
+ assert(ret == TRITON_SUCCESS);
+ break;
+
+ case TEST_READ:
+ ret = file_open(&file_fd,
+ req.filename,
+ (O_RDONLY|O_DIRECT),
+ 0644);
+ assert(ret == TRITON_SUCCESS);
+
+ ret = file_pread(file_fd,
+ buffer,
+ req.size,
+ 0);
+ assert(ret == TRITON_SUCCESS);
+
+ ret = triton_write(fd, buffer, req.size, &written);
+ assert(ret == TRITON_SUCCESS);
+
+ ret = file_close(file_fd);
+ assert(ret == TRITON_SUCCESS);
+ break;
+
+ case TEST_WRITE:
+ ret = triton_read(fd, buffer, req.size, &len);
+ assert(ret == TRITON_SUCCESS);
+
+ ret = file_open(&file_fd,
+ req.filename,
+ (O_CREAT|O_TRUNC|O_WRONLY|O_DIRECT),
+ 0644);
+ assert(ret == TRITON_SUCCESS);
+
+ ret = file_pwrite(file_fd,
+ buffer,
+ req.size,
+ 0);
+ assert(ret == TRITON_SUCCESS);
+
+ ret = file_close(file_fd);
+ assert(ret == TRITON_SUCCESS);
+
+ break;
+
+ default:
+ assert(0 && "Unknown request type!");
+ }
+ ret = triton_write(fd, &resp, sizeof(resp), &written);
+ assert(ret == TRITON_SUCCESS);
+ free(buffer);
+ };
+
+ close(fd);
+ }
+}
+
+static __blocking int dotest(int argc, char** argv)
+{
+ int listensocket;
+ struct sockaddr_in addr;
+ triton_ret_t ret;
+ int newsocket;
+ int value = 1;
+ int rc;
+ int opt_port = 10888;
+
+ struct sigaction new_action;
+ sigset_t sigset;
+ new_action.sa_handler = handler;
+ sigemptyset(&new_action.sa_mask);
+ new_action.sa_flags = SA_RESETHAND;
+ sigaction(SIGTERM, &new_action, NULL);
+ sigaction(SIGINT, &new_action, NULL);
+ sigaction(SIGQUIT, &new_action, NULL);
+ sigemptyset(&sigset);
+ sigaddset(&sigset, SIGTERM);
+ sigaddset(&sigset, SIGINT);
+ sigaddset(&sigset, SIGQUIT);
+ sigprocmask(SIG_UNBLOCK, &sigset, NULL);
+
+ parse_args(argc, argv, &opt_port);
+
+ listensocket = socket(AF_INET, SOCK_STREAM, 0);
+ assert(listensocket >= 0);
+
+ // Prepare socket for use with the triton-socket module
+ triton_socket_prepare (listensocket);
+
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ addr.sin_addr.s_addr = htonl(INADDR_ANY);
+ addr.sin_port = htons(opt_port);
+
+ /* allow address to be reused quickly */
+ rc = setsockopt(listensocket, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(value));
+ assert(rc == 0);
+
+ rc = bind(listensocket, (struct sockaddr *) &addr, sizeof(addr));
+ assert(rc == 0);
+
+ rc = listen(listensocket, SOMAXCONN);
+ assert(rc == 0);
+
+ while (1)
+ {
+ ret = triton_accept(listensocket, 0, 0, &newsocket);
+ assert(ret == TRITON_SUCCESS);
+
+ rc = setsockopt(newsocket, IPPROTO_TCP, TCP_NODELAY, &value,
+ sizeof(value));
+ assert(rc == 0);
+
+ handleConnection(newsocket);
+ }
+
+ return 0;
+}
+
+aesop_main_set_with_init(NULL, "triton.echo-server", dotest, "timer", "aesocket", "file");
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
diff --git a/code/src/socket/test/echo-server.h b/code/src/socket/tests/echo-server.h
similarity index 100%
rename from code/src/socket/test/echo-server.h
rename to code/src/socket/tests/echo-server.h
diff --git a/code/src/socket/tests/module.mk.in b/code/src/socket/tests/module.mk.in
new file mode 100644
index 0000000..a189036
--- /dev/null
+++ b/code/src/socket/tests/module.mk.in
@@ -0,0 +1,6 @@
+DIR := src/socket/tests
+
+AETESTSRC += $(DIR)/echo-server.ae
+
+src/socket/tests/echo-server-lite: src/socket/tests/echo-server.o src/socket/triton-socket.o src/common/resources/file/file-resource.o src/common/libev/ev.o src/common/resources/aesocket/aesocket.o src/common/resources/timer/timer.o src/common/triton-error.o src/common/triton-debug.o src/common/triton-log.o src/common/triton-string.o src/common/lookup3.o src/common/triton-init.o src/common/triton-init-registry-lite.o src/zeroconf/zeroconf.o src/aesop/opcache.o src/aesop/aesop.o src/aesop/resource.o src/aesop/hints.o src/aesop/ae-ctl.o src/common/triton-error-defs.o src/net/triton-message.o src/remote/message.o src/common/resources/signal/signal.o
+ gcc $(LDFLAGS) $^ -lpthread -lm -o $@
diff --git a/code/src/state/state.ae b/code/src/state/state.ae
index d34b20d..ec3e396 100644
--- a/code/src/state/state.ae
+++ b/code/src/state/state.ae
@@ -155,12 +155,6 @@ static triton_ret_t __blocking check_state(triton_node_t peer,
peer_status_previous);
}
- /* this seems necessary to catch the CANCEL (ref #122) */
- if(pret == TRITON_SUCCESS)
- {
- pret = triton_timer(100);
- }
-
return(pret);
}
diff --git a/code/src/state/test/engine1.sh b/code/src/state/test/engine1.sh
deleted file mode 100755
index 2d776f1..0000000
--- a/code/src/state/test/engine1.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-# Test with sorted input...
-mpiexec -l -n 4 ${BIN} ${SRCDIR}/src/mapping/test/hosts2.txt > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-LINES=$( grep "done" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 4 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/state/test/module.mk.in b/code/src/state/test/module.mk.in
deleted file mode 100644
index 3bddc28..0000000
--- a/code/src/state/test/module.mk.in
+++ /dev/null
@@ -1,106 +0,0 @@
-
-DIR := src/state/test
-
-# Set default value
-ifeq (,$(ROSD_DISABLE_FAKESS))
- ROSD_DISABLE_FAKESS = 0
-endif
-
-STATE_TEST_SRC :=
-STATE_TEST_SRC += $(DIR)/local.ae
-STATE_TEST_SRC += $(DIR)/shutdown.ae
-STATE_TEST_SRC += $(DIR)/post-global.ae
-STATE_TEST_SRC += $(DIR)/engine1.ae
-STATE_TEST_SRC += $(DIR)/rpc-size.ae
-STATE_TEST_SRC += $(DIR)/rpc-global.ae
-STATE_TEST_SRC += $(DIR)/rpc-list.ae
-STATE_TEST_SRC += $(DIR)/rosd-start.ae
-# STATE_TEST_SRC += $(DIR)/rosd-global.ae
-# STATE_TEST_SRC += $(DIR)/rosd-status.ae
-# STATE_TEST_SRC += $(DIR)/rosd-trigger.ae
-# STATE_TEST_SRC += $(DIR)/rosd-peers.ae
-# STATE_TEST_SRC += $(DIR)/rosd-maint.ae
-STATE_TEST_SRC += $(DIR)/rosd-injection.ae
-# Still needs some work:
-# STATE_TEST_SRC += $(DIR)/rosd-recover.ae
-# AETESTSRC += $(DIR)/state-client.ae
-
-STATE_TESTS = $(patsubst %.ae,%,$(STATE_TEST_SRC))
-
-state_tests: $(STATE_TESTS)
-
-AETESTSRC += $(STATE_TEST_SRC)
-
-STATE_TEST_RESULTS := $(patsubst %.ae,%.result,$(STATE_TEST_SRC))
-
-TEST_RESULTS += $(STATE_TEST_RESULTS)
-
-state_test_results: $(STATE_TEST_RESULTS)
-
-TEST_OUT += $(patsubst %.result,%.out,$(STATE_TEST_RESULTS))
-
-MODLIBS_$(DIR)/testbqueue1 = -lpthread
-MODLIBS_$(DIR)/testbqueue2 = -lpthread
-
-MODCFLAGS_$(DIR)/local = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/local = $(MPILDFLAGS)
-MODLIBS_$(DIR)/local = $(MPILIBS)
-MODCC_$(DIR)/local = $(MPICC)
-
-MODCFLAGS_$(DIR)/shutdown = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/shutdown = $(MPILDFLAGS)
-MODLIBS_$(DIR)/shutdown = $(MPILIBS)
-MODCC_$(DIR)/shutdown = $(MPICC)
-
-MODCFLAGS_$(DIR)/post-global = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/post-global = $(MPILDFLAGS)
-MODLIBS_$(DIR)/post-global = $(MPILIBS)
-MODCC_$(DIR)/post-global = $(MPICC)
-
-MODCFLAGS_$(DIR)/engine1 = $(MPICFLAGS)
-MODLDFLAGS_$(DIR)/engine1 = $(MPILDFLAGS)
-MODLIBS_$(DIR)/engine1 = $(MPILIBS)
-MODCC_$(DIR)/engine1 = $(MPICC)
-
-MODCFLAGS_$(DIR)/rosd-start = $(MPICFLAGS) \
- -D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
- -Wunused-variable
-MODLDFLAGS_$(DIR)/rosd-start = $(MPILDFLAGS)
-MODLINKWITH_$(DIR)/rosd-start = src/replicated-osd/tests/rosd-test-builder.o
-
-MODCFLAGS_$(DIR)/rosd-global = $(MPICFLAGS) \
- -D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
- -Wunused-variable
-MODLDFLAGS_$(DIR)/rosd-global = $(MPILDFLAGS)
-MODLIBS_$(DIR)/rosd-global = $(MPILIBS)
-MODCC_$(DIR)/rosd-global = $(MPICC)
-MODLINKWITH_$(DIR)/rosd-global = src/replicated-osd/tests/rosd-test-builder.o
-
-MODCFLAGS_$(DIR)/rosd-status = $(MPICFLAGS) \
- -D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
- -Wunused-variable
-MODLDFLAGS_$(DIR)/rosd-status = $(MPILDFLAGS)
-MODLIBS_$(DIR)/rosd-status = $(MPILIBS)
-MODCC_$(DIR)/rosd-status = $(MPICC)
-
-MODCFLAGS_$(DIR)/rosd-trigger = $(MPICFLAGS) \
- -D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
- -Wunused-variable
-MODLDFLAGS_$(DIR)/rosd-trigger = $(MPILDFLAGS)
-MODLIBS_$(DIR)/rosd-trigger = $(MPILIBS)
-MODCC_$(DIR)/rosd-trigger = $(MPICC)
-
-MODCFLAGS_$(DIR)/rosd-peers = $(MPICFLAGS) \
- -D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
- -Wunused-variable
-MODLDFLAGS_$(DIR)/rosd-peers = $(MPILDFLAGS)
-MODLIBS_$(DIR)/rosd-peers = $(MPILIBS)
-MODCC_$(DIR)/rosd-peers = $(MPICC)
-
-MODCFLAGS_$(DIR)/rosd-injection = $(MPICFLAGS) \
- -D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
- -Wunused-variable
-MODLDFLAGS_$(DIR)/rosd-injection = $(MPILDFLAGS)
-MODLIBS_$(DIR)/rosd-injection = $(MPILIBS)
-MODCC_$(DIR)/rosd-injection = $(MPICC)
-MODLINKWITH_$(DIR)/rosd-injection = src/replicated-osd/tests/rosd-test-builder.o
\ No newline at end of file
diff --git a/code/src/state/test/post-global.sh b/code/src/state/test/post-global.sh
deleted file mode 100755
index 2d776f1..0000000
--- a/code/src/state/test/post-global.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-# Test with sorted input...
-mpiexec -l -n 4 ${BIN} ${SRCDIR}/src/mapping/test/hosts2.txt > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-LINES=$( grep "done" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 4 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/state/test/rosd-recover.sh b/code/src/state/test/rosd-recover.sh
deleted file mode 100755
index e690e48..0000000
--- a/code/src/state/test/rosd-recover.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-export triton_fakess_method=fault
-export aesop_remote_default_net=fault
-
-# Test with sorted input...
-mpiexec -l -n 4 ${VALGRIND} ${BIN} /tmp/rosd.db /tmp/rosd-log \
- 1 1 0 0 2 1 ${SRCDIR}/src/mapping/test/faulty2.txt > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-LINES=$( grep "status change:" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-# Handle this check later:
-# [[ ${LINES} == 6 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/state/test/rosd-test-funcs.ae b/code/src/state/test/rosd-test-funcs.ae
deleted file mode 100644
index 072d33b..0000000
--- a/code/src/state/test/rosd-test-funcs.ae
+++ /dev/null
@@ -1,134 +0,0 @@
-#include "src/aesop/aesop-support.hae"
-
-static triton_ret_t __blocking check_state(triton_node_t peer, triton_state_data_t* data, triton_status_t* peer_status, triton_status_t* peer_status_previous)
-{
- triton_ret_t pret = TRITON_SUCCESS;
-
- triton_mutex_lock(&data->mutex);
- *peer_status = *(triton_status_t *)(data->value);
- if (*peer_status == *peer_status_previous)
- {
- pret = triton_sched_wait(data->sched,
- &data->mutex);
- }
- triton_mutex_unlock(&data->mutex);
-
- *peer_status = *(triton_status_t *)(data->value);
- if (pret == TRITON_SUCCESS && *peer_status != *peer_status_previous)
- {
- handle_status_change(peer, peer_status,
- peer_status_previous);
- }
-
- /* this seems necessary to catch the CANCEL (ref #122) */
- if(pret == TRITON_SUCCESS)
- {
- pret = triton_timer(100);
- }
-
- return(pret);
-}
-
-__blocking void monitor_state()
-{
- triton_string_t key;
- triton_node_t self;
- triton_list_t *map;
- triton_status_t *status;
- triton_ret_t ret;
- bool running;
-
- triton_map_get(&map);
- self = triton_map_self();
- triton_string_init(&key, "triton.state");
- triton_fakess_item_add(self, &key);
-
- status = malloc(sizeof(triton_status_t));
- *status = triton_status;
- ret = triton_fakess_post(self, &key,
- status, sizeof(triton_status_t));
- triton_error_assert(ret);
-
- /* wait for all nodes to post status=NOMINAL */
- triton_timer(1000);
-
- pwait
- {
- pprivate triton_ret_t pret;
- pprivate triton_state_data_t *data;
- pprivate triton_node_t peer;
- pprivate triton_map_t *entry;
- pprivate triton_map_t *scratch;
- pprivate triton_status_t peer_status = TRITON_STATUS_PROTO;
- pprivate triton_status_t peer_status_previous = TRITON_STATUS_PROTO;
- triton_list_for_each_entry (entry, scratch, map,
- triton_map_t, link)
- {
- pbranch
- {
- peer = entry->node;
- data = triton_fakess_lookup(peer, &key);
- assert(data);
-
- while (true)
- {
- /* see ticket #182. As a workaround to a known aesop
- * bug we have to put the logic inside this while loop
- * in its own blocking function.
- */
-#if 1
- pret = check_state(peer, data, &peer_status, &peer_status_previous);
- if(pret != TRITON_SUCCESS)
- {
- break;
- }
-#else
- triton_mutex_lock(&data->mutex);
- peer_status = *(triton_status_t *)(data->value);
- if (peer_status == peer_status_previous)
- {
- pret = triton_sched_wait(data->sched,
- &data->mutex);
- }
- triton_mutex_unlock(&data->mutex);
-
- peer_status = *(triton_status_t *)(data->value);
- if (peer_status != peer_status_previous)
- {
- handle_status_change(peer, &peer_status,
- &peer_status_previous);
- }
-
- /* this seems necessary to catch the CANCEL (ref #122) */
- pret = triton_timer(100);
-
- if (pret != TRITON_SUCCESS)
- {
- break;
- }
-#endif
- }
- }
- }
- pbranch
- {
- while (triton_fakess_running())
- {
- triton_timer(1000);
- }
- aesop_cancel_branches_wait();
- }
- }
-
- triton_string_destroy(&key);
- return;
-}
-
-/*
- * Local variables:
- * mode: c
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
diff --git a/code/src/state/test/rpc-global.sh b/code/src/state/test/rpc-global.sh
deleted file mode 100755
index d4fb3ef..0000000
--- a/code/src/state/test/rpc-global.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-mpiexec -l -n 4 ${BIN} ${SRCDIR}/src/mapping/test/hosts2.txt > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-LINES=$( grep "value: 34" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 3 ]] || exit 1
-
-LINES=$( grep "size: 3" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 4 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/state/test/rpc-list.sh b/code/src/state/test/rpc-list.sh
deleted file mode 100755
index ce38d35..0000000
--- a/code/src/state/test/rpc-list.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-triton_debug_masks=triton.mapping triton_debug_file=/dev/stderr \
- mpiexec -l -n 4 ${BIN} ${SRCDIR}/src/mapping/test/hosts2.txt > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-LINES=$( grep -c "node:" ${OUT} )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 4 ]] || exit 1
-
-# state.size includes triton_node_null
-LINES=$( grep -c "size: 3" ${OUT} )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 2 ]] || exit 1
-
-LINES=$( grep -c "done" ${OUT} )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 4 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/state/test/rpc-size.sh b/code/src/state/test/rpc-size.sh
deleted file mode 100755
index 0cc7563..0000000
--- a/code/src/state/test/rpc-size.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-mpiexec -l -n 2 ${BIN} ${SRCDIR}/src/mapping/test/hosts1a.txt > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-grep "result: 2" ${OUT} > /dev/null || exit 1
-
-LINES=$( grep "done" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 2 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/state/test/shutdown.ae b/code/src/state/test/shutdown.ae
deleted file mode 100644
index 895e5ae..0000000
--- a/code/src/state/test/shutdown.ae
+++ /dev/null
@@ -1,132 +0,0 @@
-
-/**
- Test state.shutdown()
- Example:
- mpiexec -l -n 3 src/state/test/shutdown src/mapping/test/hosts2.txt
-*/
-
-#include <stdbool.h>
-#include <stdio.h>
-#include "src/aesop/aesop.h"
-#include "src/common/triton-notify.h"
-#include "src/common/resources/timer/timer.hae"
-#include "src/net/mpi/mpi.hae"
-#include "src/fakess/fakess.hae"
-#include "src/mapping/mapping.hae"
-
-#include <sys/types.h>
-#include <unistd.h>
-
-static __blocking void sender()
-{
- printf("sender()...\n");
- printf("shutdown...\n");
- triton_state.shutdown();
-}
-
-static __blocking void receiver()
-{
- printf("receiver():\n");
- while (triton_state.running())
- {
- triton_state.recv();
- }
-}
-
-static __blocking int dostuff(char *hostlist)
-{
- int rank;
-
- triton_fakess_state_install();
- triton_map_file(hostlist);
- triton_state.load();
-
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
- if (rank == 0)
- {
- sender();
- }
- else if (rank == 1)
- {
- receiver();
- }
-
- return 0;
-}
-
-int done = 0;
-int dostuff_ret;
-
-static void done_callback(void *user_ptr, int ret)
-{
- ae_context_t ctx = (ae_context_t)user_ptr;
- dostuff_ret = ret;
- done = 1;
- ae_poll_break(ctx);
-}
-
-int main(int argc, char *argv[])
-{
- triton_ret_t ret;
- ae_op_id_t op_id;
- ae_context_t ctx;
- ae_hints_t hints;
-
- char *hostlist;
-
- /* GDB_WAIT: */
- int gdb_wait = 0;
- pid_t pid;
- int rank;
-
- assert(argc == 2);
-
- hostlist = argv[1];
-
- triton_init("triton.client");
-
- if (getenv("GDB_WAIT"))
- {
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- if (rank == 0)
- {
- pid = getpid();
- printf("gdb_wait: rank: %i pid: %i\n", rank, pid);
- while (!gdb_wait);
- }
- }
-
- ae_context_create(&ctx, "mpi", "timer", "sched");
-
- ae_hints_init(&hints);
- ret = ae_post_blocking(dostuff, done_callback, ctx, &hints, ctx, &op_id,
- &dostuff_ret, hostlist);
- if(ret == TRITON_SUCCESS)
- {
- while (done == 0)
- {
- ae_poll(ctx, 10);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
- ae_context_destroy(ctx);
-
- printf("done\n");
-
- triton_finalize();
- // ae_context_destroy(ctx);
- // MPI_Finalize();
-
- return dostuff_ret;
-}
-
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * End:
- *
- * vim: ft=c ts=8 sts=4 sw=4 expandtab
- */
diff --git a/code/src/state/test/shutdown.sh b/code/src/state/test/shutdown.sh
deleted file mode 100755
index 6e1d43b..0000000
--- a/code/src/state/test/shutdown.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-# Test with sorted input...
-mpiexec -l -n 3 ${BIN} ${SRCDIR}/src/mapping/test/hosts2.txt > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-LINES=$( grep "done" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 3 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/state/test/engine1.ae b/code/src/state/tests/engine1.ae
similarity index 100%
rename from code/src/state/test/engine1.ae
rename to code/src/state/tests/engine1.ae
diff --git a/code/src/state/tests/engine1.sh b/code/src/state/tests/engine1.sh
new file mode 100755
index 0000000..bc388bc
--- /dev/null
+++ b/code/src/state/tests/engine1.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
+
+shopt -s extglob
+SCRIPT=$0
+BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
+OUT=${BIN}.out
+
+# Test with sorted input...
+mpiexec -l -n 4 ${BIN} ${SRCDIR}/src/mapping/tests/hosts2.txt > ${OUT} 2>&1
+[[ $? == 0 ]] || exit 1
+
+LINES=$( grep "done" ${OUT} | wc -l )
+[[ $? == 0 ]] || exit 1
+[[ ${LINES} == 4 ]] || exit 1
+
+echo OK
+exit 0
diff --git a/code/src/state/test/local.ae b/code/src/state/tests/local.ae
similarity index 100%
rename from code/src/state/test/local.ae
rename to code/src/state/tests/local.ae
diff --git a/code/src/state/test/local.sh b/code/src/state/tests/local.sh
similarity index 100%
rename from code/src/state/test/local.sh
rename to code/src/state/tests/local.sh
diff --git a/code/src/state/tests/module.mk.in b/code/src/state/tests/module.mk.in
new file mode 100644
index 0000000..5175b4b
--- /dev/null
+++ b/code/src/state/tests/module.mk.in
@@ -0,0 +1,106 @@
+
+DIR := src/state/tests
+
+# Set default value
+ifeq (,$(ROSD_DISABLE_FAKESS))
+ ROSD_DISABLE_FAKESS = 0
+endif
+
+STATE_TEST_SRC :=
+STATE_TEST_SRC += $(DIR)/local.ae
+STATE_TEST_SRC += $(DIR)/shutdown.ae
+STATE_TEST_SRC += $(DIR)/post-global.ae
+STATE_TEST_SRC += $(DIR)/engine1.ae
+STATE_TEST_SRC += $(DIR)/rpc-size.ae
+STATE_TEST_SRC += $(DIR)/rpc-global.ae
+STATE_TEST_SRC += $(DIR)/rpc-list.ae
+STATE_TEST_SRC += $(DIR)/rosd-start.ae
+# STATE_TEST_SRC += $(DIR)/rosd-global.ae
+# STATE_TEST_SRC += $(DIR)/rosd-status.ae
+# STATE_TEST_SRC += $(DIR)/rosd-trigger.ae
+# STATE_TEST_SRC += $(DIR)/rosd-peers.ae
+# STATE_TEST_SRC += $(DIR)/rosd-maint.ae
+STATE_TEST_SRC += $(DIR)/rosd-injection.ae
+# Still needs some work:
+# STATE_TEST_SRC += $(DIR)/rosd-recover.ae
+# AETESTSRC += $(DIR)/state-client.ae
+
+STATE_TESTS = $(patsubst %.ae,%,$(STATE_TEST_SRC))
+
+state_tests: $(STATE_TESTS)
+
+AETESTSRC += $(STATE_TEST_SRC)
+
+STATE_TEST_RESULTS := $(patsubst %.ae,%.result,$(STATE_TEST_SRC))
+
+TEST_RESULTS += $(STATE_TEST_RESULTS)
+
+state_test_results: $(STATE_TEST_RESULTS)
+
+TEST_OUT += $(patsubst %.result,%.out,$(STATE_TEST_RESULTS))
+
+MODLIBS_$(DIR)/testbqueue1 = -lpthread
+MODLIBS_$(DIR)/testbqueue2 = -lpthread
+
+MODCFLAGS_$(DIR)/local = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/local = $(MPILDFLAGS)
+MODLIBS_$(DIR)/local = $(MPILIBS)
+MODCC_$(DIR)/local = $(MPICC)
+
+MODCFLAGS_$(DIR)/shutdown = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/shutdown = $(MPILDFLAGS)
+MODLIBS_$(DIR)/shutdown = $(MPILIBS)
+MODCC_$(DIR)/shutdown = $(MPICC)
+
+MODCFLAGS_$(DIR)/post-global = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/post-global = $(MPILDFLAGS)
+MODLIBS_$(DIR)/post-global = $(MPILIBS)
+MODCC_$(DIR)/post-global = $(MPICC)
+
+MODCFLAGS_$(DIR)/engine1 = $(MPICFLAGS)
+MODLDFLAGS_$(DIR)/engine1 = $(MPILDFLAGS)
+MODLIBS_$(DIR)/engine1 = $(MPILIBS)
+MODCC_$(DIR)/engine1 = $(MPICC)
+
+MODCFLAGS_$(DIR)/rosd-start = $(MPICFLAGS) \
+ -D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
+ -Wunused-variable
+MODLDFLAGS_$(DIR)/rosd-start = $(MPILDFLAGS)
+MODLINKWITH_$(DIR)/rosd-start = src/replicated-osd/tests/rosd-test-builder.o
+
+MODCFLAGS_$(DIR)/rosd-global = $(MPICFLAGS) \
+ -D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
+ -Wunused-variable
+MODLDFLAGS_$(DIR)/rosd-global = $(MPILDFLAGS)
+MODLIBS_$(DIR)/rosd-global = $(MPILIBS)
+MODCC_$(DIR)/rosd-global = $(MPICC)
+MODLINKWITH_$(DIR)/rosd-global = src/replicated-osd/tests/rosd-test-builder.o
+
+MODCFLAGS_$(DIR)/rosd-status = $(MPICFLAGS) \
+ -D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
+ -Wunused-variable
+MODLDFLAGS_$(DIR)/rosd-status = $(MPILDFLAGS)
+MODLIBS_$(DIR)/rosd-status = $(MPILIBS)
+MODCC_$(DIR)/rosd-status = $(MPICC)
+
+MODCFLAGS_$(DIR)/rosd-trigger = $(MPICFLAGS) \
+ -D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
+ -Wunused-variable
+MODLDFLAGS_$(DIR)/rosd-trigger = $(MPILDFLAGS)
+MODLIBS_$(DIR)/rosd-trigger = $(MPILIBS)
+MODCC_$(DIR)/rosd-trigger = $(MPICC)
+
+MODCFLAGS_$(DIR)/rosd-peers = $(MPICFLAGS) \
+ -D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
+ -Wunused-variable
+MODLDFLAGS_$(DIR)/rosd-peers = $(MPILDFLAGS)
+MODLIBS_$(DIR)/rosd-peers = $(MPILIBS)
+MODCC_$(DIR)/rosd-peers = $(MPICC)
+
+MODCFLAGS_$(DIR)/rosd-injection = $(MPICFLAGS) \
+ -D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
+ -Wunused-variable
+MODLDFLAGS_$(DIR)/rosd-injection = $(MPILDFLAGS)
+MODLIBS_$(DIR)/rosd-injection = $(MPILIBS)
+MODCC_$(DIR)/rosd-injection = $(MPICC)
+MODLINKWITH_$(DIR)/rosd-injection = src/replicated-osd/tests/rosd-test-builder.o
\ No newline at end of file
diff --git a/code/src/state/test/post-global.ae b/code/src/state/tests/post-global.ae
similarity index 100%
rename from code/src/state/test/post-global.ae
rename to code/src/state/tests/post-global.ae
diff --git a/code/src/state/tests/post-global.sh b/code/src/state/tests/post-global.sh
new file mode 100755
index 0000000..bc388bc
--- /dev/null
+++ b/code/src/state/tests/post-global.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
+
+shopt -s extglob
+SCRIPT=$0
+BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
+OUT=${BIN}.out
+
+# Test with sorted input...
+mpiexec -l -n 4 ${BIN} ${SRCDIR}/src/mapping/tests/hosts2.txt > ${OUT} 2>&1
+[[ $? == 0 ]] || exit 1
+
+LINES=$( grep "done" ${OUT} | wc -l )
+[[ $? == 0 ]] || exit 1
+[[ ${LINES} == 4 ]] || exit 1
+
+echo OK
+exit 0
diff --git a/code/src/state/test/rosd-injection.ae b/code/src/state/tests/rosd-injection.ae
similarity index 100%
rename from code/src/state/test/rosd-injection.ae
rename to code/src/state/tests/rosd-injection.ae
diff --git a/code/src/state/test/rosd-injection.sh b/code/src/state/tests/rosd-injection.sh
similarity index 100%
rename from code/src/state/test/rosd-injection.sh
rename to code/src/state/tests/rosd-injection.sh
diff --git a/code/src/state/test/rosd-recover.ae b/code/src/state/tests/rosd-recover.ae
similarity index 100%
rename from code/src/state/test/rosd-recover.ae
rename to code/src/state/tests/rosd-recover.ae
diff --git a/code/src/state/tests/rosd-recover.sh b/code/src/state/tests/rosd-recover.sh
new file mode 100755
index 0000000..83e952a
--- /dev/null
+++ b/code/src/state/tests/rosd-recover.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
+
+shopt -s extglob
+SCRIPT=$0
+BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
+OUT=${BIN}.out
+
+export triton_fakess_method=fault
+export aesop_remote_default_net=fault
+
+# Test with sorted input...
+mpiexec -l -n 4 ${VALGRIND} ${BIN} /tmp/rosd.db /tmp/rosd-log \
+ 1 1 0 0 2 1 ${SRCDIR}/src/mapping/tests/faulty2.txt > ${OUT} 2>&1
+[[ $? == 0 ]] || exit 1
+
+LINES=$( grep "status change:" ${OUT} | wc -l )
+[[ $? == 0 ]] || exit 1
+# Handle this check later:
+# [[ ${LINES} == 6 ]] || exit 1
+
+echo OK
+exit 0
diff --git a/code/src/state/test/rosd-start.ae b/code/src/state/tests/rosd-start.ae
similarity index 100%
rename from code/src/state/test/rosd-start.ae
rename to code/src/state/tests/rosd-start.ae
diff --git a/code/src/state/test/rosd-start.sh b/code/src/state/tests/rosd-start.sh
similarity index 100%
rename from code/src/state/test/rosd-start.sh
rename to code/src/state/tests/rosd-start.sh
diff --git a/code/src/state/test/rpc-global.ae b/code/src/state/tests/rpc-global.ae
similarity index 100%
rename from code/src/state/test/rpc-global.ae
rename to code/src/state/tests/rpc-global.ae
diff --git a/code/src/state/tests/rpc-global.sh b/code/src/state/tests/rpc-global.sh
new file mode 100755
index 0000000..e3e16ff
--- /dev/null
+++ b/code/src/state/tests/rpc-global.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
+
+shopt -s extglob
+SCRIPT=$0
+BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
+OUT=${BIN}.out
+
+mpiexec -l -n 4 ${BIN} ${SRCDIR}/src/mapping/tests/hosts2.txt > ${OUT} 2>&1
+[[ $? == 0 ]] || exit 1
+
+LINES=$( grep "value: 34" ${OUT} | wc -l )
+[[ $? == 0 ]] || exit 1
+[[ ${LINES} == 3 ]] || exit 1
+
+LINES=$( grep "size: 3" ${OUT} | wc -l )
+[[ $? == 0 ]] || exit 1
+[[ ${LINES} == 4 ]] || exit 1
+
+echo OK
+exit 0
diff --git a/code/src/state/test/rpc-list.ae b/code/src/state/tests/rpc-list.ae
similarity index 100%
rename from code/src/state/test/rpc-list.ae
rename to code/src/state/tests/rpc-list.ae
diff --git a/code/src/state/tests/rpc-list.sh b/code/src/state/tests/rpc-list.sh
new file mode 100755
index 0000000..72eedb7
--- /dev/null
+++ b/code/src/state/tests/rpc-list.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
+
+shopt -s extglob
+SCRIPT=$0
+BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
+OUT=${BIN}.out
+
+triton_debug_masks=triton.mapping triton_debug_file=/dev/stderr \
+ mpiexec -l -n 4 ${BIN} ${SRCDIR}/src/mapping/tests/hosts2.txt > ${OUT} 2>&1
+[[ $? == 0 ]] || exit 1
+
+LINES=$( grep -c "node:" ${OUT} )
+[[ $? == 0 ]] || exit 1
+[[ ${LINES} == 4 ]] || exit 1
+
+# state.size includes triton_node_null
+LINES=$( grep -c "size: 3" ${OUT} )
+[[ $? == 0 ]] || exit 1
+[[ ${LINES} == 2 ]] || exit 1
+
+LINES=$( grep -c "done" ${OUT} )
+[[ $? == 0 ]] || exit 1
+[[ ${LINES} == 4 ]] || exit 1
+
+echo OK
+exit 0
diff --git a/code/src/state/test/rpc-size.ae b/code/src/state/tests/rpc-size.ae
similarity index 100%
rename from code/src/state/test/rpc-size.ae
rename to code/src/state/tests/rpc-size.ae
diff --git a/code/src/state/tests/rpc-size.sh b/code/src/state/tests/rpc-size.sh
new file mode 100755
index 0000000..8507061
--- /dev/null
+++ b/code/src/state/tests/rpc-size.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
+
+shopt -s extglob
+SCRIPT=$0
+BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
+OUT=${BIN}.out
+
+mpiexec -l -n 2 ${BIN} ${SRCDIR}/src/mapping/tests/hosts1a.txt > ${OUT} 2>&1
+[[ $? == 0 ]] || exit 1
+
+grep "result: 2" ${OUT} > /dev/null || exit 1
+
+LINES=$( grep "done" ${OUT} | wc -l )
+[[ $? == 0 ]] || exit 1
+[[ ${LINES} == 2 ]] || exit 1
+
+echo OK
+exit 0
diff --git a/code/src/state/tests/shutdown.ae b/code/src/state/tests/shutdown.ae
new file mode 100644
index 0000000..791ccec
--- /dev/null
+++ b/code/src/state/tests/shutdown.ae
@@ -0,0 +1,132 @@
+
+/**
+ Test state.shutdown()
+ Example:
+ mpiexec -l -n 3 src/state/tests/shutdown src/mapping/tests/hosts2.txt
+*/
+
+#include <stdbool.h>
+#include <stdio.h>
+#include "src/aesop/aesop.h"
+#include "src/common/triton-notify.h"
+#include "src/common/resources/timer/timer.hae"
+#include "src/net/mpi/mpi.hae"
+#include "src/fakess/fakess.hae"
+#include "src/mapping/mapping.hae"
+
+#include <sys/types.h>
+#include <unistd.h>
+
+static __blocking void sender()
+{
+ printf("sender()...\n");
+ printf("shutdown...\n");
+ triton_state.shutdown();
+}
+
+static __blocking void receiver()
+{
+ printf("receiver():\n");
+ while (triton_state.running())
+ {
+ triton_state.recv();
+ }
+}
+
+static __blocking int dostuff(char *hostlist)
+{
+ int rank;
+
+ triton_fakess_state_install();
+ triton_map_file(hostlist);
+ triton_state.load();
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+ if (rank == 0)
+ {
+ sender();
+ }
+ else if (rank == 1)
+ {
+ receiver();
+ }
+
+ return 0;
+}
+
+int done = 0;
+int dostuff_ret;
+
+static void done_callback(void *user_ptr, int ret)
+{
+ ae_context_t ctx = (ae_context_t)user_ptr;
+ dostuff_ret = ret;
+ done = 1;
+ ae_poll_break(ctx);
+}
+
+int main(int argc, char *argv[])
+{
+ triton_ret_t ret;
+ ae_op_id_t op_id;
+ ae_context_t ctx;
+ ae_hints_t hints;
+
+ char *hostlist;
+
+ /* GDB_WAIT: */
+ int gdb_wait = 0;
+ pid_t pid;
+ int rank;
+
+ assert(argc == 2);
+
+ hostlist = argv[1];
+
+ triton_init("triton.client");
+
+ if (getenv("GDB_WAIT"))
+ {
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ if (rank == 0)
+ {
+ pid = getpid();
+ printf("gdb_wait: rank: %i pid: %i\n", rank, pid);
+ while (!gdb_wait);
+ }
+ }
+
+ ae_context_create(&ctx, "mpi", "timer", "sched");
+
+ ae_hints_init(&hints);
+ ret = ae_post_blocking(dostuff, done_callback, ctx, &hints, ctx, &op_id,
+ &dostuff_ret, hostlist);
+ if(ret == TRITON_SUCCESS)
+ {
+ while (done == 0)
+ {
+ ae_poll(ctx, 10);
+ }
+ }
+ triton_error_assert(ret);
+ ae_hints_destroy(&hints);
+ ae_context_destroy(ctx);
+
+ printf("done\n");
+
+ triton_finalize();
+ // ae_context_destroy(ctx);
+ // MPI_Finalize();
+
+ return dostuff_ret;
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ft=c ts=8 sts=4 sw=4 expandtab
+ */
diff --git a/code/src/state/tests/shutdown.sh b/code/src/state/tests/shutdown.sh
new file mode 100755
index 0000000..1615577
--- /dev/null
+++ b/code/src/state/tests/shutdown.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
+
+shopt -s extglob
+SCRIPT=$0
+BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
+OUT=${BIN}.out
+
+# Test with sorted input...
+mpiexec -l -n 3 ${BIN} ${SRCDIR}/src/mapping/tests/hosts2.txt > ${OUT} 2>&1
+[[ $? == 0 ]] || exit 1
+
+LINES=$( grep "done" ${OUT} | wc -l )
+[[ $? == 0 ]] || exit 1
+[[ ${LINES} == 3 ]] || exit 1
+
+echo OK
+exit 0
diff --git a/code/src/state/test/state-client.ae b/code/src/state/tests/state-client.ae
similarity index 100%
rename from code/src/state/test/state-client.ae
rename to code/src/state/tests/state-client.ae
hooks/post-receive
--
Triton Repository
1
0
Triton Repository branch, master, updated. 5abd6398b0c74a3bbf76826446d6262a03f683ee
by noreply@mcs.anl.gov 05 Mar '12
by noreply@mcs.anl.gov 05 Mar '12
05 Mar '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Triton Repository".
The branch, master has been updated
via 5abd6398b0c74a3bbf76826446d6262a03f683ee (commit)
from d9cba65b8fa9ac622ac48305bdf4b1910e807bb8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5abd6398b0c74a3bbf76826446d6262a03f683ee
Author: Justin M Wozniak <wozniak(a)mcs.anl.gov>
Date: Mon Mar 5 14:10:52 2012 -0600
New system state documentation
-----------------------------------------------------------------------
Summary of changes:
code/doc/state.txt | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 88 insertions(+), 0 deletions(-)
create mode 100644 code/doc/state.txt
Diff of changes:
diff --git a/code/doc/state.txt b/code/doc/state.txt
new file mode 100644
index 0000000..b73edbf
--- /dev/null
+++ b/code/doc/state.txt
@@ -0,0 +1,88 @@
+= Triton Fault Response System
+
+== Introduction
+
+This page documents the state interfaces and outlines procedures used
+to respond to fault states among Triton servers.
+
+== Components
+
+The following components are used:
+
++placement+:: Placement algorithm abstraction layer.
+Maps OIDs to server addresses
+
++fakess+:: Fake system state.
+Broadcasts system state changes without a real gossip protocol
+
++state+:: State interface.
+Interface to system state system. Interface is implemented by +fakess+
+
++rebuild+:: Rebuild work manager.
+Responds to state changes, schedules repair operations
+
++TOSD+:: The local storage component
+
+== Operation
+
+=== Use of system state
+
+. System state is represented as a globally-visible key/value store
+. Each server has a local cache of all key/value pairs
+. Servers can query and post to the store
+. Servers can block on a key using Aesop functionality and
+receive a notification when the value changes
+. Servers use Aesop functionality to block on keys corresponding to
+the state of peer servers
+
+=== Current functionality
+
+Currently, the following functionality has been implemented:
+
+. The test framework instantiates a Triton client/server network
+. A client can inject a state change on a server through an
+administrative RPC
+. This RPC is implemented by the +state+ component:
+.. Local operations are performed
+.. The state changes is posted to +fakess+
+. On an unaffected server, when a peer server enters a fault state,
+the +state+ component is notified
+. It posts the state update to the +rebuild+ component
+. The +rebuild+ component queries +TOSD+ for affected user data
+. Work units (i.e., replica transfers) are enqueued to repair the
+damage
+
+== State API
+
+An underlying state implementation should:
+
+. Implement the function pointers found in +state.hae+
+. Provide a function to install itself as the state implementation
+(cf. +triton_fakess_state_install()+)
+
+=== Core features
+
++item_add()+:: Add a node/key item to the store
+
++post()+:: Set a new node/key/value, notifying other servers
+
++lookup()+:: Given a node/key, obtain the data item. The data item
+contains an Aesop +sched+ that may be used to receive notifications
+
++propagation()+:: Obtain an estimate of the gossip protocol
+propagation time
+
+=== Configuration features
+
++init()+:: Initialize the component
+
++list()+:: Obtain the list of healthy servers
+
++engine_start()+:: Start the system. This is intended to be called
+from a +pbranch+. This function returns when the state system is shut
+down
+
++engine_stop()+:: Shut down the system
+
++finalize()+:: Finalize the component
+
hooks/post-receive
--
Triton Repository
1
0
Triton-private Repository branch, master, updated. 46b49bc605d78b3c5ed31a98a2cb23ecb856704d
by noreply@mcs.anl.gov 05 Mar '12
by noreply@mcs.anl.gov 05 Mar '12
05 Mar '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Triton-private Repository".
The branch, master has been updated
via 46b49bc605d78b3c5ed31a98a2cb23ecb856704d (commit)
from e0bd168d488010980fb366c5b230cb94557d4ba4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 46b49bc605d78b3c5ed31a98a2cb23ecb856704d
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Mon Mar 5 14:57:04 2012 -0500
more comments
-----------------------------------------------------------------------
Summary of changes:
papers/2011/aesop/model.tex | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
Diff of changes:
diff --git a/papers/2011/aesop/model.tex b/papers/2011/aesop/model.tex
index 8356377..e755941 100644
--- a/papers/2011/aesop/model.tex
+++ b/papers/2011/aesop/model.tex
@@ -25,7 +25,11 @@ using the shared instance when the branch is created. \color{red}PHC:
clarify that when you say variables are shared between pbranches by default,
you are only talking about variables declared in the scope containing the
pbranch. Variables actually declared in the pbranch itself are private by
-default.\color{black}
+default.\color{black}
+
+\color{red}PHC: also, if there is a similar notation in any of the other
+parallel programming models (openmp or whatever) for shared/private
+variables then we should cite at least one example here.\color{black}
It is possible for a pbranch to request the termination (or cancellation) of
all other pbranches within the same pwait by calling the
@@ -41,6 +45,10 @@ say that a cancelled pbranch will receive a well-known (ECANCELLED) error
code from affected functions, and that a pbranch can also check its
cancellation state manually at any time?\color{black}
+\color{red}PHC: it might also be good to contrast the aesop cancel
+functionality with pthread\_cancel() and point out why the aesop
+functionality is better.\color{black}
+
\aesop also supports {\em lonely pbranches}, i.e.\ pbranches created outside
of a pwait. A lonely pbranch is similar to a POSIX detached thread in that
lonely pbranches cannot be cancelled or synchronized with.
hooks/post-receive
--
Triton-private Repository
1
0
Triton-private Repository branch, master, updated. e0bd168d488010980fb366c5b230cb94557d4ba4
by noreply@mcs.anl.gov 05 Mar '12
by noreply@mcs.anl.gov 05 Mar '12
05 Mar '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Triton-private Repository".
The branch, master has been updated
via e0bd168d488010980fb366c5b230cb94557d4ba4 (commit)
via 47c49f80e89017b38d53c94e63632e2b504df65e (commit)
from 838aa2a6cb11e27147c8b77578ab993288ab7868 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e0bd168d488010980fb366c5b230cb94557d4ba4
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Mon Mar 5 14:52:28 2012 -0500
draft conclusion section
commit 47c49f80e89017b38d53c94e63632e2b504df65e
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Mon Mar 5 14:52:22 2012 -0500
tweak abstract
-----------------------------------------------------------------------
Summary of changes:
papers/2011/aesop/aesop.tex | 6 +++-
papers/2011/aesop/conclusion.tex | 72 +++++++++++++++++++-------------------
2 files changed, 41 insertions(+), 37 deletions(-)
Diff of changes:
diff --git a/papers/2011/aesop/aesop.tex b/papers/2011/aesop/aesop.tex
index 5d21b22..b321718 100644
--- a/papers/2011/aesop/aesop.tex
+++ b/papers/2011/aesop/aesop.tex
@@ -98,7 +98,11 @@ successful. Unfortunately, there is no single programming model for
distributed system software that offers optimal performance in all cases.
In addition, many concurrent server architectures introduce software
complexity that influences algorithm development and hinders software
-maintenance and portability.
+maintenance and portability. Numerous languages and language
+extensions have been developed in recent years to simplify parallel
+computation, but they do not address the challenges of distributed system
+software in which concurrency control involves a variety of hardware
+and network devices, not just computational resources.
In this work we present \aesop, a new programming language and programming
model designed to implement distributed system software with
diff --git a/papers/2011/aesop/conclusion.tex b/papers/2011/aesop/conclusion.tex
index 6e2f7e1..f56b26b 100644
--- a/papers/2011/aesop/conclusion.tex
+++ b/papers/2011/aesop/conclusion.tex
@@ -1,41 +1,41 @@
\label{section:conclusion}
-Much focus has been placed on programming models for parallel computing.
-The focus has been on the constructs to build parallel programs, with
-little research on the constructs for building the storage and I/O systems
-of HPC.
-
-Storage systems are by far the most complex software component
-in HPC systems today, requiring persistence, high performance,
-aggregation models, fault tolerance and high availability,
-semantic guarantees, etc...
-
-Reducing the complexity of such storage software is vital to allow storage
-software to be inspected and understood at a high level, ultimately ensuring
-that the software is valid. This work is a preliminary step in that
-direction.
-
-% use section* for acknowledgement
-
-
-% talk about remote code generation
-
-%\subsection{Future Work}
-
-While Aesop is currently feature complete and actively used to developed
-distributed system software, a number of issues remain.
-Not all language constraints are correctly enforced, leading to program
-misbehaviour at runtime.
-
-Debugging the generated code is difficult due to the highly non-linear
-execution flow. The translation of aesop code to C code is an order of
-magnitute slower than the compilation of the resulting C code, significantly
-increasing build time compared to hand-written C code and thus
-reducing programmer productivity.
-
-Aesop also implements extensions for remote procedure calls (RPC), making it
-possible to seamlessly call a remote function in the same way as a local
-function. We defer the discussion of this functionality to a another paper.
+In this work we have introduced a new programming model and programming
+language, known as \aesop, that was designed with the explicit goal of
+supporting distributed system software development. Its primary feature is
+that it allows system software developers to express concurrency without
+dictating the threading or event model used to provide that concurrency. It
+also provides a number of language constructs that simplify common system
+software development patterns. Numerous languages and language
+extensions have been developed in recent years to simplify parallel
+computation, but \aesop is unique in that it addresses the challenges of
+distributed system software in which concurrency control involves a variety of
+hardware and network devices, not just computational resources.
+
+\color{red}TODO: sprinkle in some of the important numbers from the
+evaluation section here. \color{black}
+
+From our experimental evaluation, we see that Aesop offers competitive,
+and in some cases superior, runtime performance to the most common system
+software concurrency models in use today. We expect Aesop to continue
+to perform well at even larger scales than those evaluated in this study
+due to the fact that it does not rely on mapping concurrent execution
+paths to dedicated operating system threads. We have also found that
+the Aesop language reduces code complexity while also offering advanced
+primitives such as cancellation of execution paths and control
+of variable scope that are not available in any other system software
+development environment.
+
+We will continue to evaluate and evolve the Aesop language as we use it
+to implement future production HPC storage services. As part of this
+work we will likely extend the language to include additional features.
+One example, which exists in prototype form already, is remote procedure
+call (RPC) framework that uses Aesop to manage concurrent communication,
+timeout, and retry functionality in a transparent manner. We also plan to
+improve debugging functionality by providing mechanisms to trace control
+flow through Aesop blocking functions. This will allow us to generate
+more meaningful stack traces that map directly to the original Aesop
+code rather than the underlying C code that it has been translated to.
%- Need to fix some parser issues
%- Compilation speed
hooks/post-receive
--
Triton-private Repository
1
0
Triton-private Repository branch, master, updated. 838aa2a6cb11e27147c8b77578ab993288ab7868
by noreply@mcs.anl.gov 05 Mar '12
by noreply@mcs.anl.gov 05 Mar '12
05 Mar '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Triton-private Repository".
The branch, master has been updated
via 838aa2a6cb11e27147c8b77578ab993288ab7868 (commit)
from 33fe0b97300c6d64aeece8634f0c650e2fdb4551 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 838aa2a6cb11e27147c8b77578ab993288ab7868
Author: Kevin Harms <harms(a)alcf.anl.gov>
Date: Mon Mar 5 13:26:50 2012 -0600
Fix up perf graph subfig and use subfig instead of subfigure, fix up some citations.
-----------------------------------------------------------------------
Summary of changes:
papers/2011/aesop/aesop.tex | 2 +-
papers/2011/aesop/evaluation.tex | 23 +++++++++++------------
2 files changed, 12 insertions(+), 13 deletions(-)
Diff of changes:
diff --git a/papers/2011/aesop/aesop.tex b/papers/2011/aesop/aesop.tex
index 66ec2b6..5d21b22 100644
--- a/papers/2011/aesop/aesop.tex
+++ b/papers/2011/aesop/aesop.tex
@@ -7,7 +7,7 @@
\usepackage{listing}
\usepackage{hyperref}
\usepackage{listings}
-\usepackage{subfigure}
+\usepackage{subfig}
\usepackage{xspace}
\graphicspath{{./}}
diff --git a/papers/2011/aesop/evaluation.tex b/papers/2011/aesop/evaluation.tex
index 21ec4b8..fe7e057 100644
--- a/papers/2011/aesop/evaluation.tex
+++ b/papers/2011/aesop/evaluation.tex
@@ -88,7 +88,7 @@ request processing. Each server uses the same fundamental coding style to
the degree possible. One server is implemented using the Aesop language,
while all other servers are implemented in C. The pthread library was
used in all cases that required explicit threading, while the
-libev~\ref{libev-web} library was used in all cases that required an
+libev~\cite{libev-web} library was used in all cases that required an
explicit event loop.
Each server is setup to report the VmHWM stat when the application exits.
@@ -213,28 +213,27 @@ section that poor Aesop performance at small scale is likely a tuning flaw
in the file resource used in the Aesop standard library, rather than a
fundamental programming language problem.
-\begin{figure}[ht]
+\begin{figure*}[ht]
\centering
- \subfigure[Read performance]{
+ \subfloat[Read performance]{
\includegraphics[keepaspectratio,width=0.45\textwidth]{fig/read-hist.pdf}
\label{fig:read}
}
-
- \subfigure[Write performance]{
+ \subfloat[Write performance]{
\includegraphics[keepaspectratio,width=0.45\textwidth]{fig/write-hist.pdf}
\label{fig:write}
}
- \subfigure[Read-null performance]{
+ \subfloat[Read-null performance]{
\includegraphics[keepaspectratio,width=0.45\textwidth]{fig/read-null-hist.pdf}
\label{fig:readnull}
}
-
- \subfigure[Write-null performance]{
+ \subfloat[Write-null performance]{
\includegraphics[keepaspectratio,width=0.45\textwidth]{fig/write-null-hist.pdf}
\label{fig:writenull}
}
-\end{figure}
+ \caption{Runtime performance for four test cases}
+\end{figure*}
\subsubsection{Latency}
@@ -309,12 +308,12 @@ event & 28 & 23 & 341 \\
\end{table}
Table~\ref{tab:complexity} compares the code complexity of each server
-implemenation using McCabe Cyclomatic Complexity (CC) \ref{mccabe},
+implemenation using McCabe Cyclomatic Complexity (CC) \cite{mccabe},
Modified McCabe Cyclomatic Complexity (mod. CC), and
Source Lines of Code (SLOC). The CC and Mod. CC metrics were measured
-using the pmccabe tool, version 2.6, created by Paul Bame \ref{pmccabe},
+using the pmccabe tool, version 2.6, created by Paul Bame \cite{pmccabe},
while the SLOC metrics were measured using the sloccount tool,
-version 2.26, created by David A. Wheeler \ref{sloccount}.
+version 2.26, created by David A. Wheeler \cite{sloccount}.
To simplify the comparison, all four servers had no error handling except
for assertions on expected return codes. The protocol definition (ie,
hooks/post-receive
--
Triton-private Repository
1
0
Triton-private Repository branch, master, updated. 33fe0b97300c6d64aeece8634f0c650e2fdb4551
by noreply@mcs.anl.gov 05 Mar '12
by noreply@mcs.anl.gov 05 Mar '12
05 Mar '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Triton-private Repository".
The branch, master has been updated
via 33fe0b97300c6d64aeece8634f0c650e2fdb4551 (commit)
from 837daad841732767d04f354ab05a3a6e6bf271f2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 33fe0b97300c6d64aeece8634f0c650e2fdb4551
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Mon Mar 5 14:14:13 2012 -0500
draft abstract, probably too long again
-----------------------------------------------------------------------
Summary of changes:
papers/2011/aesop/aesop.tex | 40 ++++++++++++++++++++++++++++------------
1 files changed, 28 insertions(+), 12 deletions(-)
Diff of changes:
diff --git a/papers/2011/aesop/aesop.tex b/papers/2011/aesop/aesop.tex
index 05a3d96..66ec2b6 100644
--- a/papers/2011/aesop/aesop.tex
+++ b/papers/2011/aesop/aesop.tex
@@ -89,20 +89,36 @@ Argonne, IL 60439\\
\maketitle
\begin{abstract}
-This paper describes \aesop, a new programming language and programming
-model designed to implement distributed system software with high
-development productivity while maintining
-run time efficiency. \aesop is implemented as a source-to-source compiler
-that
-extends the C language with a set of concurrency extensions designed for
-distributed computing.
+HPC and distributed systems rely on a diverse collection of system
+software to provide application services, including file systems,
+schedulers, web services, and fault detectors. Such system software
+services must manage highly concurrent requests, interact with
+diverse resources resources, and scale efficiently in order to be
+successful. Unfortunately, there is no single programming model for
+distributed system software that offers optimal performance in all cases.
+In addition, many concurrent server architectures introduce software
+complexity that influences algorithm development and hinders software
+maintenance and portability.
+
+In this work we present \aesop, a new programming language and programming
+model designed to implement distributed system software with
+high development productivity and run time efficiency. \aesop is
+a superset of the C language that describes blocks of code to be executed
+concurrently without dictating the threading or event model that will be
+used to provide that concurrency. This decoupling of algorithm description
+and run time implementation enables system software to adjust to different
+architectures, device APIs, and workloads without any change to the core
+algorithm implementation. \aesop also provides a set of language constructs
+that provide more
+expressive control over concurrent execution than is typically found in
+multithreaded or event-driven programming models.
We evaluate \aesop by implementing a simple file server and comparing its
-implementation and performance against traditional thread-based and
-event-based programming models.
-
-Our work shows that \aesop succeeds in maintaining sequential program flow,
-while at the same time generating ...
+performance, memory efficiency, and developer productivity to several
+thread-based and event-based implementations. \aesop is shown to provide
+competitive (and in some cases superior) performance to traditional
+distributed system software development models while also reducing code
+complexity and providing constructs that enhance developer productivity.
\end{abstract}
\section{Introduction}
hooks/post-receive
--
Triton-private Repository
1
0
Triton Repository branch, master, updated. d9cba65b8fa9ac622ac48305bdf4b1910e807bb8
by noreply@mcs.anl.gov 05 Mar '12
by noreply@mcs.anl.gov 05 Mar '12
05 Mar '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Triton Repository".
The branch, master has been updated
via d9cba65b8fa9ac622ac48305bdf4b1910e807bb8 (commit)
via 9ef918961e1b665f356be315a0d6f15b81547f4d (commit)
via 7182f4af8808f967acaa93b9cd2087453fe99fed (commit)
via cc1704188ddc83ae4fb59d52cf0c5b961ba82630 (commit)
from 1531f2b5f95d94114666e44fd19112e80e190214 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d9cba65b8fa9ac622ac48305bdf4b1910e807bb8
Author: Justin M Wozniak <wozniak(a)mcs.anl.gov>
Date: Mon Mar 5 12:56:18 2012 -0600
System state update works: client-injected fault triggers entry into rebuild module
Also, clear out some unused tests
commit 9ef918961e1b665f356be315a0d6f15b81547f4d
Author: Justin M Wozniak <wozniak(a)mcs.anl.gov>
Date: Mon Mar 5 12:48:18 2012 -0600
Wait for server to wait on fakess messages
commit 7182f4af8808f967acaa93b9cd2087453fe99fed
Author: Justin M Wozniak <wozniak(a)mcs.anl.gov>
Date: Mon Mar 5 12:47:55 2012 -0600
Fix output
commit cc1704188ddc83ae4fb59d52cf0c5b961ba82630
Author: Justin M Wozniak <wozniak(a)mcs.anl.gov>
Date: Mon Mar 5 12:47:16 2012 -0600
Better output
-----------------------------------------------------------------------
Summary of changes:
code/src/fakess/fakess.ae | 31 +-
code/src/rebuild/rebuild.ae | 4 +-
code/src/replicated-osd/rosd-test-harness.ae | 9 +
code/src/replicated-osd/tests/rosd-test-builder.ae | 2 +
code/src/state/state-client.aer | 4 +-
code/src/state/state.ae | 70 ++-
code/src/state/test/module.mk.in | 10 +-
code/src/state/test/rosd-global.ae | 65 ---
code/src/state/test/rosd-global.sh | 20 -
code/src/state/test/rosd-injection.ae | 13 +-
code/src/state/test/rosd-maint.ae | 483 --------------------
code/src/state/test/rosd-maint.sh | 20 -
code/src/state/test/rosd-peers.ae | 473 -------------------
code/src/state/test/rosd-peers.sh | 28 --
code/src/state/test/rosd-status.ae | 475 -------------------
code/src/state/test/rosd-status.sh | 20 -
code/src/state/test/rosd-trigger.ae | 472 -------------------
code/src/state/test/rosd-trigger.sh | 20 -
18 files changed, 90 insertions(+), 2129 deletions(-)
delete mode 100644 code/src/state/test/rosd-global.ae
delete mode 100755 code/src/state/test/rosd-global.sh
delete mode 100644 code/src/state/test/rosd-maint.ae
delete mode 100755 code/src/state/test/rosd-maint.sh
delete mode 100644 code/src/state/test/rosd-peers.ae
delete mode 100755 code/src/state/test/rosd-peers.sh
delete mode 100644 code/src/state/test/rosd-status.ae
delete mode 100755 code/src/state/test/rosd-status.sh
delete mode 100644 code/src/state/test/rosd-trigger.ae
delete mode 100755 code/src/state/test/rosd-trigger.sh
Diff of changes:
diff --git a/code/src/fakess/fakess.ae b/code/src/fakess/fakess.ae
index 87786d5..daea3cd 100644
--- a/code/src/fakess/fakess.ae
+++ b/code/src/fakess/fakess.ae
@@ -146,18 +146,6 @@ triton_ret_t triton_fakess_init(void)
assert(!initialized);
- triton_debug_add_mask("triton.fakess", &debug,
- "Triton fake system state");
-
- triton_debug_add_mask("triton.fakess.system", &debug_system,
- "Triton fake system state system");
-
- triton_debug_add_mask("triton.fakess.data", &debug_data,
- "Triton fake system state lookups");
-
- triton_debug_add_mask("triton.fakess.trace", &debug_trace,
- "Triton fake system state trace");
-
triton_zeroconf_register(method_confkey, "mpi", NULL,
"fakess messaging method");
@@ -184,6 +172,18 @@ triton_ret_t triton_fakess_init_stage2(void)
const char *method = triton_zeroconf_get(method_confkey);
assert(method);
+ triton_debug_add_mask("triton.fakess", &debug,
+ "Triton fake system state");
+
+ triton_debug_add_mask("triton.fakess.system", &debug_system,
+ "Triton fake system state system");
+
+ triton_debug_add_mask("triton.fakess.data", &debug_data,
+ "Triton fake system state lookups");
+
+ triton_debug_add_mask("triton.fakess.trace", &debug_trace,
+ "Triton fake system state trace");
+
result = triton_msg_group_add(method, "triton.fakess", &msg_group);
triton_error_assert(result);
return result;
@@ -445,7 +445,8 @@ triton_ret_t triton_fakess_set(triton_state_data_t *data,
triton_mutex_lock(&data->mutex);
update(data, value, value_length);
- triton_debug(debug_trace, "notify_all: %p %p\n", data, data->sched);
+ // triton_debug(debug_trace, "notify_all: %p %p\n", data, data->sched);
+ // printf("notify_all: %p %p\n", data, data->sched);
triton_sched_notify_all(data->sched);
triton_mutex_unlock(&data->mutex);
@@ -528,11 +529,13 @@ __blocking triton_ret_t triton_fakess_post(triton_node_t node,
assert(initialized);
+ // printf("post: %s\n", triton_string_get(key));
+
tag = triton_msg_new_tag(msg_group);
if (triton_debug_enabled(debug_system))
{
triton_node_to_string(node, &tmp);
- triton_debug(debug_system, "post: node: %s key: %s\n",
+ triton_debug(debug, "post: node: %s key: %s\n",
triton_string_get(&tmp), triton_string_get(key));
triton_string_destroy(&tmp);
}
diff --git a/code/src/rebuild/rebuild.ae b/code/src/rebuild/rebuild.ae
index 5ccdbdc..5c7c0c6 100644
--- a/code/src/rebuild/rebuild.ae
+++ b/code/src/rebuild/rebuild.ae
@@ -55,7 +55,7 @@ __blocking void enumerate_stub_wus(triton_node_t self,
triton_ret_t ret;
triton_node_t other;
- puts("enumerate");
+ printf("rebuild: enumerate work units...\n");
offset = 0;
while (true)
@@ -85,7 +85,7 @@ __blocking void triton_rebuild_recovery_enter(triton_node_t failed)
{
triton_node_t self;
- puts("recovery_enter");
+ printf("rebuild: recovery_enter()...\n");
self = triton_map_self();
if (triton_cmp_node(self, failed) == 0)
diff --git a/code/src/replicated-osd/rosd-test-harness.ae b/code/src/replicated-osd/rosd-test-harness.ae
index a1ca724..f29de2a 100644
--- a/code/src/replicated-osd/rosd-test-harness.ae
+++ b/code/src/replicated-osd/rosd-test-harness.ae
@@ -6,6 +6,8 @@
#include <limits.h>
#include <unistd.h>
+#include "src/aesop/aesop-support.hae"
+
#include "src/replicated-osd/rosd-test-harness.hae"
#include "src/mapping/mapping.hae"
#include "src/placement/placement.hae"
@@ -21,6 +23,7 @@
#include "src/state/sc_stubs.hae"
#include "src/state/sc_module.h"
+#include "src/state/state.hae"
#include "mpi.h"
@@ -589,6 +592,8 @@ __blocking triton_ret_t rosd_test_harness_noop(struct rosd_test_harness_options*
}
+__blocking void monitor_state();
+
__blocking triton_ret_t rosd_test_harness_server_fn(int nservers, int nclients, void* data, MPI_Comm server_comm)
{
triton_ret_t ret;
@@ -658,6 +663,10 @@ __blocking triton_ret_t rosd_test_harness_server_fn(int nservers, int nclients,
/* TODO: error handling */
triton_error_assert(fakess_ret);
}
+ pbranch
+ {
+ triton_state_monitor();
+ }
}
/* will exit when it gets a shutdown request from a client */
diff --git a/code/src/replicated-osd/tests/rosd-test-builder.ae b/code/src/replicated-osd/tests/rosd-test-builder.ae
index 00b38e8..adb901e 100644
--- a/code/src/replicated-osd/tests/rosd-test-builder.ae
+++ b/code/src/replicated-osd/tests/rosd-test-builder.ae
@@ -98,6 +98,8 @@ static __blocking triton_ret_t client_fn(int nservers, int nclients, void* data,
ret = triton_init("triton.client");
triton_error_assert(ret);
+ triton_debug_enable("/dev/stdout", "triton.fakess");
+
/* initialize fakess and placement components */
hostfile = triton_map_generate_mapfile(nservers);
if(!hostfile)
diff --git a/code/src/state/state-client.aer b/code/src/state/state-client.aer
index fb737f7..5c239a9 100644
--- a/code/src/state/state-client.aer
+++ b/code/src/state/state-client.aer
@@ -155,8 +155,8 @@ __remote __blocking triton_ret_t state_client_admin_status_set(
/* Propagate into state system */
self = triton_map_self();
triton_string_init(&key, "triton.state");
- ret = triton_state.post(self, &key,
- copy, sizeof(triton_status_t));
+ ret = triton_state.post(self, &key,
+ copy, sizeof(triton_status_t));
/* triton_string_destroy(&key); */
diff --git a/code/src/state/state.ae b/code/src/state/state.ae
index 767c88d..d34b20d 100644
--- a/code/src/state/state.ae
+++ b/code/src/state/state.ae
@@ -59,6 +59,11 @@ __blocking triton_ret_t triton_status_set(triton_status_t status)
return ret;
}
+static triton_ret_t __blocking check_state(triton_node_t peer,
+ triton_state_data_t* data,
+ triton_status_t* peer_status,
+ triton_status_t* peer_status_previous);
+
__blocking void triton_state_monitor()
{
triton_string_t key;
@@ -68,6 +73,8 @@ __blocking void triton_state_monitor()
triton_ret_t ret;
bool running;
+ printf("state: monitoring state changes...\n");
+
triton_map_get(&map);
self = triton_map_self();
triton_string_init(&key, "triton.state");
@@ -102,30 +109,13 @@ __blocking void triton_state_monitor()
while (true)
{
- triton_mutex_lock(&data->mutex);
- peer_status = *(triton_status_t *)(data->value);
- if (peer_status == peer_status_previous)
- {
- pret = triton_sched_wait(data->sched,
- &data->mutex);
- }
- triton_mutex_unlock(&data->mutex);
-
- peer_status = *(triton_status_t *)(data->value);
- if (peer_status != peer_status_previous)
- {
- triton_status_change(peer, &peer_status,
- &peer_status_previous);
- }
-
- /* this seems necessary to catch the CANCEL (ref #122) */
- pret = triton_timer(100);
-
- if (pret != TRITON_SUCCESS)
- {
- break;
- }
- }
+ pret = check_state(peer, data,
+ &peer_status, &peer_status_previous);
+ if(pret != TRITON_SUCCESS)
+ {
+ break;
+ }
+ }
}
}
pbranch
@@ -142,6 +132,38 @@ __blocking void triton_state_monitor()
return;
}
+static triton_ret_t __blocking check_state(triton_node_t peer,
+ triton_state_data_t* data,
+ triton_status_t* peer_status,
+ triton_status_t* peer_status_previous)
+{
+ triton_ret_t pret = TRITON_SUCCESS;
+
+ triton_mutex_lock(&data->mutex);
+ *peer_status = *(triton_status_t *)(data->value);
+ if (*peer_status == *peer_status_previous)
+ {
+ pret = triton_sched_wait(data->sched,
+ &data->mutex);
+ }
+ triton_mutex_unlock(&data->mutex);
+
+ *peer_status = *(triton_status_t *)(data->value);
+ if (pret == TRITON_SUCCESS && *peer_status != *peer_status_previous)
+ {
+ triton_status_change(peer, peer_status,
+ peer_status_previous);
+ }
+
+ /* this seems necessary to catch the CANCEL (ref #122) */
+ if(pret == TRITON_SUCCESS)
+ {
+ pret = triton_timer(100);
+ }
+
+ return(pret);
+}
+
__blocking void triton_status_change(triton_node_t node,
triton_status_t *status_current,
triton_status_t *status_previous)
diff --git a/code/src/state/test/module.mk.in b/code/src/state/test/module.mk.in
index c5b6d76..3bddc28 100644
--- a/code/src/state/test/module.mk.in
+++ b/code/src/state/test/module.mk.in
@@ -15,11 +15,11 @@ STATE_TEST_SRC += $(DIR)/rpc-size.ae
STATE_TEST_SRC += $(DIR)/rpc-global.ae
STATE_TEST_SRC += $(DIR)/rpc-list.ae
STATE_TEST_SRC += $(DIR)/rosd-start.ae
-STATE_TEST_SRC += $(DIR)/rosd-global.ae
-STATE_TEST_SRC += $(DIR)/rosd-status.ae
-STATE_TEST_SRC += $(DIR)/rosd-trigger.ae
-STATE_TEST_SRC += $(DIR)/rosd-peers.ae
-STATE_TEST_SRC += $(DIR)/rosd-maint.ae
+# STATE_TEST_SRC += $(DIR)/rosd-global.ae
+# STATE_TEST_SRC += $(DIR)/rosd-status.ae
+# STATE_TEST_SRC += $(DIR)/rosd-trigger.ae
+# STATE_TEST_SRC += $(DIR)/rosd-peers.ae
+# STATE_TEST_SRC += $(DIR)/rosd-maint.ae
STATE_TEST_SRC += $(DIR)/rosd-injection.ae
# Still needs some work:
# STATE_TEST_SRC += $(DIR)/rosd-recover.ae
diff --git a/code/src/state/test/rosd-global.ae b/code/src/state/test/rosd-global.ae
deleted file mode 100644
index dc7a496..0000000
--- a/code/src/state/test/rosd-global.ae
+++ /dev/null
@@ -1,65 +0,0 @@
-
-/**
- ROSD GLOBAL
-
- Startup / post global / shutdown
-*/
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <limits.h>
-#include <stdlib.h>
-
-#include "src/common/triton-types.h"
-#include "src/common/triton-debug.h"
-#include "src/aesop/hints.h"
-#include "src/aesop/aesop.h"
-#include "src/remote/encoding.h"
-#include "src/remote/remote.hae"
-#include "src/net/triton-message.hae"
-#include "src/net/triton-message-method.hae"
-#include "src/net/mock/mock-method.h"
-#include "src/common/resources/scheduling/sched.hae"
-#include "src/common/resources/timer/timer.hae"
-#include "src/zeroconf/zeroconf.h"
-#include "src/net/mpi/mpi.hae"
-#include "src/net/mpi/mpi-method.h"
-#include "src/remote/service.hae"
-#include "src/replicated-osd/rosd-utils.h"
-#include "src/mapping/mapping.hae"
-#include "src/fakess/fakess.hae"
-#include "src/placement/placement.hae"
-#include "src/common/triton-init.h"
-
-/* include server-side rosd skeletons */
-#include "src/replicated-osd/rosd_module.h"
-#include "src/remote/core_module.h"
-
-/* include client-side rosd stubs */
-#include "src/replicated-osd/rosd_stubs.hae"
-#include "src/remote/core_stubs.hae"
-
-#include "src/replicated-osd/rosd-test-harness.hae"
-
-#include "mpi.h"
-
- __blocking triton_ret_t rosd_test_client_fn(int nservers,
- int nclients,
- void* data,
- MPI_Comm client_comm)
-{
- int rank;
- MPI_Comm_rank(client_comm, &rank);
- printf("rosd-global: rosd_client_fn(): rank: %i\n", rank);
- return TRITON_SUCCESS;
-}
-
-/*
- * Local variables:
- * mode: c
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
diff --git a/code/src/state/test/rosd-global.sh b/code/src/state/test/rosd-global.sh
deleted file mode 100755
index 20b7148..0000000
--- a/code/src/state/test/rosd-global.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-# Test with sorted input...
-mpiexec -l -n 4 ${VALGRIND} ${BIN} /tmp/rosd.db /tmp/rosd-log \
- 1 1 2 1 > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-# LINES=$( grep "value: 23" ${OUT} | wc -l )
-# [[ $? == 0 ]] || exit 1
-# [[ ${LINES} == 2 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/state/test/rosd-injection.ae b/code/src/state/test/rosd-injection.ae
index d54bb4f..301769b 100644
--- a/code/src/state/test/rosd-injection.ae
+++ b/code/src/state/test/rosd-injection.ae
@@ -44,10 +44,10 @@
#include "mpi.h"
- __blocking triton_ret_t rosd_test_client_fn(int nservers,
- int nclients,
- void* data,
- MPI_Comm client_comm)
+__blocking triton_ret_t rosd_test_client_fn(int nservers,
+ int nclients,
+ void* data,
+ MPI_Comm client_comm)
{
triton_ret_t ret;
int rank;
@@ -59,6 +59,9 @@
triton_uint128_setzero(oid);
+ /* wait for server start-up */
+ triton_timer(3000);
+
MPI_Comm_rank(client_comm, &rank);
printf("rosd-injection: rosd_client_fn(): rank: %i\n", rank);
@@ -82,8 +85,6 @@
ret = remote_state_client_admin_status_set
(AER_DEFAULT_CTX, svr_addr, status, NULL);
triton_error_assert(ret);
-
- printf("called\n");
}
return TRITON_SUCCESS;
}
diff --git a/code/src/state/test/rosd-maint.ae b/code/src/state/test/rosd-maint.ae
deleted file mode 100644
index 41bb989..0000000
--- a/code/src/state/test/rosd-maint.ae
+++ /dev/null
@@ -1,483 +0,0 @@
-
-/**
- Let ROSD servers wait for a change to a state variable from
- multiple peers. The change is triggered by the client
-*/
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <limits.h>
-#include <stdlib.h>
-
-#include "src/common/triton-types.h"
-#include "src/common/triton-debug.h"
-#include "src/aesop/hints.h"
-#include "src/aesop/aesop.h"
-#include "src/aesop/aesop-support.hae"
-#include "src/remote/encoding.h"
-#include "src/remote/remote.hae"
-#include "src/remote/client-server-exec.hae"
-#include "src/net/triton-message.hae"
-#include "src/net/triton-message-method.hae"
-#include "src/net/mock/mock-method.h"
-#include "src/common/resources/scheduling/sched.hae"
-#include "src/common/resources/timer/timer.hae"
-#include "src/zeroconf/zeroconf.h"
-#include "src/net/mpi/mpi.hae"
-#include "src/net/mpi/mpi-method.h"
-#include "src/remote/service.hae"
-#include "src/replicated-osd/rosd-utils.h"
-#include "src/mapping/mapping.hae"
-#include "src/fakess/fakess.hae"
-#include "src/placement/placement.hae"
-#include "src/state/state.hae"
-#include "src/state/sc_stubs.hae"
-#include "src/common/triton-init.h"
-
-/* include server-side rosd skeletons */
-#include "src/replicated-osd/rosd_module.h"
-#include "src/remote/core_module.h"
-#include "src/state/sc_module.h"
-
-/* include client-side rosd stubs */
-#include "src/replicated-osd/rosd_stubs.hae"
-#include "src/remote/core_stubs.hae"
-
-#include "mpi.h"
-
-#define SVR_POLL_TIMEOUT 1000
-#define CLIENT_POLL_TIMEOUT 1000
-
-int nobjects = 0;
-int nconcurrent = 0;
-char db_path[PATH_MAX];
-char log_path[PATH_MAX];
-int coalescing = 0;
-int nservers = 0;
-int replication_factor = 0;
-char *hostfile;
-
-int mpi_rank;
-
-/*
-__blocking void update_state()
-{
- triton_timer(3000);
- triton_string_t key;
- triton_node_t self;
- triton_status_t *status;
-
- printf("update_state()\n");
- self = triton_map_self();
- triton_status = TRITON_STATUS_MAINTENANCE;
-
- triton_string_init(&key, "triton.state");
- status = malloc(sizeof(triton_status_t));
- *status = triton_status;
- triton_fakess_post(self, &key, status, sizeof(triton_status_t));
-
- triton_string_destroy(&key);
- return;
-}
-*/
-
-void handle_status_change(triton_node_t node,
- triton_status_t *status_current,
- triton_status_t *status_previous);
-
-void handle_status_change(triton_node_t node,
- triton_status_t *status_current,
- triton_status_t *status_previous)
-{
- char node_string[128];
- triton_string_t status_string_current;
- triton_string_t status_string_previous;
-
- triton_uint128_to_string(node_string, 128, node);
- triton_status_tostring(&status_string_current, *status_current);
- triton_status_tostring(&status_string_previous, *status_previous);
-
- printf("handle status change: node: %s from: %s to: %s\n",
- node_string,
- triton_string_get(&status_string_previous),
- triton_string_get(&status_string_current));
- triton_string_destroy(&status_string_current);
- triton_string_destroy(&status_string_previous);
-
- *status_previous = *status_current;
-}
-
-#include "src/state/test/rosd-test-funcs.ae"
-
-triton_mutex_t oid_mutex = TRITON_MUTEX_INITIALIZER;
-
-#if ROSD_DISABLE_FAKESS == 1
-#warning FAKESS DISABLED
-__blocking void do_remote_server(void)
-{
- /* run service engine to process requests */
- assert(AER_DEFAULT_CTX);
- aer_service_engine_start(AER_DEFAULT_CTX);
-
- return;
-}
-#else
-__blocking void do_remote_server(void)
-{
- triton_ret_t ret;
- int32_t result;
- uint128_t oid;
- int nprocs;
-
- MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
-
- assert(nprocs > 1);
-
- // triton_debug_enable("/dev/stdout", "triton.fakess");
- triton_fakess_state_install();
-
- pwait
- {
- pprivate int done = 0;
- pprivate int mpi_ret;
- pprivate char done_signal;
- pprivate MPI_Request request;
- pprivate MPI_Status status;
- pprivate triton_ret_t fakess_ret;
-
- pbranch
- {
- /* run service engine to process requests */
- assert(AER_DEFAULT_CTX);
- aer_service_engine_start(AER_DEFAULT_CTX);
- /* when service_engine exits, we are done */
- triton_fakess_engine_stop();
- }
- pbranch
- {
- /* run fakess engine to track system state */
- fakess_ret = triton_fakess_engine_start();
- /* TODO: error handling */
- triton_error_assert(fakess_ret);
- }
- pbranch
- {
- triton_status = TRITON_STATUS_NOMINAL;
- monitor_state();
- }
- }
-}
-#endif
-
-__blocking void do_remote_noop(void)
-{
- triton_ret_t ret;
- int32_t result;
- uint128_t oid;
- uint32_t flags = 0;
-
- triton_status_t maintenance = TRITON_STATUS_MAINTENANCE;
- int32_t *status;
- int32_t ignore;
-
- /* NOTE: noop doesn't really need an oid to operate on, but we use one
- * anyway for mapping purposes so that we talk to the same servers that
- * we would have had this been a real rosd operation
- */
-
- /* TODO: clean this up; I'm cheating for convenience... */
- oid = triton_uint128_from_uint64(0);
- oid.u += mpi_rank;
-
- status = malloc(sizeof(int32_t));
- *status = maintenance;
-
- pwait
- {
- pprivate int i;
- pprivate triton_addr_t svr_addr;
- pprivate triton_node_t svr_node;
-
- for(i=0; i<nconcurrent; i++)
- {
- pbranch
- {
- triton_mutex_lock(&oid_mutex);
- while(oid.l < nobjects)
- {
- oid.l++;
-
- /* look up location of this object */
- ret = triton_place_lookup(oid, 1, &svr_node);
- triton_error_assert(ret);
-
- triton_mutex_unlock(&oid_mutex);
-
- ret = triton_map_lookup_node(svr_node, &svr_addr);
- triton_error_assert(ret);
-
- ret = remote_triton_core_noop(AER_DEFAULT_CTX,
- svr_addr, NULL, NULL);
- if(ret != TRITON_SUCCESS)
- {
- fprintf(stderr,
- "Error: triton_server_noop() failure.\n");
- }
-
- triton_timer(mpi_rank*1000-2000);
- ret = remote_state_client_admin_status_set
- (AER_DEFAULT_CTX, svr_addr, status, NULL);
- triton_error_assert(ret);
- ret = remote_triton_core_noop(AER_DEFAULT_CTX,
- svr_addr, NULL, NULL);
- triton_error_assert(ret);
- triton_mutex_lock(&oid_mutex);
- }
- triton_mutex_unlock(&oid_mutex);
- }
- }
- }
-}
-
-static int done = 0;
-static void cb(void *up)
-{
- done=1;
- ae_poll_break(NULL);
-}
-
-static void usage(void)
-{
- fprintf(stderr,
- "Usage: rosd-create-bench <db path> <log path> <objects per proc> <concurrency> <coalescing> <use niids> <nservers> <replication_factor> <hostfile>\n");
-}
-int main(int argc, char *argv[])
-{
- triton_ret_t ret;
- triton_ret_t ret2;
- ae_op_id_t op_id;
- ae_hints_t hints;
- int mpi_ret;
- MPI_Group orig_group, client_group;
- MPI_Comm client_comm;
- int* server_ranks = NULL;
- double test_start, test_end, noop_elapsed;
- double noop_elapsed_time, noop_min_elapsed_time;
- int scan_ret;
- int nclients;
- char rank_suffix[10];
- int i;
- int provided;
-
- mpi_ret = MPI_Init_thread(NULL, NULL, MPI_THREAD_MULTIPLE, &provided);
- assert(mpi_ret == MPI_SUCCESS);
- MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
-
- /* parse command line */
- if(argc != 10)
- {
- usage();
- return(-1);
- }
-
- scan_ret = sscanf(argv[1], "%s", db_path);
- if(scan_ret != 1)
- {
- usage();
- return(-1);
- }
- scan_ret = sscanf(argv[2], "%s", log_path);
- if(scan_ret != 1)
- {
- usage();
- return(-1);
- }
-
- scan_ret = sscanf(argv[3], "%d", &nobjects);
- if(scan_ret != 1 || nobjects < 1)
- {
- usage();
- return(-1);
- }
- scan_ret = sscanf(argv[4], "%d", &nconcurrent);
- if(scan_ret != 1 || nconcurrent < 1)
- {
- usage();
- return(-1);
- }
- scan_ret = sscanf(argv[7], "%d", &nservers);
- if(scan_ret != 1 || nservers < 1)
- {
- usage();
- return(-1);
- }
- if(mpi_rank < nservers)
- {
- ret = triton_zeroconf_set("triton.rosd.niid_enabled", argv[6]);
- if(ret != TRITON_SUCCESS)
- {
- usage();
- return(-1);
- }
- }
-
- scan_ret = sscanf(argv[8], "%d", &replication_factor);
- if(scan_ret != 1 || replication_factor < 1)
- {
- usage();
- return(-1);
- }
-
- hostfile = argv[9];
-
- if(mpi_rank < nservers)
- {
- /* tack on the rank number to the paths to avoid conflicts when
- * running two svrs on one box
- */
- sprintf(rank_suffix, "%d", mpi_rank);
-
- strcat(log_path, rank_suffix);
- ret = triton_zeroconf_set("triton.tosd.data_path", log_path);
- triton_error_assert(ret);
-
- strcat(db_path, rank_suffix);
- ret = triton_zeroconf_set("triton.tosd.db_path", db_path);
- triton_error_assert(ret);
-
- ret = triton_zeroconf_set("triton.tosd.db_coalescing_highwater", argv[5]);
- triton_error_assert(ret);
- ret = triton_zeroconf_set("triton.tosd.data_coalescing_highwater", argv[5]);
- triton_error_assert(ret);
-
- /* servers */
- ret = triton_init("triton.server", "triton.traffic_cop");
- triton_error_assert(ret);
- ret = aer_remote_register_rosd();
- triton_error_assert(ret);
- ret = aer_remote_register_core();
- triton_error_assert(ret);
- ret = aer_remote_register_sc();
- triton_error_assert(ret);
- }
- else
- {
- /* clients */
- ret = triton_init("triton.client", "triton.traffic_cop");
- triton_error_assert(ret);
- }
-
- /* initialize fakess and placement components */
- /* TODO: error handling? */
- triton_map_file(hostfile);
- triton_fakess_load_map();
-
- server_ranks = (int*)malloc(nservers*sizeof(*server_ranks));
- assert(server_ranks);
- for(i=0; i<nservers; i++)
- {
- server_ranks[i] = i;
- }
- MPI_Comm_size(MPI_COMM_WORLD, &nclients);
- nclients -= nservers;
-
- /* create a communicator for the "clients" */
- mpi_ret = MPI_Comm_group(MPI_COMM_WORLD, &orig_group);
- assert(mpi_ret == MPI_SUCCESS);
- mpi_ret = MPI_Group_excl(orig_group, nservers, server_ranks, &client_group);
- assert(mpi_ret == MPI_SUCCESS);
- mpi_ret = MPI_Comm_create(MPI_COMM_WORLD, client_group, &client_comm);
- assert(mpi_ret == MPI_SUCCESS);
-
- if(mpi_rank < nservers)
- {
- /* servers */
- ae_hints_init(&hints);
- ret = ae_post_blocking(do_remote_server, cb, NULL, &hints, NULL, &op_id);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, SVR_POLL_TIMEOUT);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
- }
- else
- {
- /* clients */
-
- /* wait a little bit to make sure the server gets started */
- sleep(5);
-
- /* barrier and start noop test */
- done = 0;
- mpi_ret = MPI_Barrier(client_comm);
- assert(mpi_ret == MPI_SUCCESS);
- if(mpi_rank == nservers)
- {
- printf("# starting noop test.\n");
- }
-
- test_start = MPI_Wtime();
- ae_hints_init(&hints);
- ret = ae_post_blocking(do_remote_noop, cb, NULL, &hints, NULL, &op_id);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, CLIENT_POLL_TIMEOUT);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
- test_end = MPI_Wtime();
- noop_elapsed = test_end - test_start;
- }
-
- if(mpi_rank >= nservers)
- {
- MPI_Allreduce(&noop_elapsed, &noop_elapsed_time, 1,
- MPI_DOUBLE, MPI_MAX, client_comm);
- MPI_Allreduce(&noop_elapsed, &noop_min_elapsed_time, 1,
- MPI_DOUBLE, MPI_MIN, client_comm);
- if(mpi_rank == nservers)
- {
- printf("# remove test done.\n");
-
- /* first non-server rank */
- printf("# <op> <nclients> <nservers> <objs/client> <concurrency> <min> <max> <rate> <niid enabled>\n");
- printf("noop\t%d\t%d\t%d\t%d\t%f\t%f\t%f\t%s\n",
- nclients, nservers, nobjects, nconcurrent, noop_min_elapsed_time, noop_elapsed_time, (double)nobjects*(double)(nclients)/noop_elapsed_time, argv[6]);
-
- done = 0;
- ae_hints_init(&hints);
- ret = ae_post_blocking(triton_do_remote_shutdown, cb, NULL, &hints, NULL, &op_id, &ret2);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, CLIENT_POLL_TIMEOUT);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
- }
- }
-
- triton_finalize();
- MPI_Finalize();
-
- free(server_ranks);
- return 0;
-}
-
-/*
- * Local variables:
- * mode: c
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
diff --git a/code/src/state/test/rosd-maint.sh b/code/src/state/test/rosd-maint.sh
deleted file mode 100755
index a5ac75b..0000000
--- a/code/src/state/test/rosd-maint.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-# Test with sorted input...
-mpiexec -l -n 4 ${VALGRIND} ${BIN} /tmp/rosd.db /tmp/rosd-log \
- 1 1 0 0 2 1 ${SRCDIR}/src/mapping/test/hosts2.txt > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-LINES=$( grep "status change:" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 6 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/state/test/rosd-peers.ae b/code/src/state/test/rosd-peers.ae
deleted file mode 100644
index a42d5f9..0000000
--- a/code/src/state/test/rosd-peers.ae
+++ /dev/null
@@ -1,473 +0,0 @@
-
-/**
- Let ROSD servers wait for a change to a state variable from
- multiple peers
-*/
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <limits.h>
-#include <stdlib.h>
-
-#include "src/common/triton-types.h"
-#include "src/common/triton-debug.h"
-#include "src/aesop/hints.h"
-#include "src/aesop/aesop.h"
-#include "src/remote/encoding.h"
-#include "src/remote/remote.hae"
-#include "src/remote/client-server-exec.hae"
-#include "src/net/triton-message.hae"
-#include "src/net/triton-message-method.hae"
-#include "src/net/mock/mock-method.h"
-#include "src/common/resources/scheduling/sched.hae"
-#include "src/common/resources/timer/timer.hae"
-#include "src/zeroconf/zeroconf.h"
-#include "src/net/mpi/mpi.hae"
-#include "src/net/mpi/mpi-method.h"
-#include "src/remote/service.hae"
-#include "src/replicated-osd/rosd-utils.h"
-#include "src/mapping/mapping.hae"
-#include "src/fakess/fakess.hae"
-#include "src/placement/placement.hae"
-#include "src/state/state.hae"
-#include "src/common/triton-init.h"
-
-#include "src/aesop/aesop-support.hae"
-
-/* include server-side rosd skeletons */
-#include "src/replicated-osd/rosd_module.h"
-#include "src/remote/core_module.h"
-
-/* include client-side rosd stubs */
-#include "src/replicated-osd/rosd_stubs.hae"
-#include "src/remote/core_stubs.hae"
-
-#include "src/state/state.hae"
-
-#include "mpi.h"
-
-#define SVR_POLL_TIMEOUT 1000
-#define CLIENT_POLL_TIMEOUT 1000
-
-int nobjects = 0;
-int nconcurrent = 0;
-char db_path[PATH_MAX];
-char log_path[PATH_MAX];
-int coalescing = 0;
-int nservers = 0;
-int replication_factor = 0;
-char *hostfile;
-
-int mpi_rank;
-
-__blocking void update_state()
-{
- triton_timer(3000);
- triton_string_t key;
- triton_node_t self;
- triton_status_t *status;
-
- printf("update_state()\n");
- self = triton_map_self();
- triton_status = TRITON_STATUS_MAINTENANCE;
-
- triton_string_init(&key, "triton.state");
- status = malloc(sizeof(triton_status_t));
- *status = triton_status;
- triton_fakess_post(self, &key, status, sizeof(triton_status_t));
-
- triton_string_destroy(&key);
- return;
-}
-
-void handle_status_change(triton_node_t node,
- triton_status_t *status_current,
- triton_status_t *status_previous);
-
-void handle_status_change(triton_node_t node,
- triton_status_t *status_current,
- triton_status_t *status_previous)
-{
- char node_string[128];
- triton_string_t status_string_current;
- triton_string_t status_string_previous;
- triton_string_t status_string_tmp;
- triton_status_t tmp;
-
- triton_uint128_to_string(node_string, 128, node);
- triton_status_tostring(&status_string_current, *status_current);
- triton_status_tostring(&status_string_previous, *status_previous);
-
- printf("handle status change: node: %s from: %s to: %s\n",
- node_string,
- triton_string_get(&status_string_previous),
- triton_string_get(&status_string_current));
- triton_string_destroy(&status_string_current);
- triton_string_destroy(&status_string_previous);
-
- // Additional test: use triton_status_get
- triton_status_get(node, &tmp);
- triton_status_tostring(&status_string_tmp, tmp);
- printf("status_get: %s\n", triton_string_get(&status_string_tmp));
- triton_string_destroy(&status_string_tmp);
-
- *status_previous = *status_current;
-}
-
-#include "src/state/test/rosd-test-funcs.ae"
-
-triton_mutex_t oid_mutex = TRITON_MUTEX_INITIALIZER;
-
-#if ROSD_DISABLE_FAKESS == 1
-#warning FAKESS DISABLED
-__blocking void do_remote_server(void)
-{
- /* run service engine to process requests */
- assert(AER_DEFAULT_CTX);
- aer_service_engine_start(AER_DEFAULT_CTX);
-
- return;
-}
-#else
-__blocking void do_remote_server(void)
-{
- triton_ret_t ret;
- int32_t result;
- uint128_t oid;
- int nprocs;
-
- MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
-
- assert(nprocs > 1);
-
- pwait
- {
- pprivate int done = 0;
- pprivate int mpi_ret;
- pprivate char done_signal;
- pprivate MPI_Request request;
- pprivate MPI_Status status;
- pprivate triton_ret_t fakess_ret;
-
- pbranch
- {
- /* run service engine to process requests */
- assert(AER_DEFAULT_CTX);
- aer_service_engine_start(AER_DEFAULT_CTX);
- /* when service_engine exits, we are done */
- triton_fakess_engine_stop();
- }
- pbranch
- {
- /* run fakess engine to track system state */
- triton_fakess_state_install();
- fakess_ret = triton_fakess_engine_start();
- /* TODO: error handling */
- triton_error_assert(fakess_ret);
- }
- pbranch
- {
- update_state();
- }
- pbranch
- {
- triton_status = TRITON_STATUS_NOMINAL;
- monitor_state();
- }
- }
-}
-#endif
-
-__blocking void do_remote_noop(void)
-{
- triton_ret_t ret;
- int32_t result;
- uint128_t oid;
- uint32_t flags = 0;
-
- /* NOTE: noop doesn't really need an oid to operate on, but we use one
- * anyway for mapping purposes so that we talk to the same servers that
- * we would have had this been a real rosd operation
- */
-
- /* TODO: clean this up; I'm cheating for convenience... */
- oid = triton_uint128_from_uint64(0);
- oid.u += mpi_rank;
-
- pwait
- {
- pprivate int i;
- pprivate triton_addr_t svr_addr;
- pprivate triton_node_t svr_node;
-
- for(i=0; i<nconcurrent; i++)
- {
- pbranch
- {
- triton_mutex_lock(&oid_mutex);
- while(oid.l < nobjects)
- {
- oid.l++;
-
- /* look up location of this object */
- ret = triton_place_lookup(oid, 1, &svr_node);
- triton_error_assert(ret);
-
- triton_mutex_unlock(&oid_mutex);
-
- ret = triton_map_lookup_node(svr_node, &svr_addr);
- triton_error_assert(ret);
-
- ret = remote_triton_core_noop(AER_DEFAULT_CTX, svr_addr, NULL, NULL);
- if(ret != TRITON_SUCCESS)
- {
- fprintf(stderr, "Error: triton_server_noop() failure.\n");
- }
- triton_mutex_lock(&oid_mutex);
- }
- triton_mutex_unlock(&oid_mutex);
- }
- }
- }
-}
-
-static int done = 0;
-static void cb(void *up)
-{
- done=1;
- ae_poll_break(NULL);
-}
-
-static void usage(void)
-{
- fprintf(stderr,
- "Usage: rosd-create-bench <db path> <log path> <objects per proc> <concurrency> <coalescing> <use niids> <nservers> <replication_factor> <hostfile>\n");
-}
-int main(int argc, char *argv[])
-{
- triton_ret_t ret;
- triton_ret_t ret2;
- ae_op_id_t op_id;
- ae_hints_t hints;
- int mpi_ret;
- MPI_Group orig_group, client_group;
- MPI_Comm client_comm;
- int* server_ranks = NULL;
- double test_start, test_end, noop_elapsed;
- double noop_elapsed_time, noop_min_elapsed_time;
- int scan_ret;
- int nclients;
- char rank_suffix[10];
- int i;
- int provided;
-
- mpi_ret = MPI_Init_thread(NULL, NULL, MPI_THREAD_MULTIPLE, &provided);
- assert(mpi_ret == MPI_SUCCESS);
- MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
-
- /* parse command line */
- if(argc != 10)
- {
- usage();
- return(-1);
- }
-
- scan_ret = sscanf(argv[1], "%s", db_path);
- if(scan_ret != 1)
- {
- usage();
- return(-1);
- }
- scan_ret = sscanf(argv[2], "%s", log_path);
- if(scan_ret != 1)
- {
- usage();
- return(-1);
- }
-
- scan_ret = sscanf(argv[3], "%d", &nobjects);
- if(scan_ret != 1 || nobjects < 1)
- {
- usage();
- return(-1);
- }
- scan_ret = sscanf(argv[4], "%d", &nconcurrent);
- if(scan_ret != 1 || nconcurrent < 1)
- {
- usage();
- return(-1);
- }
- scan_ret = sscanf(argv[7], "%d", &nservers);
- if(scan_ret != 1 || nservers < 1)
- {
- usage();
- return(-1);
- }
- if(mpi_rank < nservers)
- {
- ret = triton_zeroconf_set("triton.rosd.niid_enabled", argv[6]);
- if(ret != TRITON_SUCCESS)
- {
- usage();
- return(-1);
- }
- }
-
- scan_ret = sscanf(argv[8], "%d", &replication_factor);
- if(scan_ret != 1 || replication_factor < 1)
- {
- usage();
- return(-1);
- }
-
- hostfile = argv[9];
-
- if(mpi_rank < nservers)
- {
- /* tack on the rank number to the paths to avoid conflicts when
- * running two svrs on one box
- */
- sprintf(rank_suffix, "%d", mpi_rank);
-
- strcat(log_path, rank_suffix);
- ret = triton_zeroconf_set("triton.tosd.data_path", log_path);
- triton_error_assert(ret);
-
- strcat(db_path, rank_suffix);
- ret = triton_zeroconf_set("triton.tosd.db_path", db_path);
- triton_error_assert(ret);
-
- ret = triton_zeroconf_set("triton.tosd.db_coalescing_highwater", argv[5]);
- triton_error_assert(ret);
- ret = triton_zeroconf_set("triton.tosd.data_coalescing_highwater", argv[5]);
- triton_error_assert(ret);
-
- /* servers */
- ret = triton_init("triton.server", "triton.traffic_cop");
- triton_error_assert(ret);
- ret = aer_remote_register_rosd();
- triton_error_assert(ret);
- ret = aer_remote_register_core();
- triton_error_assert(ret);
- }
- else
- {
- /* clients */
- ret = triton_init("triton.client", "triton.traffic_cop");
- triton_error_assert(ret);
- }
-
- /* initialize fakess and placement components */
- /* TODO: error handling? */
- triton_map_file(hostfile);
- triton_fakess_load_map();
-
- server_ranks = (int*)malloc(nservers*sizeof(*server_ranks));
- assert(server_ranks);
- for(i=0; i<nservers; i++)
- {
- server_ranks[i] = i;
- }
- MPI_Comm_size(MPI_COMM_WORLD, &nclients);
- nclients -= nservers;
-
- /* create a communicator for the "clients" */
- mpi_ret = MPI_Comm_group(MPI_COMM_WORLD, &orig_group);
- assert(mpi_ret == MPI_SUCCESS);
- mpi_ret = MPI_Group_excl(orig_group, nservers, server_ranks, &client_group);
- assert(mpi_ret == MPI_SUCCESS);
- mpi_ret = MPI_Comm_create(MPI_COMM_WORLD, client_group, &client_comm);
- assert(mpi_ret == MPI_SUCCESS);
-
- if(mpi_rank < nservers)
- {
- /* servers */
- ae_hints_init(&hints);
- ret = ae_post_blocking(do_remote_server, cb, NULL, &hints, NULL, &op_id);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, SVR_POLL_TIMEOUT);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
- }
- else
- {
- /* clients */
-
- /* wait a little bit to make sure the server gets started */
- sleep(5);
-
- /* barrier and start noop test */
- done = 0;
- mpi_ret = MPI_Barrier(client_comm);
- assert(mpi_ret == MPI_SUCCESS);
- if(mpi_rank == nservers)
- {
- printf("# starting noop test.\n");
- }
-
- test_start = MPI_Wtime();
- ae_hints_init(&hints);
- ret = ae_post_blocking(do_remote_noop, cb, NULL, &hints, NULL, &op_id);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, CLIENT_POLL_TIMEOUT);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
- test_end = MPI_Wtime();
- noop_elapsed = test_end - test_start;
- }
-
- if(mpi_rank >= nservers)
- {
- MPI_Allreduce(&noop_elapsed, &noop_elapsed_time, 1,
- MPI_DOUBLE, MPI_MAX, client_comm);
- MPI_Allreduce(&noop_elapsed, &noop_min_elapsed_time, 1,
- MPI_DOUBLE, MPI_MIN, client_comm);
- if(mpi_rank == nservers)
- {
- printf("# remove test done.\n");
-
- /* first non-server rank */
- printf("# <op> <nclients> <nservers> <objs/client> <concurrency> <min> <max> <rate> <niid enabled>\n");
- printf("noop\t%d\t%d\t%d\t%d\t%f\t%f\t%f\t%s\n",
- nclients, nservers, nobjects, nconcurrent, noop_min_elapsed_time, noop_elapsed_time, (double)nobjects*(double)(nclients)/noop_elapsed_time, argv[6]);
-
- done = 0;
- ae_hints_init(&hints);
- ret = ae_post_blocking(triton_do_remote_shutdown, cb, NULL, &hints, NULL, &op_id, &ret2);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, CLIENT_POLL_TIMEOUT);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
- }
- }
-
- triton_finalize();
- MPI_Finalize();
-
- free(server_ranks);
- return 0;
-}
-
-/*
- * Local variables:
- * mode: c
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
diff --git a/code/src/state/test/rosd-peers.sh b/code/src/state/test/rosd-peers.sh
deleted file mode 100755
index 1d0894e..0000000
--- a/code/src/state/test/rosd-peers.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-# Test with sorted input...
-mpiexec -l -n 4 ${VALGRIND} ${BIN} /tmp/rosd.db /tmp/rosd-log \
- 1 1 0 0 2 1 ${SRCDIR}/src/mapping/test/hosts2.txt > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-LINES=$( grep "status change:" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 8 ]] || exit 1
-
-LINES=$( grep "status_get: NOMINAL" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 4 ]] || exit 1
-
-LINES=$( grep "status_get: MAINTENANCE" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 4 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/state/test/rosd-status.ae b/code/src/state/test/rosd-status.ae
deleted file mode 100644
index c767a47..0000000
--- a/code/src/state/test/rosd-status.ae
+++ /dev/null
@@ -1,475 +0,0 @@
-
-/**
- Let ROSD servers read a global state variable
-*/
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <limits.h>
-#include <stdlib.h>
-
-#include "src/common/triton-types.h"
-#include "src/common/triton-debug.h"
-#include "src/aesop/hints.h"
-#include "src/aesop/aesop.h"
-#include "src/remote/encoding.h"
-#include "src/remote/remote.hae"
-#include "src/remote/client-server-exec.hae"
-#include "src/net/triton-message.hae"
-#include "src/net/triton-message-method.hae"
-#include "src/net/mock/mock-method.h"
-#include "src/common/resources/scheduling/sched.hae"
-#include "src/common/resources/timer/timer.hae"
-#include "src/zeroconf/zeroconf.h"
-#include "src/net/mpi/mpi.hae"
-#include "src/net/mpi/mpi-method.h"
-#include "src/remote/service.hae"
-#include "src/replicated-osd/rosd-utils.h"
-#include "src/mapping/mapping.hae"
-#include "src/fakess/fakess.hae"
-#include "src/placement/placement.hae"
-#include "src/state/state.hae"
-#include "src/common/triton-init.h"
-
-/* include server-side rosd skeletons */
-#include "src/replicated-osd/rosd_module.h"
-#include "src/remote/core_module.h"
-
-/* include client-side rosd stubs */
-#include "src/replicated-osd/rosd_stubs.hae"
-#include "src/remote/core_stubs.hae"
-
-#include "mpi.h"
-
-#define SVR_POLL_TIMEOUT 1000
-#define CLIENT_POLL_TIMEOUT 1000
-
-int nobjects = 0;
-int nconcurrent = 0;
-char db_path[PATH_MAX];
-char log_path[PATH_MAX];
-int coalescing = 0;
-int nservers = 0;
-int replication_factor = 0;
-char *hostfile;
-
-__blocking void update_global()
-{
- triton_timer(1000);
- triton_string_t key;
- triton_node_t self;
- triton_status_t *status;
-
- printf("update_global()\n");
- self = triton_map_self();
- triton_status = TRITON_STATUS_MAINTENANCE;
-
- triton_string_init(&key, "triton.state");
- status = malloc(sizeof(triton_status_t));
- *status = triton_status;
- triton_fakess_post(self, &key, status, sizeof(triton_status_t));
-
- triton_string_destroy(&key);
- return;
-}
-
-__blocking void listen_global()
-{
- triton_string_t key;
- triton_state_data_t *data;
- triton_node_t self;
- triton_status_t *status;
- triton_ret_t ret;
-
- printf("listen_global()\n");
-
- self = triton_map_self();
- triton_string_init(&key, "triton.state");
- triton_fakess_item_add(self, &key);
- printf("added item\n");
-
- status = malloc(sizeof(triton_status_t));
- *status = triton_status;
- ret = triton_fakess_post(self, &key,
- status, sizeof(triton_status_t));
- triton_error_assert(ret);
-
- printf("posted\n");
-
- triton_timer(2000);
-
- printf("listening...\n");
-
- data = triton_fakess_lookup(self, &key);
-
- printf("status: %i\n", *(int *)(data->value));
-
- triton_string_destroy(&key);
-
- return;
-}
-
-#if ROSD_DISABLE_FAKESS == 1
-#warning FAKESS DISABLED
-__blocking void do_remote_server(void)
-{
- /* run service engine to process requests */
- assert(AER_DEFAULT_CTX);
- aer_service_engine_start(AER_DEFAULT_CTX);
-
- return;
-}
-#else
-__blocking void do_remote_server(void)
-{
- triton_ret_t ret;
- int32_t result;
- int rank;
- uint128_t oid;
- int nprocs;
-
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
-
- assert(nprocs > 1);
-
- pwait
- {
- pprivate int done = 0;
- pprivate int mpi_ret;
- pprivate char done_signal;
- pprivate MPI_Request request;
- pprivate MPI_Status status;
- pprivate triton_ret_t fakess_ret;
-
- pbranch
- {
- /* run service engine to process requests */
- assert(AER_DEFAULT_CTX);
- aer_service_engine_start(AER_DEFAULT_CTX);
- /* when service_engine exits, we are done */
- triton_fakess_engine_stop();
- }
- pbranch
- {
- /* run fakess engine to track system state */
- fakess_ret = triton_fakess_engine_start();
- /* TODO: error handling */
- triton_error_assert(fakess_ret);
- }
- pbranch
- {
- if (rank == 0)
- {
- update_global();
- }
- }
- pbranch
- {
- triton_status = TRITON_STATUS_NOMINAL;
- listen_global();
- }
- }
-}
-#endif
-
-triton_mutex_t oid_mutex = TRITON_MUTEX_INITIALIZER;
-
-__blocking void do_remote_noop(void)
-{
- triton_ret_t ret;
- int32_t result;
- int rank;
- uint128_t oid;
- uint32_t flags = 0;
-
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
- /* NOTE: noop doesn't really need an oid to operate on, but we use one
- * anyway for mapping purposes so that we talk to the same servers that
- * we would have had this been a real rosd operation
- */
-
- /* TODO: clean this up; I'm cheating for convenience... */
- oid = triton_uint128_from_uint64(0);
- oid.u += rank;
-
- pwait
- {
- pprivate int i;
- pprivate triton_addr_t svr_addr;
- pprivate triton_node_t svr_node;
-
- for(i=0; i<nconcurrent; i++)
- {
- pbranch
- {
- triton_mutex_lock(&oid_mutex);
- while(oid.l < nobjects)
- {
- oid.l++;
-
- /* look up location of this object */
- ret = triton_place_lookup(oid, 1, &svr_node);
- triton_error_assert(ret);
-
- triton_mutex_unlock(&oid_mutex);
-
- ret = triton_map_lookup_node(svr_node, &svr_addr);
- triton_error_assert(ret);
-
- ret = remote_triton_core_noop(AER_DEFAULT_CTX, svr_addr, NULL, NULL);
- if(ret != TRITON_SUCCESS)
- {
- fprintf(stderr, "Error: triton_server_noop() failure.\n");
- }
- triton_mutex_lock(&oid_mutex);
- }
- triton_mutex_unlock(&oid_mutex);
- }
- }
- }
-}
-
-static int done = 0;
-static void cb(void *up)
-{
- done=1;
- ae_poll_break(NULL);
-}
-
-static void usage(void)
-{
- fprintf(stderr,
- "Usage: rosd-create-bench <db path> <log path> <objects per proc> <concurrency> <coalescing> <use niids> <nservers> <replication_factor> <hostfile>\n");
-}
-int main(int argc, char *argv[])
-{
- triton_ret_t ret;
- triton_ret_t ret2;
- ae_op_id_t op_id;
- ae_hints_t hints;
- int rank;
- int mpi_ret;
- MPI_Group orig_group, client_group;
- MPI_Comm client_comm;
- int* server_ranks = NULL;
- double test_start, test_end, noop_elapsed;
- double noop_elapsed_time, noop_min_elapsed_time;
- int scan_ret;
- int nclients;
- char rank_suffix[10];
- int i;
- int provided;
-
- mpi_ret = MPI_Init_thread(NULL, NULL, MPI_THREAD_MULTIPLE, &provided);
- assert(mpi_ret == MPI_SUCCESS);
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
- /* parse command line */
- if(argc != 10)
- {
- usage();
- return(-1);
- }
-
- scan_ret = sscanf(argv[1], "%s", db_path);
- if(scan_ret != 1)
- {
- usage();
- return(-1);
- }
- scan_ret = sscanf(argv[2], "%s", log_path);
- if(scan_ret != 1)
- {
- usage();
- return(-1);
- }
-
- scan_ret = sscanf(argv[3], "%d", &nobjects);
- if(scan_ret != 1 || nobjects < 1)
- {
- usage();
- return(-1);
- }
- scan_ret = sscanf(argv[4], "%d", &nconcurrent);
- if(scan_ret != 1 || nconcurrent < 1)
- {
- usage();
- return(-1);
- }
- scan_ret = sscanf(argv[7], "%d", &nservers);
- if(scan_ret != 1 || nservers < 1)
- {
- usage();
- return(-1);
- }
- if(rank < nservers)
- {
- ret = triton_zeroconf_set("triton.rosd.niid_enabled", argv[6]);
- if(ret != TRITON_SUCCESS)
- {
- usage();
- return(-1);
- }
- }
-
- scan_ret = sscanf(argv[8], "%d", &replication_factor);
- if(scan_ret != 1 || replication_factor < 1)
- {
- usage();
- return(-1);
- }
-
- hostfile = argv[9];
-
- if(rank < nservers)
- {
- /* tack on the rank number to the paths to avoid conflicts when
- * running two svrs on one box
- */
- sprintf(rank_suffix, "%d", rank);
-
- strcat(log_path, rank_suffix);
- ret = triton_zeroconf_set("triton.tosd.data_path", log_path);
- triton_error_assert(ret);
-
- strcat(db_path, rank_suffix);
- ret = triton_zeroconf_set("triton.tosd.db_path", db_path);
- triton_error_assert(ret);
-
- ret = triton_zeroconf_set("triton.tosd.db_coalescing_highwater", argv[5]);
- triton_error_assert(ret);
- ret = triton_zeroconf_set("triton.tosd.data_coalescing_highwater", argv[5]);
- triton_error_assert(ret);
-
- /* servers */
- ret = triton_init("triton.server", "triton.traffic_cop");
- triton_error_assert(ret);
- ret = aer_remote_register_rosd();
- triton_error_assert(ret);
- ret = aer_remote_register_core();
- triton_error_assert(ret);
- }
- else
- {
- /* clients */
- ret = triton_init("triton.client", "triton.traffic_cop");
- triton_error_assert(ret);
- }
-
- /* initialize fakess and placement components */
- /* TODO: error handling? */
- triton_map_file(hostfile);
- triton_fakess_load_map();
-
- server_ranks = (int*)malloc(nservers*sizeof(*server_ranks));
- assert(server_ranks);
- for(i=0; i<nservers; i++)
- {
- server_ranks[i] = i;
- }
- MPI_Comm_size(MPI_COMM_WORLD, &nclients);
- nclients -= nservers;
-
- /* create a communicator for the "clients" */
- mpi_ret = MPI_Comm_group(MPI_COMM_WORLD, &orig_group);
- assert(mpi_ret == MPI_SUCCESS);
- mpi_ret = MPI_Group_excl(orig_group, nservers, server_ranks, &client_group);
- assert(mpi_ret == MPI_SUCCESS);
- mpi_ret = MPI_Comm_create(MPI_COMM_WORLD, client_group, &client_comm);
- assert(mpi_ret == MPI_SUCCESS);
-
- if(rank < nservers)
- {
- /* servers */
- ae_hints_init(&hints);
- ret = ae_post_blocking(do_remote_server, cb, NULL, &hints, NULL, &op_id);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, SVR_POLL_TIMEOUT);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
- }
- else
- {
- /* clients */
-
- /* wait a little bit to make sure the server gets started */
- sleep(3);
-
- /* barrier and start noop test */
- done = 0;
- mpi_ret = MPI_Barrier(client_comm);
- assert(mpi_ret == MPI_SUCCESS);
- if(rank == nservers)
- {
- printf("# starting noop test.\n");
- }
-
- test_start = MPI_Wtime();
- ae_hints_init(&hints);
- ret = ae_post_blocking(do_remote_noop, cb, NULL, &hints, NULL, &op_id);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, CLIENT_POLL_TIMEOUT);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
- test_end = MPI_Wtime();
- noop_elapsed = test_end - test_start;
- }
-
- if(rank >= nservers)
- {
- MPI_Allreduce(&noop_elapsed, &noop_elapsed_time, 1,
- MPI_DOUBLE, MPI_MAX, client_comm);
- MPI_Allreduce(&noop_elapsed, &noop_min_elapsed_time, 1,
- MPI_DOUBLE, MPI_MIN, client_comm);
- if(rank == nservers)
- {
- printf("# remove test done.\n");
-
- /* first non-server rank */
- printf("# <op> <nclients> <nservers> <objs/client> <concurrency> <min> <max> <rate> <niid enabled>\n");
- printf("noop\t%d\t%d\t%d\t%d\t%f\t%f\t%f\t%s\n",
- nclients, nservers, nobjects, nconcurrent, noop_min_elapsed_time, noop_elapsed_time, (double)nobjects*(double)(nclients)/noop_elapsed_time, argv[6]);
-
- done = 0;
- ae_hints_init(&hints);
- ret = ae_post_blocking(triton_do_remote_shutdown, cb, NULL, &hints, NULL, &op_id, &ret2);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, CLIENT_POLL_TIMEOUT);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
- }
- }
-
- triton_finalize();
- MPI_Finalize();
-
- free(server_ranks);
- return 0;
-}
-
-/*
- * Local variables:
- * mode: c
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
diff --git a/code/src/state/test/rosd-status.sh b/code/src/state/test/rosd-status.sh
deleted file mode 100755
index 9d57885..0000000
--- a/code/src/state/test/rosd-status.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-# Test with sorted input...
-mpiexec -l -n 4 ${VALGRIND} ${BIN} /tmp/rosd.db /tmp/rosd-log \
- 1 1 0 0 2 1 ${SRCDIR}/src/mapping/test/hosts2.txt > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-LINES=$( grep "status:" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 2 ]] || exit 1
-
-echo OK
-exit 0
diff --git a/code/src/state/test/rosd-trigger.ae b/code/src/state/test/rosd-trigger.ae
deleted file mode 100644
index 0c96be1..0000000
--- a/code/src/state/test/rosd-trigger.ae
+++ /dev/null
@@ -1,472 +0,0 @@
-
-/**
- Let ROSD servers wait for a change to a state variable
-*/
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <limits.h>
-#include <stdlib.h>
-
-#include "src/common/triton-types.h"
-#include "src/common/triton-debug.h"
-#include "src/aesop/hints.h"
-#include "src/aesop/aesop.h"
-#include "src/remote/encoding.h"
-#include "src/remote/remote.hae"
-#include "src/remote/client-server-exec.hae"
-#include "src/net/triton-message.hae"
-#include "src/net/triton-message-method.hae"
-#include "src/net/mock/mock-method.h"
-#include "src/common/resources/scheduling/sched.hae"
-#include "src/common/resources/timer/timer.hae"
-#include "src/zeroconf/zeroconf.h"
-#include "src/net/mpi/mpi.hae"
-#include "src/net/mpi/mpi-method.h"
-#include "src/remote/service.hae"
-#include "src/replicated-osd/rosd-utils.h"
-#include "src/mapping/mapping.hae"
-#include "src/fakess/fakess.hae"
-#include "src/placement/placement.hae"
-#include "src/state/state.hae"
-#include "src/common/triton-init.h"
-
-/* include server-side rosd skeletons */
-#include "src/replicated-osd/rosd_module.h"
-#include "src/remote/core_module.h"
-
-/* include client-side rosd stubs */
-#include "src/replicated-osd/rosd_stubs.hae"
-#include "src/remote/core_stubs.hae"
-
-#include "mpi.h"
-
-#define SVR_POLL_TIMEOUT 1000
-#define CLIENT_POLL_TIMEOUT 1000
-
-int nobjects = 0;
-int nconcurrent = 0;
-char db_path[PATH_MAX];
-char log_path[PATH_MAX];
-int coalescing = 0;
-int nservers = 0;
-int replication_factor = 0;
-char *hostfile;
-
-int mpi_rank;
-
-__blocking void update_global()
-{
- triton_timer(1000);
- triton_string_t key;
- triton_node_t self;
- triton_status_t *status;
-
- printf("update_global()\n");
- self = triton_map_self();
- triton_status = TRITON_STATUS_MAINTENANCE;
-
- triton_string_init(&key, "triton.state");
- status = malloc(sizeof(triton_status_t));
- *status = triton_status;
- triton_fakess_post(self, &key, status, sizeof(triton_status_t));
-
- triton_string_destroy(&key);
- return;
-}
-
-__blocking void listen_global()
-{
- triton_string_t key;
- triton_state_data_t *data;
- triton_node_t self;
- triton_status_t *status;
- triton_ret_t ret;
-
- printf("listen_global()\n");
-
- self = triton_map_self();
- triton_string_init(&key, "triton.state");
- triton_fakess_item_add(self, &key);
- printf("added item\n");
-
- status = malloc(sizeof(triton_status_t));
- *status = triton_status;
- ret = triton_fakess_post(self, &key,
- status, sizeof(triton_status_t));
- triton_error_assert(ret);
-
- data = triton_fakess_lookup(self, &key);
- assert(data);
-
- if (mpi_rank == 0)
- {
- printf("waiting for update...\n");
- triton_mutex_lock(&data->mutex);
- triton_sched_wait(data->sched, &data->mutex);
- triton_mutex_unlock(&data->mutex);
- }
- printf("status: %i\n", *(int *)(data->value));
-
- triton_string_destroy(&key);
- return;
-}
-
-#if ROSD_DISABLE_FAKESS == 1
-#warning FAKESS DISABLED
-__blocking void do_remote_server(void)
-{
- /* run service engine to process requests */
- assert(AER_DEFAULT_CTX);
- aer_service_engine_start(AER_DEFAULT_CTX);
-
- return;
-}
-#else
-__blocking void do_remote_server(void)
-{
- triton_ret_t ret;
- int32_t result;
- uint128_t oid;
- int nprocs;
-
- MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
-
- assert(nprocs > 1);
-
- pwait
- {
- pprivate int done = 0;
- pprivate int mpi_ret;
- pprivate char done_signal;
- pprivate MPI_Request request;
- pprivate MPI_Status status;
- pprivate triton_ret_t fakess_ret;
-
- pbranch
- {
- /* run service engine to process requests */
- assert(AER_DEFAULT_CTX);
- aer_service_engine_start(AER_DEFAULT_CTX);
- /* when service_engine exits, we are done */
- triton_fakess_engine_stop();
- }
- pbranch
- {
- /* run fakess engine to track system state */
- fakess_ret = triton_fakess_engine_start();
- /* TODO: error handling */
- triton_error_assert(fakess_ret);
- }
- pbranch
- {
- if (mpi_rank == 0)
- {
- update_global();
- }
- }
- pbranch
- {
- triton_status = TRITON_STATUS_NOMINAL;
- listen_global();
- }
- }
-}
-#endif
-
-triton_mutex_t oid_mutex = TRITON_MUTEX_INITIALIZER;
-
-__blocking void do_remote_noop(void)
-{
- triton_ret_t ret;
- int32_t result;
- uint128_t oid;
- uint32_t flags = 0;
-
- /* NOTE: noop doesn't really need an oid to operate on, but we use one
- * anyway for mapping purposes so that we talk to the same servers that
- * we would have had this been a real rosd operation
- */
-
- /* TODO: clean this up; I'm cheating for convenience... */
- oid = triton_uint128_from_uint64(0);
- oid.u += mpi_rank;
-
- pwait
- {
- pprivate int i;
- pprivate triton_addr_t svr_addr;
- pprivate triton_node_t svr_node;
-
- for(i=0; i<nconcurrent; i++)
- {
- pbranch
- {
- triton_mutex_lock(&oid_mutex);
- while(oid.l < nobjects)
- {
- oid.l++;
-
- /* look up location of this object */
- ret = triton_place_lookup(oid, 1, &svr_node);
- triton_error_assert(ret);
-
- triton_mutex_unlock(&oid_mutex);
-
- ret = triton_map_lookup_node(svr_node, &svr_addr);
- triton_error_assert(ret);
-
- ret = remote_triton_core_noop(AER_DEFAULT_CTX, svr_addr, NULL, NULL);
- if(ret != TRITON_SUCCESS)
- {
- fprintf(stderr, "Error: triton_server_noop() failure.\n");
- }
- triton_mutex_lock(&oid_mutex);
- }
- triton_mutex_unlock(&oid_mutex);
- }
- }
- }
-}
-
-static int done = 0;
-static void cb(void *up)
-{
- done=1;
- ae_poll_break(NULL);
-}
-
-static void usage(void)
-{
- fprintf(stderr,
- "Usage: rosd-create-bench <db path> <log path> <objects per proc> <concurrency> <coalescing> <use niids> <nservers> <replication_factor> <hostfile>\n");
-}
-int main(int argc, char *argv[])
-{
- triton_ret_t ret;
- triton_ret_t ret2;
- ae_op_id_t op_id;
- ae_hints_t hints;
- int mpi_ret;
- MPI_Group orig_group, client_group;
- MPI_Comm client_comm;
- int* server_ranks = NULL;
- double test_start, test_end, noop_elapsed;
- double noop_elapsed_time, noop_min_elapsed_time;
- int scan_ret;
- int nclients;
- char rank_suffix[10];
- int i;
- int provided;
-
- mpi_ret = MPI_Init_thread(NULL, NULL, MPI_THREAD_MULTIPLE, &provided);
- assert(mpi_ret == MPI_SUCCESS);
- MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
-
- /* parse command line */
- if(argc != 10)
- {
- usage();
- return(-1);
- }
-
- scan_ret = sscanf(argv[1], "%s", db_path);
- if(scan_ret != 1)
- {
- usage();
- return(-1);
- }
- scan_ret = sscanf(argv[2], "%s", log_path);
- if(scan_ret != 1)
- {
- usage();
- return(-1);
- }
-
- scan_ret = sscanf(argv[3], "%d", &nobjects);
- if(scan_ret != 1 || nobjects < 1)
- {
- usage();
- return(-1);
- }
- scan_ret = sscanf(argv[4], "%d", &nconcurrent);
- if(scan_ret != 1 || nconcurrent < 1)
- {
- usage();
- return(-1);
- }
- scan_ret = sscanf(argv[7], "%d", &nservers);
- if(scan_ret != 1 || nservers < 1)
- {
- usage();
- return(-1);
- }
- if(mpi_rank < nservers)
- {
- ret = triton_zeroconf_set("triton.rosd.niid_enabled", argv[6]);
- if(ret != TRITON_SUCCESS)
- {
- usage();
- return(-1);
- }
- }
-
- scan_ret = sscanf(argv[8], "%d", &replication_factor);
- if(scan_ret != 1 || replication_factor < 1)
- {
- usage();
- return(-1);
- }
-
- hostfile = argv[9];
-
- if(mpi_rank < nservers)
- {
- /* tack on the rank number to the paths to avoid conflicts when
- * running two svrs on one box
- */
- sprintf(rank_suffix, "%d", mpi_rank);
-
- strcat(log_path, rank_suffix);
- ret = triton_zeroconf_set("triton.tosd.data_path", log_path);
- triton_error_assert(ret);
-
- strcat(db_path, rank_suffix);
- ret = triton_zeroconf_set("triton.tosd.db_path", db_path);
- triton_error_assert(ret);
-
- ret = triton_zeroconf_set("triton.tosd.db_coalescing_highwater", argv[5]);
- triton_error_assert(ret);
- ret = triton_zeroconf_set("triton.tosd.data_coalescing_highwater", argv[5]);
- triton_error_assert(ret);
-
- /* servers */
- ret = triton_init("triton.server", "triton.traffic_cop");
- triton_error_assert(ret);
- ret = aer_remote_register_rosd();
- triton_error_assert(ret);
- ret = aer_remote_register_core();
- triton_error_assert(ret);
- }
- else
- {
- /* clients */
- ret = triton_init("triton.client", "triton.traffic_cop");
- triton_error_assert(ret);
- }
-
- /* initialize fakess and placement components */
- /* TODO: error handling? */
- triton_map_file(hostfile);
- triton_fakess_load_map();
-
- server_ranks = (int*)malloc(nservers*sizeof(*server_ranks));
- assert(server_ranks);
- for(i=0; i<nservers; i++)
- {
- server_ranks[i] = i;
- }
- MPI_Comm_size(MPI_COMM_WORLD, &nclients);
- nclients -= nservers;
-
- /* create a communicator for the "clients" */
- mpi_ret = MPI_Comm_group(MPI_COMM_WORLD, &orig_group);
- assert(mpi_ret == MPI_SUCCESS);
- mpi_ret = MPI_Group_excl(orig_group, nservers, server_ranks, &client_group);
- assert(mpi_ret == MPI_SUCCESS);
- mpi_ret = MPI_Comm_create(MPI_COMM_WORLD, client_group, &client_comm);
- assert(mpi_ret == MPI_SUCCESS);
-
- if(mpi_rank < nservers)
- {
- /* servers */
- ae_hints_init(&hints);
- ret = ae_post_blocking(do_remote_server, cb, NULL, &hints, NULL, &op_id);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, SVR_POLL_TIMEOUT);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
- }
- else
- {
- /* clients */
-
- /* wait a little bit to make sure the server gets started */
- sleep(3);
-
- /* barrier and start noop test */
- done = 0;
- mpi_ret = MPI_Barrier(client_comm);
- assert(mpi_ret == MPI_SUCCESS);
- if(mpi_rank == nservers)
- {
- printf("# starting noop test.\n");
- }
-
- test_start = MPI_Wtime();
- ae_hints_init(&hints);
- ret = ae_post_blocking(do_remote_noop, cb, NULL, &hints, NULL, &op_id);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, CLIENT_POLL_TIMEOUT);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
- test_end = MPI_Wtime();
- noop_elapsed = test_end - test_start;
- }
-
- if(mpi_rank >= nservers)
- {
- MPI_Allreduce(&noop_elapsed, &noop_elapsed_time, 1,
- MPI_DOUBLE, MPI_MAX, client_comm);
- MPI_Allreduce(&noop_elapsed, &noop_min_elapsed_time, 1,
- MPI_DOUBLE, MPI_MIN, client_comm);
- if(mpi_rank == nservers)
- {
- printf("# remove test done.\n");
-
- /* first non-server rank */
- printf("# <op> <nclients> <nservers> <objs/client> <concurrency> <min> <max> <rate> <niid enabled>\n");
- printf("noop\t%d\t%d\t%d\t%d\t%f\t%f\t%f\t%s\n",
- nclients, nservers, nobjects, nconcurrent, noop_min_elapsed_time, noop_elapsed_time, (double)nobjects*(double)(nclients)/noop_elapsed_time, argv[6]);
-
- done = 0;
- ae_hints_init(&hints);
- ret = ae_post_blocking(triton_do_remote_shutdown, cb, NULL, &hints, NULL, &op_id, &ret2);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, CLIENT_POLL_TIMEOUT);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
- }
- }
-
- triton_finalize();
- MPI_Finalize();
-
- free(server_ranks);
- return 0;
-}
-
-/*
- * Local variables:
- * mode: c
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
diff --git a/code/src/state/test/rosd-trigger.sh b/code/src/state/test/rosd-trigger.sh
deleted file mode 100755
index 9d57885..0000000
--- a/code/src/state/test/rosd-trigger.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-[[ -n ${TRITON_SCRIPT_DEBUG} ]] && set -x
-
-shopt -s extglob
-SCRIPT=$0
-BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
-OUT=${BIN}.out
-
-# Test with sorted input...
-mpiexec -l -n 4 ${VALGRIND} ${BIN} /tmp/rosd.db /tmp/rosd-log \
- 1 1 0 0 2 1 ${SRCDIR}/src/mapping/test/hosts2.txt > ${OUT} 2>&1
-[[ $? == 0 ]] || exit 1
-
-LINES=$( grep "status:" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 2 ]] || exit 1
-
-echo OK
-exit 0
hooks/post-receive
--
Triton Repository
1
0
Triton-private Repository branch, master, updated. 837daad841732767d04f354ab05a3a6e6bf271f2
by noreply@mcs.anl.gov 05 Mar '12
by noreply@mcs.anl.gov 05 Mar '12
05 Mar '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Triton-private Repository".
The branch, master has been updated
via 837daad841732767d04f354ab05a3a6e6bf271f2 (commit)
from a36e58fd5d468977f2640e2d61963914f197007f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 837daad841732767d04f354ab05a3a6e6bf271f2
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Mon Mar 5 13:01:17 2012 -0500
summary of contributions
- probably too long right now, edit later
-----------------------------------------------------------------------
Summary of changes:
papers/2011/aesop/conclusion.tex | 2 ++
papers/2011/aesop/evaluation.tex | 2 ++
papers/2011/aesop/intro.tex | 35 ++++++++++++++++++++++++-----------
papers/2011/aesop/language.tex | 2 ++
papers/2011/aesop/model.tex | 1 +
5 files changed, 31 insertions(+), 11 deletions(-)
Diff of changes:
diff --git a/papers/2011/aesop/conclusion.tex b/papers/2011/aesop/conclusion.tex
index c3ebb6d..6e2f7e1 100644
--- a/papers/2011/aesop/conclusion.tex
+++ b/papers/2011/aesop/conclusion.tex
@@ -1,3 +1,5 @@
+\label{section:conclusion}
+
Much focus has been placed on programming models for parallel computing.
The focus has been on the constructs to build parallel programs, with
little research on the constructs for building the storage and I/O systems
diff --git a/papers/2011/aesop/evaluation.tex b/papers/2011/aesop/evaluation.tex
index 179118f..21ec4b8 100644
--- a/papers/2011/aesop/evaluation.tex
+++ b/papers/2011/aesop/evaluation.tex
@@ -1,3 +1,5 @@
+\label{section:evaluation}
+
In this paper we evaluate Aesop based on three criteria, runtime efficiency,
memory efficiency and progammer productivity.
diff --git a/papers/2011/aesop/intro.tex b/papers/2011/aesop/intro.tex
index 8c04208..5f1b718 100644
--- a/papers/2011/aesop/intro.tex
+++ b/papers/2011/aesop/intro.tex
@@ -106,19 +106,32 @@ algorithms. Unlike event-driven architectures, the \aesop extensions
also preserve readable control flow regardless of how many steps or
concurrent devices are utilized in a given algorithm. Aesop also offers
functionality that is simply not available in a traditional multithreaded or
-event-driven framework, including the ability to mark variables as being
+event-driven framework, including the ability to mark variables as
shared or private across concurrent execution paths as well as a robust
mechanism to cancel concurrent execution paths.
-\todo{Fill this in:}
+\subsection{Summary of contributions}
-The remainder of this paper is organized as follows. In
-Section~\ref{section:context} we survey challenges in developing
-concurrent system software and in Section~\ref{section:related} we
-identify related work in languages and programming models. In section
-FOO we present an evaluation that contrasts \aesop with N common
-alternative programming models for the case study of a simple file
-server. The implementations are compared both in terms of developer
-productivity and run time performance. Finally in section FOO we
-present our conclusions and identify avenues for future work.
+The contributions of this paper can be summarized as:
+\begin{itemize}
+\item A description of a proposed programming model and language, known
+as Aesop, for use in the development of distributed system software
+\item The definition of new language constructs to aid managing highly
+concurrent execution
+\item An case study comparing Aesop to five popular multithreaded
+and event-driven architectures for a simple distributed service
+\item A quantitative analysis of the code complexity of the architectures
+used in the case study
+\end{itemize}
+
+The remainder of this paper is organized as follows.
+Sections~\ref{section:context} and~\ref{section:related} describe the
+challenges of distributed system software development and related work in
+addressing those challenges. Sections~\ref{section:model}
+and~\ref{section:language} present the Aesop programming model and
+programming language. Section~\ref{section:evaluation} describes a simple
+example distributed service and uses it as a case study to contrast Aesop
+against other models in terms of performance, memory efficiency, and
+productivity. Section~\ref{section:conclusion} summarizes our findings and
+proposes avenues of future work.
diff --git a/papers/2011/aesop/language.tex b/papers/2011/aesop/language.tex
index 35bf5bc..0283d45 100644
--- a/papers/2011/aesop/language.tex
+++ b/papers/2011/aesop/language.tex
@@ -1,3 +1,5 @@
+\label{section:language}
+
% TODO:
% - Language section: how to use it
% - Split into implementation detail section
diff --git a/papers/2011/aesop/model.tex b/papers/2011/aesop/model.tex
index c59b4ba..8356377 100644
--- a/papers/2011/aesop/model.tex
+++ b/papers/2011/aesop/model.tex
@@ -1,3 +1,4 @@
+\label{section:model}
This section describes the \aesop progamming language and the associated
program model.
hooks/post-receive
--
Triton-private Repository
1
0
Triton Repository branch, master, updated. 1531f2b5f95d94114666e44fd19112e80e190214
by noreply@mcs.anl.gov 05 Mar '12
by noreply@mcs.anl.gov 05 Mar '12
05 Mar '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Triton Repository".
The branch, master has been updated
via 1531f2b5f95d94114666e44fd19112e80e190214 (commit)
via 8fc64279b16d14590c69407b83a9bc66f70e80b5 (commit)
via 4c66d930e15c706f35cc804e50b60822cc996f3b (commit)
from 155501673886427f5eb28b0eb82be2aecbc4dc7b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1531f2b5f95d94114666e44fd19112e80e190214
Author: Justin M Wozniak <wozniak(a)mcs.anl.gov>
Date: Mon Mar 5 11:01:48 2012 -0600
Initial use of rosd-injection
commit 8fc64279b16d14590c69407b83a9bc66f70e80b5
Author: Justin M Wozniak <wozniak(a)mcs.anl.gov>
Date: Mon Mar 5 11:01:11 2012 -0600
Check ordering
commit 4c66d930e15c706f35cc804e50b60822cc996f3b
Author: Justin M Wozniak <wozniak(a)mcs.anl.gov>
Date: Tue Feb 28 11:40:43 2012 -0600
rosd-injection skeleton works in new framework: fix author
-----------------------------------------------------------------------
Summary of changes:
code/src/fakess/fakess.ae | 3 +-
code/src/replicated-osd/rosd-test-harness.ae | 17 ++
code/src/state/module.mk.in | 2 +-
code/src/state/state-client.aer | 14 +-
code/src/state/test/module.mk.in | 9 +
code/src/state/test/rosd-global.ae | 252 +++------------------
code/src/state/test/rosd-global.sh | 6 +-
code/src/state/test/rosd-injection.ae | 317 +++++---------------------
code/src/state/test/rosd-injection.sh | 22 +-
9 files changed, 132 insertions(+), 510 deletions(-)
Diff of changes:
diff --git a/code/src/fakess/fakess.ae b/code/src/fakess/fakess.ae
index 409610b..87786d5 100644
--- a/code/src/fakess/fakess.ae
+++ b/code/src/fakess/fakess.ae
@@ -526,8 +526,9 @@ __blocking triton_ret_t triton_fakess_post(triton_node_t node,
triton_string_t tmp;
- tag = triton_msg_new_tag(msg_group);
assert(initialized);
+
+ tag = triton_msg_new_tag(msg_group);
if (triton_debug_enabled(debug_system))
{
triton_node_to_string(node, &tmp);
diff --git a/code/src/replicated-osd/rosd-test-harness.ae b/code/src/replicated-osd/rosd-test-harness.ae
index cc608bf..a1ca724 100644
--- a/code/src/replicated-osd/rosd-test-harness.ae
+++ b/code/src/replicated-osd/rosd-test-harness.ae
@@ -19,6 +19,9 @@
#include "src/replicated-osd/rosd_module.h"
#include "src/remote/core_module.h"
+#include "src/state/sc_stubs.hae"
+#include "src/state/sc_module.h"
+
#include "mpi.h"
static triton_mutex_t oid_mutex = TRITON_MUTEX_INITIALIZER;
@@ -591,6 +594,9 @@ __blocking triton_ret_t rosd_test_harness_server_fn(int nservers, int nclients,
triton_ret_t ret;
char* hostfile;
struct rosd_test_harness_options* options = (struct rosd_test_harness_options*)data;
+ triton_node_t self;
+ triton_string_t key;
+ triton_status_t *status;
/* set paths for data storage */
ret = triton_zeroconf_set("triton.tosd.data_path", options->log_path);
@@ -606,6 +612,10 @@ __blocking triton_ret_t rosd_test_harness_server_fn(int nservers, int nclients,
ret = aer_remote_register_core();
triton_error_assert(ret);
+ /* register state-client RPCs */
+ ret = aer_remote_register_sc();
+ triton_error_assert(ret);
+
/* initialize fakess and placement components */
hostfile = triton_map_generate_mapfile(nservers);
if(!hostfile)
@@ -623,6 +633,13 @@ __blocking triton_ret_t rosd_test_harness_server_fn(int nservers, int nclients,
return(ret);
}
+ triton_fakess_state_install();
+ self = triton_map_self();
+ triton_string_init(&key, "triton.state");
+ triton_fakess_item_add(self, &key);
+ status = malloc(sizeof(triton_status_t));
+ *status = TRITON_STATUS_NOMINAL;
+
pwait
{
pbranch
diff --git a/code/src/state/module.mk.in b/code/src/state/module.mk.in
index 5bb4269..e473f6c 100644
--- a/code/src/state/module.mk.in
+++ b/code/src/state/module.mk.in
@@ -9,7 +9,7 @@ AELIBSRC += $(DIR_STATE)/state.ae
MODCFLAGS_$(DIR_STATE)/state = $(MPICFLAGS)
MODCC_$(DIR_STATE)/state = $(MPICC)
-REMOTE_TESTLIB_MODULES += $(DIR_STATE)/sc
+REMOTE_LIB_MODULES += $(DIR_STATE)/sc
REMOTE_MODSRC_$(DIR_STATE)/sc := $(DIR_STATE)/state-client.aer
MODCFLAGS_$(DIR_STATE)/state-client = $(MPICFLAGS)
diff --git a/code/src/state/state-client.aer b/code/src/state/state-client.aer
index d9939ad..fb737f7 100644
--- a/code/src/state/state-client.aer
+++ b/code/src/state/state-client.aer
@@ -111,7 +111,7 @@ __remote __blocking triton_ret_t state_client_propagation(
static void inject_local_fault()
{
- puts("entering faulty state...");
+ printf("entering faulty state...\n");
triton_zeroconf_set("triton.net.fault_injector.insert_send_timeouts_at_rate",
"100");
return;
@@ -121,7 +121,8 @@ static void handle_state_change(triton_status_t *status)
{
triton_string_t state;
triton_status_tostring(&state, *status);
- triton_debug(debug, "new state: %s\n", triton_string_get(&state));
+ // triton_debug(debug, "new state: %s\n", triton_string_get(&state));
+ printf("handle_state_change(): new state: %s\n", triton_string_get(&state));
triton_string_destroy(&state);
if (*status == TRITON_STATUS_INJECTED)
@@ -145,7 +146,6 @@ __remote __blocking triton_ret_t state_client_admin_status_set(
triton_status_t *copy;
triton_ret_t ret;
- /* Copy in from RPC */
copy = malloc(sizeof(triton_status_t));
*copy = *status;
@@ -155,10 +155,12 @@ __remote __blocking triton_ret_t state_client_admin_status_set(
/* Propagate into state system */
self = triton_map_self();
triton_string_init(&key, "triton.state");
- ret = triton_state.post(self, &key,
- copy, sizeof(triton_status_t));
- triton_string_destroy(&key);
+ ret = triton_state.post(self, &key,
+ copy, sizeof(triton_status_t));
+ /* triton_string_destroy(&key); */
+
+ ret = TRITON_SUCCESS;
return(ret);
}
diff --git a/code/src/state/test/module.mk.in b/code/src/state/test/module.mk.in
index 3111c09..c5b6d76 100644
--- a/code/src/state/test/module.mk.in
+++ b/code/src/state/test/module.mk.in
@@ -74,6 +74,7 @@ MODCFLAGS_$(DIR)/rosd-global = $(MPICFLAGS) \
MODLDFLAGS_$(DIR)/rosd-global = $(MPILDFLAGS)
MODLIBS_$(DIR)/rosd-global = $(MPILIBS)
MODCC_$(DIR)/rosd-global = $(MPICC)
+MODLINKWITH_$(DIR)/rosd-global = src/replicated-osd/tests/rosd-test-builder.o
MODCFLAGS_$(DIR)/rosd-status = $(MPICFLAGS) \
-D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
@@ -95,3 +96,11 @@ MODCFLAGS_$(DIR)/rosd-peers = $(MPICFLAGS) \
MODLDFLAGS_$(DIR)/rosd-peers = $(MPILDFLAGS)
MODLIBS_$(DIR)/rosd-peers = $(MPILIBS)
MODCC_$(DIR)/rosd-peers = $(MPICC)
+
+MODCFLAGS_$(DIR)/rosd-injection = $(MPICFLAGS) \
+ -D ROSD_DISABLE_FAKESS=$(ROSD_DISABLE_FAKESS) \
+ -Wunused-variable
+MODLDFLAGS_$(DIR)/rosd-injection = $(MPILDFLAGS)
+MODLIBS_$(DIR)/rosd-injection = $(MPILIBS)
+MODCC_$(DIR)/rosd-injection = $(MPICC)
+MODLINKWITH_$(DIR)/rosd-injection = src/replicated-osd/tests/rosd-test-builder.o
\ No newline at end of file
diff --git a/code/src/state/test/rosd-global.ae b/code/src/state/test/rosd-global.ae
index 1a290dd..dc7a496 100644
--- a/code/src/state/test/rosd-global.ae
+++ b/code/src/state/test/rosd-global.ae
@@ -1,6 +1,8 @@
/**
- Let ROSD servers read a global state variable
+ ROSD GLOBAL
+
+ Startup / post global / shutdown
*/
#include <sys/types.h>
@@ -12,240 +14,44 @@
#include "src/common/triton-debug.h"
#include "src/aesop/hints.h"
#include "src/aesop/aesop.h"
-#include "src/remote/client-server-exec.hae"
-#include "src/replicated-osd/rosd-test-harness.hae"
-#include "src/mapping/mapping.hae"
+#include "src/remote/encoding.h"
+#include "src/remote/remote.hae"
+#include "src/net/triton-message.hae"
+#include "src/net/triton-message-method.hae"
+#include "src/net/mock/mock-method.h"
+#include "src/common/resources/scheduling/sched.hae"
+#include "src/common/resources/timer/timer.hae"
#include "src/zeroconf/zeroconf.h"
+#include "src/net/mpi/mpi.hae"
+#include "src/net/mpi/mpi-method.h"
+#include "src/remote/service.hae"
+#include "src/replicated-osd/rosd-utils.h"
+#include "src/mapping/mapping.hae"
#include "src/fakess/fakess.hae"
-#include "src/common/resources/timer/timer.hae"
+#include "src/placement/placement.hae"
+#include "src/common/triton-init.h"
/* include server-side rosd skeletons */
#include "src/replicated-osd/rosd_module.h"
#include "src/remote/core_module.h"
-#include "mpi.h"
+/* include client-side rosd stubs */
+#include "src/replicated-osd/rosd_stubs.hae"
+#include "src/remote/core_stubs.hae"
-#define POLL_TIMEOUT 1000
-
-static __blocking triton_ret_t rosd_client_fn(int nservers, int nclients, void* data, MPI_Comm client_comm);
-static __blocking triton_ret_t server_fn(int nclients, int nservers, void* data, MPI_Comm server_comm);
-
-triton_ret_t main_tret;
-static int done = 0;
-static void cb(void *up, triton_ret_t tret)
-{
- main_tret = tret;
- done=1;
- ae_poll_break(NULL);
-}
-
-__blocking void update_global()
-{
- triton_timer(1000);
- triton_string_t key;
- int *value;
- triton_string_init(&key, "KEY1");
- value = malloc(sizeof(int));
- *value = 23;
- printf("update_global()\n");
- triton_fakess_post(triton_node_null, &key, value, sizeof(int));
- return;
-}
-
-__blocking void listen_global()
-{
- triton_string_t key;
- int *value;
- triton_state_data_t *data;
- triton_string_init(&key, "KEY1");
- triton_fakess_item_add(triton_node_null, &key);
-
- triton_timer(2000);
-
- printf("listen_global()\n");
-
- data = triton_fakess_lookup(triton_node_null, &key);
- value = data->value;
- printf("value: %i\n", *value);
-
- triton_string_destroy(&key);
+#include "src/replicated-osd/rosd-test-harness.hae"
- return;
-}
+#include "mpi.h"
-static __blocking triton_ret_t server_fn(int nclients, int nservers, void* data, MPI_Comm server_comm)
+ __blocking triton_ret_t rosd_test_client_fn(int nservers,
+ int nclients,
+ void* data,
+ MPI_Comm client_comm)
{
- triton_ret_t ret;
- char* hostfile;
int rank;
- struct rosd_test_harness_options* options = (struct rosd_test_harness_options*)data;
-
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
- /* set paths for data storage */
- ret = triton_zeroconf_set("triton.tosd.data_path", options->log_path);
- triton_error_assert(ret);
- ret = triton_zeroconf_set("triton.tosd.db_path", options->db_path);
- triton_error_assert(ret);
-
- /* start triton library and register appropriate RPCs */
- ret = triton_init("triton.server");
- triton_error_assert(ret);
- ret = aer_remote_register_rosd();
- triton_error_assert(ret);
- ret = aer_remote_register_core();
- triton_error_assert(ret);
-
- /* initialize fakess and placement components */
- hostfile = triton_map_generate_mapfile(nservers);
- if(!hostfile)
- return(TRITON_ERR_INVAL);
- ret = triton_map_file(hostfile);
- if(ret != TRITON_SUCCESS)
- {
- free(hostfile);
- return(ret);
- }
- ret = triton_fakess_load_map();
- triton_map_destroy_mapfile(hostfile);
- if(ret != TRITON_SUCCESS)
- {
- return(ret);
- }
-
- pwait
- {
- pbranch
- {
- /* run service engine to process requests */
- assert(AER_DEFAULT_CTX);
- aer_service_engine_start(AER_DEFAULT_CTX);
- /* once service engine stops we should stop fakess as well */
- triton_fakess_engine_stop();
- }
- pbranch
- {
- triton_ret_t fakess_ret;
- /* start fakess engine */
- fakess_ret = triton_fakess_engine_start();
- /* TODO: error handling */
- triton_error_assert(fakess_ret);
- }
- pbranch
- {
- if (rank == 0)
- {
- update_global();
- }
- }
- pbranch
- {
- listen_global();
- }
- }
-
- /* will exit when it gets a shutdown request from a client */
-
- return(TRITON_SUCCESS);
-}
-
-int main(int argc, char *argv[])
-{
- triton_ret_t ret;
- ae_op_id_t op_id;
- ae_hints_t hints;
- int rank, nprocs;
- int mpi_ret;
- int provided;
- struct rosd_test_harness_options options;
-
- mpi_ret = MPI_Init_thread(NULL, NULL, MPI_THREAD_MULTIPLE, &provided);
- assert(mpi_ret == MPI_SUCCESS);
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
-
- /* parse command line */
- ret = rosd_test_harness_parseargs(argc, argv, rank, &options);
- if(ret != TRITON_SUCCESS)
- {
- return(-1);
- }
-
- if(options.nservers < 1 || (nprocs - options.nservers) < 1)
- {
- fprintf(stderr, "Error: not enough procs.\n");
- return(-1);
- }
-
- ae_hints_init(&hints);
- ret = ae_post_blocking(triton_launch_client_server, cb, NULL, &hints, NULL, &op_id, &main_tret, options.nservers, &options, rosd_client_fn, server_fn);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, POLL_TIMEOUT);
- }
- }
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
-
- if(main_tret != TRITON_SUCCESS)
- fprintf(stderr, "Error: test failed.\n");
-
- triton_finalize();
- MPI_Finalize();
-
- return 0;
-}
-
-static __blocking triton_ret_t rosd_client_fn(int nservers, int nclients, void* data, MPI_Comm client_comm)
-{
- triton_ret_t ret;
- char* hostfile;
- int client_rank;
- double noop_elapsed_time, noop_min_elapsed_time, noop_rate;
- int mpi_ret;
- struct rosd_test_harness_options* options = (struct rosd_test_harness_options*)data;
-
- MPI_Comm_rank(client_comm, &client_rank);
-
- /* start up triton */
- ret = triton_init("triton.client");
- triton_error_assert(ret);
-
- /* initialize fakess and placement components */
- hostfile = triton_map_generate_mapfile(nservers);
- if(!hostfile)
- return(TRITON_ERR_INVAL);
- ret = triton_map_file(hostfile);
- if(ret != TRITON_SUCCESS)
- {
- free(hostfile);
- return(ret);
- }
- ret = triton_fakess_load_map();
- unlink(hostfile);
- free(hostfile);
- if(ret != TRITON_SUCCESS)
- {
- return(ret);
- }
-
- if(client_rank == 0)
- printf("# starting noop test.\n");
- ret = rosd_test_harness_noop(options, client_comm, &noop_min_elapsed_time, &noop_elapsed_time, &noop_rate);
- triton_error_assert(ret);
- sleep(2);
-
- if(client_rank == 0)
- {
- printf("# <op> <nclients> <options->nservers> <objs/client> <concurrency> <min> <max> <rate>\n");
- printf("noop\t%d\t%d\t%d\t%d\t%f\t%f\t%f\n",
- nclients, options->nservers, options->nobjects, options->nconcurrent, noop_min_elapsed_time, noop_elapsed_time, noop_rate);
-
- }
-
- return(TRITON_SUCCESS);
+ MPI_Comm_rank(client_comm, &rank);
+ printf("rosd-global: rosd_client_fn(): rank: %i\n", rank);
+ return TRITON_SUCCESS;
}
/*
diff --git a/code/src/state/test/rosd-global.sh b/code/src/state/test/rosd-global.sh
index 62ba29f..20b7148 100755
--- a/code/src/state/test/rosd-global.sh
+++ b/code/src/state/test/rosd-global.sh
@@ -12,9 +12,9 @@ mpiexec -l -n 4 ${VALGRIND} ${BIN} /tmp/rosd.db /tmp/rosd-log \
1 1 2 1 > ${OUT} 2>&1
[[ $? == 0 ]] || exit 1
-LINES=$( grep "value: 23" ${OUT} | wc -l )
-[[ $? == 0 ]] || exit 1
-[[ ${LINES} == 2 ]] || exit 1
+# LINES=$( grep "value: 23" ${OUT} | wc -l )
+# [[ $? == 0 ]] || exit 1
+# [[ ${LINES} == 2 ]] || exit 1
echo OK
exit 0
diff --git a/code/src/state/test/rosd-injection.ae b/code/src/state/test/rosd-injection.ae
index 590b047..d54bb4f 100644
--- a/code/src/state/test/rosd-injection.ae
+++ b/code/src/state/test/rosd-injection.ae
@@ -1,7 +1,8 @@
/**
- Let ROSD servers wait for a change to a state variable from
- multiple peers. The change is triggered by the client
+ ROSD GLOBAL
+
+ Startup / post global / shutdown
*/
#include <sys/types.h>
@@ -13,299 +14,85 @@
#include "src/common/triton-debug.h"
#include "src/aesop/hints.h"
#include "src/aesop/aesop.h"
-#include "src/remote/client-server-exec.hae"
-#include "src/replicated-osd/rosd-test-harness.hae"
-#include "src/mapping/mapping.hae"
+#include "src/remote/encoding.h"
+#include "src/remote/remote.hae"
+#include "src/net/triton-message.hae"
+#include "src/net/triton-message-method.hae"
+#include "src/net/mock/mock-method.h"
+#include "src/common/triton-init.h"
+#include "src/common/resources/scheduling/sched.hae"
+#include "src/common/resources/timer/timer.hae"
#include "src/zeroconf/zeroconf.h"
+#include "src/net/mpi/mpi.hae"
+#include "src/net/mpi/mpi-method.h"
+#include "src/remote/service.hae"
+#include "src/replicated-osd/rosd-utils.h"
+#include "src/mapping/mapping.hae"
#include "src/fakess/fakess.hae"
-#include "src/common/resources/timer/timer.hae"
+#include "src/placement/placement.hae"
#include "src/state/state.hae"
#include "src/state/sc_stubs.hae"
-#include "src/placement/placement.hae"
-#include "src/remote/core_stubs.hae"
+#include "src/state/sc_module.h"
/* include server-side rosd skeletons */
#include "src/replicated-osd/rosd_module.h"
#include "src/remote/core_module.h"
-#include "src/state/sc_module.h"
-
-#include "mpi.h"
-
-#define POLL_TIMEOUT 1000
-
-static __blocking triton_ret_t rosd_client_fn(int nservers, int nclients, void* data, MPI_Comm client_comm);
-static __blocking triton_ret_t server_fn(int nclients, int nservers, void* data, MPI_Comm server_comm);
-static __blocking void do_remote_admin_status_set(struct rosd_test_harness_options* options);
-
-int mpi_rank;
-
-static bool do_remote_admin_status_set_result = false;
-
-void handle_status_change(triton_node_t node,
- triton_status_t *status_current,
- triton_status_t *status_previous);
-
-void handle_status_change(triton_node_t node,
- triton_status_t *status_current,
- triton_status_t *status_previous)
-{
- char node_string[128];
- triton_string_t status_string_current;
- triton_string_t status_string_previous;
-
- triton_uint128_to_string(node_string, 128, node);
- triton_status_tostring(&status_string_current, *status_current);
- triton_status_tostring(&status_string_previous, *status_previous);
-
- printf("handle status change: node: %s from: %s to: %s\n",
- node_string,
- triton_string_get(&status_string_previous),
- triton_string_get(&status_string_current));
- triton_string_destroy(&status_string_current);
- triton_string_destroy(&status_string_previous);
- *status_previous = *status_current;
-}
+/* include client-side rosd stubs */
+#include "src/replicated-osd/rosd_stubs.hae"
+#include "src/remote/core_stubs.hae"
-#include "src/state/test/rosd-test-funcs.ae"
+#include "mpi.h"
-static __blocking triton_ret_t server_fn(int nclients, int nservers, void* data, MPI_Comm server_comm)
+ __blocking triton_ret_t rosd_test_client_fn(int nservers,
+ int nclients,
+ void* data,
+ MPI_Comm client_comm)
{
triton_ret_t ret;
- char* hostfile;
int rank;
- struct rosd_test_harness_options* options = (struct rosd_test_harness_options*)data;
+ triton_node_t svr_node;
+ triton_addr_t svr_addr;
+ uint128_t oid;
+ triton_string_t s;
+ triton_status_t *status;
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ triton_uint128_setzero(oid);
- /* set paths for data storage */
- ret = triton_zeroconf_set("triton.tosd.data_path", options->log_path);
- triton_error_assert(ret);
- ret = triton_zeroconf_set("triton.tosd.db_path", options->db_path);
- triton_error_assert(ret);
+ MPI_Comm_rank(client_comm, &rank);
+ printf("rosd-injection: rosd_client_fn(): rank: %i\n", rank);
- /* start triton library and register appropriate RPCs */
- ret = triton_init("triton.server");
+ ret = triton_place_lookup(oid, 1, &svr_node);
triton_error_assert(ret);
- ret = aer_remote_register_rosd();
- triton_error_assert(ret);
- ret = aer_remote_register_core();
- triton_error_assert(ret);
- ret = aer_remote_register_sc();
- triton_error_assert(ret);
-
- /* initialize fakess and placement components */
- hostfile = triton_map_generate_mapfile(nservers);
- if(!hostfile)
- return(TRITON_ERR_INVAL);
- ret = triton_map_file(hostfile);
- if(ret != TRITON_SUCCESS)
- {
- free(hostfile);
- return(ret);
- }
- ret = triton_fakess_load_map();
- triton_map_destroy_mapfile(hostfile);
- if(ret != TRITON_SUCCESS)
- {
- return(ret);
- }
-
- triton_debug_enable("/dev/stdout", "net.fault");
- triton_fakess_state_install();
-
- pwait
- {
- pbranch
- {
- /* run service engine to process requests */
- assert(AER_DEFAULT_CTX);
- aer_service_engine_start(AER_DEFAULT_CTX);
- /* once service engine stops we should stop fakess as well */
- triton_fakess_engine_stop();
- }
- pbranch
- {
- triton_ret_t fakess_ret;
- /* start fakess engine */
- fakess_ret = triton_fakess_engine_start();
- /* TODO: error handling */
- triton_error_assert(fakess_ret);
- }
- pbranch
- {
- triton_status = TRITON_STATUS_NOMINAL;
- monitor_state();
- }
- }
-
- /* will exit when it gets a shutdown request from a client */
-
- return(TRITON_SUCCESS);
-}
-triton_mutex_t oid_mutex = TRITON_MUTEX_INITIALIZER;
-
-static __blocking triton_ret_t rosd_client_fn(int nservers, int nclients, void* data, MPI_Comm client_comm)
-{
- triton_ret_t ret;
- char* hostfile;
- int client_rank;
- int mpi_ret;
- struct rosd_test_harness_options* options = (struct rosd_test_harness_options*)data;
- int32_t result;
- uint128_t oid;
- int32_t *status;
-
- MPI_Comm_rank(client_comm, &client_rank);
-
- /* start up triton */
- ret = triton_init("triton.client");
+ ret = triton_map_lookup_node(svr_node, &svr_addr);
triton_error_assert(ret);
- /* initialize fakess and placement components */
- hostfile = triton_map_generate_mapfile(nservers);
- if(!hostfile)
- return(TRITON_ERR_INVAL);
- ret = triton_map_file(hostfile);
- if(ret != TRITON_SUCCESS)
- {
- free(hostfile);
- return(ret);
- }
- ret = triton_fakess_load_map();
- unlink(hostfile);
- free(hostfile);
- if(ret != TRITON_SUCCESS)
- {
- return(ret);
- }
-
- // triton_status_t maintenance = TRITON_STATUS_MAINTENANCE;
- triton_status_t injected = TRITON_STATUS_INJECTED;
-
- /* NOTE: we aren't really operating on objects here; just using OID as a
- * way to map to servers.
- */
-
- /* TODO: clean this up; I'm cheating for convenience... */
- oid = triton_uint128_from_uint64(0);
- oid.u += mpi_rank;
-
- status = malloc(sizeof(int32_t));
- *status = injected;
-
- /* TODO: why are we using oids here? Maybe it would be better to just
- * pick servers out of the mapping?
- */
-
- pwait
- {
- pprivate int i;
- pprivate triton_addr_t svr_addr;
- pprivate triton_node_t svr_node;
-
- for(i=0; i<options->nconcurrent; i++)
- {
- pbranch
- {
- triton_mutex_lock(&oid_mutex);
- while(oid.l < options->nobjects)
- {
- oid.l++;
-
- /* look up location of this object */
- ret = triton_place_lookup(oid, 1, &svr_node);
- triton_error_assert(ret);
-
- triton_mutex_unlock(&oid_mutex);
-
- ret = triton_map_lookup_node(svr_node, &svr_addr);
- triton_error_assert(ret);
+ triton_addr_to_string(svr_addr, &s);
+ printf("addr: %s\n", triton_string_get(&s));
+ triton_string_destroy(&s);
- triton_timer(mpi_rank*1000-2000);
- ret = remote_state_client_admin_status_set
- (AER_DEFAULT_CTX, svr_addr, status, NULL);
- if (ret != TRITON_ERR_CANCELED)
- {
- fprintf(stderr, "ERROR: remote_state_client_admin_status_set() returned and unexpected value.\n");
- exit(-1);
- }
+ // triton_timer(rank*1000-2000);
- triton_mutex_lock(&oid_mutex);
- }
- triton_mutex_unlock(&oid_mutex);
- }
- }
- }
-
- do_remote_admin_status_set_result = true;
-
- return(TRITON_SUCCESS);
-}
-
-triton_ret_t main_tret;
-static int done = 0;
-static void cb(void *up, triton_ret_t tret)
-{
- main_tret = tret;
- done=1;
- ae_poll_break(NULL);
-}
-
-int main(int argc, char *argv[])
-{
- triton_ret_t ret;
- ae_op_id_t op_id;
- ae_hints_t hints;
- int mpi_ret;
- int provided;
- struct rosd_test_harness_options options;
- int nprocs;
-
- mpi_ret = MPI_Init_thread(NULL, NULL, MPI_THREAD_MULTIPLE, &provided);
- assert(mpi_ret == MPI_SUCCESS);
- MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
- MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
-
- /* parse command line */
- ret = rosd_test_harness_parseargs(argc, argv, mpi_rank, &options);
- if(ret != TRITON_SUCCESS)
+ /* only one client sets the status */
+ if (rank == 0)
{
- return(-1);
- }
-
- if(options.nservers < 1 || (nprocs - options.nservers) < 1)
- {
- fprintf(stderr, "Error: not enough procs.\n");
- return(-1);
- }
+ status = malloc(sizeof(triton_status_t));
+ *status = TRITON_STATUS_INJECTED;
+ ret = remote_state_client_admin_status_set
+ (AER_DEFAULT_CTX, svr_addr, status, NULL);
+ triton_error_assert(ret);
- ae_hints_init(&hints);
- ret = ae_post_blocking(triton_launch_client_server, cb, NULL, &hints, NULL, &op_id, &main_tret, options.nservers, &options, rosd_client_fn, server_fn);
- if(ret == TRITON_SUCCESS)
- {
- while(!done)
- {
- ae_poll(NULL, POLL_TIMEOUT);
- }
+ printf("called\n");
}
- triton_error_assert(ret);
- ae_hints_destroy(&hints);
-
- if(main_tret != TRITON_SUCCESS)
- fprintf(stderr, "Error: test failed.\n");
-
- triton_finalize();
- MPI_Finalize();
-
- return 0;
+ return TRITON_SUCCESS;
}
/*
* Local variables:
- * mode: c
- * c-basic-offset: 4
+ * mode: c
+ * c-indent-level: 4
+ * c-basic-offset: 4
* End:
*
* vim: ts=8 sts=4 sw=4 expandtab
diff --git a/code/src/state/test/rosd-injection.sh b/code/src/state/test/rosd-injection.sh
index 5e5f66d..7db691b 100755
--- a/code/src/state/test/rosd-injection.sh
+++ b/code/src/state/test/rosd-injection.sh
@@ -7,27 +7,27 @@ SCRIPT=$0
BIN=${SCRIPT//+(${SRCDIR}\/|.sh)}
OUT=${BIN}.out
-export triton_fakess_method=fault
-export aesop_remote_default_net=fault
+# export triton_fakess_method=fault
+# export aesop_remote_default_net=fault
export triton_traffic_cop_static_timeout=10
# TODO: skipping this test for now; comment out the following 2 lines to
# re-enable it
-echo "SKIPPING: Test broken as of 2011-12-07"
-exit 0
+# echo "SKIPPING: Test broken as of 2011-12-07"
+# exit 0
# Test with sorted input...
mpiexec -l -n 4 ${VALGRIND} ${BIN} /tmp/rosd.db /tmp/rosd-log \
- 1 1 2 1 ${SRCDIR}/src/mapping/test/faulty2.txt > ${OUT} 2>&1
-# This is expected to fail
-[[ $? != 0 ]] || exit 1
-
-LINES=$( grep "status change:" ${OUT} | wc -l )
+ 1 1 2 1 > ${OUT} 2>&1
+#
[[ $? == 0 ]] || exit 1
-# This seems unpredictable:
+
+# LINES=$( grep "status change:" ${OUT} | wc -l )
+# [[ $? == 0 ]] || exit 1
+# This seems unpredictable:
# [[ ${LINES} == 4 ]] || exit 1
-grep "entering faulty state" ${OUT} || exit 1
+# grep "entering faulty state" ${OUT} || exit 1
echo OK
exit 0
hooks/post-receive
--
Triton Repository
1
0
Triton-private Repository branch, master, updated. a36e58fd5d468977f2640e2d61963914f197007f
by noreply@mcs.anl.gov 05 Mar '12
by noreply@mcs.anl.gov 05 Mar '12
05 Mar '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Triton-private Repository".
The branch, master has been updated
via a36e58fd5d468977f2640e2d61963914f197007f (commit)
from d85b33448e54d0ac8f38bc71b03d4753d83dc8d3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a36e58fd5d468977f2640e2d61963914f197007f
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Mon Mar 5 11:44:02 2012 -0500
some comments in the language/model sections
-----------------------------------------------------------------------
Summary of changes:
papers/2011/aesop/model.tex | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
Diff of changes:
diff --git a/papers/2011/aesop/model.tex b/papers/2011/aesop/model.tex
index fa1020d..c59b4ba 100644
--- a/papers/2011/aesop/model.tex
+++ b/papers/2011/aesop/model.tex
@@ -20,7 +20,11 @@ all of the pbranches it encloses have completed.
By default, variables in \aesop are shared between pbranches. Marking a
variable as {\em pprivate} gives each pbranch a private shadow copy, initialized
-using the shared instance when the branch is created.
+using the shared instance when the branch is created. \color{red}PHC:
+clarify that when you say variables are shared between pbranches by default,
+you are only talking about variables declared in the scope containing the
+pbranch. Variables actually declared in the pbranch itself are private by
+default.\color{black}
It is possible for a pbranch to request the termination (or cancellation) of
all other pbranches within the same pwait by calling the
@@ -30,7 +34,11 @@ it does not wait for the other pbranches to exit. While pbranches are not
forcibly terminated, a pbranch with an outstanding cancellation request
exhibits a slightly different behavior to ensure a race free delivery of the
cancellation signal. By design, it is not possible for a pbranch to clear its
-cancellation flag.
+cancellation flag. \color{red}PHC: we probably have to clarify "slightly
+different behavior" there to keep reviewers from flipping out. Maybe just
+say that a cancelled pbranch will receive a well-known (ECANCELLED) error
+code from affected functions, and that a pbranch can also check its
+cancellation state manually at any time?\color{black}
\aesop also supports {\em lonely pbranches}, i.e.\ pbranches created outside
of a pwait. A lonely pbranch is similar to a POSIX detached thread in that
@@ -50,7 +58,10 @@ Functions can be made blocking by adding the \code{__blocking}
qualifyer to the function declaration. However, blocking functions can only be
called (either direct or indirect through a blocking function pointer) by
other blocking functions. This effectively requires the starting function of
-an \aesop program to be blocking.
+an \aesop program to be blocking. \color{red}PHC: what about bindings like
+we use for the key/val API? This is perhaps important to show that Aesop
+can be used not only on the server side, but also in libraries that are
+linked to standard applications.\color{black}.
% cancellation
@@ -90,6 +101,10 @@ multiple OS threads executing within a single aesop program. In fact, to fully
exploit multi-core systems, we routinely use multiple threads to run aesop
code. In that case, if more than one pbranch becomes ready for execution,
multiple threads will be used to execute those branches concurrently.
+\color{red}PHC: clarify that when you say "we routinely use multiple threads
+to run aesop code" you don't mean that the developer is explicitly
+putting threads in their code; you are talking about something that's
+happening within the aesop runtime engine.\color{black}
\subsection{Example Aesop Code}
hooks/post-receive
--
Triton-private Repository
1
0