-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic types and functions, initial makefile, and smoke test.
- Loading branch information
Showing
15 changed files
with
304 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
.project | ||
.cproject | ||
.settings | ||
test/test | ||
libuct.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <util/sys/error.h> | ||
|
||
|
||
/** | ||
* @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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <util/sys/error.h> | ||
#include <stddef.h> | ||
|
||
|
||
/** | ||
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <stdint.h> | ||
|
||
|
||
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 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Copyright (C) Mellanox Technologies Ltd. 2001-2014. ALL RIGHTS RESERVED. | ||
* | ||
* $COPYRIGHT$ | ||
* $HEADER$ | ||
*/ | ||
|
||
#include <uct/api/tl.h> | ||
|
||
|
||
mopsy_status_t mopsy_tl_init(mopsy_tl_context_h *context_p) | ||
{ | ||
return MOPSY_SUCCESS; | ||
} | ||
|
||
void mopsy_tl_cleanup(mopsy_tl_context_h context) | ||
{ | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Copyright (C) Mellanox Technologies Ltd. 2001-2014. ALL RIGHTS RESERVED. | ||
* | ||
* $COPYRIGHT$ | ||
* $HEADER$ | ||
*/ | ||
|
||
#include <uct/api/tl.h> | ||
#include <stdio.h> | ||
|
||
|
||
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; | ||
} | ||
|