c-mpi-commits Mailing List for C-MPI (Page 2)
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...> - 2011-04-15 21:50:50
|
Revision: 182
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=182&view=rev
Author: jmwozniak
Date: 2011-04-15 21:50:44 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Fix for problem on SiCortex
Modified Paths:
--------------
src/kda-2/conn-A.c
Modified: src/kda-2/conn-A.c
===================================================================
--- src/kda-2/conn-A.c 2011-04-15 21:48:07 UTC (rev 181)
+++ src/kda-2/conn-A.c 2011-04-15 21:50:44 UTC (rev 182)
@@ -135,3 +135,7 @@
int length = sprintf(result, "%X", id);
MPIRPC_Return(caller, unique, result, length+1);
}
+
+void
+KDA_Detach(MPIRPC_Node node)
+{}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 21:48:13
|
Revision: 181
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=181&view=rev
Author: jmwozniak
Date: 2011-04-15 21:48:07 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Fix SVN error
Modified Paths:
--------------
test/cmpi/test-manyputs.c
Modified: test/cmpi/test-manyputs.c
===================================================================
--- test/cmpi/test-manyputs.c 2011-04-15 21:45:08 UTC (rev 180)
+++ test/cmpi/test-manyputs.c 2011-04-15 21:48:07 UTC (rev 181)
@@ -48,8 +48,6 @@
double stop = MPI_Wtime();
printf("TOOK: %0.3f\n", stop-start);
- double stop = MPI_Wtime();
-
// sleep((mpi_size-mpi_rank)*3+10);
MPI_Barrier(cmpi_comm_clients);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 21:45:14
|
Revision: 180
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=180&view=rev
Author: jmwozniak
Date: 2011-04-15 21:45:08 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Code improvements
Modified Paths:
--------------
include/cmpi_kda-2.h
include/mpirpc.h
src/cmpi/node.c
src/kda-2/kademlia.c
src/mpirpc/mpirpc.c
test/cmpi/test-manyputs.c
Modified: include/cmpi_kda-2.h
===================================================================
--- include/cmpi_kda-2.h 2011-04-15 21:44:49 UTC (rev 179)
+++ include/cmpi_kda-2.h 2011-04-15 21:45:08 UTC (rev 180)
@@ -4,3 +4,5 @@
//// Helpers:
void add_contacts(void);
+
+void listen_loop(void);
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2011-04-15 21:44:49 UTC (rev 179)
+++ include/mpirpc.h 2011-04-15 21:45:08 UTC (rev 180)
@@ -30,9 +30,9 @@
int status;
char name[MPIRPC_MAX_NAME];
char args[MPIRPC_MAX_ARGS];
- void* blob;
+ char* blob;
int blob_length;
- void* result;
+ char* result;
int result_length;
void* extras;
void (*proceed) (struct mpirpc* rpc);
@@ -86,20 +86,20 @@
void* extras, void (*proceed)(MPIRPC*));
MPIRPC* MPIRPC_Call_blob(MPIRPC_Node target, char* name, char* args,
- void* blob, int blob_length,
+ char* blob, int blob_length,
void* extras, void (*proceed)(MPIRPC*));
-void* MPIRPC_Block(MPIRPC_Node target, char* name, char* args);
+char* MPIRPC_Block(MPIRPC_Node target, char* name, char* args);
-void* MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
- void* blob, int blob_length);
+char* MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
+ char* blob, int blob_length);
-void* MPIRPC_Wait(MPIRPC* rpc);
+char* MPIRPC_Wait(MPIRPC* rpc);
void MPIRPC_Null(MPIRPC_Node caller, int unique);
void MPIRPC_Return(MPIRPC_Node caller, int unique,
- void* result, int rlength);
+ char* result, int rlength);
MPIRPC_Node* MPIRPC_Node_create(MPI_Comm comm, int rank);
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2011-04-15 21:44:49 UTC (rev 179)
+++ src/cmpi/node.c 2011-04-15 21:45:08 UTC (rev 180)
@@ -153,8 +153,10 @@
main(int argc, char* argv[])
{
gossip_debug_init();
- // gossip_set_debug_mask(true,MASK_DEBUG|MASK_MPIRPC|MASK_ADTS|
- // MASK_CMPI|MASK_DRIVER);
+
+ //gossip_set_debug_mask(true,MASK_DEBUG|MASK_MPIRPC|MASK_ADTS|
+ // MASK_CMPI|MASK_DRIVER);
+
gossip_enable_stdout();
// Comment out to achieve deterministic results:
Modified: src/kda-2/kademlia.c
===================================================================
--- src/kda-2/kademlia.c 2011-04-15 21:44:49 UTC (rev 179)
+++ src/kda-2/kademlia.c 2011-04-15 21:45:08 UTC (rev 180)
@@ -96,7 +96,6 @@
static KDA_ID make_id(int salt);
static char* id_tostring(void);
-static void listen_loop(void);
static void bootstrap(MPIRPC_Node node);
int KDA_Neighbor_table_size(void);
@@ -1059,7 +1058,7 @@
{
// NOTE_F;
char* result = buckets_tostring();
- printf(result);
+ printf("%s\n", result);
free(result);
}
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2011-04-15 21:44:49 UTC (rev 179)
+++ src/mpirpc/mpirpc.c 2011-04-15 21:45:08 UTC (rev 180)
@@ -195,7 +195,7 @@
MPIRPC*
MPIRPC_Create(MPIRPC_Node target, char* name, char* args,
- void* blob, int blob_length,
+ char* blob, int blob_length,
void* extras, void (*proceed)(MPIRPC*))
{
// gossip_do(MASK_MPIRPC, NOTE_F);
@@ -258,7 +258,7 @@
*/
MPIRPC*
MPIRPC_Call_blob(MPIRPC_Node target, char* name, char* args,
- void* blob, int blob_length,
+ char* blob, int blob_length,
void* extras, void (*proceed)(MPIRPC* rpc))
{
assert(target.comm != MPI_COMM_NULL);
@@ -312,18 +312,18 @@
Copied into MPIRPC.
@param args The args to send. Copied into MPIRPC.
*/
-void*
+char*
MPIRPC_Block(MPIRPC_Node target, char* name, char* args)
{
//gossip_do(MASK_MPIRPC, NOTE_FS(name));
return MPIRPC_Block_blob(target, name, args, NULL, 0);
}
-void*
+char*
MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
- void* blob, int blob_length)
+ char* blob, int blob_length)
{
- void* result;
+ char* result;
gossip_do(MASK_MPIRPC, NOTE_FS(name));
MPIRPC* rpc = MPIRPC_Call_blob(target, name, args,
blob, blob_length, NULL, NULL);
@@ -411,7 +411,7 @@
MPIRPC_Return(caller, unique, NULL, -1);
}
-MPIRPC_Value* MPIRPC_Value_create(int unique, void* result, int length);
+MPIRPC_Value* MPIRPC_Value_create(int unique, char* result, int length);
/**
Return result to caller for unique RPC.
@@ -420,7 +420,7 @@
*/
void
MPIRPC_Return(MPIRPC_Node caller, int unique,
- void* result, int length)
+ char* result, int length)
{
gossip_do(MASK_MPIRPC, SHOW_FIII(caller.rank, unique, length));
@@ -479,7 +479,7 @@
MPIRPC_TAG_RESULT, sender.comm, &status);
}
else if (rpc->result_length == 0)
- rpc->result = heap("");
+ rpc->result = NULL;
else
rpc->result = NULL;
@@ -556,7 +556,7 @@
}
MPIRPC_Value*
-MPIRPC_Value_create(int unique, void* result, int length)
+MPIRPC_Value_create(int unique, char* result, int length)
{
MPIRPC_Value* value = malloc(sizeof(MPIRPC_Value));
@@ -597,7 +597,7 @@
MPIRPC_Free() or MPIRPC_Destroy() as proceed-functions.
@return rpc's result when obtained.
*/
-void*
+char*
MPIRPC_Wait(MPIRPC* rpc)
{
int unique = rpc->unique;
Modified: test/cmpi/test-manyputs.c
===================================================================
--- test/cmpi/test-manyputs.c 2011-04-15 21:44:49 UTC (rev 179)
+++ test/cmpi/test-manyputs.c 2011-04-15 21:45:08 UTC (rev 180)
@@ -45,6 +45,8 @@
cmpi_put(key, value, strlen(value)+1);
free(value);
}
+ double stop = MPI_Wtime();
+ printf("TOOK: %0.3f\n", stop-start);
double stop = MPI_Wtime();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 21:44:55
|
Revision: 179
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=179&view=rev
Author: jmwozniak
Date: 2011-04-15 21:44:49 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Start on SiCortex walk-through
Modified Paths:
--------------
docs/manual/manual.txt
Modified: docs/manual/manual.txt
===================================================================
--- docs/manual/manual.txt 2011-04-15 21:36:48 UTC (rev 178)
+++ docs/manual/manual.txt 2011-04-15 21:44:49 UTC (rev 179)
@@ -530,3 +530,36 @@
A logging library from Phil Carns.
+Walk-throughs
+-------------
+
+SiCortex
+~~~~~~~~
+
+How to run a C-MPI test on the ANL SiCortex.
+
+. Check out source
++
+-------------------------------------------
+svn co https://c-mpi.svn.sourceforge.net/svnroot/c-mpi+
+-------------------------------------------
+
+. Setup
++
+-------------------------------------------
+./setup
+-------------------------------------------
+
+. Configure
++
+-------------------------------------------
+./configure --enable-table-dense-1 --enable-tests
+-------------------------------------------
+
+. Build test
++
+-------------------------------------------
+make deps
+make -j 3 test/cmpi/test-manyputs.x
+-------------------------------------------
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 21:36:54
|
Revision: 178
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=178&view=rev
Author: jmwozniak
Date: 2011-04-15 21:36:48 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Remove some debugging output, 1 copy for DENSE
Modified Paths:
--------------
src/cmpi/node.c
src/dense-1/cmpi_dense.c
src/mpirpc/mpirpc.c
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2011-04-15 21:35:14 UTC (rev 177)
+++ src/cmpi/node.c 2011-04-15 21:36:48 UTC (rev 178)
@@ -153,8 +153,8 @@
main(int argc, char* argv[])
{
gossip_debug_init();
- gossip_set_debug_mask(true,MASK_DEBUG|MASK_MPIRPC|MASK_ADTS|
- MASK_CMPI|MASK_DRIVER);
+ // gossip_set_debug_mask(true,MASK_DEBUG|MASK_MPIRPC|MASK_ADTS|
+ // MASK_CMPI|MASK_DRIVER);
gossip_enable_stdout();
// Comment out to achieve deterministic results:
Modified: src/dense-1/cmpi_dense.c
===================================================================
--- src/dense-1/cmpi_dense.c 2011-04-15 21:35:14 UTC (rev 177)
+++ src/dense-1/cmpi_dense.c 2011-04-15 21:36:48 UTC (rev 178)
@@ -23,7 +23,7 @@
DENSE_Read_params();
- DENSE_Init(3, 3);
+ DENSE_Init(1, 3);
return CMPI_SUCCESS;
}
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2011-04-15 21:35:14 UTC (rev 177)
+++ src/mpirpc/mpirpc.c 2011-04-15 21:36:48 UTC (rev 178)
@@ -391,7 +391,6 @@
MPI_Recv(blob, blob_length, MPI_CHAR, caller.rank,
MPIRPC_TAG_ARGS, caller.comm, &status);
}
- printf("\t %s(%s) from %i \n", name, args, caller.rank);
char* (*handler)(MPIRPC_Node,int,char*,char*,int) =
hashtable_search(portmap, name);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 21:35:20
|
Revision: 177
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=177&view=rev
Author: jmwozniak
Date: 2011-04-15 21:35:14 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Better test mechanics for timing
Modified Paths:
--------------
test/cmpi/test-manyputs.c
Modified: test/cmpi/test-manyputs.c
===================================================================
--- test/cmpi/test-manyputs.c 2011-04-15 20:45:06 UTC (rev 176)
+++ test/cmpi/test-manyputs.c 2011-04-15 21:35:14 UTC (rev 177)
@@ -32,6 +32,10 @@
wait_for_notification();
notify_next();
+ MPI_Barrier(cmpi_comm_clients);
+
+ double start = MPI_Wtime();
+
for (i = 0; i < reps; i++)
{
char key[20];
@@ -42,16 +46,14 @@
free(value);
}
- sleep((mpi_size-mpi_rank)*3+10);
+ double stop = MPI_Wtime();
+ // sleep((mpi_size-mpi_rank)*3+10);
+ MPI_Barrier(cmpi_comm_clients);
+
+ sleep(1000);
+ if (mpi_rank + 1 == mpi_size)
+ printf("TOOK: %0.3f\n", stop-start);
+
cmpi_shutdown();
- /*
- int client_rank;
- MPI_Comm_rank(cmpi_comm_clients, &client_rank);
- if (client_rank == 0)
- {
- note("Shutting down...");
- cmpi_shutdown();
- }
- */
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 20:45:13
|
Revision: 176
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=176&view=rev
Author: jmwozniak
Date: 2011-04-15 20:45:06 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
More memory leak fixes (test/cmpi/test-manyputs)
Modified Paths:
--------------
src/cmpi/cmpi.c
src/dense-1/cmpi_dense.c
src/dense-1/dense.c
test/cmpi/test-manyputs.c
Modified: src/cmpi/cmpi.c
===================================================================
--- src/cmpi/cmpi.c 2011-04-15 20:30:46 UTC (rev 175)
+++ src/cmpi/cmpi.c 2011-04-15 20:45:06 UTC (rev 176)
@@ -45,16 +45,13 @@
}
/**
- Returns a copy of the matching value or NULL if not found.
+ Returns pointer to the matching value or NULL if not found.
*/
char*
cmpi_params_search(char* key)
{
- char* result;
- result = hashtable_search(cmpi_params, key);
- if (result)
- return heap(result);
- return NULL;
+ char* result = hashtable_search(cmpi_params, key);
+ return result;
}
void
Modified: src/dense-1/cmpi_dense.c
===================================================================
--- src/dense-1/cmpi_dense.c 2011-04-15 20:30:46 UTC (rev 175)
+++ src/dense-1/cmpi_dense.c 2011-04-15 20:45:06 UTC (rev 176)
@@ -261,7 +261,6 @@
int n = sscanf(nodes_msg, "%i", &dense_nodes);
// SHOW_I(dense_nodes);
assert(n == 1);
- free(nodes_msg);
}
else
{
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2011-04-15 20:30:46 UTC (rev 175)
+++ src/dense-1/dense.c 2011-04-15 20:45:06 UTC (rev 176)
@@ -161,7 +161,6 @@
/**
Instruct a node to store a value.
Asynchronous. Copies key into MPIRPC.
- Frees value on completion
*/
MPIRPC*
DENSE_Store(MPIRPC_Node node, char* key, char* value, int length)
Modified: test/cmpi/test-manyputs.c
===================================================================
--- test/cmpi/test-manyputs.c 2011-04-15 20:30:46 UTC (rev 175)
+++ test/cmpi/test-manyputs.c 2011-04-15 20:45:06 UTC (rev 176)
@@ -22,7 +22,7 @@
char* s = cmpi_params_search("reps");
if (s == NULL || strlen(s) == 0)
{
- NOTE("No reps given!");
+ puts("No reps given!");
exit(1);
}
int reps;
@@ -39,6 +39,7 @@
char* value = useless_data(10);
cmpi_put(key, value, strlen(value)+1);
+ free(value);
}
sleep((mpi_size-mpi_rank)*3+10);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 20:30:52
|
Revision: 175
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=175&view=rev
Author: jmwozniak
Date: 2011-04-15 20:30:46 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Memory leak fixes- test-putgets now has no leaks
Modified Paths:
--------------
include/lru_table.h
src/adts/dpkm_list.c
src/adts/lru_table.c
src/cmpi/cmpi.c
src/dense-1/cmpi_dense.c
src/dense-1/dense.c
Modified: include/lru_table.h
===================================================================
--- include/lru_table.h 2011-04-15 20:29:44 UTC (rev 174)
+++ include/lru_table.h 2011-04-15 20:30:46 UTC (rev 175)
@@ -40,14 +40,16 @@
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_printf(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);
void lru_table_fprintdata(FILE* file, struct lru_table* target);
+void lru_table_destroy(struct lru_table* target);
+
+void lru_table_free(struct lru_table* target);
+
#endif
Modified: src/adts/dpkm_list.c
===================================================================
--- src/adts/dpkm_list.c 2011-04-15 20:29:44 UTC (rev 174)
+++ src/adts/dpkm_list.c 2011-04-15 20:30:46 UTC (rev 175)
@@ -905,7 +905,6 @@
Free this dpkm_list and its data but not its
extra pointers.
*/
-/*
void
dpkm_list_destroy(struct dpkm_list* target)
{
@@ -913,13 +912,14 @@
while (item)
{
struct dpkm_list_item* next = item->next;
- free(item->data);
+ free(item->key);
+ if (item->data)
+ free(item->data);
free(item);
item = next;
}
free(target);
}
-*/
/*
int
Modified: src/adts/lru_table.c
===================================================================
--- src/adts/lru_table.c 2011-04-15 20:29:44 UTC (rev 174)
+++ src/adts/lru_table.c 2011-04-15 20:30:46 UTC (rev 175)
@@ -68,6 +68,24 @@
}
/**
+ Frees structure and the data.
+*/
+void
+lru_table_destroy(struct lru_table* target)
+{
+ NOTE_F;
+ int i;
+ for (i = 0; i < target->capacity; i++)
+ dpkm_list_destroy(target->array[i]);
+ free(target->array);
+ // Do not free the keys or data in this list- they are referred
+ // to by the array entries
+ dpkm_list_free(target->lru);
+ free(target);
+}
+
+
+/**
Adds the key/data pair to the table.
Adds new item to end of table list and lru list.
Modified: src/cmpi/cmpi.c
===================================================================
--- src/cmpi/cmpi.c 2011-04-15 20:29:44 UTC (rev 174)
+++ src/cmpi/cmpi.c 2011-04-15 20:30:46 UTC (rev 175)
@@ -218,7 +218,7 @@
// free(kv);
}
*/
- lru_table_free(cmpi_cache);
+ lru_table_destroy(cmpi_cache);
// NOTE("free cmpi_params");
hashtable_destroy(cmpi_params);
}
Modified: src/dense-1/cmpi_dense.c
===================================================================
--- src/dense-1/cmpi_dense.c 2011-04-15 20:29:44 UTC (rev 174)
+++ src/dense-1/cmpi_dense.c 2011-04-15 20:30:46 UTC (rev 175)
@@ -125,6 +125,8 @@
MPIRPC_Wait(lookup);
struct inlist* ranks = inlist_parse(lookup->result);
+ free(lookup->result);
+ MPIRPC_Free(lookup);
NOTE("got ranks: ");
DEBUG(inlist_printf(ranks));
@@ -194,6 +196,8 @@
struct inlist* ranks = inlist_parse(lookup->result);
int rank = inlist_random(ranks);
inlist_free(ranks);
+ free(lookup->result);
+ MPIRPC_Free(lookup);
MPIRPC_Node_make(MPI_COMM_WORLD, rank, &node);
MPIRPC* rpc = DENSE_Retrieve(node, key);
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2011-04-15 20:29:44 UTC (rev 174)
+++ src/dense-1/dense.c 2011-04-15 20:30:46 UTC (rev 175)
@@ -266,6 +266,7 @@
inlist_add(ranks, other_rank);
}
char* result = inlist_serialize(ranks);
+ inlist_free(ranks);
MPIRPC_Return(caller, unique, result, strlen(result)+1);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 20:29:50
|
Revision: 174
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=174&view=rev
Author: jmwozniak
Date: 2011-04-15 20:29:44 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Clean up
Modified Paths:
--------------
Makefile.in
Modified: Makefile.in
===================================================================
--- Makefile.in 2011-04-15 19:27:40 UTC (rev 173)
+++ Makefile.in 2011-04-15 20:29:44 UTC (rev 174)
@@ -541,7 +541,6 @@
$(call dirname, $*) $(CFLAGS) $< > $@
SPLINTOPTS = +posixlib +gnuextensions # -preproc
-SPLINT_GS_S := $(shell find . -name "*.gs.s")
splint: $(CMPI_SRC)
$(Q) " SPLINT splint.out"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 19:27:46
|
Revision: 173
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=173&view=rev
Author: jmwozniak
Date: 2011-04-15 19:27:40 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Memory cleanup fix
Modified Paths:
--------------
src/cmpi/cmpi.c
Modified: src/cmpi/cmpi.c
===================================================================
--- src/cmpi/cmpi.c 2011-04-15 19:27:27 UTC (rev 172)
+++ src/cmpi/cmpi.c 2011-04-15 19:27:40 UTC (rev 173)
@@ -40,8 +40,8 @@
void
cmpi_params_add(char* key, char* value)
{
- // SHOW_FSS(key, value);
- hashtable_add(cmpi_params, heap(key), heap(value));
+ SHOW_FSS(key, value);
+ hashtable_add(cmpi_params, strdup(key), strdup(value));
}
/**
@@ -220,7 +220,7 @@
*/
lru_table_free(cmpi_cache);
// NOTE("free cmpi_params");
- hashtable_free(cmpi_params);
+ hashtable_destroy(cmpi_params);
}
/**
@@ -230,6 +230,6 @@
cmpi_client_cleanup()
{
// NOTE_F;
- hashtable_free(cmpi_params);
+ hashtable_destroy(cmpi_params);
MPIRPC_Finalize();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 19:27:33
|
Revision: 172
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=172&view=rev
Author: jmwozniak
Date: 2011-04-15 19:27:27 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Better output
Modified Paths:
--------------
src/dense-1/dense.c
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2011-04-15 19:27:01 UTC (rev 171)
+++ src/dense-1/dense.c 2011-04-15 19:27:27 UTC (rev 172)
@@ -334,7 +334,7 @@
char* blob, int blob_length)
{
MPIRPC_Null(caller, unique);
- note("cmpi_cache:");
+ puts("cmpi_cache:");
lru_table_printdata(cmpi_cache);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 19:27:12
|
Revision: 171
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=171&view=rev
Author: jmwozniak
Date: 2011-04-15 19:27:01 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Minor cleanup
Modified Paths:
--------------
Makefile.in
Modified: Makefile.in
===================================================================
--- Makefile.in 2011-04-15 19:15:42 UTC (rev 170)
+++ Makefile.in 2011-04-15 19:27:01 UTC (rev 171)
@@ -537,7 +537,6 @@
# default rule for generating dependency files (deps)
%.d: %.c
$(Q) " DEP $@"
-# $(E) $(MPICC) -M $(CFLAGS) $(<) | sed -e 's@.*\.o:@@;s@\\@@' > $(@)
$(E) CC="$(MPICC)" $(srcdir)/depend.sh \
$(call dirname, $*) $(CFLAGS) $< > $@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 19:15:49
|
Revision: 170
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=170&view=rev
Author: jmwozniak
Date: 2011-04-15 19:15:42 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Major improvement to build system
Modified Paths:
--------------
Makefile.in
configure.ac
depend.sh
src/cmpi/node.c
test/driver/module.mk.in
Modified: Makefile.in
===================================================================
--- Makefile.in 2011-04-15 19:15:23 UTC (rev 169)
+++ Makefile.in 2011-04-15 19:15:42 UTC (rev 170)
@@ -44,11 +44,9 @@
mandir = $(DESTDIR)@mandir@
exec_prefix = $(DESTDIR)@exec_prefix@
-VPATH = $(srcdir)
SHELL = @SHELL@
INSTALL = @INSTALL@
GNUC = @GNUC@
-INTELC = @INTELC@
# OpenSSL
ifneq (@OPENSSL_LOCATION@,)
@@ -56,10 +54,7 @@
OPENSSL_LIB = @OPENSSL_LOCATION@/lib
endif
-ifneq (@DMALLOC_LOCATION@,)
- DMALLOC_INCLUDE = @DMALLOC_LOCATION@/include
- DMALLOC_LIB = @DMALLOC_LOCATION@/lib
-endif
+ENABLE_TESTS = @ENABLE_TESTS@
# MPI location
MPI = @USE_MPI@
@@ -68,8 +63,6 @@
MPIEXEC = @USE_MPI@/bin/@MPIEXEC@
# MPIARGS = -recvtimeout 10
MPIARGS = @MPIARGS@
-# MPIARGS = -f hosts
-MPDCHECK = tools/mpd-available.zsh @USE_MPI@/bin/mpdlistjobs
# Job launch selection (mpiexec or srun)
ifeq (@HAVE_SRUN@,no)
@@ -262,14 +255,6 @@
# run ./configure --help for information on how to do this cleanly.
LIBCFLAGS = # @LIBCFLAGS@
-# Add gcc-specific flags if we know it is a gnu compiler.
-ifdef GNUC
-CFLAGS += $(GCC_CFLAGS)
-endif
-ifdef INTELC
-CFLAGS += $(INTEL_CFLAGS)
-endif
-
# LIBSRC is source code for libcmpi
LIBSRC :=
# Source code for Kademlia
@@ -338,27 +323,6 @@
include src/cmpi-cp/module.mk
################################################################
-# Derived file lists
-
-# NOTES: At this point, the subdirectory makefile includes have informed
-# us what the source files are. Now we want to generate some
-# other lists (such as objects, executables, and dependency files)
-# by manipulating the lists of source files
-
-# LIBOBJS is a list of objects to put in the client lib
-#LIBOBJS := $(patsubst %.c,%.o, $(filter %.c,$(LIBSRC)))
-
-#DISKSIM_OBJS := $(patsubst %.c,%.o, $(filter %.c,$(DISKSIM_SRC)))
-
-CMPI_OBJS := $(TABLE_OBJS) $(MPIRPC_OBJS) $(CMPI_OBJS)
-# $(DISKSIM_OBJS)
-
-MPIRPC_DEPS := $(patsubst %.o,%.d,$(MPIRPC_OBJS))
-CMPI_DEPS := $(patsubst %.o,%.d,$(CMPI_OBJS))
-
-deps: $(CMPI_DEPS)
-
-################################################################
# Test cases
# Test rules are heavily based on the definitions above
@@ -380,6 +344,30 @@
TEST_DEPS += $(patsubst %.c, %.d, $(TEST_SRC))
TEST_DEPS += $(patsubst %.c, %.d, $(TEST_HELPER_SRC))
+################################################################
+# Derived file lists
+
+# NOTES: At this point, the subdirectory makefile includes have informed
+# us what the source files are. Now we want to generate some
+# other lists (such as objects, executables, and dependency files)
+# by manipulating the lists of source files
+
+# LIBOBJS is a list of objects to put in the client lib
+#LIBOBJS := $(patsubst %.c,%.o, $(filter %.c,$(LIBSRC)))
+
+#DISKSIM_OBJS := $(patsubst %.c,%.o, $(filter %.c,$(DISKSIM_SRC)))
+
+CMPI_OBJS := $(TABLE_OBJS) $(MPIRPC_OBJS) $(CMPI_OBJS)
+# $(DISKSIM_OBJS)
+
+MPIRPC_DEPS := $(patsubst %.o,%.d,$(MPIRPC_OBJS))
+CMPI_DEPS := $(patsubst %.o,%.d,$(CMPI_OBJS))
+ifeq ($(ENABLE_TESTS),yes)
+ CMPI_DEPS += $(TEST_DEPS)
+endif
+
+deps: $(CMPI_DEPS)
+
####################################################################
# Rules and dependencies
@@ -393,20 +381,12 @@
#cmpi-io: $(CMPI_IO)
# Just like dir, but strip the slash off the end, to be pretty.
-# dirname = $(patsubst %/,%,$(dir $(1)))
+dirname = $(patsubst %/,%,$(dir $(1)))
# Generate the canonical in-tree location of a file, given a possibly
# out-of-tree reference.
# canonname = $(patsubst $(srcdir)/%,%,$(call dirname,$(1)))
-# Grab any CFLAGS defined by the make stub for a particular file, and
-# for the directory in which the source resides.
-# modcflags = $(MODCFLAGS_$(call canonname,$(1))) \
-# $(MODCFLAGS_$(patsubst $(srcdir)/%,%,$(1)))
-# -I$(srcdir)/$(call dirname,$(1))
-# modldflags = $(MODLDFLAGS_$(call canonname,$(1))) \
-# $(MODLDFLAGS_$(patsubst $(srcdir)/%,%,$(1)))
-
# CMPI-IO must be enabled in configure --enable-cmpi-io
#$(CMPI_IO): $(CMPI) src/cmpi/cmpi-io.po
# $(Q) " MPICC [PIC] $@"
@@ -467,16 +447,6 @@
.SECONDARY : %.o %.x
-# rule for building shared objects from objects
-#%.po: %.o
-# $(Q) " CC [PIC] $@"
-# $(E)$(CC) $(LIBCFLAGS) $(PICFLAGS) $(call modcflags,$<) $< -c -o $@
-
-# rule for building shared objects
-# %.po: %.c
-# $(Q) " CC [PIC] $@"
-# $(E)$(CC) $(LIBCFLAGS) $(CFLAGS) $(PICFLAGS) $(call modcflags,$<) $< -c -o $@
-
# handy rule to generate cpp-output file, for debugging
.PHONY: FORCE
%.i: %.c FORCE
@@ -554,9 +524,9 @@
# NOTE: we wrap this in ifneq's in order to prevent the
# dependencies from being generated for special targets that don't
# require them
-#ifeq (,$(filter clean distclean dist docs cscope tags nodep,$(MAKECMDGOALS)))
- include $(CMPI_DEPS)
-#endif
+ifeq (,$(filter clean distclean dist docs cscope tags nodep deps,$(MAKECMDGOALS)))
+ -include $(CMPI_DEPS)
+endif
# add this as a make goal to disable rebuilding dependencies
.PHONY: nodep clean
@@ -564,11 +534,12 @@
.PRECIOUS: $(TEST_OUTPUT) %.o
nodep:; @:
-# default rule for generating dependency files
+# default rule for generating dependency files (deps)
%.d: %.c
$(Q) " DEP $@"
# $(E) $(MPICC) -M $(CFLAGS) $(<) | sed -e 's@.*\.o:@@;s@\\@@' > $(@)
- $(E) CC="$(MPICC)" $(srcdir)/depend.sh $(call dirname,$*) $(CFLAGS) $(call modcflags,$<) $< > $@
+ $(E) CC="$(MPICC)" $(srcdir)/depend.sh \
+ $(call dirname, $*) $(CFLAGS) $< > $@
SPLINTOPTS = +posixlib +gnuextensions # -preproc
SPLINT_GS_S := $(shell find . -name "*.gs.s")
@@ -577,17 +548,4 @@
$(Q) " SPLINT splint.out"
$(E) splint $(SPLINTOPTS) $(IFLAGS) -I $(MPI)/include $(CMPI_SRC) > splint.out
-#%.p: %.c
-# $(Q) " CPP $@"
-# $(E) cpp $(IFLAGS) -I $(MPI)/include $(<) > $(@) # || rm -v $(@)
-
-install:: all install_doc
- install -d $(prefix)/include
- install -d $(prefix)/lib
- install -d $(prefix)/bin
-ifdef TARGET_OS_DARWIN
-# TOC needs to be regenerated in libs after they get moved
- ranlib $(patsubst %,$(prefix)/%,$(LIBRARIES))
-endif
-
null:
Modified: configure.ac
===================================================================
--- configure.ac 2011-04-15 19:15:23 UTC (rev 169)
+++ configure.ac 2011-04-15 19:15:42 UTC (rev 170)
@@ -139,6 +139,7 @@
fi
)
+dnl Stop using dmalloc - use valgrind
AC_ARG_WITH(dmalloc,
[ --with-dmalloc Use dmalloc],
if test "x$withval" = "xyes" ; then
@@ -382,6 +383,7 @@
[enable test modules]),
[AC_MSG_RESULT([enabling test modules...])
ENABLE_TESTS="yes"], [])
+AC_SUBST(ENABLE_TESTS)
dnl Disable -rdynamic if we don't have it.
dnl Use it if we can for backtraces.
Modified: depend.sh
===================================================================
--- depend.sh 2011-04-15 19:15:23 UTC (rev 169)
+++ depend.sh 2011-04-15 19:15:42 UTC (rev 170)
@@ -3,6 +3,7 @@
DIR="$1"
shift
if [ -n "$DIR" ] ; then
- DIR="$DIR"/
+ DIR="$DIR"
fi
-exec $CC -M -MG "$@" | sed -e "s@^\(.*\)\.o:@$DIR\1.d $DIR\1.o $DIR\1.po:@"
+
+exec $CC -M -MG "$@" | sed -e "s@^\(.*\)\.o:@$DIR/\1.d $DIR/\1.o:@"
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2011-04-15 19:15:23 UTC (rev 169)
+++ src/cmpi/node.c 2011-04-15 19:15:42 UTC (rev 170)
@@ -23,7 +23,6 @@
void
options(int argc, char* argv[])
{
-
struct option options[] =
{
{"cache", required_argument, NULL, 'c'},
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2011-04-15 19:15:23 UTC (rev 169)
+++ test/driver/module.mk.in 2011-04-15 19:15:42 UTC (rev 170)
@@ -1,10 +1,10 @@
DIR := test/driver
-TEST_DRIVER_SRC += test-cmd-quit.c \
- test-cmd-sleep.c \
- test-cmd-put.c \
- test-cmd-get.c
+TEST_DRIVER_SRC += $(DIR)/test-cmd-quit.c \
+ $(DIR)/test-cmd-sleep.c \
+ $(DIR)/test-cmd-put.c \
+ $(DIR)/test-cmd-get.c
TEST_DRIVER_OBJS = $(patsubst %.c, %.o, $(TEST_DRIVER_SRC))
TEST_DRIVER_OUTPUT = test/driver/test-quit.out \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 19:15:31
|
Revision: 169
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=169&view=rev
Author: jmwozniak
Date: 2011-04-15 19:15:23 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
asciidoc version of manual complete
Modified Paths:
--------------
docs/manual/manual.txt
Modified: docs/manual/manual.txt
===================================================================
--- docs/manual/manual.txt 2011-04-14 23:54:25 UTC (rev 168)
+++ docs/manual/manual.txt 2011-04-15 19:15:23 UTC (rev 169)
@@ -275,7 +275,8 @@
~~~~~~~~
-C-MPI is intended to be an easy to use MPI-based distributed key/value store.
+C-MPI is intended to be an easy to use MPI-based distributed key/value
+store.
API
~~~
@@ -289,116 +290,110 @@
+cmpi_put()+::
-Post a key/value pair in C-MPI.
+ Post a key/value pair in C-MPI. Arguments:
-Arguments:
+ +char* key+;;
-+char* key+;;
+ +NULL+-terminated string key. Passed as the args argument to
+ +MPIRPC_Call_blob()+.
-+NULL+-terminated string key. Passed as the args argument to
-+MPIRPC_Call_blob()+.
+ +void* value+;;
-+void* value+;;
+ Variable-length user data. Passed as the blob argument to
+ +MPIRPC_Call_blob()+.
-Variable-length user data. Passed as the blob argument to
-+MPIRPC_Call_blob()+.
+ +int length+;;
-+int length+;;
+ Byte-length of value.
-Byte-length of value.
-
+cmpi_update()+::
-Update the value of a key/value pair in C-MPI.
+ Update the value of a key/value pair in C-MPI. Arguments:
-Arguments:
+ +char* key+;;
-+char* key+;;
+ +NULL+-terminated string key. Passed as the args argument to
+ MPIRPC_Call_blob().
-+NULL+-terminated string key. Passed as the args argument to MPIRPC_Call_blob().
+ +void* value+;;
-+void* value+;;
+ Variable-length user data. Passed as the blob argument to
+ +MPIRPC_Call_blob()+.
-Variable-length user data. Passed as the blob argument to MPIRPC_Call_blob().
+ +int length+;;
-+int length+;;
+ Byte-length of value.
-Byte-length of value.
+ +int offset+;;
-+int offset+;;
+ 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.
-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.
+cmpi_get()+::
-Extract the value of a key/value pair into fresh storage.
+ Extract the value of a key/value pair into fresh storage.
+ Arguments:
-Arguments:
+ +char* key+;;
-+char* key+;;
+ +NULL+-terminated string key. Passed as the args argument to
+ +MPIRPC_Call_blob()+.
-+NULL+-terminated string key. Passed as the args argument to MPIRPC_Call_blob().
+ +void** result+;;
-+void** result+;;
+ Will be set to the location of the extracted data in fresh storage.
-Will be set to the location of the extracted data in fresh storage.
+ +int* length+;;
-+int* length+;;
+ Will be set to the length of the extracted data.
-Will be set to the length of the extracted data.
-
Configure, build, test
----------------------
Configure
~~~~~~~~~
-. Run ./setup.sh.
+. Run +./setup.sh+.
-. Run ./configure.
+. Run +./configure+.
-+--with-mpi+::
+--with-mpi::
-Mandatory. The location of your MPICH installation. E.g., ${HOME}/sfw/mpich2-1.1.1p1-x86_64
+Mandatory. The location of your MPICH installation. E.g.,
++${HOME}/sfw/mpich2-1.1.1p1-x86_64+
--enable-table-*::
-Mandatory. The underlying DHT algorithm. Current options:
+ Mandatory. The underlying DHT algorithm. Current options:
---enable-table-dense-1;;
+ --enable-table-dense-1;;
-Simple dense table defined in src/dense-1. Uses monolithic
-communicator. Hashes keys and assigns to nodes by modulus. Not really
-a DHT; doesn't need neighbor tables. Great for debugging, simple and
-fast.
+ Simple dense table defined in src/dense-1. Uses monolithic
+ communicator. Hashes keys and assigns to nodes by modulus. Not
+ really a DHT; doesn't need neighbor tables. Great for debugging,
+ simple and fast.
---enable-table-kda-2A;;
+ --enable-table-kda-2A;;
-Kademlia implementation defined in +src/kda-2+, linked with
-+src/kda-2/conn-A.c+. Uses monolithic communicator.
+ Kademlia implementation defined in +src/kda-2+, linked with
+ +src/kda-2/conn-A.c+. Uses monolithic communicator.
---enable-table-kda-2B;;
+ --enable-table-kda-2B;;
-Kademlia implementation defined in +src/kda-2+, linked with
-+src/kda-2/conn-B.c+. Uses MPI-2 dynamic processes.
+ Kademlia implementation defined in +src/kda-2+, linked with
+ +src/kda-2/conn-B.c+. Uses MPI-2 dynamic processes.
---enable-mode-*;;
+--enable-mode-*::
-The node layout scheme. (see <<cmpi-modes>>).
+ The node layout scheme. (see <<cmpi-modes>>).
---enable-mode-mono;;
+--enable-tests::
-The default.
-
---enable-mode-pairs
-
---enable-tests
-
Turn on support for tests. When compiling tests, be sure to use make D=1.
---enable-cmpi-io
+--enable-cmpi-io::
Turn on support for the skeletal CMPI-IO component.
@@ -419,10 +414,11 @@
D=1::
- Turn on debugging output. Mandatory for many tests.
+Turn on debugging output. Mandatory for many tests.
+
V=1::
- Turn on verbose build output. Useful when debugging build process.
+Turn on verbose build output. Useful when debugging build process.
-j::
@@ -495,34 +491,42 @@
one node process and one client process, the client will only contact
the local node.
-node.c
++node.c+::
- Reusable C-MPI node.
+Reusable C-MPI node. Generally, a C-MPI node is anything that calls
+into +cmpi_init()+.
- Generally, a C-MPI node is anything that calls into cmpi_init().
-client.c
++client.c+::
++
+Reusable C-MPI client.
++
+Generally, a C-MPI client is anything that calls into
++cmpi_init_client()+. +client.c+ calls into cmpi_client_code(), which
+is a convenient way to reuse the setup routines in +client.c+. See the
+tests for use of +cmpi_client_code()+.
++
+Other clients could be built that do different things, such as provide
+filesystem interfaces.
++
- Reusable C-MPI client.
++driver+::
- Generally, a C-MPI client is anything that calls into cmpi_init_client(). client.c calls into cmpi_client_code(), which is a convenient way to reuse the setup routines in client.c. See the tests for use of cmpi_client_code().
+ Issue commands to a client over a stream interface.
- Other clients could be built that do different things, such as provide filesystem interfaces.
-driver
++cmpi-db+::
- Issue commands to a client over a stream interface.
-cmpi-db
+Instantiates several nodes and clients. The clients may be manipulated
+by a driver.
- Instantiates several nodes and clients. The clients may be manipulated by a driver.
-cmpi-cp
++cmpi-cp+::
- Acts as a "user" in the diagram above.
-adts
+Acts as a "user" in the diagram above.
- Abstract data types: lists, hash tables, etc.
-gossip
++adts+::
- A logging library from Phil Carns.
+Abstract data types: lists, hash tables, etc.
-8. Appendix
++gossip+;;
-Updated: Fri May 21 11:02:44 CDT 2010
+A logging library from Phil Carns.
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-14 23:54:32
|
Revision: 168
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=168&view=rev
Author: jmwozniak
Date: 2011-04-14 23:54:25 +0000 (Thu, 14 Apr 2011)
Log Message:
-----------
Misc. code cleanups
Modified Paths:
--------------
Makefile.in
TODO.txt
include/cmpi-types.h
include/cmpi.h
include/cmpi_dense-1.h
include/inlist.h
include/kda-2.h
include/list.h
include/mpirpc.h
src/adts/About.txt
src/adts/inlist.c
src/adts/lru_table.c
src/cmpi/driver.c
src/cmpi/node.c
src/dense-1/cmpi_dense.c
src/dense-1/dense.c
src/kda-2/cmpi_kademlia.c
src/kda-2/kademlia.c
src/mpi_tools/mpi_tools.c
src/mpirpc/mpirpc.c
test/adts/test-dpkm_list.c
test/adts/test-inlist.c
test/adts/test-lru_table01.c
test/adts/test_helpers.h
test/cmpi/test-manyputs.c
test/cmpi/test-putget.c
test/cmpi/test-tables.c
test/cmpi/test-update01.c
test/cmpi/test-update02.c
test/driver/module.mk.in
test/driver/test-cmd-get.c
test/driver/test-cmd-quit.c
test/driver/test-cmd-sleep.c
test/driver/test-quit.zsh
test/driver/test.zsh
test/driver/test_driver_fifo.c
test/mpirpc/test-args.c
test/mpirpc/test-args.zsh
test/mpirpc/test-blob.c
test/mpirpc/test-blob.zsh
test/mpirpc/test-ping.c
test/mpirpc/test-returns.c
tools/test-helpers.zsh
Added Paths:
-----------
include/cmpi-driver.h
Removed Paths:
-------------
include/driver.h
Modified: Makefile.in
===================================================================
--- Makefile.in 2011-04-14 23:53:21 UTC (rev 167)
+++ Makefile.in 2011-04-14 23:54:25 UTC (rev 168)
@@ -12,7 +12,7 @@
# INPUT CONTROL VARIABLES
# D : if 1, turn on debugging output in CMPI programs
# G : if 1, certain tests wait for GDB to attach
-# S : if 1, turn on debugging symbols
+# S : if 0, turn off debugging symbols
# T : if 1, turn on MPE printf debugging
# V : if 1, turn on normal make output
@@ -93,7 +93,9 @@
ifeq ($(G),1)
GDB_WAIT="-D GDB_WAIT"
endif
-ifeq ($(S),1)
+ifeq ($(S),0)
+ GGDB = 0
+else
GGDB = 1
endif
ifeq ($(T),1)
Modified: TODO.txt
===================================================================
--- TODO.txt 2011-04-14 23:53:21 UTC (rev 167)
+++ TODO.txt 2011-04-14 23:54:25 UTC (rev 168)
@@ -8,3 +8,5 @@
* Simplify header files, move more definitions into the C files
that need them
+
+* Migrate away from requiring D=1 for test output
Added: include/cmpi-driver.h
===================================================================
--- include/cmpi-driver.h (rev 0)
+++ include/cmpi-driver.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -0,0 +1,47 @@
+
+#include <cmpi-config.h>
+
+#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <cmpi.h>
+#include <io_tools.h>
+
+/**
+ Maximum command line for driver.
+*/
+#define CMPI_DRIVER_MAX_COMMAND (100+CMPI_KEY_LENGTH)
+
+typedef struct
+{
+ FILE* source;
+ FILE* sink;
+ char command[CMPI_DRIVER_MAX_COMMAND];
+ char data[CMPI_VALUE_LENGTH];
+ bool quitting;
+} cmpi_driver;
+
+enum
+{
+ CMPI_DRIVER_FILE,
+ CMPI_DRIVER_STDIN,
+ CMPI_DRIVER_PIPE
+};
+
+//// API...
+
+cmpi_driver* driver_create(void);
+
+bool driver_setup_stdin(cmpi_driver* driver);
+bool driver_setup_file(cmpi_driver* driver, char* filename);
+bool driver_setup_fifo(cmpi_driver* driver);
+
+void driver_process(cmpi_driver* driver);
+
+//// Internal functions...
+
+struct list* driver_tokens(cmpi_driver* driver);
+
+
+
Modified: include/cmpi-types.h
===================================================================
--- include/cmpi-types.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/cmpi-types.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -2,7 +2,7 @@
#ifndef CMPI_TYPES_H
#define CMPI_TYPES_H
-#define CMPI_KEY_LENGTH 64
+#define CMPI_KEY_LENGTH 64
#define CMPI_VALUE_LENGTH (64*1024)
/**
Modified: include/cmpi.h
===================================================================
--- include/cmpi.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/cmpi.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -40,7 +40,7 @@
extern int cmpi_nodes;
-#define CMPI_BLOB_LENGTH LIST_MAX_DATUM
+#define CMPI_BLOB_LENGTH (4*1024*1024)
extern struct lru_table* cmpi_cache;
@@ -118,7 +118,6 @@
//// Methods to aid passing information to user programs:
void cmpi_params_init(void);
-
/**
Stores a copy of the key, value pair.
*/
Modified: include/cmpi_dense-1.h
===================================================================
--- include/cmpi_dense-1.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/cmpi_dense-1.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -2,13 +2,6 @@
#ifndef CMPI_DENSE_1_H
#define CMPI_DENSE_1_H
-#include "dense-1.h"
+// Nothing to do
-//// Helpers:
-
-void add_contacts(void);
-
-void DENSE_Read_params(void);
-
-
#endif
Deleted: include/driver.h
===================================================================
--- include/driver.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/driver.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -1,47 +0,0 @@
-
-#include <cmpi-config.h>
-
-#include <getopt.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <cmpi.h>
-#include <io_tools.h>
-
-/**
- Maximum command line for driver.
-*/
-#define CMPI_DRIVER_MAX_COMMAND (100+CMPI_KEY_LENGTH)
-
-typedef struct
-{
- FILE* source;
- FILE* sink;
- char command[CMPI_DRIVER_MAX_COMMAND];
- char data[CMPI_VALUE_LENGTH];
- bool quitting;
-} cmpi_driver;
-
-enum
-{
- CMPI_DRIVER_FILE,
- CMPI_DRIVER_STDIN,
- CMPI_DRIVER_PIPE
-};
-
-//// API...
-
-cmpi_driver* driver_create(void);
-
-bool driver_setup_stdin(cmpi_driver* driver);
-bool driver_setup_file(cmpi_driver* driver, char* filename);
-bool driver_setup_fifo(cmpi_driver* driver);
-
-void driver_process(cmpi_driver* driver);
-
-//// Internal functions...
-
-struct list* driver_tokens(cmpi_driver* driver);
-
-
-
Modified: include/inlist.h
===================================================================
--- include/inlist.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/inlist.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -7,16 +7,9 @@
#ifndef INLIST_H
#define INLIST_H
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <stdbool.h>
+#include <stdlib.h>
-#include <mpi_tools.h>
-
-// Maximum size of a kinlist datum
-#define INLIST_MAX_DATUM 100
-
struct inlist_item
{
int data;
@@ -43,8 +36,6 @@
bool inlist_remove(struct inlist* target, int data);
-bool inlist_erase(struct inlist* target, int data, size_t n);
-
int inlist_pop(struct inlist* target);
int inlist_peek(struct inlist* target);
Modified: include/kda-2.h
===================================================================
--- include/kda-2.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/kda-2.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -136,6 +136,8 @@
char* KDA_Description(void);
char* KDA_id_tostring(KDA_ID other_id);
+KDA_Neighbor* KDA_Random_neighbor(void);
+
//// Remote API:
MPIRPC* KDA_Translate(MPIRPC_Node node, KDA_ID id);
MPIRPC* KDA_Translate_k(MPIRPC_Node node, KDA_ID id);
@@ -146,6 +148,4 @@
MPIRPC* KDA_Retrieve(KDA_Neighbor* neighbor, char* key);
-
-
#endif
Modified: include/list.h
===================================================================
--- include/list.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/list.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -13,7 +13,7 @@
#include <mpi_tools.h>
-// Maximum size of a list datum
+// Maximum size of a list datum (only used for debug printing)
#define LIST_MAX_DATUM 1024
struct list_item
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/mpirpc.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -4,6 +4,10 @@
#include <cmpi-config.h>
+#include <mpi.h>
+
+#include <stdbool.h>
+
#define MPIRPC_MAX_NAME 128
#define MPIRPC_MAX_ARGS 256
#define MPIRPC_PROCEED_NULL ((void (*)(MPIRPC*)) 1)
@@ -125,6 +129,8 @@
void MPIRPC_Snooze_reset(void);
+void MPIRPC_Snooze_set(int s);
+
//// Data structure helpers...
int MPIRPC_Node_cmp(void* node1, void* node2);
Modified: src/adts/About.txt
===================================================================
--- src/adts/About.txt 2011-04-14 23:53:21 UTC (rev 167)
+++ src/adts/About.txt 2011-04-14 23:54:25 UTC (rev 168)
@@ -1,15 +1,19 @@
+Index of possible ADT functions
+
void _append(target, key)
bool _add(target, key)
+ { should allow duplicates }
+bool _add_unique(target, cmp(), key)
{ false and do nothing if key found }
-bool _add_unique(target, cmp(), key)
- {false and do nothing if key found }
bool _contains(target, key)
bool _matches(target, cmp(), data)
DATA _search(target, key)
DATA _inspect(target, data, n)
+ { search for data in target that matches given data in n bytes }
_update(target, key, data, offset, length)
_set(target, key, data)
+ { reset the value of the given key }
DATA _poll() { head }
DATA _pop() { tail }
DATA _get(i)
Modified: src/adts/inlist.c
===================================================================
--- src/adts/inlist.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/adts/inlist.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -1,6 +1,11 @@
#include "inlist.h"
+#include <stdio.h>
+#include <string.h>
+
+#include <mpi_tools.h>
+
struct inlist*
inlist_create()
{
@@ -367,6 +372,7 @@
}
/**
+ Allocate and return string containing ints in this inlist
Returns pointer to allocated output location, 12*size.
*/
char*
@@ -403,7 +409,6 @@
free(target);
}
-
/*
*
** Dump inlist to string a la snprintf()
Modified: src/adts/lru_table.c
===================================================================
--- src/adts/lru_table.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/adts/lru_table.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -73,7 +73,7 @@
Adds new item to end of table list and lru list.
Sets those two item ptrs to each other.
- @param key
+ @param key May not be NULL
@param data
@return NULL if the table is not overfull or a
@@ -85,6 +85,7 @@
void* data, int length)
{
NOTE_FS(key);
+ assert(key);
struct keyvalue* result = NULL;
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/cmpi/driver.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -8,8 +8,10 @@
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <unistd.h>
-#include <driver.h>
+#include <cmpi-driver.h>
+#include <list.h>
char* filename = NULL;
@@ -119,7 +121,7 @@
void
driver_put(cmpi_driver* driver, struct list* tokens)
{
- char* key = tokens->head->next->data;
+ char* key = (char*) tokens->head->next->data;
char value[CMPI_VALUE_LENGTH];
int length;
int n;
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/cmpi/node.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -10,6 +10,9 @@
* -t <tag> symbolic tag number.
*/
+#include <getopt.h>
+#include <unistd.h>
+
#include <node.h>
#include <cmpi_mode.h>
#include <io_tools.h>
@@ -20,6 +23,7 @@
void
options(int argc, char* argv[])
{
+
struct option options[] =
{
{"cache", required_argument, NULL, 'c'},
@@ -38,7 +42,7 @@
// Defaults...
cmpi_cache_limit = 10000;
- snooze_max = 500000;
+ int snooze_max = 500000;
debug_rank = mpi_rank;
cmpi_nodes = mpi_size;
@@ -115,6 +119,8 @@
}
c++;
}
+
+ MPIRPC_Snooze_set(snooze_max);
}
/**
Modified: src/dense-1/cmpi_dense.c
===================================================================
--- src/dense-1/cmpi_dense.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/dense-1/cmpi_dense.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -3,11 +3,17 @@
#include <cmpi_dense-1.h>
+#include <dense-1.h>
+
/**
List of node ranks to contact for DENSE routines.
*/
-struct inlist* contacts;
+static struct inlist* contacts;
+// void add_contacts(void);
+
+static void DENSE_Read_params(void);
+
CMPI_RETURN
cmpi_init_impl()
{
@@ -123,8 +129,7 @@
NOTE("got ranks: ");
DEBUG(inlist_printf(ranks));
- for (item = ranks->head;
- item; item = item->next)
+ for (item = ranks->head; item; item = item->next)
{
SHOW_I(item->data);
MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
@@ -170,6 +175,9 @@
return CMPI_SUCCESS;
}
+/**
+ Blocking call.
+*/
CMPI_RETURN
cmpi_get(char* key, char** value, int* length)
{
@@ -236,7 +244,10 @@
}
}
-void
+/**
+ Extract parameters from C-MPI specific to DENSE
+ */
+static void
DENSE_Read_params(void)
{
// NOTE_F;
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/dense-1/dense.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -154,8 +154,7 @@
char args[32];
sprintf(args, "%X", id);
MPIRPC* rpc =
- MPIRPC_Call(node, "query_id_k", args,
- NULL, MPIRPC_PROCEED_NULL);
+ MPIRPC_Call(node, "query_id_k", args, NULL, MPIRPC_PROCEED_NULL);
return rpc;
}
@@ -187,9 +186,9 @@
char args[MPIRPC_MAX_ARGS];
sprintf(args, "%s %i", key, offset);
- MPIRPC* rpc = MPIRPC_Call_blob(node, "update", args,
- value, length,
- NULL, MPIRPC_PROCEED_NULL);
+ MPIRPC* rpc =
+ MPIRPC_Call_blob(node, "update", args, value, length,
+ NULL, MPIRPC_PROCEED_NULL);
return rpc;
}
@@ -197,14 +196,13 @@
Instruct a node to retrieve a value.
Asynchronous. Copies key into MPIRPC.
User must use MPIRPC->result_length
- to find number of bytes retrieved.
+ to find number of bytes retrieved.
*/
MPIRPC*
DENSE_Retrieve(MPIRPC_Node node, char* key)
{
MPIRPC* rpc =
- MPIRPC_Call(node, "retrieve", key,
- NULL, MPIRPC_PROCEED_NULL);
+ MPIRPC_Call(node, "retrieve", key, NULL, MPIRPC_PROCEED_NULL);
return rpc;
}
@@ -250,7 +248,7 @@
sscanf(args, "%X", &object_id);
int other_rank = object_id % dense_nodes;
char* result = malloc(10*sizeof(char));
- int length = sprintf(result, "%i", other_rank);
+ int length = sprintf(result, "%i", other_rank)+1;
MPIRPC_Return(caller, unique, result, length);
}
Modified: src/kda-2/cmpi_kademlia.c
===================================================================
--- src/kda-2/cmpi_kademlia.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/kda-2/cmpi_kademlia.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -83,7 +83,7 @@
}
NOTE("CONTACT LOOKUP FAILED: LINKING");
- KDA_Harpoon(random_neighbor()->node, neighbor->id);
+ KDA_Harpoon(KDA_Random_neighbor()->node, neighbor->id);
add_contacts();
return contact_lookup(neighbor);
Modified: src/kda-2/kademlia.c
===================================================================
--- src/kda-2/kademlia.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/kda-2/kademlia.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -98,7 +98,6 @@
static char* id_tostring(void);
static void listen_loop(void);
static void bootstrap(MPIRPC_Node node);
-KDA_Neighbor* random_neighbor(void);
int KDA_Neighbor_table_size(void);
@@ -215,7 +214,7 @@
}
KDA_Neighbor*
-random_neighbor()
+KDA_Random_neighbor()
{
int i;
struct list_item* item;
@@ -1014,7 +1013,7 @@
dump_bucket_ids()
{
char* result = bucket_ids_tostring();
- printf(result);
+ printf("%s", result);
free(result);
}
Modified: src/mpi_tools/mpi_tools.c
===================================================================
--- src/mpi_tools/mpi_tools.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/mpi_tools/mpi_tools.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -162,9 +162,9 @@
note(char* msg)
{
if (msg == NULL)
- fprintf(debug_file, "[%i] (NULL) \n", debug_rank);
+ fprintf(debug_file, "(NULL) \n");
else
- fprintf(debug_file, "[%i] %s \n", debug_rank, msg);
+ fprintf(debug_file, "%s \n", msg);
fflush(debug_file);
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/mpirpc/mpirpc.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -1,7 +1,6 @@
#include <mpi_tools.h>
-#include <stdbool.h>
#include <unistd.h>
#include <itable.h>
@@ -338,7 +337,7 @@
/**
Receives RPC and issues it to local procedure handler.
name is on the stack.
- Handler should free args and blob.
+ Handler should free blob.
*/
void
MPIRPC_Request(MPIRPC_Node caller)
@@ -392,8 +391,7 @@
MPI_Recv(blob, blob_length, MPI_CHAR, caller.rank,
MPIRPC_TAG_ARGS, caller.comm, &status);
}
- /* printf("\t [%i] %s(%s) for %i \n",
- mpi_rank, name, args, caller); */
+ printf("\t %s(%s) from %i \n", name, args, caller.rank);
char* (*handler)(MPIRPC_Node,int,char*,char*,int) =
hashtable_search(portmap, name);
@@ -798,11 +796,18 @@
usleep(snooze_amount *= 2);
}
-void MPIRPC_Snooze_reset()
+void
+MPIRPC_Snooze_reset()
{
snooze_amount = snooze_amount_reset;
}
+void
+MPIRPC_Snooze_set(int s)
+{
+ snooze_max = s;
+}
+
/**
Convenience method for MPI_Comm_get_name().
Places the name in a static location.
Modified: test/adts/test-dpkm_list.c
===================================================================
--- test/adts/test-dpkm_list.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/adts/test-dpkm_list.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -11,7 +11,7 @@
{
if (item)
{
- note_s("extra: ", item->key);
+ printf("extra: %s\n", item->key);
free(item);
}
}
@@ -20,7 +20,7 @@
{
if (item)
{
- note_s("extra: ", item->key);
+ printf("extra: %s\n", item->key);
printdata("data: ", item->data, strlen(item->data));
printf("\n");
free(item->data);
@@ -32,7 +32,7 @@
{
if (item)
{
- note_s("extra: ", item->key);
+ printf("extra: %s\n", item->key);
printdata("data: ", item->data, item->length);
printf("\n");
free(item->key);
@@ -44,11 +44,6 @@
int
main(int argc, char* argv[])
{
- MPI_Init(&argc, &argv);
- whoami();
-
- dmalloc_setup();
-
struct dpkm_list* L = dpkm_list_create(4);
char s[1000];
@@ -105,7 +100,7 @@
extra(item);
dpkm_list_printf("%i", L);
- note("polling...");
+ puts("polling...");
while ((item = dpkm_list_poll(L)))
{
@@ -136,23 +131,18 @@
dpkm_list_printdata(L2);
char* key = makekey(j);
void* data = makedata(j);
- note_s("adding: ", key);
+ printf("adding: %s\n", key);
item = dpkm_list_add(L2, key, data, j);
extra_key_data(item);
}
}
dpkm_list_printdata(L2);
- note_i("size: ", L2->size);
+ printf("size: %i\n", L2->size);
while (item = dpkm_list_poll(L2))
extra_key_data(item);
- note_i("size: ", L2->size);
+ printf("size: %i\n", L2->size);
assert(L2->size == 0);
dpkm_list_free(L2);
-
- DMALLOC_COMPLETE;
-
- MPI_Finalize();
- return 0;
}
Modified: test/adts/test-inlist.c
===================================================================
--- test/adts/test-inlist.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/adts/test-inlist.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -3,6 +3,8 @@
* Test inlist functionality.
* */
+#include <mpi.h>
+
#include <inlist.h>
#include "test_helpers.h"
@@ -10,11 +12,6 @@
int
main(int argc, char* argv[])
{
- MPI_Init(&argc, &argv);
- whoami();
-
- dmalloc_setup();
-
char* s = " 1 4 2 ";
struct inlist* L = inlist_parse(s);
@@ -23,9 +20,5 @@
inlist_free(L);
- MPI_Finalize();
-
- DMALLOC_COMPLETE;
-
return 0;
}
Modified: test/adts/test-lru_table01.c
===================================================================
--- test/adts/test-lru_table01.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/adts/test-lru_table01.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -5,12 +5,6 @@
#include <lru_table.h>
-/*
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-*/
-
#include "test_helpers.h"
void extra_kv(struct keyvalue* kv)
@@ -30,6 +24,10 @@
if (kv)
{
printf("extra: %s \n", kv->key);
+ if (kv->data)
+ free(kv->data);
+ if (kv->key)
+ free(kv->key);
free(kv);
}
}
@@ -40,10 +38,8 @@
MPI_Init(&argc, &argv);
whoami();
- dmalloc_setup();
+ struct lru_table* table = lru_table_create(5, 4);
- struct lru_table* table = lru_table_create(5, 4);
-
int* one = malloc(sizeof(int));
int* two = malloc(sizeof(int));
@@ -91,7 +87,7 @@
free(one);
free(two);
- note("loop...");
+ printf("loop...");
table = lru_table_create(6, 4);
for (int i = 0; i < 30; i++)
{
@@ -105,14 +101,14 @@
}
else
{
- note_s("search: ", key);
+ printf("search: %s\n", key);
kv = lru_table_search(table, key);
free(key);
extra_kv(kv);
}
}
- note("draining...");
+ puts("draining...");
while ((kv = lru_table_poll(table)))
{
printf("polled: %s\n", kv->key, kv->data);
@@ -189,9 +185,10 @@
// dmalloc_shutdown();
+ printf("\n");
+ printf("Normal exit.\n");
+
MPI_Finalize();
- DMALLOC_COMPLETE;
-
return 0;
}
Modified: test/adts/test_helpers.h
===================================================================
--- test/adts/test_helpers.h 2011-04-14 23:53:21 UTC (rev 167)
+++ test/adts/test_helpers.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -1,15 +1,6 @@
-/*
-#define TEST_DMALLOC \
- DMALLOC_SETUP( \
- { \
- SHOW_S(dmalloc_logpath); \
- dmalloc_shutdown(); \
- dmalloc_log_unfreed(); \
- });
+#include <stdio.h>
-*/
-
void* makedata(int n)
{
char* result = malloc(n*sizeof(char));
Modified: test/cmpi/test-manyputs.c
===================================================================
--- test/cmpi/test-manyputs.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/cmpi/test-manyputs.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -5,6 +5,8 @@
"reps" key in the CMPI cache.
*/
+#include <unistd.h>
+
#include "test_helpers.h"
/**
Modified: test/cmpi/test-putget.c
===================================================================
--- test/cmpi/test-putget.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/cmpi/test-putget.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -3,6 +3,8 @@
Put two keys and get one of them.
*/
+#include <unistd.h>
+
#include "test_helpers.h"
void
Modified: test/cmpi/test-tables.c
===================================================================
--- test/cmpi/test-tables.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/cmpi/test-tables.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -3,6 +3,10 @@
Assemble and debug tables.
*/
+#include <unistd.h>
+
+#include <cmpi.h>
+
#include "test_helpers.h"
void
Modified: test/cmpi/test-update01.c
===================================================================
--- test/cmpi/test-update01.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/cmpi/test-update01.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -3,6 +3,8 @@
Put three keys, update one, and get the updated value.
*/
+#include <unistd.h>
+
#include "test_helpers.h"
void
Modified: test/cmpi/test-update02.c
===================================================================
--- test/cmpi/test-update02.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/cmpi/test-update02.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -3,6 +3,8 @@
Update two new keys, update those, and retrieve one.
*/
+#include <unistd.h>
+
#include "test_helpers.h"
void
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/module.mk.in 2011-04-14 23:54:25 UTC (rev 168)
@@ -47,7 +47,8 @@
test/driver/test%.out: test/driver/test%.zsh $(TEST_PROGS) $(TEST_DRIVER)
$(Q) " TEST $(@) "
- $(E) test/driver/test.zsh $(@) $(NODES) $(CLIENTS) $(<) $(DRIVER_DIR)
+ $(E) LAUNCH=$(LAUNCH) test/driver/test.zsh $(@) \
+ $(NODES) $(CLIENTS) $(<) $(DRIVER_DIR)
test/driver/test-success.out: test/cmpi/test-success.out \
$(TEST_DRIVER_OUTPUT)
Modified: test/driver/test-cmd-get.c
===================================================================
--- test/driver/test-cmd-get.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/test-cmd-get.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -22,6 +22,7 @@
main(int argc, char* argv[])
{
int code;
+ char* t;
test_cmd_setup(argc, argv);
@@ -35,7 +36,7 @@
int length;
char message[32];
- fgets(message, 32, from_cmpi); // &length);
+ t = fgets(message, 32, from_cmpi); // &length);
// printf("length: %s\n", message);
// if (code != 1)
// crash("No response from driver!");
Modified: test/driver/test-cmd-quit.c
===================================================================
--- test/driver/test-cmd-quit.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/test-cmd-quit.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -11,6 +11,7 @@
main(int argc, char* argv[])
{
int error;
+ int t;
test_cmd_setup(argc, argv);
@@ -20,7 +21,7 @@
fprintf(to_cmpi, "quit\n");
fflush(to_cmpi);
char output[32];
- fscanf(from_cmpi, "%s", output);
+ t = fscanf(from_cmpi, "%s", output);
assert(!strcmp(output, "ok"));
Modified: test/driver/test-cmd-sleep.c
===================================================================
--- test/driver/test-cmd-sleep.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/test-cmd-sleep.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -12,6 +12,7 @@
main(int argc, char* argv[])
{
int code;
+ int t;
test_cmd_setup(argc, argv);
@@ -21,7 +22,8 @@
fprintf(to_cmpi, "sleep %i\n", sleep_time);
fflush(to_cmpi);
char output[32];
- fscanf(from_cmpi, "%s", output);
+ t = fscanf(from_cmpi, "%s", output);
+ assert(t == 0);
if (!(output[0] == 'o' &&
output[1] == 'k'))
Modified: test/driver/test-quit.zsh
===================================================================
--- test/driver/test-quit.zsh 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/test-quit.zsh 2011-04-14 23:54:25 UTC (rev 168)
@@ -1 +1,3 @@
+#!/bin/zsh
+
test/driver/test-cmd-quit.x -d ${DRIVER_DIR}
Modified: test/driver/test.zsh
===================================================================
--- test/driver/test.zsh 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/test.zsh 2011-04-14 23:54:25 UTC (rev 168)
@@ -12,8 +12,8 @@
bail()
{
- kill ${BOMB_PID}
- crash $1
+ [[ ${BOMB_PID} != "" ]] && kill ${BOMB_PID}
+ crash $1
}
# set -x
@@ -24,6 +24,8 @@
fi
CMPI_OPTS="-p driver_dir=${DRIVER_DIR}"
+[[ ${LAUNCH} == "" ]] && bail "No LAUNCH specified!"
+
DRIVER=test/driver/test_driver.x
${LAUNCH} -n ${TOTAL} ${DRIVER} -n ${NODES} ${CMPI_OPTS} > ${OUTPUT} &
DRIVER_PID=${!}
@@ -41,3 +43,7 @@
check_exits ${TOTAL} ${OUTPUT}
return 0
+
+# Local variables:
+# sh-basic-offset: 2
+# End:
Modified: test/driver/test_driver_fifo.c
===================================================================
--- test/driver/test_driver_fifo.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/test_driver_fifo.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -1,6 +1,6 @@
#include <node.h>
-#include <driver.h>
+#include <cmpi-driver.h>
#include "test_helpers.h"
Modified: test/mpirpc/test-args.c
===================================================================
--- test/mpirpc/test-args.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/mpirpc/test-args.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -5,6 +5,8 @@
NULL return values.
*/
+#include <mpi_tools.h>
+#include <gossip.h>
#include <mpirpc.h>
void
Modified: test/mpirpc/test-args.zsh
===================================================================
--- test/mpirpc/test-args.zsh 2011-04-14 23:53:21 UTC (rev 167)
+++ test/mpirpc/test-args.zsh 2011-04-14 23:54:25 UTC (rev 168)
@@ -11,7 +11,7 @@
shift
LAUNCH=${*}
-eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUTPUT} 2>&1
+eval ${LAUNCH} -n 2 ${VALGRIND} ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
Modified: test/mpirpc/test-blob.c
===================================================================
--- test/mpirpc/test-blob.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/mpirpc/test-blob.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -5,6 +5,8 @@
for non-0-length blobs.
*/
+#include <mpi_tools.h>
+#include <gossip.h>
#include <mpirpc.h>
#include "test_helpers.h"
@@ -15,7 +17,7 @@
{
int a;
sscanf(args, "%i", &a);
- show_fsi(args, a);
+ printf("handle_test: %i\n", a);
assert(blob[0] == '\n');
assert(blob[1] == '\0');
@@ -25,6 +27,7 @@
printf("asserts ok\n");
MPIRPC_Null(caller, unique);
+ free(blob);
}
int
@@ -35,8 +38,6 @@
MPI_Init(&argc, &argv);
MPIRPC_Init();
- DMALLOC_SETUP(dmalloc_setup());
-
MPIRPC_Comm_add(MPI_COMM_WORLD);
MPIRPC_Node neighbor;
@@ -50,7 +51,7 @@
char* result;
MPIRPC_Node_make(MPI_COMM_WORLD, 1, &neighbor);
result = MPIRPC_Block_blob(neighbor, "test", "0", blob, 4);
- show_s(result);
+ printf("result: %s\n", result);
}
else
{
@@ -62,8 +63,4 @@
printf("Normal exit.\n");
MPIRPC_Finalize();
MPI_Finalize();
-
- TEST_DMALLOC;
-
- return 0;
}
Modified: test/mpirpc/test-blob.zsh
===================================================================
--- test/mpirpc/test-blob.zsh 2011-04-14 23:53:21 UTC (rev 167)
+++ test/mpirpc/test-blob.zsh 2011-04-14 23:54:25 UTC (rev 168)
@@ -11,7 +11,7 @@
shift
LAUNCH=${*}
-eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUTPUT} 2>&1
+eval ${LAUNCH} -n 2 ${VALGRIND} ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
Modified: test/mpirpc/test-ping.c
===================================================================
--- test/mpirpc/test-ping.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/mpirpc/test-ping.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -4,6 +4,10 @@
No arguments or return values.
*/
+#include <unistd.h>
+
+#include <mpi_tools.h>
+#include <gossip.h>
#include <mpirpc.h>
#include "test_helpers.h"
Modified: test/mpirpc/test-returns.c
===================================================================
--- test/mpirpc/test-returns.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/mpirpc/test-returns.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -5,6 +5,9 @@
for NULL, 0-length, and non-0-length return values.
*/
+#include <mpi_tools.h>
+#include <gossip.h>
+
#include <mpirpc.h>
#include "test_helpers.h"
Modified: tools/test-helpers.zsh
===================================================================
--- tools/test-helpers.zsh 2011-04-14 23:53:21 UTC (rev 167)
+++ tools/test-helpers.zsh 2011-04-14 23:54:25 UTC (rev 168)
@@ -23,7 +23,12 @@
crash()
{
print $1
- mv -v ${OUTPUT} ${OUTPUT}.failed
+ if [ -f ${OUTPUT} ]
+ then
+ mv -v ${OUTPUT} ${OUTPUT}.failed
+ else
+ print "Not created: ${OUTPUT}"
+ fi
exit 1
}
@@ -48,3 +53,7 @@
N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == TOTAL )) || crash "N != ${TOTAL}"
}
+
+# Local variables:
+# mode: sh
+# End:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-14 23:53:30
|
Revision: 167
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=167&view=rev
Author: jmwozniak
Date: 2011-04-14 23:53:21 +0000 (Thu, 14 Apr 2011)
Log Message:
-----------
New manual in asciidoc
Added Paths:
-----------
docs/manual/manual.txt
Added: docs/manual/manual.txt
===================================================================
--- docs/manual/manual.txt (rev 0)
+++ docs/manual/manual.txt 2011-04-14 23:53:21 UTC (rev 167)
@@ -0,0 +1,528 @@
+
+C-MPI User Guide
+================
+Justin M. Wozniak <wo...@mc...>
+v0.1, April 2011
+
+
+Overview
+--------
+
+This manual provides reference material for the Content-MPI (C-MPI) DHT.
+
+C-MPI provides a key/value store for distributed computing over MPI.
+
+Quick Start
+-----------
+
+The fastest way to get a quick overview of provided features is to just run:
+
+--------------------------------------------------------
+./setup.sh
+./configure --config-cache --enable-table-dense-1 \
+ --enable-tests \
+ --with-mpi=${HOME}/sfw/mpich2-1.2.1p1
+make D=1 test_results
+--------------------------------------------------------
+
+Then, just take a look at the test code and output to see how things work.
+
+
+Use Cases
+---------
+
+MPI Library
+~~~~~~~~~~~
+
+C-MPI can be used as an MPI library. In this mode, the user allocates
+some number of DHT nodes and DHT clients. The nodes start up and begin
+listening for requests. The clients call into +cmpi_client_code()+, do
+work, and make C-MPI calls.
+
+More advanced user programs can link to +libcmpi.a+ directly as well
+by imitating +cmpi/client.c+.
+
+--------------------------------------------------------
+#include <cmpi.h>
+
+cmpi_client_code()
+{
+ sprintf(key, "key_%i", mpi_rank);
+ sprintf(value, "value_%i", mpi_rank);
+ cmpi_put(key, value, strlen(value)+1);
+
+ rank = (mpi_rank+1)%mpi_size;
+ sprintf(key, "key_%i", rank);
+ cmpi_get(key, &result, &length);
+ printf("result(%i): %s\n", length, result);
+}
+--------------------------------------------------------
+
+Cluster database
+~~~~~~~~~~~~~~~~
+
+In this mode, the DHT runs as a distributed background process
+(+cmpi-db+) and the user connects to it via a cp-like tool
+(+cmpi-cp+).
+
+Commands executed on submit host:
+--------------------------------------------------------
+#!/bin/sh
+
+# Allocate 6 compute nodes
+qsub -t 1-6 ...
+
+# List node host names to file for mpiexec
+qstat | something > hosts
+
+# Create some initial conditions
+create_initial > input
+
+# Launch the DHT (12 processes on 6 nodes)
+mpiexec.hydra -f hosts -n 12 bin/cmpi-db -n 6 &
+
+# Spawn client scripts
+# (Could use Falkon here?)
+id=0
+total=$( wc -l hosts )
+for host in $( cat hosts )
+do
+ ssh ${host} client_script.sh $(( id++ )) ${total} &
+done
+
+wait
+--------------------------------------------------------
+
+client_script.sh:
+
+--------------------------------------------------------
+#!/bin/sh
+
+id=$1
+nodes=$2
+
+for (( i=0 ; i<10 ; i++ ))
+do
+ # Do some useful work
+ do_work ${id} ${nodes} < input > output
+ # Post the results to the DHT
+ key=output_${id}_${i}
+ cmpi-cp output dht://${key}
+ # Read a neighbor's result
+ key=output_$(( id-1 % nodes ))_${i}
+ cmpi-cp dht://${key} input
+done
+--------------------------------------------------------
+
+MPI-IO implementation
+~~~~~~~~~~~~~~~~~~~~~
+
+The CMPI-IO module is really only an sketch. Here's the idea:
+
+. C-MPI provides a patch for MPICH. The user applies the patch and recompiles MPICH.
+
+. The user writes a normal MPI/MPI-IO program but provides cmpi:/ pathnames to trigger the CMPI-IO implementation.
+
+. The user launches the program with mpiexec, allocating extra processes for the DHT.
+
+. Calls like MPI_FILE_WRITE_AT() are translated by ROMIO and
+implemented ultimately by calls like ADIOI_CMPI_WriteContig(). (The
+full list of what CMPI-IO needs to implement is in +ad_cmpi.h+; it's
+actually not that bad.) This method would be implemented via calls to
++cmpi_put()+/+cmpi_get()+.
+
+FUSE module
+~~~~~~~~~~~
+
+A FUSE adapter could be built using functionality similar to the
+techniques above. The user would first instantiate the cmpi-db. Then,
+the FUSE implementation would make calls using the driver interface
+similar to the way that cmpi-cp does.
+
+MPI-RPC
+~~~~~~~
+
+Overview
+^^^^^^^^
+
+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.
+
+Definitions
+^^^^^^^^^^^
+
+MPIRPC object::
+
+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().
+
+proceed-function::
+
+A user function pointer passed into an MPIRPC call. Called by MPIRPC
+on call completion with the MPIRPC object. This allows the caller
+to make progress after the call completed, and obtain the result.
+
+handler::
+
+A user function that is the target of an MPIRPC call. Called by MPIRPC
+on an incoming request.
+
+MPIRPC_Call::
+
++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:
+
++MPIRPC_Node target+;;
+
+The target +MPIRPC_Node+, which is an MPI communicator and rank.
+
++char* name+;;
+
+Remote function name Copied into the MPIRPC object. Limited to
+MPIRPC_MAX_NAME (128) characters. May not be +NULL+.
+
++char* args+;;
+
+Short +NULL+-terminated string for user control data arguments. Copied
+into the MPIRPC object. Limited to +MPIRPC_MAX_ARGS+ (256)
+characters. May be +NULL+.
+
++void* extras+;;
+
+Extra user state accessible by the proceed-function.
+
++void (*proceed)(MPIRPC*)+;;
+
+The proceed-function.
+
+The MPIRPC Object::
+
+The MPIRPC object contains:
+
++MPIRPC_Node target+;;
+
+ The target MPIRPC_Node
+
++status+;;
+
+The status of the call: +MPIRPC_STATUS_PROTO+, +MPIRPC_STATUS_CALLED+,
+or +MPIRPC_STATUS_RETURNED+.
+
++char[] name+;;
+
+Copy of the remote procedure name.
+
++char[] args+;;
+
+Copy of the user argument string.
+
++char* blob+;;
+
+Pointer to the user data blob.
+
++int blob_length+;;
+
+Length of the user data blob.
+
++void* result+;;
+
+Pointer to result data returned by remote procedure in fresh storage.
+
++int result_length+;;
+
+Length of result data.
+
++void* extras+;;
+
+Extra user pointer useful for proceed-function.
+
++int unique+;;
+
+Internal uniquifier.
+
++bool cancelled+;;
+
+Not yet used.
+
++MPIRPC_Node target+;;
+
+The target MPIRPC_Node
+
++MPI_Request request[]+;;
+
+Internal MPI objects. Released by +MPIRPC_Free()+.
+
+Example
+
+sample code
+
+Usage notes
+~~~~~~~~~~~
+
+* Handler routines: The handler must copy the incoming args if it
+ wants to save them. The handler must return by calling
+ +MPIRPC_Return()+ or +MPIRPC_Null()+. Handlers can call into
+ +MPIRPC_Call()+ but the flow eventually return to the original
+ caller.
+
+C-MPI
+-----
+
+Overview
+~~~~~~~~
+
+
+C-MPI is intended to be an easy to use MPI-based distributed key/value store.
+
+API
+~~~
+
+The C-MPI API:
+
++cmpi_init()+::
+
+Initialize C-MPI. The user must first call +MPI_Init()+ and
++MPIRPC_Init()+.
+
++cmpi_put()+::
+
+Post a key/value pair in C-MPI.
+
+Arguments:
+
++char* key+;;
+
++NULL+-terminated string key. Passed as the args argument to
++MPIRPC_Call_blob()+.
+
++void* value+;;
+
+Variable-length user data. Passed as the blob argument to
++MPIRPC_Call_blob()+.
+
++int length+;;
+
+Byte-length of value.
+
++cmpi_update()+::
+
+Update the value of a key/value pair in C-MPI.
+
+Arguments:
+
++char* key+;;
+
++NULL+-terminated string key. Passed as the args argument to MPIRPC_Call_blob().
+
++void* value+;;
+
+Variable-length user data. Passed as the blob argument to MPIRPC_Call_blob().
+
++int length+;;
+
+Byte-length of value.
+
++int offset+;;
+
+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.
+
++cmpi_get()+::
+
+Extract the value of a key/value pair into fresh storage.
+
+Arguments:
+
++char* key+;;
+
++NULL+-terminated string key. Passed as the args argument to MPIRPC_Call_blob().
+
++void** result+;;
+
+Will be set to the location of the extracted data in fresh storage.
+
++int* length+;;
+
+Will be set to the length of the extracted data.
+
+Configure, build, test
+----------------------
+
+Configure
+~~~~~~~~~
+
+. Run ./setup.sh.
+
+. Run ./configure.
+
++--with-mpi+::
+
+Mandatory. The location of your MPICH installation. E.g., ${HOME}/sfw/mpich2-1.1.1p1-x86_64
+
+--enable-table-*::
+
+Mandatory. The underlying DHT algorithm. Current options:
+
+--enable-table-dense-1;;
+
+Simple dense table defined in src/dense-1. Uses monolithic
+communicator. Hashes keys and assigns to nodes by modulus. Not really
+a DHT; doesn't need neighbor tables. Great for debugging, simple and
+fast.
+
+--enable-table-kda-2A;;
+
+Kademlia implementation defined in +src/kda-2+, linked with
++src/kda-2/conn-A.c+. Uses monolithic communicator.
+
+--enable-table-kda-2B;;
+
+Kademlia implementation defined in +src/kda-2+, linked with
++src/kda-2/conn-B.c+. Uses MPI-2 dynamic processes.
+
+--enable-mode-*;;
+
+The node layout scheme. (see <<cmpi-modes>>).
+
+--enable-mode-mono;;
+
+The default.
+
+--enable-mode-pairs
+
+--enable-tests
+
+Turn on support for tests. When compiling tests, be sure to use make D=1.
+
+--enable-cmpi-io
+
+Turn on support for the skeletal CMPI-IO component.
+
+Build
+~~~~~
+
+Each component defines its build behavior in a +module.mk.in+
+file. These are converted to +module.mk+ by +configure+ (or
++config.status+). These components typically append to variables or
+define additional targes. +Makefile+ includes all +module.mk+s and
+manages the whole build.
+
+Functions like +cmpi_get()+ are defined in multiple places
+(+cmpi_dense.c+, +cmpi-kademlia.c+). The choice of which to compile is
+made at configure time.
+
+Useful arguments to make:
+
+D=1::
+
+ Turn on debugging output. Mandatory for many tests.
+V=1::
+
+ Turn on verbose build output. Useful when debugging build process.
+
+-j::
+
+You can do make -j tests but you cannot running the tests
+concurrently is not recommended.
+
+mpirpc::
+
+Build a stand-alone MPI-RPC lib.
+
+cmpi::
+
+Build a stand-alone C-MPI lib.
+
+tests::
+
+Build (but do not run) the test programs.
+
+test/<module>/test-success.out::
+
+Run all the tests for module after all of the tests for its dependencies.
+
+tags::
+
+Make an etags file based on the configuration choices.
+
+Test
+~~~~
+
+The tests are defined for each component in +module.mk+. For each
++test-*.c+, a +test-*.x+ executable is produced and launched. The
+launcher is ; +assert()+s and output parsing are used to confirm
+correctness. Output is collected in +test-*.out+. If the test is run
+from a +test-*.zsh+, debugging output is collected and post-processed
+by the ZSH script. If the test fails, the output is moved to
++test-*.out.failed+ (so make does not consider it).
+
+make D=1 test_results
+
+Build and run all the tests. Requires +./configure --enable-tests+.
+
+Components
+----------
+
+cmpi::
+
+The C-MPI interface. Some reusable functionality is defined.
+
++cmpi_*.c+::
+
+The translation layer. Translates C-MPI calls into calls to a DHT
+implementation.
+
+[[cmpi-modes]]
++mode_*.c+::
+
+C-MPI mode selection made at configure time.
+
+mono;;
+
+Given +mpiexec -n 6 cmpi-db -n 4+, creates 4 DHT nodes (ranks 0-3) and
+2 clients (ranks 4-5). The clients will use all nodes as
+contacts. Ideal for the SMP case.
+
+pairs;;
+
+Given +mpiexec -n 6 cmpi-db -n 3+, creates 3 DHT nodes (ranks 0-2) and
+3 clients (ranks 3-5). The clients connect to a single contact (0:3,
+1:4, 2:5). Ideal for the cluster case: each physical node will have
+one node process and one client process, the client will only contact
+the local node.
+
+node.c
+
+ Reusable C-MPI node.
+
+ Generally, a C-MPI node is anything that calls into cmpi_init().
+client.c
+
+ Reusable C-MPI client.
+
+ Generally, a C-MPI client is anything that calls into cmpi_init_client(). client.c calls into cmpi_client_code(), which is a convenient way to reuse the setup routines in client.c. See the tests for use of cmpi_client_code().
+
+ Other clients could be built that do different things, such as provide filesystem interfaces.
+driver
+
+ Issue commands to a client over a stream interface.
+cmpi-db
+
+ Instantiates several nodes and clients. The clients may be manipulated by a driver.
+cmpi-cp
+
+ Acts as a "user" in the diagram above.
+adts
+
+ Abstract data types: lists, hash tables, etc.
+gossip
+
+ A logging library from Phil Carns.
+
+8. Appendix
+
+Updated: Fri May 21 11:02:44 CDT 2010
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-14 18:53:15
|
Revision: 166
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=166&view=rev
Author: jmwozniak
Date: 2011-04-14 18:53:09 +0000 (Thu, 14 Apr 2011)
Log Message:
-----------
Adding
Added Paths:
-----------
TODO.txt
Added: TODO.txt
===================================================================
--- TODO.txt (rev 0)
+++ TODO.txt 2011-04-14 18:53:09 UTC (rev 166)
@@ -0,0 +1,10 @@
+
+Ongoing code modifications:
+
+* Take tools from mpi_tools that do not need MPI and move them to
+ a new module "tools"
+
+* Remove mpi_tools references from code that does not need them
+
+* Simplify header files, move more definitions into the C files
+ that need them
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-14 14:30:17
|
Revision: 165
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=165&view=rev
Author: jmwozniak
Date: 2011-04-14 14:30:08 +0000 (Thu, 14 Apr 2011)
Log Message:
-----------
Code cleanups, more notes...
Modified Paths:
--------------
Makefile.in
include/kda-2.h
include/mpirpc.h
src/kda-2/kademlia.c
src/mpi_tools/mpi_tools.c
src/mpirpc/module.mk.in
src/mpirpc/mpirpc.c
Modified: Makefile.in
===================================================================
--- Makefile.in 2011-03-03 23:13:44 UTC (rev 164)
+++ Makefile.in 2011-04-14 14:30:08 UTC (rev 165)
@@ -109,11 +109,11 @@
endif
ifeq ($(QUIET_COMPILE),1)
- # say a one-line description of the action, do not echo the command
+ # Prints a short description of the action, does not show command
Q=@echo
E=@
else
- # do not say the short Q lines, but do echo the entire command
+ # Just echo the entire command
Q=@echo >/dev/null
E=
endif
@@ -292,7 +292,7 @@
$(E)echo CFLAGS: $(CFLAGS)
$(E)echo IFLAGS: $(IFLAGS)
$(E)echo LIBS: $(LIBS)
- $(E)echo DEPENDS: $(DEPENDS)
+ $(E)echo CMPI_DEPS: $(CMPI_DEPS)
$(E)echo OPENSSL: $(OPENSSL_LOCATION)
$(E)echo GOSSIP_OBJS: $(GOSSIP_OBJS)
$(E)echo ADTS_OBJS: $(ADTS_OBJS)
@@ -351,8 +351,11 @@
CMPI_OBJS := $(TABLE_OBJS) $(MPIRPC_OBJS) $(CMPI_OBJS)
# $(DISKSIM_OBJS)
-CMPI_DEPS := $(patsubst %.o,%.d,$(CMPI_OBJS))
+MPIRPC_DEPS := $(patsubst %.o,%.d,$(MPIRPC_OBJS))
+CMPI_DEPS := $(patsubst %.o,%.d,$(CMPI_OBJS))
+deps: $(CMPI_DEPS)
+
################################################################
# Test cases
# Test rules are heavily based on the definitions above
@@ -397,7 +400,8 @@
# Grab any CFLAGS defined by the make stub for a particular file, and
# for the directory in which the source resides.
# modcflags = $(MODCFLAGS_$(call canonname,$(1))) \
-# $(MODCFLAGS_$(patsubst $(srcdir)/%,%,$(1))) # -I$(srcdir)/$(call dirname,$(1))
+# $(MODCFLAGS_$(patsubst $(srcdir)/%,%,$(1)))
+# -I$(srcdir)/$(call dirname,$(1))
# modldflags = $(MODLDFLAGS_$(call canonname,$(1))) \
# $(MODLDFLAGS_$(patsubst $(srcdir)/%,%,$(1)))
@@ -548,9 +552,9 @@
# NOTE: we wrap this in ifneq's in order to prevent the
# dependencies from being generated for special targets that don't
# require them
-ifeq (,$(filter clean distclean dist docs cscope tags nodep,$(MAKECMDGOALS)))
--include $(DEPENDS)
-endif
+#ifeq (,$(filter clean distclean dist docs cscope tags nodep,$(MAKECMDGOALS)))
+ include $(CMPI_DEPS)
+#endif
# add this as a make goal to disable rebuilding dependencies
.PHONY: nodep clean
@@ -571,9 +575,9 @@
$(Q) " SPLINT splint.out"
$(E) splint $(SPLINTOPTS) $(IFLAGS) -I $(MPI)/include $(CMPI_SRC) > splint.out
-%.p: %.c
- $(Q) " CPP $@"
- $(E) cpp $(IFLAGS) -I $(MPI)/include $(<) > $(@) # || rm -v $(@)
+#%.p: %.c
+# $(Q) " CPP $@"
+# $(E) cpp $(IFLAGS) -I $(MPI)/include $(<) > $(@) # || rm -v $(@)
install:: all install_doc
install -d $(prefix)/include
Modified: include/kda-2.h
===================================================================
--- include/kda-2.h 2011-03-03 23:13:44 UTC (rev 164)
+++ include/kda-2.h 2011-04-14 14:30:08 UTC (rev 165)
@@ -144,114 +144,8 @@
MPIRPC* KDA_Store(KDA_Neighbor* neighbor, char* key, char* value, int length);
-/**
- Instruct a node to retrieve a value.
-*/
MPIRPC* KDA_Retrieve(KDA_Neighbor* neighbor, char* key);
-//// Convenience prototypes to keep functions in decent order...
-KDA_ID make_id(int salt);
-// void join(MPIRPC_Node* node);
-char* id_tostring(void);
-void listen_loop(void);
-void bootstrap(MPIRPC_Node node);
-KDA_Neighbor* random_neighbor(void);
-int KDA_Neighbor_table_size(void);
-//// Neighbor management...
-
-/**
- Add neighbor to the neighbor table.
- @return false iff n is already in the neighbor table.
-*/
-bool neighbor_add(KDA_Neighbor* neighbor);
-
-/**
- Add neighbor to the client list.
-*/
-void client_add(KDA_Neighbor* client);
-
-/**
- Find neighbor in buckets and set its comm.
-*/
-void neighbor_set_node(KDA_Neighbor* neighbor, MPIRPC_Node node);
-
-/**
- Translate a dummy neighbor that is set to MPI_COMM_NULL to
- a good one in a bucket.
- TODO: Speed this up with an index or something.
-*/
-KDA_Neighbor* neighbor_lookup(KDA_Neighbor* neighbor);
-
-/**
- Use node to connect to neighbor.
-*/
-KDA_Neighbor* check_neighbor(MPIRPC_Node node, KDA_Neighbor* neighbor);
-
-/**
- Add neighbor to the neighbor table.
- Use node to link to the neighbor.
-*/
-void connect_neighbor(MPIRPC_Node* node, KDA_Neighbor* neighbor);
-
-void dump_bucket_ids(void);
-char* bucket_ids_tostring(void);
-void dump_buckets(void);
-char* buckets_tostring(void);
-
-//// Handlers...
-
-/**
- Generate info string for debugging
-*/
-void handle_info(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
-void handle_join(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_link(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_find_node(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
-void handle_neighbor(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
-void handle_ping(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
-void handle_query_id(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
-void handle_query_id_k(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
-void handle_store(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
-void handle_retrieve(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
-void handle_shutdown(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-
-/* SPECIFIC TO CONN TYPE
- void handle_accept(MPIRPC_Node* caller, int unique, char* args, char* blob, int blob_length);
- void handle_connect(MPIRPC_Node* caller, int unique, char* args, char* blob, int blob_length);
-*/
-
-// Synchronous methods...
-struct ilist* find_node(KDA_ID id);
-
-// Asynchronous methods and return services...
-void query_id(MPIRPC_Node node, int unique, KDA_ID id);
-void return_query_id(KDA_Operation* op);
-void query_id_k(MPIRPC_Node node, int unique, KDA_ID id);
-void return_query_id_k(KDA_Operation* op);
-
-// RPCs...
-
-void rpc_find_node(KDA_Neighbor* neighbor, KDA_Operation* op);
-
-// Proceeds...
-void proceed_find(MPIRPC* rpc);
-void proceed_ping(MPIRPC* rpc);
-void proceed_link(MPIRPC* rpc);
-
-
-// void proceed_
-
#endif
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2011-03-03 23:13:44 UTC (rev 164)
+++ include/mpirpc.h 2011-04-14 14:30:08 UTC (rev 165)
@@ -2,24 +2,8 @@
#ifndef MPIRPC_H
#define MPIRPC_H
-#define _XOPEN_SOURCE 500
-
-#include <stdbool.h>
-#include <sys/types.h>
-#include <unistd.h>
-
#include <cmpi-config.h>
-#include <list.h>
-#include <itable.h>
-#include <hashtable.h>
-
-#include <mpi_tools.h>
-
-extern int unique;
-
-extern useconds_t snooze_max;
-
#define MPIRPC_MAX_NAME 128
#define MPIRPC_MAX_ARGS 256
#define MPIRPC_PROCEED_NULL ((void (*)(MPIRPC*)) 1)
Modified: src/kda-2/kademlia.c
===================================================================
--- src/kda-2/kademlia.c 2011-03-03 23:13:44 UTC (rev 164)
+++ src/kda-2/kademlia.c 2011-04-14 14:30:08 UTC (rev 165)
@@ -3,6 +3,11 @@
#include <strings.h>
+/**
+ Uniquify KDA_Operations
+ */
+static int unique = 0;
+
KDA_ID id;
K_BUCKET k_bucket[KDA_SPACE_SIZE];
@@ -53,6 +58,101 @@
*/
int unique_client = 1;
+/**
+ Use node to connect to neighbor.
+*/
+KDA_Neighbor* check_neighbor(MPIRPC_Node node, KDA_Neighbor* neighbor);
+
+
+//// Neighbor management...
+
+/**
+ Add neighbor to the neighbor table.
+ @return false iff n is already in the neighbor table.
+*/
+bool neighbor_add(KDA_Neighbor* neighbor);
+
+/**
+ Add neighbor to the client list.
+*/
+void client_add(KDA_Neighbor* client);
+
+/**
+ Find neighbor in buckets and set its comm.
+*/
+void neighbor_set_node(KDA_Neighbor* neighbor, MPIRPC_Node node);
+
+/**
+ Translate a dummy neighbor that is set to MPI_COMM_NULL to
+ a good one in a bucket.
+ TODO: Speed this up with an index or something.
+*/
+KDA_Neighbor* neighbor_lookup(KDA_Neighbor* neighbor);
+
+void dump_bucket_ids(void);
+char* bucket_ids_tostring(void);
+void dump_buckets(void);
+char* buckets_tostring(void);
+
+static KDA_ID make_id(int salt);
+static char* id_tostring(void);
+static void listen_loop(void);
+static void bootstrap(MPIRPC_Node node);
+KDA_Neighbor* random_neighbor(void);
+
+int KDA_Neighbor_table_size(void);
+
+//// Handlers...
+
+/**
+ Generate info string for debugging
+*/
+void handle_info(MPIRPC_Node node, int unique, char* args,
+ char* blob, int blob_length);
+void handle_join(MPIRPC_Node caller, int unique, char* args,
+ char* blob, int blob_length);
+void handle_link(MPIRPC_Node caller, int unique, char* args,
+ char* blob, int blob_length);
+void handle_find_node(MPIRPC_Node node, int unique, char* args,
+ char* blob, int blob_length);
+void handle_neighbor(MPIRPC_Node node, int unique, char* args,
+ char* blob, int blob_length);
+void handle_ping(MPIRPC_Node node, int unique, char* args,
+ char* blob, int blob_length);
+void handle_query_id(MPIRPC_Node node, int unique, char* args,
+ char* blob, int blob_length);
+void handle_query_id_k(MPIRPC_Node node, int unique, char* args,
+ char* blob, int blob_length);
+void handle_store(MPIRPC_Node node, int unique, char* args,
+ char* blob, int blob_length);
+void handle_retrieve(MPIRPC_Node node, int unique, char* args,
+ char* blob, int blob_length);
+void handle_shutdown(MPIRPC_Node caller, int unique, char* args,
+ char* blob, int blob_length);
+
+/* SPECIFIC TO CONN TYPE
+ void handle_accept(MPIRPC_Node* caller, int unique, char* args, char* blob, int blob_length);
+ void handle_connect(MPIRPC_Node* caller, int unique, char* args, char* blob, int blob_length);
+*/
+
+// Synchronous methods...
+struct ilist* find_node(KDA_ID id);
+
+// Asynchronous methods and return services...
+void query_id(MPIRPC_Node node, int unique, KDA_ID id);
+void return_query_id(KDA_Operation* op);
+void query_id_k(MPIRPC_Node node, int unique, KDA_ID id);
+void return_query_id_k(KDA_Operation* op);
+
+// RPCs...
+
+void rpc_find_node(KDA_Neighbor* neighbor, KDA_Operation* op);
+
+// Proceeds...
+void proceed_find(MPIRPC* rpc);
+void proceed_ping(MPIRPC* rpc);
+void proceed_link(MPIRPC* rpc);
+
void
KDA_Data(int alpha_in, int k_in)
{
@@ -371,7 +471,7 @@
NOTE_F;
KDA_Query* query = (KDA_Query*) malloc(sizeof(KDA_Query));
query->caller = caller;
- query->unique = unique;
+ query->unique = unique++;
query->service = service;
return query;
}
@@ -432,7 +532,8 @@
}
void
-handle_shutdown(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length)
+handle_shutdown(MPIRPC_Node caller, int unique, char* args,
+ char* blob, int blob_length)
{
NOTE_F;
cmpi_quitting = true;
@@ -448,7 +549,8 @@
}
void
-handle_find_node(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length)
+handle_find_node(MPIRPC_Node caller, int unique, char* args,
+ char* blob, int blob_length)
{
struct ilist_item* item;
NOTE_FS(args);
@@ -472,7 +574,8 @@
}
void
-handle_query_id(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length)
+handle_query_id(MPIRPC_Node caller, int unique, char* args,
+ char* blob, int blob_length)
{
int object_id;
sscanf(args, "%X", &object_id);
@@ -498,7 +601,8 @@
}
void
-handle_query_id_k(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length)
+handle_query_id_k(MPIRPC_Node caller, int unique, char* args,
+ char* blob, int blob_length)
{
int object_id;
sscanf(args, "%X", &object_id);
@@ -732,7 +836,7 @@
(KDA_Operation*) malloc(sizeof(KDA_Operation));
op->object_id = object_id;
- op->unique = ++unique;
+ op->unique = unique++;
op->name = name;
op->args = args;
op->k_closest = NULL;
@@ -858,7 +962,8 @@
No native method. Simply return.
*/
void
-handle_ping(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length)
+handle_ping(MPIRPC_Node caller, int unique, char* args,
+ char* blob, int blob_length)
{
MPIRPC_Null(caller, unique);
}
Modified: src/mpi_tools/mpi_tools.c
===================================================================
--- src/mpi_tools/mpi_tools.c 2011-03-03 23:13:44 UTC (rev 164)
+++ src/mpi_tools/mpi_tools.c 2011-04-14 14:30:08 UTC (rev 165)
@@ -79,6 +79,10 @@
}
*/
+/**
+ Print possibly binary data with nice handling of newline, tab,
+ NULL characters, and misc. non-printing characters
+ */
void
fprintdata(FILE* file, char* tag, char* data, int length)
{
@@ -102,12 +106,19 @@
fprintf(file, "]");
}
+/**
+ Print possibly binary data with nice handling of newline, tab,
+ NULL characters, and misc. non-printing characters
+ */
void
printdata(char* tag, char* data, int length)
{
fprintdata(stdout, tag, data, length);
}
+/**
+ Print the bits of a binary number
+ */
void
printbinary(unsigned int number)
{
@@ -135,10 +146,10 @@
unsigned int
ilog2(unsigned int j)
{
- int r = 0;
+ unsigned int r = 0;
while (j >>= 1)
r++;
- return (unsigned int) r;
+ return r;
}
unsigned int
Modified: src/mpirpc/module.mk.in
===================================================================
--- src/mpirpc/module.mk.in 2011-03-03 23:13:44 UTC (rev 164)
+++ src/mpirpc/module.mk.in 2011-04-14 14:30:08 UTC (rev 165)
@@ -3,8 +3,8 @@
MPIRPC_SRC := $(DIR)/mpirpc.c
-MPIRPC_OBJS := $(patsubst %.c, %.o, $(MPIRPC_SRC))
-MPIRPC_OBJS += $(ADTS_OBJS)
+MPIRPC_OBJS := $(patsubst %.c, %.o, $(MPIRPC_SRC))
+MPIRPC_OBJS += $(ADTS_OBJS)
MPIRPC = lib/libmpirpc.a
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2011-03-03 23:13:44 UTC (rev 164)
+++ src/mpirpc/mpirpc.c 2011-04-14 14:30:08 UTC (rev 165)
@@ -1,82 +1,87 @@
+#include <mpi_tools.h>
+
+#include <stdbool.h>
+#include <unistd.h>
+
+#include <itable.h>
+#include <hashtable.h>
+#include <list.h>
+
#include <mpirpc.h>
/**
- Functions MPIRPC_* may be exported at some point.
-*/
-
-/**
Counter to uniquify RPC calls.
*/
-int unique = 0;
+static int unique = 0;
/**
For MPIRPC_Check() : Irecv()...
*/
-MPI_Request check_request = MPI_REQUEST_NULL;
+static MPI_Request check_request = MPI_REQUEST_NULL;
/**
For MPIRPC_Check() : Irecv()...
*/
-int check_msg;
+static int check_msg;
-// Internal prototypes (just a convenience):
-void* MPIRPC_Remove(int index);
-void MPIRPC_Handle(int msg, MPIRPC_Node caller);
+// Internal prototypes:
+static void* MPIRPC_Remove(int index);
+static void MPIRPC_Handle(int msg, MPIRPC_Node caller);
/**
Sendable call control code.
*/
-int mpirpc_msg_call;
+static int mpirpc_msg_call;
/**
Sendable return control code.
*/
-int mpirpc_msg_return;
+static int mpirpc_msg_return;
/**
Sendable shutdown control code.
*/
-int mpirpc_msg_disconnect;
+static int mpirpc_msg_disconnect;
/**
Sendable OK control code.
*/
-int mpirpc_msg_ok;
+static int mpirpc_msg_ok;
/**
Sendable failure control code.
*/
-int mpirpc_msg_fail;
+static int mpirpc_msg_fail;
/**
Table of registered functions that may be called.
*/
-struct hashtable* portmap;
+static struct hashtable* portmap;
/**
Table of outstanding RPCs.
*/
-struct itable* rpctable;
+static struct itable* rpctable;
/**
Table of known channels.
*/
-struct list* channels;
+static struct list* channels;
/**
Return values to be garbage collected by MPIRPC_Check().
*/
-struct list* garbage_values;
+static struct list* garbage_values;
/**
Time in microseconds to snooze when MPIRPC_Check() finds nothing.
snooze() & reset_snooze() are called by MPIRPC_Wait().
*/
-unsigned int snooze_amount_reset = 0;
-unsigned int snooze_amount = 0;
+static unsigned int snooze_amount_reset = 0;
+static unsigned int snooze_amount = 0;
/**
The maximum amount of time to snooze in microseconds.
Default 500000us.
*/
-useconds_t snooze_max = 500000;
+static useconds_t snooze_max = 500000;
void
MPIRPC_Init()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-03-03 23:13:50
|
Revision: 164
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=164&view=rev
Author: jmwozniak
Date: 2011-03-03 23:13:44 +0000 (Thu, 03 Mar 2011)
Log Message:
-----------
Drop semicolon
Modified Paths:
--------------
test/adts/module.mk.in
Modified: test/adts/module.mk.in
===================================================================
--- test/adts/module.mk.in 2011-03-03 23:13:20 UTC (rev 163)
+++ test/adts/module.mk.in 2011-03-03 23:13:44 UTC (rev 164)
@@ -16,7 +16,7 @@
$(DIR)/test%.out: $(DIR)/test%.x
$(Q) " TEST $(@) "
- $(E) LAUNCH=$(LAUNCH) ; test/adts/runtest.zsh $(<) $(@) 2>&1
+ $(E) LAUNCH=$(LAUNCH) test/adts/runtest.zsh $(<) $(@) 2>&1
$(DIR)/test-success.out: test/gossip/test-success.out \
$(TEST_ADTS_OUTPUT)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-03-03 23:13:26
|
Revision: 163
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=163&view=rev
Author: jmwozniak
Date: 2011-03-03 23:13:20 +0000 (Thu, 03 Mar 2011)
Log Message:
-----------
Clarify note
Modified Paths:
--------------
src/mpirpc/mpirpc.c
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2011-03-03 22:15:38 UTC (rev 162)
+++ src/mpirpc/mpirpc.c 2011-03-03 23:13:20 UTC (rev 163)
@@ -401,7 +401,7 @@
/**
Convenience for MPIRPC_Return(NULL).
- Return null to caller.
+ Return NULL to caller.
*/
void
MPIRPC_Null(MPIRPC_Node caller, int unique)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-03-03 22:15:44
|
Revision: 162
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=162&view=rev
Author: jmwozniak
Date: 2011-03-03 22:15:38 +0000 (Thu, 03 Mar 2011)
Log Message:
-----------
Drop semicolon
Modified Paths:
--------------
test/gossip/module.mk.in
Modified: test/gossip/module.mk.in
===================================================================
--- test/gossip/module.mk.in 2011-02-28 17:22:48 UTC (rev 161)
+++ test/gossip/module.mk.in 2011-03-03 22:15:38 UTC (rev 162)
@@ -10,13 +10,13 @@
$(DIR)/test%.x: $(DIR)/test%.o $(GOSSIP_OBJS)
$(Q) " LINK $(@) "
- $(E)$(MPICC) $(<) $(GOSSIP_OBJS) $(LIBS) -o $(@)
+ $(E) $(MPICC) $(<) $(GOSSIP_OBJS) $(LIBS) -o $(@)
$(DIR)/test%.out: $(DIR)/test%.x
$(Q) " TEST $(@) "
- $(E)LAUNCH=$(LAUNCH) ; $(patsubst %.x, %.zsh, $(<)) $(<)
+ $(E) LAUNCH=$(LAUNCH) $(patsubst %.x, %.zsh, $(<)) $(<)
$(DIR)/test-success.out: test/mpi_tools/test-success.out \
$(TEST_GOSSIP_OUTPUT)
$(Q) " TOUCH $(@) "
- $(E)touch $(@)
+ $(E) touch $(@)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-02-28 17:22:54
|
Revision: 161
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=161&view=rev
Author: jmwozniak
Date: 2011-02-28 17:22:48 +0000 (Mon, 28 Feb 2011)
Log Message:
-----------
Use ${LAUNCH} to select srun in tests
Modified Paths:
--------------
Makefile.in
test/adts/module.mk.in
test/adts/runtest.zsh
test/cmpi/test-manyputs.zsh
test/cmpi/test-putget.zsh
test/cmpi/test-tables.zsh
test/cmpi/test-update01.zsh
test/cmpi/test-update02.zsh
test/driver/test.zsh
test/gossip/module.mk.in
test/gossip/test-do.zsh
test/gossip/test-env.zsh
test/gossip/test-masks.zsh
Modified: Makefile.in
===================================================================
--- Makefile.in 2011-02-28 16:55:59 UTC (rev 160)
+++ Makefile.in 2011-02-28 17:22:48 UTC (rev 161)
@@ -1,4 +1,5 @@
+
# LIST OF TARGETS WHICH MAY BE USED WHEN RUNNING MAKE:
#
# all default rule; builds libs, server, and test programs
@@ -70,7 +71,7 @@
# MPIARGS = -f hosts
MPDCHECK = tools/mpd-available.zsh @USE_MPI@/bin/mpdlistjobs
-# Job launch selection
+# Job launch selection (mpiexec or srun)
ifeq (@HAVE_SRUN@,no)
LAUNCH = $(MPIEXEC) $(MPIARGS)
else
Modified: test/adts/module.mk.in
===================================================================
--- test/adts/module.mk.in 2011-02-28 16:55:59 UTC (rev 160)
+++ test/adts/module.mk.in 2011-02-28 17:22:48 UTC (rev 161)
@@ -16,7 +16,7 @@
$(DIR)/test%.out: $(DIR)/test%.x
$(Q) " TEST $(@) "
- $(E) test/adts/runtest.zsh $(<) $(@) 2>&1
+ $(E) LAUNCH=$(LAUNCH) ; test/adts/runtest.zsh $(<) $(@) 2>&1
$(DIR)/test-success.out: test/gossip/test-success.out \
$(TEST_ADTS_OUTPUT)
Modified: test/adts/runtest.zsh
===================================================================
--- test/adts/runtest.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/adts/runtest.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -3,7 +3,7 @@
PROG=$1
OUTPUT=$2
-${PROG} > ${OUTPUT}
+${LAUNCH} ${PROG} > ${OUTPUT}
if [[ $? != 0 ]]
then
mv -v ${OUTPUT} ${OUTPUT}.failed
Modified: test/cmpi/test-manyputs.zsh
===================================================================
--- test/cmpi/test-manyputs.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/cmpi/test-manyputs.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -20,7 +20,7 @@
# Monolithic execution (3 nodes, 3 clients):
- mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
+ ${LAUNCH} -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -29,7 +29,7 @@
# KDA-2B execution:
tools/startup_nodes.zsh $(( N-1 )) 100 &
- mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ ${LAUNCH} -n 1 test/cmpi/test01.x > CLIENT.out
sleep $(( N+15 ))
fi
Modified: test/cmpi/test-putget.zsh
===================================================================
--- test/cmpi/test-putget.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/cmpi/test-putget.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -20,7 +20,7 @@
# Monolithic execution (3 nodes, 3 clients):
- mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} >& ${OUTPUT}
+ ${LAUNCH} -n ${TOTAL} ${PROGRAM} -n ${NODES} >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -29,7 +29,7 @@
# KDA-2B execution:
tools/startup_nodes.zsh $(( N-1 )) 100 &
- mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ ${LAUNCH} -n 1 test/cmpi/test01.x > CLIENT.out
sleep $(( N+15 ))
fi
Modified: test/cmpi/test-tables.zsh
===================================================================
--- test/cmpi/test-tables.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/cmpi/test-tables.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -19,7 +19,7 @@
then
# Monolithic execution:
- mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
+ ${LAUNCH} -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -28,7 +28,7 @@
# KDA-2B execution:
tools/startup_nodes.zsh $(( N-1 )) 100 &
- mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ ${LAUNCH} -n 1 test/cmpi/test01.x > CLIENT.out
sleep $(( N+15 ))
fi
Modified: test/cmpi/test-update01.zsh
===================================================================
--- test/cmpi/test-update01.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/cmpi/test-update01.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -19,7 +19,7 @@
then
# Monolithic execution:
- mpiexec -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
+ ${LAUNCH} -n ${TOTAL} ${PROGRAM} -n ${NODES} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -28,7 +28,7 @@
# KDA-2B execution:
tools/startup_nodes.zsh $(( N-1 )) 100 &
- mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ ${LAUNCH} -n 1 test/cmpi/test01.x > CLIENT.out
sleep $(( N+15 ))
fi
Modified: test/cmpi/test-update02.zsh
===================================================================
--- test/cmpi/test-update02.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/cmpi/test-update02.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -19,7 +19,7 @@
# Monolithic execution:
- mpiexec -n ${TOTAL} ${PROGRAM} -n ${CLIENTS} -p reps=10 >& ${OUTPUT}
+ ${LAUNCH} -n ${TOTAL} ${PROGRAM} -n ${CLIENTS} -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -28,7 +28,7 @@
# KDA-2B execution:
tools/startup_nodes.zsh $(( N-1 )) 100 &
- mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ ${LAUNCH} -n 1 test/cmpi/test01.x > CLIENT.out
sleep $(( N+15 ))
fi
Modified: test/driver/test.zsh
===================================================================
--- test/driver/test.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/driver/test.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -25,7 +25,7 @@
CMPI_OPTS="-p driver_dir=${DRIVER_DIR}"
DRIVER=test/driver/test_driver.x
-mpiexec -n ${TOTAL} ${DRIVER} -n ${NODES} ${CMPI_OPTS} > ${OUTPUT} &
+${LAUNCH} -n ${TOTAL} ${DRIVER} -n ${NODES} ${CMPI_OPTS} > ${OUTPUT} &
DRIVER_PID=${!}
tools/timebomb.zsh ${$} 20 ${OUTPUT} $0 &
Modified: test/gossip/module.mk.in
===================================================================
--- test/gossip/module.mk.in 2011-02-28 16:55:59 UTC (rev 160)
+++ test/gossip/module.mk.in 2011-02-28 17:22:48 UTC (rev 161)
@@ -14,9 +14,9 @@
$(DIR)/test%.out: $(DIR)/test%.x
$(Q) " TEST $(@) "
- $(E)$(patsubst %.x, %.zsh, $(<)) $(<)
+ $(E)LAUNCH=$(LAUNCH) ; $(patsubst %.x, %.zsh, $(<)) $(<)
$(DIR)/test-success.out: test/mpi_tools/test-success.out \
$(TEST_GOSSIP_OUTPUT)
$(Q) " TOUCH $(@) "
- $(E) touch $(@)
+ $(E)touch $(@)
Modified: test/gossip/test-do.zsh
===================================================================
--- test/gossip/test-do.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/gossip/test-do.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -9,15 +9,15 @@
PROGRAM=$1
OUTPUT=${PROGRAM%.x}.out
-${PROGRAM} > ${OUTPUT} 2>&1
+${LAUNCH} ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUTPUT} 2>&1
+CMPI_DEBUG_MASK=example ${LAUNCH} ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUTPUT} 2>&1
+CMPI_DEBUG_MASK=all ${LAUNCH} ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
Modified: test/gossip/test-env.zsh
===================================================================
--- test/gossip/test-env.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/gossip/test-env.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -16,15 +16,15 @@
exit 1
}
-${PROGRAM} > ${OUTPUT} 2>&1
+${LAUNCH} ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUTPUT} 2>&1
+CMPI_DEBUG_MASK=example ${LAUNCH} ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUTPUT} 2>&1
+CMPI_DEBUG_MASK=all ${LAUNCH} ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
Modified: test/gossip/test-masks.zsh
===================================================================
--- test/gossip/test-masks.zsh 2011-02-28 16:55:59 UTC (rev 160)
+++ test/gossip/test-masks.zsh 2011-02-28 17:22:48 UTC (rev 161)
@@ -9,7 +9,7 @@
PROGRAM=$1
OUTPUT=${PROGRAM%.x}.out
-${PROGRAM} > ${OUTPUT} 2>&1
+${LAUNCH} ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-02-28 16:56:05
|
Revision: 160
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=160&view=rev
Author: jmwozniak
Date: 2011-02-28 16:55:59 +0000 (Mon, 28 Feb 2011)
Log Message:
-----------
Use LAUNCH variable even for single-process jobs
Modified Paths:
--------------
test/mpi_tools/module.mk.in
Modified: test/mpi_tools/module.mk.in
===================================================================
--- test/mpi_tools/module.mk.in 2011-02-28 16:28:35 UTC (rev 159)
+++ test/mpi_tools/module.mk.in 2011-02-28 16:55:59 UTC (rev 160)
@@ -12,7 +12,7 @@
$(DIR)/test%.out: test/mpi_tools/test%.x
$(Q) " TEST $(@) "
- $(E) $(<) > $(@) 2>&1
+ $(E) $(LAUNCH) $(<) > $(@) 2>&1
$(DIR)/test%.x: test/mpi_tools/test%.o $(MPITOOLS_OBJS)
$(Q) " LINK $(@) "
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-02-28 16:28:44
|
Revision: 159
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=159&view=rev
Author: jmwozniak
Date: 2011-02-28 16:28:35 +0000 (Mon, 28 Feb 2011)
Log Message:
-----------
Drop use of MPD
Modified Paths:
--------------
test/cmpi-db/module.mk.in
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2011-02-28 16:25:21 UTC (rev 158)
+++ test/cmpi-db/module.mk.in 2011-02-28 16:28:35 UTC (rev 159)
@@ -20,7 +20,7 @@
test/cmpi-db/test-%.out: test/cmpi-db/test-%.zsh $(CMPIDB_TOOLS)
$(Q) " TEST $(@) "
- $(E) $(MPDCHECK)
+# $(E) $(MPDCHECK)
$(E) $(<) $(@) $(NODES) $(CLIENTS)
test/cmpi-db/test-success.out: test/driver/test-success.out \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-02-28 16:25:29
|
Revision: 158
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=158&view=rev
Author: jmwozniak
Date: 2011-02-28 16:25:21 +0000 (Mon, 28 Feb 2011)
Log Message:
-----------
New S variable for -ggdb3
Modified Paths:
--------------
Makefile.in
Modified: Makefile.in
===================================================================
--- Makefile.in 2011-02-28 16:24:47 UTC (rev 157)
+++ Makefile.in 2011-02-28 16:25:21 UTC (rev 158)
@@ -11,6 +11,7 @@
# INPUT CONTROL VARIABLES
# D : if 1, turn on debugging output in CMPI programs
# G : if 1, certain tests wait for GDB to attach
+# S : if 1, turn on debugging symbols
# T : if 1, turn on MPE printf debugging
# V : if 1, turn on normal make output
@@ -91,6 +92,9 @@
ifeq ($(G),1)
GDB_WAIT="-D GDB_WAIT"
endif
+ifeq ($(S),1)
+ GGDB = 1
+endif
ifeq ($(T),1)
MPE =-mpe=mpitrace
endif
@@ -184,10 +188,15 @@
STRICT_CFLAGS = @STRICT_CFLAGS@
ifeq ($(DEBUG),1)
- CFLAGS += @RDYNAMIC@ -Wno-unused-variable -ggdb3
+ CFLAGS += @RDYNAMIC@ -Wno-unused-variable
else
CFLAGS += -O2
endif
+
+ifeq ($(GGDB),1)
+ CFLAGS += -ggdb3
+endif
+
# turn on large file support by default
CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
IFLAGS += -I $(srcdir)
@@ -407,7 +416,6 @@
# node executable is only built in the stand-alone node cases
# (e.g., KDA-2B)
-
node: src/cmpi/node.o $(CMPI)
$(Q) " MPICC $(@)"
$(E)$(MPICC) $(MPE) src/cmpi/node.o $(CMPI) $(LIBS) -o $(@)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|