Thread: [C-mpi-commits] SF.net SVN: c-mpi:[5] include
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-04-20 04:12:40
|
Revision: 5
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=5&view=rev
Author: jmwozniak
Date: 2010-04-20 04:12:34 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Deleting unnecessary headers.
Modified Paths:
--------------
include/mpirpc-2.h
Removed Paths:
-------------
include/gobs_dense.h
include/gs-debug.h
include/kda-1.h
include/kda_neighbor-1.h
include/kda_types-1.h
include/mpirpc-1.h
Deleted: include/gobs_dense.h
===================================================================
--- include/gobs_dense.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/gobs_dense.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -1,46 +0,0 @@
-
-#ifndef GOBS_DENSE_H
-#define GOBS_DENSE_H
-
-#include <list.h>
-
-#include <gobs.gsh>
-
-typedef struct
-{
- int index;
- ait_entry* table;
-} gobs_dense_iterator;
-
-// extern gobs_fns gobs_dense_impl;
-
-extern ait_entry* gobs_dense_ait;
-extern int gobs_dense_ait_size;
-
-void gobs_dense_setup(MPI_Comm comm);
-
-void gobs_dense_ait_create();
-
-int gobs_dense_ait_get_size();
-
-ait_iterator* gobs_dense_get_iterator();
-
-ait_entry* gobs_dense_iterator_next(ait_iterator* iterator);
-
-ait_entry* gobs_dense_ait_lookup(gobs_id id);
-
-gum_node gobs_dense_random_member();
-
-struct list* gobs_dense_random_k_members(int k);
-
-void gobs_dense_fail(gum_node dead_node);
-
-bool gobs_dense_failed(gum_node node);
-
-/*
-gum_node gobs_dense_lookup(gobs_id id);
-
-__blocking gum_node gobs_dense_query(gum_node target, gobs_id id);
-*/
-
-#endif
Deleted: include/gs-debug.h
===================================================================
--- include/gs-debug.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/gs-debug.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -1,42 +0,0 @@
-
-/* This file just defines debugging masks to be used with the gossip
- * logging utility.
- */
-
-#ifndef __PVFS2_DEBUG_H
-#define __PVFS2_DEBUG_H
-
-#ifdef __KERNEL__
-#include <linux/types.h>
-#else
-#include <stdint.h>
-#include <stdlib.h>
-#endif
-#include <gossip.h>
-
-#define GS_D_NONE (uint64_t)0
-#define GS_D_EXAMPLE ((uint64_t)1 << 0)
-/* NOTE: add others here, along with corresponding entries in gs-debug.c */
-
-#define gs_debug_init() \
-do {\
- char* __mask_str; \
- uint64_t __mask; \
- __mask_str = getenv("GS_DEBUG_MASK"); \
- __mask = (__mask_str ? gs_debug_mask(__mask_str) : 0); \
- gossip_set_debug_mask(1, __mask); \
-}while(0)
-
-uint64_t gs_debug_mask(
- const char *event_logging);
-
-#endif /* __PVFS2_DEBUG_H */
-
-/*
- * Local variables:
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
Deleted: include/kda-1.h
===================================================================
--- include/kda-1.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/kda-1.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -1,145 +0,0 @@
-
-#ifndef KADEMLIA_1_H
-#define KADEMLIA_1_H
-
-#include <limits.h>
-#include <signal.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <unistd.h>
-
-#include <mpi.h>
-
-#include <hashtable.h>
-#include <itable.h>
-#include <list.h>
-#include <ilist.h>
-#include <inlist.h>
-#include <mpi_tools.h>
-#include <mpirpc.h>
-#include <cmpi.h>
-// #include <driver.h>
-
-#ifdef DISKSIM_LOCATION
-#include <disksim.h>
-#endif
-
-typedef int KDA_ID;
-
-#include "kda_types-1.h"
-#include "kda_neighbor-1.h"
-
-
-#define KDA_SPACE_SIZE (sizeof(KDA_ID)*8) // 160 in paper
-#define KDA_HASH_SPACE INT_MAX //
-
-/**
- KDA_ID_NULL=0 is an invalid KDA_ID used for semantic purposes.
- make_id must not create this id.
-*/
-#define KDA_ID_NULL 0;
-
-/**
- Obtain the Kademlia distance between two ids.
-*/
-#define XOR(id1, id2) (((int) id1) ^ ((int) id2))
-
-/**
- Contains neighbors. A bucket is all neighbors of a given
- distance 2^i - 2^i+1
-*/
-typedef struct list* K_BUCKET;
-
-extern int kda_nodes;
-extern struct itable* operations;
-
-
-void KDA_Init(int alpha_in, int k_in);
-
-//// General API...
-/**
- Return once op->status is KDA_STATUS_COMPLETE
-*/
-void KDA_Wait(KDA_Operation* op);
-
-//// Local API...
-int KDA_Local_rank(KDA_ID other_id);
-KDA_Neighbor* KDA_Local_ID(int other_rank);
-
-
-//// Client API:
-MPIRPC* KDA_Translate(int rank, KDA_ID id);
-MPIRPC* KDA_Translate_k(int rank, KDA_ID id);
-MPIRPC* KDA_Lookup(int rank, char* key);
-MPIRPC* KDA_Lookup_k(int rank, char* key);
-MPIRPC* KDA_Store(int rank, char* key, char* value);
-MPIRPC* KDA_Retrieve(int rank, char* key);
-MPIRPC* KDA_Update(int rank, char* key, char* value, int length, int offset);
-
-//// In-DHT API...
-void KDA_Ping(KDA_ID other_id);
-void KDA_Announce(void);
-struct ilist* KDA_Find_key(char* key);
-struct ilist* KDA_Find(KDA_ID object_id);
-struct ilist* KDA_Closest(KDA_ID object_id);
-
-//// Helpers...
-KDA_Operation* KDA_Operate(KDA_ID object_id, char* name, void* args,
- void (*proceed)(MPIRPC* rpc),
- KDA_Query* query);
-bool KDA_Find_node(KDA_Operation* op);
-bool KDA_Find_node_again(KDA_Operation* op);
-void KDA_Operation_free(KDA_Operation* op);
-
-char* KDA_Description(void);
-char* KDA_id_tostring(KDA_ID other_id);
-
-KDA_ID make_id(void);
-void join(int other_rank);
-char* id_tostring(void);
-void listen_loop(void);
-void bootstrap(int other_rank);
-void bootjoin(int other_id, int other_rank);
-void rpc_bootjoin(int other_rank);
-void bootping(void);
-void dump_buckets(void);
-char* bucket_usage(void);
-char* buckets_tostring(void);
-bool add_neighbor(KDA_Neighbor* neighbor);
-
-//// Handlers...
-
-void handle_announce(int caller, int unique, char* args);
-void handle_info(int caller, int unique, char* args);
-void handle_debug_tables(int caller, int unique, char* args);
-void handle_bucket_usage(int caller, int unique, char* args);
-void handle_bootjoin(int caller, int unique, char* args);
-void handle_bootping(int caller, int unique, char* args);
-void handle_update(int caller, int unique, char* args);
-void handle_find_node(int caller, int unique, char* args);
-void handle_ping(int caller, int unique, char* args);
-void handle_query_id(int caller, int unique, char* args);
-void handle_query_id_k(int caller, int unique, char* args);
-void handle_store(int caller, int unique, char* args);
-void handle_retrieve(int caller, int unique, char* args);
-void handle_quit(int caller, int unique, char* args);
-
-//// Synchronous methods...
-struct ilist* find_node(KDA_ID id);
-
-//// Asynchronous methods and return services...
-void query_id(int caller, int unique, KDA_ID id);
-void return_query_id(KDA_Operation* op);
-void query_id_k(int caller, int unique, KDA_ID id);
-void return_query_id_k(KDA_Operation* op);
-
-//// Proceeds...
-void proceed_bootjoin(MPIRPC* rpc);
-void proceed_find(MPIRPC* rpc);
-void proceed_ping(MPIRPC* rpc);
-
-
-
-#endif
Deleted: include/kda_neighbor-1.h
===================================================================
--- include/kda_neighbor-1.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/kda_neighbor-1.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -1,36 +0,0 @@
-
-#ifndef KDA_NEIGHBOR_1_H
-#define KDA_NEIGHBOR_1_H
-
-#include <stdbool.h>
-
-#include "kda-1.h"
-
-KDA_Neighbor* neighbor_create(KDA_ID id, int rank);
-KDA_Neighbor* neighbor_clone(KDA_Neighbor* neighbor);
-void neighbor_make(KDA_ID id, int rank, KDA_Neighbor* neighbor);
-
-/**
- Compare neighbors based on id.
-*/
-int neighbor_cmp(void* object1, void* object2);
-
-/**
- Compare lastseen times for neighbors n1, n2.
- @return 1 iff n1 > n2, -1 iff n1 < n2, 0 iff n1 == n2
-*/
-int neighbor_time_cmp(void* object1, void* object2);
-
-
-//// Output methods:
-char* neighbor_name(void* object);
-int neighbor_name_sprint(char* buffer, void* object);
-char* neighbor_tostring(void* object);
-int neighbor_sprint(char* buffer, void* object);
-void neighbor_dump(void* object);
-char* neighbor_ranks_tostring(struct ilist* neighbors);
-
-//// Input methods:
-struct inlist* neighbor_rank_list(char* data);
-
-#endif
Deleted: include/kda_types-1.h
===================================================================
--- include/kda_types-1.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/kda_types-1.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -1,66 +0,0 @@
-
-#ifndef KADEMLIA_TYPES_1_H
-#define KADEMLIA_TYPES_1_H
-
-typedef struct neighbor
-{
- int rank;
- KDA_ID id;
- time_t lastseen;
- bool quitting;
-} KDA_Neighbor;
-
-typedef struct kda_query KDA_Query;
-typedef struct kda_operation KDA_Operation;
-
-struct kda_query
-{
- int caller;
- int unique;
- char* result;
- void (*service)(KDA_Operation* op);
-};
-
-/**
- Performs an operation.
- -# Finds k nodes nearest to object_id using
- KDA_Find_node -> rpc_find_node -> proceed_find.
- -# When proceed_find converges, it
- calls map.
- -# map either maps the function name out (if name given),
- proceeding with the proceed function, or
- returns the query.
-*/
-struct kda_operation
-{
- KDA_ID object_id;
- int unique;
- // An MPIRPC function symbolic name to map() over found nodes:
- char* name;
- // The args for map().
- char* args;
- // Maps distance to neighbors:
- struct ilist* k_closest;
- // neighbor->ranks that have been searched but not heard from:
- struct inlist* outstanding;
- // neighbor->ranks that have been searched for this operation:
- struct inlist* contacted;
- // neighbor ranks that have returned the RPC for this operation:
- struct inlist* returned;
- // If the latest rpc_find_node calls improved our search.
- bool improved;
- int status;
- // How to proceed after map(name):
- void (*proceed)(MPIRPC* op);
- // Incoming query to respond to that triggered this operation:
- KDA_Query* query;
-};
-
-enum
-{
- KDA_STATUS_SEARCHING,
- KDA_STATUS_CALLING,
- KDA_STATUS_COMPLETE
-};
-
-#endif
Deleted: include/mpirpc-1.h
===================================================================
--- include/mpirpc-1.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/mpirpc-1.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -1,130 +0,0 @@
-
-#ifndef MPIRPC_1_H
-#define MPIRPC_1_H
-
-#define _XOPEN_SOURCE 500
-
-#include <assert.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include <cmpi-config.h>
-
-#include <list.h>
-#include <itable.h>
-#include <hashtable.h>
-
-#include <mpi_tools.h>
-#include <gossip.h>
-
-#include "handlers.h"
-
-extern int unique;
-
-extern useconds_t snooze_max;
-
-extern int emulating_fault;
-
-extern char* MPIRPC_RESULT_FAULT;
-
-typedef struct mpirpc MPIRPC;
-struct mpirpc
-{
- int status;
- int target;
- char* name;
- char* args;
- char* result;
- void* extras;
- void (*proceed) (MPIRPC* rpc);
- int unique;
- bool cancelled;
-
- int name_length;
- int args_length;
- MPI_Request* request;
-};
-
-typedef struct mpirpc_value MPIRPC_Value;
-struct mpirpc_value
-{
- int unique;
- int length;
- char* result;
- MPI_Request* request;
-};
-
-//// API...
-
-void MPIRPC_Init(void);
-
-bool MPIRPC_Check(void);
-
-void MPIRPC_Register(char* name,
- void (*method)(int caller, int unique, char* args));
-
-MPIRPC* MPIRPC_Call(int target, char* name, char* args, void* extras,
- void (*proceed)(MPIRPC*));
-
-char* MPIRPC_Block(int target, char* name, char* args);
-
-void MPIRPC_Return(int caller, int unique, char* result);
-
-void MPIRPC_Free(MPIRPC* rpc);
-
-void MPIRPC_Kill(int target);
-
-void MPIRPC_Flush_returns(void);
-
-void MPIRPC_Die(int caller);
-
-char* MPIRPC_Wait(MPIRPC* rpc);
-
-void MPIRPC_Finalize(void);
-
-//// Debugging...
-
-void MPIRPC_Dump(MPIRPC* rpc);
-
-void MPIRPC_Dump_portmap(void);
-
-//// Internals...
-
-MPIRPC* MPIRPC_Lookup(int unique);
-
-void MPIRPC_Snooze(void);
-
-void MPIRPC_Snooze_reset(void);
-
-enum
-{
- MPIRPC_STATUS_PROTO,
- MPIRPC_STATUS_CALLED,
- MPIRPC_STATUS_RETURNED,
- MPIRPC_STATUS_FAULT
-};
-
-enum
-{
- MPIRPC_TAG_CONTROL,
- MPIRPC_TAG_UNIQUE,
- MPIRPC_TAG_NAME,
- MPIRPC_TAG_LENGTH,
- MPIRPC_TAG_ARGS,
- MPIRPC_TAG_RESULT
-};
-
-enum
-{
- MPIRPC_MSG_CALL,
- MPIRPC_MSG_RETURN,
- MPIRPC_MSG_FAULT,
- MPIRPC_MSG_DIE
-};
-
-#define MPIRPC_NAME_SIZE 128
-#define MPIRPC_ARG_MAX 1024
-#define MPIRPC_PROCEED_NULL ((void (*)(MPIRPC*)) 1)
-
-#endif
Modified: include/mpirpc-2.h
===================================================================
--- include/mpirpc-2.h 2010-04-20 04:09:45 UTC (rev 4)
+++ include/mpirpc-2.h 2010-04-20 04:12:34 UTC (rev 5)
@@ -23,8 +23,8 @@
extern useconds_t snooze_max;
-#define MPIRPC_MAX_NAME 100
-#define MPIRPC_MAX_ARGS 200
+#define MPIRPC_MAX_NAME 128
+#define MPIRPC_MAX_ARGS 256
#define MPIRPC_PROCEED_NULL ((void (*)(MPIRPC*)) 1)
typedef struct
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-04-20 04:14:40
|
Revision: 6
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=6&view=rev
Author: jmwozniak
Date: 2010-04-20 04:14:33 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Use only MPIRPC-2.
Modified Paths:
--------------
Makefile.in
configure.ac
include/mpirpc.h
Removed Paths:
-------------
include/mpirpc-2.h
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-20 04:12:34 UTC (rev 5)
+++ Makefile.in 2010-04-20 04:14:33 UTC (rev 6)
@@ -5,7 +5,7 @@
# clean cleans up make-created files
# cleaner cleans up configure-created files
# distclean _really_ cleans up; returns to pristine tree
-# etags generates tags file for use by editors
+# tags generates etags file for use by editors
# INPUT CONTROL VARIABLES
# D : if 1, turn on debugging output in CMPI programs
@@ -547,14 +547,12 @@
$(Q) " CPP $@"
$(E)$(CC) $(LIBCFLAGS) $(CFLAGS) $(call modcflags,$<) $< -E -o $@
-TAGS:
- $(Q) " TAGS "
- $(E) find $(srcdir) -name '*.[ch]' | xargs etags -a $(ETAGS_FLAGS)
+tags: TAGS
# Generate TAGS based on only files used by CMPI as configured:
-TAGS.config: deps.config.txt
+TAGS: deps.config.txt
$(Q) " TAGS "
- $(E)etags -o $(@) $(ETAGS_FLAGS) `cat deps.config.txt`
+ $(E)etags $(ETAGS_FLAGS) `cat deps.config.txt`
# $(E)etags `cat deps.txt`
# Extract all files from *.d files, format and sort:
@@ -591,7 +589,7 @@
# some stuff that is cleaned in both distclean and dist targets
cleaner: clean
$(Q) " CLEANER"
- $(E)rm -fvr TAGS TAGS.config deps.config.txt \
+ $(E)rm -fvr TAGS deps.config.txt \
maint/mpi-depend.sh \
examples/pvfs2-server.rc \
/doxygen/pvfs2-doxygen.conf \
@@ -637,7 +635,7 @@
%.d: %.c
$(Q) " DEP $@"
# $(E) $(MPICC) -M $(CFLAGS) $(<) | sed -e 's@.*\.o:@@;s@\\@@' > $(@)
- $(E) CC="$(MPICC)" $(srcdir)/maint/depend.sh $(call dirname,$*) $(CFLAGS) $(call modcflags,$<) $< > $@
+ $(E) CC="$(MPICC)" $(srcdir)/depend.sh $(call dirname,$*) $(CFLAGS) $(call modcflags,$<) $< > $@
SPLINTOPTS = +posixlib +gnuextensions # -preproc
SPLINT_GS_S := $(shell find . -name "*.gs.s")
Modified: configure.ac
===================================================================
--- configure.ac 2010-04-20 04:12:34 UTC (rev 5)
+++ configure.ac 2010-04-20 04:14:33 UTC (rev 6)
@@ -367,19 +367,6 @@
USE_COMM_WORLD=1],
[USE_TABLE_DENSE_1=0])
-AC_ARG_ENABLE([table-kda-1],
- AS_HELP_STRING(
- [--enable-table-kda-1],
- [use kademlia-1 implementation]),
- [AC_MSG_RESULT([using kademlia-1 implementation...] )
- AC_DEFINE([USE_TABLE_KDA_1], [1], [Using Kademlia-1])
- AC_DEFINE([USE_MPIRPC_1], [1], [Using MPIRPC-1])
- AC_DEFINE([USE_COMM_WORLD], [1], [Using MPI_COMM_WORLD])
- USE_TABLE_KDA_1=1
- USE_MPIRPC_1=1
- USE_COMM_WORLD=1],
- [USE_TABLE_KDA_1=0])
-
AC_ARG_ENABLE([table-kda-2A],
AS_HELP_STRING(
[--enable-table-kda-2A],
Deleted: include/mpirpc-2.h
===================================================================
--- include/mpirpc-2.h 2010-04-20 04:12:34 UTC (rev 5)
+++ include/mpirpc-2.h 2010-04-20 04:14:33 UTC (rev 6)
@@ -1,199 +0,0 @@
-
-#ifndef MPIRPC_2_H
-#define MPIRPC_2_H
-
-#define _XOPEN_SOURCE 500
-
-#include <stdbool.h>
-#include <unistd.h>
-
-#include <cmpi-config.h>
-
-#include <list.h>
-#include <itable.h>
-#include <hashtable.h>
-
-#include <mpi_tools.h>
-
-#ifdef DMALLOC
-#include <dmalloc.h>
-#endif
-
-extern int unique;
-
-extern useconds_t snooze_max;
-
-#define MPIRPC_MAX_NAME 128
-#define MPIRPC_MAX_ARGS 256
-#define MPIRPC_PROCEED_NULL ((void (*)(MPIRPC*)) 1)
-
-typedef struct
-{
- MPI_Comm comm;
- int rank;
-} MPIRPC_Node;
-
-typedef struct
-{
- MPI_Comm comm;
- MPI_Request request;
-} MPIRPC_Channel;
-
-typedef struct mpirpc
-{
- MPIRPC_Node target;
- int status;
- char name[MPIRPC_MAX_NAME];
- char args[MPIRPC_MAX_ARGS];
- char* blob;
- int blob_length;
- char* result;
- int result_length;
- void* extras;
- void (*proceed) (struct mpirpc* rpc);
- int unique;
- bool cancelled;
-
- // Internals:
- /**
- name_length is transferred via Isend().
- */
- int name_length;
-
- /**
- args_length is transferred via Isend().
- */
- int args_length;
-
- /**
- Array of Isend() requests to be freed on return.
- */
- MPI_Request request[8];
-} MPIRPC;
-
-/**
- Internal MPIRPC return value. Used for garbage collection.
-*/
-typedef struct mpirpc_value MPIRPC_Value;
-struct mpirpc_value
-{
- int unique;
- int length;
- char* result;
- MPI_Request request[4];
-};
-
-//// API...
-
-void MPIRPC_Init(void);
-
-bool MPIRPC_Check(void);
-
-void MPIRPC_Recv(MPI_Comm comm);
-
-void MPIRPC_Register(char* name,
- void (*f)(MPIRPC_Node,int,char*,char*,int));
-
-bool MPIRPC_Comm_add(MPI_Comm comm);
-
-void MPIRPC_Close(MPIRPC_Channel* channel);
-
-MPIRPC* MPIRPC_Call(MPIRPC_Node target, char* name, char* args,
- void* extras, void (*proceed)(MPIRPC*));
-
-MPIRPC* MPIRPC_Call_blob(MPIRPC_Node target, char* name, char* args,
- char* blob, int blob_length,
- void* extras, void (*proceed)(MPIRPC*));
-
-char* MPIRPC_Block(MPIRPC_Node target, char* name, char* args);
-
-char* MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
- char* blob, int blob_length);
-
-char* MPIRPC_Wait(MPIRPC* rpc);
-
-void MPIRPC_Null(MPIRPC_Node caller, int unique);
-
-void MPIRPC_Return(MPIRPC_Node caller, int unique,
- char* result, int rlength);
-
-MPIRPC_Node* MPIRPC_Node_create(MPI_Comm comm, int rank);
-
-MPIRPC_Node* MPIRPC_Node_make(MPI_Comm comm, int rank,
- MPIRPC_Node* node);
-
-void MPIRPC_Garbage_collect(void);
-
-struct list* MPIRPC_Comms(void);
-
-void MPIRPC_Dump(MPIRPC* rpc);
-
-void MPIRPC_Dump_portmap(void);
-
-void MPIRPC_Dump_channels(void);
-
-MPIRPC* MPIRPC_Lookup(int unique);
-
-void MPIRPC_Flush_returns(void);
-
-char* MPIRPC_Comm_get_name(MPI_Comm comm);
-
-void MPIRPC_Free(MPIRPC* rpc);
-
-void MPIRPC_Snooze(void);
-
-void MPIRPC_Snooze_reset(void);
-
-//// Internal routines...
-
-bool MPIRPC_Garbage_collect_value(void);
-
-void MPIRPC_Value_free(MPIRPC_Value* value);
-
-MPIRPC_Value* MPIRPC_Value_create(int unique, char* result, int length);
-
-//// Data structure helpers...
-
-int MPIRPC_Node_cmp(void* node1, void* node2);
-
-int MPIRPC_Channel_cmp(void* c1, void* c2);
-
-int MPIRPC_Channel_comm_cmp(void* c1, void* c2);
-
-MPIRPC_Channel* MPIRPC_Channel_for_node(MPIRPC_Node node);
-
-void MPIRPC_Finalize(void);
-
-/**
- MPIRPC stati.
-*/
-enum
-{
- MPIRPC_STATUS_PROTO,
- MPIRPC_STATUS_CALLED,
- MPIRPC_STATUS_RETURNED
-};
-
-/**
- Tags used by MPIRPC.
-*/
-enum
-{
- MPIRPC_TAG_CONTROL,
- MPIRPC_TAG_UNIQUE,
- MPIRPC_TAG_NAME,
- MPIRPC_TAG_LENGTH,
- MPIRPC_TAG_ARGS,
- MPIRPC_TAG_RESULT
-};
-
-enum
-{
- MPIRPC_MSG_CALL = 12,
- MPIRPC_MSG_RETURN = 13,
- MPIRPC_MSG_DISCONNECT = 14,
- MPIRPC_MSG_OK = 15,
- MPIRPC_MSG_FAIL = 16
-};
-
-#endif
Modified: include/mpirpc.h
===================================================================
--- include/mpirpc.h 2010-04-20 04:12:34 UTC (rev 5)
+++ include/mpirpc.h 2010-04-20 04:14:33 UTC (rev 6)
@@ -2,12 +2,196 @@
#ifndef MPIRPC_H
#define MPIRPC_H
+#include <stdbool.h>
+#include <unistd.h>
+
#include <cmpi-config.h>
-#if USE_MPIRPC_1 == 1
-#include <mpirpc-1.h>
-#else
-#include <mpirpc-2.h>
+#include <list.h>
+#include <itable.h>
+#include <hashtable.h>
+
+#include <mpi_tools.h>
+
+#ifdef DMALLOC
+#include <dmalloc.h>
#endif
+extern int unique;
+
+extern useconds_t snooze_max;
+
+#define MPIRPC_MAX_NAME 128
+#define MPIRPC_MAX_ARGS 256
+#define MPIRPC_PROCEED_NULL ((void (*)(MPIRPC*)) 1)
+
+typedef struct
+{
+ MPI_Comm comm;
+ int rank;
+} MPIRPC_Node;
+
+typedef struct
+{
+ MPI_Comm comm;
+ MPI_Request request;
+} MPIRPC_Channel;
+
+typedef struct mpirpc
+{
+ MPIRPC_Node target;
+ int status;
+ char name[MPIRPC_MAX_NAME];
+ char args[MPIRPC_MAX_ARGS];
+ char* blob;
+ int blob_length;
+ char* result;
+ int result_length;
+ void* extras;
+ void (*proceed) (struct mpirpc* rpc);
+ int unique;
+ bool cancelled;
+
+ // Internals:
+ /**
+ name_length is transferred via Isend().
+ */
+ int name_length;
+
+ /**
+ args_length is transferred via Isend().
+ */
+ int args_length;
+
+ /**
+ Array of Isend() requests to be freed on return.
+ */
+ MPI_Request request[8];
+} MPIRPC;
+
+/**
+ Internal MPIRPC return value. Used for garbage collection.
+*/
+typedef struct mpirpc_value MPIRPC_Value;
+struct mpirpc_value
+{
+ int unique;
+ int length;
+ char* result;
+ MPI_Request request[4];
+};
+
+//// API...
+
+void MPIRPC_Init(void);
+
+bool MPIRPC_Check(void);
+
+void MPIRPC_Recv(MPI_Comm comm);
+
+void MPIRPC_Register(char* name,
+ void (*f)(MPIRPC_Node,int,char*,char*,int));
+
+bool MPIRPC_Comm_add(MPI_Comm comm);
+
+void MPIRPC_Close(MPIRPC_Channel* channel);
+
+MPIRPC* MPIRPC_Call(MPIRPC_Node target, char* name, char* args,
+ void* extras, void (*proceed)(MPIRPC*));
+
+MPIRPC* MPIRPC_Call_blob(MPIRPC_Node target, char* name, char* args,
+ char* blob, int blob_length,
+ void* extras, void (*proceed)(MPIRPC*));
+
+char* MPIRPC_Block(MPIRPC_Node target, char* name, char* args);
+
+char* MPIRPC_Block_blob(MPIRPC_Node target, char* name, char* args,
+ char* blob, int blob_length);
+
+char* MPIRPC_Wait(MPIRPC* rpc);
+
+void MPIRPC_Null(MPIRPC_Node caller, int unique);
+
+void MPIRPC_Return(MPIRPC_Node caller, int unique,
+ char* result, int rlength);
+
+MPIRPC_Node* MPIRPC_Node_create(MPI_Comm comm, int rank);
+
+MPIRPC_Node* MPIRPC_Node_make(MPI_Comm comm, int rank,
+ MPIRPC_Node* node);
+
+void MPIRPC_Garbage_collect(void);
+
+struct list* MPIRPC_Comms(void);
+
+void MPIRPC_Dump(MPIRPC* rpc);
+
+void MPIRPC_Dump_portmap(void);
+
+void MPIRPC_Dump_channels(void);
+
+MPIRPC* MPIRPC_Lookup(int unique);
+
+void MPIRPC_Flush_returns(void);
+
+char* MPIRPC_Comm_get_name(MPI_Comm comm);
+
+void MPIRPC_Free(MPIRPC* rpc);
+
+void MPIRPC_Snooze(void);
+
+void MPIRPC_Snooze_reset(void);
+
+//// Internal routines...
+
+bool MPIRPC_Garbage_collect_value(void);
+
+void MPIRPC_Value_free(MPIRPC_Value* value);
+
+MPIRPC_Value* MPIRPC_Value_create(int unique, char* result, int length);
+
+//// Data structure helpers...
+
+int MPIRPC_Node_cmp(void* node1, void* node2);
+
+int MPIRPC_Channel_cmp(void* c1, void* c2);
+
+int MPIRPC_Channel_comm_cmp(void* c1, void* c2);
+
+MPIRPC_Channel* MPIRPC_Channel_for_node(MPIRPC_Node node);
+
+void MPIRPC_Finalize(void);
+
+/**
+ MPIRPC stati.
+*/
+enum
+{
+ MPIRPC_STATUS_PROTO,
+ MPIRPC_STATUS_CALLED,
+ MPIRPC_STATUS_RETURNED
+};
+
+/**
+ Tags used by MPIRPC.
+*/
+enum
+{
+ MPIRPC_TAG_CONTROL,
+ MPIRPC_TAG_UNIQUE,
+ MPIRPC_TAG_NAME,
+ MPIRPC_TAG_LENGTH,
+ MPIRPC_TAG_ARGS,
+ MPIRPC_TAG_RESULT
+};
+
+enum
+{
+ MPIRPC_MSG_CALL = 12,
+ MPIRPC_MSG_RETURN = 13,
+ MPIRPC_MSG_DISCONNECT = 14,
+ MPIRPC_MSG_OK = 15,
+ MPIRPC_MSG_FAIL = 16
+};
+
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jmw...@us...> - 2010-05-18 18:16:59
|
Revision: 128
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=128&view=rev
Author: jmwozniak
Date: 2010-05-18 18:16:51 +0000 (Tue, 18 May 2010)
Log Message:
-----------
Increase some constants
Modified Paths:
--------------
include/cmpi.h
include/list.h
Modified: include/cmpi.h
===================================================================
--- include/cmpi.h 2010-05-17 22:20:29 UTC (rev 127)
+++ include/cmpi.h 2010-05-18 18:16:51 UTC (rev 128)
@@ -46,7 +46,7 @@
//// Communication settings...
// Table size for outstanding asynchronous communication:
-#define CALL_TABLE_SIZE 3
+#define CALL_TABLE_SIZE 16
extern int cmpi_status;
Modified: include/list.h
===================================================================
--- include/list.h 2010-05-17 22:20:29 UTC (rev 127)
+++ include/list.h 2010-05-18 18:16:51 UTC (rev 128)
@@ -13,8 +13,8 @@
#include <mpi_tools.h>
-// Maximum size of a klist datum
-#define LIST_MAX_DATUM 100
+// Maximum size of a list datum
+#define LIST_MAX_DATUM 1024
struct list_item
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|