branch, ticket-227, updated. 2de95fd20ecffd7f9385ec9eacf308c71ec5dd81
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "". The branch, ticket-227 has been updated via 2de95fd20ecffd7f9385ec9eacf308c71ec5dd81 (commit) via 78ba3f78e3ae74a6dfe3aff0b5f50b8cf72cb077 (commit) from 1d6834bbaec12013f0431b791dc5bca4e376cdd6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2de95fd20ecffd7f9385ec9eacf308c71ec5dd81 Author: Phil Carns <[email protected]> Date: Wed Jun 26 21:37:03 2013 -0400 stub server side mercury engine commit 78ba3f78e3ae74a6dfe3aff0b5f50b8cf72cb077 Author: Phil Carns <[email protected]> Date: Wed Jun 26 21:24:56 2013 -0400 --with-mercury option to configure ----------------------------------------------------------------------- Summary of changes: code/Makefile.in | 6 ++- code/configure.ac | 18 +++++++++ code/src/remote/mercury-engine.ae | 68 ++++++++++++++++++++++++++++++++++++ code/src/remote/mercury-engine.hae | 11 ++++++ code/src/remote/mercury-svr.ae | 44 +++++++++++++++++++++++ code/src/remote/module.mk.in | 8 ++++- 6 files changed, 152 insertions(+), 3 deletions(-) create mode 100644 code/src/remote/mercury-engine.ae create mode 100644 code/src/remote/mercury-engine.hae create mode 100644 code/src/remote/mercury-svr.ae Diff of changes: diff --git a/code/Makefile.in b/code/Makefile.in index 44203f7..4f52958 100644 --- a/code/Makefile.in +++ b/code/Makefile.in @@ -72,7 +72,7 @@ ifneq (0,$(VALGRIND_CLEAN)) CPPFLAGS += -DVALGRIND_CLEAN -DVALGRIND endif -CFLAGS= -I$(srcdir)/include -I. -I$(srcdir) @CFLAGS@ $(CPPFLAGS) +CFLAGS= -I$(srcdir)/include -I. -I$(srcdir) @CFLAGS@ @MERCURY_CFLAGS@ $(CPPFLAGS) # enable relocatable #CFLAGS += -fPIC @@ -109,7 +109,7 @@ LIBCFLAGS=@LIBCFLAGS@ LIBCFLAGS += -DEV_CONFIG_H=\"triton-config.h\" LDFLAGS += @LDFLAGS@ LIBS += @LIBS@ -lcrypto -LIBS += @AESOP_LIBS@ -lc-utils -lm -ldb +LIBS += @AESOP_LIBS@ @MERCURY_LIBS@ -lc-utils -lm -ldb DEPLIBS += @THREAD_LIB@ @@ -122,6 +122,8 @@ MPILDFLAGS = @MPILDFLAGS@ MPILIBS = @MPILIBS@ BUILD_MPI = @BUILD_MPI@ +USE_MERCURY=@USE_MERCURY@ + CFLAGS += $(MPICFLAGS) LDFLAGS += $(MPILDFLAGS) LIBS += $(MPILIBS) diff --git a/code/configure.ac b/code/configure.ac index d488f19..6504eb4 100644 --- a/code/configure.ac +++ b/code/configure.ac @@ -57,6 +57,22 @@ AECC=${withval}/bin/aecc AESOP_LIBS=`PKG_CONFIG_PATH=${withval}/lib/pkgconfig pkg-config aesop --libs` AC_SUBST(USE_AESOP) +USE_MERCURY= +AC_ARG_WITH(mercury, + [ --with-mercury=<dir> Location of external mercury package], + [ + AC_CHECK_FILE(${withval}/mercury.h) + USE_MERCURY=${withval} + ], + [ + USE_MERCURY= + ]) +AECC=${withval}/bin/aecc +MERCURY_LIBS=`PKG_CONFIG_PATH=${withval}/lib/pkgconfig pkg-config mercury --libs` +MERCURY_CFLAGS=`PKG_CONFIG_PATH=${withval}/lib/pkgconfig pkg-config mercury --cflags` +AC_SUBST(USE_MERCURY) + + dnl ====================================================================== dnl Try harder to be valgrind safe dnl ====================================================================== @@ -360,6 +376,8 @@ AC_SUBST(BLOCKSOPT) AC_SUBST(LIBCFLAGS) AC_SUBST(THREAD_LIB) AC_SUBST(AESOP_LIBS) +AC_SUBST(MERCURY_LIBS) +AC_SUBST(MERCURY_CFLAGS) AC_CHECK_LIB([crypto], [SHA1], [], [AC_MSG_ERROR([-lcrypto required. Install OpenSSL.])]) diff --git a/code/src/remote/mercury-engine.ae b/code/src/remote/mercury-engine.ae new file mode 100644 index 0000000..60b2215 --- /dev/null +++ b/code/src/remote/mercury-engine.ae @@ -0,0 +1,68 @@ + +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> +#include <unistd.h> + +#include <aesop/aesop.h> +#include <triton-thread.h> +#include "src/common/triton-error.h" +#include "src/remote/mercury-engine.hae" + +#include "mercury_handler.h" +#include "na_bmi.h" + +/* TODO: configurable transport and address */ +/* TODO: replace fprintf() calls */ + +static triton_mutex_t module_lock = TRITON_MUTEX_INITIALIZER; +static int module_refcount = 0; + +triton_ret_t triton_mercury_svr_init(void) +{ + na_class_t *network_class = NULL; + int hg_ret; + + triton_mutex_lock(&module_lock); + + if (!module_refcount) + { + + /* Initialize the interface */ + network_class = NA_BMI_Init("bmi_tcp", "tcp://localhost:3344", BMI_INIT_SERVER); + + hg_ret = HG_Handler_init(network_class); + if (hg_ret != HG_SUCCESS) + { + fprintf(stderr, "Could not initialize function shipper handler\n"); + return(TRITON_ERR_UNKNOWN); + } + + /* TODO: start thread to run Handler_process() */ + + } + module_refcount++; + triton_mutex_unlock(&module_lock); + + return(TRITON_SUCCESS); +} + +void triton_mercury_svr_finalize(void) +{ + int hg_ret; + + triton_mutex_lock(&module_lock); + module_refcount--; + + if (!module_refcount) + { + /* TODO: stop thread */ + + hg_ret = HG_Handler_finalize(); + if (hg_ret != HG_SUCCESS) { + fprintf(stderr, "Could not finalize function shipper handler\n"); + return; + } + } + triton_mutex_unlock(&module_lock); +} diff --git a/code/src/remote/mercury-engine.hae b/code/src/remote/mercury-engine.hae new file mode 100644 index 0000000..cd954ee --- /dev/null +++ b/code/src/remote/mercury-engine.hae @@ -0,0 +1,11 @@ +#ifndef __REMOTE_HAE__ +#define __REMOTE_HAE__ + +#include <aesop/aesop.h> +#include "src/common/triton-error.h" + +triton_ret_t triton_mercury_svr_init(void); + +void triton_mercury_svr_finalize(void); + +#endif diff --git a/code/src/remote/mercury-svr.ae b/code/src/remote/mercury-svr.ae new file mode 100644 index 0000000..d981f88 --- /dev/null +++ b/code/src/remote/mercury-svr.ae @@ -0,0 +1,44 @@ +#include <stdio.h> +#include <errno.h> +#include <assert.h> +#include <stdio.h> + +#include <aesop/aesop.h> +#include "src/zeroconf/zeroconf.h" + +static void triton_perror(const char *s, triton_ret_t ret); + +static __blocking int run_server(void) +{ + return 0; +} + +__blocking int aesop_main(int argc, char **argv) +{ + triton_ret_t ret; + int test_ret; + + test_ret = run_server(); + if(test_ret == 0) + printf("Test success.\n"); + else + printf("Test failure.\n"); + + return test_ret; +} +aesop_main_set(aesop_main); + +static void triton_perror(const char *s, triton_ret_t ret) +{ + /* TODO: fix this */ + fprintf(stderr, "%s: I have no clue how to print this error.\n", s); +} + +/* + * Local variables: + * c-indent-level: 4 + * c-basic-offset: 4 + * End: + * + * vim: ft=c ts=8 sts=4 sw=4 expandtab + */ diff --git a/code/src/remote/module.mk.in b/code/src/remote/module.mk.in index 0f50440..1da1b53 100644 --- a/code/src/remote/module.mk.in +++ b/code/src/remote/module.mk.in @@ -11,7 +11,13 @@ AELIBSRC += $(DIR_REMOTE)/message.ae \ $(DIR_REMOTE)/service.ae \ $(DIR_REMOTE)/retry-method.ae \ $(DIR_REMOTE)/client-server-exec.ae \ - $(DIR_REMOTE)/core-client.ae + $(DIR_REMOTE)/core-client.ae + +ifneq (,$(USE_MERCURY)) +AESOP_HDR += $(DIR_REMOTE)/mercury-engine.hae +AELIBSRC += $(DIR_REMOTE)/mercury-engine.ae +endif AERLIBSRC += $(DIR_REMOTE)/core.aer +AETESTSRC += $(DIR_REMOTE)/mercury-svr.ae hooks/post-receive --
participants (1)
-
noreply@mcs.anl.gov