c-mpi-commits Mailing List for C-MPI (Page 6)
Status: Pre-Alpha
Brought to you by:
jmwozniak
You can subscribe to this list here.
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
(64) |
May
(80) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2011 |
Jan
|
Feb
(7) |
Mar
(3) |
Apr
(33) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jmw...@us...> - 2010-05-11 19:13:33
|
Revision: 82
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=82&view=rev
Author: jmwozniak
Date: 2010-05-11 19:13:24 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Wrapper script for ADT tests.
Added Paths:
-----------
test/adts/runtest.zsh
Added: test/adts/runtest.zsh
===================================================================
--- test/adts/runtest.zsh (rev 0)
+++ test/adts/runtest.zsh 2010-05-11 19:13:24 UTC (rev 82)
@@ -0,0 +1,13 @@
+#!/bin/zsh
+
+PROG=$1
+OUTPUT=$2
+
+${PROG} > ${OUTPUT}
+if [[ $? != 0 ]]
+then
+ mv -v ${OUTPUT} ${OUTPUT}.failed
+ exit 1
+fi
+
+return 0
Property changes on: test/adts/runtest.zsh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-11 16:11:03
|
Revision: 81
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=81&view=rev
Author: jmwozniak
Date: 2010-05-11 16:10:53 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Better error handling when mpd not up, manual improvements.
Modified Paths:
--------------
Makefile.in
docs/manual/manual.xml
docs/manual/sf-post.zsh
test/cmpi/module.mk.in
test/cmpi-db/module.mk.in
test/mpirpc/module.mk.in
Added Paths:
-----------
tools/mpd-available.zsh
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-10 19:46:14 UTC (rev 80)
+++ Makefile.in 2010-05-11 16:10:53 UTC (rev 81)
@@ -63,7 +63,7 @@
MPI = @USE_MPI@
MPICC = @USE_MPI@/bin/mpicc
MPIEXEC = @USE_MPI@/bin/mpiexec -recvtimeout 10
-CHECK_MPD = @USE_MPI@/bin/mpdlistjobs > /dev/null
+MPDCHECK = tools/mpd-available.zsh @USE_MPI@/bin/mpdlistjobs
# Job launch selection
ifeq (@HAVE_SRUN@,no)
Modified: docs/manual/manual.xml
===================================================================
--- docs/manual/manual.xml 2010-05-10 19:46:14 UTC (rev 80)
+++ docs/manual/manual.xml 2010-05-11 16:10:53 UTC (rev 81)
@@ -553,7 +553,7 @@
(This is how all tests will be run in the future.)
<variablelist>
<varlistentry>
- <term>make test_results</term>
+ <term>make D=1 test_results</term>
<listitem><para>
Build and run all the tests.
Requires <literal>./configure --enable-tests</literal>
Modified: docs/manual/sf-post.zsh
===================================================================
--- docs/manual/sf-post.zsh 2010-05-10 19:46:14 UTC (rev 80)
+++ docs/manual/sf-post.zsh 2010-05-11 16:10:53 UTC (rev 81)
@@ -9,4 +9,6 @@
cd ${DIR}
HTML=( index.html manual.html )
-scp ${HTML} ${USER},c-...@we...:htdocs
+IMG=( cmpi-connections.png )
+FILES=( ${HTML} ${IMG} )
+scp -p ${FILES} ${USER},c-...@we...:htdocs
Modified: test/cmpi/module.mk.in
===================================================================
--- test/cmpi/module.mk.in 2010-05-10 19:46:14 UTC (rev 80)
+++ test/cmpi/module.mk.in 2010-05-11 16:10:53 UTC (rev 81)
@@ -15,13 +15,13 @@
ifeq (@USE_COMM_WORLD@,1)
test/cmpi/test%.out: test/cmpi/test%.x test/cmpi/test%.zsh
- $(E)$(CHECK_MPD)
+ $(E) $(MPDCHECK)
$(Q) " TEST $(@) "
- $(E)$(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
+ $(E) $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
test/cmpi/test%.x: test/cmpi/test%.o test/cmpi/test_helpers.o src/cmpi/node.o $(CMPI)
$(Q) " LINK $(@) "
- $(E)$(MPICC) $(MPE) $(<) test/cmpi/test_helpers.o src/cmpi/node.o \
+ $(E) $(MPICC) $(MPE) $(<) test/cmpi/test_helpers.o src/cmpi/node.o \
$(CMPI) $(LIBS) -o $(@)
else
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-10 19:46:14 UTC (rev 80)
+++ test/cmpi-db/module.mk.in 2010-05-11 16:10:53 UTC (rev 81)
@@ -10,7 +10,7 @@
test/cmpi-db/test-%.out: test/cmpi-db/test-%.zsh $(CMPI_DB_TOOLS)
$(Q) " TEST $(@) "
- $(E) mpdlistjobs
+ $(E) $(MPDCHECK)
$(E) $(<) $(@) 4 3
# test/cmpi-db/test-quit.zsh
Modified: test/mpirpc/module.mk.in
===================================================================
--- test/mpirpc/module.mk.in 2010-05-10 19:46:14 UTC (rev 80)
+++ test/mpirpc/module.mk.in 2010-05-11 16:10:53 UTC (rev 81)
@@ -11,7 +11,7 @@
test/mpirpc/test%.out: test/mpirpc/test%.x
$(Q) " TEST $(@) "
- $(E)mpdlistjobs
+ $(E) $(MPDCHECK)
$(E) $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
# cp -uv $(@) test/mpirpc/readable.txt
Added: tools/mpd-available.zsh
===================================================================
--- tools/mpd-available.zsh (rev 0)
+++ tools/mpd-available.zsh 2010-05-11 16:10:53 UTC (rev 81)
@@ -0,0 +1,14 @@
+#!/bin/zsh
+
+# Check that MPD is up
+
+MPD_COMMAND=$1
+
+${MPD_COMMAND} > /dev/null
+if [[ $? != 0 ]]
+then
+ ${MPD_COMMAND}
+ exit 1
+fi
+
+return 0
Property changes on: tools/mpd-available.zsh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-10 19:46:25
|
Revision: 80
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=80&view=rev
Author: jmwozniak
Date: 2010-05-10 19:46:14 +0000 (Mon, 10 May 2010)
Log Message:
-----------
Fixes to tests.
Modified Paths:
--------------
test/cmpi-db/test-quit.zsh
test/mpirpc/module.mk.in
test/mpirpc/test-args.zsh
test/mpirpc/test-blob.c
test/mpirpc/test-blob.zsh
test/mpirpc/test-ping.c
test/mpirpc/test-ping.zsh
test/mpirpc/test-returns.zsh
Modified: test/cmpi-db/test-quit.zsh
===================================================================
--- test/cmpi-db/test-quit.zsh 2010-05-07 21:57:23 UTC (rev 79)
+++ test/cmpi-db/test-quit.zsh 2010-05-10 19:46:14 UTC (rev 80)
@@ -2,7 +2,7 @@
# Be sure to make tests with D=1
-# set -x
+set -x
OUT=$1
PROCS=$2
Modified: test/mpirpc/module.mk.in
===================================================================
--- test/mpirpc/module.mk.in 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/module.mk.in 2010-05-10 19:46:14 UTC (rev 80)
@@ -10,9 +10,10 @@
TEST_OUTPUT += $(patsubst %.c, %.out, $(TEST_MPIRPC_SRC))
test/mpirpc/test%.out: test/mpirpc/test%.x
- mpdlistjobs
- $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
- cp -uv $(@) test/mpirpc/readable.txt
+ $(Q) " TEST $(@) "
+ $(E)mpdlistjobs
+ $(E) $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
+# cp -uv $(@) test/mpirpc/readable.txt
$(DIR)/test%.x: $(DIR)/test%.o $(CMPI)
$(Q) " MPICC $(@) "
Modified: test/mpirpc/test-args.zsh
===================================================================
--- test/mpirpc/test-args.zsh 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/test-args.zsh 2010-05-10 19:46:14 UTC (rev 80)
@@ -1,6 +1,6 @@
#!/bin/zsh
-set -x
+# set -x
# Be sure to make tests with D=1
@@ -30,7 +30,7 @@
for T in ${TOKENS}
do
- grep ${T} ${OUT} || crash "Not found: ${T}"
+ grep ${T} ${OUT} > /dev/null || crash "Not found: ${T}"
done
exit 0
Modified: test/mpirpc/test-blob.c
===================================================================
--- test/mpirpc/test-blob.c 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/test-blob.c 2010-05-10 19:46:14 UTC (rev 80)
@@ -20,7 +20,7 @@
assert(blob[2] == '\t');
assert(blob[3] == '\n');
- NOTE("asserts ok");
+ printf("asserts ok\n");
MPIRPC_Null(caller, unique);
if (args)
@@ -60,7 +60,7 @@
while (! MPIRPC_Check());
}
- NOTE("Normal exit.\n");
+ printf("Normal exit.\n");
MPIRPC_Finalize();
MPI_Finalize();
Modified: test/mpirpc/test-blob.zsh
===================================================================
--- test/mpirpc/test-blob.zsh 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/test-blob.zsh 2010-05-10 19:46:14 UTC (rev 80)
@@ -25,7 +25,7 @@
for T in ${TOKENS}
do
- grep ${T} ${OUT} || crash "Not found: ${T}"
+ grep ${T} ${OUT} > /dev/null || crash "Not found: ${T}"
done
# Should be 2 "Normal exit."s
Modified: test/mpirpc/test-ping.c
===================================================================
--- test/mpirpc/test-ping.c 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/test-ping.c 2010-05-10 19:46:14 UTC (rev 80)
@@ -43,7 +43,8 @@
int
main(int argc, char* argv[])
{
- printf("host: %s\n", file_string("/etc/hostname"));
+ printf("hello\n");
+ // printf("host: %s\n", file_string("/etc/hostname"));
MPI_Init(&argc, &argv);
Modified: test/mpirpc/test-ping.zsh
===================================================================
--- test/mpirpc/test-ping.zsh 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/test-ping.zsh 2010-05-10 19:46:14 UTC (rev 80)
@@ -1,6 +1,6 @@
#!/bin/zsh
-set -x
+# set -x
# Be sure to make tests with D=1
@@ -24,7 +24,7 @@
N=$( grep -c "handle_ping" ${OUT} )
(( N == 5 )) || crash "N != 6"
-grep "handle_quit" ${OUT} || crash "No handle_quit!"
+grep "handle_quit" ${OUT} > /dev/null || crash "No handle_quit!"
# Should be 2 "Normal exit."s
N=$( grep -c "Normal exit." ${OUT} )
Modified: test/mpirpc/test-returns.zsh
===================================================================
--- test/mpirpc/test-returns.zsh 2010-05-07 21:57:23 UTC (rev 79)
+++ test/mpirpc/test-returns.zsh 2010-05-10 19:46:14 UTC (rev 80)
@@ -1,6 +1,6 @@
#!/bin/zsh
-set -x
+# set -x
# Be sure to make tests with D=1
@@ -25,7 +25,7 @@
for T in ${TOKENS}
do
- grep ${T} ${OUT} || crash "Not found: ${T}"
+ grep ${T} ${OUT} > /dev/null || crash "Not found: ${T}"
done
exit 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-07 21:57:29
|
Revision: 79
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=79&view=rev
Author: jmwozniak
Date: 2010-05-07 21:57:23 +0000 (Fri, 07 May 2010)
Log Message:
-----------
Minor fixes
Modified Paths:
--------------
src/adts/ilist.c
src/adts/llist.c
test/cmpi-db/module.mk.in
test/driver/module.mk.in
Added Paths:
-----------
test/cmpi/test-update02.zsh
Modified: src/adts/ilist.c
===================================================================
--- src/adts/ilist.c 2010-05-07 16:10:58 UTC (rev 78)
+++ src/adts/ilist.c 2010-05-07 21:57:23 UTC (rev 79)
@@ -1,33 +1,33 @@
-#include <stdbool.h>
+#include <stdbool.h>
#include <stdio.h>
-#include <string.h>
+#include <string.h>
-#include "ilist.h"
+#include "ilist.h"
struct ilist*
ilist_create()
{
- // NOTE_F;
+ // NOTE_F;
struct ilist* new_ilist = malloc(sizeof(struct ilist));
if (! new_ilist)
- return NULL;
+ return NULL;
new_ilist->head = NULL;
new_ilist->tail = NULL;
new_ilist->size = 0;
- return new_ilist;
+ return new_ilist;
}
-struct ilist_item*
+struct ilist_item*
ilist_add(struct ilist* target, int key, void* data)
{
struct ilist_item* new_item = malloc(sizeof(struct ilist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
- new_item->next = NULL;
+ new_item->next = NULL;
if (target->size == 0)
{
target->head = new_item;
@@ -37,15 +37,15 @@
{
target->tail->next = new_item;
}
- target->tail = new_item;
+ target->tail = new_item;
target->size++;
- return new_item;
+ return new_item;
}
/**
-
+
*/
-struct ilist_item*
+struct ilist_item*
ilist_replace(struct ilist* target, int key, void* data)
{
struct ilist_item* item;
@@ -53,7 +53,7 @@
if (item->key == key)
{
item->data = data;
- return item;
+ return item;
}
return ilist_add(target, key, data);
}
@@ -65,7 +65,7 @@
for (item = target->head; item; item = item->next)
if (item->key == key)
return true;
- return false;
+ return false;
}
bool
@@ -77,22 +77,22 @@
for (item = target->head; item; item = item->next)
if (cmp(item->data, data) == 0)
return true;
- return false;
+ return false;
}
/**
Insert into list so that keys are in order from smallest at head
to largest at tail.
*/
-struct ilist_item*
+struct ilist_item*
ilist_ordered_insert(struct ilist* target, int key, void* data)
{
- // NOTE_F;
-
+ // NOTE_F;
+
struct ilist_item* new_item = malloc(sizeof(struct ilist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
new_item->next = NULL;
@@ -104,44 +104,44 @@
else
{
struct ilist_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (key < target->head->key)
{
new_item->next = target->head;
- target->head = new_item;
+ target->head = new_item;
}
else
{
do
{
- // Are we inserting after this item?
+ // Are we inserting after this item?
if (item->next == NULL)
{
item->next = new_item;
target->tail = new_item;
- break;
+ break;
}
else
{
if (key < item->next->key)
{
- new_item->next = item->next;
+ new_item->next = item->next;
item->next = new_item;
- break;
+ break;
}
}
} while ((item = item->next));
}
}
target->size++;
- return new_item;
+ return new_item;
}
/**
Does nothing if the key/data pair are in the list.
- Ordered smallest to largest.
+ Ordered smallest to largest.
@return NULL iff the key/data pair are in the list.
- Could optimize to only malloc if insertion point is found.
+ Could optimize to only malloc if insertion point is found.
*/
struct ilist_item*
ilist_ordered_insert_unique(struct ilist* target,
@@ -151,7 +151,7 @@
struct ilist_item* new_item = malloc(sizeof(struct ilist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
new_item->next = NULL;
@@ -163,73 +163,73 @@
else
{
struct ilist_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (key < target->head->key)
{
new_item->next = target->head;
- target->head = new_item;
+ target->head = new_item;
}
- // Are we equal to the head?
+ // Are we equal to the head?
else if (key == target->head->key &&
cmp(data, target->head->data) == 0)
{
- free(new_item);
+ free(new_item);
return NULL;
}
else
{
do
{
- // Are we inserting after this item?
+ // Are we inserting after this item?
if (item->next == NULL)
{
item->next = new_item;
target->tail = new_item;
- break;
+ break;
}
else
{
- if (key == item->next->key &&
+ if (key == item->next->key &&
cmp(data, item->next->data) == 0)
{
- free(new_item);
+ free(new_item);
return NULL;
}
if (key < item->next->key)
{
- new_item->next = item->next;
+ new_item->next = item->next;
item->next = new_item;
- break;
+ break;
}
}
} while ((item = item->next));
}
}
target->size++;
- return new_item;
+ return new_item;
}
/**
This is expensive: singly linked list.
*/
-void*
+void*
ilist_pop(struct ilist* target)
{
- // NOTE_F;
-
- void* data;
+ // NOTE_F;
+
+ void* data;
if (target->size == 0)
return NULL;
if (target->size == 1)
{
- data = target->head->data;
- free(target->head);
+ data = target->head->data;
+ free(target->head);
target->head = NULL;
target->tail = NULL;
- target->size = 0;
- return data;
+ target->size = 0;
+ return data;
}
-
+
struct ilist_item* item;
for (item = target->head; item->next->next;
item = item->next);
@@ -237,35 +237,35 @@
free(item->next);
item->next = NULL;
target->tail = item;
- target->size--;
- return data;
+ target->size--;
+ return data;
}
/**
- Remove and return head of list.
+ Remove and return head of list.
*/
void*
ilist_poll(struct ilist* target)
{
- void* data;
+ void* data;
if (target->size == 0)
return NULL;
if (target->size == 1)
{
- data = target->head->data;
- free(target->head);
+ data = target->head->data;
+ free(target->head);
target->head = NULL;
target->tail = NULL;
- target->size = 0;
- return data;
+ target->size = 0;
+ return data;
}
- struct ilist_item* delendum = target->head;
+ struct ilist_item* delendum = target->head;
data = target->head->data;
target->head = target->head->next;
free(delendum);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
/**
@@ -275,20 +275,20 @@
ilist_get(struct ilist* target, int i)
{
struct ilist_item* item;
- int j = 0;
+ int j = 0;
for (item = target->head; item; item = item->next, j++)
- if (i == j)
+ if (i == j)
return (item->data);
return NULL;
}
/**
- @return The data or NULL if not found.
+ @return The data or NULL if not found.
*/
-void*
+void*
ilist_search(struct ilist* target, int key)
{
- struct ilist_item* item;
+ struct ilist_item* item;
for (item = target->head; item; item = item->next)
if (key == item->key)
return (item->data);
@@ -297,38 +297,38 @@
/**
Removes the ilist_item from the list.
- frees the ilist_item.
- @return The data item or NULL if not found.
+ frees the ilist_item.
+ @return The data item or NULL if not found.
*/
void*
ilist_remove(struct ilist* target, int key)
{
struct ilist_item* item;
- void* data;
+ void* data;
if (target->size == 0)
- return false;
+ return false;
if (target->head->key == key)
{
item = target->head;
target->head = item->next;
- data = item->data;
+ data = item->data;
free(item);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
for (item = target->head; item->next; item = item->next)
if (item->next->key == key)
{
struct ilist_item* delendum = item->next;
- data = delendum->data;
+ data = delendum->data;
if (item->next == target->tail)
- target->tail = item;
+ target->tail = item;
item->next = item->next->next;
free(delendum);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
- return NULL;
+ return NULL;
}
/**
@@ -340,11 +340,11 @@
struct ilist_item* item = target->head;
while (item)
{
- struct ilist_item* next = item->next;
+ struct ilist_item* next = item->next;
free(item);
- item = next;
+ item = next;
}
- free(target);
+ free(target);
}
/**
@@ -353,21 +353,21 @@
void
ilist_destroy(struct ilist* target)
{
- // NOTE_F;
+ // NOTE_F;
struct ilist_item* item = target->head;
while (item)
{
struct ilist_item* next = item->next;
free(item->data);
// free(item);
- item = next;
+ item = next;
}
free(target);
- // DONE;
+ // DONE;
}
/**
- @param format Specifies the output format for the data items.
+ @param format Specifies the output format for the data items.
*/
void
ilist_printf(char* format, struct ilist* target)
@@ -382,15 +382,15 @@
printf(format, item->data);
else if (strcmp(format, "%i") == 0)
printf(format, *((int*) (item->data)));
- printf(")");
+ printf(")");
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
/**
- @param format Specifies the output format for the data items.
+ @param format Specifies the output format for the data items.
*/
void
ilist_fprintf(FILE* file, char* format, struct ilist* target)
@@ -405,15 +405,15 @@
fprintf(file, format, item->data);
else if (strcmp(format, "%i") == 0)
fprintf(file, format, *((int*) (item->data)));
- fprintf(file, ")");
+ fprintf(file, ")");
if (item->next)
- fprintf(file, ",");
+ fprintf(file, ",");
}
fprintf(file, "]\n");
}
/**
- @param f Specifies the output format for the data items.
+ @param f Specifies the output format for the data items.
*/
void
ilist_fdump(FILE* file, char* (f)(void*), struct ilist* target)
@@ -425,15 +425,15 @@
{
fprintf(file, "(%i,", item->key);
fprintf(file, "%s", f(item->data));
- fprintf(file, ")");
+ fprintf(file, ")");
if (item->next)
- fprintf(file, ",");
+ fprintf(file, ",");
}
fprintf(file, "]\n");
}
/**
- Just dump the int keys.
+ Just dump the int keys.
*/
void
ilist_dumpkeys(struct ilist* target)
@@ -445,13 +445,13 @@
{
printf("(%i)", item->key);
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
/**
- Just dump the int keys.
+ Just dump the int keys.
*/
void
ilist_fdumpkeys(FILE* file, struct ilist* target)
@@ -463,13 +463,13 @@
{
fprintf(file, "(%i)", item->key);
if (item->next)
- fprintf(file, ",");
+ fprintf(file, ",");
}
fprintf(file, "]\n");
}
/**
- Dump the int keys in hex.
+ Dump the int keys in hex.
*/
void
ilist_xdumpkeys(struct ilist* target)
@@ -481,31 +481,31 @@
{
printf("(%x)", item->key);
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
/**
Just dump the data pointers.
- @return Allocated memory: 10 * target->size.
+ @return Allocated memory: 10 * target->size.
*/
-char*
-ilist_serialize_ptrs(struct ilist* target)
+char*
+ilist_serialize_ptrs(struct ilist* target)
{
- char* result = malloc(30*target->size);
+ char* result = malloc(30*target->size);
struct ilist_item* item;
- char* p = result;
+ char* p = result;
p += sprintf(p, "PTRS: [");
for (item = target->head;
item; item = item->next)
{
p += sprintf(p, "%p", item->data);
if (item->next)
- p += sprintf(p, " ");
+ p += sprintf(p, " ");
}
sprintf(p, "]\n");
- return result;
+ return result;
}
static char*
@@ -513,10 +513,10 @@
{
ptr += sprintf(ptr, "(%i,", item->key);
ptr += sprintf(ptr, "%s)", s);
-
+
if (item->next)
ptr += sprintf(ptr, ",");
- return ptr;
+ return ptr;
}
/**
@@ -531,10 +531,10 @@
item; item = item->next)
{
printf("(%i,", item->key);
- printf(f(item->data));
+ printf("%s", f(item->data));
printf(")");
if (item->next)
- printf(",");
+ printf(",");
}
printf("] \n");
}
@@ -543,73 +543,73 @@
size must be greater than 2.
format specifies the output format for the data items
returns int greater than size if size limits are exceeded
- indicating result is garbage
- */
+ indicating result is garbage
+ */
int ilist_snprintf(char* str, size_t size,
char* format, struct ilist* target)
{
- int error = size+1;
- char* ptr = str;
+ int error = size+1;
+ char* ptr = str;
struct ilist_item* item;
if (size <= 2)
- return error;
-
+ return error;
+
ptr += sprintf(ptr, "[");
char* s = (char*) malloc(sizeof(char)*ILIST_MAX_DATUM);
-
+
for (item = target->head; item && ptr-str < size;
- item = item->next)
+ item = item->next)
{
int r = snprintf(s, ILIST_MAX_DATUM, format, item->data);
if (r > ILIST_MAX_DATUM)
- return size+1;
+ return size+1;
if ((ptr-str) + 10 + r + 4 < size)
- ptr = append_pair(ptr, item, s);
+ ptr = append_pair(ptr, item, s);
else
- return error;
+ return error;
}
ptr += sprintf(ptr, "]");
- free(s);
- return (ptr-str);
+ free(s);
+ return (ptr-str);
}
/** Dump ilist to string a la snprintf()
size must be greater than 2.
format specifies the output format for the data items
returns int greater than size if size limits are exceeded
- indicating result is garbage
- */
+ indicating result is garbage
+ */
int ilist_marshal(char* str, size_t size,
char* (f)(void*), struct ilist* target)
{
- int error = size+1;
- char* ptr = str;
+ int error = size+1;
+ char* ptr = str;
struct ilist_item* item;
if (size <= 2)
- return error;
-
+ return error;
+
ptr += sprintf(ptr, "[");
for (item = target->head; item && ptr-str < size;
- item = item->next)
+ item = item->next)
{
- char* s = f(item->data);
+ char* s = f(item->data);
int r = sprintf(s, "%s", s);
if (r > ILIST_MAX_DATUM)
- return size+1;
+ return size+1;
if ((ptr-str) + 10 + r + 4 < size)
- ptr = append_pair(ptr, item, s);
+ ptr = append_pair(ptr, item, s);
else
- return error;
+ return error;
}
ptr += sprintf(ptr, "]");
- return (ptr-str);
+ return (ptr-str);
}
#ifdef DEBUG_ILIST
Modified: src/adts/llist.c
===================================================================
--- src/adts/llist.c 2010-05-07 16:10:58 UTC (rev 78)
+++ src/adts/llist.c 2010-05-07 21:57:23 UTC (rev 79)
@@ -1,28 +1,28 @@
-#include "llist.h"
+#include "llist.h"
struct llist*
llist_create()
{
struct llist* new_llist = malloc(sizeof(struct llist));
if (! new_llist)
- return NULL;
+ return NULL;
new_llist->head = NULL;
new_llist->tail = NULL;
new_llist->size = 0;
- return new_llist;
+ return new_llist;
}
-struct llist_item*
+struct llist_item*
llist_add(struct llist* target, long key, void* data)
{
struct llist_item* new_item = malloc(sizeof(struct llist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
- new_item->next = NULL;
+ new_item->next = NULL;
if (target->size == 0)
{
target->head = new_item;
@@ -32,22 +32,22 @@
{
target->tail->next = new_item;
}
- target->tail = new_item;
+ target->tail = new_item;
target->size++;
- return new_item;
+ return new_item;
}
/**
Insert into list so that keys are in order from smallest at head
to largest at tail.
*/
-struct llist_item*
+struct llist_item*
llist_ordered_insert(struct llist* target, long key, void* data)
{
struct llist_item* new_item = malloc(sizeof(struct llist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
new_item->next = NULL;
@@ -59,43 +59,43 @@
else
{
struct llist_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (key < target->head->key)
{
new_item->next = target->head;
- target->head = new_item;
+ target->head = new_item;
}
else
{
do
{
- // Are we inserting after this item?
+ // Are we inserting after this item?
if (item->next == NULL)
{
item->next = new_item;
target->tail = new_item;
- break;
+ break;
}
else
{
if (key < item->next->key)
{
- new_item->next = item->next;
+ new_item->next = item->next;
item->next = new_item;
- break;
+ break;
}
}
} while ((item = item->next));
}
}
target->size++;
- return new_item;
+ return new_item;
}
/**
- Does nothing if the key/data pair are in the list.
+ Does nothing if the key/data pair are in the list.
@return NULL iff the key/data pair are in the list.
- Could optimize to only malloc if insertion point is found.
+ Could optimize to only malloc if insertion point is found.
*/
struct llist_item*
llist_ordered_insertdata(struct llist* target,
@@ -105,7 +105,7 @@
struct llist_item* new_item = malloc(sizeof(struct llist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
new_item->next = NULL;
@@ -117,71 +117,71 @@
else
{
struct llist_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (key < target->head->key)
{
new_item->next = target->head;
- target->head = new_item;
+ target->head = new_item;
}
- // Are we equal to the head?
+ // Are we equal to the head?
else if (key == target->head->key &&
cmp(data, target->head->data))
{
- free(new_item);
+ free(new_item);
return NULL;
}
else
{
do
{
- // Are we inserting after this item?
+ // Are we inserting after this item?
if (item->next == NULL)
{
item->next = new_item;
target->tail = new_item;
- break;
+ break;
}
else
{
- if (key == item->next->key &&
+ if (key == item->next->key &&
cmp(data, item->next->data))
{
- free(new_item);
+ free(new_item);
return NULL;
}
if (key < item->next->key)
{
- new_item->next = item->next;
+ new_item->next = item->next;
item->next = new_item;
- break;
+ break;
}
}
} while ((item = item->next));
}
}
target->size++;
- return new_item;
+ return new_item;
}
/**
This is expensive: singly linked list.
*/
-void*
+void*
llist_pop(struct llist* target)
{
- void* data;
+ void* data;
if (target->size == 0)
return NULL;
if (target->size == 1)
{
- data = target->head->data;
- free(target->head);
+ data = target->head->data;
+ free(target->head);
target->head = NULL;
target->tail = NULL;
- target->size = 0;
- return data;
+ target->size = 0;
+ return data;
}
-
+
struct llist_item* item;
for (item = target->head; item->next->next;
item = item->next);
@@ -189,35 +189,35 @@
free(item->next);
item->next = NULL;
target->tail = item;
- target->size--;
- return data;
+ target->size--;
+ return data;
}
/**
- Remove and return head of list.
+ Remove and return head of list.
*/
void*
llist_poll(struct llist* target)
{
- void* data;
+ void* data;
if (target->size == 0)
return NULL;
if (target->size == 1)
{
- data = target->head->data;
- free(target->head);
+ data = target->head->data;
+ free(target->head);
target->head = NULL;
target->tail = NULL;
- target->size = 0;
- return data;
+ target->size = 0;
+ return data;
}
- struct llist_item* delendum = target->head;
+ struct llist_item* delendum = target->head;
data = target->head->data;
target->head = target->head->next;
free(delendum);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
/**
@@ -227,17 +227,17 @@
llist_get(struct llist* target, int i)
{
struct llist_item* item;
- int j = 0;
+ int j = 0;
for (item = target->head; item; item = item->next, j++)
- if (i == j)
+ if (i == j)
return (item->data);
return NULL;
}
-void*
+void*
llist_search(struct llist* target, long key)
{
- struct llist_item* item;
+ struct llist_item* item;
for (item = target->head; item; item = item->next)
if (key == item->key)
return (item->data);
@@ -247,37 +247,37 @@
/**
Removes the llist_item from the list.
frees the llist_item and the data pointer.
- @return The removed item or NULL if not found.
+ @return The removed item or NULL if not found.
*/
-void*
+void*
llist_remove(struct llist* target, long key)
{
struct llist_item* item;
- void* data;
+ void* data;
if (target->size == 0)
- return false;
+ return false;
if (target->head->key == key)
{
item = target->head;
target->head = item->next;
- data = item->data;
+ data = item->data;
free(item);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
for (item = target->head; item->next; item = item->next)
if (item->next->key == key)
{
struct llist_item* delendum = item->next;
- data = delendum->data;
+ data = delendum->data;
if (item->next == target->tail)
- target->tail = item;
+ target->tail = item;
item->next = item->next->next;
free(delendum);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
- return NULL;
+ return NULL;
}
/**
@@ -289,11 +289,11 @@
struct llist_item* item = target->head;
while (item)
{
- struct llist_item* next = item->next;
+ struct llist_item* next = item->next;
free(item);
- item = next;
+ item = next;
}
- free(target);
+ free(target);
}
/**
@@ -306,11 +306,11 @@
while (item)
{
struct llist_item* next = item->next;
- free(item->data);
+ free(item->data);
free(item);
- item = next;
+ item = next;
}
- free(target);
+ free(target);
}
/** format specifies the output format for the data items
@@ -328,14 +328,14 @@
printf(format, item->data);
else if (strcmp(format, "%li") == 0)
printf(format, *((long*) (item->data)));
- printf(")");
+ printf(")");
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
-/** Just dump the long keys.
+/** Just dump the long keys.
*/
void
llist_dumpkeys(struct llist* target)
@@ -347,12 +347,12 @@
{
printf("(%li)", item->key);
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
-/** Dump the long keys in hex.
+/** Dump the long keys in hex.
*/
void
llist_xdumpkeys(struct llist* target)
@@ -364,7 +364,7 @@
{
printf("(%lx)", item->key);
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
@@ -375,10 +375,10 @@
{
ptr += sprintf(ptr, "(%li,", item->key);
ptr += sprintf(ptr, "%s)", s);
-
+
if (item->next)
ptr += sprintf(ptr, ",");
- return ptr;
+ return ptr;
}
/**
@@ -392,10 +392,10 @@
item; item = item->next)
{
printf("(%li,", item->key);
- printf(f(item->data));
+ printf("%s", f(item->data));
printf(")");
if (item->next)
- printf(",");
+ printf(",");
}
printf("] \n");
}
@@ -404,38 +404,38 @@
size must be greater than 2.
format specifies the output format for the data items
returns int greater than size if size limits are exceeded
- indicating result is garbage
- */
+ indicating result is garbage
+ */
int llist_tostring(char* str, size_t size,
char* format, struct llist* target)
{
- int error = size+1;
- char* ptr = str;
+ int error = size+1;
+ char* ptr = str;
struct llist_item* item;
if (size <= 2)
- return error;
-
+ return error;
+
ptr += sprintf(ptr, "[");
char* s = (char*) malloc(sizeof(char)*LLIST_MAX_DATUM);
-
+
for (item = target->head; item && ptr-str < size;
- item = item->next)
+ item = item->next)
{
int r = snprintf(s, LLIST_MAX_DATUM, format, item->data);
if (r > LLIST_MAX_DATUM)
- return size+1;
+ return size+1;
if ((ptr-str) + 10 + r + 4 < size)
- ptr = append_pair(ptr, item, s);
+ ptr = append_pair(ptr, item, s);
else
- return error;
+ return error;
}
ptr += sprintf(ptr, "]");
- free(s);
- return (ptr-str);
+ free(s);
+ return (ptr-str);
}
#ifdef DEBUG_LLIST
@@ -443,13 +443,13 @@
int
main()
{
- int i;
+ int i;
char s[200];
char* d1 = malloc(50*sizeof(char));
- strcpy(d1, "okey-dokey");
+ strcpy(d1, "okey-dokey");
char* d2 = malloc(50*sizeof(char));
strcpy(d2, "okey-dokey30");
-
+
struct llist* list = llist_create();
llist_ordered_insert(list, 30, d2);
@@ -457,20 +457,20 @@
llist_remove(list, 30);
i = llist_tostring(s, 200, "%s", list);
printf("1: %s \n", s);
-
+
llist_ordered_insert(list, 31, "okey-dokey31");
- //
- llist_ordered_insert(list, 32, "okey-dokey32");
-
+ //
+ llist_ordered_insert(list, 32, "okey-dokey32");
+
i = llist_tostring(s, 200, "%s", list);
printf("2: %s \n", s);
-
+
llist_remove(list, 12);
llist_ordered_insert(list, 33, "okey-dokey33");
- // llist_remove(list, 30);
+ // llist_remove(list, 30);
llist_ordered_insert(list, 20, "okey-dokey20");
-
+
i = llist_tostring(s, 200, "%s", list);
printf("%s \n", s);
}
Added: test/cmpi/test-update02.zsh
===================================================================
--- test/cmpi/test-update02.zsh (rev 0)
+++ test/cmpi/test-update02.zsh 2010-05-07 21:57:23 UTC (rev 79)
@@ -0,0 +1,37 @@
+#!/bin/zsh
+
+# Be sure to make tests with D=1
+
+# set -x
+
+source tools/test-helpers.zsh
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+shift
+LAUNCH=${*}
+
+if (( USE_COMM_WORLD == 1 ))
+then
+
+ # Monolithic execution (5 nodes, 1 client):
+
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ CODE=$?
+ [[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+else
+
+ # KDA-2B execution:
+
+ tools/startup_nodes.zsh $(( N-1 )) 100 &
+ mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ sleep $(( N+15 ))
+
+fi
+
+# Should be 6 "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == 6 )) || crash "N != 6"
+
+exit 0
Property changes on: test/cmpi/test-update02.zsh
___________________________________________________________________
Added: svn:executable
+ *
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-07 16:10:58 UTC (rev 78)
+++ test/cmpi-db/module.mk.in 2010-05-07 21:57:23 UTC (rev 79)
@@ -1,7 +1,7 @@
-TEST_CMPI_DB_SRC += $(shell find test/driver -name "*.c" ! -name test_helpers.c)
+TEST_CMPI_DB_SRC += # $(shell find test/cmpi-db -name "*.c" ! -name test_helpers.c)
TEST_SRC += $(TEST_CMPI_DB_SRC)
-TEST_HELPER_SRC += test/driver/test_helpers.c
+TEST_HELPER_SRC += test/driver/test_helpers.c
CMPI_DB = bin/cmpi-db
CMPI_CP = bin/cmpi-cp
@@ -14,10 +14,10 @@
$(E) $(<) $(@) 4 3
# test/cmpi-db/test-quit.zsh
-test/cmpi-db/test%.out: test/driver/test%.x $(DRIVER)
- $(Q) " TEST $(@) "
- $(E)touch $(@)
+#test/cmpi-db/test%.out: test/cmpi-db/test%.x $(DRIVER)
+# $(Q) " TEST $(@) "
+# $(E)touch $(@)
-$(DRIVER): $(DRIVER_IMPL) test/driver/test_helpers.o src/cmpi/node.o $(CMPI)
- $(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o src/cmpi/node.o \
- $(CMPI) $(LIBS) -o $(@)
+# $(DRIVER): $(DRIVER_IMPL) test/driver/test_helpers.o src/cmpi/node.o $(CMPI)
+# $(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o src/cmpi/node.o \
+# $(CMPI) $(LIBS) -o $(@)
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-07 16:10:58 UTC (rev 78)
+++ test/driver/module.mk.in 2010-05-07 21:57:23 UTC (rev 79)
@@ -1,5 +1,5 @@
-TEST_DRIVER_SRC += $(shell find test/driver -name "*.c" ! -name test_helpers.c)
+TEST_DRIVER_SRC += # $(shell find test/driver -name "*.c" ! -name test_helpers.c)
TEST_SRC += $(TEST_DRIVER_SRC)
TEST_HELPER_SRC += test/driver/test_helpers.c
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-07 16:11:06
|
Revision: 78
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=78&view=rev
Author: jmwozniak
Date: 2010-05-07 16:10:58 +0000 (Fri, 07 May 2010)
Log Message:
-----------
Requires bash.
Modified Paths:
--------------
setup.sh
Modified: setup.sh
===================================================================
--- setup.sh 2010-05-07 14:48:05 UTC (rev 77)
+++ setup.sh 2010-05-07 16:10:58 UTC (rev 78)
@@ -1,11 +1,10 @@
-#!/bin/sh
+#!/bin/bash
rm -fv config.cache
mkdir -p maint/config
-if [[ ! -f configure ||
- configure.ac -nt configure ]]
+if [[ ! -f configure || configure.ac -nt configure ]]
then
echo "regenerating..."
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-07 14:48:11
|
Revision: 77
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=77&view=rev
Author: jmwozniak
Date: 2010-05-07 14:48:05 +0000 (Fri, 07 May 2010)
Log Message:
-----------
New test and header.
Added Paths:
-----------
include/cmpi-types.h
test/cmpi-db/test-cp1.zsh
Added: include/cmpi-types.h
===================================================================
--- include/cmpi-types.h (rev 0)
+++ include/cmpi-types.h 2010-05-07 14:48:05 UTC (rev 77)
@@ -0,0 +1,39 @@
+
+#define CMPI_KEY_LENGTH 64
+#define CMPI_VALUE_LENGTH (64*1024)
+
+/**
+ CMPI method return error codes.
+*/
+typedef enum
+{
+ /**
+ Successful return code.
+ */
+ CMPI_SUCCESS,
+
+ /**
+ Record does not exist.
+ */
+ CMPI_DOESNT_EXIST,
+
+ /**
+ Query target is in a fault state.
+ */
+ CMPI_ERROR_FAULT,
+
+ /**
+ Unknown error.
+ */
+ CMPI_ERROR_UNKNOWN,
+
+ /**
+ Could not find port to attach.
+ */
+ CMPI_ERROR_SERVICENAME,
+
+ /**
+ Insufficient neighbors or poorly connected network.
+ */
+ CMPI_ERROR_NEIGHBORS
+} CMPI_RETURN;
Added: test/cmpi-db/test-cp1.zsh
===================================================================
--- test/cmpi-db/test-cp1.zsh (rev 0)
+++ test/cmpi-db/test-cp1.zsh 2010-05-07 14:48:05 UTC (rev 77)
@@ -0,0 +1,52 @@
+#!/bin/zsh
+
+# Be sure to make tests with D=1
+
+# set -x
+
+OUT=$1
+PROCS=$2
+NODES=$3
+
+source tools/test-helpers.zsh
+
+mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUT} &
+MPI_PROCESS=$!
+
+sleep ${PROCS}
+
+echo "DATA" > test-cp1.input.data
+echo "cmpi-cp insert" >& cmpi-cp.out
+bin/cmpi-cp test-cp1.input.data dht://test-cp1 >>& cmpi-cp.out
+if [[ $? != 0 ]]
+then
+ cat cmpi-cp.out
+ rm -v cmpi-cp.out
+ crash "cmpi-cp error!"
+fi
+
+echo inserted
+
+echo "\n\ncmpi-cp retrieve" >>& cmpi-cp.out
+bin/cmpi-cp dht://test-cp1 test-cp1.output.data >>& cmpi-cp.out
+if [[ $? != 0 ]]
+then
+ cat cmpi-cp.out
+ rm -v cmpi-cp.out
+ crash "cmpi-cp error!"
+fi
+
+echo retrieved
+
+bin/cmpi-db-fifo-quit >& /dev/null &
+QUIT_PROCESS=$!
+
+sleep ${PROCS}
+
+# Should be ${PROCS} "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == PROCS )) || crash "N != ${PROCS}"
+
+# rm cmpi-cp.out test-cp1.*.data
+
+exit 0
Property changes on: test/cmpi-db/test-cp1.zsh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-07 14:47:27
|
Revision: 76
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=76&view=rev
Author: jmwozniak
Date: 2010-05-07 14:47:21 +0000 (Fri, 07 May 2010)
Log Message:
-----------
Minor changes.
Modified Paths:
--------------
include/accessor.h
include/cmpi-cp.h
include/cmpi.h
include/io_tools.h
include/node.h
src/cmpi/driver.c
src/cmpi-cp/cmpi-cp.c
test/cmpi-db/module.mk.in
Modified: include/accessor.h
===================================================================
--- include/accessor.h 2010-05-06 19:56:18 UTC (rev 75)
+++ include/accessor.h 2010-05-07 14:47:21 UTC (rev 76)
@@ -1,9 +1,9 @@
-#include <stdbool.h>
+#include <stdbool.h>
#include <stdio.h>
-#include <stdlib.h>
+#include <stdlib.h>
FILE* to_cmpi;
-FILE* from_cmpi;
-
+FILE* from_cmpi;
+
bool driver_access_fifo(void);
Modified: include/cmpi-cp.h
===================================================================
--- include/cmpi-cp.h 2010-05-06 19:56:18 UTC (rev 75)
+++ include/cmpi-cp.h 2010-05-07 14:47:21 UTC (rev 76)
@@ -1,7 +1,11 @@
-#include <node.h>
+// #include <node.h>
#include <accessor.h>
+#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
+
#include <io_tools.h>
// #define CMPI_CP_CHUNK CMPI_VALUE_LENGTH
Modified: include/cmpi.h
===================================================================
--- include/cmpi.h 2010-05-06 19:56:18 UTC (rev 75)
+++ include/cmpi.h 2010-05-07 14:47:21 UTC (rev 76)
@@ -26,6 +26,8 @@
#include "dmalloc.h"
#endif
+#include <cmpi-types.h>
+
typedef unsigned int CMPI_ID;
//// Storage settings...
@@ -36,9 +38,6 @@
*/
extern int cmpi_cache_limit;
-#define CMPI_KEY_LENGTH 64
-#define CMPI_VALUE_LENGTH (64*1024)
-
#define CMPI_BLOB_LENGTH LIST_MAX_DATUM
extern struct lru_table* cmpi_cache;
@@ -93,42 +92,6 @@
};
/**
- CMPI method return error codes.
-*/
-typedef enum
-{
- /**
- Successful return code.
- */
- CMPI_SUCCESS,
-
- /**
- Record does not exist.
- */
- CMPI_DOESNT_EXIST,
-
- /**
- Query target is in a fault state.
- */
- CMPI_ERROR_FAULT,
-
- /**
- Unknown error.
- */
- CMPI_ERROR_UNKNOWN,
-
- /**
- Could not find port to attach.
- */
- CMPI_ERROR_SERVICENAME,
-
- /**
- Insufficient neighbors or poorly connected network.
- */
- CMPI_ERROR_NEIGHBORS
-} CMPI_RETURN;
-
-/**
CMPI control message types.
Must be in-memory integers to allow referencing by MPI calls.
*/
Modified: include/io_tools.h
===================================================================
--- include/io_tools.h 2010-05-06 19:56:18 UTC (rev 75)
+++ include/io_tools.h 2010-05-07 14:47:21 UTC (rev 76)
@@ -1,6 +1,6 @@
-#include <stdio.h>
+#include <stdio.h>
void stream_to_buffer(char* buffer, int length, FILE* stream);
void buffer_to_stream(char* buffer, int length, FILE* stream);
-void eat_whitespace(FILE* stream);
+void eat_whitespace(FILE* stream);
Modified: include/node.h
===================================================================
--- include/node.h 2010-05-06 19:56:18 UTC (rev 75)
+++ include/node.h 2010-05-07 14:47:21 UTC (rev 76)
@@ -1,8 +1,8 @@
-#include <getopt.h>
+#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
-#include <cmpi.h>
+#include <cmpi.h>
extern MPI_Comm cmpi_comm_clients;
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-06 19:56:18 UTC (rev 75)
+++ src/cmpi/driver.c 2010-05-07 14:47:21 UTC (rev 76)
@@ -104,10 +104,10 @@
cmpi_put(key, value, length);
int error = fprintf(driver->sink, "ok\n");
- NOTE("said ok\n");
if (error == -1)
printf("driver_put result error!\n");
fflush(driver->sink);
+ NOTE("said ok\n");
}
void
@@ -201,6 +201,7 @@
else if (strncmp(optoken, "get", 3) == 0)
{
driver_get(driver, tokens);
+ NOTE("driver_get returned\n");
}
else if (strncmp(optoken, "lookup", 6) == 0)
{
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-05-06 19:56:18 UTC (rev 75)
+++ src/cmpi-cp/cmpi-cp.c 2010-05-07 14:47:21 UTC (rev 76)
@@ -1,6 +1,10 @@
#include <cmpi-cp.h>
+#include <string.h>
+
+#include <cmpi-types.h>
+
char* target1;
char* target2;
@@ -12,7 +16,7 @@
if (argc == 1)
{
printhelp();
- exit(EXIT_FAILURE);
+ exit(1);
}
target1 = argv[1];
target2 = argv[2];
@@ -56,7 +60,7 @@
return result;
}
-CMPI_RETURN
+int
cmpi_cp_put(FILE* file, char* object)
{
char key[CMPI_KEY_LENGTH+10];
@@ -103,7 +107,7 @@
return CMPI_SUCCESS;
}
-CMPI_RETURN
+int
cmpi_cp_get(char* object, FILE* file)
{
char data[value_size];
@@ -113,6 +117,8 @@
fprintf(to_cmpi, "get %s\n", object);
fflush(to_cmpi);
+ printf("issued get\n");
+
fscanf(from_cmpi, "%i", &length);
fgetc(from_cmpi);
if (length == -1)
@@ -127,6 +133,7 @@
fprintf(to_cmpi, "get %s[%i]\n", object, c);
fflush(to_cmpi);
fscanf(from_cmpi, "%i", &length);
+ printf("incoming length: %i\n", length);
fgetc(from_cmpi);
if (length == -1)
{
@@ -144,17 +151,17 @@
bad_file(char* filename)
{
printf("Could not open: %s\n", filename);
- exit(EXIT_FAILURE);
+ exit(1);
}
/**
Case logic for different uses
*/
-CMPI_RETURN
+int
cmpi_cp_case(CMPI_CP_TYPE type1, char* object1,
CMPI_CP_TYPE type2, char* object2)
{
- CMPI_RETURN result = CMPI_SUCCESS;
+ int result = CMPI_SUCCESS;
if (type1 == CMPI_CP_FILE &&
type2 == CMPI_CP_KEY)
{
@@ -214,24 +221,24 @@
target2_type == CMPI_CP_FILE)
{
printf("cmpi-cp: given two files!\n");
- exit(EXIT_FAILURE);
+ exit(1);
}
driver_access_fifo();
- CMPI_RETURN result =
+ int result =
cmpi_cp_case(target1_type, object1, target2_type, object2);
if (result == CMPI_DOESNT_EXIST)
{
// cmpi_get could not find the dht:// target
printf("does not exist: %s\n", target1);
- return EXIT_FAILURE;
+ exit(1);
}
else if (result != CMPI_SUCCESS)
{
printf("error\n");
- return EXIT_FAILURE;
+ exit(1);
}
- return EXIT_SUCCESS;
+ return 0;
}
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-06 19:56:18 UTC (rev 75)
+++ test/cmpi-db/module.mk.in 2010-05-07 14:47:21 UTC (rev 76)
@@ -4,12 +4,14 @@
TEST_HELPER_SRC += test/driver/test_helpers.c
CMPI_DB = bin/cmpi-db
+CMPI_CP = bin/cmpi-cp
CMPI_DB_QUIT = bin/cmpi-db-fifo-quit
-CMPI_DB_TOOLS = $(CMPI_DB) $(CMPI_DB_QUIT)
+CMPI_DB_TOOLS = $(CMPI_DB) $(CMPI_CP) $(CMPI_DB_QUIT)
test/cmpi-db/test-%.out: test/cmpi-db/test-%.zsh $(CMPI_DB_TOOLS)
$(Q) " TEST $(@) "
- $(E)$(<) $(@) 4 3
+ $(E) mpdlistjobs
+ $(E) $(<) $(@) 4 3
# test/cmpi-db/test-quit.zsh
test/cmpi-db/test%.out: test/driver/test%.x $(DRIVER)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-05 15:59:36
|
Revision: 68
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=68&view=rev
Author: jmwozniak
Date: 2010-05-05 15:59:26 +0000 (Wed, 05 May 2010)
Log Message:
-----------
Docs fixes.
Modified Paths:
--------------
docs/manual/manual.xml
docs/manual/sf-post.zsh
Modified: docs/manual/manual.xml
===================================================================
--- docs/manual/manual.xml 2010-05-05 15:56:25 UTC (rev 67)
+++ docs/manual/manual.xml 2010-05-05 15:59:26 UTC (rev 68)
@@ -11,12 +11,12 @@
<section id="overview">
<title>Overview</title>
<para>
- This manual provides reference material for the Content-MPI
- (C-MPI) DHT.
+ This manual provides reference material for the Content-MPI
+ (C-MPI) DHT.
</para>
<para>
- C-MPI provides a key/value store for distributed computing
- over MPI.
+ C-MPI provides a key/value store for distributed computing
+ over MPI.
</para>
</section>
Modified: docs/manual/sf-post.zsh
===================================================================
--- docs/manual/sf-post.zsh 2010-05-05 15:56:25 UTC (rev 67)
+++ docs/manual/sf-post.zsh 2010-05-05 15:59:26 UTC (rev 68)
@@ -3,6 +3,10 @@
# Post HTML to SourceForge
USER=$1
+[[ ${USER} == "" ]] && print "No USER!" && exit 1
+DIR=$( dirname $0 )
+cd ${DIR}
+
HTML=( index.html manual.html )
scp ${HTML} ${USER},c-...@we...:htdocs
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-05 15:56:31
|
Revision: 67
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=67&view=rev
Author: jmwozniak
Date: 2010-05-05 15:56:25 +0000 (Wed, 05 May 2010)
Log Message:
-----------
Test fixes.
Modified Paths:
--------------
Makefile.in
configure.ac
test/adts/module.mk.in
test/driver/module.mk.in
test/gossip/module.mk.in
test/gossip/test-do.zsh
test/gossip/test-env.zsh
test/gossip/test-masks.zsh
test/mpi_tools/module.mk.in
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-04 18:46:20 UTC (rev 66)
+++ Makefile.in 2010-05-05 15:56:25 UTC (rev 67)
@@ -6,6 +6,7 @@
# cleaner cleans up configure-created files
# distclean _really_ cleans up; returns to pristine tree
# tags generates etags file for use by editors
+# test_results run all tests
# INPUT CONTROL VARIABLES
# D : if 1, turn on debugging output in CMPI programs
@@ -428,9 +429,9 @@
tests: $(CMPI) $(TEST_PROGS)
# Obsolete target: delete soon.
-cmpi-io-test: $(CMPI_IO) src/cmpi/cmpi-io-test.o
- $(Q) " MPICC cmpi-io-test"
- $(E)$(MPICC) src/cmpi/cmpi-io-test.o $(CMPI) $(LIBS) -o cmpi-io-test
+#cmpi-io-test: $(CMPI_IO) src/cmpi/cmpi-io-test.o
+# $(Q) " MPICC cmpi-io-test"
+# $(E)$(MPICC) src/cmpi/cmpi-io-test.o $(CMPI) $(LIBS) -o cmpi-io-test
# override default rule for building objects
%.o : %.c
@@ -503,8 +504,8 @@
aclocal.m4 \
config.h.in \
autoscan.log \
- configure.scan \
- cmpi-config.h*
+ configure.scan \
+ Makefile
$(E)find . -name "*.i" -exec rm -fv \{\} \;
$(E)find . -name "*.d" -exec rm -fv \{\} \;
$(E)find . -name "module.mk" -exec rm -fv \{\} \;
@@ -514,9 +515,7 @@
# except, don't remove generated .c files if this is a distributed release
distclean: cleaner docsclean
$(Q) " DISTCLEAN"
- $(E)rm -fv Makefile config.h \
- src/server/simple.conf \
- src/apps/admin/pvfs2-config
+ $(E)rm -fv configure config.h cmpi-config.h*
$(E)find . -name "*.dat" -exec rm -fv \{\} \;
# this is where we include all of our automatic dependencies.
Modified: configure.ac
===================================================================
--- configure.ac 2010-05-04 18:46:20 UTC (rev 66)
+++ configure.ac 2010-05-05 15:56:25 UTC (rev 67)
@@ -380,28 +380,33 @@
dnl output final version of top level makefile and subdirectory
dnl makefile includes
-AC_CONFIG_FILES(Makefile
-src/gossip/module.mk
-src/adts/module.mk
-src/cmpi/module.mk
-src/cmpi-cp/module.mk
-src/cmpi-db/module.mk
-src/mpi_tools/module.mk
-src/mpirpc/module.mk
-src/dense-1/module.mk
-src/kda-2/module.mk
-)
+AC_CONFIG_FILES(
+ Makefile
+ src/gossip/module.mk
+ src/adts/module.mk
+ src/cmpi/module.mk
+ src/cmpi-cp/module.mk
+ src/cmpi-db/module.mk
+ src/mpi_tools/module.mk
+ src/mpirpc/module.mk
+ src/dense-1/module.mk
+ src/kda-2/module.mk
+ )
if test "x$ENABLE_TESTS" = "xyes" ; then
AC_CONFIG_FILES(
- test/adts/module.mk
- test/cmpi/module.mk
- test/cmpi-io/module.mk
- test/driver/module.mk
- test/gossip/module.mk
- test/mpirpc/module.mk
- test/mpi_tools/module.mk
- )
+ test/adts/module.mk
+ test/cmpi/module.mk
+ test/driver/module.mk
+ test/gossip/module.mk
+ test/mpirpc/module.mk
+ test/mpi_tools/module.mk
+ )
+ if test "x$USE_CMPI_IO" = "x1" ; then
+ AC_CONFIG_FILES(
+ test/cmpi-io/module.mk
+ )
+ fi
fi
AC_OUTPUT
Modified: test/adts/module.mk.in
===================================================================
--- test/adts/module.mk.in 2010-05-04 18:46:20 UTC (rev 66)
+++ test/adts/module.mk.in 2010-05-05 15:56:25 UTC (rev 67)
@@ -4,3 +4,7 @@
test/adts/test%.x: test/adts/test%.o src/mpi_tools/mpi_tools.o $(CMPI)
$(Q) " LINK $(@) "
$(E)$(MPICC) $(MPE) $(<) src/mpi_tools/mpi_tools.o $(ADT_OBJS) $(LIBS) -o $(@)
+
+test/adts/test%.out: test/adts/test%.x
+ $(Q) " TEST $(@) "
+ $(E)$(<) > $(@) 2>&1
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-04 18:46:20 UTC (rev 66)
+++ test/driver/module.mk.in 2010-05-05 15:56:25 UTC (rev 67)
@@ -11,6 +11,10 @@
$(Q) " MPICC $(@) "
$(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o $(CMPI) $(LIBS) -o $(@)
+test/driver/test%.out: test/driver/test%.x $(DRIVER)
+ $(Q) " TEST $(@) "
+ $(E)touch $(@)
+
$(DRIVER): $(DRIVER_IMPL) test/driver/test_helpers.o src/cmpi/node.o $(CMPI)
$(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o src/cmpi/node.o \
$(CMPI) $(LIBS) -o $(@)
Modified: test/gossip/module.mk.in
===================================================================
--- test/gossip/module.mk.in 2010-05-04 18:46:20 UTC (rev 66)
+++ test/gossip/module.mk.in 2010-05-05 15:56:25 UTC (rev 67)
@@ -8,4 +8,5 @@
$(E)$(MPICC) $(<) $(CMPI) $(LIBS) -o $(@)
$(DIR)/test%.out: $(DIR)/test%.x
- $(patsubst %.x, %.zsh, $(<)) $(<)
+ $(Q) " TEST $(@) "
+ $(E)$(patsubst %.x, %.zsh, $(<)) $(<)
Modified: test/gossip/test-do.zsh
===================================================================
--- test/gossip/test-do.zsh 2010-05-04 18:46:20 UTC (rev 66)
+++ test/gossip/test-do.zsh 2010-05-05 15:56:25 UTC (rev 67)
@@ -1,6 +1,6 @@
#!/bin/zsh
-set -x
+# set -x
# Be sure to make tests with D=1
Modified: test/gossip/test-env.zsh
===================================================================
--- test/gossip/test-env.zsh 2010-05-04 18:46:20 UTC (rev 66)
+++ test/gossip/test-env.zsh 2010-05-05 15:56:25 UTC (rev 67)
@@ -1,6 +1,6 @@
#!/bin/zsh
-set -x
+# set -x
# Be sure to make tests with D=1
@@ -31,7 +31,7 @@
(( N == 3 )) || crash "N != 3"
# Should be 2 "Example debugging message."s
-N=$( grep -c "Example debugging message." ${OUT} )
+N=$( grep -c "EXAMPLE MESSAGE" ${OUT} )
(( N == 2 )) || crash "N != 2"
exit 0
Modified: test/gossip/test-masks.zsh
===================================================================
--- test/gossip/test-masks.zsh 2010-05-04 18:46:20 UTC (rev 66)
+++ test/gossip/test-masks.zsh 2010-05-05 15:56:25 UTC (rev 67)
@@ -1,6 +1,6 @@
#!/bin/zsh
-set -x
+# set -x
# Be sure to make tests with D=1
Modified: test/mpi_tools/module.mk.in
===================================================================
--- test/mpi_tools/module.mk.in 2010-05-04 18:46:20 UTC (rev 66)
+++ test/mpi_tools/module.mk.in 2010-05-05 15:56:25 UTC (rev 67)
@@ -3,10 +3,9 @@
TEST_SRC += $(TEST_MPITOOLS_SRC)
test/mpi_tools/test%.out: test/mpi_tools/test%.x
- $(LAUNCH) -n $(NODES) $(<) > $(@) 2>&1
+ $(Q) " TEST $(@) "
+ $(E)$(LAUNCH) -n 3 $(<) > $(@) 2>&1
test/mpi_tools/test%.x: test/mpi_tools/test%.o $(CMPI)
$(Q) " MPICC $(@) "
$(E)$(MPICC) $(MPE) $(<) $(CMPI) $(LIBS) -o $(@)
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-04 18:46:26
|
Revision: 66
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=66&view=rev
Author: jmwozniak
Date: 2010-05-04 18:46:20 +0000 (Tue, 04 May 2010)
Log Message:
-----------
Remove "basic" test; compilation fixes.
Modified Paths:
--------------
Makefile.in
configure.ac
include/itable.h
include/ltable.h
include/mpirpc.h
src/gossip/gossip.c
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-29 21:56:33 UTC (rev 65)
+++ Makefile.in 2010-05-04 18:46:20 UTC (rev 66)
@@ -145,7 +145,7 @@
BUILD_CFLAGS = @BUILD_CFLAGS@
BUILD_LDFLAGS = @BUILD_LDFLAGS@
# make sure the srcdir include gets included first
-CFLAGS = -std=c99 # @CFLAGS@ @CPPFLAGS@ # -I $(srcdir)/include
+CFLAGS = -std=gnu99 # @CFLAGS@ @CPPFLAGS@ # -I $(srcdir)/include
LDFLAGS = -L@BUILD_ABSOLUTE_TOP@/lib
ifneq ($(DISKSIM)/src,)
LDFLAGS += -L$(DISKSIM)/src
Modified: configure.ac
===================================================================
--- configure.ac 2010-04-29 21:56:33 UTC (rev 65)
+++ configure.ac 2010-05-04 18:46:20 UTC (rev 66)
@@ -395,7 +395,6 @@
if test "x$ENABLE_TESTS" = "xyes" ; then
AC_CONFIG_FILES(
test/adts/module.mk
- test/basic/module.mk
test/cmpi/module.mk
test/cmpi-io/module.mk
test/driver/module.mk
Modified: include/itable.h
===================================================================
--- include/itable.h 2010-04-29 21:56:33 UTC (rev 65)
+++ include/itable.h 2010-05-04 18:46:20 UTC (rev 66)
@@ -2,7 +2,7 @@
*
* See COPYING in top-level directory.
*
- * Modified for Grayskull by Justin M Wozniak <wo...@mc...>
+ * Modified for Grayskull by Justin M Wozniak <wo...@mc...>
*/
#ifndef ITABLE_H
@@ -11,18 +11,18 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
-#include <string.h>
+#include <string.h>
-#include "ilist.h"
+#include "ilist.h"
struct itable
{
struct ilist** array;
int capacity;
- int size;
+ int size;
};
-inline int hash_int(int key, int capacity);
+int hash_int(int key, int capacity);
struct itable* itable_create(int capacity);
@@ -30,16 +30,16 @@
void* itable_search(struct itable* target, int key);
-void* itable_remove(struct itable* target, int key);
+void* itable_remove(struct itable* target, int key);
-void itable_free(struct itable* target);
+void itable_free(struct itable* target);
-void itable_destroy(struct itable* target);
+void itable_destroy(struct itable* target);
-void itable_dump(char* format, struct itable* target);
+void itable_dump(char* format, struct itable* target);
int itable_tostring(char* str, size_t size,
- char* format, struct itable* target);
+ char* format, struct itable* target);
#endif
Modified: include/ltable.h
===================================================================
--- include/ltable.h 2010-04-29 21:56:33 UTC (rev 65)
+++ include/ltable.h 2010-05-04 18:46:20 UTC (rev 66)
@@ -9,20 +9,20 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
-#include <string.h>
+#include <string.h>
-#include <mpi_tools.h>
+#include <mpi_tools.h>
-#include "llist.h"
+#include "llist.h"
struct ltable
{
struct llist** array;
int capacity;
- int size;
+ int size;
};
-inline int hash_long(long key, int capacity);
+int hash_long(long key, int capacity);
struct ltable* ltable_create(int capacity);
@@ -30,12 +30,12 @@
void* ltable_search(struct ltable* table, long key);
-void* ltable_remove(struct ltable* table, long key);
+void* ltable_remove(struct ltable* table, long key);
-void ltable_dump(char* format, struct ltable* target);
+void ltable_dump(char* format, struct ltable* target);
int ltable_tostring(char* str, size_t size,
- char* format, struct ltable* target);
+ char* format, struct ltable* target);
#endif
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2010-04-29 21:56:33 UTC (rev 65)
+++ include/mpirpc.h 2010-05-04 18:46:20 UTC (rev 66)
@@ -22,7 +22,7 @@
extern int unique;
-extern unsigned int snooze_max;
+extern useconds_t snooze_max;
#define MPIRPC_MAX_NAME 128
#define MPIRPC_MAX_ARGS 256
Modified: src/gossip/gossip.c
===================================================================
--- src/gossip/gossip.c 2010-04-29 21:56:33 UTC (rev 65)
+++ src/gossip/gossip.c 2010-05-04 18:46:20 UTC (rev 66)
@@ -11,6 +11,8 @@
* Handles debugging output.
*/
+#include <strings.h>
+
#include <gossip.h>
/** controls whether debugging is on or off */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 21:56:39
|
Revision: 65
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=65&view=rev
Author: jmwozniak
Date: 2010-04-29 21:56:33 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Why is this in here?
Removed Paths:
-------------
test/basic/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 21:55:56
|
Revision: 64
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=64&view=rev
Author: jmwozniak
Date: 2010-04-29 21:55:50 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Whitespace fixes.
Modified Paths:
--------------
include/cmpi-cp.h
src/cmpi/accessor.c
src/cmpi/client.c
src/cmpi/driver.c
src/cmpi-cp/cmpi-cp.c
src/cmpi-db/cmpi-db-fifo-quit.c
src/cmpi-db/cmpi-db-fifo.c
src/mpi_tools/io_tools.c
test/driver/test01.c
test/driver/test01.zsh
test/driver/test02.c
Modified: include/cmpi-cp.h
===================================================================
--- include/cmpi-cp.h 2010-04-29 21:42:41 UTC (rev 63)
+++ include/cmpi-cp.h 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,8 +1,8 @@
-#include <node.h>
-#include <accessor.h>
+#include <node.h>
+#include <accessor.h>
-#include <io_tools.h>
+#include <io_tools.h>
// #define CMPI_CP_CHUNK CMPI_VALUE_LENGTH
@@ -13,10 +13,9 @@
CMPI_CP_KEY,
CMPI_CP_FILE,
CMPI_CP_STREAM,
- CMPI_CP_TYPE_ERROR,
-} CMPI_CP_TYPE;
+ CMPI_CP_TYPE_ERROR,
+} CMPI_CP_TYPE;
-void printhelp(void);
+void printhelp(void);
-#define debug(x) x
-
+#define debug(x) x
Modified: src/cmpi/accessor.c
===================================================================
--- src/cmpi/accessor.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/cmpi/accessor.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,26 +1,26 @@
-#include <accessor.h>
+#include <accessor.h>
/**
- @return True iff successfully access to fifos is made.
+ @return True iff successfully access to fifos is made.
*/
-bool
+bool
driver_access_fifo()
{
char fifo_in[20] = "/tmp/cmpi.fifo.in";
char fifo_out[20] = "/tmp/cmpi.fifo.out";
-
+
to_cmpi = fopen(fifo_in, "w");
if (to_cmpi == NULL)
{
printf("Could not open: %s \n", fifo_in);
- return false;
+ return false;
}
from_cmpi = fopen(fifo_out, "r");
if (from_cmpi == NULL)
{
printf("Could not open: %s \n", fifo_out);
- return false;
+ return false;
}
- return true;
+ return true;
}
Modified: src/cmpi/client.c
===================================================================
--- src/cmpi/client.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/cmpi/client.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,17 +1,17 @@
/**
* Participant client for CMPI.
- * Only used in multiple communicator, MPI-2 case.
+ * Only used in multiple communicator, MPI-2 case.
*
- * Command-line arguments:
+ * Command-line arguments:
*
- * -s <ms> snooze_max in milliseconds.
+ * -s <ms> snooze_max in milliseconds.
* -t <tag> symbolic tag number
- */
+ */
#include "node.h"
-int nodes;
+int nodes;
void
options(int argc, char* argv[])
@@ -21,18 +21,18 @@
{"snooze", required_argument, NULL, 's'},
{"tag", required_argument, NULL, 't'},
{"nodes", required_argument, NULL, 'n'},
- {0, 0, 0, 0}
- };
-
+ {0, 0, 0, 0}
+ };
+
int c = 0;
int t = 0;
- while ((c = getopt_long(argc, argv, "f:s:t:n:c:", options, &c)) != -1)
+ while ((c = getopt_long(argc, argv, "f:s:t:n:c:", options, &c)) != -1)
{
switch (c)
{
case 's':
sscanf(optarg, "%i", &t);
- snooze_max = t*1000;
+ snooze_max = t*1000;
// printf("Snooze max: %i \n", snooze_max);
case 't':
sscanf(optarg, "%i", &t);
@@ -41,25 +41,25 @@
sscanf(optarg, "%i", &t);
nodes = t;
}
- c++;
+ c++;
}
}
int
main(int argc, char* argv[])
{
- options(argc, argv);
-
- MPI_Init(&argc, &argv);
+ options(argc, argv);
+ MPI_Init(&argc, &argv);
+
whoami();
if (mpi_rank == 0)
timestamp("START", NULL);
- cmpi_init_client();
- cmpi_client_code();
+ cmpi_init_client();
+ cmpi_client_code();
MPI_Finalize();
- return 0;
+ return 0;
}
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/cmpi/driver.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,38 +1,38 @@
/**
* Command-line client for CMPI.
- */
+ */
#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
+#include <signal.h>
+#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <driver.h>
-char* filename = NULL;
+char* filename = NULL;
-bool driver_quitting = false;
+bool driver_quitting = false;
cmpi_driver*
driver_create(void)
{
cmpi_driver* driver = malloc(sizeof(cmpi_driver));
driver->quitting = false;
- return driver;
+ return driver;
}
-bool
+bool
driver_setup_file(cmpi_driver* driver, char* filename)
{
driver->source = fopen(filename, "r");
if (driver->source == NULL)
{
printf("Could not open: %s \n", filename);
- return false;
+ return false;
}
- return true;
+ return true;
}
bool
@@ -40,40 +40,40 @@
{
driver->source = stdin;
driver->sink = stdout;
- return true;
+ return true;
}
/**
- @return True iff the fifos were set up and opened correctly.
+ @return True iff the fifos were set up and opened correctly.
*/
bool
driver_setup_fifo(cmpi_driver* driver)
-{
+{
char fifo_in[20] = "/tmp/cmpi.fifo.in";
- char fifo_out[20] = "/tmp/cmpi.fifo.out";
+ char fifo_out[20] = "/tmp/cmpi.fifo.out";
- signal(SIGPIPE, SIG_IGN);
-
+ signal(SIGPIPE, SIG_IGN);
+
int error = mkfifo(fifo_in, S_IRUSR|S_IWUSR);
if (error != 0 &&
errno != EEXIST)
{
- printf("Could not create fifo: %s\n", fifo_in);
- return false;
+ printf("Could not create fifo: %s\n", fifo_in);
+ return false;
}
error = mkfifo(fifo_out, S_IRUSR|S_IWUSR);
if (error != 0 &&
errno != EEXIST)
{
- printf("Could not create fifo: %s\n", fifo_in);
- return false;
+ printf("Could not create fifo: %s\n", fifo_in);
+ return false;
}
driver->source = fopen(fifo_in, "r");
if (driver->source == NULL)
{
printf("Could not open: %s \n", fifo_in);
- return false;
+ return false;
}
driver->sink = fopen(fifo_out, "w");
@@ -83,7 +83,7 @@
return false;
}
- return true;
+ return true;
}
void
@@ -94,20 +94,20 @@
int length;
sscanf(tokens->head->next->next->data, "%i", &length);
- SHOW_FSI(key, length);
+ SHOW_FSI(key, length);
fprintf(driver->sink, "ok\n");
- fflush(driver->sink);
+ fflush(driver->sink);
- NOTE("reading to buffer");
+ NOTE("reading to buffer");
stream_to_buffer(value, length, driver->source);
- NOTE("got buffer");
+ NOTE("got buffer");
cmpi_put(key, value, length);
-
+
int error = fprintf(driver->sink, "ok\n");
- NOTE("said ok\n");
+ NOTE("said ok\n");
if (error == -1)
- printf("driver_put result error!\n");
- fflush(driver->sink);
+ printf("driver_put result error!\n");
+ fflush(driver->sink);
}
void
@@ -115,11 +115,11 @@
{
char* key = tokens->head->next->data;
- NOTE_FS(key);
-
+ NOTE_FS(key);
+
char* value;
int length;
- cmpi_get(key, &value, &length);
+ cmpi_get(key, &value, &length);
if (value == NULL)
{
@@ -128,11 +128,11 @@
else
{
fprintf(driver->sink, "%i\n", length);
- fflush(driver->sink);
- buffer_to_stream(value, length, driver->sink);
+ fflush(driver->sink);
+ buffer_to_stream(value, length, driver->sink);
}
fflush(driver->sink);
- DONE;
+ DONE;
}
void
@@ -140,16 +140,16 @@
{
char* p = tokens->head->next->data;
int i;
- sscanf(p, "%i", &i);
+ sscanf(p, "%i", &i);
char* result = cmpi_info(i);
- printf(result);
+ printf(result);
}
void
driver_lookup(struct list* tokens)
{
char* p = tokens->head->next->data;
- cmpi_lookup(p);
+ cmpi_lookup(p);
}
void
@@ -157,11 +157,11 @@
{
char* p = tokens->head->next->data;
int i;
- SHOW_I(i);
- sscanf(p, "%i", &i);
+ SHOW_I(i);
+ sscanf(p, "%i", &i);
sleep(i);
fprintf(driver->sink, "ok\n");
- fflush(driver->sink);
+ fflush(driver->sink);
}
void
@@ -170,54 +170,54 @@
driver->quitting = true;
fprintf(driver->sink, "ok\n");
- fflush(driver->sink);
+ fflush(driver->sink);
cmpi_shutdown();
- DONE;
+ DONE;
}
void
-driver_execute(cmpi_driver* driver)
+driver_execute(cmpi_driver* driver)
{
- SHOW_FS(driver->command);
-
- struct list* tokens = list_parse(driver->command);
-
+ SHOW_FS(driver->command);
+
+ struct list* tokens = list_parse(driver->command);
+
gossip_ldebug(MASK_DRIVER, "got tokens: \n");
- gossip_do(MASK_DRIVER, list_printf("%s", tokens));
-
+ gossip_do(MASK_DRIVER, list_printf("%s", tokens));
+
if (tokens->size == 0)
- return;
+ return;
char* optoken = tokens->head->data;
if (strncmp(optoken, "#", 1) == 0)
{
- ; // This is a comment.
+ ; // This is a comment.
}
else if (strncmp(optoken, "put", 3) == 0)
{
- driver_put(driver, tokens);
+ driver_put(driver, tokens);
}
else if (strncmp(optoken, "get", 3) == 0)
{
- driver_get(driver, tokens);
+ driver_get(driver, tokens);
}
else if (strncmp(optoken, "lookup", 6) == 0)
{
- driver_lookup(tokens);
+ driver_lookup(tokens);
}
else if (strncmp(optoken, "info", 4) == 0)
{
- driver_info(tokens);
+ driver_info(tokens);
}
else if (strncmp(optoken, "sleep", 5) == 0)
{
- printf("sleep\n");
+ printf("sleep\n");
driver_sleep(driver, tokens);
}
else if (strncmp(optoken, "quit", 4) == 0)
{
- driver_quit(driver);
+ driver_quit(driver);
}
list_destroy(tokens);
}
@@ -226,23 +226,23 @@
driver_process(cmpi_driver* driver)
{
gossip_ldebug(MASK_DRIVER, "driver_process()...\n");
- while (! driver->quitting)
+ while (! driver->quitting)
{
char* result =
fgets(driver->command, CMPI_DRIVER_MAX_COMMAND, driver->source);
if (!result)
{
- gossip_ldebug(MASK_DRIVER, "Resetting driver...\n");
+ gossip_ldebug(MASK_DRIVER, "Resetting driver...\n");
fclose(driver->source);
fclose(driver->sink);
- driver_setup_fifo(driver);
+ driver_setup_fifo(driver);
continue;
}
char* s = strchr(driver->command, '\n');
- *s = '\0';
+ *s = '\0';
driver_execute(driver);
}
- gossip_ldebug(MASK_DRIVER, "Closing driver...\n");
+ gossip_ldebug(MASK_DRIVER, "Closing driver...\n");
fclose(driver->source);
fclose(driver->sink);
}
@@ -257,13 +257,11 @@
printf("file error: %s \n", filename);
return;
}
-
+
for (i = 1; i < mpi_size; i++)
{
char* t = cmpi_info(i);
- fprintf(f, "%s\n", t);
+ fprintf(f, "%s\n", t);
}
- fclose(f);
+ fclose(f);
}
-
-
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/cmpi-cp/cmpi-cp.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,10 +1,10 @@
-#include <cmpi-cp.h>
+#include <cmpi-cp.h>
char* target1;
char* target2;
-int value_size;
+int value_size;
void
cmpi_cp_args(int argc, char* argv[])
@@ -12,10 +12,10 @@
if (argc == 1)
{
printhelp();
- exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
target1 = argv[1];
- target2 = argv[2];
+ target2 = argv[2];
}
void
@@ -23,7 +23,7 @@
{
printf("usage: cmpi [OPTION] target1 target2 \n");
printf(" each target is a file path \n");
- printf(" or a standard stream - \n");
+ printf(" or a standard stream - \n");
printf(" or a DHT key formatted as dht://<key> \n\n");
printf("options: \n");
printf(" -h print this message \n");
@@ -32,12 +32,12 @@
}
/**
- Determine the type of this target, file or key.
+ Determine the type of this target, file or key.
*/
CMPI_CP_TYPE
cmpi_cp_extract_type(char* target, char* value)
{
- CMPI_CP_TYPE result;
+ CMPI_CP_TYPE result;
if (strstr(target, "dht://"))
{
strcpy(value, target+6);
@@ -48,59 +48,59 @@
strcpy(value, target);
result = CMPI_CP_STREAM;
}
- else
+ else
{
strcpy(value, target);
result = CMPI_CP_FILE;
}
- return result;
+ return result;
}
CMPI_RETURN
cmpi_cp_put(FILE* file, char* object)
{
- char key[CMPI_KEY_LENGTH+10];
+ char key[CMPI_KEY_LENGTH+10];
char data[value_size];
- char msg[100];
- int count = 0;
+ char msg[100];
+ int count = 0;
while (! feof(file))
{
- int total = 0;
- while (!feof(file) &&
+ int total = 0;
+ while (!feof(file) &&
total < value_size)
{
int chunk = value_size-total;
int actual = fread(data+total, 1, chunk, file);
- data[total+actual] = '\0';
+ data[total+actual] = '\0';
total += actual;
}
if (total == 0)
- break;
+ break;
sprintf(key, "%s[%i]", object, count++);
- // printf("put: %s\n", key);
+ // printf("put: %s\n", key);
fprintf(to_cmpi, "put %s %i\n", key, total);
- fflush(to_cmpi);
+ fflush(to_cmpi);
fscanf(from_cmpi, "%s", msg);
if (strcmp(msg, "ok") != 0)
- return CMPI_ERROR_UNKNOWN;
+ return CMPI_ERROR_UNKNOWN;
buffer_to_stream(data, total, to_cmpi);
- fflush(to_cmpi);
- }
+ fflush(to_cmpi);
+ }
- sprintf(data, "DHT: %i", count);
+ sprintf(data, "DHT: %i", count);
fprintf(to_cmpi, "put %s %i\n", object, (int) strlen(data));
- fflush(to_cmpi);
+ fflush(to_cmpi);
fprintf(to_cmpi, "%s", data);
- fflush(to_cmpi);
+ fflush(to_cmpi);
- char result[32];
- fscanf(from_cmpi, "%s\n", result);
+ char result[32];
+ fscanf(from_cmpi, "%s\n", result);
if (strncmp(result, "ok", 2) != 0)
return CMPI_ERROR_UNKNOWN;
-
- return CMPI_SUCCESS;
+
+ return CMPI_SUCCESS;
}
CMPI_RETURN
@@ -108,59 +108,62 @@
{
char data[value_size];
int count, c;
- int length;
+ int length;
fprintf(to_cmpi, "get %s\n", object);
- fflush(to_cmpi);
+ fflush(to_cmpi);
- fscanf(from_cmpi, "%i", &length);
- fgetc(from_cmpi);
+ fscanf(from_cmpi, "%i", &length);
+ fgetc(from_cmpi);
if (length == -1)
- return CMPI_DOESNT_EXIST;
+ return CMPI_DOESNT_EXIST;
stream_to_buffer(data, length, from_cmpi);
sscanf(data, "DHT: %i", &count);
- // printf("count: %i\n", count);
-
+ // printf("count: %i\n", count);
+
for (c = 0; c < count; c++)
{
fprintf(to_cmpi, "get %s[%i]\n", object, c);
- fflush(to_cmpi);
+ fflush(to_cmpi);
fscanf(from_cmpi, "%i", &length);
- fgetc(from_cmpi);
+ fgetc(from_cmpi);
if (length == -1)
{
- printf("not found: %s[%i]\n", object, c);
+ printf("not found: %s[%i]\n", object, c);
return CMPI_DOESNT_EXIST;
}
- stream_to_buffer(data, length, from_cmpi);
- buffer_to_stream(data, length, file);
- }
- return CMPI_SUCCESS;
+ stream_to_buffer(data, length, from_cmpi);
+ buffer_to_stream(data, length, file);
+ }
+ return CMPI_SUCCESS;
}
void
bad_file(char* filename)
{
printf("Could not open: %s\n", filename);
- exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
+/**
+ Case logic for different uses
+*/
CMPI_RETURN
cmpi_cp_case(CMPI_CP_TYPE type1, char* object1,
CMPI_CP_TYPE type2, char* object2)
{
- CMPI_RETURN result = CMPI_SUCCESS;
+ CMPI_RETURN result = CMPI_SUCCESS;
if (type1 == CMPI_CP_FILE &&
type2 == CMPI_CP_KEY)
{
- // FILE -> DHT
+ // FILE -> DHT
FILE* file = fopen(object1, "r");
if (!file)
- bad_file(object1);
+ bad_file(object1);
result = cmpi_cp_put(file, object2);
- fclose(file);
+ fclose(file);
}
else if (type1 == CMPI_CP_KEY &&
type2 == CMPI_CP_FILE)
@@ -168,30 +171,30 @@
// DHT -> FILE
FILE* file = fopen(object2, "w");
if (!file)
- bad_file(object2);
+ bad_file(object2);
result = cmpi_cp_get(object1, file);
- fclose(file);
+ fclose(file);
}
else if (type1 == CMPI_CP_KEY &&
type2 == CMPI_CP_KEY)
{
- // DHT -> DHT
+ // DHT -> DHT
}
else if (type1 == CMPI_CP_STREAM &&
type2 == CMPI_CP_KEY)
{
// STREAM -> DHT
- result = cmpi_cp_put(stdin, object2);
+ result = cmpi_cp_put(stdin, object2);
}
else if (type1 == CMPI_CP_KEY &&
type2 == CMPI_CP_STREAM)
{
// DHT -> STREAM
- result = cmpi_cp_get(object1, stdout);
+ result = cmpi_cp_get(object1, stdout);
}
- return result;
+ return result;
}
-
+
int
main(int argc, char* argv[])
{
@@ -201,9 +204,9 @@
char object1[CMPI_KEY_LENGTH+10];
char object2[CMPI_KEY_LENGTH+10];
- value_size = CMPI_CP_CHUNK;
-
- cmpi_cp_args(argc, argv);
+ value_size = CMPI_CP_CHUNK;
+
+ cmpi_cp_args(argc, argv);
target1_type = cmpi_cp_extract_type(target1, object1);
target2_type = cmpi_cp_extract_type(target2, object2);
@@ -211,24 +214,24 @@
target2_type == CMPI_CP_FILE)
{
printf("cmpi-cp: given two files!\n");
- exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
- driver_access_fifo();
+ driver_access_fifo();
CMPI_RETURN result =
- cmpi_cp_case(target1_type, object1, target2_type, object2);
-
+ cmpi_cp_case(target1_type, object1, target2_type, object2);
+
if (result == CMPI_DOESNT_EXIST)
{
- // cmpi_get could not find the dht:// target
- printf("does not exist: %s\n", target1);
- return EXIT_FAILURE;
+ // cmpi_get could not find the dht:// target
+ printf("does not exist: %s\n", target1);
+ return EXIT_FAILURE;
}
- else if (result != CMPI_SUCCESS)
+ else if (result != CMPI_SUCCESS)
{
- printf("error\n");
- return EXIT_FAILURE;
+ printf("error\n");
+ return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
Modified: src/cmpi-db/cmpi-db-fifo-quit.c
===================================================================
--- src/cmpi-db/cmpi-db-fifo-quit.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/cmpi-db/cmpi-db-fifo-quit.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,26 +1,26 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
-#include <accessor.h>
+#include <accessor.h>
int
main(int argc, char* argv[])
{
- char msg[100];
-
+ char msg[100];
+
driver_access_fifo();
-
+
fprintf(to_cmpi, "quit\n");
- fflush(to_cmpi);
+ fflush(to_cmpi);
fscanf(from_cmpi, "%s\n", msg);
if (strcmp(msg, "ok") != 0)
{
printf("error\n");
- return EXIT_FAILURE;
+ return EXIT_FAILURE;
}
-
- return EXIT_SUCCESS;
+
+ return EXIT_SUCCESS;
}
Modified: src/cmpi-db/cmpi-db-fifo.c
===================================================================
--- src/cmpi-db/cmpi-db-fifo.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/cmpi-db/cmpi-db-fifo.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -31,7 +31,7 @@
void
cmpi_client_code()
{
- char hostname[100];
+ char hostname[128];
wait_for_notification();
notify_next();
Modified: src/mpi_tools/io_tools.c
===================================================================
--- src/mpi_tools/io_tools.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/mpi_tools/io_tools.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,7 +1,7 @@
-#include <io_tools.h>
+#include <io_tools.h>
-#include <unistd.h>
+#include <unistd.h>
void
stream_to_buffer(char* buffer, int length, FILE* stream)
@@ -25,17 +25,17 @@
{
int chunk = length-total;
int actual = fwrite(buffer+total, 1, chunk, stream);
- total += actual;
+ total += actual;
}
}
void
eat_whitespace(FILE* stream)
{
- char c;
+ char c;
do
{
c = fgetc(stream);
} while (c == ' ' || c == '\n');
- ungetc(c, stream);
+ ungetc(c, stream);
}
Modified: test/driver/test01.c
===================================================================
--- test/driver/test01.c 2010-04-29 21:42:41 UTC (rev 63)
+++ test/driver/test01.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,21 +1,21 @@
-#include <stdio.h>
-#include <stdlib.h>
+#include <stdio.h>
+#include <stdlib.h>
-#include <accessor.h>
+#include <accessor.h>
int
main(int argc, char* argv[])
{
- driver_access_fifo();
-
+ driver_access_fifo();
+
fprintf(to_cmpi, "sleep 3\n");
- fflush(to_cmpi);
+ fflush(to_cmpi);
char output[30];
fscanf(from_cmpi, "output: %s", output);
printf("%s\n", output);
- return 0;
+ return 0;
}
Modified: test/driver/test01.zsh
===================================================================
--- test/driver/test01.zsh 2010-04-29 21:42:41 UTC (rev 63)
+++ test/driver/test01.zsh 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,18 +1,18 @@
-#!/bin/zsh
+#!/bin/zsh
make -j 3 D=1 test/driver/test01.x test/driver/test02.x \
- test/driver/test_driver.x
+ test/driver/test_driver.x
-mpiexec -n 5 test/driver/test_driver.x -n 4 &
+mpiexec -n 5 test/driver/test_driver.x -n 4 &
DRIVER_PID=${!}
-sleep 5
+sleep 5
print "Launching tool 01..."
-test/driver/test01.x
+test/driver/test01.x
print "Launching tool 02..."
-test/driver/test02.x
+test/driver/test02.x
-wait
+wait
Modified: test/driver/test02.c
===================================================================
--- test/driver/test02.c 2010-04-29 21:42:41 UTC (rev 63)
+++ test/driver/test02.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,20 +1,20 @@
-#include <stdio.h>
-#include <stdlib.h>
+#include <stdio.h>
+#include <stdlib.h>
-#include <accessor.h>
+#include <accessor.h>
int
main(int argc, char* argv[])
{
driver_access_fifo();
-
+
fprintf(to_cmpi, "quit\n");
- fflush(to_cmpi);
+ fflush(to_cmpi);
char output[30];
fscanf(from_cmpi, "output: %s", output);
printf("%s\n", output);
- return 0;
+ return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 21:42:47
|
Revision: 63
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=63&view=rev
Author: jmwozniak
Date: 2010-04-29 21:42:41 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Final CMPI test works.
Modified Paths:
--------------
include/lru_table.h
src/adts/lru_table.c
src/cmpi/cmpi.c
src/dense-1/dense.c
src/mpi_tools/mpi_tools.c
test/cmpi/test-update02.c
Modified: include/lru_table.h
===================================================================
--- include/lru_table.h 2010-04-29 21:01:27 UTC (rev 62)
+++ include/lru_table.h 2010-04-29 21:42:41 UTC (rev 63)
@@ -9,23 +9,23 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
-#include <string.h>
+#include <string.h>
-#include <mpi_tools.h>
-#include <gossip.h>
+#include <mpi_tools.h>
+#include <gossip.h>
-// Use hash functions from hashtable.h
-#include "hashtable.h"
+// Use hash functions from hashtable.h
+#include "hashtable.h"
#include "dpkm_list.h"
-#include "keyvalue.h"
+#include "keyvalue.h"
struct lru_table
{
struct dpkm_list** array;
- struct dpkm_list* lru;
- int capacity;
+ struct dpkm_list* lru;
+ int capacity;
int size;
- int limit;
+ int limit;
};
struct lru_table* lru_table_create(int capacity, int limit);
@@ -34,18 +34,18 @@
char* key, char* data, int length);
bool lru_table_update(struct lru_table *table,
- char* key, char* data, int offset, int length);
+ char* key, char* data, int offset, int length);
struct keyvalue* lru_table_search(struct lru_table* table, char* key);
-struct keyvalue* lru_table_poll(struct lru_table* table);
+struct keyvalue* lru_table_poll(struct lru_table* table);
void lru_table_free(struct lru_table* target);
void lru_table_printf(char* format, struct lru_table* target);
-void lru_table_fprintf(FILE* file, char* format, struct lru_table* target);
+void lru_table_fprintf(FILE* file, char* format, struct lru_table* target);
+void lru_table_printdata(struct lru_table* target);
#endif
-
Modified: src/adts/lru_table.c
===================================================================
--- src/adts/lru_table.c 2010-04-29 21:01:27 UTC (rev 62)
+++ src/adts/lru_table.c 2010-04-29 21:42:41 UTC (rev 63)
@@ -83,7 +83,7 @@
struct keyvalue*
lru_table_add(struct lru_table* table, char* key, char* data, int length)
{
- // NOTE_F;
+ NOTE_FS(key);
struct keyvalue* result = NULL;
@@ -101,6 +101,7 @@
if (victim == NULL)
{
+ NOTE("no victim\n");
table->size++;
}
else
@@ -143,6 +144,7 @@
result->length = item->length;
printdata("lru found: ", item->data, item->length);
+ printf("\n");
return result;
}
@@ -190,6 +192,8 @@
DEBUG(printdata("new data: ", item->data, item->length));
+ DEBUG(lru_table_printdata(table));
+
return true;
}
@@ -319,10 +323,9 @@
*/
/**
- @param format specifies the output format for the data items
*/
void
-lru_table_printdata(char* format, struct lru_table* target)
+lru_table_printdata(struct lru_table* target)
{
int i;
printf("LRU_TABLE(%i) \n{\n", target->size);
Modified: src/cmpi/cmpi.c
===================================================================
--- src/cmpi/cmpi.c 2010-04-29 21:01:27 UTC (rev 62)
+++ src/cmpi/cmpi.c 2010-04-29 21:42:41 UTC (rev 63)
@@ -176,8 +176,11 @@
cmpi_cached_update(char* key, char* data, int offset, int length)
{
SHOW_FSII(key,offset,length);
- printdata("update: ", data, length) ;
+ printdata("update: ", data, length);
+ printf("\n");
+ DEBUG(lru_table_printdata(cmpi_cache));
+
if (lru_table_search(cmpi_cache, key))
{
lru_table_update(cmpi_cache, key, data, offset, length);
@@ -187,7 +190,7 @@
if (offset != 0)
{
char* update = malloc(offset+length);
- memset(update, ' ', offset);
+ memset(update, '\0', offset);
memcpy(update+offset, data, length);
lru_table_add(cmpi_cache, key, update, length);
}
@@ -196,7 +199,7 @@
lru_table_add(cmpi_cache, key, data, length);
}
}
- // DEBUG(lru_table_fprintf(debug_file, "%s", cmpi_cache));
+ DEBUG(lru_table_printdata(cmpi_cache));
DONE;
}
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2010-04-29 21:01:27 UTC (rev 62)
+++ src/dense-1/dense.c 2010-04-29 21:42:41 UTC (rev 63)
@@ -279,7 +279,7 @@
handle_update(MPIRPC_Node caller, int unique, char* args,
char* blob, int blob_length)
{
- char key[CMPI_KEY_LENGTH];
+ char* key = malloc(strlen(args));
int offset;
SHOW_FSI(args, blob_length);
Modified: src/mpi_tools/mpi_tools.c
===================================================================
--- src/mpi_tools/mpi_tools.c 2010-04-29 21:01:27 UTC (rev 62)
+++ src/mpi_tools/mpi_tools.c 2010-04-29 21:42:41 UTC (rev 63)
@@ -99,7 +99,7 @@
else
printf("\\%i", (int) c);
}
- printf("]\n");
+ printf("]");
}
void
Modified: test/cmpi/test-update02.c
===================================================================
--- test/cmpi/test-update02.c 2010-04-29 21:01:27 UTC (rev 62)
+++ test/cmpi/test-update02.c 2010-04-29 21:42:41 UTC (rev 63)
@@ -22,14 +22,19 @@
sprintf(value, "value1");
cmpi_update(key1, value, strlen(value)+1, 0);
+ sleep(1);
sprintf(value, "value2");
cmpi_update(key2, value, strlen(value)+1, 0);
+ sleep(1);
sprintf(value, "X");
cmpi_update(key2, value, strlen(value)+1, 3);
+ sleep(1);
sprintf(value, "value3");
cmpi_update(key3, value, strlen(value)+1, 0);
+ sleep(1);
sprintf(value, "X");
cmpi_update(key3, value, strlen(value)+1, 1);
+ sleep(1);
sprintf(value, "value1");
cmpi_update(key3, value, strlen(value)+1, 3);
@@ -41,8 +46,10 @@
int length;
cmpi_get(key1, &result, &length);
printf("RESULT_1: %s\n", result);
+ sleep(1);
cmpi_get(key2, &result, &length);
printf("RESULT_2: %s\n", result);
+ sleep(1);
cmpi_get(key3, &result, &length);
printf("RESULT_3: %s\n", result);
NOTE("GET SUCCEEDED");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 21:01:33
|
Revision: 62
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=62&view=rev
Author: jmwozniak
Date: 2010-04-29 21:01:27 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
cmpi/test06 -> test/update02
Added Paths:
-----------
test/cmpi/test-update02.c
Removed Paths:
-------------
test/cmpi/test06.c
Copied: test/cmpi/test-update02.c (from rev 42, test/cmpi/test06.c)
===================================================================
--- test/cmpi/test-update02.c (rev 0)
+++ test/cmpi/test-update02.c 2010-04-29 21:01:27 UTC (rev 62)
@@ -0,0 +1,53 @@
+
+/**
+ Update two new keys, update those, and retrieve one.
+*/
+
+#include "test_helpers.h"
+
+void
+cmpi_client_code()
+{
+ char key1[10];
+ char key2[10];
+ char key3[10];
+ sprintf(key1, "key1_%i", mpi_rank);
+ sprintf(key2, "key2_%i", mpi_rank);
+ sprintf(key3, "key3_%i", mpi_rank);
+
+ wait_for_notification();
+ notify_next();
+
+ char* value = malloc(64*sizeof(char));
+
+ sprintf(value, "value1");
+ cmpi_update(key1, value, strlen(value)+1, 0);
+ sprintf(value, "value2");
+ cmpi_update(key2, value, strlen(value)+1, 0);
+ sprintf(value, "X");
+ cmpi_update(key2, value, strlen(value)+1, 3);
+ sprintf(value, "value3");
+ cmpi_update(key3, value, strlen(value)+1, 0);
+ sprintf(value, "X");
+ cmpi_update(key3, value, strlen(value)+1, 1);
+ sprintf(value, "value1");
+ cmpi_update(key3, value, strlen(value)+1, 3);
+
+ free(value);
+
+ sleep(2);
+
+ char* result;
+ int length;
+ cmpi_get(key1, &result, &length);
+ printf("RESULT_1: %s\n", result);
+ cmpi_get(key2, &result, &length);
+ printf("RESULT_2: %s\n", result);
+ cmpi_get(key3, &result, &length);
+ printf("RESULT_3: %s\n", result);
+ NOTE("GET SUCCEEDED");
+
+ sleep(2);
+
+ cmpi_shutdown();
+}
Property changes on: test/cmpi/test-update02.c
___________________________________________________________________
Added: svn:mergeinfo
+
Deleted: test/cmpi/test06.c
===================================================================
--- test/cmpi/test06.c 2010-04-29 20:57:35 UTC (rev 61)
+++ test/cmpi/test06.c 2010-04-29 21:01:27 UTC (rev 62)
@@ -1,53 +0,0 @@
-
-/**
- Update two new keys, update those, and retrieve one.
-*/
-
-#include "test_helpers.h"
-
-void
-cmpi_client_code()
-{
- char key1[10];
- char key2[10];
- char key3[10];
- sprintf(key1, "key1_%i", mpi_rank);
- sprintf(key2, "key2_%i", mpi_rank);
- sprintf(key3, "key3_%i", mpi_rank);
-
- wait_for_notification();
- notify_next();
-
- char* value = malloc(64*sizeof(char));
-
- sprintf(value, "value1");
- cmpi_update(key1, value, strlen(value)+1, 0);
- sprintf(value, "value2");
- cmpi_update(key2, value, strlen(value)+1, 0);
- sprintf(value, "X");
- cmpi_update(key2, value, strlen(value)+1, 3);
- sprintf(value, "value3");
- cmpi_update(key3, value, strlen(value)+1, 0);
- sprintf(value, "X");
- cmpi_update(key3, "X", strlen(value)+1, 1);
- sprintf(value, "value1");
- cmpi_update(key3, "X", strlen(value)+1, 3);
-
- free(value);
-
- sleep(2);
-
- char* result;
- int length;
- cmpi_get(key1, &result, &length);
- printf("RESULT_1: %s\n", result);
- cmpi_get(key2, &result, &length);
- printf("RESULT_2: %s\n", result);
- cmpi_get(key3, &result, &length);
- printf("RESULT_3: %s\n", result);
- NOTE("GET SUCCEEDED");
-
- sleep(2);
-
- cmpi_shutdown();
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 20:57:41
|
Revision: 61
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=61&view=rev
Author: jmwozniak
Date: 2010-04-29 20:57:35 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
cmpi/test05 -> test-update01
Added Paths:
-----------
test/cmpi/test-update01.c
test/cmpi/test-update01.zsh
Removed Paths:
-------------
test/cmpi/test05.c
test/cmpi/test05.zsh
Copied: test/cmpi/test-update01.c (from rev 60, test/cmpi/test05.c)
===================================================================
--- test/cmpi/test-update01.c (rev 0)
+++ test/cmpi/test-update01.c 2010-04-29 20:57:35 UTC (rev 61)
@@ -0,0 +1,45 @@
+
+/**
+ Put three keys, update one, and get the updated value.
+*/
+
+#include "test_helpers.h"
+
+void
+cmpi_client_code()
+{
+ char key1[10];
+ char key2[10];
+ char key3[10];
+ sprintf(key1, "key1_%i", mpi_rank);
+ sprintf(key2, "key2_%i", mpi_rank);
+ sprintf(key3, "key3_%i", mpi_rank);
+
+ wait_for_notification();
+ notify_next();
+
+ char value[30];
+ sprintf(value, "value1");
+ cmpi_put(key1, value, strlen(value)+1);
+ printf("FIRST PUT SUCCEEDED\n");
+ sprintf(value, "value2");
+ cmpi_put(key2, value, strlen(value)+1);
+ printf("SECOND PUT SUCCEEDED\n");
+ sprintf(value, "value3");
+ cmpi_put(key3, value, strlen(value)+1);
+ printf("THIRD PUT SUCCEEDED\n");
+
+ sleep(2);
+
+ cmpi_update(key2, "X", 1, 3);
+
+ char* result;
+ int length;
+ cmpi_get(key2, &result, &length);
+ printf("result: %s\n", result);
+ printf("GET SUCCEEDED\n");
+
+ sleep(2);
+
+ cmpi_shutdown();
+}
Property changes on: test/cmpi/test-update01.c
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: test/cmpi/test-update01.zsh (from rev 60, test/cmpi/test05.zsh)
===================================================================
--- test/cmpi/test-update01.zsh (rev 0)
+++ test/cmpi/test-update01.zsh 2010-04-29 20:57:35 UTC (rev 61)
@@ -0,0 +1,37 @@
+#!/bin/zsh
+
+# Be sure to make tests with D=1
+
+# set -x
+
+source tools/test-helpers.zsh
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+shift
+LAUNCH=${*}
+
+if (( USE_COMM_WORLD == 1 ))
+then
+
+ # Monolithic execution (5 nodes, 1 client):
+
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ CODE=$?
+ [[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+else
+
+ # KDA-2B execution:
+
+ tools/startup_nodes.zsh $(( N-1 )) 100 &
+ mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ sleep $(( N+15 ))
+
+fi
+
+# Should be 6 "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == 6 )) || crash "N != 6"
+
+exit 0
Property changes on: test/cmpi/test-update01.zsh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mergeinfo
+
Deleted: test/cmpi/test05.c
===================================================================
--- test/cmpi/test05.c 2010-04-29 20:56:35 UTC (rev 60)
+++ test/cmpi/test05.c 2010-04-29 20:57:35 UTC (rev 61)
@@ -1,45 +0,0 @@
-
-/**
- Put three keys, update one, and get the updated value.
-*/
-
-#include "test_helpers.h"
-
-void
-cmpi_client_code()
-{
- char key1[10];
- char key2[10];
- char key3[10];
- sprintf(key1, "key1_%i", mpi_rank);
- sprintf(key2, "key2_%i", mpi_rank);
- sprintf(key3, "key3_%i", mpi_rank);
-
- wait_for_notification();
- notify_next();
-
- char value[30];
- sprintf(value, "value1");
- cmpi_put(key1, value, strlen(value)+1);
- printf("FIRST PUT SUCCEEDED\n");
- sprintf(value, "value2");
- cmpi_put(key2, value, strlen(value)+1);
- printf("SECOND PUT SUCCEEDED\n");
- sprintf(value, "value3");
- cmpi_put(key3, value, strlen(value)+1);
- printf("THIRD PUT SUCCEEDED\n");
-
- sleep(2);
-
- cmpi_update(key2, "X", 1, 3);
-
- char* result;
- int length;
- cmpi_get(key2, &result, &length);
- printf("result: %s\n", result);
- printf("GET SUCCEEDED\n");
-
- sleep(2);
-
- cmpi_shutdown();
-}
Deleted: test/cmpi/test05.zsh
===================================================================
--- test/cmpi/test05.zsh 2010-04-29 20:56:35 UTC (rev 60)
+++ test/cmpi/test05.zsh 2010-04-29 20:57:35 UTC (rev 61)
@@ -1,37 +0,0 @@
-#!/bin/zsh
-
-# Be sure to make tests with D=1
-
-# set -x
-
-source tools/test-helpers.zsh
-
-PROGRAM=$1
-OUT=${PROGRAM%.x}.out
-shift
-LAUNCH=${*}
-
-if (( USE_COMM_WORLD == 1 ))
-then
-
- # Monolithic execution (5 nodes, 1 client):
-
- mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
- CODE=$?
- [[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-
-else
-
- # KDA-2B execution:
-
- tools/startup_nodes.zsh $(( N-1 )) 100 &
- mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
- sleep $(( N+15 ))
-
-fi
-
-# Should be 6 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
-(( N == 6 )) || crash "N != 6"
-
-exit 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 20:56:41
|
Revision: 60
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=60&view=rev
Author: jmwozniak
Date: 2010-04-29 20:56:35 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Fixes for cmpi/test05
Modified Paths:
--------------
Makefile.in
test/adts/module.mk.in
test/adts/test-dpkm_list.c
test/adts/test-lru_table02.c
test/cmpi/test05.c
Added Paths:
-----------
test/cmpi/test05.zsh
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-29 20:55:41 UTC (rev 59)
+++ Makefile.in 2010-04-29 20:56:35 UTC (rev 60)
@@ -281,6 +281,7 @@
$(E)echo LIBS: $(LIBS)
$(E)echo DEPENDS: $(DEPENDS)
$(E)echo OPENSSL: $(OPENSSL_LOCATION)
+ $(E)echo ADT_OBJS: $(ADT_OBJS)
# $(E)echo USE_MPIRPC_1: @USE_MPIRPC_1@
# $(E)echo USE_MPIRPC_2: @USE_MPIRPC_2@
# $(E)echo USE_TABLE_KDA_1: @USE_TABLE_KDA_1@
@@ -338,7 +339,6 @@
TABLE_OBJS := $(KDA_OBJS) $(DENSE_OBJS)
CMPI_OBJS := $(patsubst %.c,%.o, $(filter %.c,$(CMPI_SRC)))
CMPI_OBJS += $(TABLE_OBJS) $(MPIRPC_OBJS) $(DISKSIM_OBJS)
-# CMPI_PICS += src/cmpi/cmpi-io.po
CMPI_DEPS := $(patsubst %.o,%.d,$(CMPI_OBJS))
Modified: test/adts/module.mk.in
===================================================================
--- test/adts/module.mk.in 2010-04-29 20:55:41 UTC (rev 59)
+++ test/adts/module.mk.in 2010-04-29 20:56:35 UTC (rev 60)
@@ -1,6 +1,6 @@
TEST_SRC += $(shell find test/adts -name "*.c")
-test/adts/test%.x: test/adts/test%.o src/mpi_tools/mpi_tools.o $(ADT_OBJS)
+test/adts/test%.x: test/adts/test%.o src/mpi_tools/mpi_tools.o $(CMPI)
$(Q) " LINK $(@) "
$(E)$(MPICC) $(MPE) $(<) src/mpi_tools/mpi_tools.o $(ADT_OBJS) $(LIBS) -o $(@)
Modified: test/adts/test-dpkm_list.c
===================================================================
--- test/adts/test-dpkm_list.c 2010-04-29 20:55:41 UTC (rev 59)
+++ test/adts/test-dpkm_list.c 2010-04-29 20:56:35 UTC (rev 60)
@@ -86,6 +86,11 @@
dpkm_list_tostring(s, 1000, "%i", L);
printf("From string: %s\n", s);
+ struct dpkm_list* L2 = dpkm_list_create(4);
+ char* binary = "data";
+ dpkm_list_add(L2, "binary", binary, strlen(binary)+1);
+ dpkm_list_printdata(L2);
+
/*
dpkm_list_printf("%i", L);
dpkm_list_poll(L);
Modified: test/adts/test-lru_table02.c
===================================================================
--- test/adts/test-lru_table02.c 2010-04-29 20:55:41 UTC (rev 59)
+++ test/adts/test-lru_table02.c 2010-04-29 20:56:35 UTC (rev 60)
@@ -27,9 +27,12 @@
lru_table_add(table, "key2", heap(data2), strlen(data2)+1);
lru_table_printf("%s", table);
- char* overwrite = "XJKLJKL";
+ char* overwrite = "_-_-_";
lru_table_update(table, "key2", overwrite, 3, strlen(overwrite)+1);
+ lru_table_printf("%s", table);
+ overwrite = "X";
+ lru_table_update(table, "key2", overwrite, 1, strlen(overwrite)+1);
lru_table_printf("%s", table);
while ((kv = lru_table_poll(table)))
Modified: test/cmpi/test05.c
===================================================================
--- test/cmpi/test05.c 2010-04-29 20:55:41 UTC (rev 59)
+++ test/cmpi/test05.c 2010-04-29 20:56:35 UTC (rev 60)
@@ -1,45 +1,45 @@
/**
- Put three keys, update one, and get the updated value.
+ Put three keys, update one, and get the updated value.
*/
-#include "test_helpers.h"
+#include "test_helpers.h"
void
cmpi_client_code()
{
char key1[10];
char key2[10];
- char key3[10];
+ char key3[10];
sprintf(key1, "key1_%i", mpi_rank);
sprintf(key2, "key2_%i", mpi_rank);
sprintf(key3, "key3_%i", mpi_rank);
wait_for_notification();
- notify_next();
+ notify_next();
char value[30];
sprintf(value, "value1");
- cmpi_put(key1, value, strlen(value)+1);
+ cmpi_put(key1, value, strlen(value)+1);
printf("FIRST PUT SUCCEEDED\n");
sprintf(value, "value2");
- cmpi_put(key2, value, strlen(value)+1);
+ cmpi_put(key2, value, strlen(value)+1);
printf("SECOND PUT SUCCEEDED\n");
sprintf(value, "value3");
- cmpi_put(key3, value, strlen(value)+1);
+ cmpi_put(key3, value, strlen(value)+1);
printf("THIRD PUT SUCCEEDED\n");
-
- sleep(2);
- cmpi_update(key2, "W", 1, 3);
-
+ sleep(2);
+
+ cmpi_update(key2, "X", 1, 3);
+
char* result;
- int length;
- cmpi_get(key2, &result, &length);
- printf("result: %s\n", result);
- printf("GET SUCCEEDED\n");
-
- sleep(2);
-
- cmpi_shutdown();
+ int length;
+ cmpi_get(key2, &result, &length);
+ printf("result: %s\n", result);
+ printf("GET SUCCEEDED\n");
+
+ sleep(2);
+
+ cmpi_shutdown();
}
Added: test/cmpi/test05.zsh
===================================================================
--- test/cmpi/test05.zsh (rev 0)
+++ test/cmpi/test05.zsh 2010-04-29 20:56:35 UTC (rev 60)
@@ -0,0 +1,37 @@
+#!/bin/zsh
+
+# Be sure to make tests with D=1
+
+# set -x
+
+source tools/test-helpers.zsh
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+shift
+LAUNCH=${*}
+
+if (( USE_COMM_WORLD == 1 ))
+then
+
+ # Monolithic execution (5 nodes, 1 client):
+
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ CODE=$?
+ [[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+else
+
+ # KDA-2B execution:
+
+ tools/startup_nodes.zsh $(( N-1 )) 100 &
+ mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ sleep $(( N+15 ))
+
+fi
+
+# Should be 6 "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == 6 )) || crash "N != 6"
+
+exit 0
Property changes on: test/cmpi/test05.zsh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 20:55:47
|
Revision: 59
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=59&view=rev
Author: jmwozniak
Date: 2010-04-29 20:55:41 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Better output methods.
Modified Paths:
--------------
include/dpkm_list.h
src/adts/dpkm_list.c
src/adts/lru_table.c
Modified: include/dpkm_list.h
===================================================================
--- include/dpkm_list.h 2010-04-29 20:02:28 UTC (rev 58)
+++ include/dpkm_list.h 2010-04-29 20:55:41 UTC (rev 59)
@@ -96,8 +96,6 @@
void dpkm_list_output(char* (*f)(void*), struct dpkm_list* target);
-// void dpkm_list_dump(char* format, struct dpkm_list* target);
-
void dpkm_list_free(struct dpkm_list* target);
void dpkm_list_destroy(struct dpkm_list* target);
@@ -106,6 +104,8 @@
void dpkm_list_fprintf(FILE* file, char* format, struct dpkm_list* target);
+void dpkm_list_printdata(struct dpkm_list* target);
+
int dpkm_list_tostring(char* str, size_t size,
char* format, struct dpkm_list* target);
Modified: src/adts/dpkm_list.c
===================================================================
--- src/adts/dpkm_list.c 2010-04-29 20:02:28 UTC (rev 58)
+++ src/adts/dpkm_list.c 2010-04-29 20:55:41 UTC (rev 59)
@@ -858,6 +858,25 @@
}
/**
+ Print list using printdata() for values.
+ */
+void
+dpkm_list_printdata(struct dpkm_list* target)
+{
+ struct dpkm_list_item* item;
+
+ printf("[");
+ for (item = target->head; item; item = item->next)
+ {
+ printf("(%s,", item->key);
+ printdata("", item->data, item->length);
+ if (item->next)
+ printf(",");
+ }
+ printf("]\n");
+}
+
+/**
Free this dpkm_list but not its data.
*/
void
Modified: src/adts/lru_table.c
===================================================================
--- src/adts/lru_table.c 2010-04-29 20:02:28 UTC (rev 58)
+++ src/adts/lru_table.c 2010-04-29 20:55:41 UTC (rev 59)
@@ -1,12 +1,18 @@
#include "lru_table.h"
-int
+static int
max(int i1, int i2)
{
return (i1>i2) ? i1 : i2;
}
+static int
+min(int i1, int i2)
+{
+ return (i1<i2) ? i1 : i2;
+}
+
struct lru_table*
lru_table_create(int capacity, int limit)
{
@@ -166,7 +172,7 @@
return false;
gossip_do(MASK_ADTS, lru_table_printf("%s", table));
- printdata("old data: ", item->data, item->length);
+ DEBUG(printdata("old data: ", item->data, item->length));
char* data = item->data;
@@ -182,12 +188,8 @@
item->data = update;
item->length = new_length;
- printdata("new data: ", item->data, item->length);
+ DEBUG(printdata("new data: ", item->data, item->length));
- gossip_do(MASK_ADTS, lru_table_printf("%s", table));
-
- free(data);
-
return true;
}
@@ -316,6 +318,25 @@
}
*/
+/**
+ @param format specifies the output format for the data items
+ */
+void
+lru_table_printdata(char* format, struct lru_table* target)
+{
+ int i;
+ printf("LRU_TABLE(%i) \n{\n", target->size);
+ printf("LRU: ");
+ dpkm_list_printdata(target->lru);
+ for (i = 0; i < target->capacity; i++)
+ if (target->array[i]->size > 0)
+ {
+ printf(" %i: ", i);
+ dpkm_list_printdata(target->array[i]);
+ }
+ printf("}\n");
+}
+
/** Dump dpkm_list to string a la snprintf()
size must be greater than 2.
format specifies the output format for the data items
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 20:02:35
|
Revision: 58
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=58&view=rev
Author: jmwozniak
Date: 2010-04-29 20:02:28 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
cmpi/test04 -> manyputs
Added Paths:
-----------
test/cmpi/test-manyputs.c
test/cmpi/test-manyputs.zsh
Removed Paths:
-------------
test/cmpi/test04.c
test/cmpi/test04.zsh
Copied: test/cmpi/test-manyputs.c (from rev 57, test/cmpi/test04.c)
===================================================================
--- test/cmpi/test-manyputs.c (rev 0)
+++ test/cmpi/test-manyputs.c 2010-04-29 20:02:28 UTC (rev 58)
@@ -0,0 +1,51 @@
+
+/**
+ Store many small records.
+ The number of records is controlled by the
+ "reps" key in the CMPI cache.
+*/
+
+#include "test_helpers.h"
+
+/**
+ Requires that "reps" be in the CMPI params.
+ Generates keys for multiple clients.
+*/
+void
+cmpi_client_code()
+{
+ int i;
+
+ // Obtain the number of reps to perform:
+ char* s = cmpi_params_search("reps");
+ if (s == NULL || strlen(s) == 0)
+ {
+ NOTE("No reps given!");
+ exit(1);
+ }
+ int reps;
+ int n = sscanf(s, "%i", &reps);
+ assert(n > 0);
+
+ wait_for_notification();
+ notify_next();
+
+ for (i = 0; i < reps; i++)
+ {
+ char key[20];
+ sprintf(key, "key_%i_%i", mpi_rank, i);
+ char* value = useless_data(10);
+
+ cmpi_put(key, value, strlen(value)+1);
+ }
+
+ sleep((mpi_size-mpi_rank)*3+10);
+
+ int client_rank;
+ MPI_Comm_rank(cmpi_comm_clients, &client_rank);
+ if (client_rank == 0)
+ {
+ note("Shutting down...");
+ cmpi_shutdown();
+ }
+}
Property changes on: test/cmpi/test-manyputs.c
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: test/cmpi/test-manyputs.zsh (from rev 57, test/cmpi/test04.zsh)
===================================================================
--- test/cmpi/test-manyputs.zsh (rev 0)
+++ test/cmpi/test-manyputs.zsh 2010-04-29 20:02:28 UTC (rev 58)
@@ -0,0 +1,37 @@
+#!/bin/zsh
+
+# Be sure to make tests with D=1
+
+# set -x
+
+source tools/test-helpers.zsh
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+shift
+LAUNCH=${*}
+
+if (( USE_COMM_WORLD == 1 ))
+then
+
+ # Monolithic execution (5 nodes, 1 client):
+
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ CODE=$?
+ [[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+else
+
+ # KDA-2B execution:
+
+ tools/startup_nodes.zsh $(( N-1 )) 100 &
+ mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ sleep $(( N+15 ))
+
+fi
+
+# Should be 6 "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == 6 )) || crash "N != 6"
+
+exit 0
Property changes on: test/cmpi/test-manyputs.zsh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mergeinfo
+
Deleted: test/cmpi/test04.c
===================================================================
--- test/cmpi/test04.c 2010-04-29 20:01:28 UTC (rev 57)
+++ test/cmpi/test04.c 2010-04-29 20:02:28 UTC (rev 58)
@@ -1,51 +0,0 @@
-
-/**
- Store many small records.
- The number of records is controlled by the
- "reps" key in the CMPI cache.
-*/
-
-#include "test_helpers.h"
-
-/**
- Requires that "reps" be in the CMPI params.
- Generates keys for multiple clients.
-*/
-void
-cmpi_client_code()
-{
- int i;
-
- // Obtain the number of reps to perform:
- char* s = cmpi_params_search("reps");
- if (s == NULL || strlen(s) == 0)
- {
- NOTE("No reps given!");
- exit(1);
- }
- int reps;
- int n = sscanf(s, "%i", &reps);
- assert(n > 0);
-
- wait_for_notification();
- notify_next();
-
- for (i = 0; i < reps; i++)
- {
- char key[20];
- sprintf(key, "key_%i_%i", mpi_rank, i);
- char* value = useless_data(10);
-
- cmpi_put(key, value, strlen(value)+1);
- }
-
- sleep((mpi_size-mpi_rank)*3+10);
-
- int client_rank;
- MPI_Comm_rank(cmpi_comm_clients, &client_rank);
- if (client_rank == 0)
- {
- note("Shutting down...");
- cmpi_shutdown();
- }
-}
Deleted: test/cmpi/test04.zsh
===================================================================
--- test/cmpi/test04.zsh 2010-04-29 20:01:28 UTC (rev 57)
+++ test/cmpi/test04.zsh 2010-04-29 20:02:28 UTC (rev 58)
@@ -1,37 +0,0 @@
-#!/bin/zsh
-
-# Be sure to make tests with D=1
-
-# set -x
-
-source tools/test-helpers.zsh
-
-PROGRAM=$1
-OUT=${PROGRAM%.x}.out
-shift
-LAUNCH=${*}
-
-if (( USE_COMM_WORLD == 1 ))
-then
-
- # Monolithic execution (5 nodes, 1 client):
-
- mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
- CODE=$?
- [[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-
-else
-
- # KDA-2B execution:
-
- tools/startup_nodes.zsh $(( N-1 )) 100 &
- mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
- sleep $(( N+15 ))
-
-fi
-
-# Should be 6 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
-(( N == 6 )) || crash "N != 6"
-
-exit 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 20:01:34
|
Revision: 57
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=57&view=rev
Author: jmwozniak
Date: 2010-04-29 20:01:28 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
test/cmpi/test04 works.
Modified Paths:
--------------
src/cmpi/node.c
test/cmpi/About.txt
test/cmpi/test04.c
test/cmpi/test04.zsh
tools/test-helpers.zsh
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2010-04-29 19:24:21 UTC (rev 56)
+++ src/cmpi/node.c 2010-04-29 20:01:28 UTC (rev 57)
@@ -77,7 +77,7 @@
p = strchr(optarg, '=');
if (p == NULL)
{
- printf("Got bad -p argument! \n");
+ printf("Got bad -p argument! \n\n");
exit(EXIT_FAILURE);
}
*p = ' ';
Modified: test/cmpi/About.txt
===================================================================
--- test/cmpi/About.txt 2010-04-29 19:24:21 UTC (rev 56)
+++ test/cmpi/About.txt 2010-04-29 20:01:28 UTC (rev 57)
@@ -13,3 +13,4 @@
test-putget: Small put() + get().
test04: multiple put() + get().
test05: put() + update() + get().
+test06:
Modified: test/cmpi/test04.c
===================================================================
--- test/cmpi/test04.c 2010-04-29 19:24:21 UTC (rev 56)
+++ test/cmpi/test04.c 2010-04-29 20:01:28 UTC (rev 57)
@@ -2,34 +2,34 @@
/**
Store many small records.
The number of records is controlled by the
- "reps" key in the CMPI cache.
+ "reps" key in the CMPI cache.
*/
-#include "test_helpers.h"
+#include "test_helpers.h"
/**
Requires that "reps" be in the CMPI params.
- Generates keys for multiple clients.
+ Generates keys for multiple clients.
*/
void
cmpi_client_code()
{
int i;
- // Obtain the number of reps to perform:
+ // Obtain the number of reps to perform:
char* s = cmpi_params_search("reps");
if (s == NULL || strlen(s) == 0)
{
NOTE("No reps given!");
- exit(1);
+ exit(1);
}
int reps;
int n = sscanf(s, "%i", &reps);
- assert(n > 0);
+ assert(n > 0);
wait_for_notification();
- notify_next();
-
+ notify_next();
+
for (i = 0; i < reps; i++)
{
char key[20];
@@ -39,13 +39,13 @@
cmpi_put(key, value, strlen(value)+1);
}
- sleep((mpi_size-mpi_rank)*3+10);
+ sleep((mpi_size-mpi_rank)*3+10);
int client_rank;
MPI_Comm_rank(cmpi_comm_clients, &client_rank);
if (client_rank == 0)
{
- note("Shutting down...");
+ note("Shutting down...");
cmpi_shutdown();
}
}
Modified: test/cmpi/test04.zsh
===================================================================
--- test/cmpi/test04.zsh 2010-04-29 19:24:21 UTC (rev 56)
+++ test/cmpi/test04.zsh 2010-04-29 20:01:28 UTC (rev 57)
@@ -1,13 +1,37 @@
-#!/bin/zsh
+#!/bin/zsh
-N=$1
+# Be sure to make tests with D=1
-[[ $N == "" ]] && N=4
+# set -x
-# tools/startup_nodes.zsh ${N} 100 &
+source tools/test-helpers.zsh
-# sleep $(( N+15 ))
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+shift
+LAUNCH=${*}
-# KDA-1 execution:
-mpiexec -n ${N} test/cmpi/test04.x -n $(( N-1 )) >& test/cmpi/test04.out
+if (( USE_COMM_WORLD == 1 ))
+then
+ # Monolithic execution (5 nodes, 1 client):
+
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ CODE=$?
+ [[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+else
+
+ # KDA-2B execution:
+
+ tools/startup_nodes.zsh $(( N-1 )) 100 &
+ mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ sleep $(( N+15 ))
+
+fi
+
+# Should be 6 "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == 6 )) || crash "N != 6"
+
+exit 0
Modified: tools/test-helpers.zsh
===================================================================
--- tools/test-helpers.zsh 2010-04-29 19:24:21 UTC (rev 56)
+++ tools/test-helpers.zsh 2010-04-29 20:01:28 UTC (rev 57)
@@ -6,6 +6,6 @@
crash()
{
print $1
- mv ${OUT} ${OUT}.failed
+ mv -v ${OUT} ${OUT}.failed
exit 1
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 19:24:27
|
Revision: 56
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=56&view=rev
Author: jmwozniak
Date: 2010-04-29 19:24:21 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Rename docbook -> manual.
Added Paths:
-----------
docs/manual/
docs/manual/Makefile
docs/manual/formatting/
docs/manual/manual.xml
docs/manual/sf-post.zsh
Removed Paths:
-------------
docs/docbook/
docs/manual/Makefile
docs/manual/formatting/
docs/manual/manual.xml
docs/manual/sf-post.zsh
Property changes on: docs/manual
___________________________________________________________________
Added: svn:ignore
+ fop
manual.html
index.html
Added: svn:mergeinfo
+
Deleted: docs/manual/Makefile
===================================================================
--- docs/docbook/Makefile 2010-04-29 19:22:00 UTC (rev 55)
+++ docs/manual/Makefile 2010-04-29 19:24:21 UTC (rev 56)
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-all: htmls
-# phps pdfs
-
-# phps: userguide.php
-
-htmls: manual.html
-
-# pdfs: userguide.pdf
-
-# chunked-userguide: userguide.xml
-# ./build-chunked-userguide.sh
-
-%.php: %.xml formatting/swiftsh_html.xsl
- xsltproc --nonet formatting/swiftsh_html.xsl $<
- sed -e "s/index.html#/#/g" index.html >$@
-
-#%.pdf: %.xml formatting/vdl2_fo.xsl
-# fop/fop -xsl formatting/vdl2_fo.xsl -xml $< -pdf $@
-
-%.html: %.php
- cp $< $@
Copied: docs/manual/Makefile (from rev 52, docs/docbook/Makefile)
===================================================================
--- docs/manual/Makefile (rev 0)
+++ docs/manual/Makefile 2010-04-29 19:24:21 UTC (rev 56)
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+all: htmls
+# phps pdfs
+
+# phps: userguide.php
+
+htmls: manual.html
+
+# pdfs: userguide.pdf
+
+# chunked-userguide: userguide.xml
+# ./build-chunked-userguide.sh
+
+%.php: %.xml formatting/swiftsh_html.xsl
+ xsltproc --nonet formatting/swiftsh_html.xsl $<
+ sed -e "s/index.html#/#/g" index.html >$@
+
+#%.pdf: %.xml formatting/vdl2_fo.xsl
+# fop/fop -xsl formatting/vdl2_fo.xsl -xml $< -pdf $@
+
+%.html: %.php
+ cp $< $@
Deleted: docs/manual/manual.xml
===================================================================
--- docs/docbook/manual.xml 2010-04-29 19:22:00 UTC (rev 55)
+++ docs/manual/manual.xml 2010-04-29 19:24:21 UTC (rev 56)
@@ -1,371 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [] >
-
-<article>
- <articleinfo revision="0.1">
- <title>C-MPI User Guide</title>
- <subtitle>Content-MPI</subtitle>
- </articleinfo>
-
- <section id="overview">
- <title>Overview</title>
- <para>
- This manual provides reference material for the Content-MPI
- (C-MPI) DHT.
- </para>
- <para>
- C-MPI provides a key/value store for distributed computing
- over MPI.
- </para>
- </section>
-
- <section id="usecases">
- <title>Use Cases</title>
- <section><title>MPI Library</title>
- <para>
- C-MPI can be used as an MPI library:
- </para>
-
- <programlisting> <![CDATA[
-
- #include <cmpi.h>
-
- int main(int argc, char* argv[])
- {
- int mpi_rank;
- int mpi_size;
- char key[10];
- char value[30];
- int length;
- char* result;
-
- MPI_Init(&argc, &argv);
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- MPI_Comm_size(MPI_COMM_WORLD, &size);
-
- cmpi_init();
-
- sprintf(key, "key_%i", mpi_rank);
- sprintf(value, "value_%i", mpi_rank);
- cmpi_put(key, value, strlen(value)+1);
-
- rank = (mpi_rank+1)%mpi_size;
- sprintf(key, "key_%i", rank);
- cmpi_get(key, &result, &length);
- printf("result(%i): %s\n", length, result);
-
- MPI_Finalize();
-
- cmpi_cleanup();
- }
- ]]>
- </programlisting>
- </section>
- </section>
-
- <section id="mpirpc">
- <title>MPI-RPC</title>
-
- <section><title>Overview</title>
- <para>
- The MPIRPC component is used to allow the user to
- issue multiple asynchronous requests in one thread
- from a higher-level, RPC, event-driven model.
- </para>
- </section>
-
- <section><title>Definitions</title>
- <para>
- <variablelist>
- <varlistentry>
- <term>MPIRPC object</term>
- <listitem><para>Created by an MPIRPC call.
- Can be waited on.
- On call completion, this is passed to the proceed-function.
- Contains the result of the call on completion.
- Must be freed by the user with MPIRPC_Free().
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>proceed-function</term>
- <listitem><para>A user function pointer passed
- into an MPIRPC call.
- Called by MPIRPC on call completion with the MPIRPC object.
- </para></listitem>
- </varlistentry>
- </variablelist>
- </para>
- </section>
-
- <section><title>MPIRPC_Call</title>
- <para>
- MPIRPC_Call() creates an MPIRPC object and starts performing
- the RPC asynchronously. The MPIRPC object will contain the results
- of the call when complete.
-
- The arguments are:
-
- <variablelist>
- <varlistentry>
- <term>MPIRPC_Node target</term>
- <listitem><para>
- The target MPIRPC_Node.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>char* name</term>
- <listitem><para>
- Remote function name
- Copied into the MPIRPC object.
- Limited to MPIRPC_MAX_NAME (128) characters.
- May not be NULL.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>char* args</term>
- <listitem><para>
- Short NULL-terminated string for user
- control data arguments.
- Copied into the MPIRPC object.
- Limited to MPIRPC_MAX_ARGS (256) characters.
- May be NULL.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>void* extras</term>
- <listitem><para>
- Extra user state accessible by the proceed-function.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>void (*proceed)(MPIRPC*)</term>
- <listitem><para>
- The proceed-function.
- </para></listitem>
- </varlistentry>
- </variablelist>
- </para>
- </section>
-
- <section><title>The MPIRPC Object</title>
- <para>
- The MPIRPC object contains:
- <variablelist>
- <varlistentry>
- <term>MPIRPC_Node target</term>
- <listitem><para>
- The target MPIRPC_Node
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>status</term>
- <listitem><para>
- The status of the call:
- MPIRPC_STATUS_PROTO, MPIRPC_STATUS_CALLED,
- or MPIRPC_STATUS_RETURNED.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>char[] name</term>
- <listitem><para>
- Copy of the remote procedure name.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>char[] args</term>
- <listitem><para>
- Copy of the user argument string.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>char* blob</term>
- <listitem><para>
- Pointer to the user data blob.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>int blob_length</term>
- <listitem><para>
- Length of the user data blob.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>void* result</term>
- <listitem><para>
- Pointer to result data returned by remote procedure
- in fresh storage.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>int result_length</term>
- <listitem><para>
- Length of result data.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>void* extras</term>
- <listitem><para>
- Extra user pointer useful for proceed-function.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>int unique</term>
- <listitem><para>
- Internal uniquifier.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>bool cancelled</term>
- <listitem><para>
- Not yet used.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>MPIRPC_Node target</term>
- <listitem><para>
- The target MPIRPC_Node
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>MPI_Request request[]</term>
- <listitem><para>
- Internal MPI objects.
- Released by MPIRPC_Free().
- </para></listitem>
- </varlistentry>
- </variablelist>
- </para>
- </section>
- </section>
-
- <section id="cmpi">
- <title>C-MPI</title>
-
- <section><title>Overview</title>
- <para>
- C-MPI is intended to be an easy to use MPI-based
- distributed key/value store.
- </para>
- </section>
-
- <section><title>API</title>
- <para>
- The C-MPI API:
-
- <variablelist>
- <varlistentry>
- <term>cmpi_init()</term>
- <listitem><para>
- Initialize C-MPI.
- The user must first call MPI_Init() and MPIRPC_Init().
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>cmpi_put()</term>
- <listitem><para>
- Post a key/value pair in C-MPI.
- </para>
- <para>
- Arguments:
- <variablelist>
- <varlistentry>
- <term>char* key</term>
- <listitem><para>
- NULL-terminated string key.
- Passed as the args argument to MPIRPC_Call_blob().
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>void* value</term>
- <listitem><para>
- Variable-length user data.
- Passed as the blob argument to MPIRPC_Call_blob().
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>int length</term>
- <listitem><para>
- Byte-length of value.
- </para></listitem>
- </varlistentry>
- </variablelist>
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>cmpi_update()</term>
- <listitem><para>
- Update the value of a key/value pair in C-MPI.
- </para>
- <para>
- Arguments:
- <variablelist>
- <varlistentry>
- <term>char* key</term>
- <listitem><para>
- NULL-terminated string key.
- Passed as the args argument to MPIRPC_Call_blob().
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>void* value</term>
- <listitem><para>
- Variable-length user data.
- Passed as the blob argument to MPIRPC_Call_blob().
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>int length</term>
- <listitem><para>
- Byte-length of value.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>int offset</term>
- <listitem><para>
- At which point to begin overwrite.
- Offset+length may exceed the original value length.
- The key/value pair need not originally exist,
- but if it does not, the offset must be 0.
- </para></listitem>
- </varlistentry>
- </variablelist>
- </para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term>cmpi_get()</term>
- <listitem><para>
- Extract the value of a key/value pair into fresh storage.
- </para>
- <para>
- Arguments:
- <variablelist>
- <varlistentry>
- <term>char* key</term>
- <listitem><para>
- NULL-terminated string key.
- Passed as the args argument to MPIRPC_Call_blob().
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>void** result</term>
- <listitem><para>
- Will be set to the location of the extracted data in
- fresh storage.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term>int* length</term>
- <listitem><para>
- Will be set to the length of the extracted data.
- </para></listitem>
- </varlistentry>
- </variablelist>
- </para></listitem>
- </varlistentry>
- </variablelist>
- </para>
- </section>
- </section>
-</article>
Copied: docs/manual/manual.xml (from rev 52, docs/docbook/manual.xml)
===================================================================
--- docs/manual/manual.xml (rev 0)
+++ docs/manual/manual.xml 2010-04-29 19:24:21 UTC (rev 56)
@@ -0,0 +1,371 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [] >
+
+<article>
+ <articleinfo revision="0.1">
+ <title>C-MPI User Guide</title>
+ <subtitle>Content-MPI</subtitle>
+ </articleinfo>
+
+ <section id="overview">
+ <title>Overview</title>
+ <para>
+ This manual provides reference material for the Content-MPI
+ (C-MPI) DHT.
+ </para>
+ <para>
+ C-MPI provides a key/value store for distributed computing
+ over MPI.
+ </para>
+ </section>
+
+ <section id="usecases">
+ <title>Use Cases</title>
+ <section><title>MPI Library</title>
+ <para>
+ C-MPI can be used as an MPI library:
+ </para>
+
+ <programlisting> <![CDATA[
+
+ #include <cmpi.h>
+
+ int main(int argc, char* argv[])
+ {
+ int mpi_rank;
+ int mpi_size;
+ char key[10];
+ char value[30];
+ int length;
+ char* result;
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+
+ cmpi_init();
+
+ sprintf(key, "key_%i", mpi_rank);
+ sprintf(value, "value_%i", mpi_rank);
+ cmpi_put(key, value, strlen(value)+1);
+
+ rank = (mpi_rank+1)%mpi_size;
+ sprintf(key, "key_%i", rank);
+ cmpi_get(key, &result, &length);
+ printf("result(%i): %s\n", length, result);
+
+ MPI_Finalize();
+
+ cmpi_cleanup();
+ }
+ ]]>
+ </programlisting>
+ </section>
+ </section>
+
+ <section id="mpirpc">
+ <title>MPI-RPC</title>
+
+ <section><title>Overview</title>
+ <para>
+ The MPIRPC component is used to allow the user to
+ issue multiple asynchronous requests in one thread
+ from a higher-level, RPC, event-driven model.
+ </para>
+ </section>
+
+ <section><title>Definitions</title>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term>MPIRPC object</term>
+ <listitem><para>Created by an MPIRPC call.
+ Can be waited on.
+ On call completion, this is passed to the proceed-function.
+ Contains the result of the call on completion.
+ Must be freed by the user with MPIRPC_Free().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>proceed-function</term>
+ <listitem><para>A user function pointer passed
+ into an MPIRPC call.
+ Called by MPIRPC on call completion with the MPIRPC object.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </section>
+
+ <section><title>MPIRPC_Call</title>
+ <para>
+ MPIRPC_Call() creates an MPIRPC object and starts performing
+ the RPC asynchronously. The MPIRPC object will contain the results
+ of the call when complete.
+
+ The arguments are:
+
+ <variablelist>
+ <varlistentry>
+ <term>MPIRPC_Node target</term>
+ <listitem><para>
+ The target MPIRPC_Node.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>char* name</term>
+ <listitem><para>
+ Remote function name
+ Copied into the MPIRPC object.
+ Limited to MPIRPC_MAX_NAME (128) characters.
+ May not be NULL.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>char* args</term>
+ <listitem><para>
+ Short NULL-terminated string for user
+ control data arguments.
+ Copied into the MPIRPC object.
+ Limited to MPIRPC_MAX_ARGS (256) characters.
+ May be NULL.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void* extras</term>
+ <listitem><para>
+ Extra user state accessible by the proceed-function.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void (*proceed)(MPIRPC*)</term>
+ <listitem><para>
+ The proceed-function.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </section>
+
+ <section><title>The MPIRPC Object</title>
+ <para>
+ The MPIRPC object contains:
+ <variablelist>
+ <varlistentry>
+ <term>MPIRPC_Node target</term>
+ <listitem><para>
+ The target MPIRPC_Node
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>status</term>
+ <listitem><para>
+ The status of the call:
+ MPIRPC_STATUS_PROTO, MPIRPC_STATUS_CALLED,
+ or MPIRPC_STATUS_RETURNED.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>char[] name</term>
+ <listitem><para>
+ Copy of the remote procedure name.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>char[] args</term>
+ <listitem><para>
+ Copy of the user argument string.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>char* blob</term>
+ <listitem><para>
+ Pointer to the user data blob.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int blob_length</term>
+ <listitem><para>
+ Length of the user data blob.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void* result</term>
+ <listitem><para>
+ Pointer to result data returned by remote procedure
+ in fresh storage.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int result_length</term>
+ <listitem><para>
+ Length of result data.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void* extras</term>
+ <listitem><para>
+ Extra user pointer useful for proceed-function.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int unique</term>
+ <listitem><para>
+ Internal uniquifier.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>bool cancelled</term>
+ <listitem><para>
+ Not yet used.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>MPIRPC_Node target</term>
+ <listitem><para>
+ The target MPIRPC_Node
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>MPI_Request request[]</term>
+ <listitem><para>
+ Internal MPI objects.
+ Released by MPIRPC_Free().
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </section>
+ </section>
+
+ <section id="cmpi">
+ <title>C-MPI</title>
+
+ <section><title>Overview</title>
+ <para>
+ C-MPI is intended to be an easy to use MPI-based
+ distributed key/value store.
+ </para>
+ </section>
+
+ <section><title>API</title>
+ <para>
+ The C-MPI API:
+
+ <variablelist>
+ <varlistentry>
+ <term>cmpi_init()</term>
+ <listitem><para>
+ Initialize C-MPI.
+ The user must first call MPI_Init() and MPIRPC_Init().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>cmpi_put()</term>
+ <listitem><para>
+ Post a key/value pair in C-MPI.
+ </para>
+ <para>
+ Arguments:
+ <variablelist>
+ <varlistentry>
+ <term>char* key</term>
+ <listitem><para>
+ NULL-terminated string key.
+ Passed as the args argument to MPIRPC_Call_blob().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void* value</term>
+ <listitem><para>
+ Variable-length user data.
+ Passed as the blob argument to MPIRPC_Call_blob().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int length</term>
+ <listitem><para>
+ Byte-length of value.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>cmpi_update()</term>
+ <listitem><para>
+ Update the value of a key/value pair in C-MPI.
+ </para>
+ <para>
+ Arguments:
+ <variablelist>
+ <varlistentry>
+ <term>char* key</term>
+ <listitem><para>
+ NULL-terminated string key.
+ Passed as the args argument to MPIRPC_Call_blob().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void* value</term>
+ <listitem><para>
+ Variable-length user data.
+ Passed as the blob argument to MPIRPC_Call_blob().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int length</term>
+ <listitem><para>
+ Byte-length of value.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int offset</term>
+ <listitem><para>
+ At which point to begin overwrite.
+ Offset+length may exceed the original value length.
+ The key/value pair need not originally exist,
+ but if it does not, the offset must be 0.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>cmpi_get()</term>
+ <listitem><para>
+ Extract the value of a key/value pair into fresh storage.
+ </para>
+ <para>
+ Arguments:
+ <variablelist>
+ <varlistentry>
+ <term>char* key</term>
+ <listitem><para>
+ NULL-terminated string key.
+ Passed as the args argument to MPIRPC_Call_blob().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void** result</term>
+ <listitem><para>
+ Will be set to the location of the extracted data in
+ fresh storage.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int* length</term>
+ <listitem><para>
+ Will be set to the length of the extracted data.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </section>
+ </section>
+</article>
Deleted: docs/manual/sf-post.zsh
===================================================================
--- docs/docbook/sf-post.zsh 2010-04-29 19:22:00 UTC (rev 55)
+++ docs/manual/sf-post.zsh 2010-04-29 19:24:21 UTC (rev 56)
@@ -1,8 +0,0 @@
-#!/bin/zsh
-
-# Post HTML to SourceForge
-
-USER=$1
-
-HTML=( index.html manual.html )
-scp ${HTML} ${USER},c-...@we...:htdocs
Copied: docs/manual/sf-post.zsh (from rev 52, docs/docbook/sf-post.zsh)
===================================================================
--- docs/manual/sf-post.zsh (rev 0)
+++ docs/manual/sf-post.zsh 2010-04-29 19:24:21 UTC (rev 56)
@@ -0,0 +1,8 @@
+#!/bin/zsh
+
+# Post HTML to SourceForge
+
+USER=$1
+
+HTML=( index.html manual.html )
+scp ${HTML} ${USER},c-...@we...:htdocs
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 19:22:06
|
Revision: 55
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=55&view=rev
Author: jmwozniak
Date: 2010-04-29 19:22:00 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Ignore
Property Changed:
----------------
docs/docbook/
Property changes on: docs/docbook
___________________________________________________________________
Modified: svn:ignore
- manual.html index.html fop
+ fop
manual.html
index.html
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 19:19:43
|
Revision: 54
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=54&view=rev
Author: jmwozniak
Date: 2010-04-29 19:19:37 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Ignore
Property Changed:
----------------
docs/docbook/
Property changes on: docs/docbook
___________________________________________________________________
Modified: svn:ignore
- manual.html,index.html,fop
+ manual.html index.html fop
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 19:19:05
|
Revision: 53
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=53&view=rev
Author: jmwozniak
Date: 2010-04-29 19:18:59 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Ignore generated files and fop.
Property Changed:
----------------
docs/docbook/
Property changes on: docs/docbook
___________________________________________________________________
Added: svn:ignore
+ manual.html,index.html,fop
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 19:17:36
|
Revision: 52
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=52&view=rev
Author: jmwozniak
Date: 2010-04-29 19:17:30 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Ignore docbook package.
Property Changed:
----------------
docs/docbook/formatting/
Property changes on: docs/docbook/formatting
___________________________________________________________________
Added: svn:ignore
+ docbook
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 19:16:23
|
Revision: 51
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=51&view=rev
Author: jmwozniak
Date: 2010-04-29 19:16:17 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Manual, Makefile, and XSL.
Added Paths:
-----------
docs/docbook/Makefile
docs/docbook/formatting/
docs/docbook/formatting/swift_html.xsl
docs/docbook/formatting/swiftsh_html.xsl
docs/docbook/formatting/swiftsh_html_chunked.xsl
docs/docbook/formatting/vdl2_fo.xsl
docs/docbook/manual.xml
Added: docs/docbook/Makefile
===================================================================
--- docs/docbook/Makefile (rev 0)
+++ docs/docbook/Makefile 2010-04-29 19:16:17 UTC (rev 51)
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+all: htmls
+# phps pdfs
+
+# phps: userguide.php
+
+htmls: manual.html
+
+# pdfs: userguide.pdf
+
+# chunked-userguide: userguide.xml
+# ./build-chunked-userguide.sh
+
+%.php: %.xml formatting/swiftsh_html.xsl
+ xsltproc --nonet formatting/swiftsh_html.xsl $<
+ sed -e "s/index.html#/#/g" index.html >$@
+
+#%.pdf: %.xml formatting/vdl2_fo.xsl
+# fop/fop -xsl formatting/vdl2_fo.xsl -xml $< -pdf $@
+
+%.html: %.php
+ cp $< $@
Added: docs/docbook/formatting/swift_html.xsl
===================================================================
--- docs/docbook/formatting/swift_html.xsl (rev 0)
+++ docs/docbook/formatting/swift_html.xsl 2010-04-29 19:16:17 UTC (rev 51)
@@ -0,0 +1,256 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <!-- Which DocBook standard xsl file should we use as the default? -->
+ <!-- Well, xsltproc doesn't cache the xsl files fetched over the web, so better use a local copy -->
+ <xsl:import href="docbook/html/chunk.xsl"/>
+ <!--<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>-->
+ <!--
+
+ testing: if you want to generate your own html without installing
+ stylesheets, substitute the following url for the import href above:
+ http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
+
+ -->
+ <!-- speed up the chunking process? -->
+ <xsl:param name="chunk.fast">1</xsl:param>
+
+ <!--
+ Use graphics in admonitions? like 'warnings' 'important' 'note' etc
+ -->
+ <xsl:param name="admon.graphics">1</xsl:param>
+ <!-- Set path to admonition graphics -->
+ <xsl:param name="admon.graphics.path">/docbook-images/</xsl:param>
+ <!--
+
+ Set path to docbook graphics (testing)
+ <xsl:param name="admon.graphics.path">file:///Z:/testing/alliance/docbook-images/</xsl:param>
+
+ -->
+ <!--
+ Again, if 1 above, what is the filename extension for admon graphics?
+ -->
+ <xsl:param name="admon.graphics.extension" select="'.gif'"/>
+ <!-- Set path to callout graphics -->
+
+ <xsl:param name="callout.graphics.path">/docbook-images/</xsl:param>
+ <!-- Depth to which sections should be chunked -->
+ <xsl:param name="chunk.section.depth">0</xsl:param>
+
+ <!--
+
+ Are parts automatically enumerated?
+ <xsl:param name="part.autolabel">0</xsl:param>
+
+ -->
+ <!-- Are chapters automatically enumerated? -->
+ <xsl:param name="chapter.autolabel">0</xsl:param>
+ <!-- Are sections enumerated? -->
+ <xsl:param name="section.autolabel">1</xsl:param>
+ <!-- how deep should each toc be? (how many levels?) -->
+ <xsl:param name="toc.max.depth">2</xsl:param>
+ <!--
+ How deep should recursive sections appear in the TOC for chapters?
+ -->
+ <xsl:param name="toc.section.depth">4</xsl:param>
+ <!--
+ Should the first section be chunked separately from its parent? > 0 = yes
+ -->
+ <xsl:param name="chunk.first.sections">1</xsl:param>
+ <!--
+
+ Instead of using default filenames, use ids for filenames (dbhtml
+ directives take precedence) taking this out to avoid breaking any
+ current bookmarks
+
+ <xsl:param name="use.id.as.filename">1</xsl:param>
+
+ -->
+ <!-- custom toc - book only shows chapter -->
+ <xsl:template match="preface|chapter|appendix|article" mode="toc">
+ <xsl:param name="toc-context" select="."/>
+
+ <xsl:choose>
+ <xsl:when test="local-name($toc-context) = 'book'">
+ <xsl:call-template name="subtoc">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ <xsl:with-param name="nodes" select="foo"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="subtoc">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ <xsl:with-param name="nodes" select="section|sect1|glossary|bibliography|index |bridgehead[$bridgehead.in.toc != 0]"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- INDEX PARAMETERS -->
+ <!-- do you want an index? -->
+ <xsl:param name="generate.index">1</xsl:param>
+ <!-- Select indexterms based on type attribute value -->
+ <xsl:param name="index.on.type">1</xsl:param>
+ <!-- GLOSSARY PARAMETERS -->
+ <!-- Display glossentry acronyms? -->
+ <xsl:param name="glossentry.show.acronym">yes</xsl:param>
+
+ <!--
+
+ Name of the glossary collection file
+
+ <xsl:param name="glossary.collection" select="'glossary.xml'"></xsl:param>
+
+ -->
+
+ <!--
+ Generate links from glossterm to glossentry automatically?
+
+ <xsl:param name="glossterm.auto.link">1</xsl:param>
+
+ -->
+
+ <!--
+
+ if non-zero value for previous parameter, does automatic glossterm
+ linking only apply to firstterms?
+
+ <xsl:param name="firstterm.only.link">1</xsl:param>
+ -->
+
+ <!--
+
+ permit wrapping of long lines of code
+
+ <xsl:attribute-set name="monospace.verbatim.properties"
+ use-attribute-sets="verbatim.properties monospace.properties">
+
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
+ </xsl:attribute-set>
+ -->
+
+ <!-- INCORPORATING DOCBOOK PAGES INTO WEBSITE -->
+
+ <!--
+ make sure there's a DOCTYPE in the html output (otherwise, some css renders strangely
+ -->
+ <xsl:param name="chunker.output.doctype-public" select="'-//W3C//DTD HTML 4.01 Transitional//EN'"/>
+ <xsl:param name="chunker.output.doctype-system" select="'http://www.w3.org/TR/html4/loose.dtd'"/>
+ <!-- add elements to the HEAD tag -->
+
+ <xsl:template name="user.head.content">
+ <link href="../css/style1col.css" rel="stylesheet" type="text/css" />
+ </xsl:template>
+
+ <!-- add an attribute to the BODY tag -->
+
+ <xsl:template name="body.attributes">
+ <xsl:attribute name="class">section-3</xsl:attribute>
+ </xsl:template>
+
+ <!--
+ pull in 'website' with this code by modifying chunk-element-content from html/chunk-common.xsl
+ -->
+
+ <xsl:template name="chunk-element-content">
+ <xsl:param name="prev"/>
+ <xsl:param name="next"/>
+ <xsl:param name="nav.context"/>
+ <xsl:param name="content">
+ <xsl:apply-imports/>
+ </xsl:param>
+
+ <xsl:call-template name="user.preroot"/>
+
+ <html>
+
+ <xsl:call-template name="html.head">
+ <xsl:with-param name="prev" select="$prev"/>
+ <xsl:with-param name="next" select="$next"/>
+ </xsl:call-template>
+
+ <body>
+ <xsl:call-template name="body.attributes"/>
+
+ <xsl:call-template name="user.header.navigation"/>
+
+ <xsl:call-template name="user.header.content"/>
+
+ <xsl:copy-of select="$content"/>
+
+ <xsl:call-template name="user.footer.content"/>
+
+ <xsl:call-template name="user.footer.navigation"/>
+
+ <!-- for google analytics -->
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+try {var pageTracker = _gat._getTracker("UA-106257-5");
+pageTracker._trackPageview();
+} catch(err) {}</script>
+
+
+ </body>
+ </html>
+ </xsl:template>
+
+ <!--
+ prevent h1 and h2 using clear: both - want to control in css, instead
+ -->
+
+ <xsl:template name="section.heading">
+ <xsl:param name="section" select="."/>
+ <xsl:param name="level" select="'1'"/>
+ <xsl:param name="title"/>
+
+ <xsl:element name="h{$level+1}">
+ <xsl:attribute name="class">title</xsl:attribute>
+
+ <a>
+ <xsl:attribute name="name">
+ <xsl:call-template name="object.id">
+ <xsl:with-param name="object" select="$section"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </a>
+
+ <xsl:copy-of select="$title"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template name="user.header.content">
+ <xsl:text disable-output-escaping="yes"><![CDATA[
+
+ <!-- entire page container -->
+ <div id="container">
+ <!-- header -->
+ <div id="header">
+ <?php require('../inc/header.php') ?>
+ </div>
+ <!-- end header -->
+ <!-- nav -->
+ <div id="nav">
+ <?php require('../inc/nav.php') ?>
+ </div>
+ <!-- end nav -->
+ <!-- content container -->
+ <div id="content">
+ ]]>
+ </xsl:text>
+ </xsl:template>
+
+ <xsl:template name="user.footer.content">
+ <xsl:text disable-output-escaping="yes"><![CDATA[
+ </div>
+ <!-- end content container-->
+ <!-- footer -->
+ <div id="footer"><?php require('../inc/footer.php') ?></div>
+ <!-- end footer -->
+
+ </div>
+ <!-- end entire page container -->
+ ]]>
+ </xsl:text>
+ </xsl:template>
+</xsl:stylesheet>
Added: docs/docbook/formatting/swiftsh_html.xsl
===================================================================
--- docs/docbook/formatting/swiftsh_html.xsl (rev 0)
+++ docs/docbook/formatting/swiftsh_html.xsl 2010-04-29 19:16:17 UTC (rev 51)
@@ -0,0 +1,260 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <!-- Which DocBook standard xsl file should we use as the default? -->
+ <!-- Well, xsltproc doesn't cache the xsl files fetched over the web, so better use a local copy -->
+ <xsl:import href="docbook/html/chunk.xsl"/>
+ <!--<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>-->
+ <!--
+
+ testing: if you want to generate your own html without installing
+ stylesheets, substitute the following url for the import href above:
+ http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
+
+ -->
+ <!-- speed up the chunking process? -->
+ <xsl:param name="chunk.fast">1</xsl:param>
+
+ <!--
+ Use graphics in admonitions? like 'warnings' 'important' 'note' etc
+ -->
+ <xsl:param name="admon.graphics">1</xsl:param>
+ <!-- Set path to admonition graphics -->
+ <xsl:param name="admon.graphics.path">/docbook-images/</xsl:param>
+ <!--
+
+ Set path to docbook graphics (testing)
+ <xsl:param name="admon.graphics.path">file:///Z:/testing/alliance/docbook-images/</xsl:param>
+
+ -->
+ <!--
+ Again, if 1 above, what is the filename extension for admon graphics?
+ -->
+ <xsl:param name="admon.graphics.extension" select="'.gif'"/>
+ <!-- Set path to callout graphics -->
+
+ <xsl:param name="callout.graphics.path">/docbook-images/</xsl:param>
+ <!-- Depth to which sections should be chunked -->
+ <xsl:param name="chunk.section.depth">0</xsl:param>
+
+ <!--
+
+ Are parts automatically enumerated?
+ <xsl:param name="part.autolabel">0</xsl:param>
+
+ -->
+ <!-- Are chapters automatically enumerated? -->
+ <xsl:param name="chapter.autolabel">0</xsl:param>
+ <!-- Are sections enumerated? -->
+ <xsl:param name="section.autolabel">1</xsl:param>
+ <!-- how deep should each toc be? (how many levels?) -->
+ <xsl:param name="toc.max.depth">2</xsl:param>
+ <!--
+ How deep should recursive sections appear in the TOC for chapters?
+ -->
+ <xsl:param name="toc.section.depth">4</xsl:param>
+ <!--
+ Should the first section be chunked separately from its parent? > 0 = yes
+ -->
+ <xsl:param name="chunk.first.sections">1</xsl:param>
+ <!--
+
+ Instead of using default filenames, use ids for filenames (dbhtml
+ directives take precedence) taking this out to avoid breaking any
+ current bookmarks
+
+ <xsl:param name="use.id.as.filename">1</xsl:param>
+
+ -->
+ <!-- custom toc - book only shows chapter -->
+ <xsl:template match="preface|chapter|appendix|article" mode="toc">
+ <xsl:param name="toc-context" select="."/>
+
+ <xsl:choose>
+ <xsl:when test="local-name($toc-context) = 'book'">
+ <xsl:call-template name="subtoc">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ <xsl:with-param name="nodes" select="foo"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="subtoc">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ <xsl:with-param name="nodes" select="section|sect1|glossary|bibliography|index |bridgehead[$bridgehead.in.toc != 0]"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- INDEX PARAMETERS -->
+ <!-- do you want an index? -->
+ <xsl:param name="generate.index">1</xsl:param>
+ <!-- Select indexterms based on type attribute value -->
+ <xsl:param name="index.on.type">1</xsl:param>
+ <!-- GLOSSARY PARAMETERS -->
+ <!-- Display glossentry acronyms? -->
+ <xsl:param name="glossentry.show.acronym">yes</xsl:param>
+
+ <!--
+
+ Name of the glossary collection file
+
+ <xsl:param name="glossary.collection" select="'glossary.xml'"></xsl:param>
+
+ -->
+
+ <!--
+ Generate links from glossterm to glossentry automatically?
+
+ <xsl:param name="glossterm.auto.link">1</xsl:param>
+
+ -->
+
+ <!--
+
+ if non-zero value for previous parameter, does automatic glossterm
+ linking only apply to firstterms?
+
+ <xsl:param name="firstterm.only.link">1</xsl:param>
+ -->
+
+ <!--
+
+ permit wrapping of long lines of code
+
+ <xsl:attribute-set name="monospace.verbatim.properties"
+ use-attribute-sets="verbatim.properties monospace.properties">
+
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
+ </xsl:attribute-set>
+ -->
+
+ <!-- INCORPORATING DOCBOOK PAGES INTO WEBSITE -->
+
+ <!--
+ make sure there's a DOCTYPE in the html output (otherwise, some css renders strangely
+ -->
+ <xsl:param name="chunker.output.doctype-public" select="'-//W3C//DTD HTML 4.01 Transitional//EN'"/>
+ <xsl:param name="chunker.output.doctype-system" select="'http://www.w3.org/TR/html4/loose.dtd'"/>
+ <!-- add elements to the HEAD tag -->
+
+ <xsl:template name="user.head.content">
+ <link href="http://www.ci.uchicago.edu/swift/css/style1col.css" rel="stylesheet" type="text/css"/>
+ <script type="text/javascript" src="http://www.ci.uchicago.edu/swift/dhtml.js"></script>
+ <script type="text/javascript" src="http://www.ci.uchicago.edu/swift/shCoreu.js"></script>
+ <script type="text/javascript" src="http://www.ci.uchicago.edu/swift/shBrushVDL2.js"></script>
+ </xsl:template>
+
+ <!-- add an attribute to the BODY tag -->
+
+ <xsl:template name="body.attributes">
+ <xsl:attribute name="class">section-3</xsl:attribute>
+ </xsl:template>
+
+ <!--
+ pull in 'website' with this code by modifying chunk-element-content from html/chunk-common.xsl
+ -->
+
+ <xsl:template name="chunk-element-content">
+ <xsl:param name="prev"/>
+ <xsl:param name="next"/>
+ <xsl:param name="nav.context"/>
+ <xsl:param name="content">
+ <xsl:apply-imports/>
+ </xsl:param>
+
+ <xsl:call-template name="user.preroot"/>
+
+ <html>
+
+ <xsl:call-template name="html.head">
+ <xsl:with-param name="prev" select="$prev"/>
+ <xsl:with-param name="next" select="$next"/>
+ </xsl:call-template>
+
+ <body onLoad="initjs();sh();">
+ <xsl:call-template name="body.attributes"/>
+
+ <xsl:call-template name="user.header.navigation"/>
+
+ <xsl:call-template name="user.header.content"/>
+
+ <xsl:copy-of select="$content"/>
+
+ <xsl:call-template name="user.footer.content"/>
+
+ <xsl:call-template name="user.footer.navigation"/>
+
+ <!-- for google analytics -->
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+try {
+var pageTracker = _gat._getTracker("UA-106257-5");
+pageTracker._trackPageview();
+} catch(err) {}</script>
+
+ </body>
+ </html>
+ </xsl:template>
+
+ <!--
+ prevent h1 and h2 using clear: both - want to control in css, instead
+ -->
+
+ <xsl:template name="section.heading">
+ <xsl:param name="section" select="."/>
+ <xsl:param name="level" select="'1'"/>
+ <xsl:param name="title"/>
+
+ <xsl:element name="h{$level+1}">
+ <xsl:attribute name="class">title</xsl:attribute>
+
+ <a>
+ <xsl:attribute name="name">
+ <xsl:call-template name="object.id">
+ <xsl:with-param name="object" select="$section"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </a>
+
+ <xsl:copy-of select="$title"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template name="user.header.content">
+ <xsl:text disable-output-escaping="yes"><![CDATA[
+
+ <!-- entire page container -->
+ <div id="container">
+ <!-- header -->
+ <div id="header">
+ <?php require('/ci/www/projects/swift/inc/header.php') ?>
+ </div>
+ <!-- end header -->
+ <!-- nav -->
+ <div id="nav">
+ <?php require('/ci/www/projects/swift/inc/nav.php') ?>
+ </div>
+ <!-- end nav -->
+ <!-- content container -->
+ <div id="content">
+ ]]>
+ </xsl:text>
+ </xsl:template>
+
+ <xsl:template name="user.footer.content">
+ <xsl:text disable-output-escaping="yes"><![CDATA[
+ </div>
+ <!-- end content container-->
+ <!-- footer -->
+ <div id="footer"><?php require('/ci/www/projects/swift/inc/footer.php') ?></div>
+ <!-- end footer -->
+
+ </div>
+ <!-- end entire page container -->
+
+ ]]>
+ </xsl:text>
+ </xsl:template>
+</xsl:stylesheet>
Added: docs/docbook/formatting/swiftsh_html_chunked.xsl
===================================================================
--- docs/docbook/formatting/swiftsh_html_chunked.xsl (rev 0)
+++ docs/docbook/formatting/swiftsh_html_chunked.xsl 2010-04-29 19:16:17 UTC (rev 51)
@@ -0,0 +1,298 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <!-- Which DocBook standard xsl file should we use as the default? -->
+ <!-- Well, xsltproc doesn't cache the xsl files fetched over the web, so better use a local copy -->
+ <xsl:import href="docbook/html/chunk.xsl"/>
+ <xsl:param name="chunk.section.depth" select="1"></xsl:param>
+ <xsl:param name="use.id.as.filename" select="1"/>
+ <xsl:param name="html.ext">.php</xsl:param>
+
+
+ <!--<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>-->
+ <!--
+
+ testing: if you want to generate your own html without installing
+ stylesheets, substitute the following url for the import href above:
+ http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
+
+ -->
+ <!-- speed up the chunking process? -->
+ <xsl:param name="chunk.fast">1</xsl:param>
+
+ <!--
+ Use graphics in admonitions? like 'warnings' 'important' 'note' etc
+ -->
+ <xsl:param name="admon.graphics">1</xsl:param>
+ <!-- Set path to admonition graphics -->
+ <xsl:param name="admon.graphics.path">/docbook-images/</xsl:param>
+ <!--
+
+ Set path to docbook graphics (testing)
+ <xsl:param name="admon.graphics.path">file:///Z:/testing/alliance/docbook-images/</xsl:param>
+
+ -->
+ <!--
+ Again, if 1 above, what is the filename extension for admon graphics?
+ -->
+ <xsl:param name="admon.graphics.extension" select="'.gif'"/>
+ <!-- Set path to callout graphics -->
+
+ <xsl:param name="callout.graphics.path">/docbook-images/</xsl:param>
+ <!-- Depth to which sections should be chunked -->
+ <xsl:param name="chunk.section.depth">0</xsl:param>
+
+ <!--
+
+ Are parts automatically enumerated?
+ <xsl:param name="part.autolabel">0</xsl:param>
+
+ -->
+ <!-- Are chapters automatically enumerated? -->
+ <xsl:param name="chapter.autolabel">0</xsl:param>
+ <!-- Are sections enumerated? -->
+ <xsl:param name="section.autolabel">1</xsl:param>
+ <!-- how deep should each toc be? (how many levels?) -->
+ <xsl:param name="toc.max.depth">2</xsl:param>
+ <!--
+ How deep should recursive sections appear in the TOC for chapters?
+ -->
+ <xsl:param name="toc.section.depth">4</xsl:param>
+ <!--
+ Should the first section be chunked separately from its parent? > 0 = yes
+ -->
+ <xsl:param name="chunk.first.sections">1</xsl:param>
+ <!--
+
+ Instead of using default filenames, use ids for filenames (dbhtml
+ directives take precedence) taking this out to avoid breaking any
+ current bookmarks
+
+ <xsl:param name="use.id.as.filename">1</xsl:param>
+
+ -->
+ <!-- custom toc - book only shows chapter -->
+ <xsl:template match="preface|chapter|appendix|article" mode="toc">
+ <xsl:param name="toc-context" select="."/>
+
+ <xsl:choose>
+ <xsl:when test="local-name($toc-context) = 'book'">
+ <xsl:call-template name="subtoc">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ <xsl:with-param name="nodes" select="foo"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="subtoc">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ <xsl:with-param name="nodes" select="section|sect1|glossary|bibliography|index |bridgehead[$bridgehead.in.toc != 0]"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- INDEX PARAMETERS -->
+ <!-- do you want an index? -->
+ <xsl:param name="generate.index">1</xsl:param>
+ <!-- Select indexterms based on type attribute value -->
+ <xsl:param name="index.on.type">1</xsl:param>
+ <!-- GLOSSARY PARAMETERS -->
+ <!-- Display glossentry acronyms? -->
+ <xsl:param name="glossentry.show.acronym">yes</xsl:param>
+
+ <!--
+
+ Name of the glossary collection file
+
+ <xsl:param name="glossary.collection" select="'glossary.xml'"></xsl:param>
+
+ -->
+
+ <!--
+ Generate links from glossterm to glossentry automatically?
+
+ <xsl:param name="glossterm.auto.link">1</xsl:param>
+
+ -->
+
+ <!--
+
+ if non-zero value for previous parameter, does automatic glossterm
+ linking only apply to firstterms?
+
+ <xsl:param name="firstterm.only.link">1</xsl:param>
+ -->
+
+ <!--
+
+ permit wrapping of long lines of code
+
+ <xsl:attribute-set name="monospace.verbatim.properties"
+ use-attribute-sets="verbatim.properties monospace.properties">
+
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
+ </xsl:attribute-set>
+ -->
+
+ <!-- INCORPORATING DOCBOOK PAGES INTO WEBSITE -->
+
+ <!--
+ make sure there's a DOCTYPE in the html output (otherwise, some css renders strangely
+ -->
+ <xsl:param name="chunker.output.doctype-public" select="'-//W3C//DTD HTML 4.01 Transitional//EN'"/>
+ <xsl:param name="chunker.output.doctype-system" select="'http://www.w3.org/TR/html4/loose.dtd'"/>
+ <!-- add elements to the HEAD tag -->
+
+ <xsl:template name="user.head.content">
+ <link href="http://www.ci.uchicago.edu/swift/css/style1col.css" rel="stylesheet" type="text/css"/>
+ <script type="text/javascript" src="http://www.ci.uchicago.edu/swift/dhtml.js"></script>
+ <script type="text/javascript" src="http://www.ci.uchicago.edu/swift/shCoreu.js"></script>
+ <script type="text/javascript" src="http://www.ci.uchicago.edu/swift/shBrushVDL2.js"></script>
+ </xsl:template>
+
+ <!-- add an attribute to the BODY tag -->
+
+ <xsl:template name="body.attributes">
+ <xsl:attribute name="class">section-3</xsl:attribute>
+ </xsl:template>
+
+ <!--
+ pull in 'website' with this code by modifying chunk-element-content from html/chunk-common.xsl
+ -->
+
+ <xsl:template name="chunk-element-content">
+ <xsl:param name="prev"/>
+ <xsl:param name="next"/>
+ <xsl:param name="nav.context"/>
+ <xsl:param name="content">
+ <xsl:apply-imports/>
+ </xsl:param>
+
+ <xsl:call-template name="user.preroot"/>
+
+ <html>
+
+ <xsl:call-template name="html.head">
+ <xsl:with-param name="prev" select="$prev"/>
+ <xsl:with-param name="next" select="$next"/>
+ </xsl:call-template>
+
+ <body onLoad="initjs();sh();">
+ <xsl:call-template name="body.attributes"/>
+
+ <xsl:call-template name="user.header.navigation"/>
+ <xsl:call-template name="header.navigation">
+ <xsl:with-param name="prev" select="$prev"/>
+ <xsl:with-param name="next" select="$next"/>
+ <xsl:with-param name="nav.context" select="$nav.context"/>
+ </xsl:call-template>
+
+ <xsl:call-template name="user.header.content"/>
+ <xsl:call-template name="breadcrumbs" />
+ <xsl:copy-of select="$content"/>
+
+ <xsl:call-template name="user.footer.content"/>
+
+ <xsl:call-template name="footer.navigation">
+ <xsl:with-param name="prev" select="$prev"/>
+ <xsl:with-param name="next" select="$next"/>
+ <xsl:with-param name="nav.context" select="$nav.context"/>
+ </xsl:call-template>
+
+ <xsl:call-template name="user.footer.navigation"/>
+ <!-- for google analytics -->
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+try {var pageTracker = _gat._getTracker("UA-106257-5");
+pageTracker._trackPageview();
+} catch(err) {}</script>
+
+ </body>
+ </html>
+ </xsl:template>
+
+ <!--
+ prevent h1 and h2 using clear: both - want to control in css, instead
+ -->
+
+ <xsl:template name="section.heading">
+ <xsl:param name="section" select="."/>
+ <xsl:param name="level" select="'1'"/>
+ <xsl:param name="title"/>
+
+ <xsl:element name="h{$level+1}">
+ <xsl:attribute name="class">title</xsl:attribute>
+
+ <a>
+ <xsl:attribute name="name">
+ <xsl:call-template name="object.id">
+ <xsl:with-param name="object" select="$section"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </a>
+
+ <xsl:copy-of select="$title"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template name="user.header.navigation">
+ <xsl:text disable-output-escaping="yes"><![CDATA[
+
+ <!-- entire page container -->
+ <div id="container">
+ <!-- header -->
+ <div id="header">
+ <?php require('../../inc/header.php') ?>
+ </div>
+ <!-- end header -->
+ <!-- nav -->
+ <div id="nav">
+ <?php require('../../inc/nav.php') ?>
+ </div>
+ <!-- end nav -->
+ <!-- content container -->
+ <div id="content">
+ ]]>
+ </xsl:text>
+ </xsl:template>
+
+ <xsl:template name="user.footer.content">
+ <xsl:text disable-output-escaping="yes"><![CDATA[
+ </div>
+ <!-- end content container-->
+ <!-- footer -->
+ <div id="footer"><?php require('../../inc/footer.php') ?></div>
+ <!-- end footer -->
+
+ </div>
+ <!-- end entire page container -->
+
+ ]]>
+ </xsl:text>
+ </xsl:template>
+
+<xsl:template name="breadcrumbs">
+ <xsl:param name="this.node" select="."/>
+ <div class="breadcrumbs">
+ <xsl:for-each select="$this.node/ancestor::*">
+ <span class="breadcrumb-link">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:call-template name="href.target">
+ <xsl:with-param name="object" select="."/>
+ <xsl:with-param name="context" select="$this.node"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:apply-templates select="." mode="title.markup"/>
+ </a>
+ </span>
+ <xsl:text> > </xsl:text>
+ </xsl:for-each>
+ <!-- And display the current node, but not as a link -->
+ <span class="breadcrumb-node">
+ <xsl:apply-templates select="$this.node" mode="title.markup"/>
+ </span>
+ </div>
+</xsl:template>
+</xsl:stylesheet>
Added: docs/docbook/formatting/vdl2_fo.xsl
===================================================================
--- docs/docbook/formatting/vdl2_fo.xsl (rev 0)
+++ docs/docbook/formatting/vdl2_fo.xsl 2010-04-29 19:16:17 UTC (rev 51)
@@ -0,0 +1,111 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!--
+ now replace all these settings with those specific for use with the fo stylesheet (for pdf output)
+-->
+ <!--
+ just realized both html and fo can share many parameters - need to create common.xsl that gets imported to both so i can single source
+ those variables
+-->
+<!-- which stylesheet to use? -->
+<!--
+<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl"/>
+-->
+<xsl:import href="docbook/fo/docbook.xsl"/>
+
+<!-- enable extensions -->
+<xsl:param name="use.extensions" select="'0'"/>
+<xsl:param name="xep.extensions" select="0"/>
+ <!--
+ turn off table column extensions (unless you use xalan or saxon - it's a java thing
+-->
+<xsl:param name="tablecolumns.extension" select="'0'"/>
+<!-- should output be in draft mode? -->
+<xsl:param name="draft.mode" select="'no'"/>
+<!-- ALIGNMENT -->
+<xsl:param name="alignment">left</xsl:param>
+<!-- GRAPHICS -->
+ <!--
+ Use graphics in admonitions? like 'warnings' 'important' 'note' etc COMMON
+-->
+<xsl:param name="admon.graphics">1</xsl:param>
+<!-- Set path to admonition graphics COMMON -->
+<xsl:param name="admon.graphics.path">/www/www-unix.globus.org/docbook-images/</xsl:param>
+ <!--
+ Set path to docbook graphics (testing)
+ <xsl:param name="admon.graphics.path">file:///Z:/testing/alliance/docbook-images/</xsl:param>
+-->
+ <!--
+ Again, if 1 above, what is the filename extension for admon graphics?
+-->
+<xsl:param name="admon.graphics.extension" select="'.png'"/>
+ <!--
+ for some reason, xep makes the admon graphics too large, this scales them back down
+-->
+<xsl:template match="*" mode="admon.graphic.width">14pt</xsl:template>
+ <!--
+ Set path to callout graphics COMMON
+ <xsl:param name="callout.graphics.path">/www/www-unix.globus.org/docbook-images/callouts/</xsl:param>
+-->
+ <!--
+ callouts look fuzzy in print - using the following two parameters to force unicode
+-->
+<xsl:param name="callout.graphics" select="'0'"/>
+<xsl:param name="callout.unicode" select="1"/>
+<!-- NUMBERING -->
+ <!--
+ are parts enumerated? COMMON
+ <xsl:param name="part.autolabel">1</xsl:param>
+-->
+<!-- Are chapters automatically enumerated? COMMON-->
+<xsl:param name="chapter.autolabel">1</xsl:param>
+<!-- Are sections enumerated? COMMON -->
+<xsl:param name="section.autolabel">1</xsl:param>
+ <!--
+ how deep should each toc be? (how many levels?) COMMON
+-->
+<xsl:param name="toc.max.depth">2</xsl:param>
+ <!--
+ How deep should recursive sections appear in the TOC? COMMON
+-->
+<xsl:param name="toc.section.depth">1</xsl:param>
+<!-- LINKS -->
+<!-- display ulinks as footnotes at bottom of page? -->
+<xsl:param name="ulink.footnotes" select="1"/>
+<!-- display xref links with underline? -->
+ <xsl:attribute-set name="xref.properties">
+<xsl:attribute name="text-decoration">underline</xsl:attribute>
+</xsl:attribute-set>
+<!-- TABLES -->
+<xsl:param name="default.table.width" select="'6in'"/>
+<!-- INDEX -->
+<!-- do you want an index? COMMON -->
+<xsl:param name="generate.index">1</xsl:param>
+<!-- index attributes for xep -->
+ <xsl:attribute-set name="xep.index.item.properties">
+<xsl:attribute name="merge-subsequent-page-numbers">true</xsl:attribute>
+<xsl:attribute name="link-back">true</xsl:attribute>
+</xsl:attribute-set>
+<!-- GLOSSARY -->
+<!-- Display glossentry acronyms? COMMON> -->
+<xsl:param name="glossentry.show.acronym">yes</xsl:param>
+<!-- Name of the glossary collection file COMMON -->
+ <xsl:param name="glossary.collection">
+/www/www-unix.globus.org/toolkit/docs/development/4.2-drafts/glossary.xml
+</xsl:param>
+ <!--
+ Generate links from glossterm to glossentry automatically? COMMON
+-->
+<xsl:param name="glossterm.auto.link">1</xsl:param>
+ <!--
+ if non-zero value for previous parameter, does automatic glossterm linking only apply to firstterms? COMMON
+ <xsl:param name="firstterm.only.link">1</xsl:param>
+-->
+<!-- reduce 'indentation' of body text -->
+ <xsl:param name="body.start.indent">
+ <xsl:choose>
+<xsl:when test="$fop.extensions != 0">0pt</xsl:when>
+<xsl:when test="$passivetex.extensions != 0">0pt</xsl:when>
+<xsl:otherwise>0pc</xsl:otherwise>
+</xsl:choose>
+</xsl:param>
+</xsl:stylesheet>
\ No newline at end of file
Added: docs/docbook/manual.xml
===================================================================
--- docs/docbook/manual.xml (rev 0)
+++ docs/docbook/manual.xml 2010-04-29 19:16:17 UTC (rev 51)
@@ -0,0 +1,371 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [] >
+
+<article>
+ <articleinfo revision="0.1">
+ <title>C-MPI User Guide</title>
+ <subtitle>Content-MPI</subtitle>
+ </articleinfo>
+
+ <section id="overview">
+ <title>Overview</title>
+ <para>
+ This manual provides reference material for the Content-MPI
+ (C-MPI) DHT.
+ </para>
+ <para>
+ C-MPI provides a key/value store for distributed computing
+ over MPI.
+ </para>
+ </section>
+
+ <section id="usecases">
+ <title>Use Cases</title>
+ <section><title>MPI Library</title>
+ <para>
+ C-MPI can be used as an MPI library:
+ </para>
+
+ <programlisting> <![CDATA[
+
+ #include <cmpi.h>
+
+ int main(int argc, char* argv[])
+ {
+ int mpi_rank;
+ int mpi_size;
+ char key[10];
+ char value[30];
+ int length;
+ char* result;
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+
+ cmpi_init();
+
+ sprintf(key, "key_%i", mpi_rank);
+ sprintf(value, "value_%i", mpi_rank);
+ cmpi_put(key, value, strlen(value)+1);
+
+ rank = (mpi_rank+1)%mpi_size;
+ sprintf(key, "key_%i", rank);
+ cmpi_get(key, &result, &length);
+ printf("result(%i): %s\n", length, result);
+
+ MPI_Finalize();
+
+ cmpi_cleanup();
+ }
+ ]]>
+ </programlisting>
+ </section>
+ </section>
+
+ <section id="mpirpc">
+ <title>MPI-RPC</title>
+
+ <section><title>Overview</title>
+ <para>
+ The MPIRPC component is used to allow the user to
+ issue multiple asynchronous requests in one thread
+ from a higher-level, RPC, event-driven model.
+ </para>
+ </section>
+
+ <section><title>Definitions</title>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term>MPIRPC object</term>
+ <listitem><para>Created by an MPIRPC call.
+ Can be waited on.
+ On call completion, this is passed to the proceed-function.
+ Contains the result of the call on completion.
+ Must be freed by the user with MPIRPC_Free().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>proceed-function</term>
+ <listitem><para>A user function pointer passed
+ into an MPIRPC call.
+ Called by MPIRPC on call completion with the MPIRPC object.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </section>
+
+ <section><title>MPIRPC_Call</title>
+ <para>
+ MPIRPC_Call() creates an MPIRPC object and starts performing
+ the RPC asynchronously. The MPIRPC object will contain the results
+ of the call when complete.
+
+ The arguments are:
+
+ <variablelist>
+ <varlistentry>
+ <term>MPIRPC_Node target</term>
+ <listitem><para>
+ The target MPIRPC_Node.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>char* name</term>
+ <listitem><para>
+ Remote function name
+ Copied into the MPIRPC object.
+ Limited to MPIRPC_MAX_NAME (128) characters.
+ May not be NULL.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>char* args</term>
+ <listitem><para>
+ Short NULL-terminated string for user
+ control data arguments.
+ Copied into the MPIRPC object.
+ Limited to MPIRPC_MAX_ARGS (256) characters.
+ May be NULL.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void* extras</term>
+ <listitem><para>
+ Extra user state accessible by the proceed-function.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void (*proceed)(MPIRPC*)</term>
+ <listitem><para>
+ The proceed-function.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </section>
+
+ <section><title>The MPIRPC Object</title>
+ <para>
+ The MPIRPC object contains:
+ <variablelist>
+ <varlistentry>
+ <term>MPIRPC_Node target</term>
+ <listitem><para>
+ The target MPIRPC_Node
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>status</term>
+ <listitem><para>
+ The status of the call:
+ MPIRPC_STATUS_PROTO, MPIRPC_STATUS_CALLED,
+ or MPIRPC_STATUS_RETURNED.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>char[] name</term>
+ <listitem><para>
+ Copy of the remote procedure name.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>char[] args</term>
+ <listitem><para>
+ Copy of the user argument string.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>char* blob</term>
+ <listitem><para>
+ Pointer to the user data blob.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int blob_length</term>
+ <listitem><para>
+ Length of the user data blob.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void* result</term>
+ <listitem><para>
+ Pointer to result data returned by remote procedure
+ in fresh storage.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int result_length</term>
+ <listitem><para>
+ Length of result data.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void* extras</term>
+ <listitem><para>
+ Extra user pointer useful for proceed-function.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int unique</term>
+ <listitem><para>
+ Internal uniquifier.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>bool cancelled</term>
+ <listitem><para>
+ Not yet used.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>MPIRPC_Node target</term>
+ <listitem><para>
+ The target MPIRPC_Node
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>MPI_Request request[]</term>
+ <listitem><para>
+ Internal MPI objects.
+ Released by MPIRPC_Free().
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </section>
+ </section>
+
+ <section id="cmpi">
+ <title>C-MPI</title>
+
+ <section><title>Overview</title>
+ <para>
+ C-MPI is intended to be an easy to use MPI-based
+ distributed key/value store.
+ </para>
+ </section>
+
+ <section><title>API</title>
+ <para>
+ The C-MPI API:
+
+ <variablelist>
+ <varlistentry>
+ <term>cmpi_init()</term>
+ <listitem><para>
+ Initialize C-MPI.
+ The user must first call MPI_Init() and MPIRPC_Init().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>cmpi_put()</term>
+ <listitem><para>
+ Post a key/value pair in C-MPI.
+ </para>
+ <para>
+ Arguments:
+ <variablelist>
+ <varlistentry>
+ <term>char* key</term>
+ <listitem><para>
+ NULL-terminated string key.
+ Passed as the args argument to MPIRPC_Call_blob().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void* value</term>
+ <listitem><para>
+ Variable-length user data.
+ Passed as the blob argument to MPIRPC_Call_blob().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int length</term>
+ <listitem><para>
+ Byte-length of value.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>cmpi_update()</term>
+ <listitem><para>
+ Update the value of a key/value pair in C-MPI.
+ </para>
+ <para>
+ Arguments:
+ <variablelist>
+ <varlistentry>
+ <term>char* key</term>
+ <listitem><para>
+ NULL-terminated string key.
+ Passed as the args argument to MPIRPC_Call_blob().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void* value</term>
+ <listitem><para>
+ Variable-length user data.
+ Passed as the blob argument to MPIRPC_Call_blob().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int length</term>
+ <listitem><para>
+ Byte-length of value.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int offset</term>
+ <listitem><para>
+ At which point to begin overwrite.
+ Offset+length may exceed the original value length.
+ The key/value pair need not originally exist,
+ but if it does not, the offset must be 0.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>cmpi_get()</term>
+ <listitem><para>
+ Extract the value of a key/value pair into fresh storage.
+ </para>
+ <para>
+ Arguments:
+ <variablelist>
+ <varlistentry>
+ <term>char* key</term>
+ <listitem><para>
+ NULL-terminated string key.
+ Passed as the args argument to MPIRPC_Call_blob().
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>void** result</term>
+ <listitem><para>
+ Will be set to the location of the extracted data in
+ fresh storage.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>int* length</term>
+ <listitem><para>
+ Will be set to the length of the extracted data.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </section>
+ </section>
+</article>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|