c-mpi-commits Mailing List for C-MPI
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...> - 2018-02-02 16:08:21
|
Revision: 207
http://sourceforge.net/p/c-mpi/code/207
Author: jmwozniak
Date: 2018-02-02 16:08:18 +0000 (Fri, 02 Feb 2018)
Log Message:
-----------
Bug fixes
Modified Paths:
--------------
src/cmpi-db/cmpi-db-fifo.c
src/kda-2/kademlia.c
src/mpirpc/mpirpc.c
Modified: src/cmpi-db/cmpi-db-fifo.c
===================================================================
--- src/cmpi-db/cmpi-db-fifo.c 2018-02-02 16:08:01 UTC (rev 206)
+++ src/cmpi-db/cmpi-db-fifo.c 2018-02-02 16:08:18 UTC (rev 207)
@@ -2,7 +2,7 @@
#include <unistd.h>
#include <node.h>
-#include <driver.h>
+#include <cmpi-driver.h>
void
wait_for_notification(void)
Modified: src/kda-2/kademlia.c
===================================================================
--- src/kda-2/kademlia.c 2018-02-02 16:08:01 UTC (rev 206)
+++ src/kda-2/kademlia.c 2018-02-02 16:08:18 UTC (rev 207)
@@ -724,7 +724,7 @@
continue;
int d = XOR(neighbor->id, op->object_id);
- if (d < op->k_closest->tail->key);
+ if (d < op->k_closest->tail->key)
{
NOTE("improved");
op->improved = true;
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2018-02-02 16:08:01 UTC (rev 206)
+++ src/mpirpc/mpirpc.c 2018-02-02 16:08:18 UTC (rev 207)
@@ -164,8 +164,6 @@
{
gossip_do(MASK_MPIRPC, NOTE_F);
- bool disconnected = false;
-
struct list* matches =
list_pop_where(channels, MPIRPC_Channel_comm_cmp, comm);
assert(matches->size == 1);
@@ -172,7 +170,6 @@
MPIRPC_Node* node = (MPIRPC_Node*) matches->head->data;
MPI_Comm_disconnect(&node->comm);
- disconnected = true;
list_destroy(matches);
return true;
@@ -926,4 +923,3 @@
hashtable_free(portmap);
itable_free(rpctable);
}
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2018-02-02 16:08:03
|
Revision: 206
http://sourceforge.net/p/c-mpi/code/206
Author: jmwozniak
Date: 2018-02-02 16:08:01 +0000 (Fri, 02 Feb 2018)
Log Message:
-----------
Syntax fix
Modified Paths:
--------------
src/cmpi-cp/cmpi-cp.c
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2018-02-02 16:06:34 UTC (rev 205)
+++ src/cmpi-cp/cmpi-cp.c 2018-02-02 16:08:01 UTC (rev 206)
@@ -42,8 +42,8 @@
printf("%s\n", msg);
#ifdef DMALLOC
dbg("dmalloc");
- // printf("dmalloc_logpath: %s\n", dmalloc_logpath); \
- dmalloc_shutdown(); \
+ // printf("dmalloc_logpath: %s\n", dmalloc_logpath);
+ dmalloc_shutdown();
dmalloc_log_unfreed();
#endif
exit(code);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2018-02-02 16:06:36
|
Revision: 205
http://sourceforge.net/p/c-mpi/code/205
Author: jmwozniak
Date: 2018-02-02 16:06:34 +0000 (Fri, 02 Feb 2018)
Log Message:
-----------
Add docs
Modified Paths:
--------------
tools/timebomb.zsh
Added Paths:
-----------
README.txt
Added: README.txt
===================================================================
--- README.txt (rev 0)
+++ README.txt 2018-02-02 16:06:34 UTC (rev 205)
@@ -0,0 +1,6 @@
+
+Install (APT) libssl-dev for libcrypto.
+
+./setup.sh
+./configure --prefix=... --enable-table-kda-2A
+make
Modified: tools/timebomb.zsh
===================================================================
--- tools/timebomb.zsh 2018-02-02 16:05:36 UTC (rev 204)
+++ tools/timebomb.zsh 2018-02-02 16:06:34 UTC (rev 205)
@@ -1,5 +1,8 @@
#!/bin/zsh
+# TIMEBOMB
+# Kills given PID after given delay
+
TARGET=$1
DELAY=$2
DATA=$3
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2018-02-02 16:05:38
|
Revision: 204
http://sourceforge.net/p/c-mpi/code/204
Author: jmwozniak
Date: 2018-02-02 16:05:36 +0000 (Fri, 02 Feb 2018)
Log Message:
-----------
Improve configure.ac
Modified Paths:
--------------
configure.ac
Modified: configure.ac
===================================================================
--- configure.ac 2018-02-02 16:05:20 UTC (rev 203)
+++ configure.ac 2018-02-02 16:05:36 UTC (rev 204)
@@ -377,6 +377,8 @@
[USE_CMPI_IO=0])
AC_SUBST(USE_CMPI_IO)
+# Currently tests must be enabled.
+ENABLE_TESTS="yes"
AC_ARG_ENABLE([tests],
AS_HELP_STRING(
[--enable-tests],
@@ -392,13 +394,13 @@
AC_GCC_SUPPORTS_RDYNAMIC,
[
AC_PATH_PROG([grep], [grep])
- echo -n "checking if the compiler supports -rdynamic... "
+ AC_MSG_CHECKING(if the compiler supports -rdynamic...)
if test "X${ac_compiler_gnu}X" = "XyesX"; then
if test "X`${CC} -dumpspecs | ${grep} rdynamic`X" != "XX"; then
- echo "yes"
+ AC_MSG_RESULT(yes)
AC_SUBST([RDYNAMIC], ["-rdynamic"])
else
- echo "no"
+ AC_MSG_RESULT(no)
AC_SUBST([RDYNAMIC], [])
fi
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2018-02-02 16:05:21
|
Revision: 203
http://sourceforge.net/p/c-mpi/code/203
Author: jmwozniak
Date: 2018-02-02 16:05:20 +0000 (Fri, 02 Feb 2018)
Log Message:
-----------
Improve setup.sh
Modified Paths:
--------------
setup.sh
Modified: setup.sh
===================================================================
--- setup.sh 2011-05-03 15:55:18 UTC (rev 202)
+++ setup.sh 2018-02-02 16:05:20 UTC (rev 203)
@@ -1,5 +1,8 @@
#!/bin/bash
+set -eu
+# SETUP.SH
+
rm -fv config.cache
mkdir -p maint/config
@@ -9,14 +12,12 @@
echo "regenerating..."
else
echo "CMPI configure is up-to-date"
- exit 2
+ exit 0
fi
-if aclocal -I ./maint/config && autoheader && autoconf ; then
- echo "CMPI configure script successfully regenerated"
-else
- echo "Some part of configure regeneration failed!"
- exit 1
-fi
+aclocal -I ./maint/config
+autoheader
+autoconf
+echo "CMPI configure script successfully regenerated"
exit 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-05-03 15:55:25
|
Revision: 202
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=202&view=rev
Author: jmwozniak
Date: 2011-05-03 15:55:18 +0000 (Tue, 03 May 2011)
Log Message:
-----------
Cleanup output
Modified Paths:
--------------
src/adts/list.c
src/kda-2/conn-A.c
src/kda-2/kademlia.c
Modified: src/adts/list.c
===================================================================
--- src/adts/list.c 2011-05-02 22:55:48 UTC (rev 201)
+++ src/adts/list.c 2011-05-03 15:55:18 UTC (rev 202)
@@ -529,7 +529,6 @@
while (head && head != good)
{
struct list_item* next = head->next;
- printf("free: %i \n", *(int*) head->data);
free(head);
target->size--;
head = next;
@@ -582,7 +581,6 @@
/**
Remove and return all elements from the list where
cmp(data,arg) == 0.
- @return true if one or more items were deleted.
*/
struct list*
list_pop_where(struct list* target,
@@ -618,7 +616,6 @@
while (head && head != good)
{
struct list_item* next = head->next;
- printf("free: %i \n", *(int*) head->data);
list_append(result, head);
target->size--;
head = next;
Modified: src/kda-2/conn-A.c
===================================================================
--- src/kda-2/conn-A.c 2011-05-02 22:55:48 UTC (rev 201)
+++ src/kda-2/conn-A.c 2011-05-03 15:55:18 UTC (rev 202)
@@ -43,7 +43,7 @@
free(result);
KDA_Neighbor neighbor;
KDA_Neighbor_make_id(other_id, node, &neighbor);
- bool added = neighbor_add(&neighbor);
+ neighbor_add(&neighbor);
MPIRPC_Node dummy = {0};
KDA_Join(dummy, &neighbor);
}
Modified: src/kda-2/kademlia.c
===================================================================
--- src/kda-2/kademlia.c 2011-05-02 22:55:48 UTC (rev 201)
+++ src/kda-2/kademlia.c 2011-05-03 15:55:18 UTC (rev 202)
@@ -810,8 +810,8 @@
op->k_closest = KDA_Closest(op->object_id);
- printf("local closest: \n");
- ilist_dump(KDA_Neighbor_id_tostring, op->k_closest);
+ DEBUG(printf("local closest: \n");
+ ilist_dump(KDA_Neighbor_id_tostring, op->k_closest););
return KDA_Find_node_again(op);
}
@@ -1037,7 +1037,6 @@
item = item->next)
{
KDA_Neighbor* neighbor = item->data;
- char* string = KDA_Neighbor_name(neighbor);
MPIRPC_Block(neighbor->node, "shutdown", NULL);
}
DONE;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-05-02 22:55:55
|
Revision: 201
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=201&view=rev
Author: jmwozniak
Date: 2011-05-02 22:55:48 +0000 (Mon, 02 May 2011)
Log Message:
-----------
test-putget works for KDA and is valgrind-clean
Modified Paths:
--------------
include/cmpi.h
include/cmpi_disk.h
include/gossip.h
include/kda-2.h
include/kda_conn-A.h
include/kda_neighbor-2.h
include/kda_types-2.h
include/list.h
src/adts/list.c
src/cmpi/cmpi.c
src/cmpi/cmpi_disk_printf.c
src/cmpi/cmpi_disk_void.c
src/cmpi/driver.c
src/kda-2/cmpi_kademlia.c
src/kda-2/conn-A.c
src/kda-2/conn-B.c
src/kda-2/kademlia.c
src/kda-2/neighbor.c
src/mpi_tools/mpi_tools.c
src/mpirpc/mpirpc.c
test/adts/test-lru_table01.c
test/cmpi/test-putget.c
test/cmpi/test-update01.c
test/cmpi/test-update02.c
Modified: include/cmpi.h
===================================================================
--- include/cmpi.h 2011-05-02 15:06:20 UTC (rev 200)
+++ include/cmpi.h 2011-05-02 22:55:48 UTC (rev 201)
@@ -200,17 +200,17 @@
@param value Store pointer to value here
@param length OUT The value length
*/
-CMPI_RETURN cmpi_get(char* key, char** value, int* length);
+CMPI_RETURN cmpi_get(char* key, void** value, int* length);
/**
Store a key/value pair in CMPI.
*/
-CMPI_RETURN cmpi_put(char* key, char* value, int length);
+CMPI_RETURN cmpi_put(char* key, void* value, int length);
/**
Update byte region in CMPI key/value pair.
*/
-CMPI_RETURN cmpi_update(char* key, char* value,
+CMPI_RETURN cmpi_update(char* key, void* value,
int length, int offset);
/**
@@ -223,9 +223,9 @@
//// Cached disk operations:
-int cmpi_cached_retrieve(char* key, char** data);
-void cmpi_cached_store(char* key, char* data, int length);
-void cmpi_cached_update(char* key, char* data,
+int cmpi_cached_retrieve(char* key, void** data);
+void cmpi_cached_store(char* key, void* data, int length);
+void cmpi_cached_update(char* key, void* data,
int offset, int length);
/**
@@ -233,6 +233,13 @@
*/
void cmpi_shutdown(void);
+void cmpi_assert_impl(CMPI_RETURN code, const char* message,
+ const char* func, const char* file, int line);
+#define cmpi_assert(code, message) \
+ cmpi_assert_impl(code,message,__func__,__FILE__,__LINE__)
+
+int cmpi_return_tostring(char* output, CMPI_RETURN code);
+
void cmpi_cleanup(void);
void cmpi_client_cleanup(void);
Modified: include/cmpi_disk.h
===================================================================
--- include/cmpi_disk.h 2011-05-02 15:06:20 UTC (rev 200)
+++ include/cmpi_disk.h 2011-05-02 22:55:48 UTC (rev 201)
@@ -3,6 +3,6 @@
* Select disk operations based on configure-time value of DISK_TYPE.
* */
-void cmpi_disk_storepair(char* key, char* value, int length);
-int cmpi_disk_loadpair(char* key, char** value);
+void cmpi_disk_storepair(char* key, void* value, int length);
+int cmpi_disk_loadpair(char* key, void** value);
Modified: include/gossip.h
===================================================================
--- include/gossip.h 2011-05-02 15:06:20 UTC (rev 200)
+++ include/gossip.h 2011-05-02 22:55:48 UTC (rev 201)
@@ -20,7 +20,9 @@
#ifndef __GOSSIP_H
#define __GOSSIP_H
+#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500
+#endif
#include <errno.h>
#include <stdio.h>
Modified: include/kda-2.h
===================================================================
--- include/kda-2.h 2011-05-02 15:06:20 UTC (rev 200)
+++ include/kda-2.h 2011-05-02 22:55:48 UTC (rev 201)
@@ -78,7 +78,7 @@
//// Helpers...
-void KDA_Join(int other_id, int other_rank);
+void KDA_Join(MPIRPC_Node node, KDA_Neighbor* neighbor);
void KDA_Setup_node_port(void);
// void KDA_Serve(void);
@@ -91,6 +91,10 @@
// void KDA_Setup_connector_port(void);
// void KDA_Connect_port(char* port);
void KDA_Attach(struct list* contacts);
+/**
+ Attach to given neighbor if not already attached
+ */
+bool KDA_Attach_to(KDA_Neighbor* neighbor, struct list* contacts);
// MPIRPC_Node* KDA_Attach_port(char* port);
// MPIRPC_Node* KDA_Register_hub(MPI_Comm comm);
Modified: include/kda_conn-A.h
===================================================================
--- include/kda_conn-A.h 2011-05-02 15:06:20 UTC (rev 200)
+++ include/kda_conn-A.h 2011-05-02 22:55:48 UTC (rev 201)
@@ -5,8 +5,6 @@
MPI_Comm KDA_Comm_create(int* other_rank);
-void KDA_Join(int other_id, int other_rank);
-
/**
Translate a KDA_ID to a rank in MPI_COMM_WORLD.
*/
Modified: include/kda_neighbor-2.h
===================================================================
--- include/kda_neighbor-2.h 2011-05-02 15:06:20 UTC (rev 200)
+++ include/kda_neighbor-2.h 2011-05-02 22:55:48 UTC (rev 201)
@@ -4,29 +4,32 @@
#include <stdbool.h>
-#include "kda_types-2.h"
+#include "kda_types-2.h"
#include "kda-2.h"
/**
- Scan the stream data for neighbors.
+ Scan the stream data for neighbors.
@return The new neighbor. n contains the number of chars consumed
from data by sscanf().
*/
KDA_Neighbor* KDA_Neighbor_create_scan(char* data, int* n);
-KDA_Neighbor* KDA_Neighbor_create_string(char* info);
-KDA_Neighbor* KDA_Neighbor_create_id(KDA_ID id, MPIRPC_Node node);
+KDA_Neighbor* KDA_Neighbor_create_string(char* info);
+KDA_Neighbor* KDA_Neighbor_create_id(KDA_ID id, MPIRPC_Node node);
+void KDA_Neighbor_make_id(KDA_ID other_id, MPIRPC_Node node,
+ KDA_Neighbor* output);
+KDA_Neighbor* KDA_Neighbor_clone(KDA_Neighbor* original);
-//// cmp()s...
+//// cmp()s...
int KDA_Neighbor_node_cmp(void* object1, void* object2);
/**
Compare ids.
@return 1 iff n1 > n2, -1 iff n1 < n2, 0 iff n1 == n2
*/
-int KDA_Neighbor_cmp(void* object1, void* object2);
+int KDA_Neighbor_cmp(void* object1, void* object2);
-/**
- Compare lastseen times for neighbors n1, n2.
+/**
+ Compare lastseen times for neighbors n1, n2.
@return 1 iff n1 > n2, -1 iff n1 < n2, 0 iff n1 == n2
*/
int KDA_Neighbor_time_cmp(void* object1, void* object2);
@@ -37,9 +40,9 @@
*/
char* KDA_Neighbor_id_tostring(void* object);
char* KDA_Neighbor_name(void* object);
-// int KDA_Neighbor_name_sprint(char* buffer, void* object);
+// int KDA_Neighbor_name_sprint(char* buffer, void* object);
char* KDA_Neighbor_tostring(void* object);
-int KDA_Neighbor_sprint(char* buffer, void* object);
+int KDA_Neighbor_sprint(char* buffer, void* object);
void KDA_Neighbor_dump(void* object);
//// Input methods:
Modified: include/kda_types-2.h
===================================================================
--- include/kda_types-2.h 2011-05-02 15:06:20 UTC (rev 200)
+++ include/kda_types-2.h 2011-05-02 22:55:48 UTC (rev 201)
@@ -2,22 +2,22 @@
#ifndef KADEMLIA_TYPES_2_H
#define KADEMLIA_TYPES_2_H
-#include <cmpi.h>
+#include <cmpi.h>
typedef CMPI_ID KDA_ID;
typedef struct neighbor
{
- MPIRPC_Node node;
+ MPIRPC_Node node;
KDA_ID id;
- time_t lastseen;
+ time_t lastseen;
} KDA_Neighbor;
/**
Contains neighbors. A bucket is all neighbors of a given
distance 2^i - 2^i+1
*/
-typedef struct list* K_BUCKET;
+typedef struct list* K_BUCKET;
typedef struct kda_query KDA_Query;
typedef struct kda_operation KDA_Operation;
@@ -30,8 +30,8 @@
MPIRPC_Node caller;
int unique;
char* result;
- void (*service)(KDA_Operation* op);
-};
+ void (*service)(KDA_Operation* op);
+};
/**
Performs an operation.
@@ -40,38 +40,38 @@
2) When proceed_find converges, it
calls map.
3) map either maps the function name out (if name given),
- proceeding with the proceed function, or
- returns the query.
+ proceeding with the proceed function, or
+ returns the query.
*/
struct kda_operation
{
KDA_ID object_id;
- int unique;
- // An MPIRPC function symbolic name to call on found nodes:
+ int id;
+ // An MPIRPC function symbolic name to call on found nodes:
char* name;
char* args;
- // Maps distance to neighbors:
+ // Maps distance to neighbors:
struct ilist* k_closest;
- // neighbors that have been searched but not heard from:
+ // neighbors that have been searched but not heard from:
struct list* outstanding;
- // neighbors that have been searched for this operation:
+ // neighbors that have been searched for this operation:
struct list* contacted;
- // neighbors that have returned the RPC for this operation:
+ // neighbors that have returned the RPC for this operation:
struct list* returned;
- // If the latest rpc_find_node calls improved our search.
+ // If the latest rpc_find_node calls improved our search.
bool improved;
int status;
- // How to proceed after map(name):
+ // How to proceed after map(name):
void (*proceed)(MPIRPC* op);
- // Incoming query to respond to that triggered this operation:
- KDA_Query* query;
-};
+ // Incoming query to respond to that triggered this operation:
+ KDA_Query* query;
+};
-typedef struct
+typedef struct
{
void (*method)(MPIRPC_Node,void*);
KDA_Neighbor* neighbor;
- void* args;
+ void* args;
} KDA_RPC_Extras;
#endif
Modified: include/list.h
===================================================================
--- include/list.h 2011-05-02 15:06:20 UTC (rev 200)
+++ include/list.h 2011-05-02 22:55:48 UTC (rev 201)
@@ -62,6 +62,12 @@
void* list_inspect(struct list* target, void* data, size_t n);
/**
+ True if the comparator finds a match for arg
+*/
+bool list_matches(struct list* target, int (*cmp)(void*,void*),
+ void* arg);
+
+/**
Removes only one item that points to given data.
Does not free the item data.
@return True iff the data pointer was matched
@@ -83,6 +89,12 @@
int (*cmp)(void*,void*), void* arg);
/**
+ Return the first data element from the list where f(data,arg).
+*/
+void* list_select_one(struct list* target, int (*cmp)(void*,void*),
+ void* arg);
+
+/**
Remove the element from the list where f(data,arg).
*/
bool list_remove_where(struct list* target,
Modified: src/adts/list.c
===================================================================
--- src/adts/list.c 2011-05-02 15:06:20 UTC (rev 200)
+++ src/adts/list.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -354,6 +354,19 @@
return NULL;
}
+bool
+list_matches(struct list* target, int (*cmp)(void*,void*), void* arg)
+{
+ assert(target != NULL);
+
+ for (struct list_item* item = target->head; item;
+ item = item->next)
+ if (cmp(item->data, arg) == 0)
+ return true;
+
+ return false;
+}
+
/**
Empty the list.
*/
@@ -460,6 +473,20 @@
return result;
}
+void*
+list_select_one(struct list* target,
+ int (*cmp)(void*,void*), void* arg)
+{
+ assert(target != NULL);
+
+ for (struct list_item* item = target->head; item;
+ item = item->next)
+ if (cmp(item->data, arg) == 0)
+ return item->data;
+
+ return NULL;
+}
+
/**
Remove the elements from the list where cmp(data,arg) == 0.
@return true if one or more items were deleted.
Modified: src/cmpi/cmpi.c
===================================================================
--- src/cmpi/cmpi.c 2011-05-02 15:06:20 UTC (rev 200)
+++ src/cmpi/cmpi.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -108,7 +108,7 @@
@return length of data, 0 if data is NULL
*/
int
-cmpi_cached_retrieve(char* key, char** data)
+cmpi_cached_retrieve(char* key, void** data)
{
int result;
NOTE_F;
@@ -151,7 +151,7 @@
/**
*/
void
-cmpi_cached_store(char* key, char* data, int length)
+cmpi_cached_store(char* key, void* data, int length)
{
struct keyvalue* kv;
SHOW_FSI(key, length);
@@ -169,7 +169,7 @@
Does not use cmpi_disk.
*/
void
-cmpi_cached_update(char* key, char* data, int offset, int length)
+cmpi_cached_update(char* key, void* data, int offset, int length)
{
SHOW_FSII(key,offset,length);
printdata("update: ", data, length);
@@ -231,3 +231,40 @@
hashtable_destroy(cmpi_params);
MPIRPC_Finalize();
}
+
+void
+cmpi_assert_impl(CMPI_RETURN code, const char* message,
+ const char* func, const char* file, int line)
+{
+ if (code == CMPI_SUCCESS)
+ return;
+
+ char type[64];
+ if (message == NULL)
+ message = "";
+ cmpi_return_tostring(type, code);
+ printf("c-mpi: assert failed: %s: %s\n", type, message);
+ printf(" in: %s (%s:%i)\n", func, file, line);
+ exit(code);
+}
+
+int
+cmpi_return_tostring(char* output, CMPI_RETURN code)
+{
+ int length = 0;
+ if (code == CMPI_SUCCESS)
+ length = sprintf(output, "CMPI_SUCCESS");
+ if (code == CMPI_ERROR_UNKNOWN)
+ length = sprintf(output, "CMPI_ERROR_UNKNOWN");
+ if (code == CMPI_DOESNT_EXIST)
+ length = sprintf(output, "CMPI_DOESNT_EXIST");
+ if (code == CMPI_ERROR_FAULT)
+ length = sprintf(output, "CMPI_ERROR_FAULT");
+ if (code == CMPI_SUCCESS)
+ length = sprintf(output, "CMPI_ERROR_SERVICENAME");
+ if (code == CMPI_ERROR_NEIGHBORS)
+ length = sprintf(output, "CMPI_ERROR_NEIGHBORS");
+ else assert(false);
+
+ return length;
+}
Modified: src/cmpi/cmpi_disk_printf.c
===================================================================
--- src/cmpi/cmpi_disk_printf.c 2011-05-02 15:06:20 UTC (rev 200)
+++ src/cmpi/cmpi_disk_printf.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -2,20 +2,20 @@
/**
* Dumps disk operations to the screen.
* Used if configure --with-disk-printf is used.
- * */
+ * */
-#include <stdio.h>
+#include <stdio.h>
-#include <mpi_tools.h>
+#include <mpi_tools.h>
void
-cmpi_disk_storepair(char* key, char* value)
+cmpi_disk_storepair(char* key, void* value)
{
- NOTE_F;
- note_ss("DISK_STOREPAIR: ", key, value);
+ NOTE_F;
+ printf("DISK_STOREPAIR: %s\n", key);
}
-void cmpi_disk_loadpair(char* key, char** value)
+void cmpi_disk_loadpair(char* key, void** value)
{
- note_s("DISK_LOADPAIR: ", key);
+ printf("DISK_LOADPAIR: %s\n", key);
}
Modified: src/cmpi/cmpi_disk_void.c
===================================================================
--- src/cmpi/cmpi_disk_void.c 2011-05-02 15:06:20 UTC (rev 200)
+++ src/cmpi/cmpi_disk_void.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -12,7 +12,7 @@
NOTE_FS(key);
}
-int cmpi_disk_loadpair(char* key, char** value)
+int cmpi_disk_loadpair(char* key, void** value)
{
NOTE_F;
*value = NULL;
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2011-05-02 15:06:20 UTC (rev 200)
+++ src/cmpi/driver.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -153,7 +153,7 @@
NOTE_FS(key);
- char* value;
+ void* value;
int length;
cmpi_get(key, &value, &length);
Modified: src/kda-2/cmpi_kademlia.c
===================================================================
--- src/kda-2/cmpi_kademlia.c 2011-05-02 15:06:20 UTC (rev 200)
+++ src/kda-2/cmpi_kademlia.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -73,11 +73,9 @@
void
add_contacts()
{
- int i;
- struct list_item* item;
NOTE_F;
- for (i = 0; i < KDA_SPACE_SIZE; i++)
- for (item = k_bucket[i]->head;
+ for (int i = 0; i < KDA_SPACE_SIZE; i++)
+ for (struct list_item* item = k_bucket[i]->head;
item; item = item->next)
{
KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
@@ -87,22 +85,26 @@
}
}
+/**
+ If the neighbor is unknown, attach, copy and store in contacts list.
+ @param Neighbor to find via id
+ @return Internal copy of neighbor
+ */
KDA_Neighbor*
contact_lookup(KDA_Neighbor* neighbor)
{
NOTE_FX(neighbor->id);
- for (struct list_item* item = contacts->head;
- item; item = item->next)
- {
- KDA_Neighbor* n = (KDA_Neighbor*) item->data;
- if (n->id == neighbor->id)
- return n;
- }
- KDA_Join(neighbor->id, neighbor->node.comm);
+ KDA_Neighbor* copy =
+ list_select_one(contacts, KDA_Neighbor_cmp, neighbor);
+ if (copy)
+ return copy;
+
+ puts("cloneing");
+ copy = KDA_Neighbor_clone(neighbor);
+ KDA_Attach_to(copy, contacts);
add_contacts();
-
- return contact_lookup(neighbor);
+ return copy;
}
char*
@@ -159,23 +161,28 @@
}
CMPI_RETURN
-cmpi_put(char* key, char* value, int length)
+cmpi_put(char* key, void* value, int length)
{
- struct list_item* item;
- NOTE_FSS(key, value);
+ NOTE_FS(key);
// printf("contacts: %i \n", contacts);
KDA_Neighbor* n = (KDA_Neighbor*) list_random(contacts);
+ char tmp[64];
+ KDA_Neighbor_sprint(tmp, n);
+
MPIRPC* lookup = KDA_Lookup_k(n->node, key);
MPIRPC_Wait(lookup);
-
struct list* neighbors = KDA_Neighbor_node_list(lookup->result);
+ free(lookup->result);
+ MPIRPC_Free(lookup);
- for (item = neighbors->head;
- item; item = item->next)
+ for (struct list_item* item = neighbors->head; item;
+ item = item->next)
{
KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
+ DEBUG(KDA_Neighbor_sprint(tmp, neighbor);
+ printf("neighbor: %s\n", tmp););
MPIRPC* rpc = KDA_Store(neighbor, key, value, length);
MPIRPC_Wait(rpc);
MPIRPC_Free(rpc);
@@ -188,32 +195,37 @@
}
CMPI_RETURN
-cmpi_get(char* key, char** value, int* length)
+cmpi_get(char* key, void** value, int* length)
{
- struct list_item* item;
NOTE_FS(key);
KDA_Neighbor* n = (KDA_Neighbor*) list_random(contacts);
MPIRPC* lookup = KDA_Lookup_k(n->node, key);
MPIRPC_Wait(lookup);
-
struct list* neighbors = KDA_Neighbor_node_list(lookup->result);
- NOTE_I("neighbors->size ", neighbors->size);
+ free(lookup->result);
+ MPIRPC_Free(lookup);
+ SHOW_I(neighbors->size);
+ if (neighbors->size == 0)
+ return CMPI_ERROR_NEIGHBORS;
- for (item = neighbors->head;
- item; item = item->next)
+ for (struct list_item* item = neighbors->head; item;
+ item = item->next)
{
- KDA_Neighbor* neighbor_found = (KDA_Neighbor*) item->data;
- NOTE("retrieve from: ");
- KDA_Neighbor_dump(neighbor_found);
+ KDA_Neighbor* neighbor_found = item->data;
+ DEBUG(puts("retrieve from: ");
+ KDA_Neighbor_dump(neighbor_found););
KDA_Neighbor* neighbor = contact_lookup(neighbor_found);
- KDA_Neighbor_dump(neighbor);
+ DEBUG(KDA_Neighbor_dump(neighbor));
MPIRPC* rpc = KDA_Retrieve(neighbor, key);
MPIRPC_Wait(rpc);
*value = rpc->result;
+ *length = rpc->result_length;
NOTE_S("value: ", *value);
MPIRPC_Free(rpc);
+ // Assume first retrieval is successful:
+ break;
}
list_destroy(neighbors);
@@ -223,20 +235,20 @@
}
CMPI_RETURN
-cmpi_update(char* key, char* value, int length, int offset)
+cmpi_update(char* key, void* value, int length, int offset)
{
- struct list_item* item;
- NOTE_FSS(key, value);
+ NOTE_FS(key);
// printf("contacts: %i \n", contacts);
KDA_Neighbor* n = (KDA_Neighbor*) list_random(contacts);
MPIRPC* lookup = KDA_Lookup_k(n->node, key);
MPIRPC_Wait(lookup);
-
struct list* neighbors = KDA_Neighbor_node_list(lookup->result);
+ MPIRPC_Free(lookup);
- for (item = neighbors->head; item; item = item->next)
+ for (struct list_item* item = neighbors->head; item;
+ item = item->next)
{
KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
MPIRPC* rpc = KDA_Update(neighbor, key, value, length, offset);
Modified: src/kda-2/conn-A.c
===================================================================
--- src/kda-2/conn-A.c 2011-05-02 15:06:20 UTC (rev 200)
+++ src/kda-2/conn-A.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -1,4 +1,9 @@
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE
+#endif
+#include <time.h>
+
#include "kda_conn-A.h"
#include "kda_neighbor-2.h"
#include "cmpi_mode.h"
@@ -36,7 +41,11 @@
KDA_ID other_id;
sscanf(result, "%X", &other_id);
free(result);
- KDA_Join(other_id, other_rank);
+ KDA_Neighbor neighbor;
+ KDA_Neighbor_make_id(other_id, node, &neighbor);
+ bool added = neighbor_add(&neighbor);
+ MPIRPC_Node dummy = {0};
+ KDA_Join(dummy, &neighbor);
}
/*
@@ -68,28 +77,36 @@
sscanf(result, "%X", &other_id);
free(result);
KDA_Neighbor* neighbor = KDA_Neighbor_create_id(other_id, node);
- if (list_add_unique(contacts, KDA_Neighbor_cmp, neighbor))
+ if (KDA_Attach_to(neighbor, contacts))
+ {
NOTE_XI("added neighbor: ", other_id, neighbor->node.comm);
+ assert(neighbor->node.comm != MPI_COMM_NULL);
+ }
else
free(neighbor);
}
}
+bool
+KDA_Attach_to(KDA_Neighbor* neighbor, struct list* contacts)
+{
+ return list_add_unique(contacts, KDA_Neighbor_cmp, neighbor);
+}
+
/**
Form node->node connections
-
+ Neighbor should already be in k_buckets, this does not do that
+ @param node Referring node- not used in conn-A (no 3-way)
+ @param neighbor The new neighbor
*/
void
-KDA_Join(int other_id, int other_rank)
+KDA_Join(MPIRPC_Node node, KDA_Neighbor* neighbor)
{
MPIRPC_Node other_node;
- MPIRPC_Node_make(MPI_COMM_WORLD, other_rank, &other_node);
+ MPIRPC_Node_make(MPI_COMM_WORLD, neighbor->node.rank, &other_node);
char args[64];
sprintf(args, "%X %i", id, mpi_rank);
MPIRPC_Block(other_node, "join", args);
-
- KDA_Neighbor* neighbor = KDA_Neighbor_create_id(other_id, other_node);
- neighbor_add(neighbor);
}
void
@@ -105,8 +122,10 @@
{
MPIRPC_Node node;
MPIRPC_Node_make(caller.comm, caller.rank, &node);
- KDA_Neighbor* neighbor = KDA_Neighbor_create_id(other_id, node);
- neighbor_add(neighbor);
+
+ KDA_Neighbor neighbor;
+ KDA_Neighbor_make_id(other_id, node, &neighbor);
+ neighbor_add(&neighbor);
hashtable_add(world_ranks, xheap(other_id), other_rank);
}
@@ -137,3 +156,32 @@
KDA_Detach_hubs()
{}
+KDA_Neighbor*
+KDA_Neighbor_create_scan(char* data, int* n)
+{
+ NOTE_F;
+ if (data == NULL)
+ return NULL;
+ int other_rank;
+ KDA_ID other_id;
+ char junk[64];
+ char date[128];
+ char time[64];
+ int count = sscanf(data, "[%X]=%i@%s %s %s %n",
+ &other_id, &other_rank, junk, date, time, n);
+
+ if (count < 2)
+ return NULL;
+ KDA_Neighbor* nbor = malloc(sizeof(KDA_Neighbor));
+ nbor->id = other_id;
+ nbor->node.rank = other_rank;
+ nbor->node.comm = MPI_COMM_WORLD;
+ struct tm t = {0};
+ strcat(date, " ");
+ strcat(date, time);
+ SHOW(date);
+ char* c = strptime(date, "%F %T", &t);
+ assert(c);
+ nbor->lastseen = mktime(&t);
+ return nbor;
+}
Modified: src/kda-2/conn-B.c
===================================================================
--- src/kda-2/conn-B.c 2011-05-02 15:06:20 UTC (rev 200)
+++ src/kda-2/conn-B.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -508,3 +508,24 @@
free(hub);
}
}
+
+KDA_Neighbor*
+KDA_Neighbor_create_scan(char* data, int* n)
+{
+ if (data == NULL)
+ return NULL;
+ KDA_ID other_id;
+ char junk[20];
+ char date[20];
+ char time[20];
+ int count = sscanf(data, "[%X]@%s %s %s %n", &other_id,
+ junk, date, time, n);
+
+ if (count < 2)
+ return NULL;
+ KDA_Neighbor* nbor = malloc(sizeof(KDA_Neighbor));
+ nbor->id = other_id;
+ nbor->node.rank = 0;
+ nbor->node.comm = MPI_COMM_NULL;
+ return nbor;
+}
Modified: src/kda-2/kademlia.c
===================================================================
--- src/kda-2/kademlia.c 2011-05-02 15:06:20 UTC (rev 200)
+++ src/kda-2/kademlia.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -88,6 +88,7 @@
char* bucket_ids_tostring(void);
void dump_buckets(void);
char* buckets_tostring(void);
+char* kda_op_tostring(KDA_Operation* op);
static KDA_ID make_id(int salt);
// static char* id_tostring(void);
@@ -406,9 +407,10 @@
KDA_Translate_k(MPIRPC_Node node, KDA_ID id)
{
NOTE_FX(id);
+ char sid[32];
+ sprintf(sid, "%X", id);
MPIRPC* rpc =
- MPIRPC_Call(node, "query_id_k", iheap(id),
- NULL, MPIRPC_PROCEED_NULL);
+ MPIRPC_Call(node, "query_id_k", sid, NULL, MPIRPC_PROCEED_NULL);
return rpc;
}
@@ -480,7 +482,7 @@
KDA_Comm_set_name(KDA_Neighbor* neighbor)
{
NOTE_FX(neighbor->id);
- char name[20];
+ char name[32];
sprintf(name, "%X", neighbor->id);
MPI_Comm_set_name(neighbor->node.comm, name);
}
@@ -505,9 +507,9 @@
void* blob, int blob_length)
{
NOTE_S("store: ", args);
- cmpi_cached_store(args, blob, blob_length);
+ char* key = strdup(args);
+ cmpi_cached_store(key, blob, blob_length);
DEBUG(lru_table_printf("%s", cmpi_cache));
-
MPIRPC_Null(caller, unique);
}
@@ -541,12 +543,14 @@
NOTE_FS(args);
DEBUG(lru_table_printf("%s", cmpi_cache));
- char* data;
+ void* data;
int length;
length = cmpi_cached_retrieve(args, &data);
+ void* copy = malloc(length);
+ memcpy(copy, data, length);
- SHOW_S(data);
- MPIRPC_Return(caller, unique, data, length);
+ SHOW_S(copy);
+ MPIRPC_Return(caller, unique, copy, length);
}
void
@@ -562,15 +566,16 @@
rpc_find_node(KDA_Neighbor* neighbor, KDA_Operation* op)
{
NOTE_FXX(neighbor->id, op->object_id);
- MPIRPC_Call(neighbor->node, heap("find_node"), xheap(op->object_id),
- op, proceed_find);
+ char xid[32];
+ sprintf(xid, "%X", op->object_id);
+ MPIRPC_Call(neighbor->node, "find_node", xid, op, proceed_find);
}
void
handle_find_node(MPIRPC_Node caller, int unique, char* args,
void* blob, int blob_length)
{
- struct ilist_item* item;
+ ;
NOTE_FS(args);
// Decode...
int object_id;
@@ -583,8 +588,8 @@
char* result = (char*) malloc(1024*sizeof(char));
char* s = result;
s += sprintf(s, "%i ", known->size);
- for (item = known->head;
- item; item = item->next)
+ for (struct ilist_item* item = known->head; item;
+ item = item->next)
s += sprintf(s, "%s ", KDA_Neighbor_name(item->data));
ilist_free(known);
@@ -646,12 +651,13 @@
char* p = result;
while (op->k_closest->size > 0)
{
- NOTE("while");
- KDA_Neighbor* n =
- (KDA_Neighbor*) ilist_poll(op->k_closest);
+ KDA_Neighbor* n = (KDA_Neighbor*) ilist_poll(op->k_closest);
p += KDA_Neighbor_sprint(p, n);
- *(p++) = ' ';
+ if (op->k_closest->size > 0)
+ p += sprintf(p, " ");
}
+
+ SHOW_S(result);
MPIRPC_Return(op->query->caller, op->query->unique,
result, strlen(result)+1);
// free op
@@ -663,13 +669,12 @@
void
KDA_Map(KDA_Operation* op)
{
- struct ilist_item* item;
- // NOTE_F;
+ NOTE_F;
if (op->name)
{
- // printf("map: %s \n", op->name);
- for (item = op->k_closest->head;
- item; item = item->next)
+ printf("map: %s \n", op->name);
+ for (struct ilist_item* item = op->k_closest->head; item;
+ item = item->next)
{
KDA_Neighbor* n = (KDA_Neighbor*) item->data;
if (n->id == id)
@@ -680,9 +685,10 @@
}
else if (op->query)
{
- // NOTE("op->query");
+ NOTE("op->query");
op->query->service(op);
}
+ else assert(false);
op->returned = list_create();
}
@@ -690,18 +696,17 @@
void
proceed_find(MPIRPC* rpc)
{
- struct list_item* item;
NOTE_F;
KDA_Operation* op = (KDA_Operation*) rpc->extras;
list_remove_where(op->outstanding, KDA_Neighbor_node_cmp,
&rpc->target);
- NOTE("from: ");
- NOTE(MPIRPC_Comm_get_name(rpc->target.comm));
+ // NOTE("from: ");
+ // NOTE(MPIRPC_Comm_get_name(rpc->target.comm));
NOTE("outstanding: ");
- list_output(KDA_Neighbor_tostring, op->outstanding);
+ DEBUG(list_output(KDA_Neighbor_tostring, op->outstanding));
int size;
int n;
@@ -710,7 +715,8 @@
p += n;
struct list* neighbors = KDA_Neighbor_node_list(p);
- for (item = neighbors->head; item; item = item->next)
+ for (struct list_item* item = neighbors->head; item;
+ item = item->next)
{
KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
neighbor = check_neighbor(rpc->target, neighbor);
@@ -730,8 +736,11 @@
ilist_pop(op->k_closest);
}
}
- list_free(neighbors);
+ list_destroy(neighbors);
+ free(rpc->result);
+ MPIRPC_Free(rpc);
+
if (op->outstanding->size == 0)
{
if (op->improved)
@@ -739,7 +748,7 @@
if (! KDA_Find_node_again(op))
KDA_Map(op);
else
- NOTE("Doing another round. ");
+ NOTE("Doing another round.");
}
else
KDA_Map(op);
@@ -758,15 +767,13 @@
KDA_Neighbor*
neighbor_lookup(KDA_Neighbor* neighbor)
{
- int i;
- struct list_item* item;
NOTE_F;
if (neighbor->id == id)
return NULL;
- for (i = 0; i < KDA_SPACE_SIZE; i++)
- for (item = k_bucket[i]->head;
- item; item = item->next)
+ for (int i = 0; i < KDA_SPACE_SIZE; i++)
+ for (struct list_item* item = k_bucket[i]->head; item;
+ item = item->next)
{
KDA_Neighbor* n = (KDA_Neighbor*) item->data;
if (n->id == neighbor->id)
@@ -787,7 +794,7 @@
KDA_Neighbor* result;
if (neighbor_add(neighbor))
- KDA_Join(neighbor->id, node.rank);
+ KDA_Join(node, neighbor);
result = neighbor_lookup(neighbor);
return result;
@@ -853,7 +860,7 @@
(KDA_Operation*) malloc(sizeof(KDA_Operation));
op->object_id = object_id;
- op->unique = unique++;
+ op->id = unique++;
op->name = name;
op->args = args;
op->k_closest = NULL;
@@ -864,7 +871,7 @@
op->proceed = proceed;
op->query = query;
- itable_add(operations, op->unique, op);
+ itable_add(operations, op->id, op);
KDA_Find_node(op);
return op;
@@ -876,7 +883,7 @@
list_free(op->contacted);
list_free(op->outstanding);
ilist_free(op->k_closest);
- itable_remove(operations, op->unique);
+ itable_remove(operations, op->id);
free(op);
}
@@ -925,7 +932,8 @@
}
/**
- @return false if n is already in the neighbor table.
+ @return True if copy of n is added to the neighbor table -
+ use neighbor_lookup to obtain this copy after a KDA_Join
*/
bool
k_bucket_insert(int i, KDA_Neighbor* n)
@@ -938,7 +946,8 @@
return false;
}
- list_ordered_insert(k_bucket[i], KDA_Neighbor_time_cmp, (void*) n);
+ KDA_Neighbor* copy = KDA_Neighbor_clone(n);
+ list_ordered_insert(k_bucket[i], KDA_Neighbor_time_cmp, copy);
NOTE("After insert: ");
DEBUG(dump_buckets());
@@ -947,7 +956,7 @@
}
/**
- @return false if n is already in the neighbor table.
+ @return True if copy of neighbor is added to the neighbor table.
*/
bool
neighbor_add(KDA_Neighbor* neighbor)
@@ -996,7 +1005,7 @@
while (! cmpi_quitting)
{
- NOTE("loop");
+ // NOTE("loop");
loop_work();
}
shutdown_others();
@@ -1157,3 +1166,15 @@
MPIRPC_Block(neighbor->node, "shutdown", NULL);
}
}
+
+char*
+kda_op_tostring(KDA_Operation* op)
+{
+ char* result = malloc(1024);
+ char* p = result;
+
+ p += sprintf(p, "Op{");
+ p += sprintf(p, "id=%i", op->id);
+
+ return result;
+}
Modified: src/kda-2/neighbor.c
===================================================================
--- src/kda-2/neighbor.c 2011-05-02 15:06:20 UTC (rev 200)
+++ src/kda-2/neighbor.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -26,37 +26,37 @@
{
NOTE_F;
KDA_Neighbor* result = malloc(sizeof(KDA_Neighbor));
- result->id = other_id;
- result->node = node;
- result->lastseen = time(NULL);
+ KDA_Neighbor_make_id(other_id, node, result);
return result;
}
+void
+KDA_Neighbor_make_id(KDA_ID other_id, MPIRPC_Node node,
+ KDA_Neighbor* output)
+{
+ output->id = other_id;
+ output->node = node;
+ output->lastseen = time(NULL);
+}
+
/**
+ Copy the original into fresh storage
+ */
+KDA_Neighbor*
+KDA_Neighbor_clone(KDA_Neighbor* original)
+{
+ KDA_Neighbor* clone =
+ KDA_Neighbor_create_id(original->id, original->node);
+ clone->lastseen = original->lastseen;
+ return clone;
+}
+
+/**
Scan the data for neighbors.
@return The new neighbor. Output n containing the number of chars
consumed from data by sscanf().
*/
-KDA_Neighbor*
-KDA_Neighbor_create_scan(char* data, int* n)
-{
- if (data == NULL)
- return NULL;
- KDA_ID other_id;
- char junk[20];
- char date[20];
- char time[20];
- int count = sscanf(data, "[%X]@%s %s %s %n", &other_id,
- junk, date, time, n);
- if (count < 2)
- return NULL;
- KDA_Neighbor* nbor = malloc(sizeof(KDA_Neighbor));
- nbor->id = other_id;
- nbor->node.rank = 0;
- nbor->node.comm = MPI_COMM_NULL;
- return nbor;
-}
/**
Neighbor-neighbor id comparison.
@@ -174,7 +174,7 @@
if (neighbor->id == id)
{
- offset = sprintf(buffer, "[%X]@SELF ", id);
+ offset = sprintf(buffer, "[%X]=%i@SELF ", id, mpi_rank);
time_t t = time(NULL);
offset += strftime(buffer+offset, 99, "%F %T",
localtime(&t));
@@ -218,8 +218,9 @@
*/
struct list* KDA_Neighbor_node_list(char* data)
{
+ SHOW_FS(data);
+
struct list* result = list_create();
-
char* end = data+strlen(data);
while (data < end-3)
{
Modified: src/mpi_tools/mpi_tools.c
===================================================================
--- src/mpi_tools/mpi_tools.c 2011-05-02 15:06:20 UTC (rev 200)
+++ src/mpi_tools/mpi_tools.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -222,6 +222,7 @@
void
note_s(char* msg, char* s)
{
+ assert(debug_file);
fprintf(debug_file, "[%i] %s%s\n", debug_rank, msg, s);
fflush(debug_file);
}
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2011-05-02 15:06:20 UTC (rev 200)
+++ src/mpirpc/mpirpc.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -506,15 +506,13 @@
bool
MPIRPC_Check()
{
- struct list_item* item;
bool event = false;
int recvd = false;
MPI_Status status;
- for (item = channels->head;
+ for (struct list_item* item = channels->head;
item; item = item->next)
{
- NOTE("check channel");
MPIRPC_Channel* channel = (MPIRPC_Channel*) item->data;
// char* name = MPIRPC_Comm_get_name(channel->comm);
@@ -535,7 +533,6 @@
MPIRPC_Handle(check_msg, node);
}
}
- sleep(1);
return event;
}
@@ -576,14 +573,13 @@
void
MPIRPC_Flush_returns()
{
- struct list_item* item;
- int i;
- gossip_do(MASK_MPIRPC, NOTE_F);
+ // gossip_do(MASK_MPIRPC, NOTE_F);
MPI_Status status;
- for (item = garbage_values->head; item; item = item->next)
+ for (struct list_item* item = garbage_values->head; item;
+ item = item->next)
{
MPIRPC_Value* value = (MPIRPC_Value*) item->data;
- for (i = 0; i < 3; i++)
+ for (int i = 0; i < 3; i++)
{
MPI_Wait(&value->request[i], &status);
}
Modified: test/adts/test-lru_table01.c
===================================================================
--- test/adts/test-lru_table01.c 2011-05-02 15:06:20 UTC (rev 200)
+++ test/adts/test-lru_table01.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -38,7 +38,7 @@
MPI_Init(&argc, &argv);
whoami();
- struct lru_table* table = lru_table_create(5, 4);
+ struct lru_table* table = lru_table_create(5, 4);
int* one = malloc(sizeof(int));
int* two = malloc(sizeof(int));
Modified: test/cmpi/test-putget.c
===================================================================
--- test/cmpi/test-putget.c 2011-05-02 15:06:20 UTC (rev 200)
+++ test/cmpi/test-putget.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -12,9 +12,6 @@
{
NOTE_F;
- wait_for_notification();
- notify_next();
-
char key1[10];
char key2[10];
@@ -36,9 +33,11 @@
sleep(2);
int length;
- char* result;
- cmpi_get(key1, &result, &length);
- printf("result(%i): %s\n", length, result);
+ void* result;
+ CMPI_RETURN code = cmpi_get(key1, &result, &length);
+ cmpi_assert(code, "get() failed!");
+ printf("result(%i): %s\n", length, (char*) result);
+ free(result);
sleep(3);
Modified: test/cmpi/test-update01.c
===================================================================
--- test/cmpi/test-update01.c 2011-05-02 15:06:20 UTC (rev 200)
+++ test/cmpi/test-update01.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -35,10 +35,10 @@
cmpi_update(key2, "X", 1, 3);
- char* result;
+ void* result;
int length;
cmpi_get(key2, &result, &length);
- printf("result: %s\n", result);
+ printf("result: %s\n", (char*) result);
printf("GET SUCCEEDED\n");
sleep(2);
Modified: test/cmpi/test-update02.c
===================================================================
--- test/cmpi/test-update02.c 2011-05-02 15:06:20 UTC (rev 200)
+++ test/cmpi/test-update02.c 2011-05-02 22:55:48 UTC (rev 201)
@@ -44,16 +44,16 @@
sleep(2);
- char* result;
+ void* result;
int length;
cmpi_get(key1, &result, &length);
- printf("RESULT_1: %s\n", result);
+ printf("RESULT_1: %s\n", (char*) result);
sleep(1);
cmpi_get(key2, &result, &length);
- printf("RESULT_2: %s\n", result);
+ printf("RESULT_2: %s\n", (char*) result);
sleep(1);
cmpi_get(key3, &result, &length);
- printf("RESULT_3: %s\n", result);
+ printf("RESULT_3: %s\n", (char*) result);
NOTE("GET SUCCEEDED");
sleep(2);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-05-02 15:06:26
|
Revision: 200
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=200&view=rev
Author: jmwozniak
Date: 2011-05-02 15:06:20 +0000 (Mon, 02 May 2011)
Log Message:
-----------
Get test-startup working for dense-1 and kda-2A
Modified Paths:
--------------
include/cmpi.h
include/list.h
src/adts/list.c
src/dense-1/dense.c
src/mpirpc/mpirpc.c
test/cmpi/module.mk.in
test/cmpi/test-startup.c
test/cmpi/test-tables.c
Modified: include/cmpi.h
===================================================================
--- include/cmpi.h 2011-05-02 15:04:43 UTC (rev 199)
+++ include/cmpi.h 2011-05-02 15:06:20 UTC (rev 200)
@@ -229,7 +229,7 @@
int offset, int length);
/**
- Global operation. Instruct all nodes to shutdown.
+ Instruct all nodes to shutdown. All clients need to call this.
*/
void cmpi_shutdown(void);
Modified: include/list.h
===================================================================
--- include/list.h 2011-05-02 15:04:43 UTC (rev 199)
+++ include/list.h 2011-05-02 15:06:20 UTC (rev 200)
@@ -113,7 +113,7 @@
/**
Return the head data item.
*/
-void* list_peek(struct list* target);
+void* list_head(struct list* target);
/**
Remove and return the head data item.
Modified: src/adts/list.c
===================================================================
--- src/adts/list.c 2011-05-02 15:04:43 UTC (rev 199)
+++ src/adts/list.c 2011-05-02 15:06:20 UTC (rev 200)
@@ -138,7 +138,7 @@
}
void*
-list_peek(struct list* target)
+list_head(struct list* target)
{
if (target->size == 0)
return NULL;
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2011-05-02 15:04:43 UTC (rev 199)
+++ src/dense-1/dense.c 2011-05-02 15:06:20 UTC (rev 200)
@@ -92,10 +92,10 @@
}
else
{
- int client =
- cmpi_mode_first_client(mpi_rank, mpi_size, dense_nodes);
- NOTE("NOTIFYING");
- int msg = -2;
+ //int client =
+ // cmpi_mode_first_client(mpi_rank, mpi_size, dense_nodes);
+ //NOTE("NOTIFYING");
+ //int msg = -2;
// MPI_Send(&msg, 1, MPI_INT, client, 0, MPI_COMM_WORLD);
}
}
@@ -225,6 +225,7 @@
void
DENSE_Shutdown(MPIRPC_Node node)
{
+ NOTE_F;
MPIRPC_Block(node, "quit", NULL);
}
@@ -333,6 +334,7 @@
static MPIRPC_Handler(handle_quit)
{
+ NOTE_F;
MPIRPC_Null(caller, unique);
sleep(1);
MPIRPC_Flush_returns();
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2011-05-02 15:04:43 UTC (rev 199)
+++ src/mpirpc/mpirpc.c 2011-05-02 15:06:20 UTC (rev 200)
@@ -689,7 +689,7 @@
MPI_Status status;
int sent;
- value = list_peek(garbage_values);
+ value = list_head(garbage_values);
if (!value)
return false;
Modified: test/cmpi/module.mk.in
===================================================================
--- test/cmpi/module.mk.in 2011-05-02 15:04:43 UTC (rev 199)
+++ test/cmpi/module.mk.in 2011-05-02 15:06:20 UTC (rev 200)
@@ -12,20 +12,24 @@
TEST_HELPER_SRC := test/cmpi/test_helpers.c
TEST_CMPI_OBJS += $(patsubst %.c, %.o, $(TEST_HELPER_SRC))
+TEST_CMPI_PROGS := $(patsubst %.c, %.x, $(TEST_CMPI_SRC))
TEST_SRC += $(TEST_CMPI_SRC)
TEST_OBJS += $(TEST_CMPI_OBJS)
-TEST_PROGS += $(patsubst %.c, %.x, $(TEST_CMPI_SRC))
+TEST_PROGS += $(TEST_CMPI_PROGS)
TEST_OUTPUT += $(TEST_CMPI_OUTPUT)
+
ifeq (@USE_CMPI_MODE@,MONO)
- NODES := 5
- CLIENTS := 1
+ NODES := 5
+ CLIENTS := 1
else
- NODES := 3
- CLIENTS := 3
+ NODES := 3
+ CLIENTS := 3
endif
+cmpi_tests: $(TEST_CMPI_PROGS)
+
ifeq (@USE_COMM_WORLD@,1)
$(DIR)/test%.x: $(DIR)/test%.o $(DIR)/test_helpers.o src/cmpi/node.o $(CMPI)
Modified: test/cmpi/test-startup.c
===================================================================
--- test/cmpi/test-startup.c 2011-05-02 15:04:43 UTC (rev 199)
+++ test/cmpi/test-startup.c 2011-05-02 15:06:20 UTC (rev 200)
@@ -24,6 +24,5 @@
puts("running...");
- // if (mpi_rank == mpi_size-1)
cmpi_shutdown();
}
Modified: test/cmpi/test-tables.c
===================================================================
--- test/cmpi/test-tables.c 2011-05-02 15:04:43 UTC (rev 199)
+++ test/cmpi/test-tables.c 2011-05-02 15:06:20 UTC (rev 200)
@@ -16,13 +16,15 @@
gossip_set_debug_mask(1, MASK_MPIRPC|MASK_DHT);
- wait_for_notification();
- notify_next();
+ // wait_for_notification();
+ // notify_next();
+ sleep(2);
+
cmpi_debug_tables();
sleep(mpi_rank);
- //if (mpi_rank == mpi_size-1)
- cmpi_shutdown();
+ if (mpi_rank == mpi_size-1)
+ cmpi_shutdown();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-05-02 15:04:49
|
Revision: 199
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=199&view=rev
Author: jmwozniak
Date: 2011-05-02 15:04:43 +0000 (Mon, 02 May 2011)
Log Message:
-----------
Update ADT API
Modified Paths:
--------------
src/adts/About.txt
Modified: src/adts/About.txt
===================================================================
--- src/adts/About.txt 2011-05-02 15:01:05 UTC (rev 198)
+++ src/adts/About.txt 2011-05-02 15:04:43 UTC (rev 199)
@@ -11,10 +11,11 @@
DATA _search(target, key)
DATA _inspect(target, data, n)
{ search for data in target that matches given data in n bytes }
- _update(target, key, data, offset, length)
- _set(target, key, data)
+void _update(target, key, data, offset, length)
+void _set(target, key, data)
{ reset the value of the given key }
DATA _poll() { head }
+DATA _head() { head }
DATA _pop() { tail }
DATA _get(i)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-05-02 15:01:11
|
Revision: 198
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=198&view=rev
Author: jmwozniak
Date: 2011-05-02 15:01:05 +0000 (Mon, 02 May 2011)
Log Message:
-----------
How to administer manual
Added Paths:
-----------
docs/manual/About.txt
Added: docs/manual/About.txt
===================================================================
--- docs/manual/About.txt (rev 0)
+++ docs/manual/About.txt 2011-05-02 15:01:05 UTC (rev 198)
@@ -0,0 +1,10 @@
+
+
+Build manual.html:
+
+asciidoc -n docs/manual/manual.txt
+
+Upload manual to SF.net:
+
+scp docs/manual/manual.html jmwozniak,c-...@we...:/home/project-web/c-mpi/htdocs/index.html
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-28 19:53:24
|
Revision: 197
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=197&view=rev
Author: jmwozniak
Date: 2011-04-28 19:53:16 +0000 (Thu, 28 Apr 2011)
Log Message:
-----------
Overhaul to get Kademlia working again
Modified Paths:
--------------
docs/manual/manual.txt
include/cmpi.h
include/dense-1.h
include/kda-2.h
include/kda_conn-A.h
include/mpi_tools.h
include/mpirpc.h
include/xtree.h
src/adts/lru_table.c
src/adts/xtree.c
src/cmpi/cmpi.c
src/cmpi/driver.c
src/cmpi/mode_mono.c
src/cmpi/node.c
src/dense-1/cmpi_dense.c
src/dense-1/dense.c
src/kda-2/cmpi_kademlia.c
src/kda-2/conn-A.c
src/kda-2/conn-B.c
src/kda-2/kademlia.c
src/kda-2/neighbor.c
src/mpi_tools/mpi_tools.c
src/mpirpc/mpirpc.c
test/adts/test-dpkm_list.c
test/adts/test-lru_table01.c
test/cmpi/test-manyputs.c
test/cmpi/test-startup.c
test/driver/test-cmd-sleep.c
test/driver/test.zsh
test/mpi_tools/test-tools01.c
test/mpirpc/test-args.c
test/mpirpc/test-blob.c
test/mpirpc/test-ping.c
test/mpirpc/test-returns.c
Modified: docs/manual/manual.txt
===================================================================
--- docs/manual/manual.txt 2011-04-27 18:19:30 UTC (rev 196)
+++ docs/manual/manual.txt 2011-04-28 19:53:16 UTC (rev 197)
@@ -65,6 +65,8 @@
(+cmpi-db+) and the user connects to it via a cp-like tool
(+cmpi-cp+).
+image:cluster.png[Cluster mode operation]
+
Commands executed on submit host:
--------------------------------------------------------
#!/bin/sh
@@ -449,12 +451,12 @@
~~~~
The tests are defined for each component in +module.mk+. For each
-+test-*.c+, a +test-*.x+ executable is produced and launched. The
++test-\*.c+, a +test-\*.x+ executable is produced and launched. The
launcher is ; +assert()+s and output parsing are used to confirm
-correctness. Output is collected in +test-*.out+. If the test is run
-from a +test-*.zsh+, debugging output is collected and post-processed
+correctness. Output is collected in +test-\*.out+. If the test is run
+from a +test-\*.zsh+, debugging output is collected and post-processed
by the ZSH script. If the test fails, the output is moved to
-+test-*.out.failed+ (so make does not consider it).
++test-\*.out.failed+ (so make does not consider it).
make D=1 test_results
@@ -463,6 +465,8 @@
Components
----------
+image:cmpi-connections.png[C-MPI components outlined below.]
+
cmpi::
The C-MPI interface. Some reusable functionality is defined.
@@ -526,7 +530,7 @@
Abstract data types: lists, hash tables, etc.
-+gossip+;;
++gossip+::
A logging library from Phil Carns.
Modified: include/cmpi.h
===================================================================
--- include/cmpi.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/cmpi.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -124,9 +124,9 @@
void cmpi_params_add(char* key, char* value);
/**
- Copies out the result from the cache.
+ Obtain pointer to the result from the params table.
*/
-char* cmpi_params_search(char* key);
+char* cmpi_params_get(char* key);
//// Methods that the implementation must provide:
Modified: include/dense-1.h
===================================================================
--- include/dense-1.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/dense-1.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -33,25 +33,4 @@
void rpc_bootping(void);
void listen_loop(void);
-void handle_bootping(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_info(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_ping(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_query_id(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_query_id_k(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_store(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_update(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_retrieve(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_debug_cache(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-void handle_quit(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
-
#endif
Modified: include/kda-2.h
===================================================================
--- include/kda-2.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/kda-2.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -78,19 +78,21 @@
//// Helpers...
+void KDA_Join(int other_id, int other_rank);
+
void KDA_Setup_node_port(void);
-void KDA_Serve(void);
-void KDA_Serve_id(KDA_ID other_id, MPIRPC_Node node);
-MPIRPC_Node KDA_Serve_accept(void);
-void KDA_Serve_client(MPIRPC_Node node);
-void KDA_Serve_handshake(MPIRPC_Node node,
- KDA_ID* other_id, int* msg);
-void KDA_Serve_neighbor(KDA_ID other_id, MPIRPC_Node node);
-void KDA_Setup_connector_port(void);
-void KDA_Connect_port(char* port);
-MPIRPC_Node* KDA_Attach(void);
-MPIRPC_Node* KDA_Attach_port(char* port);
-MPIRPC_Node* KDA_Register_hub(MPI_Comm comm);
+// void KDA_Serve(void);
+// void KDA_Serve_id(KDA_ID other_id, MPIRPC_Node node);
+// MPIRPC_Node KDA_Serve_accept(void);
+// void KDA_Serve_client(MPIRPC_Node node);
+//void KDA_Serve_handshake(MPIRPC_Node node,
+// KDA_ID* other_id, int* msg);
+//void KDA_Serve_neighbor(KDA_ID other_id, MPIRPC_Node node);
+// void KDA_Setup_connector_port(void);
+// void KDA_Connect_port(char* port);
+void KDA_Attach(struct list* contacts);
+// MPIRPC_Node* KDA_Attach_port(char* port);
+// MPIRPC_Node* KDA_Register_hub(MPI_Comm comm);
void KDA_Comm_set_name(KDA_Neighbor* neighbor);
@@ -103,7 +105,8 @@
// void KDA_Send_neighbor(MPI_Comm comm);
void KDA_Serve_shutdown(void);
void KDA_Detach(MPIRPC_Node node);
-void KDA_Shutdown(void);
+void KDA_Detach_hubs();
+void KDA_Shutdown(struct list* contacts);
void KDA_Shutdown_port(char* hub_port);
/**
@@ -144,10 +147,13 @@
MPIRPC* KDA_Lookup(MPIRPC_Node node, char* key);
MPIRPC* KDA_Lookup_k(MPIRPC_Node node, char* key);
-MPIRPC* KDA_Store(KDA_Neighbor* neighbor, char* key, char* value, int length);
-
+MPIRPC* KDA_Store(KDA_Neighbor* neighbor, char* key, char* value,
+ int length);
MPIRPC* KDA_Retrieve(KDA_Neighbor* neighbor, char* key);
+MPIRPC* KDA_Update(KDA_Neighbor* neighbor, char* key, char* value,
+ int length, int offset);
+
void listen_loop(void);
bool neighbor_add(KDA_Neighbor* neighbor);
Modified: include/kda_conn-A.h
===================================================================
--- include/kda_conn-A.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/kda_conn-A.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -10,9 +10,9 @@
/**
Translate a KDA_ID to a rank in MPI_COMM_WORLD.
*/
-void handle_get_rank(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length);
+MPIRPC_Handler(handle_get_rank);
/**
Return the local KDA_ID.
*/
-void handle_get_id(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length);
+MPIRPC_Handler(handle_get_id);
Modified: include/mpi_tools.h
===================================================================
--- include/mpi_tools.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/mpi_tools.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -94,6 +94,8 @@
#define OK NOTE("ok")
+void setup_debug_file(void);
+
/**
Simplify debugging statements.
*/
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/mpirpc.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -30,9 +30,9 @@
int status;
char name[MPIRPC_MAX_NAME];
char args[MPIRPC_MAX_ARGS];
- char* blob;
+ void* blob;
int blob_length;
- char* result;
+ void* result;
int result_length;
void* extras;
void (*proceed) (struct mpirpc* rpc);
@@ -67,6 +67,21 @@
MPI_Request request[4];
} MPIRPC_Value;
+/**
+ Defines MPIRPC handler "f"
+ Parameters:
+ the target node
+ the uniqifier
+ the args
+ the blob
+ the blob length
+ */
+#define MPIRPC_Handler_pointer(f) void \
+ (*f)(MPIRPC_Node,int,char*,void*,int)
+
+#define MPIRPC_Handler(f) void \
+ f(MPIRPC_Node caller, int unique, char* args, void* blob, int blob_length)
+
//// API...
void MPIRPC_Init(void);
@@ -75,8 +90,7 @@
void MPIRPC_Recv(MPI_Comm comm);
-void MPIRPC_Register(char* name,
- void (*f)(MPIRPC_Node,int,char*,char*,int));
+void MPIRPC_Register(char* name, MPIRPC_Handler_pointer(f));
bool MPIRPC_Comm_add(MPI_Comm comm);
@@ -86,20 +100,20 @@
void* extras, void (*proceed)(MPIRPC*));
MPIRPC* MPIRPC_Call_blob(MPIRPC_Node target, char* name, char* args,
- char* blob, int blob_length,
+ void* blob, int blob_length,
void* extras, void (*proceed)(MPIRPC*));
-char* MPIRPC_Block(MPIRPC_Node target, char* name, char* args);
+void* 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);
+void* MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
+ void* blob, int blob_length);
-char* MPIRPC_Wait(MPIRPC* rpc);
+void* MPIRPC_Wait(MPIRPC* rpc);
void MPIRPC_Null(MPIRPC_Node caller, int unique);
void MPIRPC_Return(MPIRPC_Node caller, int unique,
- char* result, int rlength);
+ void* result, int rlength);
MPIRPC_Node* MPIRPC_Node_create(MPI_Comm comm, int rank);
Modified: include/xtree.h
===================================================================
--- include/xtree.h 2011-04-27 18:19:30 UTC (rev 196)
+++ include/xtree.h 2011-04-28 19:53:16 UTC (rev 197)
@@ -6,73 +6,67 @@
#ifndef XTREE_H
#define XTREE_H
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <inlist.h>
-#include <ilist.h>
-#include <inlist.h>
-
-typedef int xtree_id;
+typedef int xtree_id;
#define XTREE_DEPTH (sizeof(xtree_id)*8)
-typedef struct xtree_object_s xtree_object;
+typedef struct xtree_object_s xtree_object;
typedef union xtree_thing_u xtree_thing;
-typedef enum
+typedef enum
{
XTREE_NODE,
XTREE_ITEM
-} xtree_tag;
+} xtree_tag;
typedef struct xtree_item_s
{
xtree_id id;
void* data;
xtree_object* smaller;
- xtree_object* bigger;
+ xtree_object* bigger;
} xtree_item;
typedef struct xtree_node_s
{
xtree_object* zero;
- xtree_object* one;
+ xtree_object* one;
} xtree_node;
union xtree_thing_u
{
xtree_node node;
- xtree_item item;
+ xtree_item item;
};
struct xtree_object_s
{
xtree_tag tag;
- xtree_thing thing;
+ xtree_thing thing;
};
struct xtree
{
- int size;
- xtree_object* root;
+ int size;
+ xtree_object* root;
};
struct xtree* xtree_create();
-void xtree_add(struct xtree* target, xtree_id id, void* data);
+void xtree_add(struct xtree* target, xtree_id id, void* data);
void* xtree_search(struct xtree* target, xtree_id id);
struct inlist* xtree_query(struct xtree* target,
- xtree_id id, int count);
+ xtree_id id, int count);
void xtree_printf(struct xtree* target);
-//// Internals:
+//// Internals:
-void xtree_replace(struct xtree* target, int depth,
+void xtree_replace(struct xtree* target, int depth,
xtree_object* old_object,
xtree_object* new_object);
-#endif
+#endif
Modified: src/adts/lru_table.c
===================================================================
--- src/adts/lru_table.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/adts/lru_table.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -7,11 +7,13 @@
return (i1>i2) ? i1 : i2;
}
+/*
static int
min(int i1, int i2)
{
return (i1<i2) ? i1 : i2;
}
+*/
struct lru_table*
lru_table_create(int capacity, int limit)
@@ -195,8 +197,6 @@
gossip_do(MASK_ADTS, lru_table_printf("%s", table));
DEBUG(printdata("old data: ", item->data, item->length));
- char* data = item->data;
-
int new_length = max(item->length, offset+length);
char* update = realloc(item->data, new_length);
Modified: src/adts/xtree.c
===================================================================
--- src/adts/xtree.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/adts/xtree.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -1,27 +1,34 @@
-#include <xtree.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <xtree.h>
+#include <ilist.h>
+
/**
@return The ith bit of id.
*/
int
bit(int i, xtree_id id)
{
- // printf("shift: %i\n", (1 << i));
+ // printf("shift: %i\n", (1 << i));
- return !! ((1 << i) & id);
+ return !! ((1 << i) & id);
}
struct xtree*
xtree_create()
{
struct xtree* result;
-
+
result = malloc(sizeof(struct xtree));
result->size = 0;
- result->root = NULL;
-
- return result;
+ result->root = NULL;
+
+ return result;
}
void
@@ -30,37 +37,37 @@
xtree_object* new_object;
xtree_object** p;
bool done;
- int depth;
+ int depth;
new_object = malloc(sizeof(xtree_object));
- new_object->tag = XTREE_ITEM;
+ new_object->tag = XTREE_ITEM;
new_object->thing.item.id = id;
new_object->thing.item.data = data;
if (target->size == 0)
{
- target->root = new_object;
- target->size++;
- return;
+ target->root = new_object;
+ target->size++;
+ return;
}
-
+
p = &(target->root);
- depth = XTREE_DEPTH-1;
+ depth = XTREE_DEPTH-1;
done = false;
while (!done)
{
if (*p == NULL)
{
- printf("inserting at NULL stub: depth: %i\n", depth);
- *p = new_object;
- target->size++;
- break;
+ printf("inserting at NULL stub: depth: %i\n", depth);
+ *p = new_object;
+ target->size++;
+ break;
}
else if ((*p)->tag == XTREE_ITEM)
{
xtree_replace(target, depth, *p, new_object);
- target->size++;
- break;
+ target->size++;
+ break;
}
else if ((*p)->tag == XTREE_NODE)
{
@@ -68,67 +75,65 @@
p = &((*p)->thing.node.zero);
else
p = &((*p)->thing.node.one);
- depth--;
+ depth--;
}
}
}
-#include <unistd.h>
-
void
-xtree_replace(struct xtree* target, int depth,
+xtree_replace(struct xtree* target, int depth,
xtree_object* old_object, xtree_object* new_object)
{
- xtree_item old_item;
+ xtree_item old_item = {0};
xtree_object* p;
xtree_id old_id;
- xtree_id new_id;
-
- xtree_object* new_node;
+ xtree_id new_id;
- // Shortcuts...
+ xtree_object* new_node;
+
+ // Shortcuts...
old_id = old_object->thing.item.id;
new_id = new_object->thing.item.id;
-
+
old_item.id = old_object->thing.item.id;
- old_item.data = old_object->thing.item.data;
+ old_item.data = old_object->thing.item.data;
- old_object->tag = XTREE_NODE;
+ old_object->tag = XTREE_NODE;
old_object->thing.node.zero = NULL;
- old_object->thing.node.one = NULL;
+ old_object->thing.node.one = NULL;
- printf("xtree_replace(%i)\n", depth);
+ printf("xtree_replace(%i)\n", depth);
printf("old %i: \n", old_id);
printf("new %i: \n", new_id);
-
+
p = old_object;
old_object = malloc(sizeof(xtree_object));
old_object->tag = XTREE_ITEM;
- old_object->thing.item = old_item;
-
+ old_object->thing.item = old_item;
+
while (true)
{
if (bit(depth,old_id) != bit(depth,new_id))
{
- printf("diff at: %i\n", depth);
-
+ printf("diff at: %i\n", depth);
+
if (bit(depth,old_id) == 0)
{
p->thing.node.zero = old_object;
- p->thing.node.one = new_object;
+ p->thing.node.one = new_object;
}
else
{
p->thing.node.zero = new_object;
- p->thing.node.one = old_object;
+ p->thing.node.one = old_object;
}
- break;
+ break;
}
else
{
- // printf("new_node\n");
+ // printf("new_node\n");
new_node = malloc(sizeof(xtree_object));
new_node->tag = XTREE_NODE;
new_node->thing.node.zero = NULL;
@@ -137,7 +142,7 @@
p->thing.node.zero = new_node;
else
p->thing.node.one = new_node;
- p = new_node;
+ p = new_node;
}
depth--;
}
@@ -145,19 +150,19 @@
/**
*/
-void
+void
xtree_find(xtree_object* p, xtree_id id, int count,
- int depth, struct ilist* objects)
+ int depth, struct ilist* objects)
{
if (p == NULL)
{
- return;
+ return;
}
-
+
if (p->tag == XTREE_ITEM)
{
- ilist_ordered_insert(objects, id ^ p->thing.item.id, p);
- return;
+ ilist_ordered_insert(objects, id ^ p->thing.item.id, p);
+ return;
}
if (bit(depth, id) == 0)
@@ -179,53 +184,53 @@
struct inlist*
xtree_query(struct xtree* target, xtree_id id, int count)
{
- struct inlist* result;
- struct ilist* objects;
+ struct inlist* result;
+ struct ilist* objects;
struct ilist_item* item;
- xtree_object* object;
-
+ xtree_object* object;
+
objects = ilist_create();
xtree_find(target->root, id, count, XTREE_DEPTH-1, objects);
- result = inlist_create();
+ result = inlist_create();
for (item = objects->head; item; item = item->next)
{
object = (xtree_object*) item->data;
inlist_add(result, object->thing.item.id);
}
- return result;
+ return result;
}
/**
- Return the data object for the matching id.
+ Return the data object for the matching id.
*/
void*
xtree_search(struct xtree* target, xtree_id id)
{
- void* result;
- struct ilist* objects;
- xtree_object* object;
+ void* result;
+ struct ilist* objects = ilist_create();
+ xtree_object* object;
result = NULL;
-
- xtree_find(target->root, id, 1, XTREE_DEPTH-1, objects);
+ xtree_find(target->root, id, 1, XTREE_DEPTH-1, objects);
+
if (objects->size > 0)
{
object = (xtree_object*) objects->head->data;
if (object->thing.item.id == id)
- result = object->thing.item.data;
+ result = object->thing.item.data;
}
-
- return result;
+
+ return result;
}
void
xtree_printf_item(xtree_item* item, int depth)
{
- printf(" %i", item->id);
+ printf(" %i", item->id);
}
void
@@ -234,27 +239,27 @@
char spaces[256];
memset(spaces, ' ', XTREE_DEPTH-depth);
- spaces[XTREE_DEPTH-depth] = '\0';
+ spaces[XTREE_DEPTH-depth] = '\0';
- // printf("depth: %i\n", depth)
-
+ // printf("depth: %i\n", depth)
+
if (object != NULL)
{
if (object->tag == XTREE_ITEM)
{
- printf("ITEM: ");
+ printf("ITEM: ");
xtree_printf_item(&(object->thing.item), depth);
}
else
{
if (object->thing.node.zero != NULL)
{
- printf("\n%s0 ", spaces);
+ printf("\n%s0 ", spaces);
xtree_printf_node(object->thing.node.zero, depth-1);
}
if (object->thing.node.one != NULL)
{
- printf("\n%s1 ", spaces);
+ printf("\n%s1 ", spaces);
xtree_printf_node(object->thing.node.one, depth-1);
}
}
@@ -264,10 +269,10 @@
void
xtree_printf(struct xtree* target)
{
- if (target->size > 0)
+ if (target->size > 0)
xtree_printf_node(target->root, XTREE_DEPTH-1);
else
printf("xtree: empty");
- printf("\n");
+ printf("\n");
}
Modified: src/cmpi/cmpi.c
===================================================================
--- src/cmpi/cmpi.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/cmpi/cmpi.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -48,9 +48,10 @@
Returns pointer to the matching value or NULL if not found.
*/
char*
-cmpi_params_search(char* key)
+cmpi_params_get(char* key)
{
char* result = hashtable_search(cmpi_params, key);
+ SHOW_FSS(key, result);
return result;
}
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/cmpi/driver.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -54,7 +54,7 @@
*/
void driver_setup_fifo_names()
{
- char* dir = cmpi_params_search("driver_dir");
+ char* dir = cmpi_params_get("driver_dir");
if (!dir)
dir = "/tmp";
Modified: src/cmpi/mode_mono.c
===================================================================
--- src/cmpi/mode_mono.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/cmpi/mode_mono.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -51,6 +51,7 @@
int cmpi_mode_first_client(int rank, int size, int nodes)
{
+ SHOW_FI(nodes);
return nodes;
}
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/cmpi/node.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -154,8 +154,8 @@
{
gossip_debug_init();
- //gossip_set_debug_mask(true,MASK_DEBUG|MASK_MPIRPC|MASK_ADTS|
- // MASK_CMPI|MASK_DRIVER);
+ gossip_set_debug_mask(true,MASK_DEBUG|MASK_MPIRPC|// MASK_ADTS|
+ MASK_CMPI|MASK_DRIVER);
gossip_enable_stdout();
@@ -171,12 +171,8 @@
whoami();
if (mpi_rank == 0)
- {
DEBUG(timestamp("START", NULL));
- }
- dmalloc_setup();
-
// Handle and store options...
options(argc, argv);
@@ -202,7 +198,7 @@
exit(1);
}
- char* tag = cmpi_params_search("tag");
+ char* tag = cmpi_params_get("tag");
if (tag)
note_s("tag: ", tag);
Modified: src/dense-1/cmpi_dense.c
===================================================================
--- src/dense-1/cmpi_dense.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/dense-1/cmpi_dense.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -255,7 +255,7 @@
DENSE_Read_params(void)
{
// NOTE_F;
- char* nodes_msg = cmpi_params_search("nodes");
+ char* nodes_msg = cmpi_params_get("nodes");
if (nodes_msg)
{
int n = sscanf(nodes_msg, "%i", &dense_nodes);
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/dense-1/dense.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -28,6 +28,17 @@
int k = 1;
+static MPIRPC_Handler(handle_bootping);
+static MPIRPC_Handler(handle_info);
+static MPIRPC_Handler(handle_ping);
+static MPIRPC_Handler(handle_query_id);
+static MPIRPC_Handler(handle_query_id_k);
+static MPIRPC_Handler(handle_store);
+static MPIRPC_Handler(handle_update);
+static MPIRPC_Handler(handle_retrieve);
+static MPIRPC_Handler(handle_debug_cache);
+static MPIRPC_Handler(handle_quit);
+
void
DENSE_Init(int k_in, MPI_Comm comm)
{
@@ -85,7 +96,7 @@
cmpi_mode_first_client(mpi_rank, mpi_size, dense_nodes);
NOTE("NOTIFYING");
int msg = -2;
- MPI_Send(&msg, 1, MPI_INT, client, 0, MPI_COMM_WORLD);
+ // MPI_Send(&msg, 1, MPI_INT, client, 0, MPI_COMM_WORLD);
}
}
@@ -217,31 +228,23 @@
MPIRPC_Block(node, "quit", NULL);
}
-void
-handle_bootping(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_bootping)
{
MPIRPC_Null(caller, unique);
rpc_bootping();
}
-void
-handle_info(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_info)
{
MPIRPC_Null(caller, unique);
}
-void
-handle_ping(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_ping)
{
MPIRPC_Null(caller, unique);
}
-void
-handle_query_id(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_query_id)
{
int object_id;
sscanf(args, "%X", &object_id);
@@ -251,9 +254,7 @@
MPIRPC_Return(caller, unique, result, length);
}
-void
-handle_query_id_k(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_query_id_k)
{
int i;
int object_id;
@@ -269,9 +270,7 @@
MPIRPC_Return(caller, unique, result, strlen(result)+1);
}
-void
-handle_store(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_store)
{
SHOW_FSI(args, blob_length);
@@ -283,9 +282,7 @@
DONE;
}
-void
-handle_update(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_update)
{
char* key = malloc(strlen(args)+1);
@@ -301,9 +298,7 @@
MPIRPC_Null(caller, unique);
}
-void
-handle_retrieve(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_retrieve)
{
NOTE_FS(args);
@@ -329,18 +324,14 @@
}
}
-void
-handle_debug_cache(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_debug_cache)
{
MPIRPC_Null(caller, unique);
puts("cmpi_cache:");
lru_table_printdata(cmpi_cache);
}
-void
-handle_quit(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+static MPIRPC_Handler(handle_quit)
{
MPIRPC_Null(caller, unique);
sleep(1);
Modified: src/kda-2/cmpi_kademlia.c
===================================================================
--- src/kda-2/cmpi_kademlia.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/kda-2/cmpi_kademlia.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -6,10 +6,13 @@
*/
struct list* contacts;
+static void cmpi_impl_parameters(void);
+
CMPI_RETURN
cmpi_init_impl()
{
// NOTE_F;
+ cmpi_impl_parameters();
KDA_Init(3, 3);
return CMPI_SUCCESS;
@@ -18,9 +21,13 @@
CMPI_RETURN
cmpi_init_impl_client()
{
+ NOTE_F;
+
contacts = list_create();
KDA_Init_client(3,3);
+ KDA_Attach(contacts);
+
return CMPI_SUCCESS;
}
@@ -37,19 +44,30 @@
return CMPI_SUCCESS;
}
+static void
+cmpi_impl_parameters()
+{
+ char* value = cmpi_params_get("nodes");
+ assert(value);
+ cmpi_impl_parameter("nodes", value);
+}
+
CMPI_RETURN
cmpi_attach()
{
+ /*
CMPI_RETURN result;
if (KDA_Attach())
{
- add_contacts();
result = CMPI_SUCCESS;
}
else
result = CMPI_ERROR_SERVICENAME;
return result;
+ */
+ printf("cmpi_attach(): DEPRECATED!\n");
+ return CMPI_SUCCESS;
}
void
@@ -61,20 +79,19 @@
for (i = 0; i < KDA_SPACE_SIZE; i++)
for (item = k_bucket[i]->head;
item; item = item->next)
- {
- KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
- KDA_Neighbor_dump(neighbor);
- list_add_unique(contacts, KDA_Neighbor_cmp, neighbor);
- KDA_Comm_set_name(neighbor);
- }
+ {
+ KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
+ KDA_Neighbor_dump(neighbor);
+ list_add_unique(contacts, KDA_Neighbor_cmp, neighbor);
+ KDA_Comm_set_name(neighbor);
+ }
}
KDA_Neighbor*
contact_lookup(KDA_Neighbor* neighbor)
{
- struct list_item* item;
NOTE_FX(neighbor->id);
- for (item = contacts->head;
+ for (struct list_item* item = contacts->head;
item; item = item->next)
{
KDA_Neighbor* n = (KDA_Neighbor*) item->data;
@@ -82,8 +99,7 @@
return n;
}
- NOTE("CONTACT LOOKUP FAILED: LINKING");
- KDA_Harpoon(KDA_Random_neighbor()->node, neighbor->id);
+ KDA_Join(neighbor->id, neighbor->node.comm);
add_contacts();
return contact_lookup(neighbor);
@@ -118,7 +134,7 @@
MPIRPC_Wait(rpc);
- printf("cmpi_lookup()@%X -> %s \n", n->id, rpc->result);
+ printf("cmpi_lookup()@%X -> %s \n", n->id, (char*) rpc->result);
return 0;
}
@@ -159,12 +175,10 @@
for (item = neighbors->head;
item; item = item->next)
{
- KDA_Neighbor* neighbor =
- contact_lookup((KDA_Neighbor*) item->data);
+ KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
MPIRPC* rpc = KDA_Store(neighbor, key, value, length);
MPIRPC_Wait(rpc);
MPIRPC_Free(rpc);
- NOTE("freed");
}
list_destroy(neighbors);
@@ -208,7 +222,47 @@
return CMPI_SUCCESS;
}
+CMPI_RETURN
+cmpi_update(char* key, char* value, int length, int offset)
+{
+ struct list_item* item;
+ NOTE_FSS(key, value);
+
+ // printf("contacts: %i \n", contacts);
+
+ KDA_Neighbor* n = (KDA_Neighbor*) list_random(contacts);
+ MPIRPC* lookup = KDA_Lookup_k(n->node, key);
+ MPIRPC_Wait(lookup);
+
+ struct list* neighbors = KDA_Neighbor_node_list(lookup->result);
+
+ for (item = neighbors->head; item; item = item->next)
+ {
+ KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
+ MPIRPC* rpc = KDA_Update(neighbor, key, value, length, offset);
+ MPIRPC_Wait(rpc);
+ MPIRPC_Free(rpc);
+ }
+
+ list_destroy(neighbors);
+
+ DONE;
+ return CMPI_SUCCESS;
+}
+
void
+cmpi_debug_tables()
+{
+ puts("debug_tables()");
+}
+
+void
+cmpi_debug_caches()
+{
+ puts("debug_caches()");
+}
+
+void
cmpi_detach()
{
while (contacts->size > 0)
@@ -219,19 +273,21 @@
free(neighbor);
}
- while (hubs->size > 0)
- {
- MPIRPC_Node* hub = (MPIRPC_Node*) list_poll(hubs);
- KDA_Detach(*hub);
- free(hub);
- }
-
+ KDA_Detach_hubs();
NOTE("DETACHED");
}
+static void free_contacts();
+
void
cmpi_shutdown()
{
- KDA_Shutdown();
+ KDA_Shutdown(contacts);
+ free_contacts();
}
+void
+free_contacts()
+{
+ list_destroy(contacts);
+}
Modified: src/kda-2/conn-A.c
===================================================================
--- src/kda-2/conn-A.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/kda-2/conn-A.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -1,5 +1,7 @@
#include "kda_conn-A.h"
+#include "kda_neighbor-2.h"
+#include "cmpi_mode.h"
/**
Maps KDA_IDs to ints.
@@ -10,6 +12,7 @@
void
KDA_Init_conn()
{
+ NOTE_F;
// Add self to world_ranks...
world_ranks = hashtable_create(mpi_size);
int* heap_mpi_rank = malloc(sizeof(int));
@@ -21,7 +24,7 @@
MPIRPC_Register("get_id", handle_get_id);
MPIRPC_Register("get_rank", handle_get_rank);
- sleep(mpi_rank * 10);
+ sleep(mpi_rank * 3);
if (mpi_rank > 0)
{
@@ -32,85 +35,76 @@
char* result = MPIRPC_Block(node, "get_id", NULL);
KDA_ID other_id;
sscanf(result, "%X", &other_id);
+ free(result);
KDA_Join(other_id, other_rank);
}
+ /*
+ int client =
+ cmpi_mode_first_client(mpi_rank, mpi_size, kda_nodes);
+ SHOW_I(client);
+ int msg = -2;
+ // MPI_Send(&msg, 1, MPI_INT, client, 0, MPI_COMM_WORLD);
+*/
listen_loop();
}
/**
- Attach
+ Form client->node connections
*/
-MPIRPC_Node*
-KDA_Attach()
-{
- int other_rank = rand_lt(mpi_rank);
- MPIRPC_Node node;
- MPIRPC_Node_make(MPI_COMM_WORLD, other_rank, &node);
- char* result = MPIRPC_Block(node, "get_id", NULL);
- KDA_ID other_id;
- sscanf(result, "%X", &other_id);
-
- char* args = malloc(20*sizeof(int));
- sprintf(args, "%X %i", KDA_ID_CLIENT, mpi_rank);
- MPIRPC_Block(node, "join", args);
-
- return NULL;
-}
-
void
-KDA_Harpoon(MPIRPC_Node reference, KDA_ID other_id)
+KDA_Attach(struct list* contacts)
{
- KDA_ID* heap_id = malloc(sizeof(KDA_ID));
- *heap_id = other_id;
- char* result = MPIRPC_Block(reference, "get_rank", xheap(other_id));
- int* other_rank = malloc(sizeof(int));
- sscanf(result, "%i", other_rank);
- hashtable_add(world_ranks, xheap(other_id), other_rank);
- KDA_Join(other_id, *other_rank);
+ NOTE_F;
+ MPIRPC_Comm_add(MPI_COMM_WORLD);
+ for (int i = 0; i < 3; i++)
+ {
+ int other_rank = rand_lt(mpi_size/2);
+ MPIRPC_Node node;
+ MPIRPC_Node_make(MPI_COMM_WORLD, other_rank, &node);
+ char* result = MPIRPC_Block(node, "get_id", NULL);
+ NOTE("got id");
+ KDA_ID other_id;
+ sscanf(result, "%X", &other_id);
+ free(result);
+ KDA_Neighbor* neighbor = KDA_Neighbor_create_id(other_id, node);
+ if (list_add_unique(contacts, KDA_Neighbor_cmp, neighbor))
+ NOTE_XI("added neighbor: ", other_id, neighbor->node.comm);
+ else
+ free(neighbor);
+ }
}
+/**
+ Form node->node connections
+
+*/
void
KDA_Join(int other_id, int other_rank)
{
- MPIRPC_Node node1, node2;
- MPIRPC_Node_make(MPI_COMM_WORLD, other_rank, &node1);
- char* args = malloc(20*sizeof(int));
+ MPIRPC_Node other_node;
+ MPIRPC_Node_make(MPI_COMM_WORLD, other_rank, &other_node);
+ char args[64];
sprintf(args, "%X %i", id, mpi_rank);
- MPIRPC_Block(node1, "join", args);
+ MPIRPC_Block(other_node, "join", args);
- MPI_Comm newcomm = KDA_Comm_create(&other_rank);
- MPIRPC_Node_make(newcomm, 0, &node2);
- KDA_ID kda_id = (KDA_ID) other_id;
- KDA_Neighbor* neighbor = KDA_Neighbor_create_id(other_id, node2);
+ KDA_Neighbor* neighbor = KDA_Neighbor_create_id(other_id, other_node);
neighbor_add(neighbor);
}
-MPI_Comm
-KDA_Comm_create(int* other_rank)
-{
- MPI_Group world_group, newgroup;
- MPI_Comm newcomm;
- MPI_Comm_group(MPI_COMM_WORLD, &world_group);
- MPI_Group_incl(world_group, 1, other_rank, &newgroup);
- MPI_Comm_create(MPI_COMM_WORLD, newgroup, &newcomm);
- MPIRPC_Comm_add(newcomm);
- return newcomm;
-}
-
void
-handle_join(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length)
+handle_join(MPIRPC_Node caller, int unique, char* args,
+ char* blob, int blob_length)
{
+ SHOW_FI(caller.rank);
KDA_ID other_id;
- int* other_rank = malloc(sizeof(int));
+ int* other_rank = malloc(sizeof(int));
sscanf(args, "%X %i", &other_id, other_rank);
- MPI_Comm newcomm = KDA_Comm_create(other_rank);
-
if (other_id != KDA_ID_CLIENT)
{
MPIRPC_Node node;
- MPIRPC_Node_make(newcomm, 0, &node);
+ MPIRPC_Node_make(caller.comm, caller.rank, &node);
KDA_Neighbor* neighbor = KDA_Neighbor_create_id(other_id, node);
neighbor_add(neighbor);
hashtable_add(world_ranks, xheap(other_id), other_rank);
@@ -119,19 +113,18 @@
MPIRPC_Null(caller, unique);
}
-void
-handle_get_rank(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length)
+MPIRPC_Handler(handle_get_rank)
{
int* other_rank = (int*) hashtable_search(world_ranks, args);
- char* result = malloc(10*sizeof(char));
+ char* result = malloc(16*sizeof(char));
int length = sprintf(result, "%i", *other_rank);
MPIRPC_Return(caller, unique, result, length+1);
}
-void
-handle_get_id(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length)
+MPIRPC_Handler(handle_get_id)
{
- char* result = malloc(10*sizeof(char));
+ SHOW_FI(caller.rank);
+ char* result = malloc(16*sizeof(char));
int length = sprintf(result, "%X", id);
MPIRPC_Return(caller, unique, result, length+1);
}
@@ -141,5 +134,6 @@
{}
void
-KDA_Shutdown()
+KDA_Detach_hubs()
{}
+
Modified: src/kda-2/conn-B.c
===================================================================
--- src/kda-2/conn-B.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/kda-2/conn-B.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -15,6 +15,12 @@
//// Internal prototypes
int thirdhash(char* s);
+/**
+ List of MPIRPC_Node hubs.
+*/
+// struct list* hubs;
+
+
void
KDA_Init_conn()
{
@@ -38,6 +44,8 @@
KDA_Hub_init();
KDA_Hub_loop();
}
+
+ // hubs = list_create();
}
void
@@ -490,3 +498,13 @@
MPIRPC_Close(channel);
}
+void
+KDA_Detach_hubs()
+{
+ while (hubs->size > 0)
+ {
+ MPIRPC_Node* hub = (MPIRPC_Node*) list_poll(hubs);
+ KDA_Detach(*hub);
+ free(hub);
+ }
+}
Modified: src/kda-2/kademlia.c
===================================================================
--- src/kda-2/kademlia.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/kda-2/kademlia.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -21,11 +21,6 @@
*/
struct list* clients;
-/**
- List of MPIRPC_Node hubs.
-*/
-struct list* hubs;
-
MPI_Request request;
/**
@@ -95,8 +90,8 @@
char* buckets_tostring(void);
static KDA_ID make_id(int salt);
-static char* id_tostring(void);
-static void bootstrap(MPIRPC_Node node);
+// static char* id_tostring(void);
+// static void bootstrap(MPIRPC_Node node);
int KDA_Neighbor_table_size(void);
@@ -106,33 +101,30 @@
Generate info string for debugging
*/
void handle_info(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
+ void* blob, int blob_length);
void handle_join(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
+ void* blob, int blob_length);
void handle_link(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
+ void* blob, int blob_length);
void handle_find_node(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
+ void* blob, int blob_length);
void handle_neighbor(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
+ void* blob, int blob_length);
void handle_ping(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
+ void* blob, int blob_length);
void handle_query_id(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
+ void* blob, int blob_length);
void handle_query_id_k(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
+ void* blob, int blob_length);
void handle_store(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
+ void* blob, int blob_length);
+void handle_update(MPIRPC_Node node, int unique, char* args,
+ void* blob, int blob_length);
void handle_retrieve(MPIRPC_Node node, int unique, char* args,
- char* blob, int blob_length);
+ void* blob, int blob_length);
void handle_shutdown(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length);
+ void* blob, int blob_length);
-/* SPECIFIC TO CONN TYPE
- void handle_accept(MPIRPC_Node* caller, int unique, char* args, char* blob, int blob_length);
- void handle_connect(MPIRPC_Node* caller, int unique, char* args, char* blob, int blob_length);
-*/
-
// Synchronous methods...
struct ilist* find_node(KDA_ID id);
@@ -156,17 +148,13 @@
{
NOTE_F;
- int i;
alpha = alpha_in;
k = k_in;
- for (i = 0; i < KDA_SPACE_SIZE; i++)
+ for (int i = 0; i < KDA_SPACE_SIZE; i++)
k_bucket[i] = list_create();
operations = itable_create(CALL_TABLE_SIZE);
-
- clients = list_create();
- hubs = list_create();
}
/**
@@ -185,13 +173,16 @@
node.rank = 0;
id = make_id(debug_rank);
self = KDA_Neighbor_create_id(id, node);
- NOTE_XI("ID: ", id, id);
+ NOTE_XI("SELF: ", id, id);
port[0] = '\0';
+ clients = list_create();
+
MPIRPC_Register("info", handle_info);
// MPIRPC_Register("neighbor", handle_neighbor);
MPIRPC_Register("ping", handle_ping);
+ MPIRPC_Register("join", handle_join);
MPIRPC_Register("find_node", handle_find_node);
MPIRPC_Register("query_id", handle_query_id);
MPIRPC_Register("query_id_k", handle_query_id_k);
@@ -205,11 +196,10 @@
void
KDA_Init_client(int alpha_in, int k_in)
{
+ NOTE_F;
id = KDA_ID_CLIENT;
KDA_Data(alpha_in, k_in);
-
- KDA_Attach();
}
KDA_Neighbor*
@@ -276,8 +266,7 @@
struct ilist*
KDA_Find(KDA_ID id)
{
- KDA_Operation* op =
- KDA_Operate(id, NULL, NULL, NULL, NULL);
+ KDA_Operation* op = KDA_Operate(id, NULL, NULL, NULL, NULL);
KDA_Wait(op);
return op->k_closest;
}
@@ -302,8 +291,6 @@
struct ilist*
KDA_Closest(KDA_ID object_id)
{
- int i;
- struct list_item* item;
NOTE_FX(object_id);
struct ilist* result = ilist_create();
@@ -311,9 +298,9 @@
int d = XOR(self->id, object_id);
ilist_add(result, d, self);
- for (i = 0; i < KDA_SPACE_SIZE; i++)
+ for (int i = 0; i < KDA_SPACE_SIZE; i++)
{
- for (item = k_bucket[i]->head;
+ for (struct list_item* item = k_bucket[i]->head;
item; item = item->next)
{
KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
@@ -420,7 +407,7 @@
{
NOTE_FX(id);
MPIRPC* rpc =
- MPIRPC_Call(node, heap("query_id_k"), iheap(id),
+ MPIRPC_Call(node, "query_id_k", iheap(id),
NULL, MPIRPC_PROCEED_NULL);
return rpc;
}
@@ -433,7 +420,7 @@
{
NOTE_F;
- return MPIRPC_Call(node, heap("query_id"), xheap(id), NULL, NULL);
+ return MPIRPC_Call(node, "query_id", xheap(id), NULL, NULL);
}
/**
@@ -458,10 +445,25 @@
KDA_Retrieve(KDA_Neighbor* neighbor, char* key)
{
NOTE_F;
- return MPIRPC_Call(neighbor->node, heap("retrieve"), key,
+ return MPIRPC_Call(neighbor->node, "retrieve", key,
NULL, MPIRPC_PROCEED_NULL);
}
+MPIRPC*
+KDA_Update(KDA_Neighbor* neighbor, char* key, char* value,
+ int length, int offset)
+{
+ SHOW_FSI(key, length);
+
+ char args[MPIRPC_MAX_ARGS];
+ sprintf(args, "%s %i", key, offset);
+
+ MPIRPC* rpc =
+ MPIRPC_Call_blob(neighbor->node, "update", args,
+ value, length, NULL, MPIRPC_PROCEED_NULL);
+ return rpc;
+}
+
KDA_Query*
query_create(MPIRPC_Node caller, int unique,
void (*service)(KDA_Operation* op))
@@ -485,7 +487,7 @@
void
handle_info(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+ void* blob, int blob_length)
{
// NOTE_F;
char* result = buckets_tostring();
@@ -500,7 +502,7 @@
*/
void
handle_store(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+ void* blob, int blob_length)
{
NOTE_S("store: ", args);
cmpi_cached_store(args, blob, blob_length);
@@ -509,6 +511,24 @@
MPIRPC_Null(caller, unique);
}
+void
+handle_update(MPIRPC_Node caller, int unique, char* args,
+ void* blob, int blob_length)
+{
+ char* key = malloc(strlen(args)+1);
+
+ SHOW_FSI(args, blob_length);
+
+ int offset;
+ int n = sscanf(args, "%s %i", key, &offset);
+ assert(n == 2);
+
+ cmpi_cached_update(key, blob, offset, blob_length);
+ // DEBUG(lru_table_printdata("%s", cmpi_cache));
+
+ MPIRPC_Null(caller, unique);
+}
+
/**
Obtain value given key.
@param args The key
@@ -516,7 +536,7 @@
*/
void
handle_retrieve(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+ void* blob, int blob_length)
{
NOTE_FS(args);
DEBUG(lru_table_printf("%s", cmpi_cache));
@@ -531,7 +551,7 @@
void
handle_shutdown(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+ void* blob, int blob_length)
{
NOTE_F;
cmpi_quitting = true;
@@ -548,7 +568,7 @@
void
handle_find_node(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+ void* blob, int blob_length)
{
struct ilist_item* item;
NOTE_FS(args);
@@ -573,7 +593,7 @@
void
handle_query_id(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+ void* blob, int blob_length)
{
int object_id;
sscanf(args, "%X", &object_id);
@@ -600,7 +620,7 @@
void
handle_query_id_k(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+ void* blob, int blob_length)
{
int object_id;
sscanf(args, "%X", &object_id);
@@ -690,8 +710,7 @@
p += n;
struct list* neighbors = KDA_Neighbor_node_list(p);
- for (item = neighbors->head;
- item; item = item->next)
+ for (item = neighbors->head; item; item = item->next)
{
KDA_Neighbor* neighbor = (KDA_Neighbor*) item->data;
neighbor = check_neighbor(rpc->target, neighbor);
@@ -768,7 +787,7 @@
KDA_Neighbor* result;
if (neighbor_add(neighbor))
- KDA_Harpoon(node, neighbor->id);
+ KDA_Join(neighbor->id, node.rank);
result = neighbor_lookup(neighbor);
return result;
@@ -879,7 +898,7 @@
KDA_Operation* op = (KDA_Operation*) rpc->extras;
list_add(op->returned, target);
- dump_buckets();
+ DEBUG(dump_buckets());
// TODO: Deallocate op and rpc
// if (mpi_rank == mpi_size-1) NOTE("Highest rank ping completed.");
@@ -922,7 +941,7 @@
list_ordered_insert(k_bucket[i], KDA_Neighbor_time_cmp, (void*) n);
NOTE("After insert: ");
- dump_buckets();
+ DEBUG(dump_buckets());
return true;
}
@@ -961,11 +980,15 @@
*/
void
handle_ping(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+ void* blob, int blob_length)
{
MPIRPC_Null(caller, unique);
}
+static void loop_work();
+static void shutdown_others();
+static void shutdown_loop();
+
void
listen_loop(void)
{
@@ -973,18 +996,54 @@
while (! cmpi_quitting)
{
- // NOTE("check");
- if (! MPIRPC_Check())
+ NOTE("loop");
+ loop_work();
+ }
+ shutdown_others();
+ shutdown_loop();
+ DONE;
+}
+
+static void
+loop_work()
+{
+ if (! MPIRPC_Check())
+ {
+ MPIRPC_Snooze();
+ MPIRPC_Flush_returns();
+ }
+ else
+ {
+ MPIRPC_Snooze_reset();
+ }
+}
+
+static void
+shutdown_others()
+{
+ NOTE_F;
+ DEBUG(dump_buckets());
+ for (int i = 0; i < KDA_SPACE_SIZE; i++)
+ for (struct list_item* item = k_bucket[i]->head; item;
+ item = item->next)
{
- MPIRPC_Snooze();
+ KDA_Neighbor* neighbor = item->data;
+ char* string = KDA_Neighbor_name(neighbor);
+ MPIRPC_Block(neighbor->node, "shutdown", NULL);
}
- else
- {
- MPIRPC_Snooze_reset();
- }
- }
+ DONE;
}
+static void
+shutdown_loop()
+{
+ NOTE_F;
+ time_t start = time(NULL);
+ while (time(NULL) - start < 2)
+ loop_work();
+ DONE;
+}
+
int KDA_Neighbor_table_size()
{
int i;
@@ -995,12 +1054,6 @@
}
char*
-id_tostring()
-{
- return KDA_id_tostring(id);
-}
-
-char*
KDA_id_tostring(KDA_ID other_id)
{
char* s_id = malloc(10*sizeof(char));
@@ -1008,6 +1061,10 @@
return s_id;
}
+/**
+ do not use this
+ @deprecated
+ */
void
dump_bucket_ids()
{
@@ -1016,38 +1073,33 @@
free(result);
}
+/*
+ do not use this
+ */
char*
bucket_ids_tostring()
{
- int i;
- struct list_item* item;
// NOTE_F;
char* result =
(char*) malloc(sizeof(char)*KDA_SPACE_SIZE*k*20);
- char* p = result;
- char* neighbor = NULL;
- bool bucket_named;
-
+ char* p = result;
p += sprintf(p, "Neighbor table for: %X \n", id);
- for (i = 0; i < KDA_SPACE_SIZE; i++)
+ for (int i = 0; i < KDA_SPACE_SIZE; i++)
{
- if (k_bucket[i]->size > 0)
+ bool bucket_named = false;
+ for (struct list_item* item = k_bucket[i]->head; item;
+ item = item->next)
{
- bucket_named = false;
- for (item = k_bucket[i]->head;
- item; item = item->next)
+ if (! bucket_named)
{
- if (! bucket_named)
- {
- bucket_named = true;
- p += sprintf(p, "bucket[%i]: \n", i);
- }
- p += sprintf(p, "\t");
- if (item->data == NULL)
- NOTE("ERROR NULL");
- neighbor = KDA_Neighbor_id_tostring(item->data);
- p += sprintf(p, "%s\n", neighbor);
+ bucket_named = true;
+ p += sprintf(p, "bucket[%i]:\n", i);
}
+ p += sprintf(p, "\t");
+ assert(item->data);
+ KDA_Neighbor* neighbor = item->data;
+ char* string = KDA_Neighbor_id_tostring(neighbor);
+ p += sprintf(p, "%s (%i)\n", string, neighbor->node.rank);
}
}
return result;
@@ -1066,37 +1118,42 @@
buckets_tostring(void)
{
// NOTE_F;
-
- int i;
- struct list_item* item;
- // NOTE_F;
char* result =
(char*) malloc(sizeof(char)*KDA_SPACE_SIZE*k*200);
- char* p = result;
- char* neighbor = NULL;
- bool bucket_named;
-
+ char* p = result;
p += sprintf(p, "Neighbor table for: %X \n", id);
- for (i = 0; i < KDA_SPACE_SIZE; i++)
+ for (int i = 0; i < KDA_SPACE_SIZE; i++)
{
- if (k_bucket[i]->size > 0)
+ bool bucket_named = false;
+ for (struct list_item* item = k_bucket[i]->head; item;
+ item = item->next)
{
- bucket_named = false;
- for (item = k_bucket[i]->head;
- item; item = item->next)
+ if (! bucket_named)
{
- if (! bucket_named)
- {
- bucket_named = true;
- p += sprintf(p, "bucket[%i]: \n", i);
- }
- p += sprintf(p, "\t");
- if (item->data == NULL)
- NOTE("ERROR NULL");
- neighbor = KDA_Neighbor_tostring(item->data);
- p += sprintf(p, "%s\n", neighbor);
+ bucket_named = true;
+ p += sprintf(p, "bucket[%i]:\n", i);
}
+ p += sprintf(p, "\t");
+ KDA_Neighbor* neighbor = item->data;
+ assert(neighbor);
+ char* string = KDA_Neighbor_tostring(neighbor);
+ p += sprintf(p, "%s\n", string);
}
}
return result;
}
+
+/**
+ Client call to shut down contacts
+ */
+void
+KDA_Shutdown(struct list* contacts)
+{
+ NOTE_F;
+ for (struct list_item* item = contacts->head; item;
+ item = item->next)
+ {
+ KDA_Neighbor* neighbor = item->data;
+ MPIRPC_Block(neighbor->node, "shutdown", NULL);
+ }
+}
Modified: src/kda-2/neighbor.c
===================================================================
--- src/kda-2/neighbor.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/kda-2/neighbor.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -8,7 +8,7 @@
static char output[100];
/**
- Create a single neighbor. Uses KDA_Neighborcreate_scan().
+ Create a single neighbor. Uses KDA_Neighbor_create_scan().
*/
KDA_Neighbor*
KDA_Neighbor_create_string(char* info)
@@ -33,9 +33,9 @@
}
/**
- Scan the stream data for neighbors.
- @return The new neighbor. n contains the number of chars consumed
- from data by sscanf().
+ Scan the data for neighbors.
+ @return The new neighbor. Output n containing the number of chars
+ consumed from data by sscanf().
*/
KDA_Neighbor*
KDA_Neighbor_create_scan(char* data, int* n)
@@ -194,7 +194,8 @@
MPI_Comm_get_name(neighbor->node.comm, name, &length);
}
- offset = sprintf(buffer, "[%X]@%s ", neighbor->id, name);
+ offset = sprintf(buffer, "[%X]=%i@%s ", neighbor->id,
+ neighbor->node.rank, name);
offset += strftime(buffer+offset, 99, "%F %T",
localtime(&neighbor->lastseen));
}
@@ -211,7 +212,8 @@
}
/**
- Scan the stream data for neighbors. Uses KDA_Neighborcreate_scan().
+ Scan the stream data for neighbors.
+ Uses KDA_Neighbor_create_scan().
@return A list of neighbors.
*/
struct list* KDA_Neighbor_node_list(char* data)
Modified: src/mpi_tools/mpi_tools.c
===================================================================
--- src/mpi_tools/mpi_tools.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/mpi_tools/mpi_tools.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -30,7 +30,7 @@
else
{
if (mpi_rank == 0)
- printf("Using single debug file \n");
+ DEBUG(puts("Debug to stdout"));
debug_file = stdout;
}
}
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2011-04-27 18:19:30 UTC (rev 196)
+++ src/mpirpc/mpirpc.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -17,7 +17,7 @@
/**
For MPIRPC_Check() : Irecv()...
*/
-static MPI_Request check_request = MPI_REQUEST_NULL;
+// static MPI_Request check_request = MPI_REQUEST_NULL;
/**
For MPIRPC_Check() : Irecv()...
@@ -105,7 +105,7 @@
Register a new RPC for remote access.
*/
void
-MPIRPC_Register(char* name, void (*f)(MPIRPC_Node,int,char*,char*,int))
+MPIRPC_Register(char* name, MPIRPC_Handler_pointer(f))
{
hashtable_add(portmap, name, f);
}
@@ -258,7 +258,7 @@
*/
MPIRPC*
MPIRPC_Call_blob(MPIRPC_Node target, char* name, char* args,
- char* blob, int blob_length,
+ void* blob, int blob_length,
void* extras, void (*proceed)(MPIRPC* rpc))
{
assert(target.comm != MPI_COMM_NULL);
@@ -312,16 +312,16 @@
Copied into MPIRPC.
@param args The args to send. Copied into MPIRPC.
*/
-char*
+void*
MPIRPC_Block(MPIRPC_Node target, char* name, char* args)
{
gossip_do(MASK_MPIRPC, NOTE_FS(name));
return MPIRPC_Block_blob(target, name, args, NULL, 0);
}
-char*
+void*
MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
- char* blob, int blob_length)
+ void* blob, int blob_length)
{
char* result;
gossip_do(MASK_MPIRPC, NOTE_FS(name));
@@ -364,7 +364,7 @@
MPI_Recv(&args_length, 1, MPI_INT, caller.rank,
MPIRPC_TAG_LENGTH, caller.comm, &status);
- gossip_do(MASK_MPIRPC, NOTE_FS(name));
+ gossip_do(MASK_MPIRPC, SHOW_FSI(name,caller.rank));
if (args_length > 0)
{
@@ -420,7 +420,7 @@
*/
void
MPIRPC_Return(MPIRPC_Node caller, int unique,
- char* result, int length)
+ void* result, int length)
{
gossip_do(MASK_MPIRPC, SHOW_FIII(caller.rank, unique, length));
@@ -514,6 +514,7 @@
for (item = channels->head;
item; item = item->next)
{
+ NOTE("check channel");
MPIRPC_Channel* channel = (MPIRPC_Channel*) item->data;
// char* name = MPIRPC_Comm_get_name(channel->comm);
@@ -534,6 +535,8 @@
MPIRPC_Handle(check_msg, node);
}
}
+ sleep(1);
+
return event;
}
@@ -577,8 +580,7 @@
int i;
gossip_do(MASK_MPIRPC, NOTE_F);
MPI_Status status;
- for (item = garbage_values->head;
- item; item = item->next)
+ for (item = garbage_values->head; item; item = item->next)
{
MPIRPC_Value* value = (MPIRPC_Value*) item->data;
for (i = 0; i < 3; i++)
@@ -597,7 +599,7 @@
MPIRPC_Free() or MPIRPC_Destroy() as proceed-functions.
@return rpc's result when obtained.
*/
-char*
+void*
MPIRPC_Wait(MPIRPC* rpc)
{
int unique = rpc->unique;
@@ -714,8 +716,8 @@
{
if (value->result)
{
- NOTE_S("Free result: ", value->result);
- SHOW_P(value->result);
+ // NOTE_S("Free result: ", value->result);
+ // SHOW_P(value->result);
free(value->result);
}
Modified: test/adts/test-dpkm_list.c
===================================================================
--- test/adts/test-dpkm_list.c 2011-04-27 18:19:30 UTC (rev 196)
+++ test/adts/test-dpkm_list.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -139,7 +139,7 @@
dpkm_list_printdata(L2);
printf("size: %i\n", L2->size);
- while (item = dpkm_list_poll(L2))
+ while ((item = dpkm_list_poll(L2)))
extra_key_data(item);
printf("size: %i\n", L2->size);
Modified: test/adts/test-lru_table01.c
===================================================================
--- test/adts/test-lru_table01.c 2011-04-27 18:19:30 UTC (rev 196)
+++ test/adts/test-lru_table01.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -111,7 +111,7 @@
puts("draining...");
while ((kv = lru_table_poll(table)))
{
- printf("polled: %s\n", kv->key, kv->data);
+ printf("polled: %s\n", kv->key);
printdata("", kv->data, kv->length);
keyvalue_destroy(kv);
}
Modified: test/cmpi/test-manyputs.c
===================================================================
--- test/cmpi/test-manyputs.c 2011-04-27 18:19:30 UTC (rev 196)
+++ test/cmpi/test-manyputs.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -19,7 +19,7 @@
int i;
// Obtain the number of reps to perform:
- char* s = cmpi_params_search("reps");
+ char* s = cmpi_params_get("reps");
if (s == NULL || strlen(s) == 0)
{
puts("No reps given!");
Modified: test/cmpi/test-startup.c
===================================================================
--- test/cmpi/test-startup.c 2011-04-27 18:19:30 UTC (rev 196)
+++ test/cmpi/test-startup.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -4,6 +4,8 @@
Be sure to pass -n <nodes> !
*/
+#include <unistd.h>
+
#include "test_helpers.h"
void
@@ -13,9 +15,15 @@
gossip_set_debug_mask(1, MASK_MPIRPC|MASK_DHT);
- wait_for_notification();
- notify_next();
+ puts("sleeping...");
+ sleep(4);
+ // wait_for_notification();
+ // puts("notifying...");
+ // notify_next();
+
+ puts("running...");
+
// if (mpi_rank == mpi_size-1)
cmpi_shutdown();
}
Modified: test/driver/test-cmd-sleep.c
===================================================================
--- test/driver/test-cmd-sleep.c 2011-04-27 18:19:30 UTC (rev 196)
+++ test/driver/test-cmd-sleep.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -23,7 +23,7 @@
fflush(to_cmpi);
char output[32];
t = fscanf(from_cmpi, "%s", output);
- assert(t == 0);
+ assert(t == 1);
if (!(output[0] == 'o' &&
output[1] == 'k'))
Modified: test/driver/test.zsh
===================================================================
--- test/driver/test.zsh 2011-04-27 18:19:30 UTC (rev 196)
+++ test/driver/test.zsh 2011-04-28 19:53:16 UTC (rev 197)
@@ -30,7 +30,7 @@
${LAUNCH} -n ${TOTAL} ${DRIVER} -n ${NODES} ${CMPI_OPTS} > ${OUTPUT} &
DRIVER_PID=${!}
-tools/timebomb.zsh ${$} 20 ${OUTPUT} $0 &
+tools/timebomb.zsh ${$} 30 ${OUTPUT} $0 &
BOMB_PID=${!}
sleep 3
Modified: test/mpi_tools/test-tools01.c
===================================================================
--- test/mpi_tools/test-tools01.c 2011-04-27 18:19:30 UTC (rev 196)
+++ test/mpi_tools/test-tools01.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -11,6 +11,7 @@
MPI_Init(&argc, &argv);
whoami();
+ setup_debug_file();
int i;
for (i = 0; i < 20; i++)
Modified: test/mpirpc/test-args.c
===================================================================
--- test/mpirpc/test-args.c 2011-04-27 18:19:30 UTC (rev 196)
+++ test/mpirpc/test-args.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -11,7 +11,7 @@
void
handle_test(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+ void* blob, int blob_length)
{
show_fs(args);
MPIRPC_Null(caller, unique);
@@ -25,9 +25,8 @@
MPI_Init(&argc, &argv);
MPIRPC_Init();
whoami();
+ setup_debug_file();
- dmalloc_setup();
-
MPIRPC_Comm_add(MPI_COMM_WORLD);
MPIRPC_Node neighbor;
Modified: test/mpirpc/test-blob.c
===================================================================
--- test/mpirpc/test-blob.c 2011-04-27 18:19:30 UTC (rev 196)
+++ test/mpirpc/test-blob.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -13,17 +13,20 @@
void
handle_test(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+ void* blob, int blob_length)
{
int a;
sscanf(args, "%i", &a);
printf("handle_test: %i\n", a);
- assert(blob[0] == '\n');
- assert(blob[1] == '\0');
- assert(blob[2] == '\t');
- assert(blob[3] == '\n');
+ assert(blob_length == 4);
+ char* data = (char*) blob;
+ assert(data[0] == '\n');
+ assert(data[1] == '\0');
+ assert(data[2] == '\t');
+ assert(data[3] == '\n');
+
printf("asserts ok\n");
MPIRPC_Null(caller, unique);
Modified: test/mpirpc/test-ping.c
===================================================================
--- test/mpirpc/test-ping.c 2011-04-27 18:19:30 UTC (rev 196)
+++ test/mpirpc/test-ping.c 2011-04-28 19:53:16 UTC (rev 197)
@@ -1,8 +1,7 @@
-
/**
- Simple two-processor ping pong test.
- No arguments or return values.
-*/
+ Simple two-processor ping pong test.
+ No arguments or return values.
+ */
#include <unistd.h>
@@ -12,15 +11,14 @@
#include "test_helpers.h"
-int count = 0;
+int count = 0;
bool running = true;
void
-handle_ping(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+handle_ping(MPIRPC_Node caller, int unique, char* args, void* blob,
+ int blob_length)
{
- NOTE_F;
- SHOW_S(args);
+ puts("handle_ping");
MPIRPC_Null(caller, unique);
if (++count < 3)
{
@@ -35,11 +33,10 @@
}
void
-handle_quit(MPIRPC_Node caller, int unique, char* args,
- char* blob, int blob_length)
+handle_quit(MPIRPC_Node caller, int unique, char* args, void* blob,
+ int blob_length)
{
- NOTE_F;
- SHOW_S(args);
+ puts("handle_quit");
running = false;
MPIRPC_Null(caller, unique);
}
@@ -52,12 +49,13 @@
...
[truncated message content] |
|
From: <jmw...@us...> - 2011-04-27 18:19:36
|
Revision: 196
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=196&view=rev
Author: jmwozniak
Date: 2011-04-27 18:19:30 +0000 (Wed, 27 Apr 2011)
Log Message:
-----------
Warnings fixes
Modified Paths:
--------------
test/driver/test-cmd-get.c
test/driver/test-cmd-put.c
Modified: test/driver/test-cmd-get.c
===================================================================
--- test/driver/test-cmd-get.c 2011-04-27 18:19:13 UTC (rev 195)
+++ test/driver/test-cmd-get.c 2011-04-27 18:19:30 UTC (rev 196)
@@ -50,7 +50,7 @@
// printf("read stream\n");
char* result = malloc(length*sizeof(char));
memset(result, 0, length);
- int total = stream_to_buffer(result, length, from_cmpi);
+ stream_to_buffer(result, length, from_cmpi);
if (strcmp(result, "hello"))
crash("wrong result!");
Modified: test/driver/test-cmd-put.c
===================================================================
--- test/driver/test-cmd-put.c 2011-04-27 18:19:13 UTC (rev 195)
+++ test/driver/test-cmd-put.c 2011-04-27 18:19:30 UTC (rev 196)
@@ -20,9 +20,6 @@
char* data = "hello";
- char output[32];
- int tmp;
-
accessor_put(key, data, strlen(data)+1);
return 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-27 18:19:20
|
Revision: 195
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=195&view=rev
Author: jmwozniak
Date: 2011-04-27 18:19:13 +0000 (Wed, 27 Apr 2011)
Log Message:
-----------
Improve cleanup
Modified Paths:
--------------
test/driver/module.mk.in
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2011-04-27 18:18:48 UTC (rev 194)
+++ test/driver/module.mk.in 2011-04-27 18:19:13 UTC (rev 195)
@@ -6,15 +6,18 @@
$(DIR)/test-cmd-put.c \
$(DIR)/test-cmd-get.c
-TEST_DRIVER_OBJS = $(patsubst %.c, %.o, $(TEST_DRIVER_SRC))
+TEST_DRIVER_OBJS := $(patsubst %.c, %.o, $(TEST_DRIVER_SRC))
TEST_DRIVER_OUTPUT = test/driver/test-quit.out \
test/driver/test-sleep.out \
test/driver/test-put.out \
test/driver/test-get.out
-TEST_HELPER_SRC := test/driver/test_helpers.c test/driver/test-cmd.c
-TEST_DRIVER_OBJS += $(patsubst %.c, %.o, $(TEST_HELPER_SRC))
+TEST_HELPER_SRC := test/driver/test_helpers.c \
+ test/driver/test-cmd.c \
+ test/driver/test_driver_fifo.c
+TEST_DRIVER_OBJS += $(patsubst %.c, %.o, $(TEST_HELPER_SRC))
+
TEST_SRC += $(TEST_DRIVER_SRC)
TEST_OBJS += $(TEST_DRIVER_OBJS)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-27 18:18:56
|
Revision: 194
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=194&view=rev
Author: jmwozniak
Date: 2011-04-27 18:18:48 +0000 (Wed, 27 Apr 2011)
Log Message:
-----------
Turn on -Wall
Modified Paths:
--------------
Makefile.in
Modified: Makefile.in
===================================================================
--- Makefile.in 2011-04-19 20:05:12 UTC (rev 193)
+++ Makefile.in 2011-04-27 18:18:48 UTC (rev 194)
@@ -152,7 +152,7 @@
BUILD_CFLAGS = @BUILD_CFLAGS@
BUILD_LDFLAGS = @BUILD_LDFLAGS@
# make sure the srcdir include gets included first
-CFLAGS = -std=gnu99 # @CFLAGS@ @CPPFLAGS@ # -I $(srcdir)/include
+CFLAGS = -std=gnu99 -Wall # @CFLAGS@ @CPPFLAGS@ # -I $(srcdir)/include
LDFLAGS = -L@BUILD_ABSOLUTE_TOP@/lib
ifneq ($(DISKSIM)/src,)
LDFLAGS += -L$(DISKSIM)/src
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-19 20:05:18
|
Revision: 193
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=193&view=rev
Author: jmwozniak
Date: 2011-04-19 20:05:12 +0000 (Tue, 19 Apr 2011)
Log Message:
-----------
Import from paper repo
Added Paths:
-----------
docs/manual/cluster.png
Added: docs/manual/cluster.png
===================================================================
(Binary files differ)
Property changes on: docs/manual/cluster.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 23:58:41
|
Revision: 192
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=192&view=rev
Author: jmwozniak
Date: 2011-04-15 23:58:35 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Compile fix
Modified Paths:
--------------
src/mpi_tools/mpi_tools.c
Modified: src/mpi_tools/mpi_tools.c
===================================================================
--- src/mpi_tools/mpi_tools.c 2011-04-15 23:50:08 UTC (rev 191)
+++ src/mpi_tools/mpi_tools.c 2011-04-15 23:58:35 UTC (rev 192)
@@ -164,9 +164,8 @@
if (msg == NULL)
fprintf(debug_file, "[%i] (NULL) \n", debug_rank);
else
- fprintf(debug_file, "[%i] %s \n", msg, debug_rank);
+ fprintf(debug_file, "[%i] %s \n", debug_rank, msg);
-
fflush(debug_file);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 23:50:14
|
Revision: 191
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=191&view=rev
Author: jmwozniak
Date: 2011-04-15 23:50:08 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Bug fix
Modified Paths:
--------------
src/kda-2/conn-A.c
Modified: src/kda-2/conn-A.c
===================================================================
--- src/kda-2/conn-A.c 2011-04-15 23:49:50 UTC (rev 190)
+++ src/kda-2/conn-A.c 2011-04-15 23:50:08 UTC (rev 191)
@@ -139,3 +139,7 @@
void
KDA_Detach(MPIRPC_Node node)
{}
+
+void
+KDA_Shutdown()
+{}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 23:49:56
|
Revision: 190
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=190&view=rev
Author: jmwozniak
Date: 2011-04-15 23:49:50 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Bug fix
Modified Paths:
--------------
src/kda-2/kademlia.c
Modified: src/kda-2/kademlia.c
===================================================================
--- src/kda-2/kademlia.c 2011-04-15 23:49:30 UTC (rev 189)
+++ src/kda-2/kademlia.c 2011-04-15 23:49:50 UTC (rev 190)
@@ -502,7 +502,7 @@
handle_store(MPIRPC_Node caller, int unique, char* args,
char* blob, int blob_length)
{
- NOTE_S("store: ", key);
+ NOTE_S("store: ", args);
cmpi_cached_store(args, blob, blob_length);
DEBUG(lru_table_printf("%s", cmpi_cache));
@@ -678,7 +678,7 @@
&rpc->target);
NOTE("from: ");
- NOTE(MPIRPC_Comm_get_name(rpc->target->comm));
+ NOTE(MPIRPC_Comm_get_name(rpc->target.comm));
NOTE("outstanding: ");
list_output(KDA_Neighbor_tostring, op->outstanding);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 23:49:36
|
Revision: 189
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=189&view=rev
Author: jmwozniak
Date: 2011-04-15 23:49:30 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Restore gossip output
Modified Paths:
--------------
src/mpirpc/mpirpc.c
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2011-04-15 23:48:49 UTC (rev 188)
+++ src/mpirpc/mpirpc.c 2011-04-15 23:49:30 UTC (rev 189)
@@ -315,7 +315,7 @@
char*
MPIRPC_Block(MPIRPC_Node target, char* name, char* args)
{
- //gossip_do(MASK_MPIRPC, NOTE_FS(name));
+ gossip_do(MASK_MPIRPC, NOTE_FS(name));
return MPIRPC_Block_blob(target, name, args, NULL, 0);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 23:48:55
|
Revision: 188
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=188&view=rev
Author: jmwozniak
Date: 2011-04-15 23:48:49 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Restore rank output
Modified Paths:
--------------
src/mpi_tools/mpi_tools.c
Modified: src/mpi_tools/mpi_tools.c
===================================================================
--- src/mpi_tools/mpi_tools.c 2011-04-15 23:45:28 UTC (rev 187)
+++ src/mpi_tools/mpi_tools.c 2011-04-15 23:48:49 UTC (rev 188)
@@ -162,9 +162,9 @@
note(char* msg)
{
if (msg == NULL)
- fprintf(debug_file, "(NULL) \n");
+ fprintf(debug_file, "[%i] (NULL) \n", debug_rank);
else
- fprintf(debug_file, "%s \n", msg);
+ fprintf(debug_file, "[%i] %s \n", msg, debug_rank);
fflush(debug_file);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 23:45:35
|
Revision: 187
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=187&view=rev
Author: jmwozniak
Date: 2011-04-15 23:45:28 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Minor correction
Modified Paths:
--------------
docs/manual/manual.txt
Modified: docs/manual/manual.txt
===================================================================
--- docs/manual/manual.txt 2011-04-15 21:59:44 UTC (rev 186)
+++ docs/manual/manual.txt 2011-04-15 23:45:28 UTC (rev 187)
@@ -547,7 +547,7 @@
. Setup
+
-------------------------------------------
-./setup
+./setup.sh
-------------------------------------------
. Configure
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 21:59:50
|
Revision: 186
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=186&view=rev
Author: jmwozniak
Date: 2011-04-15 21:59:44 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Document srun call
Modified Paths:
--------------
docs/manual/manual.txt
Modified: docs/manual/manual.txt
===================================================================
--- docs/manual/manual.txt 2011-04-15 21:57:40 UTC (rev 185)
+++ docs/manual/manual.txt 2011-04-15 21:59:44 UTC (rev 186)
@@ -563,3 +563,9 @@
make -j 3 test/cmpi/test-manyputs.x
-------------------------------------------
+. Run test
+256 nodes, 256 clients, 1000 insertions per client.
++
+-------------------------------------------
+srun -n 512 test/cmpi/test-manyputs.x -n 256 -p reps=1000
+-------------------------------------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 21:57:46
|
Revision: 185
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=185&view=rev
Author: jmwozniak
Date: 2011-04-15 21:57:40 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Test fix
Modified Paths:
--------------
test/cmpi/test-manyputs.c
Modified: test/cmpi/test-manyputs.c
===================================================================
--- test/cmpi/test-manyputs.c 2011-04-15 21:56:16 UTC (rev 184)
+++ test/cmpi/test-manyputs.c 2011-04-15 21:57:40 UTC (rev 185)
@@ -46,7 +46,6 @@
free(value);
}
double stop = MPI_Wtime();
- printf("TOOK: %0.3f\n", stop-start);
// sleep((mpi_size-mpi_rank)*3+10);
MPI_Barrier(cmpi_comm_clients);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 21:56:22
|
Revision: 184
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=184&view=rev
Author: jmwozniak
Date: 2011-04-15 21:56:16 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
sleep call fix
Modified Paths:
--------------
test/cmpi/test-manyputs.c
Modified: test/cmpi/test-manyputs.c
===================================================================
--- test/cmpi/test-manyputs.c 2011-04-15 21:56:00 UTC (rev 183)
+++ test/cmpi/test-manyputs.c 2011-04-15 21:56:16 UTC (rev 184)
@@ -51,7 +51,7 @@
// sleep((mpi_size-mpi_rank)*3+10);
MPI_Barrier(cmpi_comm_clients);
- sleep(1000);
+ sleep(1);
if (mpi_rank + 1 == mpi_size)
printf("TOOK: %0.3f\n", stop-start);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 21:56:06
|
Revision: 183
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=183&view=rev
Author: jmwozniak
Date: 2011-04-15 21:56:00 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Compile fix
Modified Paths:
--------------
include/kda-2.h
Modified: include/kda-2.h
===================================================================
--- include/kda-2.h 2011-04-15 21:50:44 UTC (rev 182)
+++ include/kda-2.h 2011-04-15 21:56:00 UTC (rev 183)
@@ -148,4 +148,8 @@
MPIRPC* KDA_Retrieve(KDA_Neighbor* neighbor, char* key);
+void listen_loop(void);
+
+bool neighbor_add(KDA_Neighbor* neighbor);
+
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|