Thread: [C-mpi-commits] SF.net SVN: c-mpi:[2]
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-04-19 19:54:32
|
Revision: 2
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=2&view=rev
Author: jmwozniak
Date: 2010-04-19 19:54:23 +0000 (Mon, 19 Apr 2010)
Log Message:
-----------
Whitespace cleanups, etc.
Modified Paths:
--------------
Makefile.in
configure.ac
include/gossip.h
include/kda-1.h
include/mpirpc-1.h
setup.sh
src/kda-1/kademlia.c
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-19 18:18:16 UTC (rev 1)
+++ Makefile.in 2010-04-19 19:54:23 UTC (rev 2)
@@ -293,7 +293,7 @@
$(E)echo CFLAGS: $(CFLAGS)
$(E)echo IFLAGS: $(IFLAGS)
$(E)echo LIBS: $(LIBS)
- $(E)echo DEPENDS: $(DEPENDS)
+ $(E)echo DEPENDS: $(DEPENDS)
$(E)echo OPENSSL: $(OPENSSL_LOCATION)
# $(E)echo USE_MPIRPC_1: @USE_MPIRPC_1@
# $(E)echo USE_MPIRPC_2: @USE_MPIRPC_2@
@@ -317,16 +317,12 @@
CMPI := lib/libcmpi.a
MPIRPC := lib/libmpirpc.a
CMPI_IO := lib/libcmpi-io.so
-GOBS = lib/libgobs.a
-GACK = lib/libgack.a
-SKULLFS = lib/libskullfs.a
################################################################
# Makefile includes
# this is how we pull build information from all of the project
# subdirectories, make sure to catch top level module.mk as well
DIR :=
-include module.mk
include $(MODULES)
TEST_OBJS += $(patsubst %.c, %.o, $(TEST_SRC))
@@ -377,12 +373,6 @@
mpirpc: $(MPIRPC)
-gobs: $(GOBS)
-
-gack: $(GACK)
-
-skullfs: $(SKULLFS)
-
# Just like dir, but strip the slash off the end, to be pretty.
dirname = $(patsubst %/,%,$(dir $(1)))
Modified: configure.ac
===================================================================
--- configure.ac 2010-04-19 18:18:16 UTC (rev 1)
+++ configure.ac 2010-04-19 19:54:23 UTC (rev 2)
@@ -475,7 +475,6 @@
dnl output final version of top level makefile and subdirectory
dnl makefile includes
AC_CONFIG_FILES(Makefile
-module.mk
src/gossip/module.mk
src/adts/module.mk
src/cmpi/module.mk
Modified: include/gossip.h
===================================================================
--- include/gossip.h 2010-04-19 18:18:16 UTC (rev 1)
+++ include/gossip.h 2010-04-19 19:54:23 UTC (rev 2)
@@ -37,9 +37,7 @@
#define MASK_CMPI ((uint64_t)1 << 6)
#define MASK_ARCH ((uint64_t)1 << 7)
#define MASK_STORAGE ((uint64_t)1 << 8)
-#define MASK_GUM ((uint64_t)1 << 9)
-#define MASK_GOBS ((uint64_t)1 << 10)
-#define MASK_FS ((uint64_t)1 << 11)
+#define MASK_KDA ((uint64_t)1 << 9)
#define MASK_CLIENT ((uint64_t)1 << 12)
/********************************************************************
@@ -171,7 +169,7 @@
#define gossip_do(mask, x) \
if ((gossip_debug_on) && (gossip_debug_mask & mask) && \
(gossip_facility)) \
- { x; }
+ { x; }
#endif /* GOSSIP_DISABLE_DEBUG */
Modified: include/kda-1.h
===================================================================
--- include/kda-1.h 2010-04-19 18:18:16 UTC (rev 1)
+++ include/kda-1.h 2010-04-19 19:54:23 UTC (rev 2)
@@ -2,13 +2,13 @@
#ifndef KADEMLIA_1_H
#define KADEMLIA_1_H
-#include <limits.h>
-#include <signal.h>
-#include <stdbool.h>
+#include <limits.h>
+#include <signal.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <time.h>
-#include <unistd.h>
+#include <time.h>
+#include <unistd.h>
#include <mpi.h>
@@ -16,11 +16,11 @@
#include <itable.h>
#include <list.h>
#include <ilist.h>
-#include <inlist.h>
-#include <mpi_tools.h>
+#include <inlist.h>
+#include <mpi_tools.h>
#include <mpirpc.h>
-#include <cmpi.h>
-// #include <driver.h>
+#include <cmpi.h>
+// #include <driver.h>
#ifdef DISKSIM_LOCATION
#include <disksim.h>
@@ -28,18 +28,18 @@
typedef int KDA_ID;
-#include "kda_types-1.h"
+#include "kda_types-1.h"
#include "kda_neighbor-1.h"
-#define KDA_SPACE_SIZE (sizeof(KDA_ID)*8) // 160 in paper
-#define KDA_HASH_SPACE INT_MAX //
+#define KDA_SPACE_SIZE (sizeof(KDA_ID)*8) // 160 in paper
+#define KDA_HASH_SPACE INT_MAX //
/**
KDA_ID_NULL=0 is an invalid KDA_ID used for semantic purposes.
- make_id must not create this id.
+ make_id must not create this id.
*/
-#define KDA_ID_NULL 0;
+#define KDA_ID_NULL 0;
/**
Obtain the Kademlia distance between two ids.
@@ -48,12 +48,12 @@
/**
Contains neighbors. A bucket is all neighbors of a given
- distance 2^i - 2^i+1
+ distance 2^i - 2^i+1
*/
-typedef struct list* K_BUCKET;
+typedef struct list* K_BUCKET;
-extern int kda_nodes;
-extern struct itable* operations;
+extern int kda_nodes;
+extern struct itable* operations;
void KDA_Init(int alpha_in, int k_in);
@@ -62,14 +62,14 @@
/**
Return once op->status is KDA_STATUS_COMPLETE
*/
-void KDA_Wait(KDA_Operation* op);
+void KDA_Wait(KDA_Operation* op);
//// Local API...
int KDA_Local_rank(KDA_ID other_id);
-KDA_Neighbor* KDA_Local_ID(int other_rank);
+KDA_Neighbor* KDA_Local_ID(int other_rank);
-//// Client API:
+//// Client API:
MPIRPC* KDA_Translate(int rank, KDA_ID id);
MPIRPC* KDA_Translate_k(int rank, KDA_ID id);
MPIRPC* KDA_Lookup(int rank, char* key);
@@ -79,10 +79,10 @@
MPIRPC* KDA_Update(int rank, char* key, char* value, int length, int offset);
//// In-DHT API...
-void KDA_Ping(KDA_ID other_id);
-void KDA_Announce(void);
+void KDA_Ping(KDA_ID other_id);
+void KDA_Announce(void);
struct ilist* KDA_Find_key(char* key);
-struct ilist* KDA_Find(KDA_ID object_id);
+struct ilist* KDA_Find(KDA_ID object_id);
struct ilist* KDA_Closest(KDA_ID object_id);
//// Helpers...
@@ -90,56 +90,56 @@
void (*proceed)(MPIRPC* rpc),
KDA_Query* query);
bool KDA_Find_node(KDA_Operation* op);
-bool KDA_Find_node_again(KDA_Operation* op);
+bool KDA_Find_node_again(KDA_Operation* op);
void KDA_Operation_free(KDA_Operation* op);
-char* KDA_Description(void);
-char* KDA_id_tostring(KDA_ID other_id);
+char* KDA_Description(void);
+char* KDA_id_tostring(KDA_ID other_id);
KDA_ID make_id(void);
-void join(int other_rank);
+void join(int other_rank);
char* id_tostring(void);
-void listen_loop(void);
+void listen_loop(void);
void bootstrap(int other_rank);
void bootjoin(int other_id, int other_rank);
void rpc_bootjoin(int other_rank);
-void bootping(void);
+void bootping(void);
void dump_buckets(void);
-char* bucket_usage(void);
+char* bucket_usage(void);
char* buckets_tostring(void);
-bool add_neighbor(KDA_Neighbor* neighbor);
+bool add_neighbor(KDA_Neighbor* neighbor);
//// Handlers...
-void handle_announce(int caller, int unique, char* args);
+void handle_announce(int caller, int unique, char* args);
void handle_info(int caller, int unique, char* args);
void handle_debug_tables(int caller, int unique, char* args);
-void handle_bucket_usage(int caller, int unique, char* args);
+void handle_bucket_usage(int caller, int unique, char* args);
void handle_bootjoin(int caller, int unique, char* args);
void handle_bootping(int caller, int unique, char* args);
-void handle_update(int caller, int unique, char* args);
-void handle_find_node(int caller, int unique, char* args);
+void handle_update(int caller, int unique, char* args);
+void handle_find_node(int caller, int unique, char* args);
void handle_ping(int caller, int unique, char* args);
void handle_query_id(int caller, int unique, char* args);
void handle_query_id_k(int caller, int unique, char* args);
void handle_store(int caller, int unique, char* args);
void handle_retrieve(int caller, int unique, char* args);
-void handle_quit(int caller, int unique, char* args);
+void handle_quit(int caller, int unique, char* args);
//// Synchronous methods...
-struct ilist* find_node(KDA_ID id);
+struct ilist* find_node(KDA_ID id);
-//// Asynchronous methods and return services...
+//// Asynchronous methods and return services...
void query_id(int caller, int unique, KDA_ID id);
-void return_query_id(KDA_Operation* op);
+void return_query_id(KDA_Operation* op);
void query_id_k(int caller, int unique, KDA_ID id);
-void return_query_id_k(KDA_Operation* op);
+void return_query_id_k(KDA_Operation* op);
//// Proceeds...
-void proceed_bootjoin(MPIRPC* rpc);
+void proceed_bootjoin(MPIRPC* rpc);
void proceed_find(MPIRPC* rpc);
-void proceed_ping(MPIRPC* rpc);
+void proceed_ping(MPIRPC* rpc);
-#endif
+#endif
Modified: include/mpirpc-1.h
===================================================================
--- include/mpirpc-1.h 2010-04-19 18:18:16 UTC (rev 1)
+++ include/mpirpc-1.h 2010-04-19 19:54:23 UTC (rev 2)
@@ -2,8 +2,6 @@
#ifndef MPIRPC_1_H
#define MPIRPC_1_H
-#warning
-
#define _XOPEN_SOURCE 500
#include <assert.h>
Modified: setup.sh
===================================================================
--- setup.sh 2010-04-19 18:18:16 UTC (rev 1)
+++ setup.sh 2010-04-19 19:54:23 UTC (rev 2)
@@ -1,6 +1,6 @@
#!/bin/sh
-rm -fv config.cache
+rm -fv config.cache
mkdir -p maint/config
Modified: src/kda-1/kademlia.c
===================================================================
--- src/kda-1/kademlia.c 2010-04-19 18:18:16 UTC (rev 1)
+++ src/kda-1/kademlia.c 2010-04-19 19:54:23 UTC (rev 2)
@@ -2,56 +2,56 @@
#include "kda-1.h"
#ifdef DISKSIM_LOCATION
-#endif
+#endif
/**
My kademlia ID.
- Normally represented in hex.
-*/
+ Normally represented in hex.
+*/
KDA_ID id;
/**
- The neighbor table.
+ The neighbor table.
*/
-K_BUCKET k_bucket[KDA_SPACE_SIZE];
+K_BUCKET k_bucket[KDA_SPACE_SIZE];
/**
- Outstanding KDA_Operations.
+ Outstanding KDA_Operations.
*/
-struct itable* operations;
+struct itable* operations;
/**
- Kademlia parameter alpha.
+ Kademlia parameter alpha.
*/
int alpha;
/**
Kademlia parameter k.
*/
-int k;
+int k;
/**
- Number of nodes in boot-up time original DHT.
+ Number of nodes in boot-up time original DHT.
*/
-int kda_nodes;
+int kda_nodes;
/**
ID for special sequential global operations such as
- debug dumps and shutdowns.
+ debug dumps and shutdowns.
*/
-int last_global_opid = 0;
+int last_global_opid = 0;
/**
Number of times buckets have been dumped.
- Useful for debugging only.
-*/
-int dumps = 0;
+ Useful for debugging only.
+*/
+int dumps = 0;
/**
- Self. Useful in KDA_Closest().
-*/
-KDA_Neighbor self;
-
+ Self. Useful in KDA_Closest().
+*/
+KDA_Neighbor self;
+
/**
Setup Kademlia.
Must be called after API_Init() and whoami().
@@ -59,26 +59,26 @@
void
KDA_Init(int alpha_in, int k_in)
{
- gossip_do(MASK_KDA, NOTE_F);
-
+ gossip_do(MASK_KDA, NOTE_F);
+
int i;
alpha = alpha_in;
k = k_in;
-
- id = make_id();
+
+ id = make_id();
for (i = 0; i < KDA_SPACE_SIZE; i++)
k_bucket[i] = list_create();
- operations = itable_create(CALL_TABLE_SIZE);
+ operations = itable_create(CALL_TABLE_SIZE);
gossip_do(MASK_KDA, NOTE_XI("ID: ", id, id));
- neighbor_make(id, mpi_rank, &self);
-
+ neighbor_make(id, mpi_rank, &self);
+
MPIRPC_Register("info", handle_info);
MPIRPC_Register("debug_tables", handle_debug_tables);
- MPIRPC_Register("debug_table_usage", handle_bucket_usage);
+ MPIRPC_Register("debug_table_usage", handle_bucket_usage);
MPIRPC_Register("bootjoin", handle_bootjoin);
- MPIRPC_Register("bootping", handle_bootping);
+ MPIRPC_Register("bootping", handle_bootping);
MPIRPC_Register("ping", handle_ping);
MPIRPC_Register("update", handle_update);
MPIRPC_Register("find_node", handle_find_node);
@@ -88,23 +88,23 @@
MPIRPC_Register("retrieve", handle_retrieve);
MPIRPC_Register("quit", handle_quit);
- // Initialize disksim emulator:
+ // Initialize disksim emulator:
DISKSIM(disksim_init());
if (mpi_rank == 0)
{
// NOTE("bootstrap...");
- bootstrap(1);
- listen_loop();
+ bootstrap(1);
+ listen_loop();
}
- else
+ else
{
listen_loop();
}
}
/**
- Perform a local search of the neighbor table for the id.
+ Perform a local search of the neighbor table for the id.
@return The MPI rank of the given Kademlia id or -1 if not found.
*/
int
@@ -114,25 +114,25 @@
int i = ilog2(d);
struct list_item* item;
- // printf("rank : %i \n", other_id);
- // printf("i: %i \n", i);
-
+ // printf("rank : %i \n", other_id);
+ // printf("i: %i \n", i);
+
for (item = k_bucket[i]->head;
item->next; item = item->next)
{
if (((KDA_Neighbor*) item->data)->id == other_id)
- return ((KDA_Neighbor*) item->data)->rank;
+ return ((KDA_Neighbor*) item->data)->rank;
}
-
- return -1;
+
+ return -1;
}
/**
- Perform a local search of the neighbor table for the MPI rank.
- @return The Kademlia neighbor with the given rank.
+ Perform a local search of the neighbor table for the MPI rank.
+ @return The Kademlia neighbor with the given rank.
*/
KDA_Neighbor*
-KDA_Local_neighbor(int other_rank)
+KDA_Local_neighbor(int other_rank)
{
int i;
struct list_item* item;
@@ -143,22 +143,22 @@
{
KDA_Neighbor* n = (KDA_Neighbor*) item->data;
if (n->rank == other_rank)
- return n;
+ return n;
}
}
- return NULL;
+ return NULL;
}
/**
Use DHT to synchronously find the given key.
*/
-struct ilist*
+struct ilist*
KDA_Find_key(char* key)
{
NOTE_F;
-
+
int id = hash_string(key, KDA_HASH_SPACE);
- return KDA_Find(id);
+ return KDA_Find(id);
}
/**
@@ -167,25 +167,25 @@
struct ilist*
KDA_Find(KDA_ID id)
{
- KDA_Operation* op =
+ KDA_Operation* op =
KDA_Operate(id, NULL, NULL, NULL, NULL);
- KDA_Wait(op);
- return op->k_closest;
+ KDA_Wait(op);
+ return op->k_closest;
}
void
KDA_Wait(KDA_Operation* op)
{
- MPIRPC_Snooze_reset();
+ MPIRPC_Snooze_reset();
while (op->status != KDA_STATUS_COMPLETE)
{
if (MPIRPC_Check())
MPIRPC_Snooze_reset();
else
- MPIRPC_Snooze();
+ MPIRPC_Snooze();
}
}
-
+
/**
ordered local closest node lookup
@return k neighbors in a list
@@ -193,11 +193,11 @@
struct ilist*
KDA_Closest(KDA_ID object_id)
{
- gossip_do(MASK_KDA, NOTE_FX(object_id));
+ gossip_do(MASK_KDA, NOTE_FX(object_id));
struct ilist* result = ilist_create();
int d;
- d = XOR(id, object_id);
- ilist_add(result, d, neighbor_clone(&self));
+ d = XOR(id, object_id);
+ ilist_add(result, d, neighbor_clone(&self));
int i;
struct list_item* item;
for (i = 0; i < KDA_SPACE_SIZE; i++)
@@ -208,38 +208,38 @@
d = XOR(neighbor->id, object_id);
if (result->size < k)
{
- // DEBUG(ilist_fdumpkeys(debug_file, result));
+ // DEBUG(ilist_fdumpkeys(debug_file, result));
ilist_ordered_insert(result, d, neighbor_clone(neighbor));
- // DEBUG(ilist_fdumpkeys(debug_file, result));
- // DEBUG(char* s = ilist_serialize_ptrs(result);NOTE(s);free(s););
+ // DEBUG(ilist_fdumpkeys(debug_file, result));
+ // DEBUG(char* s = ilist_serialize_ptrs(result);NOTE(s);free(s););
}
else if (d < result->tail->key)
{
- KDA_Neighbor* victim = ilist_pop(result);
- // NOTE_I("POPPED: ", victim->rank);
+ KDA_Neighbor* victim = ilist_pop(result);
+ // NOTE_I("POPPED: ", victim->rank);
ilist_ordered_insert(result, d, neighbor_clone(neighbor));
- // SHOW_P(victim);
- free(victim);
+ // SHOW_P(victim);
+ free(victim);
}
}
}
- // DEBUG(char* s = ilist_serialize_ptrs(result);NOTE(s);free(s););
- return result;
+ // DEBUG(char* s = ilist_serialize_ptrs(result);NOTE(s);free(s););
+ return result;
}
/**
- Query node at rank for key location.
+ Query node at rank for key location.
*/
MPIRPC*
KDA_Lookup(int rank, char* key)
{
- gossip_do(MASK_KDA, NOTE_F);
-
+ gossip_do(MASK_KDA, NOTE_F);
+
KDA_ID object_id = hash_string(key, KDA_HASH_SPACE);
- // printf("id: %i \n", object_id);
-
- return KDA_Translate(rank, object_id);
+ // printf("id: %i \n", object_id);
+
+ return KDA_Translate(rank, object_id);
}
/**
@@ -248,11 +248,11 @@
MPIRPC*
KDA_Lookup_k(int rank, char* key)
{
- KDA_ID object_id = SHA1_mod(key);
- gossip_do(MASK_KDA, SHOW_FIS_X(rank, key, object_id));
- // NOTE_SXI("TRANSLATE: ", key, object_id, object_id);
-
- return KDA_Translate_k(rank, object_id);
+ KDA_ID object_id = SHA1_mod(key);
+ gossip_do(MASK_KDA, SHOW_FIS_X(rank, key, object_id));
+ // NOTE_SXI("TRANSLATE: ", key, object_id, object_id);
+
+ return KDA_Translate_k(rank, object_id);
}
/**
@@ -276,11 +276,11 @@
// NOTE_F;
#ifdef ENABLE_TEST01
- if (cmpi_status == CMPI_STATUS_READY)
+ if (cmpi_status == CMPI_STATUS_READY)
printf("[%i] MPIRPC_Call(query_id_k)\n", debug_rank);
#endif
-
+
MPIRPC* rpc =
MPIRPC_Call(rank, heap("query_id_k"), xheap(id),
NULL, MPIRPC_PROCEED_NULL);
@@ -289,32 +289,32 @@
/**
Instruct a node to store a value.
- Asynchronous. Copies key and value into MPIRPC.
+ Asynchronous. Copies key and value into MPIRPC.
*/
MPIRPC*
KDA_Store(int rank, char* key, char* value)
{
gossip_do(MASK_KDA, NOTE_F);
- int klength = strlen(key);
- int vlength = strlen(value);
+ int klength = strlen(key);
+ int vlength = strlen(value);
char* args = malloc((klength+vlength+5)*sizeof(char));
- assert(args);
+ assert(args);
strcpy(args, key);
- args[klength] = ' ';
+ args[klength] = ' ';
strcpy(args+klength+1, value);
#ifdef ENABLE_TEST01
- if (cmpi_status == CMPI_STATUS_READY)
+ if (cmpi_status == CMPI_STATUS_READY)
printf("[%i] MPIRPC_Call(store)\n", debug_rank);
#endif
-
+
MPIRPC* rpc = MPIRPC_Call(rank, heap("store"), args,
NULL, MPIRPC_PROCEED_NULL);
- return rpc;
+ return rpc;
}
/**
- Instruct a node to retrieve a value.
+ Instruct a node to retrieve a value.
*/
MPIRPC*
KDA_Retrieve(int rank, char* key)
@@ -322,38 +322,38 @@
MPIRPC* rpc =
MPIRPC_Call(rank, heap("retrieve"), heap(key),
NULL, MPIRPC_PROCEED_NULL);
- return rpc;
+ return rpc;
}
/**
Instruct a node to update a value.
- Asynchronous. Copies key and value into MPIRPC.
+ Asynchronous. Copies key and value into MPIRPC.
*/
MPIRPC*
-KDA_Update(int rank, char* key, char* value, int length)
+KDA_Update(int rank, char* key, char* value, int length, int offset)
{
gossip_do(MASK_KDA, NOTE_F);
- int klength = strlen(key);
- int vlength = strlen(value);
+ int klength = strlen(key);
+ int vlength = strlen(value);
char* args = malloc((klength+vlength+15)*sizeof(char));
- assert(args);
+ assert(args);
sprintf(args, "%s %i %s", key, length, value);
MPIRPC* rpc = MPIRPC_Call(rank, heap("update"), args,
NULL, MPIRPC_PROCEED_NULL);
- return rpc;
+ return rpc;
}
KDA_Query*
query_create(int caller, int unique,
- void (*service)(KDA_Operation* op))
+ void (*service)(KDA_Operation* op))
{
- // NOTE_F;
+ // NOTE_F;
KDA_Query* query = malloc(sizeof(KDA_Query));
query->caller = caller;
query->unique = unique;
- query->service = service;
- return query;
+ query->service = service;
+ return query;
}
/**
@@ -362,27 +362,27 @@
void
handle_info(int caller, int unique, char* args)
{
- gossip_do(MASK_KDA, NOTE_F);
+ gossip_do(MASK_KDA, NOTE_F);
char* result = buckets_tostring();
- MPIRPC_Return(caller, unique, result);
+ MPIRPC_Return(caller, unique, result);
}
void
handle_store(int caller, int unique, char* args)
{
#ifdef ENABLE_TEST03
- SHOW_FS(args);
+ SHOW_FS(args);
#else
char* key = malloc(CMPI_KEY_LENGTH * sizeof(char));
char* value = malloc(CMPI_VALUE_LENGTH * sizeof(char));
- sscanf(args, "%s %s", key, value);
+ sscanf(args, "%s %s", key, value);
gossip_do(MASK_KDA, SHOW_FSS(key, value));
cmpi_cached_store(key, value);
#endif
- MPIRPC_Return(caller, unique, NULL);
+ MPIRPC_Return(caller, unique, NULL);
}
void
@@ -390,26 +390,26 @@
{
gossip_do(MASK_KDA, NOTE_FS(args));
- char* data;
- cmpi_cached_retrieve(args, &data);
- // SHOW_S(data);
- MPIRPC_Return(caller, unique, heap(data));
+ char* data;
+ cmpi_cached_retrieve(args, &data);
+ // SHOW_S(data);
+ MPIRPC_Return(caller, unique, heap(data));
}
void
handle_update(int caller, int unique, char* args)
{
- gossip_do(MASK_KDA, SHOW_FS(args));
+ gossip_do(MASK_KDA, SHOW_FS(args));
char* key = malloc(CMPI_KEY_LENGTH * sizeof(char));
char* value = malloc(CMPI_VALUE_LENGTH * sizeof(char));
- int offset;
+ int offset;
- sscanf(args, "%s %i %s", key, &offset, value);
+ sscanf(args, "%s %i %s", key, &offset, value);
gossip_do(MASK_KDA, SHOW_FSSI(key, value, offset));
cmpi_cached_update(key, value, offset);
- MPIRPC_Return(caller, unique, NULL);
+ MPIRPC_Return(caller, unique, NULL);
}
void
@@ -418,17 +418,17 @@
gossip_do(MASK_KDA, NOTE_F);
/*
- // We can rebroadcast the message.
- int opid;
+ // We can rebroadcast the message.
+ int opid;
sscanf(args, "%i", &opid);
if (opid == last_global_opid)
{
NOTE("Already processed...");
MPIRPC_Return(caller, unique, NULL);
- return;
+ return;
}
- last_global_opid = opid;
+ last_global_opid = opid;
int i;
struct list_item* item;
@@ -443,57 +443,57 @@
}
}
*/
-
+
dump_buckets();
- MPIRPC_Return(caller, unique, NULL);
+ MPIRPC_Return(caller, unique, NULL);
}
void
handle_bucket_usage(int caller, int unique, char* args)
{
gossip_do(MASK_KDA, NOTE_F);
- dumps++;
+ dumps++;
char* msg = bucket_usage();
- printf(msg);
+ printf(msg);
free(msg);
- MPIRPC_Return(caller, unique, NULL);
+ MPIRPC_Return(caller, unique, NULL);
}
void
handle_quit(int caller, int unique, char* args)
{
- int i;
-
+ int i;
+
gossip_do(MASK_KDA, NOTE_F);
KDA_Neighbor* n_caller = KDA_Local_neighbor(caller);
if (n_caller != NULL)
- n_caller->quitting = true;
-
+ n_caller->quitting = true;
+
if (cmpi_quitting)
{
NOTE("Already quitting...");
- MPIRPC_Return(caller, unique, NULL);
- return;
+ MPIRPC_Return(caller, unique, NULL);
+ return;
}
cmpi_quitting = true;
-
+
MPIRPC_Return(caller, unique, NULL);
// NOTE_I("cmpi_cache: ", cmpi_cache->size);
itable_destroy(operations);
- // NOTE("DESTROY_BUCKETS");
+ // NOTE("DESTROY_BUCKETS");
for (i = 0; i < KDA_SPACE_SIZE; i++)
{
- // SHOW_I(i);
+ // SHOW_I(i);
// list_destroy(k_bucket[i]);
}
}
void
-rpc_find_node(int other_rank, KDA_Operation* op)
+rpc_find_node(int other_rank, KDA_Operation* op)
{
#ifdef ENABLE_TEST01
if (cmpi_status == CMPI_STATUS_READY)
@@ -502,8 +502,8 @@
fflush(stdout);
}
#endif
-
- MPIRPC_Call(other_rank, heap("find_node"), xheap(op->object_id),
+
+ MPIRPC_Call(other_rank, heap("find_node"), xheap(op->object_id),
op, proceed_find);
}
@@ -513,17 +513,17 @@
int object_id;
struct ilist_item* item;
int count = sscanf(args, "%X", &object_id);
- assert(count == 1);
+ assert(count == 1);
struct ilist* known = KDA_Closest(object_id);
char* result = malloc(1000*sizeof(char));
char* s = result;
- s += sprintf(s, "%i ", known->size);
+ s += sprintf(s, "%i ", known->size);
for (item = known->head;
item; item = item->next)
s += sprintf(s, "%s", neighbor_name(item->data));
- ilist_destroy(known);
- MPIRPC_Return(caller, unique, result);
+ ilist_destroy(known);
+ MPIRPC_Return(caller, unique, result);
}
void
@@ -534,18 +534,18 @@
query_id(caller, unique, object_id);
}
-void
+void
query_id(int caller, int unique, KDA_ID object_id)
{
- KDA_Operate(object_id, NULL, NULL, NULL,
- query_create(caller, unique, return_query_id));
+ KDA_Operate(object_id, NULL, NULL, NULL,
+ query_create(caller, unique, return_query_id));
}
void
return_query_id(KDA_Operation* op)
{
KDA_Neighbor* n = (KDA_Neighbor*) ilist_poll(op->k_closest);
- char* result = iheap(n->rank);
+ char* result = iheap(n->rank);
MPIRPC_Return(op->query->caller, op->query->unique, result);
// free op
}
@@ -558,33 +558,33 @@
query_id_k(caller, unique, object_id);
}
-void
+void
query_id_k(int caller, int unique, KDA_ID object_id)
{
- KDA_Operate(object_id, NULL, NULL, NULL,
- query_create(caller, unique, return_query_id_k));
+ KDA_Operate(object_id, NULL, NULL, NULL,
+ query_create(caller, unique, return_query_id_k));
}
void
return_query_id_k(KDA_Operation* op)
{
char* result = malloc(2048*sizeof(char));
- char* p = result;
+ char* p = result;
while (op->k_closest->size > 0)
{
KDA_Neighbor* neighbor =
(KDA_Neighbor*) ilist_poll(op->k_closest);
p += neighbor_name_sprint(p, neighbor);
- free(neighbor);
+ free(neighbor);
}
MPIRPC_Return(op->query->caller, op->query->unique, result);
- KDA_Operation_free(op);
+ KDA_Operation_free(op);
}
/**
The KDA_Operation has completed its k_closest list.
Now issue the RPC on the target nodes or
- respond to the client query.
+ respond to the client query.
*/
void
KDA_Map(KDA_Operation* op)
@@ -600,11 +600,11 @@
MPIRPC_Call(n->rank, heap(op->name), heap(op->args),
op, op->proceed);
}
- op->returned = inlist_create();
+ op->returned = inlist_create();
}
else if (op->query)
{
- op->returned = NULL;
+ op->returned = NULL;
op->query->service(op);
}
}
@@ -612,44 +612,44 @@
void
proceed_find(MPIRPC* rpc)
{
- gossip_do(MASK_KDA, NOTE_F);
-
- KDA_Operation* op = (KDA_Operation*) rpc->extras;
+ gossip_do(MASK_KDA, NOTE_F);
- // NOTE(neighbor_ranks_tostring(op->k_closest));
-
+ KDA_Operation* op = (KDA_Operation*) rpc->extras;
+
+ // NOTE(neighbor_ranks_tostring(op->k_closest));
+
if (rpc->status == MPIRPC_STATUS_FAULT)
{
- NOTE_FS("FAULT!");
+ NOTE_FS("FAULT!");
}
else
{
int size;
- char* p = rpc->result;
+ char* p = rpc->result;
sscanf(rpc->result, "%i ", &size);
p = index(rpc->result, ' ')+1;
int i;
for (i = 0; i < size; i++)
{
- int other_id;
+ int other_id;
int other_rank;
int count = sscanf(p, "[%X]@%i ", &other_id, &other_rank);
- assert(count == 2);
+ assert(count == 2);
p = index(p, ' ')+1;
KDA_Neighbor neighbor;
neighbor_make(other_id, other_rank, &neighbor);
- add_neighbor(&neighbor);
+ add_neighbor(&neighbor);
int d = XOR(other_id, op->object_id);
if (d < op->k_closest->tail->key ||
op->k_closest->size < k)
{
// NOTE_S("data: ", neighbor_name(&neighbor));
// DEBUG(ilist_fdump(debug_file, neighbor_name, op->k_closest));
- // DEBUG(char* s = ilist_serialize_ptrs(op->k_closest);NOTE(s);free(s););
+ // DEBUG(char* s = ilist_serialize_ptrs(op->k_closest);NOTE(s);free(s););
if (! ilist_matches(op->k_closest, neighbor_cmp, &neighbor))
{
KDA_Neighbor* clone = neighbor_clone(&neighbor);
- ilist_ordered_insert(op->k_closest, d, clone);
+ ilist_ordered_insert(op->k_closest, d, clone);
op->improved = true;
if (op->k_closest->size > k)
{
@@ -659,29 +659,29 @@
}
}
}
-
+
// Check for convergence:
inlist_remove(op->outstanding, rpc->target);
-
+
if (rpc->result != NULL &&
rpc->result != MPIRPC_RESULT_FAULT)
{
- // NOTE("Free result.");
+ // NOTE("Free result.");
// free(rpc->result);
}
- MPIRPC_Free(rpc);
-
+ MPIRPC_Free(rpc);
+
if (op->outstanding->size == 0)
{
if (op->improved)
{
- op->improved = false;
+ op->improved = false;
if (! KDA_Find_node_again(op))
- KDA_Map(op);
+ KDA_Map(op);
}
else
{
- KDA_Map(op);
+ KDA_Map(op);
}
}
}
@@ -694,8 +694,8 @@
{
if (op->k_closest == NULL)
op->k_closest = KDA_Closest(op->object_id);
- // printf("local closest: \n");
- // ilist_output(neighbor_tostring, op->k_closest);
+ // printf("local closest: \n");
+ // ilist_output(neighbor_tostring, op->k_closest);
return KDA_Find_node_again(op);
}
@@ -703,69 +703,69 @@
bool
KDA_Find_node_again(KDA_Operation* op)
{
- // NOTE_S("ranks: ", neighbor_ranks_tostring(op->k_closest));
-
+ // NOTE_S("ranks: ", neighbor_ranks_tostring(op->k_closest));
+
struct ilist_item* item;
- // True iff we actually issued another RPC:
- bool contacted = false;
+ // True iff we actually issued another RPC:
+ bool contacted = false;
- int i = 0;
+ int i = 0;
for (item = op->k_closest->head;
i < alpha && item; item = item->next)
{
KDA_Neighbor* n = (KDA_Neighbor*) item->data;
if (n->rank == mpi_rank)
- continue;
+ continue;
if (! inlist_contains(op->contacted, n->rank))
{
inlist_add(op->contacted, n->rank);
inlist_add(op->outstanding, n->rank);
rpc_find_node(n->rank, op);
- contacted = true;
- i++;
+ contacted = true;
+ i++;
}
}
- return contacted;
+ return contacted;
}
/**
Join DHT using rank other_rank as known member.
*/
-bool
+bool
KDA_Join(int other_rank)
{
// join(other_rank, other_id);
-
- return true;
+
+ return true;
}
/**
Locate the object_id and call its host method and args.
- Copies name but not args onto the heap.
+ Copies name but not args onto the heap.
*/
-KDA_Operation*
+KDA_Operation*
KDA_Operate(KDA_ID object_id, char* name, void* args,
void (*proceed)(MPIRPC* rpc), KDA_Query* query)
{
- gossip_do(MASK_KDA, NOTE_F);
+ gossip_do(MASK_KDA, NOTE_F);
KDA_Operation* op = malloc(sizeof(KDA_Operation));
op->object_id = object_id;
- op->unique = ++unique;...
[truncated message content] |
|
From: <jmw...@us...> - 2010-04-19 22:37:41
|
Revision: 3
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=3&view=rev
Author: jmwozniak
Date: 2010-04-19 22:37:35 +0000 (Mon, 19 Apr 2010)
Log Message:
-----------
More fixes.
Modified Paths:
--------------
src/cmpi/cmpi.c
src/dense-1/cmpi_dense.c
test/cmpi/test01.c
test/cmpi/test02.c
test/cmpi/test03.c
Modified: src/cmpi/cmpi.c
===================================================================
--- src/cmpi/cmpi.c 2010-04-19 19:54:23 UTC (rev 2)
+++ src/cmpi/cmpi.c 2010-04-19 22:37:35 UTC (rev 3)
@@ -1,42 +1,42 @@
-#include <cmpi.h>
+#include <cmpi.h>
#include <keyvalue.h>
-int cmpi_status;
+int cmpi_status;
int cmpi_cache_limit;
-struct lru_table* cmpi_cache = NULL;
+struct lru_table* cmpi_cache = NULL;
/**
- Used to store values from cmpi_impl_parameter().
+ Used to store values from cmpi_impl_parameter().
*/
-struct hashtable* cmpi_params = NULL;
+struct hashtable* cmpi_params = NULL;
int cmpi_msg_join;
-int cmpi_msg_neighbor;
-int cmpi_msg_sendnode;
-int cmpi_msg_sendkey;
+int cmpi_msg_neighbor;
+int cmpi_msg_sendnode;
+int cmpi_msg_sendkey;
int cmpi_msg_sendblob;
int cmpi_msg_lookupkey;
int cmpi_msg_getblob;
-int cmpi_msg_shutdown;
+int cmpi_msg_shutdown;
/**
True when quitting
*/
-bool cmpi_quitting = false;
+bool cmpi_quitting = false;
void
cmpi_params_init()
{
- // NOTE_F;
+ // NOTE_F;
cmpi_params = hashtable_create(10);
}
/**
- Add copy of key/value pair to cmpi_params table.
-*/
+ Add copy of key/value pair to cmpi_params table.
+*/
void
cmpi_params_add(char* key, char* value)
{
@@ -45,48 +45,48 @@
}
/**
- Returns a copy of the matching value or NULL if not found.
+ Returns a copy of the matching value or NULL if not found.
*/
-char*
+char*
cmpi_params_search(char* key)
{
char* result;
result = hashtable_search(cmpi_params, key);
if (result)
return heap(result);
- return NULL;
+ return NULL;
}
void
cmpi_basics(void)
{
- cmpi_status = CMPI_STATUS_PROTO;
-
- MPIRPC_Init();
-
+ cmpi_status = CMPI_STATUS_PROTO;
+
+ MPIRPC_Init();
+
cmpi_msg_join = CMPI_MSG_JOIN;
- cmpi_msg_neighbor = CMPI_MSG_NEIGHBOR;
- cmpi_msg_sendnode = CMPI_MSG_SENDNODE;
+ cmpi_msg_neighbor = CMPI_MSG_NEIGHBOR;
+ cmpi_msg_sendnode = CMPI_MSG_SENDNODE;
cmpi_msg_sendkey = CMPI_MSG_SENDKEY;
cmpi_msg_sendblob = CMPI_MSG_SENDBLOB;
cmpi_msg_lookupkey = CMPI_MSG_LOOKUPKEY;
cmpi_msg_getblob = CMPI_MSG_GETBLOB;
- cmpi_msg_shutdown = CMPI_MSG_SHUTDOWN;
+ cmpi_msg_shutdown = CMPI_MSG_SHUTDOWN;
}
/**
Must be called after MPI_Init()
*/
-CMPI_RETURN
+CMPI_RETURN
cmpi_init()
{
- cmpi_basics();
+ cmpi_basics();
- cmpi_cache = lru_table_create(cmpi_cache_limit, cmpi_cache_limit);
+ cmpi_cache = lru_table_create(cmpi_cache_limit, cmpi_cache_limit);
cmpi_init_impl();
-
- return 0;
+
+ return 0;
}
CMPI_RETURN
@@ -94,41 +94,41 @@
{
cmpi_basics();
cmpi_init_impl_client();
-
+
#ifdef USE_CMPI_IO
- NOTE("USING CMPI-IO \n");
+ NOTE("USING CMPI-IO \n");
cmpi_io_init();
#endif
- return CMPI_SUCCESS;
+ return CMPI_SUCCESS;
}
/**
-
+
*/
-int
+int
cmpi_cached_retrieve(char* key, char** data)
{
- int result;
+ int result;
NOTE_F;
-
+
DEBUG(lru_table_fprintf(debug_file, "%s", cmpi_cache));
struct keyvalue* found = lru_table_search(cmpi_cache, key);
if (found)
{
- printdata("found: ", found->data, found->length);
+ printdata("found: ", found->data, found->length);
*data = found->data;
- SHOW_P(*data);
+ SHOW_P(*data);
result = found->length;
- printf("length: %i\n", result);
- // free(found->key);
+ printf("length: %i\n", result);
+ // free(found->key);
// free(found);
}
else
{
result = cmpi_disk_loadpair(key, data);
-
+
if (*data != NULL)
{
struct keyvalue* kv = lru_table_add(cmpi_cache, key,
@@ -142,11 +142,11 @@
else
{
result = 0;
- *data = NULL;
+ *data = NULL;
}
}
- return result;
+ return result;
}
/**
@@ -154,20 +154,20 @@
void
cmpi_cached_store(char* key, char* data, int length)
{
- struct keyvalue* kv;
- SHOW_FS(key);
+ struct keyvalue* kv;
+ SHOW_FS(key);
kv = lru_table_add(cmpi_cache, key, data, length);
if (kv)
{
cmpi_disk_storepair(kv->key, kv->data, length);
- printf("CACHE_DROP: %s\n", kv->key);
+ printf("CACHE_DROP: %s\n", kv->key);
free(kv->key);
- free(kv);
+ free(kv);
}
}
/**
- Does not use cmpi_disk.
+ Does not use cmpi_disk.
*/
void
cmpi_cached_update(char* key, char* data, int offset, int length)
@@ -190,42 +190,42 @@
}
else
{
- lru_table_add(cmpi_cache, key, data, length);
+ lru_table_add(cmpi_cache, key, data, length);
}
}
- // DEBUG(lru_table_fprintf(debug_file, "%s", cmpi_cache));
+ // DEBUG(lru_table_fprintf(debug_file, "%s", cmpi_cache));
- DONE;
+ DONE;
}
/**
- Free up our resources.
+ Free up our resources.
*/
void
cmpi_cleanup()
{
- // NOTE_F;
+ // NOTE_F;
MPIRPC_Finalize();
- // struct keyvalue* kv;
- /*
+ // struct keyvalue* kv;
+ /*
while ((kv = lru_table_poll(cmpi_cache)))
{
;// free(kv->key);
- // free(kv);
+ // free(kv);
}
*/
// lru_table_free(cmpi_cache);
- // NOTE("free cmpi_params");
+ // NOTE("free cmpi_params");
hashtable_free(cmpi_params);
}
/**
- Free up our resources.
+ Free up our resources.
*/
void
cmpi_client_cleanup()
{
- // NOTE_F;
+ // NOTE_F;
hashtable_free(cmpi_params);
MPIRPC_Finalize();
}
Modified: src/dense-1/cmpi_dense.c
===================================================================
--- src/dense-1/cmpi_dense.c 2010-04-19 19:54:23 UTC (rev 2)
+++ src/dense-1/cmpi_dense.c 2010-04-19 22:37:35 UTC (rev 3)
@@ -1,39 +1,39 @@
-#include "cmpi_dense-1.h"
+#include "cmpi_dense-1.h"
/**
- List of node ranks to contact for DENSE routines.
+ List of node ranks to contact for DENSE routines.
*/
-struct inlist* contacts;
+struct inlist* contacts;
CMPI_RETURN
cmpi_init_impl()
{
// NOTE_F;
- DENSE_Read_params();
-
+ DENSE_Read_params();
+
DENSE_Init(3, 3);
- return CMPI_SUCCESS;
+ return CMPI_SUCCESS;
}
CMPI_RETURN
cmpi_init_impl_client()
{
int i;
- DENSE_Read_params();
+ DENSE_Read_params();
- DENSE_Init_client();
-
+ DENSE_Init_client();
+
contacts = inlist_create();
-
+
for (i = 0; i < dense_nodes; i++)
{
- gossip_debug(MASK_DHT, "contact: %i\n", i);
+ gossip_debug(MASK_DHT, "contact: %i\n", i);
inlist_add(contacts, i);
}
-
- return CMPI_SUCCESS;
+
+ return CMPI_SUCCESS;
}
CMPI_RETURN
@@ -46,44 +46,44 @@
dense_nodes = n;
}
- return CMPI_SUCCESS;
+ return CMPI_SUCCESS;
}
char*
cmpi_info(CMPI_ID key)
{
char* result = NULL;
- int i = inlist_random(contacts);
+ int i = inlist_random(contacts);
MPIRPC_Node node;
- MPIRPC_Node_make(i, MPI_COMM_WORLD, &node);
-
- result = MPIRPC_Block(node, "info", xheap(key));
+ MPIRPC_Node_make(i, MPI_COMM_WORLD, &node);
- return result;
+ result = MPIRPC_Block(node, "info", xheap(key));
+
+ return result;
}
/**
Ex-DHT search.
- @return The MPI rank closest to the given key.
+ @return The MPI rank closest to the given key.
*/
CMPI_ID
cmpi_lookup(char* key)
{
- int i = inlist_random(contacts);
-
- NOTE_FS(key);
+ int i = inlist_random(contacts);
+ NOTE_FS(key);
+
i = inlist_random(contacts);
MPIRPC_Node node;
- MPIRPC_Node_make(i, MPI_COMM_WORLD, &node);
-
- MPIRPC* rpc = DENSE_Lookup(node, key);
+ MPIRPC_Node_make(i, MPI_COMM_WORLD, &node);
+
+ MPIRPC* rpc = DENSE_Lookup(node, key);
MPIRPC_Wait(rpc);
- // printf("cmpi_lookup()@%i -> %s \n", i, rpc->result);
-
+ // printf("cmpi_lookup()@%i -> %s \n", i, rpc->result);
+
return 0;
}
@@ -98,23 +98,23 @@
MPIRPC* rpc = DENSE_Translate(node, (DENSE_ID) id);
MPIRPC_Wait(rpc);
- int result = 0;
+ int result = 0;
sscanf(rpc->result, "%X", &result);
- return result;
+ return result;
}
/**
- Blocking call.
+ Blocking call.
*/
CMPI_RETURN
cmpi_put(char* key, char* value, int length)
{
struct inlist_item* item;
- MPIRPC_Node node;
- SHOW_FS(key);
+ MPIRPC_Node node;
+ SHOW_FS(key);
int i = inlist_random(contacts);
- MPIRPC_Node_make(MPI_COMM_WORLD, i, &node);
+ MPIRPC_Node_make(MPI_COMM_WORLD, i, &node);
MPIRPC* lookup = DENSE_Lookup_k(node, key);
MPIRPC_Wait(lookup);
@@ -123,30 +123,30 @@
for (item = ranks->head;
item; item = item->next)
{
- SHOW_I(item->data);
- MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
+ SHOW_I(item->data);
+ MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
MPIRPC* rpc = DENSE_Store(node, key, value, length);
MPIRPC_Wait(rpc);
MPIRPC_Free(rpc);
}
- inlist_free(ranks);
+ inlist_free(ranks);
- DONE;
- return CMPI_SUCCESS;
+ DONE;
+ return CMPI_SUCCESS;
}
/**
- Blocking call.
+ Blocking call.
*/
CMPI_RETURN
cmpi_update(char* key, char* value, int length, int offset)
{
struct inlist_item* item;
- MPIRPC_Node node;
- SHOW_FS(key);
+ MPIRPC_Node node;
+ SHOW_FS(key);
int i = inlist_random(contacts);
- MPIRPC_Node_make(MPI_COMM_WORLD, i, &node);
+ MPIRPC_Node_make(MPI_COMM_WORLD, i, &node);
MPIRPC* lookup = DENSE_Lookup_k(node, key);
MPIRPC_Wait(lookup);
@@ -155,16 +155,16 @@
for (item = ranks->head;
item; item = item->next)
{
- SHOW_I(item->data);
- MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
+ SHOW_I(item->data);
+ MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
MPIRPC* rpc = DENSE_Update(node, key, value, length, offset);
MPIRPC_Wait(rpc);
MPIRPC_Free(rpc);
}
- inlist_free(ranks);
+ inlist_free(ranks);
- DONE;
- return CMPI_SUCCESS;
+ DONE;
+ return CMPI_SUCCESS;
}
CMPI_RETURN
@@ -174,27 +174,27 @@
MPIRPC_Node node;
NOTE_FS(key);
-
- MPIRPC_Node_make(MPI_COMM_WORLD, i, &node);
+ MPIRPC_Node_make(MPI_COMM_WORLD, i, &node);
+
MPIRPC* lookup = DENSE_Lookup_k(node, key);
MPIRPC_Wait(lookup);
- struct inlist* ranks = inlist_parse(lookup->result);
- int rank = inlist_random(ranks);
+ struct inlist* ranks = inlist_parse(lookup->result);
+ int rank = inlist_random(ranks);
inlist_free(ranks);
-
- MPIRPC_Node_make(MPI_COMM_WORLD, rank, &node);
+
+ MPIRPC_Node_make(MPI_COMM_WORLD, rank, &node);
MPIRPC* rpc = DENSE_Retrieve(node, key);
MPIRPC_Wait(rpc);
*value = rpc->result;
*length = rpc->result_length;
- SHOW_I(rpc->result_length);
-
+ SHOW_I(rpc->result_length);
+
MPIRPC_Free(rpc);
-
- DONE;
+
+ DONE;
return CMPI_SUCCESS;
}
@@ -202,15 +202,15 @@
cmpi_shutdown()
{
struct inlist_item* item;
- NOTE_F;
+ NOTE_F;
- MPIRPC_Node node;
+ MPIRPC_Node node;
for (item = contacts->head; item; item = item->next)
{
- MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
+ MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
DENSE_Shutdown(node);
}
- DONE;
+ DONE;
}
void
@@ -221,10 +221,10 @@
cmpi_debug_caches()
{
struct inlist_item* item;
- MPIRPC_Node node;
+ MPIRPC_Node node;
for (item = contacts->head; item; item = item->next)
{
- MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
+ MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
DENSE_Debug_cache(node);
}
}
@@ -232,17 +232,17 @@
void
DENSE_Read_params(void)
{
- // NOTE_F;
+ // NOTE_F;
char* nodes_msg = cmpi_params_search("nodes");
if (nodes_msg)
{
int n = sscanf(nodes_msg, "%i", &dense_nodes);
- // SHOW_I(dense_nodes);
+ // SHOW_I(dense_nodes);
assert(n == 1);
free(nodes_msg);
}
else
{
- dense_nodes = mpi_size;
+ dense_nodes = mpi_size;
}
}
Modified: test/cmpi/test01.c
===================================================================
--- test/cmpi/test01.c 2010-04-19 19:54:23 UTC (rev 2)
+++ test/cmpi/test01.c 2010-04-19 22:37:35 UTC (rev 3)
@@ -2,19 +2,19 @@
/**
Simply build DHT and shutdown.
Be sure to pass -n <nodes> !
-*/
+*/
-#include "test_helpers.h"
+#include "test_helpers.h"
void
cmpi_client_code()
{
- NOTE_F;
+ NOTE_F;
gossip_set_debug_mask(1, MASK_MPIRPC);
-
+
wait_for_notification();
- notify_next();
+ notify_next();
- cmpi_shutdown();
+ cmpi_shutdown();
}
Modified: test/cmpi/test02.c
===================================================================
--- test/cmpi/test02.c 2010-04-19 19:54:23 UTC (rev 2)
+++ test/cmpi/test02.c 2010-04-19 22:37:35 UTC (rev 3)
@@ -1,21 +1,21 @@
/**
- Assemble and debug tables.
+ Assemble and debug tables.
*/
-#include "test_helpers.h"
+#include "test_helpers.h"
void
cmpi_client_code()
{
- NOTE_F;
+ NOTE_F;
wait_for_notification();
- notify_next();
+ notify_next();
cmpi_debug_tables();
- sleep(mpi_rank);
-
- cmpi_shutdown();
+ sleep(mpi_rank);
+
+ cmpi_shutdown();
}
Modified: test/cmpi/test03.c
===================================================================
--- test/cmpi/test03.c 2010-04-19 19:54:23 UTC (rev 2)
+++ test/cmpi/test03.c 2010-04-19 22:37:35 UTC (rev 3)
@@ -1,39 +1,39 @@
/**
- Put two keys and get one of them.
+ Put two keys and get one of them.
*/
-#include "test_helpers.h"
+#include "test_helpers.h"
void
cmpi_client_code()
{
char key1[10];
- char key2[10];
+ char key2[10];
sprintf(key1, "key1_%i", mpi_rank);
sprintf(key2, "key2_%i", mpi_rank);
wait_for_notification();
- notify_next();
+ notify_next();
char value[30];
- strcpy(value, "value1");
- cmpi_put(key1, value, strlen(value)+1);
- strcpy(value, "value2");
+ strcpy(value, "value1");
+ cmpi_put(key1, value, strlen(value)+1);
+ strcpy(value, "value2");
cmpi_put(key2, value, strlen(value)+1);
-
+
sleep(2);
-
- cmpi_debug_caches();
- sleep(2);
-
- int length;
- char* result;
+ cmpi_debug_caches();
+
+ sleep(2);
+
+ int length;
+ char* result;
cmpi_get(key1, &result, &length);
- printf("result(%i): %s\n", result, length);
-
- sleep(3);
-
- cmpi_shutdown();
+ printf("result(%i): %s\n", result, length);
+
+ sleep(3);
+
+ cmpi_shutdown();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 20:42:09
|
Revision: 38
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=38&view=rev
Author: jmwozniak
Date: 2010-04-20 20:42:03 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Got first CMPI test working...
Modified Paths:
--------------
Makefile.in
include/gossip.h
include/mpirpc.h
src/dense-1/cmpi_dense.c
src/mpirpc/mpirpc.c
test/cmpi/module.mk.in
test/cmpi/test01.c
test/cmpi/test01.zsh
test/cmpi/test_helpers.c
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-20 19:58:22 UTC (rev 37)
+++ Makefile.in 2010-04-20 20:42:03 UTC (rev 38)
@@ -144,7 +144,7 @@
BUILD_CFLAGS = @BUILD_CFLAGS@
BUILD_LDFLAGS = @BUILD_LDFLAGS@
# make sure the srcdir include gets included first
-CFLAGS = # @CFLAGS@ @CPPFLAGS@ # -I $(srcdir)/include
+CFLAGS = -std=c99 # @CFLAGS@ @CPPFLAGS@ # -I $(srcdir)/include
LDFLAGS = -L@BUILD_ABSOLUTE_TOP@/lib
ifneq ($(DISKSIM)/src,)
LDFLAGS += -L$(DISKSIM)/src
Modified: include/gossip.h
===================================================================
--- include/gossip.h 2010-04-20 19:58:22 UTC (rev 37)
+++ include/gossip.h 2010-04-20 20:42:03 UTC (rev 38)
@@ -20,6 +20,8 @@
#ifndef __GOSSIP_H
#define __GOSSIP_H
+#define _XOPEN_SOURCE 500
+
#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2010-04-20 19:58:22 UTC (rev 37)
+++ include/mpirpc.h 2010-04-20 20:42:03 UTC (rev 38)
@@ -2,7 +2,10 @@
#ifndef MPIRPC_H
#define MPIRPC_H
+#define _XOPEN_SOURCE 500
+
#include <stdbool.h>
+#include <sys/types.h>
#include <unistd.h>
#include <cmpi-config.h>
@@ -19,7 +22,7 @@
extern int unique;
-extern useconds_t snooze_max;
+extern unsigned int snooze_max;
#define MPIRPC_MAX_NAME 128
#define MPIRPC_MAX_ARGS 256
Modified: src/dense-1/cmpi_dense.c
===================================================================
--- src/dense-1/cmpi_dense.c 2010-04-20 19:58:22 UTC (rev 37)
+++ src/dense-1/cmpi_dense.c 2010-04-20 20:42:03 UTC (rev 38)
@@ -10,6 +10,9 @@
cmpi_init_impl()
{
// NOTE_F;
+
+ gossip_debug(MASK_CMPI, "node: %i\n", mpi_rank);
+
DENSE_Read_params();
DENSE_Init(3, 3);
@@ -20,14 +23,15 @@
CMPI_RETURN
cmpi_init_impl_client()
{
- int i;
+ gossip_debug(MASK_CMPI, "client: %i\n", mpi_rank);
+
DENSE_Read_params();
DENSE_Init_client();
contacts = inlist_create();
- for (i = 0; i < dense_nodes; i++)
+ for (int i = 0; i < dense_nodes; i++)
{
gossip_debug(MASK_DHT, "contact: %i\n", i);
inlist_add(contacts, i);
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2010-04-20 19:58:22 UTC (rev 37)
+++ src/mpirpc/mpirpc.c 2010-04-20 20:42:03 UTC (rev 38)
@@ -69,7 +69,7 @@
Time in microseconds to snooze when MPIRPC_Check() finds nothing.
snooze() & reset_snooze() are called by MPIRPC_Wait().
*/
-useconds_t snooze_amount = 1;
+unsigned int snooze_amount = 1;
/**
The maximum amount of time to snooze in microseconds.
Modified: test/cmpi/module.mk.in
===================================================================
--- test/cmpi/module.mk.in 2010-04-20 19:58:22 UTC (rev 37)
+++ test/cmpi/module.mk.in 2010-04-20 20:42:03 UTC (rev 38)
@@ -15,8 +15,8 @@
ifeq (@USE_COMM_WORLD@,1)
test/cmpi/test%.out: test/cmpi/test%.x
- echo NODES: $(NODES) > $(@)
- $(LAUNCH) -n $(SIZE) $(<) -n $(NODES) -p "reps=$(REPS)" >> $(@) 2>&1
+ mpdlistjobs
+ $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
test/cmpi/test%.x: test/cmpi/test%.o test/cmpi/test_helpers.o src/cmpi/node.o $(CMPI)
$(Q) " MPICC $(@) "
Modified: test/cmpi/test01.c
===================================================================
--- test/cmpi/test01.c 2010-04-20 19:58:22 UTC (rev 37)
+++ test/cmpi/test01.c 2010-04-20 20:42:03 UTC (rev 38)
@@ -11,10 +11,11 @@
{
NOTE_F;
- gossip_set_debug_mask(1, MASK_MPIRPC);
+ gossip_set_debug_mask(1, MASK_MPIRPC|MASK_DHT);
wait_for_notification();
notify_next();
- cmpi_shutdown();
+ if (mpi_rank == mpi_size-1)
+ cmpi_shutdown();
}
Modified: test/cmpi/test01.zsh
===================================================================
--- test/cmpi/test01.zsh 2010-04-20 19:58:22 UTC (rev 37)
+++ test/cmpi/test01.zsh 2010-04-20 20:42:03 UTC (rev 38)
@@ -1,28 +1,45 @@
-#!/bin/zsh
+#!/bin/zsh
+# set -x
-N=$1
+# Be sure to make tests with D=1
-[[ ${#N} == 0 ]] && print "Need N!" && exit 1
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+shift
+LAUNCH=${*}
-make D=1 -j 3 node test/cmpi/test01.x
+crash()
+{
+ print $1
+ mv ${OUT} ${OUT}.failed
+ exit 1
+}
-source tools/helpers.zsh
+USE_COMM_WORLD=$( grep USE_COMM_WORLD cmpi-config.h | col 3 )
-USE_COMM_WORLD=$( grep USE_COMM_WORLD grayskull-config.h | col 3 )
+if (( USE_COMM_WORLD == 1 ))
+then
-if (( USE_COMM_WORLD == 1 ))
-then
+ # KDA-2A execution (3 nodes, 2 clients):
+ mpiexec -n 5 ${PROGRAM} -n 3 >& ${OUT}
+ CODE=$?
+ [[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
- # KDA-1 execution:
- mpiexec -n ${N} test/cmpi/test01.x -n $(( N-1 ))
+else
-else
+ # KDA-2B execution:
- tools/startup_nodes.zsh $(( N-1 )) 100 &
+ tools/startup_nodes.zsh $(( N-1 )) 100 &
- mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
- sleep $(( N+15 ))
+ sleep $(( N+15 ))
fi
+
+# Should be 5 "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == 5 )) || crash "N != 5"
+
+exit 0
Modified: test/cmpi/test_helpers.c
===================================================================
--- test/cmpi/test_helpers.c 2010-04-20 19:58:22 UTC (rev 37)
+++ test/cmpi/test_helpers.c 2010-04-20 20:42:03 UTC (rev 38)
@@ -1,39 +1,37 @@
-// #include <stdio.h>
+#include "test_helpers.h"
-#include "test_helpers.h"
-
/**
- Print debugging header using machine-specific information.
+ Print debugging header using machine-specific information.
*/
void
print_header(void)
{
- // Are we a SLURM job?
+ // Are we a SLURM job?
char* slurm_id = getenv("SLURM_JOBID");
if (slurm_id)
printf("SLURM_JOBID: %s\n", slurm_id);
}
-char*
-useless_data(int size)
+char*
+useless_data(int size)
{
int i;
char* s = malloc(size*sizeof(char));
for (i = 0; i < size-1; i++)
s[i] = 'a' + rand_lt(26);
- s[size-1] = '\0';
- return s;
+ s[size-1] = '\0';
+ return s;
}
void
wait_for_notification(void)
{
int tmp;
- MPI_Status status;
+ MPI_Status status;
MPI_Recv(&tmp, 1, MPI_INT,
- MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
- assert(tmp == -2);
+ MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+ assert(tmp == -2);
}
void
@@ -41,12 +39,12 @@
{
if (mpi_rank < mpi_size-1)
{
- int msg = -2;
+ int msg = -2;
MPI_Send(&msg, 1, MPI_INT,
mpi_rank+1, 0, MPI_COMM_WORLD);
}
else
{
- NOTE("NOTIFICATION_FINALIZED");
+ NOTE("NOTIFICATION_FINALIZED");
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 21:42:47
|
Revision: 63
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=63&view=rev
Author: jmwozniak
Date: 2010-04-29 21:42:41 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Final CMPI test works.
Modified Paths:
--------------
include/lru_table.h
src/adts/lru_table.c
src/cmpi/cmpi.c
src/dense-1/dense.c
src/mpi_tools/mpi_tools.c
test/cmpi/test-update02.c
Modified: include/lru_table.h
===================================================================
--- include/lru_table.h 2010-04-29 21:01:27 UTC (rev 62)
+++ include/lru_table.h 2010-04-29 21:42:41 UTC (rev 63)
@@ -9,23 +9,23 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
-#include <string.h>
+#include <string.h>
-#include <mpi_tools.h>
-#include <gossip.h>
+#include <mpi_tools.h>
+#include <gossip.h>
-// Use hash functions from hashtable.h
-#include "hashtable.h"
+// Use hash functions from hashtable.h
+#include "hashtable.h"
#include "dpkm_list.h"
-#include "keyvalue.h"
+#include "keyvalue.h"
struct lru_table
{
struct dpkm_list** array;
- struct dpkm_list* lru;
- int capacity;
+ struct dpkm_list* lru;
+ int capacity;
int size;
- int limit;
+ int limit;
};
struct lru_table* lru_table_create(int capacity, int limit);
@@ -34,18 +34,18 @@
char* key, char* data, int length);
bool lru_table_update(struct lru_table *table,
- char* key, char* data, int offset, int length);
+ char* key, char* data, int offset, int length);
struct keyvalue* lru_table_search(struct lru_table* table, char* key);
-struct keyvalue* lru_table_poll(struct lru_table* table);
+struct keyvalue* lru_table_poll(struct lru_table* table);
void lru_table_free(struct lru_table* target);
void lru_table_printf(char* format, struct lru_table* target);
-void lru_table_fprintf(FILE* file, char* format, struct lru_table* target);
+void lru_table_fprintf(FILE* file, char* format, struct lru_table* target);
+void lru_table_printdata(struct lru_table* target);
#endif
-
Modified: src/adts/lru_table.c
===================================================================
--- src/adts/lru_table.c 2010-04-29 21:01:27 UTC (rev 62)
+++ src/adts/lru_table.c 2010-04-29 21:42:41 UTC (rev 63)
@@ -83,7 +83,7 @@
struct keyvalue*
lru_table_add(struct lru_table* table, char* key, char* data, int length)
{
- // NOTE_F;
+ NOTE_FS(key);
struct keyvalue* result = NULL;
@@ -101,6 +101,7 @@
if (victim == NULL)
{
+ NOTE("no victim\n");
table->size++;
}
else
@@ -143,6 +144,7 @@
result->length = item->length;
printdata("lru found: ", item->data, item->length);
+ printf("\n");
return result;
}
@@ -190,6 +192,8 @@
DEBUG(printdata("new data: ", item->data, item->length));
+ DEBUG(lru_table_printdata(table));
+
return true;
}
@@ -319,10 +323,9 @@
*/
/**
- @param format specifies the output format for the data items
*/
void
-lru_table_printdata(char* format, struct lru_table* target)
+lru_table_printdata(struct lru_table* target)
{
int i;
printf("LRU_TABLE(%i) \n{\n", target->size);
Modified: src/cmpi/cmpi.c
===================================================================
--- src/cmpi/cmpi.c 2010-04-29 21:01:27 UTC (rev 62)
+++ src/cmpi/cmpi.c 2010-04-29 21:42:41 UTC (rev 63)
@@ -176,8 +176,11 @@
cmpi_cached_update(char* key, char* data, int offset, int length)
{
SHOW_FSII(key,offset,length);
- printdata("update: ", data, length) ;
+ printdata("update: ", data, length);
+ printf("\n");
+ DEBUG(lru_table_printdata(cmpi_cache));
+
if (lru_table_search(cmpi_cache, key))
{
lru_table_update(cmpi_cache, key, data, offset, length);
@@ -187,7 +190,7 @@
if (offset != 0)
{
char* update = malloc(offset+length);
- memset(update, ' ', offset);
+ memset(update, '\0', offset);
memcpy(update+offset, data, length);
lru_table_add(cmpi_cache, key, update, length);
}
@@ -196,7 +199,7 @@
lru_table_add(cmpi_cache, key, data, length);
}
}
- // DEBUG(lru_table_fprintf(debug_file, "%s", cmpi_cache));
+ DEBUG(lru_table_printdata(cmpi_cache));
DONE;
}
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2010-04-29 21:01:27 UTC (rev 62)
+++ src/dense-1/dense.c 2010-04-29 21:42:41 UTC (rev 63)
@@ -279,7 +279,7 @@
handle_update(MPIRPC_Node caller, int unique, char* args,
char* blob, int blob_length)
{
- char key[CMPI_KEY_LENGTH];
+ char* key = malloc(strlen(args));
int offset;
SHOW_FSI(args, blob_length);
Modified: src/mpi_tools/mpi_tools.c
===================================================================
--- src/mpi_tools/mpi_tools.c 2010-04-29 21:01:27 UTC (rev 62)
+++ src/mpi_tools/mpi_tools.c 2010-04-29 21:42:41 UTC (rev 63)
@@ -99,7 +99,7 @@
else
printf("\\%i", (int) c);
}
- printf("]\n");
+ printf("]");
}
void
Modified: test/cmpi/test-update02.c
===================================================================
--- test/cmpi/test-update02.c 2010-04-29 21:01:27 UTC (rev 62)
+++ test/cmpi/test-update02.c 2010-04-29 21:42:41 UTC (rev 63)
@@ -22,14 +22,19 @@
sprintf(value, "value1");
cmpi_update(key1, value, strlen(value)+1, 0);
+ sleep(1);
sprintf(value, "value2");
cmpi_update(key2, value, strlen(value)+1, 0);
+ sleep(1);
sprintf(value, "X");
cmpi_update(key2, value, strlen(value)+1, 3);
+ sleep(1);
sprintf(value, "value3");
cmpi_update(key3, value, strlen(value)+1, 0);
+ sleep(1);
sprintf(value, "X");
cmpi_update(key3, value, strlen(value)+1, 1);
+ sleep(1);
sprintf(value, "value1");
cmpi_update(key3, value, strlen(value)+1, 3);
@@ -41,8 +46,10 @@
int length;
cmpi_get(key1, &result, &length);
printf("RESULT_1: %s\n", result);
+ sleep(1);
cmpi_get(key2, &result, &length);
printf("RESULT_2: %s\n", result);
+ sleep(1);
cmpi_get(key3, &result, &length);
printf("RESULT_3: %s\n", result);
NOTE("GET SUCCEEDED");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-29 21:55:56
|
Revision: 64
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=64&view=rev
Author: jmwozniak
Date: 2010-04-29 21:55:50 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Whitespace fixes.
Modified Paths:
--------------
include/cmpi-cp.h
src/cmpi/accessor.c
src/cmpi/client.c
src/cmpi/driver.c
src/cmpi-cp/cmpi-cp.c
src/cmpi-db/cmpi-db-fifo-quit.c
src/cmpi-db/cmpi-db-fifo.c
src/mpi_tools/io_tools.c
test/driver/test01.c
test/driver/test01.zsh
test/driver/test02.c
Modified: include/cmpi-cp.h
===================================================================
--- include/cmpi-cp.h 2010-04-29 21:42:41 UTC (rev 63)
+++ include/cmpi-cp.h 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,8 +1,8 @@
-#include <node.h>
-#include <accessor.h>
+#include <node.h>
+#include <accessor.h>
-#include <io_tools.h>
+#include <io_tools.h>
// #define CMPI_CP_CHUNK CMPI_VALUE_LENGTH
@@ -13,10 +13,9 @@
CMPI_CP_KEY,
CMPI_CP_FILE,
CMPI_CP_STREAM,
- CMPI_CP_TYPE_ERROR,
-} CMPI_CP_TYPE;
+ CMPI_CP_TYPE_ERROR,
+} CMPI_CP_TYPE;
-void printhelp(void);
+void printhelp(void);
-#define debug(x) x
-
+#define debug(x) x
Modified: src/cmpi/accessor.c
===================================================================
--- src/cmpi/accessor.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/cmpi/accessor.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,26 +1,26 @@
-#include <accessor.h>
+#include <accessor.h>
/**
- @return True iff successfully access to fifos is made.
+ @return True iff successfully access to fifos is made.
*/
-bool
+bool
driver_access_fifo()
{
char fifo_in[20] = "/tmp/cmpi.fifo.in";
char fifo_out[20] = "/tmp/cmpi.fifo.out";
-
+
to_cmpi = fopen(fifo_in, "w");
if (to_cmpi == NULL)
{
printf("Could not open: %s \n", fifo_in);
- return false;
+ return false;
}
from_cmpi = fopen(fifo_out, "r");
if (from_cmpi == NULL)
{
printf("Could not open: %s \n", fifo_out);
- return false;
+ return false;
}
- return true;
+ return true;
}
Modified: src/cmpi/client.c
===================================================================
--- src/cmpi/client.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/cmpi/client.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,17 +1,17 @@
/**
* Participant client for CMPI.
- * Only used in multiple communicator, MPI-2 case.
+ * Only used in multiple communicator, MPI-2 case.
*
- * Command-line arguments:
+ * Command-line arguments:
*
- * -s <ms> snooze_max in milliseconds.
+ * -s <ms> snooze_max in milliseconds.
* -t <tag> symbolic tag number
- */
+ */
#include "node.h"
-int nodes;
+int nodes;
void
options(int argc, char* argv[])
@@ -21,18 +21,18 @@
{"snooze", required_argument, NULL, 's'},
{"tag", required_argument, NULL, 't'},
{"nodes", required_argument, NULL, 'n'},
- {0, 0, 0, 0}
- };
-
+ {0, 0, 0, 0}
+ };
+
int c = 0;
int t = 0;
- while ((c = getopt_long(argc, argv, "f:s:t:n:c:", options, &c)) != -1)
+ while ((c = getopt_long(argc, argv, "f:s:t:n:c:", options, &c)) != -1)
{
switch (c)
{
case 's':
sscanf(optarg, "%i", &t);
- snooze_max = t*1000;
+ snooze_max = t*1000;
// printf("Snooze max: %i \n", snooze_max);
case 't':
sscanf(optarg, "%i", &t);
@@ -41,25 +41,25 @@
sscanf(optarg, "%i", &t);
nodes = t;
}
- c++;
+ c++;
}
}
int
main(int argc, char* argv[])
{
- options(argc, argv);
-
- MPI_Init(&argc, &argv);
+ options(argc, argv);
+ MPI_Init(&argc, &argv);
+
whoami();
if (mpi_rank == 0)
timestamp("START", NULL);
- cmpi_init_client();
- cmpi_client_code();
+ cmpi_init_client();
+ cmpi_client_code();
MPI_Finalize();
- return 0;
+ return 0;
}
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/cmpi/driver.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,38 +1,38 @@
/**
* Command-line client for CMPI.
- */
+ */
#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
+#include <signal.h>
+#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <driver.h>
-char* filename = NULL;
+char* filename = NULL;
-bool driver_quitting = false;
+bool driver_quitting = false;
cmpi_driver*
driver_create(void)
{
cmpi_driver* driver = malloc(sizeof(cmpi_driver));
driver->quitting = false;
- return driver;
+ return driver;
}
-bool
+bool
driver_setup_file(cmpi_driver* driver, char* filename)
{
driver->source = fopen(filename, "r");
if (driver->source == NULL)
{
printf("Could not open: %s \n", filename);
- return false;
+ return false;
}
- return true;
+ return true;
}
bool
@@ -40,40 +40,40 @@
{
driver->source = stdin;
driver->sink = stdout;
- return true;
+ return true;
}
/**
- @return True iff the fifos were set up and opened correctly.
+ @return True iff the fifos were set up and opened correctly.
*/
bool
driver_setup_fifo(cmpi_driver* driver)
-{
+{
char fifo_in[20] = "/tmp/cmpi.fifo.in";
- char fifo_out[20] = "/tmp/cmpi.fifo.out";
+ char fifo_out[20] = "/tmp/cmpi.fifo.out";
- signal(SIGPIPE, SIG_IGN);
-
+ signal(SIGPIPE, SIG_IGN);
+
int error = mkfifo(fifo_in, S_IRUSR|S_IWUSR);
if (error != 0 &&
errno != EEXIST)
{
- printf("Could not create fifo: %s\n", fifo_in);
- return false;
+ printf("Could not create fifo: %s\n", fifo_in);
+ return false;
}
error = mkfifo(fifo_out, S_IRUSR|S_IWUSR);
if (error != 0 &&
errno != EEXIST)
{
- printf("Could not create fifo: %s\n", fifo_in);
- return false;
+ printf("Could not create fifo: %s\n", fifo_in);
+ return false;
}
driver->source = fopen(fifo_in, "r");
if (driver->source == NULL)
{
printf("Could not open: %s \n", fifo_in);
- return false;
+ return false;
}
driver->sink = fopen(fifo_out, "w");
@@ -83,7 +83,7 @@
return false;
}
- return true;
+ return true;
}
void
@@ -94,20 +94,20 @@
int length;
sscanf(tokens->head->next->next->data, "%i", &length);
- SHOW_FSI(key, length);
+ SHOW_FSI(key, length);
fprintf(driver->sink, "ok\n");
- fflush(driver->sink);
+ fflush(driver->sink);
- NOTE("reading to buffer");
+ NOTE("reading to buffer");
stream_to_buffer(value, length, driver->source);
- NOTE("got buffer");
+ NOTE("got buffer");
cmpi_put(key, value, length);
-
+
int error = fprintf(driver->sink, "ok\n");
- NOTE("said ok\n");
+ NOTE("said ok\n");
if (error == -1)
- printf("driver_put result error!\n");
- fflush(driver->sink);
+ printf("driver_put result error!\n");
+ fflush(driver->sink);
}
void
@@ -115,11 +115,11 @@
{
char* key = tokens->head->next->data;
- NOTE_FS(key);
-
+ NOTE_FS(key);
+
char* value;
int length;
- cmpi_get(key, &value, &length);
+ cmpi_get(key, &value, &length);
if (value == NULL)
{
@@ -128,11 +128,11 @@
else
{
fprintf(driver->sink, "%i\n", length);
- fflush(driver->sink);
- buffer_to_stream(value, length, driver->sink);
+ fflush(driver->sink);
+ buffer_to_stream(value, length, driver->sink);
}
fflush(driver->sink);
- DONE;
+ DONE;
}
void
@@ -140,16 +140,16 @@
{
char* p = tokens->head->next->data;
int i;
- sscanf(p, "%i", &i);
+ sscanf(p, "%i", &i);
char* result = cmpi_info(i);
- printf(result);
+ printf(result);
}
void
driver_lookup(struct list* tokens)
{
char* p = tokens->head->next->data;
- cmpi_lookup(p);
+ cmpi_lookup(p);
}
void
@@ -157,11 +157,11 @@
{
char* p = tokens->head->next->data;
int i;
- SHOW_I(i);
- sscanf(p, "%i", &i);
+ SHOW_I(i);
+ sscanf(p, "%i", &i);
sleep(i);
fprintf(driver->sink, "ok\n");
- fflush(driver->sink);
+ fflush(driver->sink);
}
void
@@ -170,54 +170,54 @@
driver->quitting = true;
fprintf(driver->sink, "ok\n");
- fflush(driver->sink);
+ fflush(driver->sink);
cmpi_shutdown();
- DONE;
+ DONE;
}
void
-driver_execute(cmpi_driver* driver)
+driver_execute(cmpi_driver* driver)
{
- SHOW_FS(driver->command);
-
- struct list* tokens = list_parse(driver->command);
-
+ SHOW_FS(driver->command);
+
+ struct list* tokens = list_parse(driver->command);
+
gossip_ldebug(MASK_DRIVER, "got tokens: \n");
- gossip_do(MASK_DRIVER, list_printf("%s", tokens));
-
+ gossip_do(MASK_DRIVER, list_printf("%s", tokens));
+
if (tokens->size == 0)
- return;
+ return;
char* optoken = tokens->head->data;
if (strncmp(optoken, "#", 1) == 0)
{
- ; // This is a comment.
+ ; // This is a comment.
}
else if (strncmp(optoken, "put", 3) == 0)
{
- driver_put(driver, tokens);
+ driver_put(driver, tokens);
}
else if (strncmp(optoken, "get", 3) == 0)
{
- driver_get(driver, tokens);
+ driver_get(driver, tokens);
}
else if (strncmp(optoken, "lookup", 6) == 0)
{
- driver_lookup(tokens);
+ driver_lookup(tokens);
}
else if (strncmp(optoken, "info", 4) == 0)
{
- driver_info(tokens);
+ driver_info(tokens);
}
else if (strncmp(optoken, "sleep", 5) == 0)
{
- printf("sleep\n");
+ printf("sleep\n");
driver_sleep(driver, tokens);
}
else if (strncmp(optoken, "quit", 4) == 0)
{
- driver_quit(driver);
+ driver_quit(driver);
}
list_destroy(tokens);
}
@@ -226,23 +226,23 @@
driver_process(cmpi_driver* driver)
{
gossip_ldebug(MASK_DRIVER, "driver_process()...\n");
- while (! driver->quitting)
+ while (! driver->quitting)
{
char* result =
fgets(driver->command, CMPI_DRIVER_MAX_COMMAND, driver->source);
if (!result)
{
- gossip_ldebug(MASK_DRIVER, "Resetting driver...\n");
+ gossip_ldebug(MASK_DRIVER, "Resetting driver...\n");
fclose(driver->source);
fclose(driver->sink);
- driver_setup_fifo(driver);
+ driver_setup_fifo(driver);
continue;
}
char* s = strchr(driver->command, '\n');
- *s = '\0';
+ *s = '\0';
driver_execute(driver);
}
- gossip_ldebug(MASK_DRIVER, "Closing driver...\n");
+ gossip_ldebug(MASK_DRIVER, "Closing driver...\n");
fclose(driver->source);
fclose(driver->sink);
}
@@ -257,13 +257,11 @@
printf("file error: %s \n", filename);
return;
}
-
+
for (i = 1; i < mpi_size; i++)
{
char* t = cmpi_info(i);
- fprintf(f, "%s\n", t);
+ fprintf(f, "%s\n", t);
}
- fclose(f);
+ fclose(f);
}
-
-
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/cmpi-cp/cmpi-cp.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,10 +1,10 @@
-#include <cmpi-cp.h>
+#include <cmpi-cp.h>
char* target1;
char* target2;
-int value_size;
+int value_size;
void
cmpi_cp_args(int argc, char* argv[])
@@ -12,10 +12,10 @@
if (argc == 1)
{
printhelp();
- exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
target1 = argv[1];
- target2 = argv[2];
+ target2 = argv[2];
}
void
@@ -23,7 +23,7 @@
{
printf("usage: cmpi [OPTION] target1 target2 \n");
printf(" each target is a file path \n");
- printf(" or a standard stream - \n");
+ printf(" or a standard stream - \n");
printf(" or a DHT key formatted as dht://<key> \n\n");
printf("options: \n");
printf(" -h print this message \n");
@@ -32,12 +32,12 @@
}
/**
- Determine the type of this target, file or key.
+ Determine the type of this target, file or key.
*/
CMPI_CP_TYPE
cmpi_cp_extract_type(char* target, char* value)
{
- CMPI_CP_TYPE result;
+ CMPI_CP_TYPE result;
if (strstr(target, "dht://"))
{
strcpy(value, target+6);
@@ -48,59 +48,59 @@
strcpy(value, target);
result = CMPI_CP_STREAM;
}
- else
+ else
{
strcpy(value, target);
result = CMPI_CP_FILE;
}
- return result;
+ return result;
}
CMPI_RETURN
cmpi_cp_put(FILE* file, char* object)
{
- char key[CMPI_KEY_LENGTH+10];
+ char key[CMPI_KEY_LENGTH+10];
char data[value_size];
- char msg[100];
- int count = 0;
+ char msg[100];
+ int count = 0;
while (! feof(file))
{
- int total = 0;
- while (!feof(file) &&
+ int total = 0;
+ while (!feof(file) &&
total < value_size)
{
int chunk = value_size-total;
int actual = fread(data+total, 1, chunk, file);
- data[total+actual] = '\0';
+ data[total+actual] = '\0';
total += actual;
}
if (total == 0)
- break;
+ break;
sprintf(key, "%s[%i]", object, count++);
- // printf("put: %s\n", key);
+ // printf("put: %s\n", key);
fprintf(to_cmpi, "put %s %i\n", key, total);
- fflush(to_cmpi);
+ fflush(to_cmpi);
fscanf(from_cmpi, "%s", msg);
if (strcmp(msg, "ok") != 0)
- return CMPI_ERROR_UNKNOWN;
+ return CMPI_ERROR_UNKNOWN;
buffer_to_stream(data, total, to_cmpi);
- fflush(to_cmpi);
- }
+ fflush(to_cmpi);
+ }
- sprintf(data, "DHT: %i", count);
+ sprintf(data, "DHT: %i", count);
fprintf(to_cmpi, "put %s %i\n", object, (int) strlen(data));
- fflush(to_cmpi);
+ fflush(to_cmpi);
fprintf(to_cmpi, "%s", data);
- fflush(to_cmpi);
+ fflush(to_cmpi);
- char result[32];
- fscanf(from_cmpi, "%s\n", result);
+ char result[32];
+ fscanf(from_cmpi, "%s\n", result);
if (strncmp(result, "ok", 2) != 0)
return CMPI_ERROR_UNKNOWN;
-
- return CMPI_SUCCESS;
+
+ return CMPI_SUCCESS;
}
CMPI_RETURN
@@ -108,59 +108,62 @@
{
char data[value_size];
int count, c;
- int length;
+ int length;
fprintf(to_cmpi, "get %s\n", object);
- fflush(to_cmpi);
+ fflush(to_cmpi);
- fscanf(from_cmpi, "%i", &length);
- fgetc(from_cmpi);
+ fscanf(from_cmpi, "%i", &length);
+ fgetc(from_cmpi);
if (length == -1)
- return CMPI_DOESNT_EXIST;
+ return CMPI_DOESNT_EXIST;
stream_to_buffer(data, length, from_cmpi);
sscanf(data, "DHT: %i", &count);
- // printf("count: %i\n", count);
-
+ // printf("count: %i\n", count);
+
for (c = 0; c < count; c++)
{
fprintf(to_cmpi, "get %s[%i]\n", object, c);
- fflush(to_cmpi);
+ fflush(to_cmpi);
fscanf(from_cmpi, "%i", &length);
- fgetc(from_cmpi);
+ fgetc(from_cmpi);
if (length == -1)
{
- printf("not found: %s[%i]\n", object, c);
+ printf("not found: %s[%i]\n", object, c);
return CMPI_DOESNT_EXIST;
}
- stream_to_buffer(data, length, from_cmpi);
- buffer_to_stream(data, length, file);
- }
- return CMPI_SUCCESS;
+ stream_to_buffer(data, length, from_cmpi);
+ buffer_to_stream(data, length, file);
+ }
+ return CMPI_SUCCESS;
}
void
bad_file(char* filename)
{
printf("Could not open: %s\n", filename);
- exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
+/**
+ Case logic for different uses
+*/
CMPI_RETURN
cmpi_cp_case(CMPI_CP_TYPE type1, char* object1,
CMPI_CP_TYPE type2, char* object2)
{
- CMPI_RETURN result = CMPI_SUCCESS;
+ CMPI_RETURN result = CMPI_SUCCESS;
if (type1 == CMPI_CP_FILE &&
type2 == CMPI_CP_KEY)
{
- // FILE -> DHT
+ // FILE -> DHT
FILE* file = fopen(object1, "r");
if (!file)
- bad_file(object1);
+ bad_file(object1);
result = cmpi_cp_put(file, object2);
- fclose(file);
+ fclose(file);
}
else if (type1 == CMPI_CP_KEY &&
type2 == CMPI_CP_FILE)
@@ -168,30 +171,30 @@
// DHT -> FILE
FILE* file = fopen(object2, "w");
if (!file)
- bad_file(object2);
+ bad_file(object2);
result = cmpi_cp_get(object1, file);
- fclose(file);
+ fclose(file);
}
else if (type1 == CMPI_CP_KEY &&
type2 == CMPI_CP_KEY)
{
- // DHT -> DHT
+ // DHT -> DHT
}
else if (type1 == CMPI_CP_STREAM &&
type2 == CMPI_CP_KEY)
{
// STREAM -> DHT
- result = cmpi_cp_put(stdin, object2);
+ result = cmpi_cp_put(stdin, object2);
}
else if (type1 == CMPI_CP_KEY &&
type2 == CMPI_CP_STREAM)
{
// DHT -> STREAM
- result = cmpi_cp_get(object1, stdout);
+ result = cmpi_cp_get(object1, stdout);
}
- return result;
+ return result;
}
-
+
int
main(int argc, char* argv[])
{
@@ -201,9 +204,9 @@
char object1[CMPI_KEY_LENGTH+10];
char object2[CMPI_KEY_LENGTH+10];
- value_size = CMPI_CP_CHUNK;
-
- cmpi_cp_args(argc, argv);
+ value_size = CMPI_CP_CHUNK;
+
+ cmpi_cp_args(argc, argv);
target1_type = cmpi_cp_extract_type(target1, object1);
target2_type = cmpi_cp_extract_type(target2, object2);
@@ -211,24 +214,24 @@
target2_type == CMPI_CP_FILE)
{
printf("cmpi-cp: given two files!\n");
- exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
- driver_access_fifo();
+ driver_access_fifo();
CMPI_RETURN result =
- cmpi_cp_case(target1_type, object1, target2_type, object2);
-
+ cmpi_cp_case(target1_type, object1, target2_type, object2);
+
if (result == CMPI_DOESNT_EXIST)
{
- // cmpi_get could not find the dht:// target
- printf("does not exist: %s\n", target1);
- return EXIT_FAILURE;
+ // cmpi_get could not find the dht:// target
+ printf("does not exist: %s\n", target1);
+ return EXIT_FAILURE;
}
- else if (result != CMPI_SUCCESS)
+ else if (result != CMPI_SUCCESS)
{
- printf("error\n");
- return EXIT_FAILURE;
+ printf("error\n");
+ return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
Modified: src/cmpi-db/cmpi-db-fifo-quit.c
===================================================================
--- src/cmpi-db/cmpi-db-fifo-quit.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/cmpi-db/cmpi-db-fifo-quit.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,26 +1,26 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
-#include <accessor.h>
+#include <accessor.h>
int
main(int argc, char* argv[])
{
- char msg[100];
-
+ char msg[100];
+
driver_access_fifo();
-
+
fprintf(to_cmpi, "quit\n");
- fflush(to_cmpi);
+ fflush(to_cmpi);
fscanf(from_cmpi, "%s\n", msg);
if (strcmp(msg, "ok") != 0)
{
printf("error\n");
- return EXIT_FAILURE;
+ return EXIT_FAILURE;
}
-
- return EXIT_SUCCESS;
+
+ return EXIT_SUCCESS;
}
Modified: src/cmpi-db/cmpi-db-fifo.c
===================================================================
--- src/cmpi-db/cmpi-db-fifo.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/cmpi-db/cmpi-db-fifo.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -31,7 +31,7 @@
void
cmpi_client_code()
{
- char hostname[100];
+ char hostname[128];
wait_for_notification();
notify_next();
Modified: src/mpi_tools/io_tools.c
===================================================================
--- src/mpi_tools/io_tools.c 2010-04-29 21:42:41 UTC (rev 63)
+++ src/mpi_tools/io_tools.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,7 +1,7 @@
-#include <io_tools.h>
+#include <io_tools.h>
-#include <unistd.h>
+#include <unistd.h>
void
stream_to_buffer(char* buffer, int length, FILE* stream)
@@ -25,17 +25,17 @@
{
int chunk = length-total;
int actual = fwrite(buffer+total, 1, chunk, stream);
- total += actual;
+ total += actual;
}
}
void
eat_whitespace(FILE* stream)
{
- char c;
+ char c;
do
{
c = fgetc(stream);
} while (c == ' ' || c == '\n');
- ungetc(c, stream);
+ ungetc(c, stream);
}
Modified: test/driver/test01.c
===================================================================
--- test/driver/test01.c 2010-04-29 21:42:41 UTC (rev 63)
+++ test/driver/test01.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,21 +1,21 @@
-#include <stdio.h>
-#include <stdlib.h>
+#include <stdio.h>
+#include <stdlib.h>
-#include <accessor.h>
+#include <accessor.h>
int
main(int argc, char* argv[])
{
- driver_access_fifo();
-
+ driver_access_fifo();
+
fprintf(to_cmpi, "sleep 3\n");
- fflush(to_cmpi);
+ fflush(to_cmpi);
char output[30];
fscanf(from_cmpi, "output: %s", output);
printf("%s\n", output);
- return 0;
+ return 0;
}
Modified: test/driver/test01.zsh
===================================================================
--- test/driver/test01.zsh 2010-04-29 21:42:41 UTC (rev 63)
+++ test/driver/test01.zsh 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,18 +1,18 @@
-#!/bin/zsh
+#!/bin/zsh
make -j 3 D=1 test/driver/test01.x test/driver/test02.x \
- test/driver/test_driver.x
+ test/driver/test_driver.x
-mpiexec -n 5 test/driver/test_driver.x -n 4 &
+mpiexec -n 5 test/driver/test_driver.x -n 4 &
DRIVER_PID=${!}
-sleep 5
+sleep 5
print "Launching tool 01..."
-test/driver/test01.x
+test/driver/test01.x
print "Launching tool 02..."
-test/driver/test02.x
+test/driver/test02.x
-wait
+wait
Modified: test/driver/test02.c
===================================================================
--- test/driver/test02.c 2010-04-29 21:42:41 UTC (rev 63)
+++ test/driver/test02.c 2010-04-29 21:55:50 UTC (rev 64)
@@ -1,20 +1,20 @@
-#include <stdio.h>
-#include <stdlib.h>
+#include <stdio.h>
+#include <stdlib.h>
-#include <accessor.h>
+#include <accessor.h>
int
main(int argc, char* argv[])
{
driver_access_fifo();
-
+
fprintf(to_cmpi, "quit\n");
- fflush(to_cmpi);
+ fflush(to_cmpi);
char output[30];
fscanf(from_cmpi, "output: %s", output);
printf("%s\n", output);
- return 0;
+ return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-04 18:46:26
|
Revision: 66
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=66&view=rev
Author: jmwozniak
Date: 2010-05-04 18:46:20 +0000 (Tue, 04 May 2010)
Log Message:
-----------
Remove "basic" test; compilation fixes.
Modified Paths:
--------------
Makefile.in
configure.ac
include/itable.h
include/ltable.h
include/mpirpc.h
src/gossip/gossip.c
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-29 21:56:33 UTC (rev 65)
+++ Makefile.in 2010-05-04 18:46:20 UTC (rev 66)
@@ -145,7 +145,7 @@
BUILD_CFLAGS = @BUILD_CFLAGS@
BUILD_LDFLAGS = @BUILD_LDFLAGS@
# make sure the srcdir include gets included first
-CFLAGS = -std=c99 # @CFLAGS@ @CPPFLAGS@ # -I $(srcdir)/include
+CFLAGS = -std=gnu99 # @CFLAGS@ @CPPFLAGS@ # -I $(srcdir)/include
LDFLAGS = -L@BUILD_ABSOLUTE_TOP@/lib
ifneq ($(DISKSIM)/src,)
LDFLAGS += -L$(DISKSIM)/src
Modified: configure.ac
===================================================================
--- configure.ac 2010-04-29 21:56:33 UTC (rev 65)
+++ configure.ac 2010-05-04 18:46:20 UTC (rev 66)
@@ -395,7 +395,6 @@
if test "x$ENABLE_TESTS" = "xyes" ; then
AC_CONFIG_FILES(
test/adts/module.mk
- test/basic/module.mk
test/cmpi/module.mk
test/cmpi-io/module.mk
test/driver/module.mk
Modified: include/itable.h
===================================================================
--- include/itable.h 2010-04-29 21:56:33 UTC (rev 65)
+++ include/itable.h 2010-05-04 18:46:20 UTC (rev 66)
@@ -2,7 +2,7 @@
*
* See COPYING in top-level directory.
*
- * Modified for Grayskull by Justin M Wozniak <wo...@mc...>
+ * Modified for Grayskull by Justin M Wozniak <wo...@mc...>
*/
#ifndef ITABLE_H
@@ -11,18 +11,18 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
-#include <string.h>
+#include <string.h>
-#include "ilist.h"
+#include "ilist.h"
struct itable
{
struct ilist** array;
int capacity;
- int size;
+ int size;
};
-inline int hash_int(int key, int capacity);
+int hash_int(int key, int capacity);
struct itable* itable_create(int capacity);
@@ -30,16 +30,16 @@
void* itable_search(struct itable* target, int key);
-void* itable_remove(struct itable* target, int key);
+void* itable_remove(struct itable* target, int key);
-void itable_free(struct itable* target);
+void itable_free(struct itable* target);
-void itable_destroy(struct itable* target);
+void itable_destroy(struct itable* target);
-void itable_dump(char* format, struct itable* target);
+void itable_dump(char* format, struct itable* target);
int itable_tostring(char* str, size_t size,
- char* format, struct itable* target);
+ char* format, struct itable* target);
#endif
Modified: include/ltable.h
===================================================================
--- include/ltable.h 2010-04-29 21:56:33 UTC (rev 65)
+++ include/ltable.h 2010-05-04 18:46:20 UTC (rev 66)
@@ -9,20 +9,20 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
-#include <string.h>
+#include <string.h>
-#include <mpi_tools.h>
+#include <mpi_tools.h>
-#include "llist.h"
+#include "llist.h"
struct ltable
{
struct llist** array;
int capacity;
- int size;
+ int size;
};
-inline int hash_long(long key, int capacity);
+int hash_long(long key, int capacity);
struct ltable* ltable_create(int capacity);
@@ -30,12 +30,12 @@
void* ltable_search(struct ltable* table, long key);
-void* ltable_remove(struct ltable* table, long key);
+void* ltable_remove(struct ltable* table, long key);
-void ltable_dump(char* format, struct ltable* target);
+void ltable_dump(char* format, struct ltable* target);
int ltable_tostring(char* str, size_t size,
- char* format, struct ltable* target);
+ char* format, struct ltable* target);
#endif
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2010-04-29 21:56:33 UTC (rev 65)
+++ include/mpirpc.h 2010-05-04 18:46:20 UTC (rev 66)
@@ -22,7 +22,7 @@
extern int unique;
-extern unsigned int snooze_max;
+extern useconds_t snooze_max;
#define MPIRPC_MAX_NAME 128
#define MPIRPC_MAX_ARGS 256
Modified: src/gossip/gossip.c
===================================================================
--- src/gossip/gossip.c 2010-04-29 21:56:33 UTC (rev 65)
+++ src/gossip/gossip.c 2010-05-04 18:46:20 UTC (rev 66)
@@ -11,6 +11,8 @@
* Handles debugging output.
*/
+#include <strings.h>
+
#include <gossip.h>
/** controls whether debugging is on or off */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-07 14:47:27
|
Revision: 76
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=76&view=rev
Author: jmwozniak
Date: 2010-05-07 14:47:21 +0000 (Fri, 07 May 2010)
Log Message:
-----------
Minor changes.
Modified Paths:
--------------
include/accessor.h
include/cmpi-cp.h
include/cmpi.h
include/io_tools.h
include/node.h
src/cmpi/driver.c
src/cmpi-cp/cmpi-cp.c
test/cmpi-db/module.mk.in
Modified: include/accessor.h
===================================================================
--- include/accessor.h 2010-05-06 19:56:18 UTC (rev 75)
+++ include/accessor.h 2010-05-07 14:47:21 UTC (rev 76)
@@ -1,9 +1,9 @@
-#include <stdbool.h>
+#include <stdbool.h>
#include <stdio.h>
-#include <stdlib.h>
+#include <stdlib.h>
FILE* to_cmpi;
-FILE* from_cmpi;
-
+FILE* from_cmpi;
+
bool driver_access_fifo(void);
Modified: include/cmpi-cp.h
===================================================================
--- include/cmpi-cp.h 2010-05-06 19:56:18 UTC (rev 75)
+++ include/cmpi-cp.h 2010-05-07 14:47:21 UTC (rev 76)
@@ -1,7 +1,11 @@
-#include <node.h>
+// #include <node.h>
#include <accessor.h>
+#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
+
#include <io_tools.h>
// #define CMPI_CP_CHUNK CMPI_VALUE_LENGTH
Modified: include/cmpi.h
===================================================================
--- include/cmpi.h 2010-05-06 19:56:18 UTC (rev 75)
+++ include/cmpi.h 2010-05-07 14:47:21 UTC (rev 76)
@@ -26,6 +26,8 @@
#include "dmalloc.h"
#endif
+#include <cmpi-types.h>
+
typedef unsigned int CMPI_ID;
//// Storage settings...
@@ -36,9 +38,6 @@
*/
extern int cmpi_cache_limit;
-#define CMPI_KEY_LENGTH 64
-#define CMPI_VALUE_LENGTH (64*1024)
-
#define CMPI_BLOB_LENGTH LIST_MAX_DATUM
extern struct lru_table* cmpi_cache;
@@ -93,42 +92,6 @@
};
/**
- CMPI method return error codes.
-*/
-typedef enum
-{
- /**
- Successful return code.
- */
- CMPI_SUCCESS,
-
- /**
- Record does not exist.
- */
- CMPI_DOESNT_EXIST,
-
- /**
- Query target is in a fault state.
- */
- CMPI_ERROR_FAULT,
-
- /**
- Unknown error.
- */
- CMPI_ERROR_UNKNOWN,
-
- /**
- Could not find port to attach.
- */
- CMPI_ERROR_SERVICENAME,
-
- /**
- Insufficient neighbors or poorly connected network.
- */
- CMPI_ERROR_NEIGHBORS
-} CMPI_RETURN;
-
-/**
CMPI control message types.
Must be in-memory integers to allow referencing by MPI calls.
*/
Modified: include/io_tools.h
===================================================================
--- include/io_tools.h 2010-05-06 19:56:18 UTC (rev 75)
+++ include/io_tools.h 2010-05-07 14:47:21 UTC (rev 76)
@@ -1,6 +1,6 @@
-#include <stdio.h>
+#include <stdio.h>
void stream_to_buffer(char* buffer, int length, FILE* stream);
void buffer_to_stream(char* buffer, int length, FILE* stream);
-void eat_whitespace(FILE* stream);
+void eat_whitespace(FILE* stream);
Modified: include/node.h
===================================================================
--- include/node.h 2010-05-06 19:56:18 UTC (rev 75)
+++ include/node.h 2010-05-07 14:47:21 UTC (rev 76)
@@ -1,8 +1,8 @@
-#include <getopt.h>
+#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
-#include <cmpi.h>
+#include <cmpi.h>
extern MPI_Comm cmpi_comm_clients;
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-06 19:56:18 UTC (rev 75)
+++ src/cmpi/driver.c 2010-05-07 14:47:21 UTC (rev 76)
@@ -104,10 +104,10 @@
cmpi_put(key, value, length);
int error = fprintf(driver->sink, "ok\n");
- NOTE("said ok\n");
if (error == -1)
printf("driver_put result error!\n");
fflush(driver->sink);
+ NOTE("said ok\n");
}
void
@@ -201,6 +201,7 @@
else if (strncmp(optoken, "get", 3) == 0)
{
driver_get(driver, tokens);
+ NOTE("driver_get returned\n");
}
else if (strncmp(optoken, "lookup", 6) == 0)
{
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-05-06 19:56:18 UTC (rev 75)
+++ src/cmpi-cp/cmpi-cp.c 2010-05-07 14:47:21 UTC (rev 76)
@@ -1,6 +1,10 @@
#include <cmpi-cp.h>
+#include <string.h>
+
+#include <cmpi-types.h>
+
char* target1;
char* target2;
@@ -12,7 +16,7 @@
if (argc == 1)
{
printhelp();
- exit(EXIT_FAILURE);
+ exit(1);
}
target1 = argv[1];
target2 = argv[2];
@@ -56,7 +60,7 @@
return result;
}
-CMPI_RETURN
+int
cmpi_cp_put(FILE* file, char* object)
{
char key[CMPI_KEY_LENGTH+10];
@@ -103,7 +107,7 @@
return CMPI_SUCCESS;
}
-CMPI_RETURN
+int
cmpi_cp_get(char* object, FILE* file)
{
char data[value_size];
@@ -113,6 +117,8 @@
fprintf(to_cmpi, "get %s\n", object);
fflush(to_cmpi);
+ printf("issued get\n");
+
fscanf(from_cmpi, "%i", &length);
fgetc(from_cmpi);
if (length == -1)
@@ -127,6 +133,7 @@
fprintf(to_cmpi, "get %s[%i]\n", object, c);
fflush(to_cmpi);
fscanf(from_cmpi, "%i", &length);
+ printf("incoming length: %i\n", length);
fgetc(from_cmpi);
if (length == -1)
{
@@ -144,17 +151,17 @@
bad_file(char* filename)
{
printf("Could not open: %s\n", filename);
- exit(EXIT_FAILURE);
+ exit(1);
}
/**
Case logic for different uses
*/
-CMPI_RETURN
+int
cmpi_cp_case(CMPI_CP_TYPE type1, char* object1,
CMPI_CP_TYPE type2, char* object2)
{
- CMPI_RETURN result = CMPI_SUCCESS;
+ int result = CMPI_SUCCESS;
if (type1 == CMPI_CP_FILE &&
type2 == CMPI_CP_KEY)
{
@@ -214,24 +221,24 @@
target2_type == CMPI_CP_FILE)
{
printf("cmpi-cp: given two files!\n");
- exit(EXIT_FAILURE);
+ exit(1);
}
driver_access_fifo();
- CMPI_RETURN result =
+ int result =
cmpi_cp_case(target1_type, object1, target2_type, object2);
if (result == CMPI_DOESNT_EXIST)
{
// cmpi_get could not find the dht:// target
printf("does not exist: %s\n", target1);
- return EXIT_FAILURE;
+ exit(1);
}
else if (result != CMPI_SUCCESS)
{
printf("error\n");
- return EXIT_FAILURE;
+ exit(1);
}
- return EXIT_SUCCESS;
+ return 0;
}
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-06 19:56:18 UTC (rev 75)
+++ test/cmpi-db/module.mk.in 2010-05-07 14:47:21 UTC (rev 76)
@@ -4,12 +4,14 @@
TEST_HELPER_SRC += test/driver/test_helpers.c
CMPI_DB = bin/cmpi-db
+CMPI_CP = bin/cmpi-cp
CMPI_DB_QUIT = bin/cmpi-db-fifo-quit
-CMPI_DB_TOOLS = $(CMPI_DB) $(CMPI_DB_QUIT)
+CMPI_DB_TOOLS = $(CMPI_DB) $(CMPI_CP) $(CMPI_DB_QUIT)
test/cmpi-db/test-%.out: test/cmpi-db/test-%.zsh $(CMPI_DB_TOOLS)
$(Q) " TEST $(@) "
- $(E)$(<) $(@) 4 3
+ $(E) mpdlistjobs
+ $(E) $(<) $(@) 4 3
# test/cmpi-db/test-quit.zsh
test/cmpi-db/test%.out: test/driver/test%.x $(DRIVER)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-07 14:48:11
|
Revision: 77
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=77&view=rev
Author: jmwozniak
Date: 2010-05-07 14:48:05 +0000 (Fri, 07 May 2010)
Log Message:
-----------
New test and header.
Added Paths:
-----------
include/cmpi-types.h
test/cmpi-db/test-cp1.zsh
Added: include/cmpi-types.h
===================================================================
--- include/cmpi-types.h (rev 0)
+++ include/cmpi-types.h 2010-05-07 14:48:05 UTC (rev 77)
@@ -0,0 +1,39 @@
+
+#define CMPI_KEY_LENGTH 64
+#define CMPI_VALUE_LENGTH (64*1024)
+
+/**
+ CMPI method return error codes.
+*/
+typedef enum
+{
+ /**
+ Successful return code.
+ */
+ CMPI_SUCCESS,
+
+ /**
+ Record does not exist.
+ */
+ CMPI_DOESNT_EXIST,
+
+ /**
+ Query target is in a fault state.
+ */
+ CMPI_ERROR_FAULT,
+
+ /**
+ Unknown error.
+ */
+ CMPI_ERROR_UNKNOWN,
+
+ /**
+ Could not find port to attach.
+ */
+ CMPI_ERROR_SERVICENAME,
+
+ /**
+ Insufficient neighbors or poorly connected network.
+ */
+ CMPI_ERROR_NEIGHBORS
+} CMPI_RETURN;
Added: test/cmpi-db/test-cp1.zsh
===================================================================
--- test/cmpi-db/test-cp1.zsh (rev 0)
+++ test/cmpi-db/test-cp1.zsh 2010-05-07 14:48:05 UTC (rev 77)
@@ -0,0 +1,52 @@
+#!/bin/zsh
+
+# Be sure to make tests with D=1
+
+# set -x
+
+OUT=$1
+PROCS=$2
+NODES=$3
+
+source tools/test-helpers.zsh
+
+mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUT} &
+MPI_PROCESS=$!
+
+sleep ${PROCS}
+
+echo "DATA" > test-cp1.input.data
+echo "cmpi-cp insert" >& cmpi-cp.out
+bin/cmpi-cp test-cp1.input.data dht://test-cp1 >>& cmpi-cp.out
+if [[ $? != 0 ]]
+then
+ cat cmpi-cp.out
+ rm -v cmpi-cp.out
+ crash "cmpi-cp error!"
+fi
+
+echo inserted
+
+echo "\n\ncmpi-cp retrieve" >>& cmpi-cp.out
+bin/cmpi-cp dht://test-cp1 test-cp1.output.data >>& cmpi-cp.out
+if [[ $? != 0 ]]
+then
+ cat cmpi-cp.out
+ rm -v cmpi-cp.out
+ crash "cmpi-cp error!"
+fi
+
+echo retrieved
+
+bin/cmpi-db-fifo-quit >& /dev/null &
+QUIT_PROCESS=$!
+
+sleep ${PROCS}
+
+# Should be ${PROCS} "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == PROCS )) || crash "N != ${PROCS}"
+
+# rm cmpi-cp.out test-cp1.*.data
+
+exit 0
Property changes on: test/cmpi-db/test-cp1.zsh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-11 16:11:03
|
Revision: 81
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=81&view=rev
Author: jmwozniak
Date: 2010-05-11 16:10:53 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Better error handling when mpd not up, manual improvements.
Modified Paths:
--------------
Makefile.in
docs/manual/manual.xml
docs/manual/sf-post.zsh
test/cmpi/module.mk.in
test/cmpi-db/module.mk.in
test/mpirpc/module.mk.in
Added Paths:
-----------
tools/mpd-available.zsh
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-10 19:46:14 UTC (rev 80)
+++ Makefile.in 2010-05-11 16:10:53 UTC (rev 81)
@@ -63,7 +63,7 @@
MPI = @USE_MPI@
MPICC = @USE_MPI@/bin/mpicc
MPIEXEC = @USE_MPI@/bin/mpiexec -recvtimeout 10
-CHECK_MPD = @USE_MPI@/bin/mpdlistjobs > /dev/null
+MPDCHECK = tools/mpd-available.zsh @USE_MPI@/bin/mpdlistjobs
# Job launch selection
ifeq (@HAVE_SRUN@,no)
Modified: docs/manual/manual.xml
===================================================================
--- docs/manual/manual.xml 2010-05-10 19:46:14 UTC (rev 80)
+++ docs/manual/manual.xml 2010-05-11 16:10:53 UTC (rev 81)
@@ -553,7 +553,7 @@
(This is how all tests will be run in the future.)
<variablelist>
<varlistentry>
- <term>make test_results</term>
+ <term>make D=1 test_results</term>
<listitem><para>
Build and run all the tests.
Requires <literal>./configure --enable-tests</literal>
Modified: docs/manual/sf-post.zsh
===================================================================
--- docs/manual/sf-post.zsh 2010-05-10 19:46:14 UTC (rev 80)
+++ docs/manual/sf-post.zsh 2010-05-11 16:10:53 UTC (rev 81)
@@ -9,4 +9,6 @@
cd ${DIR}
HTML=( index.html manual.html )
-scp ${HTML} ${USER},c-...@we...:htdocs
+IMG=( cmpi-connections.png )
+FILES=( ${HTML} ${IMG} )
+scp -p ${FILES} ${USER},c-...@we...:htdocs
Modified: test/cmpi/module.mk.in
===================================================================
--- test/cmpi/module.mk.in 2010-05-10 19:46:14 UTC (rev 80)
+++ test/cmpi/module.mk.in 2010-05-11 16:10:53 UTC (rev 81)
@@ -15,13 +15,13 @@
ifeq (@USE_COMM_WORLD@,1)
test/cmpi/test%.out: test/cmpi/test%.x test/cmpi/test%.zsh
- $(E)$(CHECK_MPD)
+ $(E) $(MPDCHECK)
$(Q) " TEST $(@) "
- $(E)$(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
+ $(E) $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
test/cmpi/test%.x: test/cmpi/test%.o test/cmpi/test_helpers.o src/cmpi/node.o $(CMPI)
$(Q) " LINK $(@) "
- $(E)$(MPICC) $(MPE) $(<) test/cmpi/test_helpers.o src/cmpi/node.o \
+ $(E) $(MPICC) $(MPE) $(<) test/cmpi/test_helpers.o src/cmpi/node.o \
$(CMPI) $(LIBS) -o $(@)
else
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-10 19:46:14 UTC (rev 80)
+++ test/cmpi-db/module.mk.in 2010-05-11 16:10:53 UTC (rev 81)
@@ -10,7 +10,7 @@
test/cmpi-db/test-%.out: test/cmpi-db/test-%.zsh $(CMPI_DB_TOOLS)
$(Q) " TEST $(@) "
- $(E) mpdlistjobs
+ $(E) $(MPDCHECK)
$(E) $(<) $(@) 4 3
# test/cmpi-db/test-quit.zsh
Modified: test/mpirpc/module.mk.in
===================================================================
--- test/mpirpc/module.mk.in 2010-05-10 19:46:14 UTC (rev 80)
+++ test/mpirpc/module.mk.in 2010-05-11 16:10:53 UTC (rev 81)
@@ -11,7 +11,7 @@
test/mpirpc/test%.out: test/mpirpc/test%.x
$(Q) " TEST $(@) "
- $(E)mpdlistjobs
+ $(E) $(MPDCHECK)
$(E) $(patsubst %.x, %.zsh, $(<)) $(<) $(LAUNCH)
# cp -uv $(@) test/mpirpc/readable.txt
Added: tools/mpd-available.zsh
===================================================================
--- tools/mpd-available.zsh (rev 0)
+++ tools/mpd-available.zsh 2010-05-11 16:10:53 UTC (rev 81)
@@ -0,0 +1,14 @@
+#!/bin/zsh
+
+# Check that MPD is up
+
+MPD_COMMAND=$1
+
+${MPD_COMMAND} > /dev/null
+if [[ $? != 0 ]]
+then
+ ${MPD_COMMAND}
+ exit 1
+fi
+
+return 0
Property changes on: tools/mpd-available.zsh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-11 21:36:11
|
Revision: 91
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=91&view=rev
Author: jmwozniak
Date: 2010-05-11 21:36:05 +0000 (Tue, 11 May 2010)
Log Message:
-----------
Fix test-quit case
Modified Paths:
--------------
test/driver/module.mk.in
test/driver/test-quit.zsh
test/driver/test-sleep.zsh
tools/timebomb.zsh
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-11 21:25:17 UTC (rev 90)
+++ test/driver/module.mk.in 2010-05-11 21:36:05 UTC (rev 91)
@@ -15,7 +15,6 @@
TEST_OUTPUT += $(TEST_DRIVER_OUTPUT)
TEST_DRIVER = test/driver/test_driver.x
-
TEST_DRIVER_IMPL = test/driver/test_driver_fifo.o
$(TEST_DRIVER): $(TEST_DRIVER_IMPL) test/driver/test_helpers.o $(CMPI)
@@ -28,6 +27,6 @@
$(Q) " MPICC $(@) "
$(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o $(CMPI) $(LIBS) -o $(@)
-test/driver/test%.out: test/driver/test%.zsh test/driver/test02.x $(TEST_DRIVER)
+test/driver/test%.out: test/driver/test%.zsh $(TEST_PROGS) $(TEST_DRIVER)
$(Q) " TEST $(@) "
$(E) $(<) $(@)
Modified: test/driver/test-quit.zsh
===================================================================
--- test/driver/test-quit.zsh 2010-05-11 21:25:17 UTC (rev 90)
+++ test/driver/test-quit.zsh 2010-05-11 21:36:05 UTC (rev 91)
@@ -5,15 +5,15 @@
mpiexec -n 5 test/driver/test_driver.x -n 4 > ${OUTPUT} &
DRIVER_PID=${!}
-tools/timebomb.zsh ${$} 10 ${OUTPUT} $0
-BOMB1_PID=${!}
+tools/timebomb.zsh ${$} 10 ${OUTPUT} $0 &
+BOMB_PID=${!}
-sleep 5
+sleep 3
-print "Launching tool 02..."
-test/driver/test02.x
+test/driver/test-cmd-quit.x
-wait
+wait ${DRIVER_PID}
+kill ${BOMB_PID}
N=$( grep -c "Normal exit" ${OUTPUT} )
if (( N != 5 ))
Modified: test/driver/test-sleep.zsh
===================================================================
--- test/driver/test-sleep.zsh 2010-05-11 21:25:17 UTC (rev 90)
+++ test/driver/test-sleep.zsh 2010-05-11 21:36:05 UTC (rev 91)
@@ -1,20 +1,23 @@
#!/bin/zsh
-make -j 3 D=1 test/driver/test02.x test/driver/test03.x \
- test/driver/test_driver.x
-[[ $? != 0 ]] && exit
-sleep 1
-
-mpiexec -n 5 test/driver/test_driver.x -n 4 &
+mpiexec -n 5 test/driver/test_driver.x -n 4 > ${OUTPUT} &
DRIVER_PID=${!}
+tools/timebomb.zsh ${$} 10 ${OUTPUT} $0
+BOMB1_PID=${!}
+
sleep 5
-print "Launching tool 03..."
-test/driver/test03.x
+print "Launching command quit..."
+test/driver/test-cmd-quit.x
-print "Launching tool 02..."
-test/driver/test02.x
-
wait
+N=$( grep -c "Normal exit" ${OUTPUT} )
+if (( N != 5 ))
+then
+ mv -v ${OUTPUT} ${OUTPUT}.failed
+ exit 1
+fi
+
+return 0
Modified: tools/timebomb.zsh
===================================================================
--- tools/timebomb.zsh 2010-05-11 21:25:17 UTC (rev 90)
+++ tools/timebomb.zsh 2010-05-11 21:36:05 UTC (rev 91)
@@ -14,4 +14,4 @@
sleep 3
-kill ${TARGET}
+kill -9 ${TARGET}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-11 23:05:35
|
Revision: 93
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=93&view=rev
Author: jmwozniak
Date: 2010-05-11 23:05:29 +0000 (Tue, 11 May 2010)
Log Message:
-----------
OUTPUT cleanups.
Modified Paths:
--------------
test/cmpi/test-manyputs.zsh
test/cmpi/test-putget.zsh
test/cmpi/test-startup.zsh
test/cmpi/test-tables.zsh
test/cmpi/test-update01.zsh
test/cmpi/test-update02.zsh
test/cmpi-db/test-cp1.zsh
test/cmpi-db/test-quit.zsh
test/driver/module.mk.in
test/driver/test-cmd-put.c
test/gossip/test-do.zsh
test/gossip/test-env.zsh
test/gossip/test-masks.zsh
test/mpirpc/test-args.zsh
test/mpirpc/test-blob.zsh
test/mpirpc/test-ping.zsh
test/mpirpc/test-returns.zsh
tools/test-helpers.zsh
Removed Paths:
-------------
test/driver/test01.zsh
Modified: test/cmpi/test-manyputs.zsh
===================================================================
--- test/cmpi/test-manyputs.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi/test-manyputs.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -7,7 +7,7 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
@@ -16,7 +16,7 @@
# Monolithic execution (5 nodes, 1 client):
- mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -31,7 +31,7 @@
fi
# Should be 6 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 6 )) || crash "N != 6"
exit 0
Modified: test/cmpi/test-putget.zsh
===================================================================
--- test/cmpi/test-putget.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi/test-putget.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -7,7 +7,7 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
@@ -16,7 +16,7 @@
# Monolithic execution (3 nodes, 2 clients):
- mpiexec -n 6 ${PROGRAM} -n 5 >& ${OUT}
+ mpiexec -n 6 ${PROGRAM} -n 5 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -31,7 +31,7 @@
fi
# Should be 5 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 6 )) || crash "N != 6"
exit 0
Modified: test/cmpi/test-startup.zsh
===================================================================
--- test/cmpi/test-startup.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi/test-startup.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -7,7 +7,7 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
@@ -15,7 +15,7 @@
then
# KDA-2A execution (3 nodes, 2 clients):
- mpiexec -n 5 ${PROGRAM} -n 3 >& ${OUT}
+ mpiexec -n 5 ${PROGRAM} -n 3 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -32,7 +32,7 @@
fi
# Should be 5 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 5 )) || crash "N != 5"
exit 0
Modified: test/cmpi/test-tables.zsh
===================================================================
--- test/cmpi/test-tables.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi/test-tables.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -7,7 +7,7 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
@@ -15,7 +15,7 @@
then
# KDA-2A execution (3 nodes, 2 clients):
- mpiexec -n 5 ${PROGRAM} -n 3 >& ${OUT}
+ mpiexec -n 5 ${PROGRAM} -n 3 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -30,7 +30,7 @@
fi
# Should be 5 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 5 )) || crash "N != 5"
exit 0
Modified: test/cmpi/test-update01.zsh
===================================================================
--- test/cmpi/test-update01.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi/test-update01.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -7,7 +7,7 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
@@ -16,7 +16,7 @@
# Monolithic execution (5 nodes, 1 client):
- mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -31,7 +31,7 @@
fi
# Should be 6 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 6 )) || crash "N != 6"
exit 0
Modified: test/cmpi/test-update02.zsh
===================================================================
--- test/cmpi/test-update02.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi/test-update02.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -7,7 +7,7 @@
source tools/test-helpers.zsh
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
@@ -16,7 +16,7 @@
# Monolithic execution (5 nodes, 1 client):
- mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUTPUT}
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -31,7 +31,7 @@
fi
# Should be 6 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 6 )) || crash "N != 6"
exit 0
Modified: test/cmpi-db/test-cp1.zsh
===================================================================
--- test/cmpi-db/test-cp1.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi-db/test-cp1.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -4,13 +4,13 @@
# set -x
-OUT=$1
+OUTPUT=$1
PROCS=$2
NODES=$3
source tools/test-helpers.zsh
-mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUT} &
+mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
MPI_PROCESS=$!
sleep ${PROCS}
@@ -44,7 +44,7 @@
sleep ${PROCS}
# Should be ${PROCS} "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == PROCS )) || crash "N != ${PROCS}"
# rm cmpi-cp.out test-cp1.*.data
Modified: test/cmpi-db/test-quit.zsh
===================================================================
--- test/cmpi-db/test-quit.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/cmpi-db/test-quit.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -4,13 +4,13 @@
set -x
-OUT=$1
+OUTPUT=$1
PROCS=$2
NODES=$3
source tools/test-helpers.zsh
-mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUT} &
+mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
MPI_PROCESS=$!
sleep ${PROCS}
@@ -21,7 +21,7 @@
sleep ${PROCS}
# Should be ${PROCS} "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == PROCS )) || crash "N != ${PROCS}"
exit 0
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-11 21:44:50 UTC (rev 92)
+++ test/driver/module.mk.in 2010-05-11 23:05:29 UTC (rev 93)
@@ -4,7 +4,10 @@
TEST_DRIVER_SRC += $(shell find test/driver -name "*.c" ! -name test_helpers.c)
TEST_DRIVER_OBJS = $(patsubst %.c, %.o, $(TEST_DRIVER_SRC))
-TEST_DRIVER_OUTPUT = $(patsubst %.c, %.out, $(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_OBJS += $(patsubst %.c, %.o, $(TEST_HELPER_SRC))
@@ -30,3 +33,6 @@
test/driver/test%.out: test/driver/test%.zsh $(TEST_PROGS) $(TEST_DRIVER)
$(Q) " TEST $(@) "
$(E) $(<) $(@)
+
+test/driver/test-success.out: test/cmpi/test-success.out \
+ $(TEST_DRIVER_OUTPUT)
Modified: test/driver/test-cmd-put.c
===================================================================
--- test/driver/test-cmd-put.c 2010-05-11 21:44:50 UTC (rev 92)
+++ test/driver/test-cmd-put.c 2010-05-11 23:05:29 UTC (rev 93)
@@ -11,9 +11,17 @@
{
driver_access_fifo();
+ if (argc < 2)
+ {
+ printf("test-cmd-put: needs key argument!\n");
+ exit(1);
+ }
+
+ char* key = argv[1];
+
char* data = "hello does this work";
- fprintf(to_cmpi, "put key1 %i\n", (int) strlen(data));
+ fprintf(to_cmpi, "put %s %i\n", key, (int) strlen(data));
fprintf(to_cmpi, "%s", data);
fflush(to_cmpi);
Deleted: test/driver/test01.zsh
===================================================================
--- test/driver/test01.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/driver/test01.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,18 +0,0 @@
-#!/bin/zsh
-
-make -j 3 D=1 test/driver/test01.x test/driver/test02.x \
- test/driver/test_driver.x
-
-mpiexec -n 5 test/driver/test_driver.x -n 4 &
-DRIVER_PID=${!}
-
-sleep 5
-
-print "Launching tool 01..."
-test/driver/test01.x
-
-print "Launching tool 02..."
-test/driver/test02.x
-
-wait
-
Modified: test/gossip/test-do.zsh
===================================================================
--- test/gossip/test-do.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/gossip/test-do.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,37 +1,32 @@
#!/bin/zsh
-# set -x
-
# Be sure to make tests with D=1
-PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+source tools/test-helpers.zsh
-crash()
-{
- print $1
- mv ${OUT} ${OUT}.failed
- exit 1
-}
+# set -x
-${PROGRAM} > ${OUT} 2>&1
+PROGRAM=$1
+OUTPUT=${PROGRAM%.x}.out
+
+${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUT} 2>&1
+CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUT} 2>&1
+CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
# Should be 3 "test program"s
-N=$( grep -c "test program" ${OUT} )
+N=$( grep -c "test program" ${OUTPUT} )
(( N == 3 )) || crash "N != 3"
# Should be 2 "EXAMPLE MESSAGE"s
-N=$( grep -c "EXAMPLE MESSAGE" ${OUT} )
+N=$( grep -c "EXAMPLE MESSAGE" ${OUTPUT} )
(( N == 2 )) || crash "N != 2"
exit 0
Modified: test/gossip/test-env.zsh
===================================================================
--- test/gossip/test-env.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/gossip/test-env.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,37 +1,39 @@
#!/bin/zsh
+# Be sure to make tests with D=1
+
+source tools/test-helpers.zsh
+
# set -x
-# Be sure to make tests with D=1
-
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
crash()
{
print $1
- mv ${OUT} ${OUT}.failed
+ mv ${OUTPUT} ${OUT}.failed
exit 1
}
-${PROGRAM} > ${OUT} 2>&1
+${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUT} 2>&1
+CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
-CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUT} 2>&1
+CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
# Should be 3 "test program"s
-N=$( grep -c "test program" ${OUT} )
+N=$( grep -c "test program" ${OUTPUT} )
(( N == 3 )) || crash "N != 3"
# Should be 2 "Example debugging message."s
-N=$( grep -c "EXAMPLE MESSAGE" ${OUT} )
+N=$( grep -c "EXAMPLE MESSAGE" ${OUTPUT} )
(( N == 2 )) || crash "N != 2"
exit 0
Modified: test/gossip/test-masks.zsh
===================================================================
--- test/gossip/test-masks.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/gossip/test-masks.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,29 +1,24 @@
#!/bin/zsh
-# set -x
-
# Be sure to make tests with D=1
-PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+source tools/test-helpers.zsh
-crash()
-{
- print $1
- mv ${OUT} ${OUT}.failed
- exit 1
-}
+# set -x
-${PROGRAM} > ${OUT} 2>&1
+PROGRAM=$1
+OUTPUT=${PROGRAM%.x}.out
+
+${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
# Should be 4 "Debug mask"s
-N=$( grep -c "Debug mask" ${OUT} )
+N=$( grep -c "Debug mask" ${OUTPUT} )
(( N == 4 )) || crash "N != 4"
# Should be 2 line outputs
-N=$( grep -c "test-masks.c main.*Debug mask" ${OUT} )
+N=$( grep -c "test-masks.c main.*Debug mask" ${OUTPUT} )
(( N == 2 )) || crash "N != 2"
exit 0
Modified: test/mpirpc/test-args.zsh
===================================================================
--- test/mpirpc/test-args.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/mpirpc/test-args.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,27 +1,22 @@
#!/bin/zsh
-# set -x
-
# Be sure to make tests with D=1
+source tools/test-helpers.zsh
+
+# set -x
+
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
-crash()
-{
- print $1
- mv ${OUT} ${OUT}.failed
- exit 1
-}
-
-eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUT} 2>&1
+eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
# Should only be 3 calls to handle_test()...
-N=$( grep -c "handle_test(args=" ${OUT} )
+N=$( grep -c "handle_test(args=" ${OUTPUT} )
(( N == 3 )) || crash "N != 3"
TOKENS=("handle_test(args=(null))"
@@ -30,7 +25,7 @@
for T in ${TOKENS}
do
- grep ${T} ${OUT} > /dev/null || crash "Not found: ${T}"
+ grep ${T} ${OUTPUT} > /dev/null || crash "Not found: ${T}"
done
exit 0
Modified: test/mpirpc/test-blob.zsh
===================================================================
--- test/mpirpc/test-blob.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/mpirpc/test-blob.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,22 +1,17 @@
#!/bin/zsh
-# set -x
-
# Be sure to make tests with D=1
+source tools/test-helpers.zsh
+
+# set -x
+
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
-crash()
-{
- print $1
- mv ${OUT} ${OUT}.failed
- exit 1
-}
-
-eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUT} 2>&1
+eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -25,11 +20,11 @@
for T in ${TOKENS}
do
- grep ${T} ${OUT} > /dev/null || crash "Not found: ${T}"
+ grep ${T} ${OUTPUT} > /dev/null || crash "Not found: ${T}"
done
# Should be 2 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 2 )) || crash "N != 2"
exit 0
Modified: test/mpirpc/test-ping.zsh
===================================================================
--- test/mpirpc/test-ping.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/mpirpc/test-ping.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,33 +1,28 @@
#!/bin/zsh
-# set -x
-
# Be sure to make tests with D=1
+source tools/test-helpers.zsh
+
+# set -x
+
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
-crash()
-{
- print $1
- mv ${OUT} ${OUT}.failed
- exit 1
-}
-
-eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUT} 2>&1
+eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
# Should be 5 calls to handle_ping()...
-N=$( grep -c "handle_ping" ${OUT} )
+N=$( grep -c "handle_ping" ${OUTPUT} )
(( N == 5 )) || crash "N != 6"
-grep "handle_quit" ${OUT} > /dev/null || crash "No handle_quit!"
+grep "handle_quit" ${OUTPUT} > /dev/null || crash "No handle_quit!"
# Should be 2 "Normal exit."s
-N=$( grep -c "Normal exit." ${OUT} )
+N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == 2 )) || crash "N != 2"
exit 0
Modified: test/mpirpc/test-returns.zsh
===================================================================
--- test/mpirpc/test-returns.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ test/mpirpc/test-returns.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -1,22 +1,17 @@
#!/bin/zsh
-# set -x
-
# Be sure to make tests with D=1
+source tools/test-helpers.zsh
+
+# set -x
+
PROGRAM=$1
-OUT=${PROGRAM%.x}.out
+OUTPUT=${PROGRAM%.x}.out
shift
LAUNCH=${*}
-crash()
-{
- print $1
- mv ${OUT} ${OUT}.failed
- exit 1
-}
-
-eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUT} 2>&1
+eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
@@ -25,7 +20,7 @@
for T in ${TOKENS}
do
- grep ${T} ${OUT} > /dev/null || crash "Not found: ${T}"
+ grep ${T} ${OUTPUT} > /dev/null || crash "Not found: ${T}"
done
exit 0
Modified: tools/test-helpers.zsh
===================================================================
--- tools/test-helpers.zsh 2010-05-11 21:44:50 UTC (rev 92)
+++ tools/test-helpers.zsh 2010-05-11 23:05:29 UTC (rev 93)
@@ -6,6 +6,6 @@
crash()
{
print $1
- mv -v ${OUT} ${OUT}.failed
+ mv -v ${OUTPUT} ${OUTPUT}.failed
exit 1
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-12 01:54:05
|
Revision: 97
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=97&view=rev
Author: jmwozniak
Date: 2010-05-12 01:53:59 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Fixes to driver and cmpi-db tests
Modified Paths:
--------------
configure.ac
src/cmpi/driver.c
src/cmpi-db/module.mk.in
test/cmpi-db/module.mk.in
test/cmpi-db/test-cp1.zsh
Modified: configure.ac
===================================================================
--- configure.ac 2010-05-12 00:16:31 UTC (rev 96)
+++ configure.ac 2010-05-12 01:53:59 UTC (rev 97)
@@ -398,6 +398,7 @@
test/adts/module.mk
test/cmpi/module.mk
test/cmpi-db/module.mk
+ test/driver/module.mk
test/gossip/module.mk
test/mpirpc/module.mk
test/mpi_tools/module.mk
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-12 00:16:31 UTC (rev 96)
+++ src/cmpi/driver.c 2010-05-12 01:53:59 UTC (rev 97)
@@ -127,6 +127,7 @@
}
else
{
+ printf("driver: length: %i\n", length);
fprintf(driver->sink, "%i\n", length);
fflush(driver->sink);
buffer_to_stream(value, length, driver->sink);
Modified: src/cmpi-db/module.mk.in
===================================================================
--- src/cmpi-db/module.mk.in 2010-05-12 00:16:31 UTC (rev 96)
+++ src/cmpi-db/module.mk.in 2010-05-12 01:53:59 UTC (rev 97)
@@ -8,11 +8,11 @@
CMPIDB = bin/cmpi-db
$(CMPIDB): src/cmpi-db/cmpi-db-fifo.o $(CMPI)
- $(Q) " MPICC $(@)"
+ $(Q) " LINK $(@)"
$(E) install -d bin
$(E) $(MPICC) $(MPE) src/cmpi/node.o src/cmpi/driver.o \
$(<) $(CMPI) $(LIBS) -o $(@)
bin/cmpi-db-quit: src/cmpi-db/cmpi-db-fifo-quit.o $(CMPI) bin
- $(Q) " MPICC $(@)"
+ $(Q) " LINK $(@)"
$(E) $(MPICC) $(<) $(CMPI) -o $(@)
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-12 00:16:31 UTC (rev 96)
+++ test/cmpi-db/module.mk.in 2010-05-12 01:53:59 UTC (rev 97)
@@ -13,11 +13,3 @@
$(Q) " TEST $(@) "
$(E) $(MPDCHECK)
$(E) $(<) $(@) 4 3
-
-#test/cmpi-db/test%.out: test/cmpi-db/test%.x $(DRIVER)
-# $(Q) " TEST $(@) "
-# $(E)touch $(@)
-
-# $(DRIVER): $(DRIVER_IMPL) test/driver/test_helpers.o src/cmpi/node.o $(CMPI)
-# $(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o src/cmpi/node.o \
-# $(CMPI) $(LIBS) -o $(@)
Modified: test/cmpi-db/test-cp1.zsh
===================================================================
--- test/cmpi-db/test-cp1.zsh 2010-05-12 00:16:31 UTC (rev 96)
+++ test/cmpi-db/test-cp1.zsh 2010-05-12 01:53:59 UTC (rev 97)
@@ -11,8 +11,11 @@
source tools/test-helpers.zsh
mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
-MPI_PROCESS=$!
+DB_PID=${!}
+tools/timebomb.zsh ${DB_PID} $(( PROCS*3 )) ${OUTPUT} $0 &
+BOMB_PID=${!}
+
sleep ${PROCS}
echo "DATA" > test-cp1.input.data
@@ -25,8 +28,6 @@
crash "cmpi-cp error!"
fi
-echo inserted
-
echo "\n\ncmpi-cp retrieve" >>& cmpi-cp.out
bin/cmpi-cp dht://test-cp1 test-cp1.output.data >>& cmpi-cp.out
if [[ $? != 0 ]]
@@ -36,8 +37,6 @@
crash "cmpi-cp error!"
fi
-echo retrieved
-
bin/cmpi-db-quit >& /dev/null &
QUIT_PROCESS=$!
@@ -47,6 +46,8 @@
N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == PROCS )) || crash "N != ${PROCS}"
+kill ${BOMB_PID}
+
rm -f cmpi-cp.out test-cp1.*.data
exit 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-12 19:20:26
|
Revision: 103
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=103&view=rev
Author: jmwozniak
Date: 2010-05-12 19:20:20 +0000 (Wed, 12 May 2010)
Log Message:
-----------
CMPI mode selection functionality
Modified Paths:
--------------
include/cmpi.h
src/cmpi/module.mk.in
src/cmpi/node.c
Added Paths:
-----------
include/cmpi_mode.h
src/cmpi/mode_mono.c
Modified: include/cmpi.h
===================================================================
--- include/cmpi.h 2010-05-12 18:34:31 UTC (rev 102)
+++ include/cmpi.h 2010-05-12 19:20:20 UTC (rev 103)
@@ -59,6 +59,12 @@
enum
{
+ CMPI_MODE_NODE,
+ CMPI_MODE_CLIENT
+};
+
+enum
+{
CMPI_STATUS_PROTO, // CMPI is starting up
CMPI_STATUS_READY, // CMPI is fully connected
CMPI_STATUS_SHUTDOWN // CMPI is shutting down
Added: include/cmpi_mode.h
===================================================================
--- include/cmpi_mode.h (rev 0)
+++ include/cmpi_mode.h 2010-05-12 19:20:20 UTC (rev 103)
@@ -0,0 +1,2 @@
+
+int select_mode(int rank, int size, int nodes);
Added: src/cmpi/mode_mono.c
===================================================================
--- src/cmpi/mode_mono.c (rev 0)
+++ src/cmpi/mode_mono.c 2010-05-12 19:20:20 UTC (rev 103)
@@ -0,0 +1,13 @@
+
+#include <cmpi.h>
+#include <cmpi_mode.h>
+
+/**
+ Original idea: if rank > nodes, I am client.
+*/
+int select_mode(int rank, int size, int nodes)
+{
+ if (rank >= nodes)
+ return CMPI_MODE_CLIENT;
+ return CMPI_MODE_NODE;
+}
Modified: src/cmpi/module.mk.in
===================================================================
--- src/cmpi/module.mk.in 2010-05-12 18:34:31 UTC (rev 102)
+++ src/cmpi/module.mk.in 2010-05-12 19:20:20 UTC (rev 103)
@@ -7,6 +7,11 @@
CMPI_SRC += $(DIR)/driver.c
CMPI_SRC += $(DIR)/accessor.c
+MODE = $(DIR)/mode_mono.c
+#MODE = $(DIR)/mode_db.c
+
+CMPI_SRC += $(MODE)
+
ifeq (@USE_TABLE_DENSE@,1)
CMPI_SRC += $(DIR)/dense.c
CMPI_SRC += $(DIR)/driver.c
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2010-05-12 18:34:31 UTC (rev 102)
+++ src/cmpi/node.c 2010-05-12 19:20:20 UTC (rev 103)
@@ -10,7 +10,8 @@
* -t <tag> symbolic tag number.
*/
-#include "node.h"
+#include <node.h>
+#include <cmpi_mode.h>
int nodes;
MPI_Comm cmpi_comm_clients;
@@ -184,12 +185,14 @@
build_client_communicator();
- if (mpi_rank < nodes)
+ if (select_mode(mpi_rank, mpi_size, nodes) == CMPI_MODE_NODE)
{
+ NOTE("I am node");
cmpi_init();
}
else
{
+ NOTE("I am client");
cmpi_init_client();
cmpi_client_code();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-12 19:59:45
|
Revision: 104
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=104&view=rev
Author: jmwozniak
Date: 2010-05-12 19:59:36 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Bug fix to cmpi-cp
Modified Paths:
--------------
src/cmpi-cp/cmpi-cp.c
src/dense-1/dense.c
test/cmpi-db/module.mk.in
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-05-12 19:20:20 UTC (rev 103)
+++ src/cmpi-cp/cmpi-cp.c 2010-05-12 19:59:36 UTC (rev 104)
@@ -95,33 +95,48 @@
sprintf(data, "DHT: %i", count);
fprintf(to_cmpi, "put %s %i\n", object, (int) strlen(data));
fflush(to_cmpi);
+ fscanf(from_cmpi, "%s", msg);
+ if (strcmp(msg, "ok") != 0)
+ return CMPI_ERROR_UNKNOWN;
fprintf(to_cmpi, "%s", data);
fflush(to_cmpi);
char result[32];
fscanf(from_cmpi, "%s\n", result);
- if (strncmp(result, "ok", 2) != 0)
+ if (strncmp(result, "ok", 2))
return CMPI_ERROR_UNKNOWN;
+ // printf("cmpi_cp_put(): complete\n");
+
return CMPI_SUCCESS;
}
int
cmpi_cp_get(char* object, FILE* file)
{
+ // char message[64];
char data[value_size];
int count, c;
int length;
+ // printf("cmpi_cp_get()\n");
+ // fflush(stdout);
+
fprintf(to_cmpi, "get %s\n", object);
fflush(to_cmpi);
- fscanf(from_cmpi, "%i\n", &length);
+ c = fscanf(from_cmpi, "%i\n", &length);
+ // printf("message: %i\n", c);
+ // printf("message: %s\n", message);
+ // sscanf(message, "%i", &length);
if (length == -1)
return CMPI_DOESNT_EXIST;
+ // printf("metadata length: %i\n", length);
+ // fflush(stdout);
+
c = stream_to_buffer(data, length, from_cmpi);
c = sscanf(data, "DHT: %i\n", &count);
if (c != 1)
@@ -137,8 +152,8 @@
fprintf(to_cmpi, "get %s[%i]\n", object, c);
fflush(to_cmpi);
fscanf(from_cmpi, "%i", &length);
- printf("incoming length: %i\n", length);
- fgetc(from_cmpi);
+ // printf("incoming length: %i\n", length);
+ // fgetc(from_cmpi);
if (length == -1)
{
printf("not found: %s[%i]\n", object, c);
@@ -146,8 +161,12 @@
}
stream_to_buffer(data, length, from_cmpi);
+ // printf("got buffer\n");
buffer_to_stream(data, length, file);
}
+
+ // printf("cmpi_cp_get(): complete\n");
+
return CMPI_SUCCESS;
}
@@ -211,6 +230,8 @@
{
printf("\ncmpi-cp start\n\n");
+ fflush(stdout);
+
CMPI_CP_TYPE target1_type;
CMPI_CP_TYPE target2_type;
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2010-05-12 19:20:20 UTC (rev 103)
+++ src/dense-1/dense.c 2010-05-12 19:59:36 UTC (rev 104)
@@ -25,7 +25,7 @@
MPIRPC_Node* nodes;
-int k = 3;
+int k = 1;
void
DENSE_Init(int k_in, MPI_Comm comm)
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-12 19:20:20 UTC (rev 103)
+++ test/cmpi-db/module.mk.in 2010-05-12 19:59:36 UTC (rev 104)
@@ -1,6 +1,7 @@
TEST_CMPIDB_OUTPUT = test/cmpi-db/test-quit.out \
- test/cmpi-db/test-cp1.out
+ test/cmpi-db/test-cp1.out \
+ test/cmpi-db/test-loop.out
TEST_OUTPUT += $(TEST_CMPIDB_OUTPUT)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-12 23:55:14
|
Revision: 109
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=109&view=rev
Author: jmwozniak
Date: 2010-05-12 23:55:08 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Test fixes
Modified Paths:
--------------
include/cmpi_mode.h
src/cmpi/driver.c
src/cmpi/mode_mono.c
src/cmpi/mode_rr.c
src/cmpi/module.mk.in
src/cmpi/node.c
src/cmpi-cp/cmpi-cp.c
src/cmpi-db/cmpi-db-fifo.c
src/dense-1/dense.c
src/mpirpc/mpirpc.c
test/driver/module.mk.in
test/driver/test-cmd-get.c
test/driver/test-cmd-put.c
test/driver/test-cmd-sleep.c
Modified: include/cmpi_mode.h
===================================================================
--- include/cmpi_mode.h 2010-05-12 20:44:33 UTC (rev 108)
+++ include/cmpi_mode.h 2010-05-12 23:55:08 UTC (rev 109)
@@ -3,3 +3,5 @@
int cmpi_mode_select(int rank, int size, int nodes);
struct inlist* cmpi_mode_contacts(int rank, int size, int nodes);
+int cmpi_mode_next(int rank, int size, int nodes);
+int cmpi_mode_first_client(int rank, int size, int nodes);
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi/driver.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -61,6 +61,7 @@
printf("Could not create fifo: %s\n", fifo_in);
return false;
}
+ NOTE_S("created fifo: ", fifo_in);
error = mkfifo(fifo_out, S_IRUSR|S_IWUSR);
if (error != 0 &&
errno != EEXIST)
@@ -68,6 +69,7 @@
printf("Could not create fifo: %s\n", fifo_in);
return false;
}
+ NOTE_S("created fifo: ", fifo_out);
driver->source = fopen(fifo_in, "r");
if (driver->source == NULL)
@@ -98,6 +100,7 @@
fprintf(driver->sink, "ok\n");
fflush(driver->sink);
+ OK;
NOTE("reading to buffer");
stream_to_buffer(value, length, driver->source);
NOTE("got buffer");
@@ -164,6 +167,7 @@
sleep(i);
fprintf(driver->sink, "ok\n");
fflush(driver->sink);
+ NOTE("awake");
}
void
@@ -220,7 +224,6 @@
}
else if (strncmp(optoken, "sleep", 5) == 0)
{
- printf("sleep\n");
driver_sleep(driver, tokens);
}
else if (strncmp(optoken, "quit", 4) == 0)
Modified: src/cmpi/mode_mono.c
===================================================================
--- src/cmpi/mode_mono.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi/mode_mono.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -24,3 +24,32 @@
return result;
}
+
+int cmpi_mode_next(int rank, int size, int nodes)
+{
+ int result;
+ int mode = cmpi_mode_select(rank, size, nodes);
+
+ if (mode == CMPI_MODE_NODE)
+ {
+ int next = rank+1;
+ if (next > nodes-1)
+ result = -1;
+ else
+ result = next;
+ }
+ else
+ {
+ int next = rank+1;
+ if (next >= size)
+ result = -1;
+ else
+ result = next;
+ }
+ return result;
+}
+
+int cmpi_mode_first_client(int rank, int size, int nodes)
+{
+ return nodes;
+}
Modified: src/cmpi/mode_rr.c
===================================================================
--- src/cmpi/mode_rr.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi/mode_rr.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -9,7 +9,8 @@
*/
int cmpi_mode_select(int rank, int size, int nodes)
{
- if (rank > size/2)
+ NOTE("using mode_rr");
+ if (rank >= size/2)
return CMPI_MODE_CLIENT;
return CMPI_MODE_NODE;
}
Modified: src/cmpi/module.mk.in
===================================================================
--- src/cmpi/module.mk.in 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi/module.mk.in 2010-05-12 23:55:08 UTC (rev 109)
@@ -8,7 +8,7 @@
CMPI_SRC += $(DIR)/accessor.c
MODE = $(DIR)/mode_mono.c
-#MODE = $(DIR)/mode_db.c
+#MODE = $(DIR)/mode_rr.c
CMPI_SRC += $(MODE)
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi/node.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -12,6 +12,7 @@
#include <node.h>
#include <cmpi_mode.h>
+#include <io_tools.h>
int nodes;
MPI_Comm cmpi_comm_clients;
@@ -185,6 +186,15 @@
build_client_communicator();
+ sleep(1);
+
+ char hostname[128];
+ char* buffer;
+ int length = file_to_buffer(&buffer, "/etc/hostname");
+ memset(hostname, 0, 128);
+ memcpy(hostname, buffer, length);
+ NOTE_S("hostname: ", hostname);
+
if (cmpi_mode_select(mpi_rank, mpi_size, nodes) == CMPI_MODE_NODE)
{
NOTE("I am node");
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi-cp/cmpi-cp.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -228,7 +228,7 @@
int
main(int argc, char* argv[])
{
- printf("\ncmpi-cp start\n\n");
+ // printf("\ncmpi-cp start\n\n");
fflush(stdout);
Modified: src/cmpi-db/cmpi-db-fifo.c
===================================================================
--- src/cmpi-db/cmpi-db-fifo.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/cmpi-db/cmpi-db-fifo.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -11,7 +11,11 @@
MPI_Status status;
MPI_Recv(&tmp, 1, MPI_INT,
MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
- assert(tmp == -2);
+ if (tmp != -2)
+ {
+ NOTE("notification error!\n");
+ exit(1);
+ }
}
void
@@ -20,11 +24,12 @@
if (mpi_rank < mpi_size-1)
{
int msg = -2;
+ NOTE_I("notifying: ", mpi_rank+1);
MPI_Send(&msg, 1, MPI_INT, mpi_rank+1, 0, MPI_COMM_WORLD);
}
else
{
- // NOTE("NOTIFICATION COMPLETE");
+ NOTE("NOTIFICATION COMPLETE");
}
}
@@ -35,7 +40,6 @@
NOTE("CMPI-DB-FIFO...");
-
wait_for_notification();
notify_next();
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/dense-1/dense.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -1,5 +1,6 @@
#include <dense-1.h>
+#include <cmpi_mode.h>
/**
Number of service nodes.
@@ -70,17 +71,20 @@
void
rpc_bootping()
{
- if (mpi_rank < dense_nodes-1)
+ int next = cmpi_mode_next(mpi_rank, mpi_size, dense_nodes);
+ if (next > 0)
{
MPIRPC_Node node;
- MPIRPC_Node_make(MPI_COMM_WORLD, mpi_rank+1, &node);
+ MPIRPC_Node_make(MPI_COMM_WORLD, next, &node);
MPIRPC_Block(node, "bootping", NULL);
}
else
{
+ int client =
+ cmpi_mode_first_client(mpi_rank, mpi_size, dense_nodes);
NOTE("NOTIFYING");
int msg = -2;
- MPI_Send(&msg, 1, MPI_INT, mpi_rank+1, 0, MPI_COMM_WORLD);
+ MPI_Send(&msg, 1, MPI_INT, client, 0, MPI_COMM_WORLD);
}
}
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2010-05-12 20:44:33 UTC (rev 108)
+++ src/mpirpc/mpirpc.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -733,6 +733,7 @@
MPIRPC_Disconnect(caller);
break;
default:
+ printf("bad msg from: %i\n", caller.rank);
assert(false);
}
}
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-12 20:44:33 UTC (rev 108)
+++ test/driver/module.mk.in 2010-05-12 23:55:08 UTC (rev 109)
@@ -24,13 +24,13 @@
TEST_DRIVER_IMPL = test/driver/test_driver_fifo.o
$(TEST_DRIVER): $(TEST_DRIVER_IMPL) test/driver/test_helpers.o $(CMPI)
- $(Q) " MPICC $(@) "
+ $(Q) " LINK $(@) "
$(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o \
$(CMPI) $(LIBS) -o $(@)
test/driver/test%.x: test/driver/test%.o test/driver/test_helpers.o \
$(CMPI)
- $(Q) " MPICC $(@) "
+ $(Q) " LINK $(@) "
$(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o $(CMPI) $(LIBS) -o $(@)
test/driver/test%.out: test/driver/test%.zsh $(TEST_PROGS) $(TEST_DRIVER)
Modified: test/driver/test-cmd-get.c
===================================================================
--- test/driver/test-cmd-get.c 2010-05-12 20:44:33 UTC (rev 108)
+++ test/driver/test-cmd-get.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -32,19 +32,23 @@
char* key = argv[1];
- fprintf(to_cmpi, "get %s\n", key);
+ fprintf(to_cmpi, "get %s\n", key);
fflush(to_cmpi);
int length;
- code = fscanf(from_cmpi, "%i\n", &length);
- printf("length: %i\n");
- if (code != 1)
- crash("No response from driver!");
+ char message[32];
+ fgets(message, 32, from_cmpi); // &length);
+ // printf("length: %s\n", message);
+ // if (code != 1)
+ // crash("No response from driver!");
// printf("length: %i code: %i \n", length, code);
+ sscanf(message, "%i", &length);
+
if (length == -1)
crash("Key not found!");
+ // printf("read stream\n");
char* result = malloc(length*sizeof(char));
memset(result, 0, length);
int total = stream_to_buffer(result, length, from_cmpi);
Modified: test/driver/test-cmd-put.c
===================================================================
--- test/driver/test-cmd-put.c 2010-05-12 20:44:33 UTC (rev 108)
+++ test/driver/test-cmd-put.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -21,14 +21,21 @@
char* data = "hello";
+ char output[32];
+ int tmp;
+
fprintf(to_cmpi, "put %s %i\n", key, (int) strlen(data)+1);
- fprintf(to_cmpi, "%s%c", data, '\0');
fflush(to_cmpi);
+ fgets(output, 128, from_cmpi);
+ assert(!strncmp(output, "ok", 2));
+ // printf("got ok\n");
- char output[32];
- fscanf(from_cmpi, "%s", output);
+ int i = fwrite(data, sizeof(char), strlen(data)+1, to_cmpi);
+ // printf("wrote: %i\n", i);
+ fflush(to_cmpi);
- assert(!strcmp(output, "ok"));
+ fgets(output, 128, from_cmpi);
+ assert(!strncmp(output, "ok", 2));
return 0;
}
Modified: test/driver/test-cmd-sleep.c
===================================================================
--- test/driver/test-cmd-sleep.c 2010-05-12 20:44:33 UTC (rev 108)
+++ test/driver/test-cmd-sleep.c 2010-05-12 23:55:08 UTC (rev 109)
@@ -29,7 +29,12 @@
char output[32];
fscanf(from_cmpi, "%s", output);
- assert(!strcmp(output, "ok"));
+ if (!(output[0] == 'o' &&
+ output[1] == 'k'))
+ {
+ printf("bad output: %s\n", output);
+ exit(1);
+ }
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-14 20:34:58
|
Revision: 124
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=124&view=rev
Author: jmwozniak
Date: 2010-05-14 20:34:52 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Fix tests for test/cmpi-db
Modified Paths:
--------------
src/cmpi/driver.c
src/cmpi/mode_mono.c
src/dense-1/dense.c
test/cmpi-db/module.mk.in
test/cmpi-db/test-cp1.zsh
test/cmpi-db/test-loop.zsh
test/cmpi-db/test-quit.zsh
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-14 20:32:54 UTC (rev 123)
+++ src/cmpi/driver.c 2010-05-14 20:34:52 UTC (rev 124)
@@ -56,7 +56,7 @@
unlink(fifo_in);
unlink(fifo_out);
-
+
int error = mkfifo(fifo_in, S_IRUSR|S_IWUSR);
if (error != 0 &&
errno != EEXIST)
@@ -184,7 +184,6 @@
fprintf(driver->sink, "ok\n");
fflush(driver->sink);
- NOTE("sent ok");
sleep(1);
cmpi_shutdown();
@@ -257,7 +256,7 @@
*s = '\0';
driver_execute(driver);
}
- gossip_ldebug(MASK_DRIVER, "Closing driver...\n");
+ NOTE("Closing driver...");
fclose(driver->source);
fclose(driver->sink);
}
Modified: src/cmpi/mode_mono.c
===================================================================
--- src/cmpi/mode_mono.c 2010-05-14 20:32:54 UTC (rev 123)
+++ src/cmpi/mode_mono.c 2010-05-14 20:34:52 UTC (rev 124)
@@ -57,9 +57,12 @@
/**
Obtain the list of nodes that this rank is
responsible for instructing to quit.
+ Should only be called by clients.
*/
struct inlist* cmpi_shutdown_list(int rank, int size, int nodes)
{
+ NOTE_F;
+
struct inlist* result = inlist_create();
int mode = cmpi_mode_select(rank, size, nodes);
@@ -67,10 +70,8 @@
int first = cmpi_mode_first_client(rank, size, nodes);
if (rank == first)
- {
for (int i = 0; i < nodes; i++)
inlist_add(result, i);
- }
return result;
}
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2010-05-14 20:32:54 UTC (rev 123)
+++ src/dense-1/dense.c 2010-05-14 20:34:52 UTC (rev 124)
@@ -218,7 +218,8 @@
}
void
-handle_bootping(MPIRPC_Node caller, int unique, char* args, char* blob, int blob_length)
+handle_bootping(MPIRPC_Node caller, int unique, char* args,
+ char* blob, int blob_length)
{
MPIRPC_Null(caller, unique);
rpc_bootping();
@@ -344,4 +345,3 @@
dense_quitting = true;
// TODO: cleanup
}
-
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-14 20:32:54 UTC (rev 123)
+++ test/cmpi-db/module.mk.in 2010-05-14 20:34:52 UTC (rev 124)
@@ -10,10 +10,19 @@
CMPIDBQUIT = bin/cmpi-db-quit
CMPIDB_TOOLS = $(CMPIDB) $(CMPICP) $(CMPIDBQUIT)
+ifeq (@USE_CMPI_MODE@,MONO)
+ NODES := 5
+ CLIENTS := 1
+else
+ NODES := 3
+ CLIENTS := 3
+endif
+
+
test/cmpi-db/test-%.out: test/cmpi-db/test-%.zsh $(CMPIDB_TOOLS)
$(Q) " TEST $(@) "
$(E) $(MPDCHECK)
- $(E) $(<) $(@) 4 3
+ $(E) $(<) $(@) $(NODES) $(CLIENTS)
test/cmpi-db/test-success.out: test/driver/test-success.out \
$(TEST_CMPIDB_OUTPUT)
Modified: test/cmpi-db/test-cp1.zsh
===================================================================
--- test/cmpi-db/test-cp1.zsh 2010-05-14 20:32:54 UTC (rev 123)
+++ test/cmpi-db/test-cp1.zsh 2010-05-14 20:34:52 UTC (rev 124)
@@ -2,21 +2,23 @@
# Be sure to make tests with D=1
-# set -x
+#set -x
OUTPUT=$1
-PROCS=$2
-NODES=$3
+NODES=$2
+CLIENTS=$3
+TOTAL=$(( NODES+CLIENTS ))
+
source tools/test-helpers.zsh
-mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
+mpiexec -n ${TOTAL} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
DB_PID=${!}
-tools/timebomb.zsh ${DB_PID} $(( PROCS*4 )) ${OUTPUT} $0 &
+tools/timebomb.zsh ${DB_PID} $(( TOTAL*4 )) ${OUTPUT} $0 &
BOMB_PID=${!}
-sleep ${PROCS}
+sleep ${TOTAL}
echo "DATA" > test-cp1.input.data
echo "cmpi-cp insert" >& cmpi-cp.out
@@ -44,11 +46,10 @@
kill ${BOMB_PID}
-sleep ${PROCS}
+sleep ${TOTAL}
-# Should be ${PROCS} "Normal exit."s
-N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == PROCS )) || crash "N != ${PROCS}"
+# Should be ${TOTAL} "Normal exit."s
+check_exits ${TOTAL} ${OUTPUT}
rm -f cmpi-cp.out test-cp1.*.data
Modified: test/cmpi-db/test-loop.zsh
===================================================================
--- test/cmpi-db/test-loop.zsh 2010-05-14 20:32:54 UTC (rev 123)
+++ test/cmpi-db/test-loop.zsh 2010-05-14 20:34:52 UTC (rev 124)
@@ -5,20 +5,22 @@
# set -x
OUTPUT=$1
-PROCS=$2
-NODES=$3
+NODES=$2
+CLIENTS=$3
+TOTAL=$(( NODES+CLIENTS ))
+
LOOPS=10
source tools/test-helpers.zsh
-mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
+mpiexec -n ${TOTAL} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
DB_PID=${!}
-tools/timebomb.zsh ${DB_PID} $(( PROCS*4 + LOOPS )) ${OUTPUT} $0 &
+tools/timebomb.zsh ${DB_PID} $(( TOTAL*4 + LOOPS )) ${OUTPUT} $0 &
BOMB_PID=${!}
-sleep ${PROCS}
+sleep ${TOTAL}
print > cmpi-cp.out
for ((i=0 ; i<LOOPS ; i++))
@@ -53,11 +55,9 @@
kill ${BOMB_PID}
-sleep ${PROCS}
+sleep ${TOTAL}
-# Should be ${PROCS} "Normal exit."s
-N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == PROCS )) || crash "N != ${PROCS}"
+check_exits ${TOTAL} ${OUTPUT}
rm -f cmpi-cp.out test-cp1.*.data
Modified: test/cmpi-db/test-quit.zsh
===================================================================
--- test/cmpi-db/test-quit.zsh 2010-05-14 20:32:54 UTC (rev 123)
+++ test/cmpi-db/test-quit.zsh 2010-05-14 20:34:52 UTC (rev 124)
@@ -5,23 +5,22 @@
# set -x
OUTPUT=$1
-PROCS=$2
-NODES=$3
+NODES=$2
+CLIENTS=$3
+TOTAL=$(( NODES+CLIENTS ))
+
source tools/test-helpers.zsh
-mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
+mpiexec -n ${TOTAL} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
MPI_PROCESS=$!
-sleep ${PROCS}
+sleep ${TOTAL}
-bin/cmpi-db-quit >& /dev/null &
-QUIT_PROCESS=$!
+bin/cmpi-db-quit >& /dev/null
-sleep ${PROCS}
+sleep ${TOTAL}
-# Should be ${PROCS} "Normal exit."s
-N=$( grep -c "Normal exit." ${OUTPUT} )
-(( N == PROCS )) || crash "N != ${PROCS}"
+check_exits ${TOTAL} ${OUTPUT}
exit 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-20 17:03:59
|
Revision: 131
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=131&view=rev
Author: jmwozniak
Date: 2010-05-20 17:03:51 +0000 (Thu, 20 May 2010)
Log Message:
-----------
Test mods to enable user selection of driver fifo dir
Modified Paths:
--------------
include/accessor.h
src/cmpi/accessor.c
src/cmpi-cp/cmpi-cp.c
src/cmpi-db/cmpi-db-fifo-quit.c
test/cmpi-db/test-quit.zsh
test/driver/module.mk.in
test/driver/test-cmd-get.c
test/driver/test-cmd-put.c
test/driver/test-cmd-quit.c
test/driver/test-cmd-sleep.c
test/driver/test-get.zsh
test/driver/test-put.zsh
test/driver/test-quit.zsh
test/driver/test-sleep.zsh
test/driver/test_helpers.h
tools/timebomb.zsh
Added Paths:
-----------
test/driver/test-cmd.c
test/driver/test-cmd.h
test/driver/test.zsh
Modified: include/accessor.h
===================================================================
--- include/accessor.h 2010-05-18 18:18:08 UTC (rev 130)
+++ include/accessor.h 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,11 +1,12 @@
#include <stdbool.h>
#include <stdio.h>
-#include <stdlib.h>
FILE* to_cmpi;
FILE* from_cmpi;
+void driver_access_fifo_setup(char* dir);
+
bool driver_access_fifo(void);
void driver_access_fifo_close(void);
Modified: src/cmpi/accessor.c
===================================================================
--- src/cmpi/accessor.c 2010-05-18 18:18:08 UTC (rev 130)
+++ src/cmpi/accessor.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,14 +1,42 @@
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+
#include <accessor.h>
+char* fifo_in = NULL;
+char* fifo_out = NULL;
+
+void
+driver_access_fifo_setup(char* dir)
+{
+ if (!dir)
+ dir = "/tmp";
+
+ fifo_in = malloc(1024*sizeof(char));
+ fifo_out = malloc(1024*sizeof(char));
+
+ fifo_in[0] = '\0';
+ fifo_out[0] = '\0';
+
+ strcat(fifo_in, dir);
+ strcat(fifo_in, "/cmpi.fifo.in");
+
+ strcat(fifo_out, dir);
+ strcat(fifo_out, "/cmpi.fifo.out");
+
+ // printf("fifo_in: %s\n", fifo_in);
+ // printf("fifo_out: %s\n", fifo_out);
+}
+
/**
@return True iff successfully access to fifos is made.
*/
bool
driver_access_fifo()
{
- char fifo_in[20] = "/tmp/cmpi.fifo.in";
- char fifo_out[20] = "/tmp/cmpi.fifo.out";
+ assert(fifo_in);
to_cmpi = fopen(fifo_in, "w");
if (to_cmpi == NULL)
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-05-18 18:18:08 UTC (rev 130)
+++ src/cmpi-cp/cmpi-cp.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -252,6 +252,7 @@
exit(1);
}
+ driver_access_fifo_setup(NULL);
driver_access_fifo();
int result =
Modified: src/cmpi-db/cmpi-db-fifo-quit.c
===================================================================
--- src/cmpi-db/cmpi-db-fifo-quit.c 2010-05-18 18:18:08 UTC (rev 130)
+++ src/cmpi-db/cmpi-db-fifo-quit.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,4 +1,5 @@
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -10,7 +11,9 @@
{
char msg[100];
- driver_access_fifo();
+ driver_access_fifo_setup(NULL);
+ bool success = driver_access_fifo();
+ assert(success);
fprintf(to_cmpi, "quit\n");
fflush(to_cmpi);
Modified: test/cmpi-db/test-quit.zsh
===================================================================
--- test/cmpi-db/test-quit.zsh 2010-05-18 18:18:08 UTC (rev 130)
+++ test/cmpi-db/test-quit.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -17,7 +17,7 @@
sleep ${TOTAL}
-bin/cmpi-db-quit >& /dev/null
+bin/cmpi-db-quit
sleep ${TOTAL}
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/module.mk.in 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,7 +1,10 @@
DIR := test/driver
-TEST_DRIVER_SRC += $(shell find test/driver -name "*.c" ! -name test_helpers.c)
+TEST_DRIVER_SRC += test-cmd-quit.c \
+ test-cmd-sleep.c \
+ test-cmd-put.c \
+ test-cmd-get.c
TEST_DRIVER_OBJS = $(patsubst %.c, %.o, $(TEST_DRIVER_SRC))
TEST_DRIVER_OUTPUT = test/driver/test-quit.out \
@@ -9,13 +12,13 @@
test/driver/test-put.out \
test/driver/test-get.out
-TEST_HELPER_SRC := test/driver/test_helpers.c
+TEST_HELPER_SRC := test/driver/test_helpers.c test/driver/test-cmd.c
TEST_DRIVER_OBJS += $(patsubst %.c, %.o, $(TEST_HELPER_SRC))
TEST_SRC += $(TEST_DRIVER_SRC)
TEST_OBJS += $(TEST_DRIVER_OBJS)
-TEST_DRIVER_CMDS = $(shell find test/driver -name test-cmd*.c )
+TEST_DRIVER_CMDS = $(shell find test/driver -name test-cmd-*.c )
TEST_PROGS += $(patsubst %.c, %.x, $(TEST_DRIVER_CMDS))
TEST_PROGS += test/driver/test_driver.x
TEST_OUTPUT += $(TEST_DRIVER_OUTPUT)
@@ -37,13 +40,14 @@
$(CMPI) $(LIBS) -o $(@)
test/driver/test%.x: test/driver/test%.o test/driver/test_helpers.o \
- $(CMPI)
+ test/driver/test-cmd.o $(CMPI)
$(Q) " LINK $(@) "
- $(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o $(CMPI) $(LIBS) -o $(@)
+ $(E) $(MPICC) $(MPE) $(<) test/driver/test_helpers.o \
+ test/driver/test-cmd.o $(CMPI) $(LIBS) -o $(@)
test/driver/test%.out: test/driver/test%.zsh $(TEST_PROGS) $(TEST_DRIVER)
$(Q) " TEST $(@) "
- $(E) test/driver/test.zsh $(@) $(NODES) $(CLIENTS) $(<) $(CMPI_OPTS)
+ $(E) test/driver/test.zsh $(@) $(NODES) $(CLIENTS) $(<) $(DRIVER_DIR)
test/driver/test-success.out: test/cmpi/test-success.out \
$(TEST_DRIVER_OUTPUT)
Modified: test/driver/test-cmd-get.c
===================================================================
--- test/driver/test-cmd-get.c 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-cmd-get.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -8,6 +8,8 @@
#include <mpi_tools.h>
#include <io_tools.h>
+#include "test-cmd.h"
+
void
crash(char* message)
{
@@ -21,17 +23,13 @@
{
int code;
- if (argc < 2)
- {
- printf("test-cmd-get: needs key argument!\n");
- exit(1);
- }
+ test_cmd_setup(argc, argv);
+ char* key = argv[optind];
+
code = driver_access_fifo();
assert(code);
- char* key = argv[1];
-
fprintf(to_cmpi, "get %s\n", key);
fflush(to_cmpi);
Modified: test/driver/test-cmd-put.c
===================================================================
--- test/driver/test-cmd-put.c 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-cmd-put.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,24 +1,24 @@
#include <assert.h>
+#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <accessor.h>
+#include "test-cmd.h"
+
int
main(int argc, char* argv[])
{
+ test_cmd_setup(argc, argv);
+
driver_access_fifo();
- if (argc < 2)
- {
- printf("test-cmd-put: needs key argument!\n");
- exit(1);
- }
+ char* key = argv[optind];
+ // printf("key: %s\n", key);
- char* key = argv[1];
-
char* data = "hello";
char output[32];
Modified: test/driver/test-cmd-quit.c
===================================================================
--- test/driver/test-cmd-quit.c 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-cmd-quit.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -5,11 +5,15 @@
#include <mpi_tools.h>
#include <accessor.h>
+#include "test-cmd.h"
+
int
main(int argc, char* argv[])
{
int error;
+ test_cmd_setup(argc, argv);
+
error = driver_access_fifo();
assert(error);
Modified: test/driver/test-cmd-sleep.c
===================================================================
--- test/driver/test-cmd-sleep.c 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-cmd-sleep.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -6,25 +6,19 @@
#include <accessor.h>
+#include "test-cmd.h"
+
int
main(int argc, char* argv[])
{
int code;
- int seconds;
- if (argc < 2)
- {
- printf("test-cmd-sleep: needs seconds argument!\n");
- exit(1);
- }
+ test_cmd_setup(argc, argv);
- code = sscanf(argv[1], "%i", &seconds);
- assert(code == 1);
-
code = driver_access_fifo();
assert(code);
- fprintf(to_cmpi, "sleep %i\n", seconds);
+ fprintf(to_cmpi, "sleep %i\n", sleep_time);
fflush(to_cmpi);
char output[32];
fscanf(from_cmpi, "%s", output);
Added: test/driver/test-cmd.c
===================================================================
--- test/driver/test-cmd.c (rev 0)
+++ test/driver/test-cmd.c 2010-05-20 17:03:51 UTC (rev 131)
@@ -0,0 +1,57 @@
+
+#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <accessor.h>
+
+#include "test-cmd.h"
+
+int sleep_time;
+
+void test_cmd_setup(int argc, char* argv[])
+{
+ char* dir = NULL;
+
+ int c;
+ while ((c = getopt(argc, argv, "d:s:")) != -1)
+ {
+ int n;
+ switch (c)
+ {
+ case 'd':
+ {
+ // Set driver directory:
+ dir = malloc(1024);
+ n = sscanf(optarg, "%s", dir);
+ if (n == 0)
+ {
+ printf("test-cmd -d got no argument!\n");
+ exit(1);
+ }
+ break;
+ }
+ case 's':
+ {
+ // Set sleep interval for test-cmd-sleep
+ n = sscanf(optarg, "%i", &sleep_time);
+ if (n == 0)
+ {
+ printf("test-cmd -s got no argument!\n");
+ exit(1);
+ }
+ break;
+ }
+ default:
+ {
+ printf("test-cmd got bad argument!\n");
+ exit(1);
+ }
+ }
+ }
+
+ // printf("cmd -d %s\n", dir);
+
+ driver_access_fifo_setup(dir);
+}
Added: test/driver/test-cmd.h
===================================================================
--- test/driver/test-cmd.h (rev 0)
+++ test/driver/test-cmd.h 2010-05-20 17:03:51 UTC (rev 131)
@@ -0,0 +1,6 @@
+
+#include <getopt.h>
+
+extern int sleep_time;
+
+void test_cmd_setup(int argc, char* argv[]);
Modified: test/driver/test-get.zsh
===================================================================
--- test/driver/test-get.zsh 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-get.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,5 +1,5 @@
-test/driver/test-cmd-put.x sample-key
-test/driver/test-cmd-sleep.x 1
-test/driver/test-cmd-get.x sample-key
+test/driver/test-cmd-put.x -d ${DRIVER_DIR} sample-key
+test/driver/test-cmd-sleep.x -d ${DRIVER_DIR} -s 1
+test/driver/test-cmd-get.x -d ${DRIVER_DIR} sample-key
[[ $? == 0 ]] || bail "could not get: sample-key"
-test/driver/test-cmd-quit.x
+test/driver/test-cmd-quit.x -d ${DRIVER_DIR}
Modified: test/driver/test-put.zsh
===================================================================
--- test/driver/test-put.zsh 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-put.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,3 +1,3 @@
-test/driver/test-cmd-put.x sample-key
-test/driver/test-cmd-sleep.x 1
-test/driver/test-cmd-quit.x
+test/driver/test-cmd-put.x -d ${DRIVER_DIR} sample-key
+test/driver/test-cmd-sleep.x -d ${DRIVER_DIR} -s 1
+test/driver/test-cmd-quit.x -d ${DRIVER_DIR}
Modified: test/driver/test-quit.zsh
===================================================================
--- test/driver/test-quit.zsh 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-quit.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -1 +1 @@
-test/driver/test-cmd-quit.x
+test/driver/test-cmd-quit.x -d ${DRIVER_DIR}
Modified: test/driver/test-sleep.zsh
===================================================================
--- test/driver/test-sleep.zsh 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test-sleep.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,4 +1,4 @@
-test/driver/test-cmd-sleep.x 1
-test/driver/test-cmd-sleep.x 1
-test/driver/test-cmd-sleep.x 1
-test/driver/test-cmd-quit.x
+test/driver/test-cmd-sleep.x -d ${DRIVER_DIR} 1
+test/driver/test-cmd-sleep.x -d ${DRIVER_DIR} 1
+test/driver/test-cmd-sleep.x -d ${DRIVER_DIR} 1
+test/driver/test-cmd-quit.x -d ${DRIVER_DIR}
Added: test/driver/test.zsh
===================================================================
--- test/driver/test.zsh (rev 0)
+++ test/driver/test.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -0,0 +1,43 @@
+#!/bin/zsh
+
+OUTPUT=$1
+NODES=$2
+CLIENTS=$3
+CMDS=$4
+DRIVER_DIR=$5
+
+TOTAL=$(( NODES+CLIENTS ))
+
+source tools/test-helpers.zsh
+
+bail()
+{
+ kill ${BOMB_PID}
+ crash $1
+}
+
+# set -x
+
+if [[ ${DRIVER_DIR} == "" ]]
+then
+ DRIVER_DIR="/tmp"
+fi
+CMPI_OPTS="-p driver_dir=${DRIVER_DIR}"
+
+DRIVER=test/driver/test_driver.x
+mpiexec -n ${TOTAL} ${DRIVER} -n ${NODES} ${CMPI_OPTS} > ${OUTPUT} &
+DRIVER_PID=${!}
+
+tools/timebomb.zsh ${$} 20 ${OUTPUT} $0 &
+BOMB_PID=${!}
+
+sleep 3
+
+source ${CMDS}
+
+wait ${DRIVER_PID}
+kill ${BOMB_PID}
+
+check_exits ${TOTAL} ${OUTPUT}
+
+return 0
Property changes on: test/driver/test.zsh
___________________________________________________________________
Added: svn:executable
+ *
Modified: test/driver/test_helpers.h
===================================================================
--- test/driver/test_helpers.h 2010-05-18 18:18:08 UTC (rev 130)
+++ test/driver/test_helpers.h 2010-05-20 17:03:51 UTC (rev 131)
@@ -1,20 +1,20 @@
-// #include <stdio.h>
+// #include <stdio.h>
#ifndef TEST_HELPERS_H
#define TEST_HELPERS_H
#include <node.h>
-#include <gossip.h>
+#include <gossip.h>
/**
- Print debugging header using machine-specific information.
+ Print debugging header using machine-specific information.
*/
void print_header(void);
-char* useless_data(int size);
+char* useless_data(int size);
-void wait_for_notification(void);
-void notify_next(void);
+void wait_for_notification(void);
+void notify_next(void);
#endif
Modified: tools/timebomb.zsh
===================================================================
--- tools/timebomb.zsh 2010-05-18 18:18:08 UTC (rev 130)
+++ tools/timebomb.zsh 2010-05-20 17:03:51 UTC (rev 131)
@@ -10,8 +10,8 @@
print "timebomb killing: ${LABEL} PID: ${TARGET}"
-cp -v ${DATA} ${DATA}.bombed
+mv -v ${DATA} ${DATA}.bombed
-sleep 3
+sleep 1
kill -9 ${TARGET}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-20 19:32:40
|
Revision: 133
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=133&view=rev
Author: jmwozniak
Date: 2010-05-20 19:32:34 +0000 (Thu, 20 May 2010)
Log Message:
-----------
Start fixing DMALLOC functionality
Modified Paths:
--------------
include/mpi_tools.h
include/mpirpc.h
src/cmpi/node.c
src/mpi_tools/mpi_tools.c
test/mpirpc/test-ping.c
Modified: include/mpi_tools.h
===================================================================
--- include/mpi_tools.h 2010-05-20 18:19:24 UTC (rev 132)
+++ include/mpi_tools.h 2010-05-20 19:32:34 UTC (rev 133)
@@ -1,6 +1,6 @@
-#ifndef MPI_ROUTINES
-#define MPI_ROUTINES
+#ifndef MPI_TOOLS
+#define MPI_TOOLS
#include <assert.h>
#include <math.h>
@@ -340,27 +340,12 @@
#ifdef DMALLOC
#include <dmalloc.h>
#define DMALLOC_SETUP(x) x
+void dmalloc_setup(void);
#else
#define DMALLOC_SETUP(x)
#endif
/**
- Set up DMALLOC
-*/
-
-#ifdef DMALLOC
-void
-dmalloc_setup(void)
-{
- dmalloc_logpath = malloc(100);
- assert(dmalloc_logpath != NULL);
- sprintf(dmalloc_logpath, "./dmalloc_%i.out", debug_rank);
- printf("dmalloc_logpath: %s \n", dmalloc_logpath);
- fflush(NULL);
-}
-#endif
-
-/**
Return a number in [0,n-1].
*/
int roll(int n);
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2010-05-20 18:19:24 UTC (rev 132)
+++ include/mpirpc.h 2010-05-20 19:32:34 UTC (rev 133)
@@ -16,10 +16,6 @@
#include <mpi_tools.h>
-#ifdef DMALLOC
-#include <dmalloc.h>
-#endif
-
extern int unique;
extern useconds_t snooze_max;
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2010-05-20 18:19:24 UTC (rev 132)
+++ src/cmpi/node.c 2010-05-20 19:32:34 UTC (rev 133)
@@ -17,15 +17,7 @@
int cmpi_nodes;
MPI_Comm cmpi_comm_clients;
-#ifdef DMALLOC
void
-dmalloc_setup(void)
-{
- // sprintf(dmalloc_logpath, "./dmalloc_%i.out", debug_rank);
-}
-#endif
-
-void
options(int argc, char* argv[])
{
struct option options[] =
Modified: src/mpi_tools/mpi_tools.c
===================================================================
--- src/mpi_tools/mpi_tools.c 2010-05-20 18:19:24 UTC (rev 132)
+++ src/mpi_tools/mpi_tools.c 2010-05-20 19:32:34 UTC (rev 133)
@@ -455,3 +455,18 @@
}
#endif
#endif
+
+#ifdef DMALLOC
+/**
+ Set up DMALLOC output
+*/
+void
+dmalloc_setup(void)
+{
+ dmalloc_logpath = malloc(100);
+ assert(dmalloc_logpath != NULL);
+ sprintf(dmalloc_logpath, "./dmalloc_%i.out", debug_rank);
+ printf("dmalloc_logpath: %s \n", dmalloc_logpath);
+ fflush(NULL);
+}
+#endif
Modified: test/mpirpc/test-ping.c
===================================================================
--- test/mpirpc/test-ping.c 2010-05-20 18:19:24 UTC (rev 132)
+++ test/mpirpc/test-ping.c 2010-05-20 19:32:34 UTC (rev 133)
@@ -84,6 +84,7 @@
{
SHOW_S(dmalloc_logpath);
dmalloc_shutdown();
+ dmalloc_log_unfreed();
});
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-22 21:20:43
|
Revision: 143
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=143&view=rev
Author: jmwozniak
Date: 2010-05-22 21:20:37 +0000 (Sat, 22 May 2010)
Log Message:
-----------
Clean all leaks in test-dpkm_list
Modified Paths:
--------------
src/adts/dpkm_list.c
test/adts/test-dpkm_list.c
Modified: src/adts/dpkm_list.c
===================================================================
--- src/adts/dpkm_list.c 2010-05-22 20:54:17 UTC (rev 142)
+++ src/adts/dpkm_list.c 2010-05-22 21:20:37 UTC (rev 143)
@@ -17,8 +17,8 @@
/**
Adds item to tail.
- If list size exceeds limit, return item to flush.
- @return The new dpkm_list_item.
+ @return If list size exceeds limit,
+ return item to flush, else NULL.
*/
struct dpkm_list_item*
dpkm_list_add(struct dpkm_list* target, char* key, void* data, int length)
@@ -896,7 +896,8 @@
}
/**
- Free this dpkm_list and its data.
+ Free this dpkm_list and its data but not its
+ extra pointers.
*/
/*
void
Modified: test/adts/test-dpkm_list.c
===================================================================
--- test/adts/test-dpkm_list.c 2010-05-22 20:54:17 UTC (rev 142)
+++ test/adts/test-dpkm_list.c 2010-05-22 21:20:37 UTC (rev 143)
@@ -5,18 +5,41 @@
#include <dpkm_list.h>
+void extra(struct dpkm_list_item* item)
+{
+ if (item)
+ {
+ note_s("extra: ", item->key);
+ free(item);
+ }
+}
+
+void extra_data(struct dpkm_list_item* item)
+{
+ if (item)
+ {
+ note_s("extra: ", item->key);
+ printdata("data: ", item->data, strlen(item->data));
+ printf("\n");
+ free(item->data);
+ free(item);
+ }
+}
+
int
main(int argc, char* argv[])
{
MPI_Init(&argc, &argv);
whoami();
+ dmalloc_setup();
+
struct dpkm_list* L = dpkm_list_create(4);
char s[1000];
+ /// Begin tests with stack data...
int zero = 0;
- // int one = 1;
int two = 2;
int three = 3;
int four = 4;
@@ -26,37 +49,31 @@
struct dpkm_list_item* item;
item = dpkm_list_add(L, "two", &two, sizeof(int));
- if (item)
- printf("%s \n", item->key);
+ extra(item);
item = dpkm_list_add(L, "four", &four, sizeof(int));
- if (item)
- printf("%s \n", item->key);
+ extra(item);
item = dpkm_list_add(L, "three", &three, sizeof(int));
- if (item)
- printf("%s \n", item->key);
+ extra(item);
item = dpkm_list_add(L, "three", &three, sizeof(int));
- if (item)
- printf("%s \n", item->key);
+ extra(item);
item = dpkm_list_add(L, "four", &four, sizeof(int));
- if (item)
- printf("%s \n", item->key);
+ extra(item);
item = dpkm_list_add(L, "zero", &zero, sizeof(int));
- if (item)
- printf("%s \n", item->key);
+ extra(item);
- fflush(stdout);
-
dpkm_list_printf("%i", L);
printf("size: %i \n", L->size); // 4
- dpkm_list_add(L, "five", &five, sizeof(int));
+ item = dpkm_list_add(L, "five", &five, sizeof(int));
+ extra(item);
+ item = L->head;
dpkm_list_excise(L, L->head);
+ extra(item);
dpkm_list_printf("%i", L);
printf("size: %i \n", L->size); // 3
item = dpkm_list_add(L, "eight", &eight, sizeof(int));
- if (item)
- printf("%s \n", item->key);
+ extra(item);
dpkm_list_printf("%i", L);
printf("size: %i \n", L->size); // 4
@@ -64,11 +81,13 @@
printf("From string: %s\n", s);
item = dpkm_list_poll(L);
+ extra(item);
dpkm_list_printf("%i", L);
printf("size: %i \n", L->size); // 3
item = dpkm_list_search(L, "zero");
dpkm_list_excise(L, item);
+ extra(item);
dpkm_list_printf("%i", L);
note("polling...");
@@ -76,21 +95,31 @@
while ((item = dpkm_list_poll(L)))
{
printf("got: %s \n", item->key);
+ extra(item);
dpkm_list_printf("%i", L);
}
dpkm_list_tostring(s, 1000, "%i", L);
printf("From string: %s\n", s);
+ assert(L->size == 0);
+ dpkm_list_free(L);
+
struct dpkm_list* L2 = dpkm_list_create(4);
- char* binary = "data";
+ char* binary = heap("data");
dpkm_list_add(L2, "binary", binary, strlen(binary)+1);
dpkm_list_printdata(L2);
+ item = dpkm_list_poll(L2);
+ extra_data(item);
+
+ assert(L2->size == 0);
+ dpkm_list_free(L2);
+
+
/*
+
dpkm_list_printf("%i", L);
- dpkm_list_poll(L);
- dpkm_list_printf("%i", L);
dpkm_list_pop(L);
dpkm_list_printf("%i", L);
dpkm_list_add(L, &seven);
@@ -106,6 +135,9 @@
// printf("size(K): %i \n", K->size);
// dpkm_list_printf("%i", L);
+
+ DMALLOC_COMPLETE;
+
MPI_Finalize();
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-14 23:54:32
|
Revision: 168
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=168&view=rev
Author: jmwozniak
Date: 2011-04-14 23:54:25 +0000 (Thu, 14 Apr 2011)
Log Message:
-----------
Misc. code cleanups
Modified Paths:
--------------
Makefile.in
TODO.txt
include/cmpi-types.h
include/cmpi.h
include/cmpi_dense-1.h
include/inlist.h
include/kda-2.h
include/list.h
include/mpirpc.h
src/adts/About.txt
src/adts/inlist.c
src/adts/lru_table.c
src/cmpi/driver.c
src/cmpi/node.c
src/dense-1/cmpi_dense.c
src/dense-1/dense.c
src/kda-2/cmpi_kademlia.c
src/kda-2/kademlia.c
src/mpi_tools/mpi_tools.c
src/mpirpc/mpirpc.c
test/adts/test-dpkm_list.c
test/adts/test-inlist.c
test/adts/test-lru_table01.c
test/adts/test_helpers.h
test/cmpi/test-manyputs.c
test/cmpi/test-putget.c
test/cmpi/test-tables.c
test/cmpi/test-update01.c
test/cmpi/test-update02.c
test/driver/module.mk.in
test/driver/test-cmd-get.c
test/driver/test-cmd-quit.c
test/driver/test-cmd-sleep.c
test/driver/test-quit.zsh
test/driver/test.zsh
test/driver/test_driver_fifo.c
test/mpirpc/test-args.c
test/mpirpc/test-args.zsh
test/mpirpc/test-blob.c
test/mpirpc/test-blob.zsh
test/mpirpc/test-ping.c
test/mpirpc/test-returns.c
tools/test-helpers.zsh
Added Paths:
-----------
include/cmpi-driver.h
Removed Paths:
-------------
include/driver.h
Modified: Makefile.in
===================================================================
--- Makefile.in 2011-04-14 23:53:21 UTC (rev 167)
+++ Makefile.in 2011-04-14 23:54:25 UTC (rev 168)
@@ -12,7 +12,7 @@
# INPUT CONTROL VARIABLES
# D : if 1, turn on debugging output in CMPI programs
# G : if 1, certain tests wait for GDB to attach
-# S : if 1, turn on debugging symbols
+# S : if 0, turn off debugging symbols
# T : if 1, turn on MPE printf debugging
# V : if 1, turn on normal make output
@@ -93,7 +93,9 @@
ifeq ($(G),1)
GDB_WAIT="-D GDB_WAIT"
endif
-ifeq ($(S),1)
+ifeq ($(S),0)
+ GGDB = 0
+else
GGDB = 1
endif
ifeq ($(T),1)
Modified: TODO.txt
===================================================================
--- TODO.txt 2011-04-14 23:53:21 UTC (rev 167)
+++ TODO.txt 2011-04-14 23:54:25 UTC (rev 168)
@@ -8,3 +8,5 @@
* Simplify header files, move more definitions into the C files
that need them
+
+* Migrate away from requiring D=1 for test output
Added: include/cmpi-driver.h
===================================================================
--- include/cmpi-driver.h (rev 0)
+++ include/cmpi-driver.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -0,0 +1,47 @@
+
+#include <cmpi-config.h>
+
+#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <cmpi.h>
+#include <io_tools.h>
+
+/**
+ Maximum command line for driver.
+*/
+#define CMPI_DRIVER_MAX_COMMAND (100+CMPI_KEY_LENGTH)
+
+typedef struct
+{
+ FILE* source;
+ FILE* sink;
+ char command[CMPI_DRIVER_MAX_COMMAND];
+ char data[CMPI_VALUE_LENGTH];
+ bool quitting;
+} cmpi_driver;
+
+enum
+{
+ CMPI_DRIVER_FILE,
+ CMPI_DRIVER_STDIN,
+ CMPI_DRIVER_PIPE
+};
+
+//// API...
+
+cmpi_driver* driver_create(void);
+
+bool driver_setup_stdin(cmpi_driver* driver);
+bool driver_setup_file(cmpi_driver* driver, char* filename);
+bool driver_setup_fifo(cmpi_driver* driver);
+
+void driver_process(cmpi_driver* driver);
+
+//// Internal functions...
+
+struct list* driver_tokens(cmpi_driver* driver);
+
+
+
Modified: include/cmpi-types.h
===================================================================
--- include/cmpi-types.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/cmpi-types.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -2,7 +2,7 @@
#ifndef CMPI_TYPES_H
#define CMPI_TYPES_H
-#define CMPI_KEY_LENGTH 64
+#define CMPI_KEY_LENGTH 64
#define CMPI_VALUE_LENGTH (64*1024)
/**
Modified: include/cmpi.h
===================================================================
--- include/cmpi.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/cmpi.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -40,7 +40,7 @@
extern int cmpi_nodes;
-#define CMPI_BLOB_LENGTH LIST_MAX_DATUM
+#define CMPI_BLOB_LENGTH (4*1024*1024)
extern struct lru_table* cmpi_cache;
@@ -118,7 +118,6 @@
//// Methods to aid passing information to user programs:
void cmpi_params_init(void);
-
/**
Stores a copy of the key, value pair.
*/
Modified: include/cmpi_dense-1.h
===================================================================
--- include/cmpi_dense-1.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/cmpi_dense-1.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -2,13 +2,6 @@
#ifndef CMPI_DENSE_1_H
#define CMPI_DENSE_1_H
-#include "dense-1.h"
+// Nothing to do
-//// Helpers:
-
-void add_contacts(void);
-
-void DENSE_Read_params(void);
-
-
#endif
Deleted: include/driver.h
===================================================================
--- include/driver.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/driver.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -1,47 +0,0 @@
-
-#include <cmpi-config.h>
-
-#include <getopt.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <cmpi.h>
-#include <io_tools.h>
-
-/**
- Maximum command line for driver.
-*/
-#define CMPI_DRIVER_MAX_COMMAND (100+CMPI_KEY_LENGTH)
-
-typedef struct
-{
- FILE* source;
- FILE* sink;
- char command[CMPI_DRIVER_MAX_COMMAND];
- char data[CMPI_VALUE_LENGTH];
- bool quitting;
-} cmpi_driver;
-
-enum
-{
- CMPI_DRIVER_FILE,
- CMPI_DRIVER_STDIN,
- CMPI_DRIVER_PIPE
-};
-
-//// API...
-
-cmpi_driver* driver_create(void);
-
-bool driver_setup_stdin(cmpi_driver* driver);
-bool driver_setup_file(cmpi_driver* driver, char* filename);
-bool driver_setup_fifo(cmpi_driver* driver);
-
-void driver_process(cmpi_driver* driver);
-
-//// Internal functions...
-
-struct list* driver_tokens(cmpi_driver* driver);
-
-
-
Modified: include/inlist.h
===================================================================
--- include/inlist.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/inlist.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -7,16 +7,9 @@
#ifndef INLIST_H
#define INLIST_H
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <stdbool.h>
+#include <stdlib.h>
-#include <mpi_tools.h>
-
-// Maximum size of a kinlist datum
-#define INLIST_MAX_DATUM 100
-
struct inlist_item
{
int data;
@@ -43,8 +36,6 @@
bool inlist_remove(struct inlist* target, int data);
-bool inlist_erase(struct inlist* target, int data, size_t n);
-
int inlist_pop(struct inlist* target);
int inlist_peek(struct inlist* target);
Modified: include/kda-2.h
===================================================================
--- include/kda-2.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/kda-2.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -136,6 +136,8 @@
char* KDA_Description(void);
char* KDA_id_tostring(KDA_ID other_id);
+KDA_Neighbor* KDA_Random_neighbor(void);
+
//// Remote API:
MPIRPC* KDA_Translate(MPIRPC_Node node, KDA_ID id);
MPIRPC* KDA_Translate_k(MPIRPC_Node node, KDA_ID id);
@@ -146,6 +148,4 @@
MPIRPC* KDA_Retrieve(KDA_Neighbor* neighbor, char* key);
-
-
#endif
Modified: include/list.h
===================================================================
--- include/list.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/list.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -13,7 +13,7 @@
#include <mpi_tools.h>
-// Maximum size of a list datum
+// Maximum size of a list datum (only used for debug printing)
#define LIST_MAX_DATUM 1024
struct list_item
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2011-04-14 23:53:21 UTC (rev 167)
+++ include/mpirpc.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -4,6 +4,10 @@
#include <cmpi-config.h>
+#include <mpi.h>
+
+#include <stdbool.h>
+
#define MPIRPC_MAX_NAME 128
#define MPIRPC_MAX_ARGS 256
#define MPIRPC_PROCEED_NULL ((void (*)(MPIRPC*)) 1)
@@ -125,6 +129,8 @@
void MPIRPC_Snooze_reset(void);
+void MPIRPC_Snooze_set(int s);
+
//// Data structure helpers...
int MPIRPC_Node_cmp(void* node1, void* node2);
Modified: src/adts/About.txt
===================================================================
--- src/adts/About.txt 2011-04-14 23:53:21 UTC (rev 167)
+++ src/adts/About.txt 2011-04-14 23:54:25 UTC (rev 168)
@@ -1,15 +1,19 @@
+Index of possible ADT functions
+
void _append(target, key)
bool _add(target, key)
+ { should allow duplicates }
+bool _add_unique(target, cmp(), key)
{ false and do nothing if key found }
-bool _add_unique(target, cmp(), key)
- {false and do nothing if key found }
bool _contains(target, key)
bool _matches(target, cmp(), data)
DATA _search(target, key)
DATA _inspect(target, data, n)
+ { search for data in target that matches given data in n bytes }
_update(target, key, data, offset, length)
_set(target, key, data)
+ { reset the value of the given key }
DATA _poll() { head }
DATA _pop() { tail }
DATA _get(i)
Modified: src/adts/inlist.c
===================================================================
--- src/adts/inlist.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/adts/inlist.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -1,6 +1,11 @@
#include "inlist.h"
+#include <stdio.h>
+#include <string.h>
+
+#include <mpi_tools.h>
+
struct inlist*
inlist_create()
{
@@ -367,6 +372,7 @@
}
/**
+ Allocate and return string containing ints in this inlist
Returns pointer to allocated output location, 12*size.
*/
char*
@@ -403,7 +409,6 @@
free(target);
}
-
/*
*
** Dump inlist to string a la snprintf()
Modified: src/adts/lru_table.c
===================================================================
--- src/adts/lru_table.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/adts/lru_table.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -73,7 +73,7 @@
Adds new item to end of table list and lru list.
Sets those two item ptrs to each other.
- @param key
+ @param key May not be NULL
@param data
@return NULL if the table is not overfull or a
@@ -85,6 +85,7 @@
void* data, int length)
{
NOTE_FS(key);
+ assert(key);
struct keyvalue* result = NULL;
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/cmpi/driver.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -8,8 +8,10 @@
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <unistd.h>
-#include <driver.h>
+#include <cmpi-driver.h>
+#include <list.h>
char* filename = NULL;
@@ -119,7 +121,7 @@
void
driver_put(cmpi_driver* driver, struct list* tokens)
{
- char* key = tokens->head->next->data;
+ char* key = (char*) tokens->head->next->data;
char value[CMPI_VALUE_LENGTH];
int length;
int n;
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/cmpi/node.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -10,6 +10,9 @@
* -t <tag> symbolic tag number.
*/
+#include <getopt.h>
+#include <unistd.h>
+
#include <node.h>
#include <cmpi_mode.h>
#include <io_tools.h>
@@ -20,6 +23,7 @@
void
options(int argc, char* argv[])
{
+
struct option options[] =
{
{"cache", required_argument, NULL, 'c'},
@@ -38,7 +42,7 @@
// Defaults...
cmpi_cache_limit = 10000;
- snooze_max = 500000;
+ int snooze_max = 500000;
debug_rank = mpi_rank;
cmpi_nodes = mpi_size;
@@ -115,6 +119,8 @@
}
c++;
}
+
+ MPIRPC_Snooze_set(snooze_max);
}
/**
Modified: src/dense-1/cmpi_dense.c
===================================================================
--- src/dense-1/cmpi_dense.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/dense-1/cmpi_dense.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -3,11 +3,17 @@
#include <cmpi_dense-1.h>
+#include <dense-1.h>
+
/**
List of node ranks to contact for DENSE routines.
*/
-struct inlist* contacts;
+static struct inlist* contacts;
+// void add_contacts(void);
+
+static void DENSE_Read_params(void);
+
CMPI_RETURN
cmpi_init_impl()
{
@@ -123,8 +129,7 @@
NOTE("got ranks: ");
DEBUG(inlist_printf(ranks));
- for (item = ranks->head;
- item; item = item->next)
+ for (item = ranks->head; item; item = item->next)
{
SHOW_I(item->data);
MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
@@ -170,6 +175,9 @@
return CMPI_SUCCESS;
}
+/**
+ Blocking call.
+*/
CMPI_RETURN
cmpi_get(char* key, char** value, int* length)
{
@@ -236,7 +244,10 @@
}
}
-void
+/**
+ Extract parameters from C-MPI specific to DENSE
+ */
+static void
DENSE_Read_params(void)
{
// NOTE_F;
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/dense-1/dense.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -154,8 +154,7 @@
char args[32];
sprintf(args, "%X", id);
MPIRPC* rpc =
- MPIRPC_Call(node, "query_id_k", args,
- NULL, MPIRPC_PROCEED_NULL);
+ MPIRPC_Call(node, "query_id_k", args, NULL, MPIRPC_PROCEED_NULL);
return rpc;
}
@@ -187,9 +186,9 @@
char args[MPIRPC_MAX_ARGS];
sprintf(args, "%s %i", key, offset);
- MPIRPC* rpc = MPIRPC_Call_blob(node, "update", args,
- value, length,
- NULL, MPIRPC_PROCEED_NULL);
+ MPIRPC* rpc =
+ MPIRPC_Call_blob(node, "update", args, value, length,
+ NULL, MPIRPC_PROCEED_NULL);
return rpc;
}
@@ -197,14 +196,13 @@
Instruct a node to retrieve a value.
Asynchronous. Copies key into MPIRPC.
User must use MPIRPC->result_length
- to find number of bytes retrieved.
+ to find number of bytes retrieved.
*/
MPIRPC*
DENSE_Retrieve(MPIRPC_Node node, char* key)
{
MPIRPC* rpc =
- MPIRPC_Call(node, "retrieve", key,
- NULL, MPIRPC_PROCEED_NULL);
+ MPIRPC_Call(node, "retrieve", key, NULL, MPIRPC_PROCEED_NULL);
return rpc;
}
@@ -250,7 +248,7 @@
sscanf(args, "%X", &object_id);
int other_rank = object_id % dense_nodes;
char* result = malloc(10*sizeof(char));
- int length = sprintf(result, "%i", other_rank);
+ int length = sprintf(result, "%i", other_rank)+1;
MPIRPC_Return(caller, unique, result, length);
}
Modified: src/kda-2/cmpi_kademlia.c
===================================================================
--- src/kda-2/cmpi_kademlia.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/kda-2/cmpi_kademlia.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -83,7 +83,7 @@
}
NOTE("CONTACT LOOKUP FAILED: LINKING");
- KDA_Harpoon(random_neighbor()->node, neighbor->id);
+ KDA_Harpoon(KDA_Random_neighbor()->node, neighbor->id);
add_contacts();
return contact_lookup(neighbor);
Modified: src/kda-2/kademlia.c
===================================================================
--- src/kda-2/kademlia.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/kda-2/kademlia.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -98,7 +98,6 @@
static char* id_tostring(void);
static void listen_loop(void);
static void bootstrap(MPIRPC_Node node);
-KDA_Neighbor* random_neighbor(void);
int KDA_Neighbor_table_size(void);
@@ -215,7 +214,7 @@
}
KDA_Neighbor*
-random_neighbor()
+KDA_Random_neighbor()
{
int i;
struct list_item* item;
@@ -1014,7 +1013,7 @@
dump_bucket_ids()
{
char* result = bucket_ids_tostring();
- printf(result);
+ printf("%s", result);
free(result);
}
Modified: src/mpi_tools/mpi_tools.c
===================================================================
--- src/mpi_tools/mpi_tools.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/mpi_tools/mpi_tools.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -162,9 +162,9 @@
note(char* msg)
{
if (msg == NULL)
- fprintf(debug_file, "[%i] (NULL) \n", debug_rank);
+ fprintf(debug_file, "(NULL) \n");
else
- fprintf(debug_file, "[%i] %s \n", debug_rank, msg);
+ fprintf(debug_file, "%s \n", msg);
fflush(debug_file);
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2011-04-14 23:53:21 UTC (rev 167)
+++ src/mpirpc/mpirpc.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -1,7 +1,6 @@
#include <mpi_tools.h>
-#include <stdbool.h>
#include <unistd.h>
#include <itable.h>
@@ -338,7 +337,7 @@
/**
Receives RPC and issues it to local procedure handler.
name is on the stack.
- Handler should free args and blob.
+ Handler should free blob.
*/
void
MPIRPC_Request(MPIRPC_Node caller)
@@ -392,8 +391,7 @@
MPI_Recv(blob, blob_length, MPI_CHAR, caller.rank,
MPIRPC_TAG_ARGS, caller.comm, &status);
}
- /* printf("\t [%i] %s(%s) for %i \n",
- mpi_rank, name, args, caller); */
+ printf("\t %s(%s) from %i \n", name, args, caller.rank);
char* (*handler)(MPIRPC_Node,int,char*,char*,int) =
hashtable_search(portmap, name);
@@ -798,11 +796,18 @@
usleep(snooze_amount *= 2);
}
-void MPIRPC_Snooze_reset()
+void
+MPIRPC_Snooze_reset()
{
snooze_amount = snooze_amount_reset;
}
+void
+MPIRPC_Snooze_set(int s)
+{
+ snooze_max = s;
+}
+
/**
Convenience method for MPI_Comm_get_name().
Places the name in a static location.
Modified: test/adts/test-dpkm_list.c
===================================================================
--- test/adts/test-dpkm_list.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/adts/test-dpkm_list.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -11,7 +11,7 @@
{
if (item)
{
- note_s("extra: ", item->key);
+ printf("extra: %s\n", item->key);
free(item);
}
}
@@ -20,7 +20,7 @@
{
if (item)
{
- note_s("extra: ", item->key);
+ printf("extra: %s\n", item->key);
printdata("data: ", item->data, strlen(item->data));
printf("\n");
free(item->data);
@@ -32,7 +32,7 @@
{
if (item)
{
- note_s("extra: ", item->key);
+ printf("extra: %s\n", item->key);
printdata("data: ", item->data, item->length);
printf("\n");
free(item->key);
@@ -44,11 +44,6 @@
int
main(int argc, char* argv[])
{
- MPI_Init(&argc, &argv);
- whoami();
-
- dmalloc_setup();
-
struct dpkm_list* L = dpkm_list_create(4);
char s[1000];
@@ -105,7 +100,7 @@
extra(item);
dpkm_list_printf("%i", L);
- note("polling...");
+ puts("polling...");
while ((item = dpkm_list_poll(L)))
{
@@ -136,23 +131,18 @@
dpkm_list_printdata(L2);
char* key = makekey(j);
void* data = makedata(j);
- note_s("adding: ", key);
+ printf("adding: %s\n", key);
item = dpkm_list_add(L2, key, data, j);
extra_key_data(item);
}
}
dpkm_list_printdata(L2);
- note_i("size: ", L2->size);
+ printf("size: %i\n", L2->size);
while (item = dpkm_list_poll(L2))
extra_key_data(item);
- note_i("size: ", L2->size);
+ printf("size: %i\n", L2->size);
assert(L2->size == 0);
dpkm_list_free(L2);
-
- DMALLOC_COMPLETE;
-
- MPI_Finalize();
- return 0;
}
Modified: test/adts/test-inlist.c
===================================================================
--- test/adts/test-inlist.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/adts/test-inlist.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -3,6 +3,8 @@
* Test inlist functionality.
* */
+#include <mpi.h>
+
#include <inlist.h>
#include "test_helpers.h"
@@ -10,11 +12,6 @@
int
main(int argc, char* argv[])
{
- MPI_Init(&argc, &argv);
- whoami();
-
- dmalloc_setup();
-
char* s = " 1 4 2 ";
struct inlist* L = inlist_parse(s);
@@ -23,9 +20,5 @@
inlist_free(L);
- MPI_Finalize();
-
- DMALLOC_COMPLETE;
-
return 0;
}
Modified: test/adts/test-lru_table01.c
===================================================================
--- test/adts/test-lru_table01.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/adts/test-lru_table01.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -5,12 +5,6 @@
#include <lru_table.h>
-/*
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-*/
-
#include "test_helpers.h"
void extra_kv(struct keyvalue* kv)
@@ -30,6 +24,10 @@
if (kv)
{
printf("extra: %s \n", kv->key);
+ if (kv->data)
+ free(kv->data);
+ if (kv->key)
+ free(kv->key);
free(kv);
}
}
@@ -40,10 +38,8 @@
MPI_Init(&argc, &argv);
whoami();
- dmalloc_setup();
+ struct lru_table* table = lru_table_create(5, 4);
- struct lru_table* table = lru_table_create(5, 4);
-
int* one = malloc(sizeof(int));
int* two = malloc(sizeof(int));
@@ -91,7 +87,7 @@
free(one);
free(two);
- note("loop...");
+ printf("loop...");
table = lru_table_create(6, 4);
for (int i = 0; i < 30; i++)
{
@@ -105,14 +101,14 @@
}
else
{
- note_s("search: ", key);
+ printf("search: %s\n", key);
kv = lru_table_search(table, key);
free(key);
extra_kv(kv);
}
}
- note("draining...");
+ puts("draining...");
while ((kv = lru_table_poll(table)))
{
printf("polled: %s\n", kv->key, kv->data);
@@ -189,9 +185,10 @@
// dmalloc_shutdown();
+ printf("\n");
+ printf("Normal exit.\n");
+
MPI_Finalize();
- DMALLOC_COMPLETE;
-
return 0;
}
Modified: test/adts/test_helpers.h
===================================================================
--- test/adts/test_helpers.h 2011-04-14 23:53:21 UTC (rev 167)
+++ test/adts/test_helpers.h 2011-04-14 23:54:25 UTC (rev 168)
@@ -1,15 +1,6 @@
-/*
-#define TEST_DMALLOC \
- DMALLOC_SETUP( \
- { \
- SHOW_S(dmalloc_logpath); \
- dmalloc_shutdown(); \
- dmalloc_log_unfreed(); \
- });
+#include <stdio.h>
-*/
-
void* makedata(int n)
{
char* result = malloc(n*sizeof(char));
Modified: test/cmpi/test-manyputs.c
===================================================================
--- test/cmpi/test-manyputs.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/cmpi/test-manyputs.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -5,6 +5,8 @@
"reps" key in the CMPI cache.
*/
+#include <unistd.h>
+
#include "test_helpers.h"
/**
Modified: test/cmpi/test-putget.c
===================================================================
--- test/cmpi/test-putget.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/cmpi/test-putget.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -3,6 +3,8 @@
Put two keys and get one of them.
*/
+#include <unistd.h>
+
#include "test_helpers.h"
void
Modified: test/cmpi/test-tables.c
===================================================================
--- test/cmpi/test-tables.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/cmpi/test-tables.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -3,6 +3,10 @@
Assemble and debug tables.
*/
+#include <unistd.h>
+
+#include <cmpi.h>
+
#include "test_helpers.h"
void
Modified: test/cmpi/test-update01.c
===================================================================
--- test/cmpi/test-update01.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/cmpi/test-update01.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -3,6 +3,8 @@
Put three keys, update one, and get the updated value.
*/
+#include <unistd.h>
+
#include "test_helpers.h"
void
Modified: test/cmpi/test-update02.c
===================================================================
--- test/cmpi/test-update02.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/cmpi/test-update02.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -3,6 +3,8 @@
Update two new keys, update those, and retrieve one.
*/
+#include <unistd.h>
+
#include "test_helpers.h"
void
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/module.mk.in 2011-04-14 23:54:25 UTC (rev 168)
@@ -47,7 +47,8 @@
test/driver/test%.out: test/driver/test%.zsh $(TEST_PROGS) $(TEST_DRIVER)
$(Q) " TEST $(@) "
- $(E) test/driver/test.zsh $(@) $(NODES) $(CLIENTS) $(<) $(DRIVER_DIR)
+ $(E) LAUNCH=$(LAUNCH) test/driver/test.zsh $(@) \
+ $(NODES) $(CLIENTS) $(<) $(DRIVER_DIR)
test/driver/test-success.out: test/cmpi/test-success.out \
$(TEST_DRIVER_OUTPUT)
Modified: test/driver/test-cmd-get.c
===================================================================
--- test/driver/test-cmd-get.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/test-cmd-get.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -22,6 +22,7 @@
main(int argc, char* argv[])
{
int code;
+ char* t;
test_cmd_setup(argc, argv);
@@ -35,7 +36,7 @@
int length;
char message[32];
- fgets(message, 32, from_cmpi); // &length);
+ t = fgets(message, 32, from_cmpi); // &length);
// printf("length: %s\n", message);
// if (code != 1)
// crash("No response from driver!");
Modified: test/driver/test-cmd-quit.c
===================================================================
--- test/driver/test-cmd-quit.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/test-cmd-quit.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -11,6 +11,7 @@
main(int argc, char* argv[])
{
int error;
+ int t;
test_cmd_setup(argc, argv);
@@ -20,7 +21,7 @@
fprintf(to_cmpi, "quit\n");
fflush(to_cmpi);
char output[32];
- fscanf(from_cmpi, "%s", output);
+ t = fscanf(from_cmpi, "%s", output);
assert(!strcmp(output, "ok"));
Modified: test/driver/test-cmd-sleep.c
===================================================================
--- test/driver/test-cmd-sleep.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/test-cmd-sleep.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -12,6 +12,7 @@
main(int argc, char* argv[])
{
int code;
+ int t;
test_cmd_setup(argc, argv);
@@ -21,7 +22,8 @@
fprintf(to_cmpi, "sleep %i\n", sleep_time);
fflush(to_cmpi);
char output[32];
- fscanf(from_cmpi, "%s", output);
+ t = fscanf(from_cmpi, "%s", output);
+ assert(t == 0);
if (!(output[0] == 'o' &&
output[1] == 'k'))
Modified: test/driver/test-quit.zsh
===================================================================
--- test/driver/test-quit.zsh 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/test-quit.zsh 2011-04-14 23:54:25 UTC (rev 168)
@@ -1 +1,3 @@
+#!/bin/zsh
+
test/driver/test-cmd-quit.x -d ${DRIVER_DIR}
Modified: test/driver/test.zsh
===================================================================
--- test/driver/test.zsh 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/test.zsh 2011-04-14 23:54:25 UTC (rev 168)
@@ -12,8 +12,8 @@
bail()
{
- kill ${BOMB_PID}
- crash $1
+ [[ ${BOMB_PID} != "" ]] && kill ${BOMB_PID}
+ crash $1
}
# set -x
@@ -24,6 +24,8 @@
fi
CMPI_OPTS="-p driver_dir=${DRIVER_DIR}"
+[[ ${LAUNCH} == "" ]] && bail "No LAUNCH specified!"
+
DRIVER=test/driver/test_driver.x
${LAUNCH} -n ${TOTAL} ${DRIVER} -n ${NODES} ${CMPI_OPTS} > ${OUTPUT} &
DRIVER_PID=${!}
@@ -41,3 +43,7 @@
check_exits ${TOTAL} ${OUTPUT}
return 0
+
+# Local variables:
+# sh-basic-offset: 2
+# End:
Modified: test/driver/test_driver_fifo.c
===================================================================
--- test/driver/test_driver_fifo.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/driver/test_driver_fifo.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -1,6 +1,6 @@
#include <node.h>
-#include <driver.h>
+#include <cmpi-driver.h>
#include "test_helpers.h"
Modified: test/mpirpc/test-args.c
===================================================================
--- test/mpirpc/test-args.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/mpirpc/test-args.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -5,6 +5,8 @@
NULL return values.
*/
+#include <mpi_tools.h>
+#include <gossip.h>
#include <mpirpc.h>
void
Modified: test/mpirpc/test-args.zsh
===================================================================
--- test/mpirpc/test-args.zsh 2011-04-14 23:53:21 UTC (rev 167)
+++ test/mpirpc/test-args.zsh 2011-04-14 23:54:25 UTC (rev 168)
@@ -11,7 +11,7 @@
shift
LAUNCH=${*}
-eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUTPUT} 2>&1
+eval ${LAUNCH} -n 2 ${VALGRIND} ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
Modified: test/mpirpc/test-blob.c
===================================================================
--- test/mpirpc/test-blob.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/mpirpc/test-blob.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -5,6 +5,8 @@
for non-0-length blobs.
*/
+#include <mpi_tools.h>
+#include <gossip.h>
#include <mpirpc.h>
#include "test_helpers.h"
@@ -15,7 +17,7 @@
{
int a;
sscanf(args, "%i", &a);
- show_fsi(args, a);
+ printf("handle_test: %i\n", a);
assert(blob[0] == '\n');
assert(blob[1] == '\0');
@@ -25,6 +27,7 @@
printf("asserts ok\n");
MPIRPC_Null(caller, unique);
+ free(blob);
}
int
@@ -35,8 +38,6 @@
MPI_Init(&argc, &argv);
MPIRPC_Init();
- DMALLOC_SETUP(dmalloc_setup());
-
MPIRPC_Comm_add(MPI_COMM_WORLD);
MPIRPC_Node neighbor;
@@ -50,7 +51,7 @@
char* result;
MPIRPC_Node_make(MPI_COMM_WORLD, 1, &neighbor);
result = MPIRPC_Block_blob(neighbor, "test", "0", blob, 4);
- show_s(result);
+ printf("result: %s\n", result);
}
else
{
@@ -62,8 +63,4 @@
printf("Normal exit.\n");
MPIRPC_Finalize();
MPI_Finalize();
-
- TEST_DMALLOC;
-
- return 0;
}
Modified: test/mpirpc/test-blob.zsh
===================================================================
--- test/mpirpc/test-blob.zsh 2011-04-14 23:53:21 UTC (rev 167)
+++ test/mpirpc/test-blob.zsh 2011-04-14 23:54:25 UTC (rev 168)
@@ -11,7 +11,7 @@
shift
LAUNCH=${*}
-eval ${LAUNCH} -n 2 ${PROGRAM} > ${OUTPUT} 2>&1
+eval ${LAUNCH} -n 2 ${VALGRIND} ${PROGRAM} > ${OUTPUT} 2>&1
CODE=$?
[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
Modified: test/mpirpc/test-ping.c
===================================================================
--- test/mpirpc/test-ping.c 2011-04-14 23:53:21 UTC (rev 167)
+++ test/mpirpc/test-ping.c 2011-04-14 23:54:25 UTC (rev 168)
@@ -4,6 +4,10 @@
No arguments or return ...
[truncated message content] |
|
From: <jmw...@us...> - 2011-04-15 19:15:49
|
Revision: 170
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=170&view=rev
Author: jmwozniak
Date: 2011-04-15 19:15:42 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Major improvement to build system
Modified Paths:
--------------
Makefile.in
configure.ac
depend.sh
src/cmpi/node.c
test/driver/module.mk.in
Modified: Makefile.in
===================================================================
--- Makefile.in 2011-04-15 19:15:23 UTC (rev 169)
+++ Makefile.in 2011-04-15 19:15:42 UTC (rev 170)
@@ -44,11 +44,9 @@
mandir = $(DESTDIR)@mandir@
exec_prefix = $(DESTDIR)@exec_prefix@
-VPATH = $(srcdir)
SHELL = @SHELL@
INSTALL = @INSTALL@
GNUC = @GNUC@
-INTELC = @INTELC@
# OpenSSL
ifneq (@OPENSSL_LOCATION@,)
@@ -56,10 +54,7 @@
OPENSSL_LIB = @OPENSSL_LOCATION@/lib
endif
-ifneq (@DMALLOC_LOCATION@,)
- DMALLOC_INCLUDE = @DMALLOC_LOCATION@/include
- DMALLOC_LIB = @DMALLOC_LOCATION@/lib
-endif
+ENABLE_TESTS = @ENABLE_TESTS@
# MPI location
MPI = @USE_MPI@
@@ -68,8 +63,6 @@
MPIEXEC = @USE_MPI@/bin/@MPIEXEC@
# MPIARGS = -recvtimeout 10
MPIARGS = @MPIARGS@
-# MPIARGS = -f hosts
-MPDCHECK = tools/mpd-available.zsh @USE_MPI@/bin/mpdlistjobs
# Job launch selection (mpiexec or srun)
ifeq (@HAVE_SRUN@,no)
@@ -262,14 +255,6 @@
# run ./configure --help for information on how to do this cleanly.
LIBCFLAGS = # @LIBCFLAGS@
-# Add gcc-specific flags if we know it is a gnu compiler.
-ifdef GNUC
-CFLAGS += $(GCC_CFLAGS)
-endif
-ifdef INTELC
-CFLAGS += $(INTEL_CFLAGS)
-endif
-
# LIBSRC is source code for libcmpi
LIBSRC :=
# Source code for Kademlia
@@ -338,27 +323,6 @@
include src/cmpi-cp/module.mk
################################################################
-# Derived file lists
-
-# NOTES: At this point, the subdirectory makefile includes have informed
-# us what the source files are. Now we want to generate some
-# other lists (such as objects, executables, and dependency files)
-# by manipulating the lists of source files
-
-# LIBOBJS is a list of objects to put in the client lib
-#LIBOBJS := $(patsubst %.c,%.o, $(filter %.c,$(LIBSRC)))
-
-#DISKSIM_OBJS := $(patsubst %.c,%.o, $(filter %.c,$(DISKSIM_SRC)))
-
-CMPI_OBJS := $(TABLE_OBJS) $(MPIRPC_OBJS) $(CMPI_OBJS)
-# $(DISKSIM_OBJS)
-
-MPIRPC_DEPS := $(patsubst %.o,%.d,$(MPIRPC_OBJS))
-CMPI_DEPS := $(patsubst %.o,%.d,$(CMPI_OBJS))
-
-deps: $(CMPI_DEPS)
-
-################################################################
# Test cases
# Test rules are heavily based on the definitions above
@@ -380,6 +344,30 @@
TEST_DEPS += $(patsubst %.c, %.d, $(TEST_SRC))
TEST_DEPS += $(patsubst %.c, %.d, $(TEST_HELPER_SRC))
+################################################################
+# Derived file lists
+
+# NOTES: At this point, the subdirectory makefile includes have informed
+# us what the source files are. Now we want to generate some
+# other lists (such as objects, executables, and dependency files)
+# by manipulating the lists of source files
+
+# LIBOBJS is a list of objects to put in the client lib
+#LIBOBJS := $(patsubst %.c,%.o, $(filter %.c,$(LIBSRC)))
+
+#DISKSIM_OBJS := $(patsubst %.c,%.o, $(filter %.c,$(DISKSIM_SRC)))
+
+CMPI_OBJS := $(TABLE_OBJS) $(MPIRPC_OBJS) $(CMPI_OBJS)
+# $(DISKSIM_OBJS)
+
+MPIRPC_DEPS := $(patsubst %.o,%.d,$(MPIRPC_OBJS))
+CMPI_DEPS := $(patsubst %.o,%.d,$(CMPI_OBJS))
+ifeq ($(ENABLE_TESTS),yes)
+ CMPI_DEPS += $(TEST_DEPS)
+endif
+
+deps: $(CMPI_DEPS)
+
####################################################################
# Rules and dependencies
@@ -393,20 +381,12 @@
#cmpi-io: $(CMPI_IO)
# Just like dir, but strip the slash off the end, to be pretty.
-# dirname = $(patsubst %/,%,$(dir $(1)))
+dirname = $(patsubst %/,%,$(dir $(1)))
# Generate the canonical in-tree location of a file, given a possibly
# out-of-tree reference.
# canonname = $(patsubst $(srcdir)/%,%,$(call dirname,$(1)))
-# Grab any CFLAGS defined by the make stub for a particular file, and
-# for the directory in which the source resides.
-# modcflags = $(MODCFLAGS_$(call canonname,$(1))) \
-# $(MODCFLAGS_$(patsubst $(srcdir)/%,%,$(1)))
-# -I$(srcdir)/$(call dirname,$(1))
-# modldflags = $(MODLDFLAGS_$(call canonname,$(1))) \
-# $(MODLDFLAGS_$(patsubst $(srcdir)/%,%,$(1)))
-
# CMPI-IO must be enabled in configure --enable-cmpi-io
#$(CMPI_IO): $(CMPI) src/cmpi/cmpi-io.po
# $(Q) " MPICC [PIC] $@"
@@ -467,16 +447,6 @@
.SECONDARY : %.o %.x
-# rule for building shared objects from objects
-#%.po: %.o
-# $(Q) " CC [PIC] $@"
-# $(E)$(CC) $(LIBCFLAGS) $(PICFLAGS) $(call modcflags,$<) $< -c -o $@
-
-# rule for building shared objects
-# %.po: %.c
-# $(Q) " CC [PIC] $@"
-# $(E)$(CC) $(LIBCFLAGS) $(CFLAGS) $(PICFLAGS) $(call modcflags,$<) $< -c -o $@
-
# handy rule to generate cpp-output file, for debugging
.PHONY: FORCE
%.i: %.c FORCE
@@ -554,9 +524,9 @@
# NOTE: we wrap this in ifneq's in order to prevent the
# dependencies from being generated for special targets that don't
# require them
-#ifeq (,$(filter clean distclean dist docs cscope tags nodep,$(MAKECMDGOALS)))
- include $(CMPI_DEPS)
-#endif
+ifeq (,$(filter clean distclean dist docs cscope tags nodep deps,$(MAKECMDGOALS)))
+ -include $(CMPI_DEPS)
+endif
# add this as a make goal to disable rebuilding dependencies
.PHONY: nodep clean
@@ -564,11 +534,12 @@
.PRECIOUS: $(TEST_OUTPUT) %.o
nodep:; @:
-# default rule for generating dependency files
+# default rule for generating dependency files (deps)
%.d: %.c
$(Q) " DEP $@"
# $(E) $(MPICC) -M $(CFLAGS) $(<) | sed -e 's@.*\.o:@@;s@\\@@' > $(@)
- $(E) CC="$(MPICC)" $(srcdir)/depend.sh $(call dirname,$*) $(CFLAGS) $(call modcflags,$<) $< > $@
+ $(E) CC="$(MPICC)" $(srcdir)/depend.sh \
+ $(call dirname, $*) $(CFLAGS) $< > $@
SPLINTOPTS = +posixlib +gnuextensions # -preproc
SPLINT_GS_S := $(shell find . -name "*.gs.s")
@@ -577,17 +548,4 @@
$(Q) " SPLINT splint.out"
$(E) splint $(SPLINTOPTS) $(IFLAGS) -I $(MPI)/include $(CMPI_SRC) > splint.out
-#%.p: %.c
-# $(Q) " CPP $@"
-# $(E) cpp $(IFLAGS) -I $(MPI)/include $(<) > $(@) # || rm -v $(@)
-
-install:: all install_doc
- install -d $(prefix)/include
- install -d $(prefix)/lib
- install -d $(prefix)/bin
-ifdef TARGET_OS_DARWIN
-# TOC needs to be regenerated in libs after they get moved
- ranlib $(patsubst %,$(prefix)/%,$(LIBRARIES))
-endif
-
null:
Modified: configure.ac
===================================================================
--- configure.ac 2011-04-15 19:15:23 UTC (rev 169)
+++ configure.ac 2011-04-15 19:15:42 UTC (rev 170)
@@ -139,6 +139,7 @@
fi
)
+dnl Stop using dmalloc - use valgrind
AC_ARG_WITH(dmalloc,
[ --with-dmalloc Use dmalloc],
if test "x$withval" = "xyes" ; then
@@ -382,6 +383,7 @@
[enable test modules]),
[AC_MSG_RESULT([enabling test modules...])
ENABLE_TESTS="yes"], [])
+AC_SUBST(ENABLE_TESTS)
dnl Disable -rdynamic if we don't have it.
dnl Use it if we can for backtraces.
Modified: depend.sh
===================================================================
--- depend.sh 2011-04-15 19:15:23 UTC (rev 169)
+++ depend.sh 2011-04-15 19:15:42 UTC (rev 170)
@@ -3,6 +3,7 @@
DIR="$1"
shift
if [ -n "$DIR" ] ; then
- DIR="$DIR"/
+ DIR="$DIR"
fi
-exec $CC -M -MG "$@" | sed -e "s@^\(.*\)\.o:@$DIR\1.d $DIR\1.o $DIR\1.po:@"
+
+exec $CC -M -MG "$@" | sed -e "s@^\(.*\)\.o:@$DIR/\1.d $DIR/\1.o:@"
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2011-04-15 19:15:23 UTC (rev 169)
+++ src/cmpi/node.c 2011-04-15 19:15:42 UTC (rev 170)
@@ -23,7 +23,6 @@
void
options(int argc, char* argv[])
{
-
struct option options[] =
{
{"cache", required_argument, NULL, 'c'},
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2011-04-15 19:15:23 UTC (rev 169)
+++ test/driver/module.mk.in 2011-04-15 19:15:42 UTC (rev 170)
@@ -1,10 +1,10 @@
DIR := test/driver
-TEST_DRIVER_SRC += test-cmd-quit.c \
- test-cmd-sleep.c \
- test-cmd-put.c \
- test-cmd-get.c
+TEST_DRIVER_SRC += $(DIR)/test-cmd-quit.c \
+ $(DIR)/test-cmd-sleep.c \
+ $(DIR)/test-cmd-put.c \
+ $(DIR)/test-cmd-get.c
TEST_DRIVER_OBJS = $(patsubst %.c, %.o, $(TEST_DRIVER_SRC))
TEST_DRIVER_OUTPUT = test/driver/test-quit.out \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-04-15 21:45:14
|
Revision: 180
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=180&view=rev
Author: jmwozniak
Date: 2011-04-15 21:45:08 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
Code improvements
Modified Paths:
--------------
include/cmpi_kda-2.h
include/mpirpc.h
src/cmpi/node.c
src/kda-2/kademlia.c
src/mpirpc/mpirpc.c
test/cmpi/test-manyputs.c
Modified: include/cmpi_kda-2.h
===================================================================
--- include/cmpi_kda-2.h 2011-04-15 21:44:49 UTC (rev 179)
+++ include/cmpi_kda-2.h 2011-04-15 21:45:08 UTC (rev 180)
@@ -4,3 +4,5 @@
//// Helpers:
void add_contacts(void);
+
+void listen_loop(void);
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2011-04-15 21:44:49 UTC (rev 179)
+++ include/mpirpc.h 2011-04-15 21:45:08 UTC (rev 180)
@@ -30,9 +30,9 @@
int status;
char name[MPIRPC_MAX_NAME];
char args[MPIRPC_MAX_ARGS];
- void* blob;
+ char* blob;
int blob_length;
- void* result;
+ char* result;
int result_length;
void* extras;
void (*proceed) (struct mpirpc* rpc);
@@ -86,20 +86,20 @@
void* extras, void (*proceed)(MPIRPC*));
MPIRPC* MPIRPC_Call_blob(MPIRPC_Node target, char* name, char* args,
- void* blob, int blob_length,
+ char* blob, int blob_length,
void* extras, void (*proceed)(MPIRPC*));
-void* MPIRPC_Block(MPIRPC_Node target, char* name, char* args);
+char* MPIRPC_Block(MPIRPC_Node target, char* name, char* args);
-void* MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
- void* blob, int blob_length);
+char* MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
+ char* blob, int blob_length);
-void* MPIRPC_Wait(MPIRPC* rpc);
+char* MPIRPC_Wait(MPIRPC* rpc);
void MPIRPC_Null(MPIRPC_Node caller, int unique);
void MPIRPC_Return(MPIRPC_Node caller, int unique,
- void* result, int rlength);
+ char* result, int rlength);
MPIRPC_Node* MPIRPC_Node_create(MPI_Comm comm, int rank);
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2011-04-15 21:44:49 UTC (rev 179)
+++ src/cmpi/node.c 2011-04-15 21:45:08 UTC (rev 180)
@@ -153,8 +153,10 @@
main(int argc, char* argv[])
{
gossip_debug_init();
- // gossip_set_debug_mask(true,MASK_DEBUG|MASK_MPIRPC|MASK_ADTS|
- // MASK_CMPI|MASK_DRIVER);
+
+ //gossip_set_debug_mask(true,MASK_DEBUG|MASK_MPIRPC|MASK_ADTS|
+ // MASK_CMPI|MASK_DRIVER);
+
gossip_enable_stdout();
// Comment out to achieve deterministic results:
Modified: src/kda-2/kademlia.c
===================================================================
--- src/kda-2/kademlia.c 2011-04-15 21:44:49 UTC (rev 179)
+++ src/kda-2/kademlia.c 2011-04-15 21:45:08 UTC (rev 180)
@@ -96,7 +96,6 @@
static KDA_ID make_id(int salt);
static char* id_tostring(void);
-static void listen_loop(void);
static void bootstrap(MPIRPC_Node node);
int KDA_Neighbor_table_size(void);
@@ -1059,7 +1058,7 @@
{
// NOTE_F;
char* result = buckets_tostring();
- printf(result);
+ printf("%s\n", result);
free(result);
}
Modified: src/mpirpc/mpirpc.c
===================================================================
--- src/mpirpc/mpirpc.c 2011-04-15 21:44:49 UTC (rev 179)
+++ src/mpirpc/mpirpc.c 2011-04-15 21:45:08 UTC (rev 180)
@@ -195,7 +195,7 @@
MPIRPC*
MPIRPC_Create(MPIRPC_Node target, char* name, char* args,
- void* blob, int blob_length,
+ char* blob, int blob_length,
void* extras, void (*proceed)(MPIRPC*))
{
// gossip_do(MASK_MPIRPC, NOTE_F);
@@ -258,7 +258,7 @@
*/
MPIRPC*
MPIRPC_Call_blob(MPIRPC_Node target, char* name, char* args,
- void* blob, int blob_length,
+ char* blob, int blob_length,
void* extras, void (*proceed)(MPIRPC* rpc))
{
assert(target.comm != MPI_COMM_NULL);
@@ -312,18 +312,18 @@
Copied into MPIRPC.
@param args The args to send. Copied into MPIRPC.
*/
-void*
+char*
MPIRPC_Block(MPIRPC_Node target, char* name, char* args)
{
//gossip_do(MASK_MPIRPC, NOTE_FS(name));
return MPIRPC_Block_blob(target, name, args, NULL, 0);
}
-void*
+char*
MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
- void* blob, int blob_length)
+ char* blob, int blob_length)
{
- void* result;
+ char* result;
gossip_do(MASK_MPIRPC, NOTE_FS(name));
MPIRPC* rpc = MPIRPC_Call_blob(target, name, args,
blob, blob_length, NULL, NULL);
@@ -411,7 +411,7 @@
MPIRPC_Return(caller, unique, NULL, -1);
}
-MPIRPC_Value* MPIRPC_Value_create(int unique, void* result, int length);
+MPIRPC_Value* MPIRPC_Value_create(int unique, char* result, int length);
/**
Return result to caller for unique RPC.
@@ -420,7 +420,7 @@
*/
void
MPIRPC_Return(MPIRPC_Node caller, int unique,
- void* result, int length)
+ char* result, int length)
{
gossip_do(MASK_MPIRPC, SHOW_FIII(caller.rank, unique, length));
@@ -479,7 +479,7 @@
MPIRPC_TAG_RESULT, sender.comm, &status);
}
else if (rpc->result_length == 0)
- rpc->result = heap("");
+ rpc->result = NULL;
else
rpc->result = NULL;
@@ -556,7 +556,7 @@
}
MPIRPC_Value*
-MPIRPC_Value_create(int unique, void* result, int length)
+MPIRPC_Value_create(int unique, char* result, int length)
{
MPIRPC_Value* value = malloc(sizeof(MPIRPC_Value));
@@ -597,7 +597,7 @@
MPIRPC_Free() or MPIRPC_Destroy() as proceed-functions.
@return rpc's result when obtained.
*/
-void*
+char*
MPIRPC_Wait(MPIRPC* rpc)
{
int unique = rpc->unique;
Modified: test/cmpi/test-manyputs.c
===================================================================
--- test/cmpi/test-manyputs.c 2011-04-15 21:44:49 UTC (rev 179)
+++ test/cmpi/test-manyputs.c 2011-04-15 21:45:08 UTC (rev 180)
@@ -45,6 +45,8 @@
cmpi_put(key, value, strlen(value)+1);
free(value);
}
+ double stop = MPI_Wtime();
+ printf("TOOK: %0.3f\n", stop-start);
double stop = MPI_Wtime();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2011-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...> - 2010-04-20 04:17:03
|
Revision: 8
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=8&view=rev
Author: jmwozniak
Date: 2010-04-20 04:16:55 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Using only one MPIRPC.
Modified Paths:
--------------
Makefile.in
configure.ac
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-20 04:16:40 UTC (rev 7)
+++ Makefile.in 2010-04-20 04:16:55 UTC (rev 8)
@@ -75,14 +75,6 @@
# DISKSIM location
DISKSIM=@USE_DISKSIM@
-# MPIRPC choice
-ifeq (@USE_MPIRPC_1@,1)
- MPIRPC_DIR = src/mpirpc-1
-endif
-ifeq (@USE_MPIRPC_2@,1)
- MPIRPC_DIR = src/mpirpc-2
-endif
-
# configure default is silent, unless --enable-verbose-build in
# which case QUIET_COMPILE will _not_ be defined. Further allow
# silence to be overriden with "make V=1".
@@ -484,7 +476,7 @@
endif
-unpublish: src/mpirpc-2/unpublish.o $(CMPI)
+unpublish: src/mpirpc/unpublish.o $(CMPI)
$(Q) " MPICC $(@)"
$(E)$(MPICC) $(<) $(CMPI) $(LIBS) -o $(@)
Modified: configure.ac
===================================================================
--- configure.ac 2010-04-20 04:16:40 UTC (rev 7)
+++ configure.ac 2010-04-20 04:16:55 UTC (rev 8)
@@ -360,10 +360,8 @@
[use dense-1 table implementation]),
[AC_MSG_RESULT( [using dense-1 table implementation...] )
AC_DEFINE([USE_TABLE_DENSE_1], [1], [Using DENSE-1])
- AC_DEFINE([USE_MPIRPC_2], [1], [Using MPIRPC-2])
AC_DEFINE([USE_COMM_WORLD], [1], [Using MPI_COMM_WORLD])
USE_TABLE_DENSE_1=1
- USE_MPIRPC_2=1
USE_COMM_WORLD=1],
[USE_TABLE_DENSE_1=0])
@@ -373,10 +371,8 @@
[use kademlia-2A implementation]),
[AC_MSG_RESULT([using kademlia-2A implementation...])
AC_DEFINE([USE_TABLE_KDA_2A], [1], [Using Kademlia-2A])
- AC_DEFINE([USE_MPIRPC_2], [1], [Using MPIRPC-2])
AC_DEFINE([USE_COMM_WORLD], [1], [Using MPI_COMM_WORLD])
USE_TABLE_KDA_2A=1
- USE_MPIRPC_2=1
USE_COMM_WORLD=1],
[USE_TABLE_KDA_2A=0])
@@ -387,22 +383,16 @@
[AC_MSG_RESULT([using kademlia-2B implementation...])
AC_DEFINE([USE_TABLE_KDA_2B], [1],
[Using Kademlia-2B])
- AC_DEFINE([USE_MPIRPC_2], [1],
- [Using MPIRPC-2])
AC_DEFINE([USE_COMM_WORLD], [0],
[Not using MPI_COMM_WORLD])
USE_TABLE_KDA_2B=1
- USE_MPIRPC_2=1
USE_COMM_WORLD=0],
[USE_TABLE_KDA_2B=0])
dnl Table results:
AC_SUBST(USE_TABLE_DENSE_1)
-AC_SUBST(USE_TABLE_KDA_1)
AC_SUBST(USE_TABLE_KDA_2A)
AC_SUBST(USE_TABLE_KDA_2B)
-AC_SUBST(USE_MPIRPC_1)
-AC_SUBST(USE_MPIRPC_2)
AC_SUBST(USE_COMM_WORLD)
AC_ARG_ENABLE([driver],
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 04:38:15
|
Revision: 13
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=13&view=rev
Author: jmwozniak
Date: 2010-04-20 04:38:07 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Improvements...
Modified Paths:
--------------
Makefile.in
setup.sh
src/gossip/module.mk.in
src/mpirpc/module.mk.in
test/adts/module.mk.in
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-20 04:26:19 UTC (rev 12)
+++ Makefile.in 2010-04-20 04:38:07 UTC (rev 13)
@@ -562,14 +562,9 @@
$(E)rm -fv $(CMPI_DEPS) $(TEST_DEPS) \
$(MPIRPC) $(CMPI) $(MPIRPC_OBJS) $(CMPI_OBJS) \
$(KDA_OBJS) $(CMPI_IO) $(CMPI_PICS) \
- hex unhex hexord unpublish node driver \
- $(TEST_OUTPUT) $(TEST_PROGS) $(TEST_OBJS) \
- $(CMPI_PROGS) $(CMPI_CP_OBJS) splint.out \
- $(GUM_OBJS) \
- $(GOBS_OBJS) $(GOBS) src/gobs/launch.o \
- $(GACK_OBJS) $(GACK) \
- $(SKULLFS_OBJS) \
- $(ALL_GS_S) $(ALL_GS_I) $(ALL_GS_DUMMY)
+ hex unhex hexord unpublish node driver \
+ $(TEST_OUTPUT) $(TEST_PROGS) $(TEST_OBJS) \
+ $(CMPI_PROGS) $(CMPI_CP_OBJS) splint.out
# $(E)find . -name "*.avg" -exec rm -fv \{\} \;
# $(E)find . -name "*.per" -exec rm -fv \{\} \;
Modified: setup.sh
===================================================================
--- setup.sh 2010-04-20 04:26:19 UTC (rev 12)
+++ setup.sh 2010-04-20 04:38:07 UTC (rev 13)
@@ -4,11 +4,18 @@
mkdir -p maint/config
+if [[ -f configure &&
+ ! configure.ac -nt configure ]]
+then
+ echo "CMPI configure is up-to-date"
+ exit 2
+fi
+
if aclocal -I ./maint/config && autoheader && autoconf ; then
- echo "CMPI configure script successfully regenerated"
+ echo "CMPI configure script successfully regenerated"
else
- echo "Some part of configure regeneration failed!"
- exit 1
+ echo "Some part of configure regeneration failed!"
+ exit 1
fi
exit 0
Modified: src/gossip/module.mk.in
===================================================================
--- src/gossip/module.mk.in 2010-04-20 04:26:19 UTC (rev 12)
+++ src/gossip/module.mk.in 2010-04-20 04:38:07 UTC (rev 13)
@@ -5,7 +5,6 @@
DIR := src/gossip
ADT_SRC += $(DIR)/gossip.c
-ADT_SRC += $(DIR)/gs-debug.c
ifdef GOSSIP_ENABLE_BACKTRACE
MODCFLAGS_$(DIR)/gossip.c := -DGOSSIP_ENABLE_BACKTRACE
Modified: src/mpirpc/module.mk.in
===================================================================
--- src/mpirpc/module.mk.in 2010-04-20 04:26:19 UTC (rev 12)
+++ src/mpirpc/module.mk.in 2010-04-20 04:38:07 UTC (rev 13)
@@ -1,8 +1,4 @@
-DIR := $(MPIRPC_DIR)
+DIR := src/mpirpc
-ifeq (@USE_MPIRPC_2@,1)
- MPIRPC_SRC += $(DIR)/mpirpc.c
-endif
-
-
+MPIRPC_SRC += $(DIR)/mpirpc.c
Modified: test/adts/module.mk.in
===================================================================
--- test/adts/module.mk.in 2010-04-20 04:26:19 UTC (rev 12)
+++ test/adts/module.mk.in 2010-04-20 04:38:07 UTC (rev 13)
@@ -3,4 +3,4 @@
test/adts/test%.x: test/adts/test%.o src/mpi_tools/mpi_tools.o $(ADT_OBJS)
$(Q) " LINK $(@) "
- $(E)$(MPICC) $(MPE) $(<) $(LIBS) src/mpi_tools/mpi_tools.o $(ADT_OBJS) -o $(@)
+ $(E)$(MPICC) $(MPE) $(<) src/mpi_tools/mpi_tools.o $(ADT_OBJS) $(LIBS) -o $(@)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|