diff --git a/.gitignore b/.gitignore index c703f184acb1..e51627a13b99 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ .project .cproject .settings +test/test +libuct.so diff --git a/Makefile b/Makefile new file mode 100644 index 000000000000..7195a2bb3bef --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ + +LIBMOPSYTL = libuct.so +TEST = test/test +CC = gcc +RM = rm -f +CPPFLAGS = -Isrc +CFLAGS = -O3 -g + +LIBMOPSY_HEADERS = \ + src/uct/api/tl_base.h \ + src/uct/api/tl_def.h \ + src/uct/api/tl.h + +LIBMOPSY_SOURCES = \ + src/uct/tl/tl.c + +TEST_SOURCES = \ + test/test.c + +.PHONY: clean all + +all: $(LIBMOPSYTL) $(TEST) + +clean: + $(RM) $(LIBMOPSYTL) $(TEST) + +$(LIBMOPSYTL): $(LIBMOPSY_SOURCES) $(LIBMOPSY_HEADERS) Makefile + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(LIBMOPSY_SOURCES) -o $(LIBMOPSYTL) -shared -fPIC + +$(TEST): $(TEST_SOURCES) $(TEST_HEADERS) $(LIBMOPSYTL) Makefile + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(TEST_SOURCES) -o $(TEST) $(LIBMOPSYTL) -Wl,-rpath $(PWD) + diff --git a/README b/README index b6a9a88a8bed..51fafbc8bb10 100644 --- a/README +++ b/README @@ -1 +1,6 @@ -This is the MOPSY project, the best HPC communication library ever made! +This is the UCX project, the best HPC communication library ever made! + +UCX - Unified Communication X +UCP - UCX Protocol +UCT - UCX Transport + diff --git a/contrib/dummy b/contrib/dummy new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/src/ucp/dummy b/src/ucp/dummy new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/src/uct/api/tl.h b/src/uct/api/tl.h new file mode 100644 index 000000000000..501d045dfd6b --- /dev/null +++ b/src/uct/api/tl.h @@ -0,0 +1,37 @@ +/** +* Copyright (C) Mellanox Technologies Ltd. 2001-2014. ALL RIGHTS RESERVED. +* +* $COPYRIGHT$ +* $HEADER$ +*/ + +#ifndef MOPSY_TL_H_ +#define MOPSY_TL_H_ + + +#include "tl_base.h" + +#include + + +/** + * @ingroup CONTEXT + * @brief Initialize global context. + * + * @param [out] context_p Filled with context handle. + * + * @return Error code. + */ +mopsy_status_t mopsy_tl_init(mopsy_tl_context_h *context_p); + + +/** + * @ingroup CONTEXT + * @brief Destroy global context. + * + * @param [in] context Handle to context. + */ +void mopsy_tl_cleanup(mopsy_tl_context_h context); + + +#endif diff --git a/src/uct/api/tl_base.h b/src/uct/api/tl_base.h new file mode 100644 index 000000000000..e06987c66ed1 --- /dev/null +++ b/src/uct/api/tl_base.h @@ -0,0 +1,84 @@ +/** +* Copyright (C) Mellanox Technologies Ltd. 2001-2014. ALL RIGHTS RESERVED. +* +* $COPYRIGHT$ +* $HEADER$ +*/ + +#ifndef TL_BASE_H_ +#define TL_BASE_H_ + +#include "tl_def.h" + +#include +#include + + +/** + * Communication interface context + */ +typedef struct mopsy_tl_iface { +} mopsy_tl_iface_t; + + +/** + * Remote endpoint + */ +typedef struct mopsy_tl_ep { + mopsy_tl_ops_t *ops; +} mopsy_tl_ep_t; + + +/** + * Send completion callback. + */ +typedef void (*mopsy_tl_completion_cb_t)(mopsy_tl_req_h req, + mopsy_status_t status); + + +/** + * Interface attributes: capabilities and limitations. + */ +typedef struct mopsy_tl_iface_attr { + size_t max_short; + size_t max_bcopy; + size_t max_zcopy; + size_t iface_addr_len; + size_t ep_addr_len; + unsigned flags; +} mopsy_tl_iface_attr_t; + + +/** + * Transport operations. + */ +struct mopsy_tl_ops { + + mopsy_status_t (*iface_open)(mopsy_tl_context_h *context, mopsy_tl_iface_h *iface_p); + void (*iface_close)(mopsy_tl_iface_h iface); + + mopsy_status_t (*iface_query)(mopsy_tl_iface_h iface, + mopsy_tl_iface_attr_t *iface_attr); + mopsy_status_t (*iface_get_address)(mopsy_tl_iface_h iface, + mopsy_tl_iface_addr_t *iface_addr); + + mopsy_status_t (*ep_create)(mopsy_tl_ep_h *ep_p); + void (*ep_destroy)(mopsy_tl_ep_h ep); + + mopsy_status_t (*ep_get_address)(mopsy_tl_ep_h *ep, + mopsy_tl_ep_addr_t *ep_addr); + mopsy_status_t (*ep_connect_to_iface)(mopsy_tl_iface_addr_t *iface_addr); + mopsy_status_t (*ep_connect_to_ep)(mopsy_tl_iface_addr_t *iface_addr, + mopsy_tl_ep_addr_t *ep_addr); + + mopsy_status_t (*ep_put_short)(mopsy_tl_ep_h ep, void *buffer, unsigned length, + mopsy_tl_rkey_t rkey, mopsy_tl_req_h *req_p, + mopsy_tl_completion_cb_t cb); + + mopsy_status_t (*iface_flush)(mopsy_tl_iface_h iface, mopsy_tl_req_h *req_p, + mopsy_tl_completion_cb_t cb); + +}; + + +#endif diff --git a/src/uct/api/tl_def.h b/src/uct/api/tl_def.h new file mode 100644 index 000000000000..20a407d0a666 --- /dev/null +++ b/src/uct/api/tl_def.h @@ -0,0 +1,25 @@ +/** +* Copyright (C) Mellanox Technologies Ltd. 2001-2014. ALL RIGHTS RESERVED. +* +* $COPYRIGHT$ +* $HEADER$ +*/ + +#ifndef TL_DEF_H_ +#define TL_DEF_H_ + +#include + + +typedef struct mopsy_tl_context *mopsy_tl_context_h; +typedef struct mopsy_tl_iface *mopsy_tl_iface_h; +typedef struct mopsy_tl_iface_addr mopsy_tl_iface_addr_t; +typedef struct mopsy_tl_ep *mopsy_tl_ep_h; +typedef struct mopsy_tl_ep_addr mopsy_tl_ep_addr_t; +typedef struct mopsy_tl_ops mopsy_tl_ops_t; +typedef uint64_t mopsy_tl_lkey_t; +typedef uint64_t mopsy_tl_rkey_t; +typedef struct mopsy_tl_req *mopsy_tl_req_h; + + +#endif diff --git a/src/uct/ib/dummy b/src/uct/ib/dummy new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/src/uct/tl/tl.c b/src/uct/tl/tl.c new file mode 100644 index 000000000000..b96483abac0f --- /dev/null +++ b/src/uct/tl/tl.c @@ -0,0 +1,18 @@ +/** +* Copyright (C) Mellanox Technologies Ltd. 2001-2014. ALL RIGHTS RESERVED. +* +* $COPYRIGHT$ +* $HEADER$ +*/ + +#include + + +mopsy_status_t mopsy_tl_init(mopsy_tl_context_h *context_p) +{ + return MOPSY_SUCCESS; +} + +void mopsy_tl_cleanup(mopsy_tl_context_h context) +{ +} diff --git a/src/uct/ugni/dummy b/src/uct/ugni/dummy new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/src/util/debug/log.h b/src/util/debug/log.h new file mode 100644 index 000000000000..a2b8a8bc4faa --- /dev/null +++ b/src/util/debug/log.h @@ -0,0 +1,31 @@ +/** +* Copyright (C) Mellanox Technologies Ltd. 2001-2014. ALL RIGHTS RESERVED. +* +* $COPYRIGHT$ +* $HEADER$ +*/ + +#ifndef _SYS_LOG_H_ +#define _SYS_LOG_H_ + + +/** + * Logging levels + */ +typedef enum { + MOPSY_LOG_LEVEL_FATAL, + MOPSY_LOG_LEVEL_ERROR, + MOPSY_LOG_LEVEL_WARN, + MOPSY_LOG_LEVEL_INFO, + MOPSY_LOG_LEVEL_DEBUG, + MOPSY_LOG_LEVEL_TRACE, + MOPSY_LOG_LEVEL_TRACE_REQ, + MOPSY_LOG_LEVEL_TRACE_DATA, + MOPSY_LOG_LEVEL_TRACE_ASYNC, + MOPSY_LOG_LEVEL_TRACE_FUNC, + MOPSY_LOG_LEVEL_TRACE_POLL, + MOPSY_LOG_LEVEL_LAST +} mopsy_log_level_t; + + +#endif diff --git a/src/util/sys/compiler.h b/src/util/sys/compiler.h new file mode 100644 index 000000000000..319825f25690 --- /dev/null +++ b/src/util/sys/compiler.h @@ -0,0 +1,21 @@ +/** +* Copyright (C) Mellanox Technologies Ltd. 2001-2014. ALL RIGHTS RESERVED. +* +* $COPYRIGHT$ +* $HEADER$ +*/ + +#ifndef _SYS_COMPILER_H_ +#define _SYS_COMPILER_H_ + + +#ifdef __cplusplus +# define BEGIN_C_DECLS extern "C" { +# define END_C_DECLS } +#else +# define BEGIN_C_DECLS +# define END_C_DECLS +#endif + + +#endif diff --git a/src/util/sys/error.h b/src/util/sys/error.h new file mode 100644 index 000000000000..393411edefd6 --- /dev/null +++ b/src/util/sys/error.h @@ -0,0 +1,22 @@ +/** +* Copyright (C) Mellanox Technologies Ltd. 2001-2014. ALL RIGHTS RESERVED. +* +* $COPYRIGHT$ +* $HEADER$ +*/ + +#ifndef _SYS_ERROR_H_ +#define _SYS_ERROR_H_ + + +/** + * Status codes + */ +typedef enum { + MOPSY_SUCCESS = 0, + MOPSY_ERR_INPROGRESS = 1, + MOPSY_ERR_INVALID_PARAM = -1 +} mopsy_status_t; + + +#endif diff --git a/test/test.c b/test/test.c new file mode 100644 index 000000000000..67a4a31d618d --- /dev/null +++ b/test/test.c @@ -0,0 +1,26 @@ +/** +* Copyright (C) Mellanox Technologies Ltd. 2001-2014. ALL RIGHTS RESERVED. +* +* $COPYRIGHT$ +* $HEADER$ +*/ + +#include +#include + + +int main(int argc, char **argv) +{ + mopsy_status_t status; + mopsy_tl_context_h context; + + status = mopsy_tl_init(&context); + if (status != MOPSY_SUCCESS) { + fprintf(stderr, "mopsy_tl_init() failed\n"); + return -1; + } + + mopsy_tl_cleanup(context); + return 0; +} +