c-mpi-commits Mailing List for C-MPI (Page 8)
Status: Pre-Alpha
Brought to you by:
jmwozniak
You can subscribe to this list here.
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
(64) |
May
(80) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2011 |
Jan
|
Feb
(7) |
Mar
(3) |
Apr
(33) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jmw...@us...> - 2010-04-20 16:25:19
|
Revision: 25
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=25&view=rev
Author: jmwozniak
Date: 2010-04-20 16:25:13 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Drop unused function headers.
Modified Paths:
--------------
include/mpi_tools.h
Modified: include/mpi_tools.h
===================================================================
--- include/mpi_tools.h 2010-04-20 16:23:41 UTC (rev 24)
+++ include/mpi_tools.h 2010-04-20 16:25:13 UTC (rev 25)
@@ -339,9 +339,6 @@
#define DMALLOC_SETUP(x)
#endif
-void* debug_malloc(size_t size);
-void debug_free(void* ptr);
-
/**
Return a number in [0,n-1].
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 16:23:47
|
Revision: 24
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=24&view=rev
Author: jmwozniak
Date: 2010-04-20 16:23:41 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Better name.
Added Paths:
-----------
test/adts/test-list.c
Removed Paths:
-------------
test/adts/test06.c
Copied: test/adts/test-list.c (from rev 14, test/adts/test06.c)
===================================================================
--- test/adts/test-list.c (rev 0)
+++ test/adts/test-list.c 2010-04-20 16:23:41 UTC (rev 24)
@@ -0,0 +1,28 @@
+
+/**
+ * Test list functionality.
+ * */
+
+#include <list.h>
+
+int
+main(int argc, char* argv[])
+{
+ struct list* L;
+
+ MPI_Init(&argc, &argv);
+ whoami();
+
+ L = list_parse("jkl iop l");
+
+ list_printf("%s", L);
+ fflush(stdout);
+ list_destroy(L);
+
+ L = list_parse(" jkl iop l ");
+ list_printf("%s", L);
+ list_destroy(L);
+
+ MPI_Finalize();
+ return 0;
+}
Property changes on: test/adts/test-list.c
___________________________________________________________________
Added: svn:mergeinfo
+
Deleted: test/adts/test06.c
===================================================================
--- test/adts/test06.c 2010-04-20 16:22:03 UTC (rev 23)
+++ test/adts/test06.c 2010-04-20 16:23:41 UTC (rev 24)
@@ -1,28 +0,0 @@
-
-/**
- * Test list functionality.
- * */
-
-#include <list.h>
-
-int
-main(int argc, char* argv[])
-{
- struct list* L;
-
- MPI_Init(&argc, &argv);
- whoami();
-
- L = list_parse("jkl iop l");
-
- list_printf("%s", L);
- fflush(stdout);
- list_destroy(L);
-
- L = list_parse(" jkl iop l ");
- list_printf("%s", L);
- list_destroy(L);
-
- MPI_Finalize();
- return 0;
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 16:22:10
|
Revision: 23
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=23&view=rev
Author: jmwozniak
Date: 2010-04-20 16:22:03 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
lru_table tests.
Added Paths:
-----------
test/adts/test-lru_table01.c
test/adts/test-lru_table02.c
Removed Paths:
-------------
test/adts/test-lru_table.c
test/adts/test05.c
Deleted: test/adts/test-lru_table.c
===================================================================
--- test/adts/test-lru_table.c 2010-04-20 16:20:19 UTC (rev 22)
+++ test/adts/test-lru_table.c 2010-04-20 16:22:03 UTC (rev 23)
@@ -1,181 +0,0 @@
-
-/**
- * Test lru_table functionality.
- * */
-
-#include <lru_table.h>
-
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
-int
-main(int argc, char* argv[])
-{
- MPI_Init(&argc, &argv);
- whoami();
-
-#ifdef DMALLOC
- sprintf(dmalloc_logpath, "./dmalloc_%i.out", debug_rank);
- printf("DMALLOC_PATH: %s \n", dmalloc_logpath);
-#endif
-
- struct lru_table* table = lru_table_create(5, 4);
-
- int* zero = malloc(sizeof(int));
- int* one = malloc(sizeof(int));
- int* two = malloc(sizeof(int));
- int* three = malloc(sizeof(int));
- int* four = malloc(sizeof(int));
- int* five = malloc(sizeof(int));
- int* eight = malloc(sizeof(int));
-
- *zero = 0;
- *one = 1;
- *two = 2;
- *three = 3;
- *four = 4;
- *five = 5;
- *eight = 8;
-
- struct keyvalue* kv;
-
- kv = lru_table_add(table, heap("two"), (char*) two, sizeof(int));
- lru_table_printf("%i", table);
- if (kv)
- printf("victim: %s \n", kv->key);
-
- printf("\n");
-
- kv = lru_table_add(table, heap("one"), (char*) one, sizeof(int));
- lru_table_printf("%i", table);
- if (kv)
- printf("victim: %s \n", kv->key);
-
- printf("\n");
-
- struct keyvalue* result;
-
- result = lru_table_search(table, "one");
- if (result == NULL)
- printf("one not found\n");
- else
- {
- printf("data: %i\n", (int) *result->data);
- free(result);
- }
-
- result = lru_table_search(table, "two");
- if (result == NULL)
- printf("two not found\n");
- else
- {
- printf("data: %i\n", (int) *result->data);
- free(result);
- }
-
- result = lru_table_search(table, "one");
- if (result == NULL)
- printf("one not found\n");
- else
- {
- printf("data: %i\n", (int) *result->data);
- free(result);
- }
-
- result = lru_table_search(table, "two");
- if (result == NULL)
- printf("two not found\n");
- else
- {
- printf("data: %i\n", (int) *result->data);
- free(result);
- }
-
- result = lru_table_search(table, "two");
- if (result == NULL)
- printf("two not found\n");
- else
- {
- printf("data: %i\n", (int) *result->data);
- free(result);
- }
-
- while ((result = lru_table_poll(table)))
- {
- printf("polled: %s %i\n", result->key, *result->data);
- keyvalue_destroy(result);
- }
- lru_table_free(table);
-
- /*
- int* result = (int*) lru_table_search(table, "five");
- printf("result: %i \n", *result);
- lru_table_dump("%i", table);
-
- result = (int*) lru_table_search(table, "twenty");
- if (result == NULL)
- printf("Got NULL \n");
-
- result = (int*) lru_table_search(table, "five");
- printf("result: %i \n", *result);
- lru_table_dump("%i", table);
-
- while ((kv = lru_table_poll(table)))
- printf("polled: %s \n", kv->key);
- */
-
-
- /*
-
- lru_table_add(table, "five", &five);
- lru_table_excise(table, table->head);
- lru_table_dump("%i", table);
- printf("size: %i \n", table->size);
-
- kv = lru_table_add(table, "eight", &eight);
- if (kv)
- printf("%s \n", kv->key);
- lru_table_dump("%i", table);
- printf("size: %i \n", table->size);
-
- lru_table_touch(table, table->head->next);
- lru_table_dump("%i", table);
- printf("size: %i \n", table->size);
-
- struct lru_table_item* item;
- item = lru_table_poll(table);
- lru_table_dump("%i", table);
- printf("size: %i \n", table->size);
-
- while ((item = lru_table_poll(table)))
- lru_table_dump("%i", table);
-
- */
- /*
- lru_table_dump("%i", table);
- lru_table_poll(table);
- lru_table_dump("%i", table);
- lru_table_pop(table);
- lru_table_dump("%i", table);
- lru_table_add(table, &seven);
- lru_table_add(table, &six);
- lru_table_dump("%i", table);
- */
-
- // lru_table_clobber(table);
- // lru_table_clear(table);
- // printf("size(table): %i \n", table->size);
-
- // lru_table_clear(K);
- // printf("size(K): %i \n", K->size);
-
- // lru_table_dump("%i", table);
-
- // dmalloc_shutdown();
-
- MPI_Finalize();
- return 0;
-}
-
-
Copied: test/adts/test-lru_table01.c (from rev 21, test/adts/test-lru_table.c)
===================================================================
--- test/adts/test-lru_table01.c (rev 0)
+++ test/adts/test-lru_table01.c 2010-04-20 16:22:03 UTC (rev 23)
@@ -0,0 +1,181 @@
+
+/**
+ * Test lru_table functionality.
+ * */
+
+#include <lru_table.h>
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+int
+main(int argc, char* argv[])
+{
+ MPI_Init(&argc, &argv);
+ whoami();
+
+#ifdef DMALLOC
+ sprintf(dmalloc_logpath, "./dmalloc_%i.out", debug_rank);
+ printf("DMALLOC_PATH: %s \n", dmalloc_logpath);
+#endif
+
+ struct lru_table* table = lru_table_create(5, 4);
+
+ int* zero = malloc(sizeof(int));
+ int* one = malloc(sizeof(int));
+ int* two = malloc(sizeof(int));
+ int* three = malloc(sizeof(int));
+ int* four = malloc(sizeof(int));
+ int* five = malloc(sizeof(int));
+ int* eight = malloc(sizeof(int));
+
+ *zero = 0;
+ *one = 1;
+ *two = 2;
+ *three = 3;
+ *four = 4;
+ *five = 5;
+ *eight = 8;
+
+ struct keyvalue* kv;
+
+ kv = lru_table_add(table, heap("two"), (char*) two, sizeof(int));
+ lru_table_printf("%i", table);
+ if (kv)
+ printf("victim: %s \n", kv->key);
+
+ printf("\n");
+
+ kv = lru_table_add(table, heap("one"), (char*) one, sizeof(int));
+ lru_table_printf("%i", table);
+ if (kv)
+ printf("victim: %s \n", kv->key);
+
+ printf("\n");
+
+ struct keyvalue* result;
+
+ result = lru_table_search(table, "one");
+ if (result == NULL)
+ printf("one not found\n");
+ else
+ {
+ printf("data: %i\n", (int) *result->data);
+ free(result);
+ }
+
+ result = lru_table_search(table, "two");
+ if (result == NULL)
+ printf("two not found\n");
+ else
+ {
+ printf("data: %i\n", (int) *result->data);
+ free(result);
+ }
+
+ result = lru_table_search(table, "one");
+ if (result == NULL)
+ printf("one not found\n");
+ else
+ {
+ printf("data: %i\n", (int) *result->data);
+ free(result);
+ }
+
+ result = lru_table_search(table, "two");
+ if (result == NULL)
+ printf("two not found\n");
+ else
+ {
+ printf("data: %i\n", (int) *result->data);
+ free(result);
+ }
+
+ result = lru_table_search(table, "two");
+ if (result == NULL)
+ printf("two not found\n");
+ else
+ {
+ printf("data: %i\n", (int) *result->data);
+ free(result);
+ }
+
+ while ((result = lru_table_poll(table)))
+ {
+ printf("polled: %s %i\n", result->key, *result->data);
+ keyvalue_destroy(result);
+ }
+ lru_table_free(table);
+
+ /*
+ int* result = (int*) lru_table_search(table, "five");
+ printf("result: %i \n", *result);
+ lru_table_dump("%i", table);
+
+ result = (int*) lru_table_search(table, "twenty");
+ if (result == NULL)
+ printf("Got NULL \n");
+
+ result = (int*) lru_table_search(table, "five");
+ printf("result: %i \n", *result);
+ lru_table_dump("%i", table);
+
+ while ((kv = lru_table_poll(table)))
+ printf("polled: %s \n", kv->key);
+ */
+
+
+ /*
+
+ lru_table_add(table, "five", &five);
+ lru_table_excise(table, table->head);
+ lru_table_dump("%i", table);
+ printf("size: %i \n", table->size);
+
+ kv = lru_table_add(table, "eight", &eight);
+ if (kv)
+ printf("%s \n", kv->key);
+ lru_table_dump("%i", table);
+ printf("size: %i \n", table->size);
+
+ lru_table_touch(table, table->head->next);
+ lru_table_dump("%i", table);
+ printf("size: %i \n", table->size);
+
+ struct lru_table_item* item;
+ item = lru_table_poll(table);
+ lru_table_dump("%i", table);
+ printf("size: %i \n", table->size);
+
+ while ((item = lru_table_poll(table)))
+ lru_table_dump("%i", table);
+
+ */
+ /*
+ lru_table_dump("%i", table);
+ lru_table_poll(table);
+ lru_table_dump("%i", table);
+ lru_table_pop(table);
+ lru_table_dump("%i", table);
+ lru_table_add(table, &seven);
+ lru_table_add(table, &six);
+ lru_table_dump("%i", table);
+ */
+
+ // lru_table_clobber(table);
+ // lru_table_clear(table);
+ // printf("size(table): %i \n", table->size);
+
+ // lru_table_clear(K);
+ // printf("size(K): %i \n", K->size);
+
+ // lru_table_dump("%i", table);
+
+ // dmalloc_shutdown();
+
+ MPI_Finalize();
+ return 0;
+}
+
+
Copied: test/adts/test-lru_table02.c (from rev 14, test/adts/test05.c)
===================================================================
--- test/adts/test-lru_table02.c (rev 0)
+++ test/adts/test-lru_table02.c 2010-04-20 16:22:03 UTC (rev 23)
@@ -0,0 +1,42 @@
+
+/**
+ * Test lru_table functionality.
+ * */
+
+#include <lru_table.h>
+
+int
+main(int argc, char* argv[])
+{
+ MPI_Init(&argc, &argv);
+ whoami();
+
+#ifdef DMALLOC
+ printf("DMALLOC\n");
+ // sprintf(dmalloc_logpath, "%s", "./dmalloc.out");
+#endif
+
+ struct lru_table* table = lru_table_create(5, 4);
+ struct keyvalue* kv;
+
+ lru_table_printf("%s", table);
+ char* data1 = "data1";
+ char* data2 = "data2";
+ lru_table_add(table, "key1", strdup(data1), strlen(data1)+1);
+ lru_table_printf("%s", table);
+ lru_table_add(table, "key2", strdup(data2), strlen(data2)+1);
+ lru_table_printf("%s", table);
+
+ char* overwrite = "XJKLJKL";
+ lru_table_update(table, "key2", overwrite, 3, strlen(overwrite)+1);
+
+ lru_table_printf("%s", table);
+
+ while ((kv = lru_table_poll(table)))
+ printf("polled: %s %s\n", kv->key, (char*) kv->data);
+
+ lru_table_printf("%s", table);
+
+ MPI_Finalize();
+ return 0;
+}
Property changes on: test/adts/test-lru_table02.c
___________________________________________________________________
Added: svn:mergeinfo
+
Deleted: test/adts/test05.c
===================================================================
--- test/adts/test05.c 2010-04-20 16:20:19 UTC (rev 22)
+++ test/adts/test05.c 2010-04-20 16:22:03 UTC (rev 23)
@@ -1,42 +0,0 @@
-
-/**
- * Test lru_table functionality.
- * */
-
-#include <lru_table.h>
-
-int
-main(int argc, char* argv[])
-{
- MPI_Init(&argc, &argv);
- whoami();
-
-#ifdef DMALLOC
- printf("DMALLOC\n");
- // sprintf(dmalloc_logpath, "%s", "./dmalloc.out");
-#endif
-
- struct lru_table* table = lru_table_create(5, 4);
- struct keyvalue* kv;
-
- lru_table_printf("%s", table);
- char* data1 = "data1";
- char* data2 = "data2";
- lru_table_add(table, "key1", strdup(data1), strlen(data1)+1);
- lru_table_printf("%s", table);
- lru_table_add(table, "key2", strdup(data2), strlen(data2)+1);
- lru_table_printf("%s", table);
-
- char* overwrite = "XJKLJKL";
- lru_table_update(table, "key2", overwrite, 3, strlen(overwrite)+1);
-
- lru_table_printf("%s", table);
-
- while ((kv = lru_table_poll(table)))
- printf("polled: %s %s\n", kv->key, (char*) kv->data);
-
- lru_table_printf("%s", table);
-
- MPI_Finalize();
- return 0;
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 16:20:25
|
Revision: 22
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=22&view=rev
Author: jmwozniak
Date: 2010-04-20 16:20:19 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Better name.
Added Paths:
-----------
test/adts/test-inlist.c
Removed Paths:
-------------
test/adts/test04.c
Copied: test/adts/test-inlist.c (from rev 14, test/adts/test04.c)
===================================================================
--- test/adts/test-inlist.c (rev 0)
+++ test/adts/test-inlist.c 2010-04-20 16:20:19 UTC (rev 22)
@@ -0,0 +1,27 @@
+
+/**
+ * Test inlist functionality.
+ * */
+
+#include <inlist.h>
+
+int
+main(int argc, char* argv[])
+{
+ MPI_Init(&argc, &argv);
+ whoami();
+
+ char* s = malloc(30);
+ strcpy(s, " 1 4 2 ");
+
+ struct inlist* L = inlist_parse(s);
+
+ inlist_printf(L);
+
+ inlist_free(L);
+ free(s);
+
+ MPI_Finalize();
+
+ return 0;
+}
Property changes on: test/adts/test-inlist.c
___________________________________________________________________
Added: svn:mergeinfo
+
Deleted: test/adts/test04.c
===================================================================
--- test/adts/test04.c 2010-04-20 16:19:00 UTC (rev 21)
+++ test/adts/test04.c 2010-04-20 16:20:19 UTC (rev 22)
@@ -1,27 +0,0 @@
-
-/**
- * Test inlist functionality.
- * */
-
-#include <inlist.h>
-
-int
-main(int argc, char* argv[])
-{
- MPI_Init(&argc, &argv);
- whoami();
-
- char* s = malloc(30);
- strcpy(s, " 1 4 2 ");
-
- struct inlist* L = inlist_parse(s);
-
- inlist_printf(L);
-
- inlist_free(L);
- free(s);
-
- MPI_Finalize();
-
- return 0;
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 16:19:07
|
Revision: 21
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=21&view=rev
Author: jmwozniak
Date: 2010-04-20 16:19:00 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Better name.
Added Paths:
-----------
test/adts/test-lru_table.c
Removed Paths:
-------------
test/adts/test02.c
Copied: test/adts/test-lru_table.c (from rev 20, test/adts/test02.c)
===================================================================
--- test/adts/test-lru_table.c (rev 0)
+++ test/adts/test-lru_table.c 2010-04-20 16:19:00 UTC (rev 21)
@@ -0,0 +1,181 @@
+
+/**
+ * Test lru_table functionality.
+ * */
+
+#include <lru_table.h>
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+int
+main(int argc, char* argv[])
+{
+ MPI_Init(&argc, &argv);
+ whoami();
+
+#ifdef DMALLOC
+ sprintf(dmalloc_logpath, "./dmalloc_%i.out", debug_rank);
+ printf("DMALLOC_PATH: %s \n", dmalloc_logpath);
+#endif
+
+ struct lru_table* table = lru_table_create(5, 4);
+
+ int* zero = malloc(sizeof(int));
+ int* one = malloc(sizeof(int));
+ int* two = malloc(sizeof(int));
+ int* three = malloc(sizeof(int));
+ int* four = malloc(sizeof(int));
+ int* five = malloc(sizeof(int));
+ int* eight = malloc(sizeof(int));
+
+ *zero = 0;
+ *one = 1;
+ *two = 2;
+ *three = 3;
+ *four = 4;
+ *five = 5;
+ *eight = 8;
+
+ struct keyvalue* kv;
+
+ kv = lru_table_add(table, heap("two"), (char*) two, sizeof(int));
+ lru_table_printf("%i", table);
+ if (kv)
+ printf("victim: %s \n", kv->key);
+
+ printf("\n");
+
+ kv = lru_table_add(table, heap("one"), (char*) one, sizeof(int));
+ lru_table_printf("%i", table);
+ if (kv)
+ printf("victim: %s \n", kv->key);
+
+ printf("\n");
+
+ struct keyvalue* result;
+
+ result = lru_table_search(table, "one");
+ if (result == NULL)
+ printf("one not found\n");
+ else
+ {
+ printf("data: %i\n", (int) *result->data);
+ free(result);
+ }
+
+ result = lru_table_search(table, "two");
+ if (result == NULL)
+ printf("two not found\n");
+ else
+ {
+ printf("data: %i\n", (int) *result->data);
+ free(result);
+ }
+
+ result = lru_table_search(table, "one");
+ if (result == NULL)
+ printf("one not found\n");
+ else
+ {
+ printf("data: %i\n", (int) *result->data);
+ free(result);
+ }
+
+ result = lru_table_search(table, "two");
+ if (result == NULL)
+ printf("two not found\n");
+ else
+ {
+ printf("data: %i\n", (int) *result->data);
+ free(result);
+ }
+
+ result = lru_table_search(table, "two");
+ if (result == NULL)
+ printf("two not found\n");
+ else
+ {
+ printf("data: %i\n", (int) *result->data);
+ free(result);
+ }
+
+ while ((result = lru_table_poll(table)))
+ {
+ printf("polled: %s %i\n", result->key, *result->data);
+ keyvalue_destroy(result);
+ }
+ lru_table_free(table);
+
+ /*
+ int* result = (int*) lru_table_search(table, "five");
+ printf("result: %i \n", *result);
+ lru_table_dump("%i", table);
+
+ result = (int*) lru_table_search(table, "twenty");
+ if (result == NULL)
+ printf("Got NULL \n");
+
+ result = (int*) lru_table_search(table, "five");
+ printf("result: %i \n", *result);
+ lru_table_dump("%i", table);
+
+ while ((kv = lru_table_poll(table)))
+ printf("polled: %s \n", kv->key);
+ */
+
+
+ /*
+
+ lru_table_add(table, "five", &five);
+ lru_table_excise(table, table->head);
+ lru_table_dump("%i", table);
+ printf("size: %i \n", table->size);
+
+ kv = lru_table_add(table, "eight", &eight);
+ if (kv)
+ printf("%s \n", kv->key);
+ lru_table_dump("%i", table);
+ printf("size: %i \n", table->size);
+
+ lru_table_touch(table, table->head->next);
+ lru_table_dump("%i", table);
+ printf("size: %i \n", table->size);
+
+ struct lru_table_item* item;
+ item = lru_table_poll(table);
+ lru_table_dump("%i", table);
+ printf("size: %i \n", table->size);
+
+ while ((item = lru_table_poll(table)))
+ lru_table_dump("%i", table);
+
+ */
+ /*
+ lru_table_dump("%i", table);
+ lru_table_poll(table);
+ lru_table_dump("%i", table);
+ lru_table_pop(table);
+ lru_table_dump("%i", table);
+ lru_table_add(table, &seven);
+ lru_table_add(table, &six);
+ lru_table_dump("%i", table);
+ */
+
+ // lru_table_clobber(table);
+ // lru_table_clear(table);
+ // printf("size(table): %i \n", table->size);
+
+ // lru_table_clear(K);
+ // printf("size(K): %i \n", K->size);
+
+ // lru_table_dump("%i", table);
+
+ // dmalloc_shutdown();
+
+ MPI_Finalize();
+ return 0;
+}
+
+
Property changes on: test/adts/test-lru_table.c
___________________________________________________________________
Added: svn:mergeinfo
+
Deleted: test/adts/test02.c
===================================================================
--- test/adts/test02.c 2010-04-20 16:18:15 UTC (rev 20)
+++ test/adts/test02.c 2010-04-20 16:19:00 UTC (rev 21)
@@ -1,181 +0,0 @@
-
-/**
- * Test lru_table functionality.
- * */
-
-#include <lru_table.h>
-
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
-int
-main(int argc, char* argv[])
-{
- MPI_Init(&argc, &argv);
- whoami();
-
-#ifdef DMALLOC
- sprintf(dmalloc_logpath, "./dmalloc_%i.out", debug_rank);
- printf("DMALLOC_PATH: %s \n", dmalloc_logpath);
-#endif
-
- struct lru_table* table = lru_table_create(5, 4);
-
- int* zero = malloc(sizeof(int));
- int* one = malloc(sizeof(int));
- int* two = malloc(sizeof(int));
- int* three = malloc(sizeof(int));
- int* four = malloc(sizeof(int));
- int* five = malloc(sizeof(int));
- int* eight = malloc(sizeof(int));
-
- *zero = 0;
- *one = 1;
- *two = 2;
- *three = 3;
- *four = 4;
- *five = 5;
- *eight = 8;
-
- struct keyvalue* kv;
-
- kv = lru_table_add(table, heap("two"), (char*) two, sizeof(int));
- lru_table_printf("%i", table);
- if (kv)
- printf("victim: %s \n", kv->key);
-
- printf("\n");
-
- kv = lru_table_add(table, heap("one"), (char*) one, sizeof(int));
- lru_table_printf("%i", table);
- if (kv)
- printf("victim: %s \n", kv->key);
-
- printf("\n");
-
- struct keyvalue* result;
-
- result = lru_table_search(table, "one");
- if (result == NULL)
- printf("one not found\n");
- else
- {
- printf("data: %i\n", (int) *result->data);
- free(result);
- }
-
- result = lru_table_search(table, "two");
- if (result == NULL)
- printf("two not found\n");
- else
- {
- printf("data: %i\n", (int) *result->data);
- free(result);
- }
-
- result = lru_table_search(table, "one");
- if (result == NULL)
- printf("one not found\n");
- else
- {
- printf("data: %i\n", (int) *result->data);
- free(result);
- }
-
- result = lru_table_search(table, "two");
- if (result == NULL)
- printf("two not found\n");
- else
- {
- printf("data: %i\n", (int) *result->data);
- free(result);
- }
-
- result = lru_table_search(table, "two");
- if (result == NULL)
- printf("two not found\n");
- else
- {
- printf("data: %i\n", (int) *result->data);
- free(result);
- }
-
- while ((result = lru_table_poll(table)))
- {
- printf("polled: %s %i\n", result->key, *result->data);
- keyvalue_destroy(result);
- }
- lru_table_free(table);
-
- /*
- int* result = (int*) lru_table_search(table, "five");
- printf("result: %i \n", *result);
- lru_table_dump("%i", table);
-
- result = (int*) lru_table_search(table, "twenty");
- if (result == NULL)
- printf("Got NULL \n");
-
- result = (int*) lru_table_search(table, "five");
- printf("result: %i \n", *result);
- lru_table_dump("%i", table);
-
- while ((kv = lru_table_poll(table)))
- printf("polled: %s \n", kv->key);
- */
-
-
- /*
-
- lru_table_add(table, "five", &five);
- lru_table_excise(table, table->head);
- lru_table_dump("%i", table);
- printf("size: %i \n", table->size);
-
- kv = lru_table_add(table, "eight", &eight);
- if (kv)
- printf("%s \n", kv->key);
- lru_table_dump("%i", table);
- printf("size: %i \n", table->size);
-
- lru_table_touch(table, table->head->next);
- lru_table_dump("%i", table);
- printf("size: %i \n", table->size);
-
- struct lru_table_item* item;
- item = lru_table_poll(table);
- lru_table_dump("%i", table);
- printf("size: %i \n", table->size);
-
- while ((item = lru_table_poll(table)))
- lru_table_dump("%i", table);
-
- */
- /*
- lru_table_dump("%i", table);
- lru_table_poll(table);
- lru_table_dump("%i", table);
- lru_table_pop(table);
- lru_table_dump("%i", table);
- lru_table_add(table, &seven);
- lru_table_add(table, &six);
- lru_table_dump("%i", table);
- */
-
- // lru_table_clobber(table);
- // lru_table_clear(table);
- // printf("size(table): %i \n", table->size);
-
- // lru_table_clear(K);
- // printf("size(K): %i \n", K->size);
-
- // lru_table_dump("%i", table);
-
- // dmalloc_shutdown();
-
- MPI_Finalize();
- return 0;
-}
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 16:18:22
|
Revision: 20
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=20&view=rev
Author: jmwozniak
Date: 2010-04-20 16:18:15 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Minor fix.
Modified Paths:
--------------
test/adts/test02.c
Modified: test/adts/test02.c
===================================================================
--- test/adts/test02.c 2010-04-20 16:15:35 UTC (rev 19)
+++ test/adts/test02.c 2010-04-20 16:18:15 UTC (rev 20)
@@ -12,48 +12,48 @@
int
main(int argc, char* argv[])
{
- MPI_Init(&argc, &argv);
+ MPI_Init(&argc, &argv);
whoami();
#ifdef DMALLOC
sprintf(dmalloc_logpath, "./dmalloc_%i.out", debug_rank);
printf("DMALLOC_PATH: %s \n", dmalloc_logpath);
-#endif
-
- struct lru_table* table = lru_table_create(5, 4);
+#endif
- int* zero = malloc(sizeof(int));
- int* one = malloc(sizeof(int));
- int* two = malloc(sizeof(int));
- int* three = malloc(sizeof(int));
- int* four = malloc(sizeof(int));
- int* five = malloc(sizeof(int));
- int* eight = malloc(sizeof(int));
+ struct lru_table* table = lru_table_create(5, 4);
+ int* zero = malloc(sizeof(int));
+ int* one = malloc(sizeof(int));
+ int* two = malloc(sizeof(int));
+ int* three = malloc(sizeof(int));
+ int* four = malloc(sizeof(int));
+ int* five = malloc(sizeof(int));
+ int* eight = malloc(sizeof(int));
+
*zero = 0;
*one = 1;
*two = 2;
*three = 3;
*four = 4;
*five = 5;
- *eight = 8;
-
- struct keyvalue* kv;
-
+ *eight = 8;
+
+ struct keyvalue* kv;
+
kv = lru_table_add(table, heap("two"), (char*) two, sizeof(int));
lru_table_printf("%i", table);
if (kv)
printf("victim: %s \n", kv->key);
- printf("\n");
-
+ printf("\n");
+
kv = lru_table_add(table, heap("one"), (char*) one, sizeof(int));
lru_table_printf("%i", table);
if (kv)
printf("victim: %s \n", kv->key);
- printf("\n");
-
+ printf("\n");
+
struct keyvalue* result;
result = lru_table_search(table, "one");
@@ -80,7 +80,7 @@
else
{
printf("data: %i\n", (int) *result->data);
- free(result);
+ free(result);
}
result = lru_table_search(table, "two");
@@ -89,7 +89,7 @@
else
{
printf("data: %i\n", (int) *result->data);
- free(result);
+ free(result);
}
result = lru_table_search(table, "two");
@@ -104,55 +104,55 @@
while ((result = lru_table_poll(table)))
{
printf("polled: %s %i\n", result->key, *result->data);
- keyvalue_destroy(result);
+ keyvalue_destroy(result);
}
- lru_table_free(table);
-
+ lru_table_free(table);
+
/*
int* result = (int*) lru_table_search(table, "five");
- printf("result: %i \n", *result);
+ printf("result: %i \n", *result);
lru_table_dump("%i", table);
result = (int*) lru_table_search(table, "twenty");
if (result == NULL)
- printf("Got NULL \n");
+ printf("Got NULL \n");
result = (int*) lru_table_search(table, "five");
- printf("result: %i \n", *result);
+ printf("result: %i \n", *result);
lru_table_dump("%i", table);
while ((kv = lru_table_poll(table)))
printf("polled: %s \n", kv->key);
*/
-
-
- /*
-
+
+
+ /*
+
lru_table_add(table, "five", &five);
- lru_table_excise(table, table->head);
+ lru_table_excise(table, table->head);
lru_table_dump("%i", table);
- printf("size: %i \n", table->size);
+ printf("size: %i \n", table->size);
kv = lru_table_add(table, "eight", &eight);
if (kv)
printf("%s \n", kv->key);
lru_table_dump("%i", table);
- printf("size: %i \n", table->size);
+ printf("size: %i \n", table->size);
- lru_table_touch(table, table->head->next);
+ lru_table_touch(table, table->head->next);
lru_table_dump("%i", table);
printf("size: %i \n", table->size);
- struct lru_table_item* item;
+ struct lru_table_item* item;
item = lru_table_poll(table);
lru_table_dump("%i", table);
printf("size: %i \n", table->size);
while ((item = lru_table_poll(table)))
- lru_table_dump("%i", table);
-
+ lru_table_dump("%i", table);
+
*/
- /*
+ /*
lru_table_dump("%i", table);
lru_table_poll(table);
lru_table_dump("%i", table);
@@ -165,17 +165,17 @@
// lru_table_clobber(table);
// lru_table_clear(table);
- // printf("size(table): %i \n", table->size);
+ // printf("size(table): %i \n", table->size);
// lru_table_clear(K);
- // printf("size(K): %i \n", K->size);
-
+ // printf("size(K): %i \n", K->size);
+
// lru_table_dump("%i", table);
-
+
// dmalloc_shutdown();
-
- MPI_Finalize();
- return 0;
+
+ MPI_Finalize();
+ return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 16:15:41
|
Revision: 19
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=19&view=rev
Author: jmwozniak
Date: 2010-04-20 16:15:35 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Better name.
Added Paths:
-----------
test/adts/test-dpkm_list.c
Removed Paths:
-------------
test/adts/test01.c
Copied: test/adts/test-dpkm_list.c (from rev 14, test/adts/test01.c)
===================================================================
--- test/adts/test-dpkm_list.c (rev 0)
+++ test/adts/test-dpkm_list.c 2010-04-20 16:15:35 UTC (rev 19)
@@ -0,0 +1,112 @@
+
+/**
+ * Test dpkm_list functionality.
+ * */
+
+#include <dpkm_list.h>
+
+int
+main(int argc, char* argv[])
+{
+ MPI_Init(&argc, &argv);
+ whoami();
+
+ struct dpkm_list* L = dpkm_list_create(4);
+
+ char s[1000];
+
+ int zero = 0;
+ // int one = 1;
+ int two = 2;
+ int three = 3;
+ int four = 4;
+ int five = 5;
+ int eight = 8;
+
+ struct dpkm_list_item* item;
+
+ item = dpkm_list_add(L, "two", &two, sizeof(int));
+ if (item)
+ printf("%s \n", item->key);
+ item = dpkm_list_add(L, "four", &four, sizeof(int));
+ if (item)
+ printf("%s \n", item->key);
+ item = dpkm_list_add(L, "three", &three, sizeof(int));
+ if (item)
+ printf("%s \n", item->key);
+ item = dpkm_list_add(L, "three", &three, sizeof(int));
+ if (item)
+ printf("%s \n", item->key);
+ item = dpkm_list_add(L, "four", &four, sizeof(int));
+ if (item)
+ printf("%s \n", item->key);
+ item = dpkm_list_add(L, "zero", &zero, sizeof(int));
+ if (item)
+ printf("%s \n", item->key);
+
+ fflush(stdout);
+
+ dpkm_list_printf("%i", L);
+ printf("size: %i \n", L->size);
+
+ dpkm_list_add(L, "five", &five, sizeof(int));
+ dpkm_list_excise(L, L->head);
+ dpkm_list_printf("%i", L);
+ printf("size: %i \n", L->size);
+
+ item = dpkm_list_add(L, "eight", &eight, sizeof(int));
+ if (item)
+ printf("%s \n", item->key);
+ dpkm_list_printf("%i", L);
+ printf("size: %i \n", L->size);
+
+ dpkm_list_tostring(s, 1000, "%i", L);
+ printf("From string: %s\n", s);
+
+ //dpkm_list_search(L, "five");
+ dpkm_list_printf("%i", L);
+ printf("size: %i \n", L->size);
+
+ item = dpkm_list_poll(L);
+ dpkm_list_printf("%i", L);
+ printf("size: %i \n", L->size);
+
+ item = dpkm_list_search(L, "zero");
+ dpkm_list_excise(L, item);
+ dpkm_list_printf("%i", L);
+
+ note("polling...");
+
+ while ((item = dpkm_list_poll(L)))
+ {
+ printf("got: %s \n", item->key);
+ dpkm_list_printf("%i", L);
+ }
+
+ dpkm_list_tostring(s, 1000, "%i", L);
+ printf("From string: %s\n", s);
+
+ /*
+ dpkm_list_printf("%i", L);
+ dpkm_list_poll(L);
+ dpkm_list_printf("%i", L);
+ dpkm_list_pop(L);
+ dpkm_list_printf("%i", L);
+ dpkm_list_add(L, &seven);
+ dpkm_list_add(L, &six);
+ dpkm_list_printf("%i", L);
+ */
+
+ // dpkm_list_clobber(L);
+ // dpkm_list_clear(L);
+ // printf("size(L): %i \n", L->size);
+
+ // dpkm_list_clear(K);
+ // printf("size(K): %i \n", K->size);
+
+ // dpkm_list_printf("%i", L);
+ MPI_Finalize();
+ return 0;
+}
+
+
Property changes on: test/adts/test-dpkm_list.c
___________________________________________________________________
Added: svn:mergeinfo
+
Deleted: test/adts/test01.c
===================================================================
--- test/adts/test01.c 2010-04-20 16:14:18 UTC (rev 18)
+++ test/adts/test01.c 2010-04-20 16:15:35 UTC (rev 19)
@@ -1,112 +0,0 @@
-
-/**
- * Test dpkm_list functionality.
- * */
-
-#include <dpkm_list.h>
-
-int
-main(int argc, char* argv[])
-{
- MPI_Init(&argc, &argv);
- whoami();
-
- struct dpkm_list* L = dpkm_list_create(4);
-
- char s[1000];
-
- int zero = 0;
- // int one = 1;
- int two = 2;
- int three = 3;
- int four = 4;
- int five = 5;
- int eight = 8;
-
- struct dpkm_list_item* item;
-
- item = dpkm_list_add(L, "two", &two, sizeof(int));
- if (item)
- printf("%s \n", item->key);
- item = dpkm_list_add(L, "four", &four, sizeof(int));
- if (item)
- printf("%s \n", item->key);
- item = dpkm_list_add(L, "three", &three, sizeof(int));
- if (item)
- printf("%s \n", item->key);
- item = dpkm_list_add(L, "three", &three, sizeof(int));
- if (item)
- printf("%s \n", item->key);
- item = dpkm_list_add(L, "four", &four, sizeof(int));
- if (item)
- printf("%s \n", item->key);
- item = dpkm_list_add(L, "zero", &zero, sizeof(int));
- if (item)
- printf("%s \n", item->key);
-
- fflush(stdout);
-
- dpkm_list_printf("%i", L);
- printf("size: %i \n", L->size);
-
- dpkm_list_add(L, "five", &five, sizeof(int));
- dpkm_list_excise(L, L->head);
- dpkm_list_printf("%i", L);
- printf("size: %i \n", L->size);
-
- item = dpkm_list_add(L, "eight", &eight, sizeof(int));
- if (item)
- printf("%s \n", item->key);
- dpkm_list_printf("%i", L);
- printf("size: %i \n", L->size);
-
- dpkm_list_tostring(s, 1000, "%i", L);
- printf("From string: %s\n", s);
-
- //dpkm_list_search(L, "five");
- dpkm_list_printf("%i", L);
- printf("size: %i \n", L->size);
-
- item = dpkm_list_poll(L);
- dpkm_list_printf("%i", L);
- printf("size: %i \n", L->size);
-
- item = dpkm_list_search(L, "zero");
- dpkm_list_excise(L, item);
- dpkm_list_printf("%i", L);
-
- note("polling...");
-
- while ((item = dpkm_list_poll(L)))
- {
- printf("got: %s \n", item->key);
- dpkm_list_printf("%i", L);
- }
-
- dpkm_list_tostring(s, 1000, "%i", L);
- printf("From string: %s\n", s);
-
- /*
- dpkm_list_printf("%i", L);
- dpkm_list_poll(L);
- dpkm_list_printf("%i", L);
- dpkm_list_pop(L);
- dpkm_list_printf("%i", L);
- dpkm_list_add(L, &seven);
- dpkm_list_add(L, &six);
- dpkm_list_printf("%i", L);
- */
-
- // dpkm_list_clobber(L);
- // dpkm_list_clear(L);
- // printf("size(L): %i \n", L->size);
-
- // dpkm_list_clear(K);
- // printf("size(K): %i \n", K->size);
-
- // dpkm_list_printf("%i", L);
- MPI_Finalize();
- return 0;
-}
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 16:14:25
|
Revision: 18
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=18&view=rev
Author: jmwozniak
Date: 2010-04-20 16:14:18 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Minors.
Modified Paths:
--------------
test/mpirpc/module.mk.in
test/mpirpc/test01.c
Added Paths:
-----------
test/gossip/test-do.c
Removed Paths:
-------------
test/gossip/test03.c
Copied: test/gossip/test-do.c (from rev 17, test/gossip/test03.c)
===================================================================
--- test/gossip/test-do.c (rev 0)
+++ test/gossip/test-do.c 2010-04-20 16:14:18 UTC (rev 18)
@@ -0,0 +1,36 @@
+/**
+ * Test gossip functionality.
+ * */
+
+#include <mpi.h>
+#include <gs-debug.h>
+#include <mpi_tools.h>
+
+int main(int argc, char* argv[])
+{
+ MPI_Init(&argc, &argv);
+
+ whoami();
+
+ printf(
+"This test program will print an example debugging message on the final\n"
+"line of output if the CMPI_DEBUG_MASK environment variable is set to include\n"
+"\"example\" or \"all\" in its comma seperated list of masks:\n"
+ );
+
+ gossip_debug_init();
+
+ gossip_do(MASK_EXAMPLE, printf("Hello\n"));
+
+ MPI_Finalize();
+ return 0;
+}
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
Property changes on: test/gossip/test-do.c
___________________________________________________________________
Added: svn:mergeinfo
+
Deleted: test/gossip/test03.c
===================================================================
--- test/gossip/test03.c 2010-04-20 16:07:29 UTC (rev 17)
+++ test/gossip/test03.c 2010-04-20 16:14:18 UTC (rev 18)
@@ -1,36 +0,0 @@
-/**
- * Test gossip functionality.
- * */
-
-#include <mpi.h>
-#include <gs-debug.h>
-#include <mpi_tools.h>
-
-int main(int argc, char* argv[])
-{
- MPI_Init(&argc, &argv);
-
- whoami();
-
- printf(
-"This test program will print an example debugging message on the final\n"
-"line of output if the CMPI_DEBUG_MASK environment variable is set to include\n"
-"\"example\" or \"all\" in its comma seperated list of masks:\n"
- );
-
- gossip_debug_init();
-
- gossip_do(MASK_EXAMPLE, printf("Hello\n"));
-
- MPI_Finalize();
- return 0;
-}
-
-/*
- * Local variables:
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
Modified: test/mpirpc/module.mk.in
===================================================================
--- test/mpirpc/module.mk.in 2010-04-20 16:07:29 UTC (rev 17)
+++ test/mpirpc/module.mk.in 2010-04-20 16:14:18 UTC (rev 18)
@@ -1,12 +1,10 @@
-DIR := test/mpirpc-2
+DIR := test/mpirpc
-ifeq (@USE_MPIRPC_2@,1)
-
TEST_MPIRPC_SRC += $(shell find $(DIR) -name "*.c" )
TEST_SRC += $(TEST_MPIRPC_SRC)
-test/mpirpc-2/test%.out: test/mpirpc-2/test%.x
+test/mpirpc/test%.out: test/mpirpc/test%.x
$(LAUNCH) -n $(NODES) $(<) -c "reps=$(REPS)" > $(@) 2>&1
cp -uv $(@) test/mpirpc/readable.txt
@@ -14,11 +12,3 @@
$(Q) " MPICC $(@) "
$(E)$(MPICC) $(MPE) $(<) $(CMPI) $(LIBS) -o $(@)
-else
-
-$(DIR)/test%.x: $(DIR)/test%.o $(CMPI)
- $(Q) " MPICC $(@) "
- $(E)$(MPICC) $(MPE) $(<) $(CMPI) $(LIBS) -o $(@)
-
-endif
-
Modified: test/mpirpc/test01.c
===================================================================
--- test/mpirpc/test01.c 2010-04-20 16:07:29 UTC (rev 17)
+++ test/mpirpc/test01.c 2010-04-20 16:14:18 UTC (rev 18)
@@ -1,28 +1,28 @@
/**
Simple two-processor ping pong test.
- No arguments or return values.
+ No arguments or return values.
*/
-#include <sys/stat.h>
+#include <sys/stat.h>
#include <mpirpc.h>
-#include "test_helpers.h"
+#include "test_helpers.h"
-int count = 0;
-bool running = true;
+int count = 0;
+bool running = true;
-char*
+char*
file_string(char* file)
{
intmax_t size;
- struct stat stats;
+ struct stat stats;
- stat(file, &stats);
- size = (intmax_t) stats.st_size;
- char* result = malloc(size+1);
-
+ stat(file, &stats);
+ size = (intmax_t) stats.st_size;
+ char* result = malloc(size+1);
+
FILE* f = fopen(file, "r");
fread(result, 1, size, f);
fclose(f);
@@ -33,18 +33,18 @@
handle_ping(MPIRPC_Node caller, int unique, char* args,
char* blob, int blob_length)
{
- NOTE_F;
+ NOTE_F;
SHOW_S(args);
- MPIRPC_Null(caller, unique);
+ MPIRPC_Null(caller, unique);
if (count++ < 3)
{
- MPIRPC_Call(caller, "ping", NULL, NULL, MPIRPC_Free);
+ MPIRPC_Call(caller, "ping", NULL, NULL, MPIRPC_Free);
}
else
{
MPIRPC_Flush_returns();
MPIRPC_Block(caller, "quit", NULL);
- running = false;
+ running = false;
}
}
@@ -52,29 +52,29 @@
handle_quit(MPIRPC_Node caller, int unique, char* args,
char* blob, int blob_length)
{
- NOTE_F;
+ NOTE_F;
SHOW_S(args);
- running = false;
+ running = false;
MPIRPC_Null(caller, unique);
}
int
main(int argc, char* argv[])
{
- printf("host: %s\n", file_string("/etc/hostname"));
-
+ printf("host: %s\n", file_string("/etc/hostname"));
+
MPI_Init(&argc, &argv);
MPIRPC_Init();
- SHOW_I(debug_rank);
-
- DMALLOC_SETUP(dmalloc_setup());
-
- MPIRPC_Comm_add(MPI_COMM_WORLD);
+ SHOW_I(debug_rank);
+
+ DMALLOC_SETUP(dmalloc_setup());
+
+ MPIRPC_Comm_add(MPI_COMM_WORLD);
MPIRPC_Register("ping", handle_ping);
MPIRPC_Register("quit", handle_quit);
-
+
MPIRPC_Node neighbor;
if (mpi_rank == 0)
{
@@ -83,24 +83,24 @@
}
else
{
- MPIRPC_Node_make(MPI_COMM_WORLD, 0, &neighbor);
+ MPIRPC_Node_make(MPI_COMM_WORLD, 0, &neighbor);
}
-
+
while (running)
{
MPIRPC_Check();
sleep(1);
}
- note("Normal exit.\n");
-
- MPIRPC_Finalize();
+ note("Normal exit.\n");
+
+ MPIRPC_Finalize();
MPI_Finalize();
DMALLOC_SETUP(if (mpi_rank == 0)
{
- SHOW_S(dmalloc_logpath);
+ SHOW_S(dmalloc_logpath);
dmalloc_shutdown();
});
- return 0;
+ return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 16:07:35
|
Revision: 17
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=17&view=rev
Author: jmwozniak
Date: 2010-04-20 16:07:29 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Fix test.
Modified Paths:
--------------
clean.zsh
test/gossip/test03.c
Modified: clean.zsh
===================================================================
--- clean.zsh 2010-04-20 16:02:43 UTC (rev 16)
+++ clean.zsh 2010-04-20 16:07:29 UTC (rev 17)
@@ -1,6 +1,7 @@
#!/bin/zsh
# Cleanup before SVN operations
+# Use ./config.status to get going again after this
MODULES=( $( print **/module.mk ) )
if [[ ${#MODULES} > 0 ]]
Modified: test/gossip/test03.c
===================================================================
--- test/gossip/test03.c 2010-04-20 16:02:43 UTC (rev 16)
+++ test/gossip/test03.c 2010-04-20 16:07:29 UTC (rev 17)
@@ -14,13 +14,13 @@
printf(
"This test program will print an example debugging message on the final\n"
-"line of output if the GS_DEBUG_MASK environment variable is set to include\n"
+"line of output if the CMPI_DEBUG_MASK environment variable is set to include\n"
"\"example\" or \"all\" in its comma seperated list of masks:\n"
);
gossip_debug_init();
- gossip_do(MASK_EXAMPLE, NOTE("Hello"));
+ gossip_do(MASK_EXAMPLE, printf("Hello\n"));
MPI_Finalize();
return 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 16:02:50
|
Revision: 16
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=16&view=rev
Author: jmwozniak
Date: 2010-04-20 16:02:43 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
More helpful names.
Added Paths:
-----------
test/gossip/test-env.c
test/gossip/test-masks.c
Removed Paths:
-------------
test/gossip/test01.c
test/gossip/test02.c
Copied: test/gossip/test-env.c (from rev 15, test/gossip/test02.c)
===================================================================
--- test/gossip/test-env.c (rev 0)
+++ test/gossip/test-env.c 2010-04-20 16:02:43 UTC (rev 16)
@@ -0,0 +1,33 @@
+/**
+ * Test gossip functionality.
+ * */
+
+#include <mpi.h>
+#include <gs-debug.h>
+
+int main(int argc, char* argv[])
+{
+ MPI_Init(&argc, &argv);
+
+ printf(
+"This test program will print an example debugging message on the final\n"
+"line of output if the CMPI_DEBUG_MASK environment variable is set to include\n"
+"\"example\" or \"all\" in its comma separated list of masks:\n"
+ );
+
+ gossip_debug_init();
+
+ gossip_debug(MASK_EXAMPLE, "Example debugging message.\n");
+
+ MPI_Finalize();
+ return 0;
+}
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
Property changes on: test/gossip/test-env.c
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: test/gossip/test-masks.c (from rev 14, test/gossip/test01.c)
===================================================================
--- test/gossip/test-masks.c (rev 0)
+++ test/gossip/test-masks.c 2010-04-20 16:02:43 UTC (rev 16)
@@ -0,0 +1,75 @@
+
+/**
+ * Test gossip functionality.
+ * */
+
+#include <mpi.h>
+#include <gossip.h>
+
+#define MASK1 ((uint64_t)1 << 0)
+#define MASK2 ((uint64_t)1 << 1)
+#define MASK3 ((uint64_t)1 << 2)
+
+int main(int argc, char* argv[])
+{
+ MPI_Init(&argc, &argv);
+
+/* examples of configuring gossip */
+/*******************************************************************/
+
+ /* control where the output goes, if desired */
+
+ /* stderr by default, no need to enable */
+ /* gossip_enable_stderr(); */
+ /* to log to a particular file */
+ /* gossip_enable_file("test.log", "w"); */
+ /* to log to syslog */
+ /* gossip_enable_syslog(LOG_USER); */
+
+ /* control what timestamp format to use */
+
+ /* usec granularity */
+ /* gossip_set_logstamp(GOSSIP_LOGSTAMP_USEC); */
+ /* turn off timestamp */
+ /* gossip_set_logstamp(GOSSIP_LOGSTAMP_NONE); */
+ /* use prettier, lower granularity for system services */
+ /* gossip_set_logstamp(GOSSIP_LOGSTAMP_DATETIME); */
+ /* like usec, but also shows thread number */
+ /* gossip_set_logstamp(GOSSIP_LOGSTAMP_THREAD); */
+
+ /* like usec, but also shows mpi rank, default for grayskull */
+ /* gossip_set_logstamp(GOSSIP_LOGSTAMP_MPI); */
+
+ /* control what mask levels get printed, one and two for this test */
+ /* all masks off by default */
+ gossip_set_debug_mask(1, MASK1|MASK2);
+
+
+/* examples of internal code using gossip */
+/*******************************************************************/
+
+ gossip_err("Error message.\n");
+ gossip_err("Error message, printf style: %d.\n", 12345);
+ gossip_lerr("Error message, with line info.\n");
+
+ /* examples of printing debugging messages */
+ gossip_debug(MASK1, "Debug mask 1.\n");
+ gossip_debug(MASK2, "Debug mask 2.\n");
+ gossip_debug(MASK3, "Debug mask 3.\n");
+
+ gossip_ldebug(MASK1, "Debug mask 1, with line info.\n");
+ gossip_ldebug(MASK2, "Debug mask 2, with line info.\n");
+ gossip_ldebug(MASK3, "Debug mask 3, with line info.\n");
+
+ MPI_Finalize();
+ return 0;
+}
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
Property changes on: test/gossip/test-masks.c
___________________________________________________________________
Added: svn:mergeinfo
+
Deleted: test/gossip/test01.c
===================================================================
--- test/gossip/test01.c 2010-04-20 16:01:22 UTC (rev 15)
+++ test/gossip/test01.c 2010-04-20 16:02:43 UTC (rev 16)
@@ -1,75 +0,0 @@
-
-/**
- * Test gossip functionality.
- * */
-
-#include <mpi.h>
-#include <gossip.h>
-
-#define MASK1 ((uint64_t)1 << 0)
-#define MASK2 ((uint64_t)1 << 1)
-#define MASK3 ((uint64_t)1 << 2)
-
-int main(int argc, char* argv[])
-{
- MPI_Init(&argc, &argv);
-
-/* examples of configuring gossip */
-/*******************************************************************/
-
- /* control where the output goes, if desired */
-
- /* stderr by default, no need to enable */
- /* gossip_enable_stderr(); */
- /* to log to a particular file */
- /* gossip_enable_file("test.log", "w"); */
- /* to log to syslog */
- /* gossip_enable_syslog(LOG_USER); */
-
- /* control what timestamp format to use */
-
- /* usec granularity */
- /* gossip_set_logstamp(GOSSIP_LOGSTAMP_USEC); */
- /* turn off timestamp */
- /* gossip_set_logstamp(GOSSIP_LOGSTAMP_NONE); */
- /* use prettier, lower granularity for system services */
- /* gossip_set_logstamp(GOSSIP_LOGSTAMP_DATETIME); */
- /* like usec, but also shows thread number */
- /* gossip_set_logstamp(GOSSIP_LOGSTAMP_THREAD); */
-
- /* like usec, but also shows mpi rank, default for grayskull */
- /* gossip_set_logstamp(GOSSIP_LOGSTAMP_MPI); */
-
- /* control what mask levels get printed, one and two for this test */
- /* all masks off by default */
- gossip_set_debug_mask(1, MASK1|MASK2);
-
-
-/* examples of internal code using gossip */
-/*******************************************************************/
-
- gossip_err("Error message.\n");
- gossip_err("Error message, printf style: %d.\n", 12345);
- gossip_lerr("Error message, with line info.\n");
-
- /* examples of printing debugging messages */
- gossip_debug(MASK1, "Debug mask 1.\n");
- gossip_debug(MASK2, "Debug mask 2.\n");
- gossip_debug(MASK3, "Debug mask 3.\n");
-
- gossip_ldebug(MASK1, "Debug mask 1, with line info.\n");
- gossip_ldebug(MASK2, "Debug mask 2, with line info.\n");
- gossip_ldebug(MASK3, "Debug mask 3, with line info.\n");
-
- MPI_Finalize();
- return 0;
-}
-
-/*
- * Local variables:
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
Deleted: test/gossip/test02.c
===================================================================
--- test/gossip/test02.c 2010-04-20 16:01:22 UTC (rev 15)
+++ test/gossip/test02.c 2010-04-20 16:02:43 UTC (rev 16)
@@ -1,33 +0,0 @@
-/**
- * Test gossip functionality.
- * */
-
-#include <mpi.h>
-#include <gs-debug.h>
-
-int main(int argc, char* argv[])
-{
- MPI_Init(&argc, &argv);
-
- printf(
-"This test program will print an example debugging message on the final\n"
-"line of output if the CMPI_DEBUG_MASK environment variable is set to include\n"
-"\"example\" or \"all\" in its comma separated list of masks:\n"
- );
-
- gossip_debug_init();
-
- gossip_debug(MASK_EXAMPLE, "Example debugging message.\n");
-
- MPI_Finalize();
- return 0;
-}
-
-/*
- * Local variables:
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 16:01:30
|
Revision: 15
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=15&view=rev
Author: jmwozniak
Date: 2010-04-20 16:01:22 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Tests compile.
Modified Paths:
--------------
include/gossip.h
setup.sh
src/gossip/gossip.c
test/cmpi-io/module.mk.in
test/gossip/test02.c
test/gossip/test03.c
Modified: include/gossip.h
===================================================================
--- include/gossip.h 2010-04-20 04:38:49 UTC (rev 14)
+++ include/gossip.h 2010-04-20 16:01:22 UTC (rev 15)
@@ -20,6 +20,23 @@
#ifndef __GOSSIP_H
#define __GOSSIP_H
+#include <errno.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <time.h>
+#include <sys/time.h>
+#ifdef HAVE_EXECINFO_H
+#include <execinfo.h>
+#endif
+#ifdef __GOSSIP_ENABLE_MPI__
+#include <mpi.h>
+#endif
+
#ifndef __KERNEL__
#include <stdint.h>
#include <stdarg.h>
@@ -28,17 +45,19 @@
#include "cmpi-config.h"
// Masks...
-#define MASK_NONE ((uint64_t)0)
-#define MASK_DEBUG ((uint64_t)1 << 1)
-#define MASK_MPIRPC ((uint64_t)1 << 2)
-#define MASK_DHT ((uint64_t)1 << 3)
-#define MASK_ADTS ((uint64_t)1 << 4)
-#define MASK_DRIVER ((uint64_t)1 << 5)
-#define MASK_CMPI ((uint64_t)1 << 6)
-#define MASK_ARCH ((uint64_t)1 << 7)
-#define MASK_STORAGE ((uint64_t)1 << 8)
-#define MASK_KDA ((uint64_t)1 << 9)
-#define MASK_CLIENT ((uint64_t)1 << 12)
+#define MASK_ALL ((uint64_t) -1)
+#define MASK_NONE ((uint64_t) 0)
+#define MASK_DEBUG ((uint64_t) 1 << 1)
+#define MASK_MPIRPC ((uint64_t) 1 << 2)
+#define MASK_DHT ((uint64_t) 1 << 3)
+#define MASK_ADTS ((uint64_t) 1 << 4)
+#define MASK_DRIVER ((uint64_t) 1 << 5)
+#define MASK_CMPI ((uint64_t) 1 << 6)
+#define MASK_ARCH ((uint64_t) 1 << 7)
+#define MASK_STORAGE ((uint64_t) 1 << 8)
+#define MASK_KDA ((uint64_t) 1 << 9)
+#define MASK_EXAMPLE ((uint64_t) 1 << 10)
+#define MASK_CLIENT ((uint64_t) 1 << 12)
/********************************************************************
* Visible interface
@@ -57,6 +76,18 @@
};
#define GOSSIP_LOGSTAMP_DEFAULT GOSSIP_LOGSTAMP_MPI
+#define gossip_debug_init() \
+do {\
+ char* __mask_str; \
+ uint64_t __mask; \
+ __mask_str = getenv("CMPI_DEBUG_MASK"); \
+ __mask = (__mask_str ? gossip_set_debug_mask_human(__mask_str) : 0); \
+ gossip_set_debug_mask(1, __mask); \
+}while(0)
+
+uint64_t gossip_set_debug_mask_human(
+ const char *event_logging);
+
/* Keep a simplified version for the kmod */
#ifdef __KERNEL__
Modified: setup.sh
===================================================================
--- setup.sh 2010-04-20 04:38:49 UTC (rev 14)
+++ setup.sh 2010-04-20 16:01:22 UTC (rev 15)
@@ -4,9 +4,11 @@
mkdir -p maint/config
-if [[ -f configure &&
- ! configure.ac -nt configure ]]
+if [[ ! -f configure ||
+ configure.ac -nt configure ]]
then
+ echo "regenerating..."
+else
echo "CMPI configure is up-to-date"
exit 2
fi
Modified: src/gossip/gossip.c
===================================================================
--- src/gossip/gossip.c 2010-04-20 04:38:49 UTC (rev 14)
+++ src/gossip/gossip.c 2010-04-20 16:01:22 UTC (rev 15)
@@ -8,32 +8,11 @@
* \ingroup gossip
*
* Implementation of gossip interface.
+ * Handles debugging output.
*/
-// #include "cmpi-config.h"
+#include <gossip.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <errno.h>
-#include <syslog.h>
-#include <stdlib.h>
-#include <time.h>
-#include <sys/time.h>
-#ifdef HAVE_EXECINFO_H
-#include <execinfo.h>
-#endif
-#ifdef __GOSSIP_ENABLE_MPI__
-#include <mpi.h>
-#endif
-
-#include "gossip.h"
-
-#if 0
-#include "gen-locks.h"
-#endif
-
/** controls whether debugging is on or off */
int gossip_debug_on = 0;
@@ -200,7 +179,7 @@
return ret;
}
-/** Fills in args indicating whether debugging is on or off, and what the
+/** Fills in args indicating whether debugging is on or off, and what the
* mask level is.
*
* \return 0 on success, -errno on failure.
@@ -249,7 +228,7 @@
#ifndef __GNUC__
/* __gossip_debug_stub()
- *
+ *
* stub for gossip_debug that doesn't do anything; used when debugging
* is "compiled out" on non-gcc builds
*
@@ -267,7 +246,7 @@
/* __gossip_debug()
- *
+ *
* Logs a standard debugging message. It will not be printed unless the
* mask value matches (logical "and" operation) with the mask specified in
* gossip_set_debug_mask() and debugging is turned on.
@@ -300,7 +279,7 @@
int ret = -EINVAL;
/* NOTE: this check happens in the macro (before making a function call)
- * if we use gcc
+ * if we use gcc
*/
#ifndef __GNUC__
/* exit quietly if we aren't meant to print */
@@ -409,7 +388,7 @@
*/
/* gossip_debug_syslog()
- *
+ *
* This is the standard debugging message function for the syslog logging
* facility
*
@@ -440,7 +419,7 @@
return 0;
}
-int gossip_debug_fp(FILE *fp, char prefix,
+int gossip_debug_fp(FILE *fp, char prefix,
enum gossip_logstamp ts, const char *format, ...)
{
int ret;
@@ -454,7 +433,7 @@
}
/* gossip_debug_fp_va()
- *
+ *
* This is the standard debugging message function for the file logging
* facility or to stderr.
*
@@ -496,7 +475,7 @@
tp = tv.tv_sec;
strftime(bptr, 9, "%H:%M:%S", localtime(&tp));
#if 0
- sprintf(bptr+8, ".%06ld (%ld)] ", (long)tv.tv_usec,
+ sprintf(bptr+8, ".%06ld (%ld)] ", (long)tv.tv_usec,
gen_thread_self());
#endif
/* CUT OUT THREAD -- RBR, 12/18/2007 */
@@ -542,7 +521,7 @@
}
/* gossip_err_syslog()
- *
+ *
* error message function for the syslog logging facility
*
* returns 0 on success, -errno on failure
@@ -566,7 +545,7 @@
/* gossip_disable_stderr()
- *
+ *
* The shutdown function for the stderr logging facility.
*
* returns 0 on success, -errno on failure
@@ -579,7 +558,7 @@
}
/* gossip_disable_file()
- *
+ *
* The shutdown function for the file logging facility.
*
* returns 0 on success, -errno on failure
@@ -596,7 +575,7 @@
}
/* gossip_disable_syslog()
- *
+ *
* The shutdown function for the syslog logging facility.
*
* returns 0 on success, -errno on failure
@@ -608,7 +587,93 @@
return 0;
}
+
+/* a private internal type */
+typedef struct
+{
+ const char *keyword;
+ uint64_t mask_val;
+} __keyword_mask_t;
+
+
+
+/* map all config keywords to pvfs2 debug masks here */
+static __keyword_mask_t s_keyword_mask_map[] =
+{
+ /* example level until we have real masks */
+ { "example", MASK_EXAMPLE },
+
+ /* NOTE: add additional levels here */
+
+ /* No debug output */
+ { "none", MASK_NONE },
+ /* Everything */
+ { "all", MASK_ALL }
+};
+#undef __DEBUG_ALL
+
+static const int num_keyword_mask_map = (int) \
+(sizeof(s_keyword_mask_map) / sizeof(__keyword_mask_t));
+
+static uint64_t debug_to_mask(__keyword_mask_t *mask_map,
+ int num_mask_map, const char *event_logging)
+{
+ uint64_t mask = 0;
+ char *s = NULL, *t = NULL;
+ const char *toks = ", ";
+ int i = 0, negate = 0;
+
+ if (event_logging)
+ {
+ s = strdup(event_logging);
+ t = strtok(s, toks);
+
+ while(t)
+ {
+ if (*t == '-')
+ {
+ negate = 1;
+ ++t;
+ }
+
+ for(i = 0; i < num_mask_map; i++)
+ {
+ if (!strcmp(t, mask_map[i].keyword))
+ {
+ if (negate)
+ {
+ mask &= ~mask_map[i].mask_val;
+ }
+ else
+ {
+ mask |= mask_map[i].mask_val;
+ }
+ break;
+ }
+ }
+ t = strtok(NULL, toks);
+ }
+ free(s);
+ }
+ return mask;
+}
+
/*
+ * Based on human readable keywords, translate them into
+ * a mask value appropriate for the debugging level desired.
+ * The 'computed' mask is returned; 0 if no keywords are
+ * present or recognized.
+ *
+ * Prefix a keyword with "-" to turn it off. All keywords
+ * processed in specified order.
+ */
+uint64_t gossip_set_debug_mask_human(const char *event_logging)
+{
+ return debug_to_mask(s_keyword_mask_map,
+ num_keyword_mask_map, event_logging);
+}
+
+/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
Modified: test/cmpi-io/module.mk.in
===================================================================
--- test/cmpi-io/module.mk.in 2010-04-20 04:38:49 UTC (rev 14)
+++ test/cmpi-io/module.mk.in 2010-04-20 16:01:22 UTC (rev 15)
@@ -6,7 +6,6 @@
TEST_HELPER_OBJS += test/cmpi/test_helpers.o
-test/cmpi-io/test%.x: test/cmpi-io/test%.o $(CMPI) $(HELPERS)
+test/cmpi-io/test%.x: test/cmpi-io/test%.o $(CMPI) test/cmpi/test_helpers.o
$(Q) " MPICC $(@) "
- $(E)$(MPICC) $(MPE) $(<) $(CMPI) $(HELPERS) $(LIBS) -o $(@)
-
+ $(E)$(MPICC) $(MPE) $(<) $(CMPI) test/cmpi/test_helpers.o $(LIBS) -o $(@)
Modified: test/gossip/test02.c
===================================================================
--- test/gossip/test02.c 2010-04-20 04:38:49 UTC (rev 14)
+++ test/gossip/test02.c 2010-04-20 16:01:22 UTC (rev 15)
@@ -11,16 +11,16 @@
printf(
"This test program will print an example debugging message on the final\n"
-"line of output if the GS_DEBUG_MASK environment variable is set to include\n"
-"\"example\" or \"all\" in its comma seperated list of masks:\n"
+"line of output if the CMPI_DEBUG_MASK environment variable is set to include\n"
+"\"example\" or \"all\" in its comma separated list of masks:\n"
);
- gs_debug_init();
+ gossip_debug_init();
- gossip_debug(GS_D_EXAMPLE, "Example debugging message.\n");
+ gossip_debug(MASK_EXAMPLE, "Example debugging message.\n");
- MPI_Finalize();
- return 0;
+ MPI_Finalize();
+ return 0;
}
/*
Modified: test/gossip/test03.c
===================================================================
--- test/gossip/test03.c 2010-04-20 04:38:49 UTC (rev 14)
+++ test/gossip/test03.c 2010-04-20 16:01:22 UTC (rev 15)
@@ -4,26 +4,26 @@
#include <mpi.h>
#include <gs-debug.h>
-#include <mpi_tools.h>
+#include <mpi_tools.h>
int main(int argc, char* argv[])
{
MPI_Init(&argc, &argv);
whoami();
-
+
printf(
"This test program will print an example debugging message on the final\n"
"line of output if the GS_DEBUG_MASK environment variable is set to include\n"
"\"example\" or \"all\" in its comma seperated list of masks:\n"
);
- gs_debug_init();
-
- gossip_do(GS_D_EXAMPLE, NOTE("Hello"));
+ gossip_debug_init();
- MPI_Finalize();
- return 0;
+ gossip_do(MASK_EXAMPLE, NOTE("Hello"));
+
+ MPI_Finalize();
+ return 0;
}
/*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 04:38:56
|
Revision: 14
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=14&view=rev
Author: jmwozniak
Date: 2010-04-20 04:38:49 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Add depend.sh .
Added Paths:
-----------
depend.sh
Added: depend.sh
===================================================================
--- depend.sh (rev 0)
+++ depend.sh 2010-04-20 04:38:49 UTC (rev 14)
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+DIR="$1"
+shift
+if [ -n "$DIR" ] ; then
+ DIR="$DIR"/
+fi
+exec $CC -M -MG "$@" | sed -e "s@^\(.*\)\.o:@$DIR\1.d $DIR\1.o $DIR\1.po:@"
Property changes on: depend.sh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 04:38:15
|
Revision: 13
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=13&view=rev
Author: jmwozniak
Date: 2010-04-20 04:38:07 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Improvements...
Modified Paths:
--------------
Makefile.in
setup.sh
src/gossip/module.mk.in
src/mpirpc/module.mk.in
test/adts/module.mk.in
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-20 04:26:19 UTC (rev 12)
+++ Makefile.in 2010-04-20 04:38:07 UTC (rev 13)
@@ -562,14 +562,9 @@
$(E)rm -fv $(CMPI_DEPS) $(TEST_DEPS) \
$(MPIRPC) $(CMPI) $(MPIRPC_OBJS) $(CMPI_OBJS) \
$(KDA_OBJS) $(CMPI_IO) $(CMPI_PICS) \
- hex unhex hexord unpublish node driver \
- $(TEST_OUTPUT) $(TEST_PROGS) $(TEST_OBJS) \
- $(CMPI_PROGS) $(CMPI_CP_OBJS) splint.out \
- $(GUM_OBJS) \
- $(GOBS_OBJS) $(GOBS) src/gobs/launch.o \
- $(GACK_OBJS) $(GACK) \
- $(SKULLFS_OBJS) \
- $(ALL_GS_S) $(ALL_GS_I) $(ALL_GS_DUMMY)
+ hex unhex hexord unpublish node driver \
+ $(TEST_OUTPUT) $(TEST_PROGS) $(TEST_OBJS) \
+ $(CMPI_PROGS) $(CMPI_CP_OBJS) splint.out
# $(E)find . -name "*.avg" -exec rm -fv \{\} \;
# $(E)find . -name "*.per" -exec rm -fv \{\} \;
Modified: setup.sh
===================================================================
--- setup.sh 2010-04-20 04:26:19 UTC (rev 12)
+++ setup.sh 2010-04-20 04:38:07 UTC (rev 13)
@@ -4,11 +4,18 @@
mkdir -p maint/config
+if [[ -f configure &&
+ ! configure.ac -nt configure ]]
+then
+ echo "CMPI configure is up-to-date"
+ exit 2
+fi
+
if aclocal -I ./maint/config && autoheader && autoconf ; then
- echo "CMPI configure script successfully regenerated"
+ echo "CMPI configure script successfully regenerated"
else
- echo "Some part of configure regeneration failed!"
- exit 1
+ echo "Some part of configure regeneration failed!"
+ exit 1
fi
exit 0
Modified: src/gossip/module.mk.in
===================================================================
--- src/gossip/module.mk.in 2010-04-20 04:26:19 UTC (rev 12)
+++ src/gossip/module.mk.in 2010-04-20 04:38:07 UTC (rev 13)
@@ -5,7 +5,6 @@
DIR := src/gossip
ADT_SRC += $(DIR)/gossip.c
-ADT_SRC += $(DIR)/gs-debug.c
ifdef GOSSIP_ENABLE_BACKTRACE
MODCFLAGS_$(DIR)/gossip.c := -DGOSSIP_ENABLE_BACKTRACE
Modified: src/mpirpc/module.mk.in
===================================================================
--- src/mpirpc/module.mk.in 2010-04-20 04:26:19 UTC (rev 12)
+++ src/mpirpc/module.mk.in 2010-04-20 04:38:07 UTC (rev 13)
@@ -1,8 +1,4 @@
-DIR := $(MPIRPC_DIR)
+DIR := src/mpirpc
-ifeq (@USE_MPIRPC_2@,1)
- MPIRPC_SRC += $(DIR)/mpirpc.c
-endif
-
-
+MPIRPC_SRC += $(DIR)/mpirpc.c
Modified: test/adts/module.mk.in
===================================================================
--- test/adts/module.mk.in 2010-04-20 04:26:19 UTC (rev 12)
+++ test/adts/module.mk.in 2010-04-20 04:38:07 UTC (rev 13)
@@ -3,4 +3,4 @@
test/adts/test%.x: test/adts/test%.o src/mpi_tools/mpi_tools.o $(ADT_OBJS)
$(Q) " LINK $(@) "
- $(E)$(MPICC) $(MPE) $(<) $(LIBS) src/mpi_tools/mpi_tools.o $(ADT_OBJS) -o $(@)
+ $(E)$(MPICC) $(MPE) $(<) src/mpi_tools/mpi_tools.o $(ADT_OBJS) $(LIBS) -o $(@)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 04:26:25
|
Revision: 12
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=12&view=rev
Author: jmwozniak
Date: 2010-04-20 04:26:19 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Changes...
Modified Paths:
--------------
configure.ac
Removed Paths:
-------------
src/gossip/gs-debug.c
Modified: configure.ac
===================================================================
--- configure.ac 2010-04-20 04:21:15 UTC (rev 11)
+++ configure.ac 2010-04-20 04:26:19 UTC (rev 12)
@@ -460,7 +460,6 @@
src/mpi_tools/module.mk
src/mpirpc/module.mk
src/dense-1/module.mk
-src/kda-1/module.mk
src/kda-2/module.mk
)
@@ -472,7 +471,7 @@
test/cmpi-io/module.mk
test/driver/module.mk
test/gossip/module.mk
- test/mpirpc-2/module.mk
+ test/mpirpc/module.mk
test/mpi_tools/module.mk
)
fi
Deleted: src/gossip/gs-debug.c
===================================================================
--- src/gossip/gs-debug.c 2010-04-20 04:21:15 UTC (rev 11)
+++ src/gossip/gs-debug.c 2010-04-20 04:26:19 UTC (rev 12)
@@ -1,100 +0,0 @@
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "gs-debug.h"
-
-/* a private internal type */
-typedef struct
-{
- const char *keyword;
- uint64_t mask_val;
-} __keyword_mask_t;
-
-#define __DEBUG_ALL ((uint64_t) -1)
-
-/* map all config keywords to pvfs2 debug masks here */
-static __keyword_mask_t s_keyword_mask_map[] =
-{
- /* example level until we have real masks */
- { "example", GS_D_EXAMPLE },
-
- /* NOTE: add additional levels here */
-
- /* No debug output */
- { "none", GS_D_NONE },
- /* Everything */
- { "all", __DEBUG_ALL }
-};
-#undef __DEBUG_ALL
-
-static const int num_keyword_mask_map = (int) \
-(sizeof(s_keyword_mask_map) / sizeof(__keyword_mask_t));
-
-static uint64_t debug_to_mask(__keyword_mask_t *mask_map,
- int num_mask_map, const char *event_logging)
-{
- uint64_t mask = 0;
- char *s = NULL, *t = NULL;
- const char *toks = ", ";
- int i = 0, negate = 0;
-
- if (event_logging)
- {
- s = strdup(event_logging);
- t = strtok(s, toks);
-
- while(t)
- {
- if (*t == '-')
- {
- negate = 1;
- ++t;
- }
-
- for(i = 0; i < num_mask_map; i++)
- {
- if (!strcmp(t, mask_map[i].keyword))
- {
- if (negate)
- {
- mask &= ~mask_map[i].mask_val;
- }
- else
- {
- mask |= mask_map[i].mask_val;
- }
- break;
- }
- }
- t = strtok(NULL, toks);
- }
- free(s);
- }
- return mask;
-}
-
-/*
- * Based on human readable keywords, translate them into
- * a mask value appropriate for the debugging level desired.
- * The 'computed' mask is returned; 0 if no keywords are
- * present or recognized.
- *
- * Prefix a keyword with "-" to turn it off. All keywords
- * processed in specified order.
- */
-uint64_t gs_debug_mask(const char *event_logging)
-{
- return debug_to_mask(s_keyword_mask_map,
- num_keyword_mask_map, event_logging);
-}
-
-/*
- * Local variables:
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 04:21:21
|
Revision: 11
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=11&view=rev
Author: jmwozniak
Date: 2010-04-20 04:21:15 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Move to test/mpirpc .
Added Paths:
-----------
test/mpirpc/
Removed Paths:
-------------
test/mpirpc-2/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 04:20:59
|
Revision: 10
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=10&view=rev
Author: jmwozniak
Date: 2010-04-20 04:20:53 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Drop MPIRPC-1 tests.
Removed Paths:
-------------
test/mpirpc-1/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 04:20:30
|
Revision: 9
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=9&view=rev
Author: jmwozniak
Date: 2010-04-20 04:20:24 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Only one MPIRPC.
Modified Paths:
--------------
configure.ac
src/mpirpc/mpirpc.c
Modified: configure.ac
===================================================================
--- configure.ac 2010-04-20 04:16:55 UTC (rev 8)
+++ configure.ac 2010-04-20 04:20:24 UTC (rev 9)
@@ -458,8 +458,7 @@
src/cmpi-cp/module.mk
src/cmpi-db/module.mk
src/mpi_tools/module.mk
-src/mpirpc-1/module.mk
-src/mpirpc-2/module.mk
+src/mpirpc/module.mk
src/dense-1/module.mk
src/kda-1/module.mk
src/kda-2/module.mk
@@ -473,7 +472,6 @@
test/cmpi-io/module.mk
test/driver/module.mk
test/gossip/module.mk
- test/mpirpc-1/module.mk
test/mpirpc-2/module.mk
test/mpi_tools/module.mk
)
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2010-04-20 04:16:55 UTC (rev 8)
+++ src/mpirpc/mpirpc.c 2010-04-20 04:20:24 UTC (rev 9)
@@ -1,5 +1,5 @@
-#include "mpirpc.h"
+#include <mpirpc.h>
/**
Functions MPIRPC_* may be exported at some point.
@@ -8,7 +8,7 @@
/**
Counter to uniquify RPC calls.
*/
-int unique = 0;
+int unique = 0;
/**
For MPIRPC_Check() : Irecv()...
@@ -82,8 +82,8 @@
{
whoami();
- rpctable = itable_create(100);
- portmap = hashtable_create(100);
+ rpctable = itable_create(128);
+ portmap = hashtable_create(128);
channels = list_create();
@@ -105,7 +105,6 @@
hashtable_add(portmap, name, f);
}
-
/**
Instruct MPIRPC to check this comm for incoming calls and returns.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 04:17:03
|
Revision: 8
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=8&view=rev
Author: jmwozniak
Date: 2010-04-20 04:16:55 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Using only one MPIRPC.
Modified Paths:
--------------
Makefile.in
configure.ac
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-20 04:16:40 UTC (rev 7)
+++ Makefile.in 2010-04-20 04:16:55 UTC (rev 8)
@@ -75,14 +75,6 @@
# DISKSIM location
DISKSIM=@USE_DISKSIM@
-# MPIRPC choice
-ifeq (@USE_MPIRPC_1@,1)
- MPIRPC_DIR = src/mpirpc-1
-endif
-ifeq (@USE_MPIRPC_2@,1)
- MPIRPC_DIR = src/mpirpc-2
-endif
-
# configure default is silent, unless --enable-verbose-build in
# which case QUIET_COMPILE will _not_ be defined. Further allow
# silence to be overriden with "make V=1".
@@ -484,7 +476,7 @@
endif
-unpublish: src/mpirpc-2/unpublish.o $(CMPI)
+unpublish: src/mpirpc/unpublish.o $(CMPI)
$(Q) " MPICC $(@)"
$(E)$(MPICC) $(<) $(CMPI) $(LIBS) -o $(@)
Modified: configure.ac
===================================================================
--- configure.ac 2010-04-20 04:16:40 UTC (rev 7)
+++ configure.ac 2010-04-20 04:16:55 UTC (rev 8)
@@ -360,10 +360,8 @@
[use dense-1 table implementation]),
[AC_MSG_RESULT( [using dense-1 table implementation...] )
AC_DEFINE([USE_TABLE_DENSE_1], [1], [Using DENSE-1])
- AC_DEFINE([USE_MPIRPC_2], [1], [Using MPIRPC-2])
AC_DEFINE([USE_COMM_WORLD], [1], [Using MPI_COMM_WORLD])
USE_TABLE_DENSE_1=1
- USE_MPIRPC_2=1
USE_COMM_WORLD=1],
[USE_TABLE_DENSE_1=0])
@@ -373,10 +371,8 @@
[use kademlia-2A implementation]),
[AC_MSG_RESULT([using kademlia-2A implementation...])
AC_DEFINE([USE_TABLE_KDA_2A], [1], [Using Kademlia-2A])
- AC_DEFINE([USE_MPIRPC_2], [1], [Using MPIRPC-2])
AC_DEFINE([USE_COMM_WORLD], [1], [Using MPI_COMM_WORLD])
USE_TABLE_KDA_2A=1
- USE_MPIRPC_2=1
USE_COMM_WORLD=1],
[USE_TABLE_KDA_2A=0])
@@ -387,22 +383,16 @@
[AC_MSG_RESULT([using kademlia-2B implementation...])
AC_DEFINE([USE_TABLE_KDA_2B], [1],
[Using Kademlia-2B])
- AC_DEFINE([USE_MPIRPC_2], [1],
- [Using MPIRPC-2])
AC_DEFINE([USE_COMM_WORLD], [0],
[Not using MPI_COMM_WORLD])
USE_TABLE_KDA_2B=1
- USE_MPIRPC_2=1
USE_COMM_WORLD=0],
[USE_TABLE_KDA_2B=0])
dnl Table results:
AC_SUBST(USE_TABLE_DENSE_1)
-AC_SUBST(USE_TABLE_KDA_1)
AC_SUBST(USE_TABLE_KDA_2A)
AC_SUBST(USE_TABLE_KDA_2B)
-AC_SUBST(USE_MPIRPC_1)
-AC_SUBST(USE_MPIRPC_2)
AC_SUBST(USE_COMM_WORLD)
AC_ARG_ENABLE([driver],
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 04:16:46
|
Revision: 7
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=7&view=rev
Author: jmwozniak
Date: 2010-04-20 04:16:40 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Only one MPIRPC in effect.
Added Paths:
-----------
src/mpirpc/
Removed Paths:
-------------
src/mpirpc-2/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 04:14:40
|
Revision: 6
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=6&view=rev
Author: jmwozniak
Date: 2010-04-20 04:14:33 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Use only MPIRPC-2.
Modified Paths:
--------------
Makefile.in
configure.ac
include/mpirpc.h
Removed Paths:
-------------
include/mpirpc-2.h
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-20 04:12:34 UTC (rev 5)
+++ Makefile.in 2010-04-20 04:14:33 UTC (rev 6)
@@ -5,7 +5,7 @@
# clean cleans up make-created files
# cleaner cleans up configure-created files
# distclean _really_ cleans up; returns to pristine tree
-# etags generates tags file for use by editors
+# tags generates etags file for use by editors
# INPUT CONTROL VARIABLES
# D : if 1, turn on debugging output in CMPI programs
@@ -547,14 +547,12 @@
$(Q) " CPP $@"
$(E)$(CC) $(LIBCFLAGS) $(CFLAGS) $(call modcflags,$<) $< -E -o $@
-TAGS:
- $(Q) " TAGS "
- $(E) find $(srcdir) -name '*.[ch]' | xargs etags -a $(ETAGS_FLAGS)
+tags: TAGS
# Generate TAGS based on only files used by CMPI as configured:
-TAGS.config: deps.config.txt
+TAGS: deps.config.txt
$(Q) " TAGS "
- $(E)etags -o $(@) $(ETAGS_FLAGS) `cat deps.config.txt`
+ $(E)etags $(ETAGS_FLAGS) `cat deps.config.txt`
# $(E)etags `cat deps.txt`
# Extract all files from *.d files, format and sort:
@@ -591,7 +589,7 @@
# some stuff that is cleaned in both distclean and dist targets
cleaner: clean
$(Q) " CLEANER"
- $(E)rm -fvr TAGS TAGS.config deps.config.txt \
+ $(E)rm -fvr TAGS deps.config.txt \
maint/mpi-depend.sh \
examples/pvfs2-server.rc \
/doxygen/pvfs2-doxygen.conf \
@@ -637,7 +635,7 @@
%.d: %.c
$(Q) " DEP $@"
# $(E) $(MPICC) -M $(CFLAGS) $(<) | sed -e 's@.*\.o:@@;s@\\@@' > $(@)
- $(E) CC="$(MPICC)" $(srcdir)/maint/depend.sh $(call dirname,$*) $(CFLAGS) $(call modcflags,$<) $< > $@
+ $(E) CC="$(MPICC)" $(srcdir)/depend.sh $(call dirname,$*) $(CFLAGS) $(call modcflags,$<) $< > $@
SPLINTOPTS = +posixlib +gnuextensions # -preproc
SPLINT_GS_S := $(shell find . -name "*.gs.s")
Modified: configure.ac
===================================================================
--- configure.ac 2010-04-20 04:12:34 UTC (rev 5)
+++ configure.ac 2010-04-20 04:14:33 UTC (rev 6)
@@ -367,19 +367,6 @@
USE_COMM_WORLD=1],
[USE_TABLE_DENSE_1=0])
-AC_ARG_ENABLE([table-kda-1],
- AS_HELP_STRING(
- [--enable-table-kda-1],
- [use kademlia-1 implementation]),
- [AC_MSG_RESULT([using kademlia-1 implementation...] )
- AC_DEFINE([USE_TABLE_KDA_1], [1], [Using Kademlia-1])
- AC_DEFINE([USE_MPIRPC_1], [1], [Using MPIRPC-1])
- AC_DEFINE([USE_COMM_WORLD], [1], [Using MPI_COMM_WORLD])
- USE_TABLE_KDA_1=1
- USE_MPIRPC_1=1
- USE_COMM_WORLD=1],
- [USE_TABLE_KDA_1=0])
-
AC_ARG_ENABLE([table-kda-2A],
AS_HELP_STRING(
[--enable-table-kda-2A],
Deleted: include/mpirpc-2.h
===================================================================
--- include/mpirpc-2.h 2010-04-20 04:12:34 UTC (rev 5)
+++ include/mpirpc-2.h 2010-04-20 04:14:33 UTC (rev 6)
@@ -1,199 +0,0 @@
-
-#ifndef MPIRPC_2_H
-#define MPIRPC_2_H
-
-#define _XOPEN_SOURCE 500
-
-#include <stdbool.h>
-#include <unistd.h>
-
-#include <cmpi-config.h>
-
-#include <list.h>
-#include <itable.h>
-#include <hashtable.h>
-
-#include <mpi_tools.h>
-
-#ifdef DMALLOC
-#include <dmalloc.h>
-#endif
-
-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)
-
-typedef struct
-{
- MPI_Comm comm;
- int rank;
-} MPIRPC_Node;
-
-typedef struct
-{
- MPI_Comm comm;
- MPI_Request request;
-} MPIRPC_Channel;
-
-typedef struct mpirpc
-{
- MPIRPC_Node target;
- int status;
- char name[MPIRPC_MAX_NAME];
- char args[MPIRPC_MAX_ARGS];
- char* blob;
- int blob_length;
- char* result;
- int result_length;
- void* extras;
- void (*proceed) (struct mpirpc* rpc);
- int unique;
- bool cancelled;
-
- // Internals:
- /**
- name_length is transferred via Isend().
- */
- int name_length;
-
- /**
- args_length is transferred via Isend().
- */
- int args_length;
-
- /**
- Array of Isend() requests to be freed on return.
- */
- MPI_Request request[8];
-} MPIRPC;
-
-/**
- Internal MPIRPC return value. Used for garbage collection.
-*/
-typedef struct mpirpc_value MPIRPC_Value;
-struct mpirpc_value
-{
- int unique;
- int length;
- char* result;
- MPI_Request request[4];
-};
-
-//// API...
-
-void MPIRPC_Init(void);
-
-bool MPIRPC_Check(void);
-
-void MPIRPC_Recv(MPI_Comm comm);
-
-void MPIRPC_Register(char* name,
- void (*f)(MPIRPC_Node,int,char*,char*,int));
-
-bool MPIRPC_Comm_add(MPI_Comm comm);
-
-void MPIRPC_Close(MPIRPC_Channel* channel);
-
-MPIRPC* MPIRPC_Call(MPIRPC_Node target, char* name, char* args,
- void* extras, void (*proceed)(MPIRPC*));
-
-MPIRPC* MPIRPC_Call_blob(MPIRPC_Node target, char* name, char* args,
- char* blob, int blob_length,
- void* extras, void (*proceed)(MPIRPC*));
-
-char* MPIRPC_Block(MPIRPC_Node target, char* name, char* args);
-
-char* MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
- char* blob, int blob_length);
-
-char* MPIRPC_Wait(MPIRPC* rpc);
-
-void MPIRPC_Null(MPIRPC_Node caller, int unique);
-
-void MPIRPC_Return(MPIRPC_Node caller, int unique,
- char* result, int rlength);
-
-MPIRPC_Node* MPIRPC_Node_create(MPI_Comm comm, int rank);
-
-MPIRPC_Node* MPIRPC_Node_make(MPI_Comm comm, int rank,
- MPIRPC_Node* node);
-
-void MPIRPC_Garbage_collect(void);
-
-struct list* MPIRPC_Comms(void);
-
-void MPIRPC_Dump(MPIRPC* rpc);
-
-void MPIRPC_Dump_portmap(void);
-
-void MPIRPC_Dump_channels(void);
-
-MPIRPC* MPIRPC_Lookup(int unique);
-
-void MPIRPC_Flush_returns(void);
-
-char* MPIRPC_Comm_get_name(MPI_Comm comm);
-
-void MPIRPC_Free(MPIRPC* rpc);
-
-void MPIRPC_Snooze(void);
-
-void MPIRPC_Snooze_reset(void);
-
-//// Internal routines...
-
-bool MPIRPC_Garbage_collect_value(void);
-
-void MPIRPC_Value_free(MPIRPC_Value* value);
-
-MPIRPC_Value* MPIRPC_Value_create(int unique, char* result, int length);
-
-//// Data structure helpers...
-
-int MPIRPC_Node_cmp(void* node1, void* node2);
-
-int MPIRPC_Channel_cmp(void* c1, void* c2);
-
-int MPIRPC_Channel_comm_cmp(void* c1, void* c2);
-
-MPIRPC_Channel* MPIRPC_Channel_for_node(MPIRPC_Node node);
-
-void MPIRPC_Finalize(void);
-
-/**
- MPIRPC stati.
-*/
-enum
-{
- MPIRPC_STATUS_PROTO,
- MPIRPC_STATUS_CALLED,
- MPIRPC_STATUS_RETURNED
-};
-
-/**
- Tags used by MPIRPC.
-*/
-enum
-{
- MPIRPC_TAG_CONTROL,
- MPIRPC_TAG_UNIQUE,
- MPIRPC_TAG_NAME,
- MPIRPC_TAG_LENGTH,
- MPIRPC_TAG_ARGS,
- MPIRPC_TAG_RESULT
-};
-
-enum
-{
- MPIRPC_MSG_CALL = 12,
- MPIRPC_MSG_RETURN = 13,
- MPIRPC_MSG_DISCONNECT = 14,
- MPIRPC_MSG_OK = 15,
- MPIRPC_MSG_FAIL = 16
-};
-
-#endif
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2010-04-20 04:12:34 UTC (rev 5)
+++ include/mpirpc.h 2010-04-20 04:14:33 UTC (rev 6)
@@ -2,12 +2,196 @@
#ifndef MPIRPC_H
#define MPIRPC_H
+#include <stdbool.h>
+#include <unistd.h>
+
#include <cmpi-config.h>
-#if USE_MPIRPC_1 == 1
-#include <mpirpc-1.h>
-#else
-#include <mpirpc-2.h>
+#include <list.h>
+#include <itable.h>
+#include <hashtable.h>
+
+#include <mpi_tools.h>
+
+#ifdef DMALLOC
+#include <dmalloc.h>
#endif
+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)
+
+typedef struct
+{
+ MPI_Comm comm;
+ int rank;
+} MPIRPC_Node;
+
+typedef struct
+{
+ MPI_Comm comm;
+ MPI_Request request;
+} MPIRPC_Channel;
+
+typedef struct mpirpc
+{
+ MPIRPC_Node target;
+ int status;
+ char name[MPIRPC_MAX_NAME];
+ char args[MPIRPC_MAX_ARGS];
+ char* blob;
+ int blob_length;
+ char* result;
+ int result_length;
+ void* extras;
+ void (*proceed) (struct mpirpc* rpc);
+ int unique;
+ bool cancelled;
+
+ // Internals:
+ /**
+ name_length is transferred via Isend().
+ */
+ int name_length;
+
+ /**
+ args_length is transferred via Isend().
+ */
+ int args_length;
+
+ /**
+ Array of Isend() requests to be freed on return.
+ */
+ MPI_Request request[8];
+} MPIRPC;
+
+/**
+ Internal MPIRPC return value. Used for garbage collection.
+*/
+typedef struct mpirpc_value MPIRPC_Value;
+struct mpirpc_value
+{
+ int unique;
+ int length;
+ char* result;
+ MPI_Request request[4];
+};
+
+//// API...
+
+void MPIRPC_Init(void);
+
+bool MPIRPC_Check(void);
+
+void MPIRPC_Recv(MPI_Comm comm);
+
+void MPIRPC_Register(char* name,
+ void (*f)(MPIRPC_Node,int,char*,char*,int));
+
+bool MPIRPC_Comm_add(MPI_Comm comm);
+
+void MPIRPC_Close(MPIRPC_Channel* channel);
+
+MPIRPC* MPIRPC_Call(MPIRPC_Node target, char* name, char* args,
+ void* extras, void (*proceed)(MPIRPC*));
+
+MPIRPC* MPIRPC_Call_blob(MPIRPC_Node target, char* name, char* args,
+ char* blob, int blob_length,
+ void* extras, void (*proceed)(MPIRPC*));
+
+char* MPIRPC_Block(MPIRPC_Node target, char* name, char* args);
+
+char* MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
+ char* blob, int blob_length);
+
+char* MPIRPC_Wait(MPIRPC* rpc);
+
+void MPIRPC_Null(MPIRPC_Node caller, int unique);
+
+void MPIRPC_Return(MPIRPC_Node caller, int unique,
+ char* result, int rlength);
+
+MPIRPC_Node* MPIRPC_Node_create(MPI_Comm comm, int rank);
+
+MPIRPC_Node* MPIRPC_Node_make(MPI_Comm comm, int rank,
+ MPIRPC_Node* node);
+
+void MPIRPC_Garbage_collect(void);
+
+struct list* MPIRPC_Comms(void);
+
+void MPIRPC_Dump(MPIRPC* rpc);
+
+void MPIRPC_Dump_portmap(void);
+
+void MPIRPC_Dump_channels(void);
+
+MPIRPC* MPIRPC_Lookup(int unique);
+
+void MPIRPC_Flush_returns(void);
+
+char* MPIRPC_Comm_get_name(MPI_Comm comm);
+
+void MPIRPC_Free(MPIRPC* rpc);
+
+void MPIRPC_Snooze(void);
+
+void MPIRPC_Snooze_reset(void);
+
+//// Internal routines...
+
+bool MPIRPC_Garbage_collect_value(void);
+
+void MPIRPC_Value_free(MPIRPC_Value* value);
+
+MPIRPC_Value* MPIRPC_Value_create(int unique, char* result, int length);
+
+//// Data structure helpers...
+
+int MPIRPC_Node_cmp(void* node1, void* node2);
+
+int MPIRPC_Channel_cmp(void* c1, void* c2);
+
+int MPIRPC_Channel_comm_cmp(void* c1, void* c2);
+
+MPIRPC_Channel* MPIRPC_Channel_for_node(MPIRPC_Node node);
+
+void MPIRPC_Finalize(void);
+
+/**
+ MPIRPC stati.
+*/
+enum
+{
+ MPIRPC_STATUS_PROTO,
+ MPIRPC_STATUS_CALLED,
+ MPIRPC_STATUS_RETURNED
+};
+
+/**
+ Tags used by MPIRPC.
+*/
+enum
+{
+ MPIRPC_TAG_CONTROL,
+ MPIRPC_TAG_UNIQUE,
+ MPIRPC_TAG_NAME,
+ MPIRPC_TAG_LENGTH,
+ MPIRPC_TAG_ARGS,
+ MPIRPC_TAG_RESULT
+};
+
+enum
+{
+ MPIRPC_MSG_CALL = 12,
+ MPIRPC_MSG_RETURN = 13,
+ MPIRPC_MSG_DISCONNECT = 14,
+ MPIRPC_MSG_OK = 15,
+ MPIRPC_MSG_FAIL = 16
+};
+
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 04:12:40
|
Revision: 5
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=5&view=rev
Author: jmwozniak
Date: 2010-04-20 04:12:34 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Deleting unnecessary headers.
Modified Paths:
--------------
include/mpirpc-2.h
Removed Paths:
-------------
include/gobs_dense.h
include/gs-debug.h
include/kda-1.h
include/kda_neighbor-1.h
include/kda_types-1.h
include/mpirpc-1.h
Deleted: include/gobs_dense.h
===================================================================
--- include/gobs_dense.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/gobs_dense.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -1,46 +0,0 @@
-
-#ifndef GOBS_DENSE_H
-#define GOBS_DENSE_H
-
-#include <list.h>
-
-#include <gobs.gsh>
-
-typedef struct
-{
- int index;
- ait_entry* table;
-} gobs_dense_iterator;
-
-// extern gobs_fns gobs_dense_impl;
-
-extern ait_entry* gobs_dense_ait;
-extern int gobs_dense_ait_size;
-
-void gobs_dense_setup(MPI_Comm comm);
-
-void gobs_dense_ait_create();
-
-int gobs_dense_ait_get_size();
-
-ait_iterator* gobs_dense_get_iterator();
-
-ait_entry* gobs_dense_iterator_next(ait_iterator* iterator);
-
-ait_entry* gobs_dense_ait_lookup(gobs_id id);
-
-gum_node gobs_dense_random_member();
-
-struct list* gobs_dense_random_k_members(int k);
-
-void gobs_dense_fail(gum_node dead_node);
-
-bool gobs_dense_failed(gum_node node);
-
-/*
-gum_node gobs_dense_lookup(gobs_id id);
-
-__blocking gum_node gobs_dense_query(gum_node target, gobs_id id);
-*/
-
-#endif
Deleted: include/gs-debug.h
===================================================================
--- include/gs-debug.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/gs-debug.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -1,42 +0,0 @@
-
-/* This file just defines debugging masks to be used with the gossip
- * logging utility.
- */
-
-#ifndef __PVFS2_DEBUG_H
-#define __PVFS2_DEBUG_H
-
-#ifdef __KERNEL__
-#include <linux/types.h>
-#else
-#include <stdint.h>
-#include <stdlib.h>
-#endif
-#include <gossip.h>
-
-#define GS_D_NONE (uint64_t)0
-#define GS_D_EXAMPLE ((uint64_t)1 << 0)
-/* NOTE: add others here, along with corresponding entries in gs-debug.c */
-
-#define gs_debug_init() \
-do {\
- char* __mask_str; \
- uint64_t __mask; \
- __mask_str = getenv("GS_DEBUG_MASK"); \
- __mask = (__mask_str ? gs_debug_mask(__mask_str) : 0); \
- gossip_set_debug_mask(1, __mask); \
-}while(0)
-
-uint64_t gs_debug_mask(
- const char *event_logging);
-
-#endif /* __PVFS2_DEBUG_H */
-
-/*
- * Local variables:
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
Deleted: include/kda-1.h
===================================================================
--- include/kda-1.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/kda-1.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -1,145 +0,0 @@
-
-#ifndef KADEMLIA_1_H
-#define KADEMLIA_1_H
-
-#include <limits.h>
-#include <signal.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <unistd.h>
-
-#include <mpi.h>
-
-#include <hashtable.h>
-#include <itable.h>
-#include <list.h>
-#include <ilist.h>
-#include <inlist.h>
-#include <mpi_tools.h>
-#include <mpirpc.h>
-#include <cmpi.h>
-// #include <driver.h>
-
-#ifdef DISKSIM_LOCATION
-#include <disksim.h>
-#endif
-
-typedef int KDA_ID;
-
-#include "kda_types-1.h"
-#include "kda_neighbor-1.h"
-
-
-#define KDA_SPACE_SIZE (sizeof(KDA_ID)*8) // 160 in paper
-#define KDA_HASH_SPACE INT_MAX //
-
-/**
- KDA_ID_NULL=0 is an invalid KDA_ID used for semantic purposes.
- make_id must not create this id.
-*/
-#define KDA_ID_NULL 0;
-
-/**
- Obtain the Kademlia distance between two ids.
-*/
-#define XOR(id1, id2) (((int) id1) ^ ((int) id2))
-
-/**
- Contains neighbors. A bucket is all neighbors of a given
- distance 2^i - 2^i+1
-*/
-typedef struct list* K_BUCKET;
-
-extern int kda_nodes;
-extern struct itable* operations;
-
-
-void KDA_Init(int alpha_in, int k_in);
-
-//// General API...
-/**
- Return once op->status is KDA_STATUS_COMPLETE
-*/
-void KDA_Wait(KDA_Operation* op);
-
-//// Local API...
-int KDA_Local_rank(KDA_ID other_id);
-KDA_Neighbor* KDA_Local_ID(int other_rank);
-
-
-//// Client API:
-MPIRPC* KDA_Translate(int rank, KDA_ID id);
-MPIRPC* KDA_Translate_k(int rank, KDA_ID id);
-MPIRPC* KDA_Lookup(int rank, char* key);
-MPIRPC* KDA_Lookup_k(int rank, char* key);
-MPIRPC* KDA_Store(int rank, char* key, char* value);
-MPIRPC* KDA_Retrieve(int rank, char* key);
-MPIRPC* KDA_Update(int rank, char* key, char* value, int length, int offset);
-
-//// In-DHT API...
-void KDA_Ping(KDA_ID other_id);
-void KDA_Announce(void);
-struct ilist* KDA_Find_key(char* key);
-struct ilist* KDA_Find(KDA_ID object_id);
-struct ilist* KDA_Closest(KDA_ID object_id);
-
-//// Helpers...
-KDA_Operation* KDA_Operate(KDA_ID object_id, char* name, void* args,
- void (*proceed)(MPIRPC* rpc),
- KDA_Query* query);
-bool KDA_Find_node(KDA_Operation* op);
-bool KDA_Find_node_again(KDA_Operation* op);
-void KDA_Operation_free(KDA_Operation* op);
-
-char* KDA_Description(void);
-char* KDA_id_tostring(KDA_ID other_id);
-
-KDA_ID make_id(void);
-void join(int other_rank);
-char* id_tostring(void);
-void listen_loop(void);
-void bootstrap(int other_rank);
-void bootjoin(int other_id, int other_rank);
-void rpc_bootjoin(int other_rank);
-void bootping(void);
-void dump_buckets(void);
-char* bucket_usage(void);
-char* buckets_tostring(void);
-bool add_neighbor(KDA_Neighbor* neighbor);
-
-//// Handlers...
-
-void handle_announce(int caller, int unique, char* args);
-void handle_info(int caller, int unique, char* args);
-void handle_debug_tables(int caller, int unique, char* args);
-void handle_bucket_usage(int caller, int unique, char* args);
-void handle_bootjoin(int caller, int unique, char* args);
-void handle_bootping(int caller, int unique, char* args);
-void handle_update(int caller, int unique, char* args);
-void handle_find_node(int caller, int unique, char* args);
-void handle_ping(int caller, int unique, char* args);
-void handle_query_id(int caller, int unique, char* args);
-void handle_query_id_k(int caller, int unique, char* args);
-void handle_store(int caller, int unique, char* args);
-void handle_retrieve(int caller, int unique, char* args);
-void handle_quit(int caller, int unique, char* args);
-
-//// Synchronous methods...
-struct ilist* find_node(KDA_ID id);
-
-//// Asynchronous methods and return services...
-void query_id(int caller, int unique, KDA_ID id);
-void return_query_id(KDA_Operation* op);
-void query_id_k(int caller, int unique, KDA_ID id);
-void return_query_id_k(KDA_Operation* op);
-
-//// Proceeds...
-void proceed_bootjoin(MPIRPC* rpc);
-void proceed_find(MPIRPC* rpc);
-void proceed_ping(MPIRPC* rpc);
-
-
-
-#endif
Deleted: include/kda_neighbor-1.h
===================================================================
--- include/kda_neighbor-1.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/kda_neighbor-1.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -1,36 +0,0 @@
-
-#ifndef KDA_NEIGHBOR_1_H
-#define KDA_NEIGHBOR_1_H
-
-#include <stdbool.h>
-
-#include "kda-1.h"
-
-KDA_Neighbor* neighbor_create(KDA_ID id, int rank);
-KDA_Neighbor* neighbor_clone(KDA_Neighbor* neighbor);
-void neighbor_make(KDA_ID id, int rank, KDA_Neighbor* neighbor);
-
-/**
- Compare neighbors based on id.
-*/
-int neighbor_cmp(void* object1, void* object2);
-
-/**
- Compare lastseen times for neighbors n1, n2.
- @return 1 iff n1 > n2, -1 iff n1 < n2, 0 iff n1 == n2
-*/
-int neighbor_time_cmp(void* object1, void* object2);
-
-
-//// Output methods:
-char* neighbor_name(void* object);
-int neighbor_name_sprint(char* buffer, void* object);
-char* neighbor_tostring(void* object);
-int neighbor_sprint(char* buffer, void* object);
-void neighbor_dump(void* object);
-char* neighbor_ranks_tostring(struct ilist* neighbors);
-
-//// Input methods:
-struct inlist* neighbor_rank_list(char* data);
-
-#endif
Deleted: include/kda_types-1.h
===================================================================
--- include/kda_types-1.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/kda_types-1.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -1,66 +0,0 @@
-
-#ifndef KADEMLIA_TYPES_1_H
-#define KADEMLIA_TYPES_1_H
-
-typedef struct neighbor
-{
- int rank;
- KDA_ID id;
- time_t lastseen;
- bool quitting;
-} KDA_Neighbor;
-
-typedef struct kda_query KDA_Query;
-typedef struct kda_operation KDA_Operation;
-
-struct kda_query
-{
- int caller;
- int unique;
- char* result;
- void (*service)(KDA_Operation* op);
-};
-
-/**
- Performs an operation.
- -# Finds k nodes nearest to object_id using
- KDA_Find_node -> rpc_find_node -> proceed_find.
- -# When proceed_find converges, it
- calls map.
- -# map either maps the function name out (if name given),
- proceeding with the proceed function, or
- returns the query.
-*/
-struct kda_operation
-{
- KDA_ID object_id;
- int unique;
- // An MPIRPC function symbolic name to map() over found nodes:
- char* name;
- // The args for map().
- char* args;
- // Maps distance to neighbors:
- struct ilist* k_closest;
- // neighbor->ranks that have been searched but not heard from:
- struct inlist* outstanding;
- // neighbor->ranks that have been searched for this operation:
- struct inlist* contacted;
- // neighbor ranks that have returned the RPC for this operation:
- struct inlist* returned;
- // If the latest rpc_find_node calls improved our search.
- bool improved;
- int status;
- // How to proceed after map(name):
- void (*proceed)(MPIRPC* op);
- // Incoming query to respond to that triggered this operation:
- KDA_Query* query;
-};
-
-enum
-{
- KDA_STATUS_SEARCHING,
- KDA_STATUS_CALLING,
- KDA_STATUS_COMPLETE
-};
-
-#endif
Deleted: include/mpirpc-1.h
===================================================================
--- include/mpirpc-1.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/mpirpc-1.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -1,130 +0,0 @@
-
-#ifndef MPIRPC_1_H
-#define MPIRPC_1_H
-
-#define _XOPEN_SOURCE 500
-
-#include <assert.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include <cmpi-config.h>
-
-#include <list.h>
-#include <itable.h>
-#include <hashtable.h>
-
-#include <mpi_tools.h>
-#include <gossip.h>
-
-#include "handlers.h"
-
-extern int unique;
-
-extern useconds_t snooze_max;
-
-extern int emulating_fault;
-
-extern char* MPIRPC_RESULT_FAULT;
-
-typedef struct mpirpc MPIRPC;
-struct mpirpc
-{
- int status;
- int target;
- char* name;
- char* args;
- char* result;
- void* extras;
- void (*proceed) (MPIRPC* rpc);
- int unique;
- bool cancelled;
-
- int name_length;
- int args_length;
- MPI_Request* request;
-};
-
-typedef struct mpirpc_value MPIRPC_Value;
-struct mpirpc_value
-{
- int unique;
- int length;
- char* result;
- MPI_Request* request;
-};
-
-//// API...
-
-void MPIRPC_Init(void);
-
-bool MPIRPC_Check(void);
-
-void MPIRPC_Register(char* name,
- void (*method)(int caller, int unique, char* args));
-
-MPIRPC* MPIRPC_Call(int target, char* name, char* args, void* extras,
- void (*proceed)(MPIRPC*));
-
-char* MPIRPC_Block(int target, char* name, char* args);
-
-void MPIRPC_Return(int caller, int unique, char* result);
-
-void MPIRPC_Free(MPIRPC* rpc);
-
-void MPIRPC_Kill(int target);
-
-void MPIRPC_Flush_returns(void);
-
-void MPIRPC_Die(int caller);
-
-char* MPIRPC_Wait(MPIRPC* rpc);
-
-void MPIRPC_Finalize(void);
-
-//// Debugging...
-
-void MPIRPC_Dump(MPIRPC* rpc);
-
-void MPIRPC_Dump_portmap(void);
-
-//// Internals...
-
-MPIRPC* MPIRPC_Lookup(int unique);
-
-void MPIRPC_Snooze(void);
-
-void MPIRPC_Snooze_reset(void);
-
-enum
-{
- MPIRPC_STATUS_PROTO,
- MPIRPC_STATUS_CALLED,
- MPIRPC_STATUS_RETURNED,
- MPIRPC_STATUS_FAULT
-};
-
-enum
-{
- MPIRPC_TAG_CONTROL,
- MPIRPC_TAG_UNIQUE,
- MPIRPC_TAG_NAME,
- MPIRPC_TAG_LENGTH,
- MPIRPC_TAG_ARGS,
- MPIRPC_TAG_RESULT
-};
-
-enum
-{
- MPIRPC_MSG_CALL,
- MPIRPC_MSG_RETURN,
- MPIRPC_MSG_FAULT,
- MPIRPC_MSG_DIE
-};
-
-#define MPIRPC_NAME_SIZE 128
-#define MPIRPC_ARG_MAX 1024
-#define MPIRPC_PROCEED_NULL ((void (*)(MPIRPC*)) 1)
-
-#endif
Modified: include/mpirpc-2.h
===================================================================
--- include/mpirpc-2.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/mpirpc-2.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -23,8 +23,8 @@
extern useconds_t snooze_max;
-#define MPIRPC_MAX_NAME 100
-#define MPIRPC_MAX_ARGS 200
+#define MPIRPC_MAX_NAME 128
+#define MPIRPC_MAX_ARGS 256
#define MPIRPC_PROCEED_NULL ((void (*)(MPIRPC*)) 1)
typedef struct
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 04:09:52
|
Revision: 4
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=4&view=rev
Author: jmwozniak
Date: 2010-04-20 04:09:45 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Do not use these anymore.
Removed Paths:
-------------
src/kda-1/
src/mpirpc-1/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-19 22:37:41
|
Revision: 3
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=3&view=rev
Author: jmwozniak
Date: 2010-04-19 22:37:35 +0000 (Mon, 19 Apr 2010)
Log Message:
-----------
More fixes.
Modified Paths:
--------------
src/cmpi/cmpi.c
src/dense-1/cmpi_dense.c
test/cmpi/test01.c
test/cmpi/test02.c
test/cmpi/test03.c
Modified: src/cmpi/cmpi.c
===================================================================
--- src/cmpi/cmpi.c 2010-04-19 19:54:23 UTC (rev 2)
+++ src/cmpi/cmpi.c 2010-04-19 22:37:35 UTC (rev 3)
@@ -1,42 +1,42 @@
-#include <cmpi.h>
+#include <cmpi.h>
#include <keyvalue.h>
-int cmpi_status;
+int cmpi_status;
int cmpi_cache_limit;
-struct lru_table* cmpi_cache = NULL;
+struct lru_table* cmpi_cache = NULL;
/**
- Used to store values from cmpi_impl_parameter().
+ Used to store values from cmpi_impl_parameter().
*/
-struct hashtable* cmpi_params = NULL;
+struct hashtable* cmpi_params = NULL;
int cmpi_msg_join;
-int cmpi_msg_neighbor;
-int cmpi_msg_sendnode;
-int cmpi_msg_sendkey;
+int cmpi_msg_neighbor;
+int cmpi_msg_sendnode;
+int cmpi_msg_sendkey;
int cmpi_msg_sendblob;
int cmpi_msg_lookupkey;
int cmpi_msg_getblob;
-int cmpi_msg_shutdown;
+int cmpi_msg_shutdown;
/**
True when quitting
*/
-bool cmpi_quitting = false;
+bool cmpi_quitting = false;
void
cmpi_params_init()
{
- // NOTE_F;
+ // NOTE_F;
cmpi_params = hashtable_create(10);
}
/**
- Add copy of key/value pair to cmpi_params table.
-*/
+ Add copy of key/value pair to cmpi_params table.
+*/
void
cmpi_params_add(char* key, char* value)
{
@@ -45,48 +45,48 @@
}
/**
- Returns a copy of the matching value or NULL if not found.
+ Returns a copy of the matching value or NULL if not found.
*/
-char*
+char*
cmpi_params_search(char* key)
{
char* result;
result = hashtable_search(cmpi_params, key);
if (result)
return heap(result);
- return NULL;
+ return NULL;
}
void
cmpi_basics(void)
{
- cmpi_status = CMPI_STATUS_PROTO;
-
- MPIRPC_Init();
-
+ cmpi_status = CMPI_STATUS_PROTO;
+
+ MPIRPC_Init();
+
cmpi_msg_join = CMPI_MSG_JOIN;
- cmpi_msg_neighbor = CMPI_MSG_NEIGHBOR;
- cmpi_msg_sendnode = CMPI_MSG_SENDNODE;
+ cmpi_msg_neighbor = CMPI_MSG_NEIGHBOR;
+ cmpi_msg_sendnode = CMPI_MSG_SENDNODE;
cmpi_msg_sendkey = CMPI_MSG_SENDKEY;
cmpi_msg_sendblob = CMPI_MSG_SENDBLOB;
cmpi_msg_lookupkey = CMPI_MSG_LOOKUPKEY;
cmpi_msg_getblob = CMPI_MSG_GETBLOB;
- cmpi_msg_shutdown = CMPI_MSG_SHUTDOWN;
+ cmpi_msg_shutdown = CMPI_MSG_SHUTDOWN;
}
/**
Must be called after MPI_Init()
*/
-CMPI_RETURN
+CMPI_RETURN
cmpi_init()
{
- cmpi_basics();
+ cmpi_basics();
- cmpi_cache = lru_table_create(cmpi_cache_limit, cmpi_cache_limit);
+ cmpi_cache = lru_table_create(cmpi_cache_limit, cmpi_cache_limit);
cmpi_init_impl();
-
- return 0;
+
+ return 0;
}
CMPI_RETURN
@@ -94,41 +94,41 @@
{
cmpi_basics();
cmpi_init_impl_client();
-
+
#ifdef USE_CMPI_IO
- NOTE("USING CMPI-IO \n");
+ NOTE("USING CMPI-IO \n");
cmpi_io_init();
#endif
- return CMPI_SUCCESS;
+ return CMPI_SUCCESS;
}
/**
-
+
*/
-int
+int
cmpi_cached_retrieve(char* key, char** data)
{
- int result;
+ int result;
NOTE_F;
-
+
DEBUG(lru_table_fprintf(debug_file, "%s", cmpi_cache));
struct keyvalue* found = lru_table_search(cmpi_cache, key);
if (found)
{
- printdata("found: ", found->data, found->length);
+ printdata("found: ", found->data, found->length);
*data = found->data;
- SHOW_P(*data);
+ SHOW_P(*data);
result = found->length;
- printf("length: %i\n", result);
- // free(found->key);
+ printf("length: %i\n", result);
+ // free(found->key);
// free(found);
}
else
{
result = cmpi_disk_loadpair(key, data);
-
+
if (*data != NULL)
{
struct keyvalue* kv = lru_table_add(cmpi_cache, key,
@@ -142,11 +142,11 @@
else
{
result = 0;
- *data = NULL;
+ *data = NULL;
}
}
- return result;
+ return result;
}
/**
@@ -154,20 +154,20 @@
void
cmpi_cached_store(char* key, char* data, int length)
{
- struct keyvalue* kv;
- SHOW_FS(key);
+ struct keyvalue* kv;
+ SHOW_FS(key);
kv = lru_table_add(cmpi_cache, key, data, length);
if (kv)
{
cmpi_disk_storepair(kv->key, kv->data, length);
- printf("CACHE_DROP: %s\n", kv->key);
+ printf("CACHE_DROP: %s\n", kv->key);
free(kv->key);
- free(kv);
+ free(kv);
}
}
/**
- Does not use cmpi_disk.
+ Does not use cmpi_disk.
*/
void
cmpi_cached_update(char* key, char* data, int offset, int length)
@@ -190,42 +190,42 @@
}
else
{
- lru_table_add(cmpi_cache, key, data, length);
+ lru_table_add(cmpi_cache, key, data, length);
}
}
- // DEBUG(lru_table_fprintf(debug_file, "%s", cmpi_cache));
+ // DEBUG(lru_table_fprintf(debug_file, "%s", cmpi_cache));
- DONE;
+ DONE;
}
/**
- Free up our resources.
+ Free up our resources.
*/
void
cmpi_cleanup()
{
- // NOTE_F;
+ // NOTE_F;
MPIRPC_Finalize();
- // struct keyvalue* kv;
- /*
+ // struct keyvalue* kv;
+ /*
while ((kv = lru_table_poll(cmpi_cache)))
{
;// free(kv->key);
- // free(kv);
+ // free(kv);
}
*/
// lru_table_free(cmpi_cache);
- // NOTE("free cmpi_params");
+ // NOTE("free cmpi_params");
hashtable_free(cmpi_params);
}
/**
- Free up our resources.
+ Free up our resources.
*/
void
cmpi_client_cleanup()
{
- // NOTE_F;
+ // NOTE_F;
hashtable_free(cmpi_params);
MPIRPC_Finalize();
}
Modified: src/dense-1/cmpi_dense.c
===================================================================
--- src/dense-1/cmpi_dense.c 2010-04-19 19:54:23 UTC (rev 2)
+++ src/dense-1/cmpi_dense.c 2010-04-19 22:37:35 UTC (rev 3)
@@ -1,39 +1,39 @@
-#include "cmpi_dense-1.h"
+#include "cmpi_dense-1.h"
/**
- List of node ranks to contact for DENSE routines.
+ List of node ranks to contact for DENSE routines.
*/
-struct inlist* contacts;
+struct inlist* contacts;
CMPI_RETURN
cmpi_init_impl()
{
// NOTE_F;
- DENSE_Read_params();
-
+ DENSE_Read_params();
+
DENSE_Init(3, 3);
- return CMPI_SUCCESS;
+ return CMPI_SUCCESS;
}
CMPI_RETURN
cmpi_init_impl_client()
{
int i;
- DENSE_Read_params();
+ DENSE_Read_params();
- DENSE_Init_client();
-
+ DENSE_Init_client();
+
contacts = inlist_create();
-
+
for (i = 0; i < dense_nodes; i++)
{
- gossip_debug(MASK_DHT, "contact: %i\n", i);
+ gossip_debug(MASK_DHT, "contact: %i\n", i);
inlist_add(contacts, i);
}
-
- return CMPI_SUCCESS;
+
+ return CMPI_SUCCESS;
}
CMPI_RETURN
@@ -46,44 +46,44 @@
dense_nodes = n;
}
- return CMPI_SUCCESS;
+ return CMPI_SUCCESS;
}
char*
cmpi_info(CMPI_ID key)
{
char* result = NULL;
- int i = inlist_random(contacts);
+ int i = inlist_random(contacts);
MPIRPC_Node node;
- MPIRPC_Node_make(i, MPI_COMM_WORLD, &node);
-
- result = MPIRPC_Block(node, "info", xheap(key));
+ MPIRPC_Node_make(i, MPI_COMM_WORLD, &node);
- return result;
+ result = MPIRPC_Block(node, "info", xheap(key));
+
+ return result;
}
/**
Ex-DHT search.
- @return The MPI rank closest to the given key.
+ @return The MPI rank closest to the given key.
*/
CMPI_ID
cmpi_lookup(char* key)
{
- int i = inlist_random(contacts);
-
- NOTE_FS(key);
+ int i = inlist_random(contacts);
+ NOTE_FS(key);
+
i = inlist_random(contacts);
MPIRPC_Node node;
- MPIRPC_Node_make(i, MPI_COMM_WORLD, &node);
-
- MPIRPC* rpc = DENSE_Lookup(node, key);
+ MPIRPC_Node_make(i, MPI_COMM_WORLD, &node);
+
+ MPIRPC* rpc = DENSE_Lookup(node, key);
MPIRPC_Wait(rpc);
- // printf("cmpi_lookup()@%i -> %s \n", i, rpc->result);
-
+ // printf("cmpi_lookup()@%i -> %s \n", i, rpc->result);
+
return 0;
}
@@ -98,23 +98,23 @@
MPIRPC* rpc = DENSE_Translate(node, (DENSE_ID) id);
MPIRPC_Wait(rpc);
- int result = 0;
+ int result = 0;
sscanf(rpc->result, "%X", &result);
- return result;
+ return result;
}
/**
- Blocking call.
+ Blocking call.
*/
CMPI_RETURN
cmpi_put(char* key, char* value, int length)
{
struct inlist_item* item;
- MPIRPC_Node node;
- SHOW_FS(key);
+ MPIRPC_Node node;
+ SHOW_FS(key);
int i = inlist_random(contacts);
- MPIRPC_Node_make(MPI_COMM_WORLD, i, &node);
+ MPIRPC_Node_make(MPI_COMM_WORLD, i, &node);
MPIRPC* lookup = DENSE_Lookup_k(node, key);
MPIRPC_Wait(lookup);
@@ -123,30 +123,30 @@
for (item = ranks->head;
item; item = item->next)
{
- SHOW_I(item->data);
- MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
+ SHOW_I(item->data);
+ MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
MPIRPC* rpc = DENSE_Store(node, key, value, length);
MPIRPC_Wait(rpc);
MPIRPC_Free(rpc);
}
- inlist_free(ranks);
+ inlist_free(ranks);
- DONE;
- return CMPI_SUCCESS;
+ DONE;
+ return CMPI_SUCCESS;
}
/**
- Blocking call.
+ Blocking call.
*/
CMPI_RETURN
cmpi_update(char* key, char* value, int length, int offset)
{
struct inlist_item* item;
- MPIRPC_Node node;
- SHOW_FS(key);
+ MPIRPC_Node node;
+ SHOW_FS(key);
int i = inlist_random(contacts);
- MPIRPC_Node_make(MPI_COMM_WORLD, i, &node);
+ MPIRPC_Node_make(MPI_COMM_WORLD, i, &node);
MPIRPC* lookup = DENSE_Lookup_k(node, key);
MPIRPC_Wait(lookup);
@@ -155,16 +155,16 @@
for (item = ranks->head;
item; item = item->next)
{
- SHOW_I(item->data);
- MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
+ SHOW_I(item->data);
+ MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
MPIRPC* rpc = DENSE_Update(node, key, value, length, offset);
MPIRPC_Wait(rpc);
MPIRPC_Free(rpc);
}
- inlist_free(ranks);
+ inlist_free(ranks);
- DONE;
- return CMPI_SUCCESS;
+ DONE;
+ return CMPI_SUCCESS;
}
CMPI_RETURN
@@ -174,27 +174,27 @@
MPIRPC_Node node;
NOTE_FS(key);
-
- MPIRPC_Node_make(MPI_COMM_WORLD, i, &node);
+ MPIRPC_Node_make(MPI_COMM_WORLD, i, &node);
+
MPIRPC* lookup = DENSE_Lookup_k(node, key);
MPIRPC_Wait(lookup);
- struct inlist* ranks = inlist_parse(lookup->result);
- int rank = inlist_random(ranks);
+ struct inlist* ranks = inlist_parse(lookup->result);
+ int rank = inlist_random(ranks);
inlist_free(ranks);
-
- MPIRPC_Node_make(MPI_COMM_WORLD, rank, &node);
+
+ MPIRPC_Node_make(MPI_COMM_WORLD, rank, &node);
MPIRPC* rpc = DENSE_Retrieve(node, key);
MPIRPC_Wait(rpc);
*value = rpc->result;
*length = rpc->result_length;
- SHOW_I(rpc->result_length);
-
+ SHOW_I(rpc->result_length);
+
MPIRPC_Free(rpc);
-
- DONE;
+
+ DONE;
return CMPI_SUCCESS;
}
@@ -202,15 +202,15 @@
cmpi_shutdown()
{
struct inlist_item* item;
- NOTE_F;
+ NOTE_F;
- MPIRPC_Node node;
+ MPIRPC_Node node;
for (item = contacts->head; item; item = item->next)
{
- MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
+ MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
DENSE_Shutdown(node);
}
- DONE;
+ DONE;
}
void
@@ -221,10 +221,10 @@
cmpi_debug_caches()
{
struct inlist_item* item;
- MPIRPC_Node node;
+ MPIRPC_Node node;
for (item = contacts->head; item; item = item->next)
{
- MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
+ MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
DENSE_Debug_cache(node);
}
}
@@ -232,17 +232,17 @@
void
DENSE_Read_params(void)
{
- // NOTE_F;
+ // NOTE_F;
char* nodes_msg = cmpi_params_search("nodes");
if (nodes_msg)
{
int n = sscanf(nodes_msg, "%i", &dense_nodes);
- // SHOW_I(dense_nodes);
+ // SHOW_I(dense_nodes);
assert(n == 1);
free(nodes_msg);
}
else
{
- dense_nodes = mpi_size;
+ dense_nodes = mpi_size;
}
}
Modified: test/cmpi/test01.c
===================================================================
--- test/cmpi/test01.c 2010-04-19 19:54:23 UTC (rev 2)
+++ test/cmpi/test01.c 2010-04-19 22:37:35 UTC (rev 3)
@@ -2,19 +2,19 @@
/**
Simply build DHT and shutdown.
Be sure to pass -n <nodes> !
-*/
+*/
-#include "test_helpers.h"
+#include "test_helpers.h"
void
cmpi_client_code()
{
- NOTE_F;
+ NOTE_F;
gossip_set_debug_mask(1, MASK_MPIRPC);
-
+
wait_for_notification();
- notify_next();
+ notify_next();
- cmpi_shutdown();
+ cmpi_shutdown();
}
Modified: test/cmpi/test02.c
===================================================================
--- test/cmpi/test02.c 2010-04-19 19:54:23 UTC (rev 2)
+++ test/cmpi/test02.c 2010-04-19 22:37:35 UTC (rev 3)
@@ -1,21 +1,21 @@
/**
- Assemble and debug tables.
+ Assemble and debug tables.
*/
-#include "test_helpers.h"
+#include "test_helpers.h"
void
cmpi_client_code()
{
- NOTE_F;
+ NOTE_F;
wait_for_notification();
- notify_next();
+ notify_next();
cmpi_debug_tables();
- sleep(mpi_rank);
-
- cmpi_shutdown();
+ sleep(mpi_rank);
+
+ cmpi_shutdown();
}
Modified: test/cmpi/test03.c
===================================================================
--- test/cmpi/test03.c 2010-04-19 19:54:23 UTC (rev 2)
+++ test/cmpi/test03.c 2010-04-19 22:37:35 UTC (rev 3)
@@ -1,39 +1,39 @@
/**
- Put two keys and get one of them.
+ Put two keys and get one of them.
*/
-#include "test_helpers.h"
+#include "test_helpers.h"
void
cmpi_client_code()
{
char key1[10];
- char key2[10];
+ char key2[10];
sprintf(key1, "key1_%i", mpi_rank);
sprintf(key2, "key2_%i", mpi_rank);
wait_for_notification();
- notify_next();
+ notify_next();
char value[30];
- strcpy(value, "value1");
- cmpi_put(key1, value, strlen(value)+1);
- strcpy(value, "value2");
+ strcpy(value, "value1");
+ cmpi_put(key1, value, strlen(value)+1);
+ strcpy(value, "value2");
cmpi_put(key2, value, strlen(value)+1);
-
+
sleep(2);
-
- cmpi_debug_caches();
- sleep(2);
-
- int length;
- char* result;
+ cmpi_debug_caches();
+
+ sleep(2);
+
+ int length;
+ char* result;
cmpi_get(key1, &result, &length);
- printf("result(%i): %s\n", result, length);
-
- sleep(3);
-
- cmpi_shutdown();
+ printf("result(%i): %s\n", result, length);
+
+ sleep(3);
+
+ cmpi_shutdown();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-19 19:54:32
|
Revision: 2
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=2&view=rev
Author: jmwozniak
Date: 2010-04-19 19:54:23 +0000 (Mon, 19 Apr 2010)
Log Message:
-----------
Whitespace cleanups, etc.
Modified Paths:
--------------
Makefile.in
configure.ac
include/gossip.h
include/kda-1.h
include/mpirpc-1.h
setup.sh
src/kda-1/kademlia.c
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-19 18:18:16 UTC (rev 1)
+++ Makefile.in 2010-04-19 19:54:23 UTC (rev 2)
@@ -293,7 +293,7 @@
$(E)echo CFLAGS: $(CFLAGS)
$(E)echo IFLAGS: $(IFLAGS)
$(E)echo LIBS: $(LIBS)
- $(E)echo DEPENDS: $(DEPENDS)
+ $(E)echo DEPENDS: $(DEPENDS)
$(E)echo OPENSSL: $(OPENSSL_LOCATION)
# $(E)echo USE_MPIRPC_1: @USE_MPIRPC_1@
# $(E)echo USE_MPIRPC_2: @USE_MPIRPC_2@
@@ -317,16 +317,12 @@
CMPI := lib/libcmpi.a
MPIRPC := lib/libmpirpc.a
CMPI_IO := lib/libcmpi-io.so
-GOBS = lib/libgobs.a
-GACK = lib/libgack.a
-SKULLFS = lib/libskullfs.a
################################################################
# Makefile includes
# this is how we pull build information from all of the project
# subdirectories, make sure to catch top level module.mk as well
DIR :=
-include module.mk
include $(MODULES)
TEST_OBJS += $(patsubst %.c, %.o, $(TEST_SRC))
@@ -377,12 +373,6 @@
mpirpc: $(MPIRPC)
-gobs: $(GOBS)
-
-gack: $(GACK)
-
-skullfs: $(SKULLFS)
-
# Just like dir, but strip the slash off the end, to be pretty.
dirname = $(patsubst %/,%,$(dir $(1)))
Modified: configure.ac
===================================================================
--- configure.ac 2010-04-19 18:18:16 UTC (rev 1)
+++ configure.ac 2010-04-19 19:54:23 UTC (rev 2)
@@ -475,7 +475,6 @@
dnl output final version of top level makefile and subdirectory
dnl makefile includes
AC_CONFIG_FILES(Makefile
-module.mk
src/gossip/module.mk
src/adts/module.mk
src/cmpi/module.mk
Modified: include/gossip.h
===================================================================
--- include/gossip.h 2010-04-19 18:18:16 UTC (rev 1)
+++ include/gossip.h 2010-04-19 19:54:23 UTC (rev 2)
@@ -37,9 +37,7 @@
#define MASK_CMPI ((uint64_t)1 << 6)
#define MASK_ARCH ((uint64_t)1 << 7)
#define MASK_STORAGE ((uint64_t)1 << 8)
-#define MASK_GUM ((uint64_t)1 << 9)
-#define MASK_GOBS ((uint64_t)1 << 10)
-#define MASK_FS ((uint64_t)1 << 11)
+#define MASK_KDA ((uint64_t)1 << 9)
#define MASK_CLIENT ((uint64_t)1 << 12)
/********************************************************************
@@ -171,7 +169,7 @@
#define gossip_do(mask, x) \
if ((gossip_debug_on) && (gossip_debug_mask & mask) && \
(gossip_facility)) \
- { x; }
+ { x; }
#endif /* GOSSIP_DISABLE_DEBUG */
Modified: include/kda-1.h
===================================================================
--- include/kda-1.h 2010-04-19 18:18:16 UTC (rev 1)
+++ include/kda-1.h 2010-04-19 19:54:23 UTC (rev 2)
@@ -2,13 +2,13 @@
#ifndef KADEMLIA_1_H
#define KADEMLIA_1_H
-#include <limits.h>
-#include <signal.h>
-#include <stdbool.h>
+#include <limits.h>
+#include <signal.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <time.h>
-#include <unistd.h>
+#include <time.h>
+#include <unistd.h>
#include <mpi.h>
@@ -16,11 +16,11 @@
#include <itable.h>
#include <list.h>
#include <ilist.h>
-#include <inlist.h>
-#include <mpi_tools.h>
+#include <inlist.h>
+#include <mpi_tools.h>
#include <mpirpc.h>
-#include <cmpi.h>
-// #include <driver.h>
+#include <cmpi.h>
+// #include <driver.h>
#ifdef DISKSIM_LOCATION
#include <disksim.h>
@@ -28,18 +28,18 @@
typedef int KDA_ID;
-#include "kda_types-1.h"
+#include "kda_types-1.h"
#include "kda_neighbor-1.h"
-#define KDA_SPACE_SIZE (sizeof(KDA_ID)*8) // 160 in paper
-#define KDA_HASH_SPACE INT_MAX //
+#define KDA_SPACE_SIZE (sizeof(KDA_ID)*8) // 160 in paper
+#define KDA_HASH_SPACE INT_MAX //
/**
KDA_ID_NULL=0 is an invalid KDA_ID used for semantic purposes.
- make_id must not create this id.
+ make_id must not create this id.
*/
-#define KDA_ID_NULL 0;
+#define KDA_ID_NULL 0;
/**
Obtain the Kademlia distance between two ids.
@@ -48,12 +48,12 @@
/**
Contains neighbors. A bucket is all neighbors of a given
- distance 2^i - 2^i+1
+ distance 2^i - 2^i+1
*/
-typedef struct list* K_BUCKET;
+typedef struct list* K_BUCKET;
-extern int kda_nodes;
-extern struct itable* operations;
+extern int kda_nodes;
+extern struct itable* operations;
void KDA_Init(int alpha_in, int k_in);
@@ -62,14 +62,14 @@
/**
Return once op->status is KDA_STATUS_COMPLETE
*/
-void KDA_Wait(KDA_Operation* op);
+void KDA_Wait(KDA_Operation* op);
//// Local API...
int KDA_Local_rank(KDA_ID other_id);
-KDA_Neighbor* KDA_Local_ID(int other_rank);
+KDA_Neighbor* KDA_Local_ID(int other_rank);
-//// Client API:
+//// Client API:
MPIRPC* KDA_Translate(int rank, KDA_ID id);
MPIRPC* KDA_Translate_k(int rank, KDA_ID id);
MPIRPC* KDA_Lookup(int rank, char* key);
@@ -79,10 +79,10 @@
MPIRPC* KDA_Update(int rank, char* key, char* value, int length, int offset);
//// In-DHT API...
-void KDA_Ping(KDA_ID other_id);
-void KDA_Announce(void);
+void KDA_Ping(KDA_ID other_id);
+void KDA_Announce(void);
struct ilist* KDA_Find_key(char* key);
-struct ilist* KDA_Find(KDA_ID object_id);
+struct ilist* KDA_Find(KDA_ID object_id);
struct ilist* KDA_Closest(KDA_ID object_id);
//// Helpers...
@@ -90,56 +90,56 @@
void (*proceed)(MPIRPC* rpc),
KDA_Query* query);
bool KDA_Find_node(KDA_Operation* op);
-bool KDA_Find_node_again(KDA_Operation* op);
+bool KDA_Find_node_again(KDA_Operation* op);
void KDA_Operation_free(KDA_Operation* op);
-char* KDA_Description(void);
-char* KDA_id_tostring(KDA_ID other_id);
+char* KDA_Description(void);
+char* KDA_id_tostring(KDA_ID other_id);
KDA_ID make_id(void);
-void join(int other_rank);
+void join(int other_rank);
char* id_tostring(void);
-void listen_loop(void);
+void listen_loop(void);
void bootstrap(int other_rank);
void bootjoin(int other_id, int other_rank);
void rpc_bootjoin(int other_rank);
-void bootping(void);
+void bootping(void);
void dump_buckets(void);
-char* bucket_usage(void);
+char* bucket_usage(void);
char* buckets_tostring(void);
-bool add_neighbor(KDA_Neighbor* neighbor);
+bool add_neighbor(KDA_Neighbor* neighbor);
//// Handlers...
-void handle_announce(int caller, int unique, char* args);
+void handle_announce(int caller, int unique, char* args);
void handle_info(int caller, int unique, char* args);
void handle_debug_tables(int caller, int unique, char* args);
-void handle_bucket_usage(int caller, int unique, char* args);
+void handle_bucket_usage(int caller, int unique, char* args);
void handle_bootjoin(int caller, int unique, char* args);
void handle_bootping(int caller, int unique, char* args);
-void handle_update(int caller, int unique, char* args);
-void handle_find_node(int caller, int unique, char* args);
+void handle_update(int caller, int unique, char* args);
+void handle_find_node(int caller, int unique, char* args);
void handle_ping(int caller, int unique, char* args);
void handle_query_id(int caller, int unique, char* args);
void handle_query_id_k(int caller, int unique, char* args);
void handle_store(int caller, int unique, char* args);
void handle_retrieve(int caller, int unique, char* args);
-void handle_quit(int caller, int unique, char* args);
+void handle_quit(int caller, int unique, char* args);
//// Synchronous methods...
-struct ilist* find_node(KDA_ID id);
+struct ilist* find_node(KDA_ID id);
-//// Asynchronous methods and return services...
+//// Asynchronous methods and return services...
void query_id(int caller, int unique, KDA_ID id);
-void return_query_id(KDA_Operation* op);
+void return_query_id(KDA_Operation* op);
void query_id_k(int caller, int unique, KDA_ID id);
-void return_query_id_k(KDA_Operation* op);
+void return_query_id_k(KDA_Operation* op);
//// Proceeds...
-void proceed_bootjoin(MPIRPC* rpc);
+void proceed_bootjoin(MPIRPC* rpc);
void proceed_find(MPIRPC* rpc);
-void proceed_ping(MPIRPC* rpc);
+void proceed_ping(MPIRPC* rpc);
-#endif
+#endif
Modified: include/mpirpc-1.h
===================================================================
--- include/mpirpc-1.h 2010-04-19 18:18:16 UTC (rev 1)
+++ include/mpirpc-1.h 2010-04-19 19:54:23 UTC (rev 2)
@@ -2,8 +2,6 @@
#ifndef MPIRPC_1_H
#define MPIRPC_1_H
-#warning
-
#define _XOPEN_SOURCE 500
#include <assert.h>
Modified: setup.sh
===================================================================
--- setup.sh 2010-04-19 18:18:16 UTC (rev 1)
+++ setup.sh 2010-04-19 19:54:23 UTC (rev 2)
@@ -1,6 +1,6 @@
#!/bin/sh
-rm -fv config.cache
+rm -fv config.cache
mkdir -p maint/config
Modified: src/kda-1/kademlia.c
===================================================================
--- src/kda-1/kademlia.c 2010-04-19 18:18:16 UTC (rev 1)
+++ src/kda-1/kademlia.c 2010-04-19 19:54:23 UTC (rev 2)
@@ -2,56 +2,56 @@
#include "kda-1.h"
#ifdef DISKSIM_LOCATION
-#endif
+#endif
/**
My kademlia ID.
- Normally represented in hex.
-*/
+ Normally represented in hex.
+*/
KDA_ID id;
/**
- The neighbor table.
+ The neighbor table.
*/
-K_BUCKET k_bucket[KDA_SPACE_SIZE];
+K_BUCKET k_bucket[KDA_SPACE_SIZE];
/**
- Outstanding KDA_Operations.
+ Outstanding KDA_Operations.
*/
-struct itable* operations;
+struct itable* operations;
/**
- Kademlia parameter alpha.
+ Kademlia parameter alpha.
*/
int alpha;
/**
Kademlia parameter k.
*/
-int k;
+int k;
/**
- Number of nodes in boot-up time original DHT.
+ Number of nodes in boot-up time original DHT.
*/
-int kda_nodes;
+int kda_nodes;
/**
ID for special sequential global operations such as
- debug dumps and shutdowns.
+ debug dumps and shutdowns.
*/
-int last_global_opid = 0;
+int last_global_opid = 0;
/**
Number of times buckets have been dumped.
- Useful for debugging only.
-*/
-int dumps = 0;
+ Useful for debugging only.
+*/
+int dumps = 0;
/**
- Self. Useful in KDA_Closest().
-*/
-KDA_Neighbor self;
-
+ Self. Useful in KDA_Closest().
+*/
+KDA_Neighbor self;
+
/**
Setup Kademlia.
Must be called after API_Init() and whoami().
@@ -59,26 +59,26 @@
void
KDA_Init(int alpha_in, int k_in)
{
- gossip_do(MASK_KDA, NOTE_F);
-
+ gossip_do(MASK_KDA, NOTE_F);
+
int i;
alpha = alpha_in;
k = k_in;
-
- id = make_id();
+
+ id = make_id();
for (i = 0; i < KDA_SPACE_SIZE; i++)
k_bucket[i] = list_create();
- operations = itable_create(CALL_TABLE_SIZE);
+ operations = itable_create(CALL_TABLE_SIZE);
gossip_do(MASK_KDA, NOTE_XI("ID: ", id, id));
- neighbor_make(id, mpi_rank, &self);
-
+ neighbor_make(id, mpi_rank, &self);
+
MPIRPC_Register("info", handle_info);
MPIRPC_Register("debug_tables", handle_debug_tables);
- MPIRPC_Register("debug_table_usage", handle_bucket_usage);
+ MPIRPC_Register("debug_table_usage", handle_bucket_usage);
MPIRPC_Register("bootjoin", handle_bootjoin);
- MPIRPC_Register("bootping", handle_bootping);
+ MPIRPC_Register("bootping", handle_bootping);
MPIRPC_Register("ping", handle_ping);
MPIRPC_Register("update", handle_update);
MPIRPC_Register("find_node", handle_find_node);
@@ -88,23 +88,23 @@
MPIRPC_Register("retrieve", handle_retrieve);
MPIRPC_Register("quit", handle_quit);
- // Initialize disksim emulator:
+ // Initialize disksim emulator:
DISKSIM(disksim_init());
if (mpi_rank == 0)
{
// NOTE("bootstrap...");
- bootstrap(1);
- listen_loop();
+ bootstrap(1);
+ listen_loop();
}
- else
+ else
{
listen_loop();
}
}
/**
- Perform a local search of the neighbor table for the id.
+ Perform a local search of the neighbor table for the id.
@return The MPI rank of the given Kademlia id or -1 if not found.
*/
int
@@ -114,25 +114,25 @@
int i = ilog2(d);
struct list_item* item;
- // printf("rank : %i \n", other_id);
- // printf("i: %i \n", i);
-
+ // printf("rank : %i \n", other_id);
+ // printf("i: %i \n", i);
+
for (item = k_bucket[i]->head;
item->next; item = item->next)
{
if (((KDA_Neighbor*) item->data)->id == other_id)
- return ((KDA_Neighbor*) item->data)->rank;
+ return ((KDA_Neighbor*) item->data)->rank;
}
-
- return -1;
+
+ return -1;
}
/**
- Perform a local search of the neighbor table for the MPI rank.
- @return The Kademlia neighbor with the given rank.
+ Perform a local search of the neighbor table for the MPI rank.
+ @return The Kademlia neighbor with the given rank.
*/
KDA_Neighbor*
-KDA_Local_neighbor(int other_rank)
+KDA_Local_neighbor(int other_rank)
{
int i;
struct list_item* item;
@@ -143,22 +143,22 @@
{
KDA_Neighbor* n = (KDA_Neighbor*) item->data;
if (n->rank == other_rank)
- return n;
+ return n;
}
}
- return NULL;
+ return NULL;
}
/**
Use DHT to synchronously find the given key.
*/
-struct ilist*
+struct ilist*
KDA_Find_key(char* key)
{
NOTE_F;
-
+
int id = hash_string(key, KDA_HASH_SPACE);
- return KDA_Find(id);
+ return KDA_Find(id);
}
/**
@@ -167,25 +167,25 @@
struct ilist*
KDA_Find(KDA_ID id)
{
- KDA_Operation* op =
+ KDA_Operation* op =
KDA_Operate(id, NULL, NULL, NULL, NULL);
- KDA_Wait(op);
- return op->k_closest;
+ KDA_Wait(op);
+ return op->k_closest;
}
void
KDA_Wait(KDA_Operation* op)
{
- MPIRPC_Snooze_reset();
+ MPIRPC_Snooze_reset();
while (op->status != KDA_STATUS_COMPLETE)
{
if (MPIRPC_Check())
MPIRPC_Snooze_reset();
else
- MPIRPC_Snooze();
+ MPIRPC_Snooze();
}
}
-
+
/**
ordered local closest node lookup
@return k neighbors in a list
@@ -193,11 +193,11 @@
struct ilist*
KDA_Closest(KDA_ID object_id)
{
- gossip_do(MASK_KDA, NOTE_FX(object_id));
+ gossip_do(MASK_KDA, NOTE_FX(object_id));
struct ilist* result = ilist_create();
int d;
- d = XOR(id, object_id);
- ilist_add(result, d, neighbor_clone(&self));
+ d = XOR(id, object_id);
+ ilist_add(result, d, neighbor_clone(&self));
int i;
struct list_item* item;
for (i = 0; i < KDA_SPACE_SIZE; i++)
@@ -208,38 +208,38 @@
d = XOR(neighbor->id, object_id);
if (result->size < k)
{
- // DEBUG(ilist_fdumpkeys(debug_file, result));
+ // DEBUG(ilist_fdumpkeys(debug_file, result));
ilist_ordered_insert(result, d, neighbor_clone(neighbor));
- // DEBUG(ilist_fdumpkeys(debug_file, result));
- // DEBUG(char* s = ilist_serialize_ptrs(result);NOTE(s);free(s););
+ // DEBUG(ilist_fdumpkeys(debug_file, result));
+ // DEBUG(char* s = ilist_serialize_ptrs(result);NOTE(s);free(s););
}
else if (d < result->tail->key)
{
- KDA_Neighbor* victim = ilist_pop(result);
- // NOTE_I("POPPED: ", victim->rank);
+ KDA_Neighbor* victim = ilist_pop(result);
+ // NOTE_I("POPPED: ", victim->rank);
ilist_ordered_insert(result, d, neighbor_clone(neighbor));
- // SHOW_P(victim);
- free(victim);
+ // SHOW_P(victim);
+ free(victim);
}
}
}
- // DEBUG(char* s = ilist_serialize_ptrs(result);NOTE(s);free(s););
- return result;
+ // DEBUG(char* s = ilist_serialize_ptrs(result);NOTE(s);free(s););
+ return result;
}
/**
- Query node at rank for key location.
+ Query node at rank for key location.
*/
MPIRPC*
KDA_Lookup(int rank, char* key)
{
- gossip_do(MASK_KDA, NOTE_F);
-
+ gossip_do(MASK_KDA, NOTE_F);
+
KDA_ID object_id = hash_string(key, KDA_HASH_SPACE);
- // printf("id: %i \n", object_id);
-
- return KDA_Translate(rank, object_id);
+ // printf("id: %i \n", object_id);
+
+ return KDA_Translate(rank, object_id);
}
/**
@@ -248,11 +248,11 @@
MPIRPC*
KDA_Lookup_k(int rank, char* key)
{
- KDA_ID object_id = SHA1_mod(key);
- gossip_do(MASK_KDA, SHOW_FIS_X(rank, key, object_id));
- // NOTE_SXI("TRANSLATE: ", key, object_id, object_id);
-
- return KDA_Translate_k(rank, object_id);
+ KDA_ID object_id = SHA1_mod(key);
+ gossip_do(MASK_KDA, SHOW_FIS_X(rank, key, object_id));
+ // NOTE_SXI("TRANSLATE: ", key, object_id, object_id);
+
+ return KDA_Translate_k(rank, object_id);
}
/**
@@ -276,11 +276,11 @@
// NOTE_F;
#ifdef ENABLE_TEST01
- if (cmpi_status == CMPI_STATUS_READY)
+ if (cmpi_status == CMPI_STATUS_READY)
printf("[%i] MPIRPC_Call(query_id_k)\n", debug_rank);
#endif
-
+
MPIRPC* rpc =
MPIRPC_Call(rank, heap("query_id_k"), xheap(id),
NULL, MPIRPC_PROCEED_NULL);
@@ -289,32 +289,32 @@
/**
Instruct a node to store a value.
- Asynchronous. Copies key and value into MPIRPC.
+ Asynchronous. Copies key and value into MPIRPC.
*/
MPIRPC*
KDA_Store(int rank, char* key, char* value)
{
gossip_do(MASK_KDA, NOTE_F);
- int klength = strlen(key);
- int vlength = strlen(value);
+ int klength = strlen(key);
+ int vlength = strlen(value);
char* args = malloc((klength+vlength+5)*sizeof(char));
- assert(args);
+ assert(args);
strcpy(args, key);
- args[klength] = ' ';
+ args[klength] = ' ';
strcpy(args+klength+1, value);
#ifdef ENABLE_TEST01
- if (cmpi_status == CMPI_STATUS_READY)
+ if (cmpi_status == CMPI_STATUS_READY)
printf("[%i] MPIRPC_Call(store)\n", debug_rank);
#endif
-
+
MPIRPC* rpc = MPIRPC_Call(rank, heap("store"), args,
NULL, MPIRPC_PROCEED_NULL);
- return rpc;
+ return rpc;
}
/**
- Instruct a node to retrieve a value.
+ Instruct a node to retrieve a value.
*/
MPIRPC*
KDA_Retrieve(int rank, char* key)
@@ -322,38 +322,38 @@
MPIRPC* rpc =
MPIRPC_Call(rank, heap("retrieve"), heap(key),
NULL, MPIRPC_PROCEED_NULL);
- return rpc;
+ return rpc;
}
/**
Instruct a node to update a value.
- Asynchronous. Copies key and value into MPIRPC.
+ Asynchronous. Copies key and value into MPIRPC.
*/
MPIRPC*
-KDA_Update(int rank, char* key, char* value, int length)
+KDA_Update(int rank, char* key, char* value, int length, int offset)
{
gossip_do(MASK_KDA, NOTE_F);
- int klength = strlen(key);
- int vlength = strlen(value);
+ int klength = strlen(key);
+ int vlength = strlen(value);
char* args = malloc((klength+vlength+15)*sizeof(char));
- assert(args);
+ assert(args);
sprintf(args, "%s %i %s", key, length, value);
MPIRPC* rpc = MPIRPC_Call(rank, heap("update"), args,
NULL, MPIRPC_PROCEED_NULL);
- return rpc;
+ return rpc;
}
KDA_Query*
query_create(int caller, int unique,
- void (*service)(KDA_Operation* op))
+ void (*service)(KDA_Operation* op))
{
- // NOTE_F;
+ // NOTE_F;
KDA_Query* query = malloc(sizeof(KDA_Query));
query->caller = caller;
query->unique = unique;
- query->service = service;
- return query;
+ query->service = service;
+ return query;
}
/**
@@ -362,27 +362,27 @@
void
handle_info(int caller, int unique, char* args)
{
- gossip_do(MASK_KDA, NOTE_F);
+ gossip_do(MASK_KDA, NOTE_F);
char* result = buckets_tostring();
- MPIRPC_Return(caller, unique, result);
+ MPIRPC_Return(caller, unique, result);
}
void
handle_store(int caller, int unique, char* args)
{
#ifdef ENABLE_TEST03
- SHOW_FS(args);
+ SHOW_FS(args);
#else
char* key = malloc(CMPI_KEY_LENGTH * sizeof(char));
char* value = malloc(CMPI_VALUE_LENGTH * sizeof(char));
- sscanf(args, "%s %s", key, value);
+ sscanf(args, "%s %s", key, value);
gossip_do(MASK_KDA, SHOW_FSS(key, value));
cmpi_cached_store(key, value);
#endif
- MPIRPC_Return(caller, unique, NULL);
+ MPIRPC_Return(caller, unique, NULL);
}
void
@@ -390,26 +390,26 @@
{
gossip_do(MASK_KDA, NOTE_FS(args));
- char* data;
- cmpi_cached_retrieve(args, &data);
- // SHOW_S(data);
- MPIRPC_Return(caller, unique, heap(data));
+ char* data;
+ cmpi_cached_retrieve(args, &data);
+ // SHOW_S(data);
+ MPIRPC_Return(caller, unique, heap(data));
}
void
handle_update(int caller, int unique, char* args)
{
- gossip_do(MASK_KDA, SHOW_FS(args));
+ gossip_do(MASK_KDA, SHOW_FS(args));
char* key = malloc(CMPI_KEY_LENGTH * sizeof(char));
char* value = malloc(CMPI_VALUE_LENGTH * sizeof(char));
- int offset;
+ int offset;
- sscanf(args, "%s %i %s", key, &offset, value);
+ sscanf(args, "%s %i %s", key, &offset, value);
gossip_do(MASK_KDA, SHOW_FSSI(key, value, offset));
cmpi_cached_update(key, value, offset);
- MPIRPC_Return(caller, unique, NULL);
+ MPIRPC_Return(caller, unique, NULL);
}
void
@@ -418,17 +418,17 @@
gossip_do(MASK_KDA, NOTE_F);
/*
- // We can rebroadcast the message.
- int opid;
+ // We can rebroadcast the message.
+ int opid;
sscanf(args, "%i", &opid);
if (opid == last_global_opid)
{
NOTE("Already processed...");
MPIRPC_Return(caller, unique, NULL);
- return;
+ return;
}
- last_global_opid = opid;
+ last_global_opid = opid;
int i;
struct list_item* item;
@@ -443,57 +443,57 @@
}
}
*/
-
+
dump_buckets();
- MPIRPC_Return(caller, unique, NULL);
+ MPIRPC_Return(caller, unique, NULL);
}
void
handle_bucket_usage(int caller, int unique, char* args)
{
gossip_do(MASK_KDA, NOTE_F);
- dumps++;
+ dumps++;
char* msg = bucket_usage();
- printf(msg);
+ printf(msg);
free(msg);
- MPIRPC_Return(caller, unique, NULL);
+ MPIRPC_Return(caller, unique, NULL);
}
void
handle_quit(int caller, int unique, char* args)
{
- int i;
-
+ int i;
+
gossip_do(MASK_KDA, NOTE_F);
KDA_Neighbor* n_caller = KDA_Local_neighbor(caller);
if (n_caller != NULL)
- n_caller->quitting = true;
-
+ n_caller->quitting = true;
+
if (cmpi_quitting)
{
NOTE("Already quitting...");
- MPIRPC_Return(caller, unique, NULL);
- return;
+ MPIRPC_Return(caller, unique, NULL);
+ return;
}
cmpi_quitting = true;
-
+
MPIRPC_Return(caller, unique, NULL);
// NOTE_I("cmpi_cache: ", cmpi_cache->size);
itable_destroy(operations);
- // NOTE("DESTROY_BUCKETS");
+ // NOTE("DESTROY_BUCKETS");
for (i = 0; i < KDA_SPACE_SIZE; i++)
{
- // SHOW_I(i);
+ // SHOW_I(i);
// list_destroy(k_bucket[i]);
}
}
void
-rpc_find_node(int other_rank, KDA_Operation* op)
+rpc_find_node(int other_rank, KDA_Operation* op)
{
#ifdef ENABLE_TEST01
if (cmpi_status == CMPI_STATUS_READY)
@@ -502,8 +502,8 @@
fflush(stdout);
}
#endif
-
- MPIRPC_Call(other_rank, heap("find_node"), xheap(op->object_id),
+
+ MPIRPC_Call(other_rank, heap("find_node"), xheap(op->object_id),
op, proceed_find);
}
@@ -513,17 +513,17 @@
int object_id;
struct ilist_item* item;
int count = sscanf(args, "%X", &object_id);
- assert(count == 1);
+ assert(count == 1);
struct ilist* known = KDA_Closest(object_id);
char* result = malloc(1000*sizeof(char));
char* s = result;
- s += sprintf(s, "%i ", known->size);
+ s += sprintf(s, "%i ", known->size);
for (item = known->head;
item; item = item->next)
s += sprintf(s, "%s", neighbor_name(item->data));
- ilist_destroy(known);
- MPIRPC_Return(caller, unique, result);
+ ilist_destroy(known);
+ MPIRPC_Return(caller, unique, result);
}
void
@@ -534,18 +534,18 @@
query_id(caller, unique, object_id);
}
-void
+void
query_id(int caller, int unique, KDA_ID object_id)
{
- KDA_Operate(object_id, NULL, NULL, NULL,
- query_create(caller, unique, return_query_id));
+ KDA_Operate(object_id, NULL, NULL, NULL,
+ query_create(caller, unique, return_query_id));
}
void
return_query_id(KDA_Operation* op)
{
KDA_Neighbor* n = (KDA_Neighbor*) ilist_poll(op->k_closest);
- char* result = iheap(n->rank);
+ char* result = iheap(n->rank);
MPIRPC_Return(op->query->caller, op->query->unique, result);
// free op
}
@@ -558,33 +558,33 @@
query_id_k(caller, unique, object_id);
}
-void
+void
query_id_k(int caller, int unique, KDA_ID object_id)
{
- KDA_Operate(object_id, NULL, NULL, NULL,
- query_create(caller, unique, return_query_id_k));
+ KDA_Operate(object_id, NULL, NULL, NULL,
+ query_create(caller, unique, return_query_id_k));
}
void
return_query_id_k(KDA_Operation* op)
{
char* result = malloc(2048*sizeof(char));
- char* p = result;
+ char* p = result;
while (op->k_closest->size > 0)
{
KDA_Neighbor* neighbor =
(KDA_Neighbor*) ilist_poll(op->k_closest);
p += neighbor_name_sprint(p, neighbor);
- free(neighbor);
+ free(neighbor);
}
MPIRPC_Return(op->query->caller, op->query->unique, result);
- KDA_Operation_free(op);
+ KDA_Operation_free(op);
}
/**
The KDA_Operation has completed its k_closest list.
Now issue the RPC on the target nodes or
- respond to the client query.
+ respond to the client query.
*/
void
KDA_Map(KDA_Operation* op)
@@ -600,11 +600,11 @@
MPIRPC_Call(n->rank, heap(op->name), heap(op->args),
op, op->proceed);
}
- op->returned = inlist_create();
+ op->returned = inlist_create();
}
else if (op->query)
{
- op->returned = NULL;
+ op->returned = NULL;
op->query->service(op);
}
}
@@ -612,44 +612,44 @@
void
proceed_find(MPIRPC* rpc)
{
- gossip_do(MASK_KDA, NOTE_F);
-
- KDA_Operation* op = (KDA_Operation*) rpc->extras;
+ gossip_do(MASK_KDA, NOTE_F);
- // NOTE(neighbor_ranks_tostring(op->k_closest));
-
+ KDA_Operation* op = (KDA_Operation*) rpc->extras;
+
+ // NOTE(neighbor_ranks_tostring(op->k_closest));
+
if (rpc->status == MPIRPC_STATUS_FAULT)
{
- NOTE_FS("FAULT!");
+ NOTE_FS("FAULT!");
}
else
{
int size;
- char* p = rpc->result;
+ char* p = rpc->result;
sscanf(rpc->result, "%i ", &size);
p = index(rpc->result, ' ')+1;
int i;
for (i = 0; i < size; i++)
{
- int other_id;
+ int other_id;
int other_rank;
int count = sscanf(p, "[%X]@%i ", &other_id, &other_rank);
- assert(count == 2);
+ assert(count == 2);
p = index(p, ' ')+1;
KDA_Neighbor neighbor;
neighbor_make(other_id, other_rank, &neighbor);
- add_neighbor(&neighbor);
+ add_neighbor(&neighbor);
int d = XOR(other_id, op->object_id);
if (d < op->k_closest->tail->key ||
op->k_closest->size < k)
{
// NOTE_S("data: ", neighbor_name(&neighbor));
// DEBUG(ilist_fdump(debug_file, neighbor_name, op->k_closest));
- // DEBUG(char* s = ilist_serialize_ptrs(op->k_closest);NOTE(s);free(s););
+ // DEBUG(char* s = ilist_serialize_ptrs(op->k_closest);NOTE(s);free(s););
if (! ilist_matches(op->k_closest, neighbor_cmp, &neighbor))
{
KDA_Neighbor* clone = neighbor_clone(&neighbor);
- ilist_ordered_insert(op->k_closest, d, clone);
+ ilist_ordered_insert(op->k_closest, d, clone);
op->improved = true;
if (op->k_closest->size > k)
{
@@ -659,29 +659,29 @@
}
}
}
-
+
// Check for convergence:
inlist_remove(op->outstanding, rpc->target);
-
+
if (rpc->result != NULL &&
rpc->result != MPIRPC_RESULT_FAULT)
{
- // NOTE("Free result.");
+ // NOTE("Free result.");
// free(rpc->result);
}
- MPIRPC_Free(rpc);
-
+ MPIRPC_Free(rpc);
+
if (op->outstanding->size == 0)
{
if (op->improved)
{
- op->improved = false;
+ op->improved = false;
if (! KDA_Find_node_again(op))
- KDA_Map(op);
+ KDA_Map(op);
}
else
{
- KDA_Map(op);
+ KDA_Map(op);
}
}
}
@@ -694,8 +694,8 @@
{
if (op->k_closest == NULL)
op->k_closest = KDA_Closest(op->object_id);
- // printf("local closest: \n");
- // ilist_output(neighbor_tostring, op->k_closest);
+ // printf("local closest: \n");
+ // ilist_output(neighbor_tostring, op->k_closest);
return KDA_Find_node_again(op);
}
@@ -703,69 +703,69 @@
bool
KDA_Find_node_again(KDA_Operation* op)
{
- // NOTE_S("ranks: ", neighbor_ranks_tostring(op->k_closest));
-
+ // NOTE_S("ranks: ", neighbor_ranks_tostring(op->k_closest));
+
struct ilist_item* item;
- // True iff we actually issued another RPC:
- bool contacted = false;
+ // True iff we actually issued another RPC:
+ bool contacted = false;
- int i = 0;
+ int i = 0;
for (item = op->k_closest->head;
i < alpha && item; item = item->next)
{
KDA_Neighbor* n = (KDA_Neighbor*) item->data;
if (n->rank == mpi_rank)
- continue;
+ continue;
if (! inlist_contains(op->contacted, n->rank))
{
inlist_add(op->contacted, n->rank);
inlist_add(op->outstanding, n->rank);
rpc_find_node(n->rank, op);
- contacted = true;
- i++;
+ contacted = true;
+ i++;
}
}
- return contacted;
+ return contacted;
}
/**
Join DHT using rank other_rank as known member.
*/
-bool
+bool
KDA_Join(int other_rank)
{
// join(other_rank, other_id);
-
- return true;
+
+ return true;
}
/**
Locate the object_id and call its host method and args.
- Copies name but not args onto the heap.
+ Copies name but not args onto the heap.
*/
-KDA_Operation*
+KDA_Operation*
KDA_Operate(KDA_ID object_id, char* name, void* args,
void (*proceed)(MPIRPC* rpc), KDA_Query* query)
{
- gossip_do(MASK_KDA, NOTE_F);
+ gossip_do(MASK_KDA, NOTE_F);
KDA_Operation* op = malloc(sizeof(KDA_Operation));
op->object_id = object_id;
- op->unique = ++unique;
+ op->unique = ++unique;
op->name = heap(name);
op->args = args;
- op->k_closest = NULL;
+ op->k_closest = NULL;
op->contacted = inlist_create();
- op->outstanding = inlist_create();
- op->improved = false;
- op->status = KDA_STATUS_SEARCHING;
- op->proceed = proceed;
- op->query = query;
-
+ op->outstanding = inlist_create();
+ op->improved = false;
+ op->status = KDA_STATUS_SEARCHING;
+ op->proceed = proceed;
+ op->query = query;
+
itable_add(operations, op->unique, op);
-
+
KDA_Find_node(op);
- return op;
+ return op;
}
void
@@ -775,23 +775,23 @@
// struct ilist_item* item;
// for (item = op->k_closest->head; item; item = item->next)
- // NOTE(neighbor_tostring(item->data));
-
- ilist_destroy(op->k_closest);
+ // NOTE(neighbor_tostring(item->data));
+ ilist_destroy(op->k_closest);
+
inlist_free(op->contacted);
- // NOTE("freeing op->outstanding");
+ // NOTE("freeing op->outstanding");
inlist_free(op->outstanding);
- // NOTE("freeing op->returned");
- if (op->returned)
+ // NOTE("freeing op->returned");
+ if (op->returned)
inlist_free(op->returned);
// NOTE("freeing op->query");
if (op->query)
- free(op->query);
-
+ free(op->query);
+
free(op->name);
- // if (op->args)
+ // if (op->args)
// free(op->args);
itable_remove(operations, op->unique);
@@ -802,13 +802,13 @@
void
KDA_Ping(KDA_ID other_id)
{
- KDA_Operate(other_id, heap("ping"), NULL, proceed_ping, NULL);
+ KDA_Operate(other_id, heap("ping"), NULL, proceed_ping, NULL);
}
void
proceed_ping(MPIRPC* rpc)
{
- KDA_Operation* op = (KDA_Operation*) rpc->extras;
+ KDA_Operation* op = (KDA_Operation*) rpc->extras;
inlist_add(op->returned, rpc->target);
// TODO: Deallocate op and rpc
@@ -821,7 +821,7 @@
{
cmpi_status = CMPI_STATUS_READY;
printf("[%i] %s\n", debug_rank, timestring("READY", NULL));
- fflush(stdout);
+ fflush(stdout);
KDA_Announce();
if (mpi_rank < kda_nodes-1)
rpc_bootjoin(mpi_rank+1);
@@ -831,20 +831,20 @@
{
// Notification hack...
printf("[%i] NOTIFICATION\n", debug_rank);
- fflush(stdout);
- int msg = -2;
+ fflush(stdout);
+ int msg = -2;
MPI_Send(&msg, 1, MPI_INT,
kda_nodes, 0, MPI_COMM_WORLD);
}
else
{
printf("[%i] NO NOTIFICATION\n", debug_rank);
- fflush(stdout);
+ fflush(stdout);
}
}
}
}
- MPIRPC_Free(rpc);
+ MPIRPC_Free(rpc);
}
void
@@ -852,8 +852,8 @@
{
gossip_do(MASK_KDA, NOTE_F);
- // NOTE_S("", buckets_tostring());
-
+ // NOTE_S("", buckets_tostring());
+
int i;
struct list_item* item;
for (i = 0; i < KDA_SPACE_SIZE; i++)
@@ -861,8 +861,8 @@
for (item = k_bucket[i]->head;
item; item = item->next)
{
- KDA_Neighbor* n = (KDA_Neighbor*) item->data;
- MPIRPC_Block(n->rank, heap("announce"), xheap(id));
+ KDA_Neighbor* n = (KDA_Neighbor*) item->data;
+ MPIRPC_Block(n->rank, heap("announce"), xheap(id));
}
}
}
@@ -871,31 +871,31 @@
is_neighbor(KDA_Neighbor* n)
{
// NOTE_F;
- int d = XOR(n->id, id);
+ int d = XOR(n->id, id);
int i = ilog2(d);
- // SHOW_I(i);
- return list_contains(k_bucket[i], neighbor_cmp, n);
+ // SHOW_I(i);
+ return list_contains(k_bucket[i], neighbor_cmp, n);
}
/**
- Allow a caller to insert self in local neighbor table.
+ Allow a caller to insert self in local neighbor table.
*/
void
handle_announce(int caller, int unique, char* args)
{
- gossip_do(MASK_KDA, NOTE_F);
+ gossip_do(MASK_KDA, NOTE_F);
int other_id;
sscanf(args, "%X", &other_id );
KDA_Neighbor neighbor;
- neighbor_make(other_id, caller, &neighbor);
+ neighbor_make(other_id, caller, &neighbor);
add_neighbor(&neighbor);
// DEBUG(char* table = buckets_tostring();NOTE(table);free(table););
-
- MPIRPC_Return(caller, unique, NULL);
+
+ MPIRPC_Return(caller, unique, NULL);
}
-
+
/**
Manufacture a random ID.
*/
@@ -903,17 +903,17 @@
make_id()
{
srand(time(NULL)+mpi_rank*30);
- // srand(mpi_rank*30);
- return rand();
+ // srand(mpi_rank*30);
+ return rand();
}
bool
k_bucket_insert(int i, KDA_Neighbor* neighbor)
{
- bool result = false;
+ bool result = false;
- // list_dump("%i", k_bucket[i]);
-
+ // list_dump("%i", k_bucket[i]);
+
if (! list_contains(k_bucket[i], neighbor_cmp, neighbor))
{
if (k_bucket[i]->size >= k)
@@ -923,46 +923,46 @@
list_remove(k_bucket[i], victim);
free(victim);
}
- list_ordered_insert(k_bucket[i],
+ list_ordered_insert(k_bucket[i],
neighbor_time_cmp, (void*) neighbor);
- result = true;
+ result = true;
}
else
{
// NOTE_I("Already have neighbor! in: ", i);
}
- // list_dump("%i", k_bucket[i]);
- return result;
+ // list_dump("%i", k_bucket[i]);
+ return result;
}
/**
- @return True iff we cloned and added the neighbor to a k_bucket.
+ @return True iff we cloned and added the neighbor to a k_bucket.
*/
-bool
-add_neighbor(KDA_Neighbor* neighbor)
+bool
+add_neighbor(KDA_Neighbor* neighbor)
{
- bool result = false;
- // SHOW_FXI(neighbor->id, neighbor->rank);
+ bool result = false;
+ // SHOW_FXI(neighbor->id, neighbor->rank);
int d = XOR(id, neighbor->id);
int i = ilog2(d);
- // SHOW_I(i);
+ // SHOW_I(i);
if (neighbor->rank == mpi_rank)
{
- // NOTE("Will not add self!");
+ // NOTE("Will not add self!");
}
else if (is_neighbor(neighbor))
{
- // NOTE_I("Already have neighbor: ", neighbor->rank);
+ // NOTE_I("Already have neighbor: ", neighbor->rank);
}
else
{
- KDA_Neighbor* entry = neighbor_clone(neighbor);
+ KDA_Neighbor* entry = neighbor_clone(neighbor);
k_bucket_insert(i, entry);
- result = true;
+ result = true;
}
- // SHOW_FXI_B(neighbor->id, neighbor->rank, result);
- return neighbor;
+ // SHOW_FXI_B(neighbor->id, neighbor->rank, result);
+ return neighbor;
}
void
@@ -974,26 +974,26 @@
void
rpc_bootjoin(int other_rank)
{
- MPIRPC_Call(other_rank, heap("bootjoin"), id_tostring(),
+ MPIRPC_Call(other_rank, heap("bootjoin"), id_tostring(),
NULL, proceed_bootjoin);
}
/**
We may now join the network.
- Return our id to the caller.
+ Return our id to the caller.
*/
void
handle_bootjoin(int caller, int unique, char* args)
{
- // NOTE_FS(args);
+ // NOTE_FS(args);
int other_id;
sscanf(args, "%X", &other_id );
-
+
char* result = malloc(50*sizeof(char));
sprintf(result, "%X", id);
MPIRPC_Return(caller, unique, result);
- MPIRPC_Flush_returns();
+ MPIRPC_Flush_returns();
bootjoin(other_id, caller);
}
@@ -1005,15 +1005,15 @@
{
KDA_Neighbor neighbor;
neighbor_make(other_id, other_rank, &neighbor);
- add_neighbor(&neighbor);
+ add_neighbor(&neighbor);
if (mpi_rank == 0)
{
- bootping();
+ bootping();
}
else if (mpi_rank < kda_nodes-1)
{
- KDA_Ping(id);
+ KDA_Ping(id);
}
else if (mpi_rank == kda_nodes-1)
{
@@ -1028,8 +1028,8 @@
sscanf(rpc->result, "%X", &other_id);
KDA_Neighbor neighbor;
neighbor_make(other_id, rpc->target, &neighbor);
- add_neighbor(&neighbor);
- MPIRPC_Free(rpc);
+ add_neighbor(&neighbor);
+ MPIRPC_Free(rpc);
}
void
@@ -1040,15 +1040,15 @@
}
/**
- MPIRPC registered function.
- We may now ping ourselves.
+ MPIRPC registered function.
+ We may now ping ourselves.
*/
void
handle_bootping(int caller, int unique, char* args)
{
// NOTE_F;
bootping();
- MPIRPC_Return(caller, unique, NULL);
+ MPIRPC_Return(caller, unique, NULL);
}
void
@@ -1056,8 +1056,8 @@
{
if (mpi_rank < kda_nodes-1)
rpc_bootping(mpi_rank+1);
-
- KDA_Ping(id);
+
+ KDA_Ping(id);
}
/**
@@ -1066,7 +1066,7 @@
void
handle_ping(int caller, int unique, char* args)
{
- MPIRPC_Return(caller, unique, NULL);
+ MPIRPC_Return(caller, unique, NULL);
}
void
@@ -1090,15 +1090,15 @@
char*
id_tostring()
{
- return KDA_id_tostring(id);
+ return KDA_id_tostring(id);
}
char*
KDA_id_tostring(int other_id)
{
char* s_id = malloc(10*sizeof(char));
- sprintf(s_id, "%X", other_id);
- return s_id;
+ sprintf(s_id, "%X", other_id);
+ return s_id;
}
/**
@@ -1107,71 +1107,71 @@
char*
KDA_Description()
{
- char* result = malloc(sizeof(char) * 30);
+ char* result = malloc(sizeof(char) * 30);
sprintf(result, "[%X]@%i", id, mpi_rank);
- return result;
+ return result;
}
int
table_size(void)
{
int result = 0;
-
+
int i;
struct list_item* item;
for (i = 0; i < KDA_SPACE_SIZE; i++)
for (item = k_bucket[i]->head;
item; item = item->next)
result++;
-
- return result;
+
+ return result;
}
-
+
void
dump_buckets()
{
- NOTE_F;
-
- char path[100];
- sprintf(path, "table_%i_%i_%i.out",
- debug_rank, kda_nodes, dumps++);
- FILE* file = fopen(path, "w");
+ NOTE_F;
+
+ char path[100];
+ sprintf(path, "table_%i_%i_%i.out",
+ debug_rank, kda_nodes, dumps++);
+ FILE* file = fopen(path, "w");
char* result = buckets_tostring();
fprintf(file, result);
free(result);
fclose(file);
- NOTE_S("writing: ", path);
- NOTE_I("TABLE_SIZE: ", table_size());
+ NOTE_S("writing: ", path);
+ NOTE_I("TABLE_SIZE: ", table_size());
}
-char*
+char*
buckets_tostring(void)
{
int i;
struct list_item* item;
- // NOTE_F;
+ // NOTE_F;
char* result = malloc(sizeof(char)*KDA_SPACE_SIZE*k*200);
char* p = result;
char* description = KDA_Description();
- char* neighbor = NULL;
- bool bucket_named;
+ char* neighbor = NULL;
+ bool bucket_named;
int count = 0;
- int bytes = 0;
-
+ int bytes = 0;
+
p += sprintf(p, "Neighbor table for: %s \n", description);
free(description);
for (i = 0; i < KDA_SPACE_SIZE; i++)
{
- bytes += sizeof(K_BUCKET);
+ bytes += sizeof(K_BUCKET);
if (k_bucket[i]->size > 0)
{
- bucket_named = false;
+ bucket_named = false;
for (item = k_bucket[i]->head;
item; item = item->next)
{
count++;
- bytes += sizeof(KDA_Neighbor);
+ bytes += sizeof(KDA_Neighbor);
if (! bucket_named)
{
bucket_named = true;
@@ -1185,32 +1185,32 @@
}
}
p += sprintf(p, "TABLE_NEIGHBORS: %i\n", count);
- sprintf(p, "TABLE_BYTES: %i\n", bytes);
- return result;
+ sprintf(p, "TABLE_BYTES: %i\n", bytes);
+ return result;
}
-char*
+char*
bucket_usage(void)
{
int i;
struct list_item* item;
- // NOTE_F;
- char* result = malloc(200 * sizeof(char));
+ // NOTE_F;
+ char* result = malloc(200 * sizeof(char));
char* p = result;
int count = 0;
- int bytes = 0;
-
+ int bytes = 0;
+
for (i = 0; i < KDA_SPACE_SIZE; i++)
{
- bytes += sizeof(K_BUCKET);
+ bytes += sizeof(K_BUCKET);
for (item = k_bucket[i]->head;
item; item = item->next)
{
count++;
- bytes += sizeof(KDA_Neighbor);
+ bytes += sizeof(KDA_Neighbor);
}
}
p += sprintf(p, "TABLE_COUNT: %i %i %i\n", mpi_rank, dumps, count);
- p += sprintf(p, "TABLE_USAGE: %i %i %i\n", mpi_rank, dumps, bytes);
- return result;
+ p += sprintf(p, "TABLE_USAGE: %i %i %i\n", mpi_rank, dumps, bytes);
+ return result;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|