Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
fa726db
small bugs in test_writer on Frontera
bozhang-hpc Mar 6, 2021
dc979ac
Merge branch 'master' of https://github.com/rdi2dspaces/dspaces
bozhang-hpc Mar 21, 2021
babb460
Merge branch 'master' of https://github.com/rdi2dspaces/dspaces
bozhang-hpc Mar 24, 2021
aa14dd0
go back to main branch
bozhang-hpc Mar 25, 2021
12e087d
Merge branch 'master' of https://github.com/rdi2dspaces/dspaces
bozhang-hpc Jun 28, 2021
14b7294
Merge branch 'master' of https://github.com/rdi2dspaces/dspaces
bozhang-hpc Sep 1, 2021
0263193
Merge branch 'master' of https://github.com/rdi2dspaces/dspaces
bozhang-hpc Oct 18, 2021
20f0b74
Merge branch 'master' of https://github.com/rdi2dspaces/dspaces
bozhang-hpc Dec 3, 2021
4ca0bcf
Merge branch 'master' of https://github.com/rdi2dspaces/dspaces
bozhang-hpc Dec 8, 2021
6a5e755
Merge branch 'master' of https://github.com/rdi2dspaces/dspaces
bozhang-hpc Jan 17, 2022
b58f2f0
init commit for GPU put()
bozhang-hpc Feb 3, 2022
56224a5
add cuda libs
bozhang-hpc Feb 4, 2022
0fc8b27
add cuda include dir
bozhang-hpc Feb 4, 2022
747a1d2
add cuda header
bozhang-hpc Feb 4, 2022
f20e11d
add cuda_runtime_api.h
bozhang-hpc Feb 4, 2022
a9c9b7f
free buffer; fix typo
bozhang-hpc Feb 4, 2022
a9f9a99
free buffer; fix typo
bozhang-hpc Feb 4, 2022
771ebe0
Merge branch 'master' of https://github.com/rdi2dspaces/dspaces
bozhang-hpc Feb 4, 2022
e76b406
Merge branch 'master' into gpu
bozhang-hpc Feb 4, 2022
c469260
init commit for dspaces_cuda get()
bozhang-hpc Feb 4, 2022
224a59b
add cuda put/get() API
bozhang-hpc Feb 4, 2022
898709d
add cu err checking for get()
bozhang-hpc Feb 17, 2022
30355a1
fix cmake cuda for version < 3.17
bozhang-hpc Feb 23, 2022
dfe5429
fix cmake cuda for version < 3.17
bozhang-hpc Feb 23, 2022
49afc75
fix cmake cuda for version < 3.17
bozhang-hpc Feb 23, 2022
9883aea
fix cmake cuda for version < 3.17
bozhang-hpc Feb 23, 2022
039409d
fix cmake cuda for version < 3.17
bozhang-hpc Feb 23, 2022
08833fd
init commit for gdr inside dspaces_cuda_put
bozhang-hpc Mar 7, 2022
59f33eb
fix odsc
bozhang-hpc Mar 7, 2022
731aa2b
add gdr condition hint print msg
bozhang-hpc Mar 7, 2022
ae68875
disable eager bulk transfer in mercury
bozhang-hpc Mar 7, 2022
e4eecb5
disable eager bulk transfer in mercury
bozhang-hpc Mar 7, 2022
3cc2e3f
init commit for gdrcopy support
bozhang-hpc Mar 22, 2022
b0fa5a6
fix typos
bozhang-hpc Mar 23, 2022
714a8f9
fix typo
bozhang-hpc Mar 23, 2022
a1ff57e
add linkage to cuda driver lib
bozhang-hpc Mar 23, 2022
8404b86
fix gdrcopy finalize when option disabled
bozhang-hpc Mar 25, 2022
f6b72f7
fix condition for gdrcopy init
bozhang-hpc Mar 25, 2022
b0849c2
add cuDevicePrimaryCtxRetain for gdrcopy
bozhang-hpc Mar 25, 2022
bf18251
fix gdrcopy hint
bozhang-hpc Mar 25, 2022
7d4e6fd
add the cuda_put() baseline
bozhang-hpc Mar 28, 2022
fee62fb
changed to benchmark env selection
bozhang-hpc Mar 28, 2022
cc671a3
adapt gdrcopy init & fini according to benchmark env selection
bozhang-hpc Mar 28, 2022
f37be71
init commit for cuda_put_hybrid()
bozhang-hpc Apr 5, 2022
bfcf9fa
add memory free for err handle; fix typos
bozhang-hpc Apr 5, 2022
ea62a47
first commit for gdr get()
bozhang-hpc Apr 19, 2022
0e0bca6
add cuda language to cmake project
bozhang-hpc Apr 19, 2022
052bb3b
mv obj_data alloc & free to ssd_copy.cu
bozhang-hpc Apr 19, 2022
73b4f09
fix cuda put & get env
bozhang-hpc Apr 19, 2022
e99db95
fix typos
bozhang-hpc Apr 19, 2022
747bdd7
enable matrix_init in ssd_copy.cu
bozhang-hpc Apr 19, 2022
8070968
fix the cudaMalloc in od_alloc_cuda
bozhang-hpc Apr 19, 2022
20dd147
fix mismatch between cuda runtime SUCCESS & driver SUCCESS
bozhang-hpc Apr 19, 2022
3e2e387
add ndim selection
bozhang-hpc Apr 19, 2022
267bb63
add include bbox.h
bozhang-hpc Apr 19, 2022
63ec352
put confict functions into ss_data.h
bozhang-hpc Apr 20, 2022
8f89b10
add cuda header
bozhang-hpc Apr 20, 2022
5a9f20c
separate cuda calls from the server source file
bozhang-hpc Apr 22, 2022
eaaa47c
rewrite the CMake files; fix some header issues
bozhang-hpc Apr 22, 2022
5a6ee2d
add timer for ssd_copy(cuda) and transfer in get_data()
bozhang-hpc Apr 24, 2022
6fc52e5
update dspaces_cuda_get() API
bozhang-hpc Apr 24, 2022
2455807
fix obj_data_free in the get_data_gdr()
bozhang-hpc Apr 24, 2022
8ad34b9
use self-added margo_bulk_create_attr() for gdr get()
bozhang-hpc Apr 27, 2022
e1c62dc
adapt put() to margo_bulk_create_attr()
bozhang-hpc Apr 27, 2022
69d1dfb
add the margo_bulk_free() before free metadata
bozhang-hpc Apr 28, 2022
1f50512
fix gdrcopy check when cuda>11.3
bozhang-hpc Jun 1, 2022
2f45034
add kernel concurrency for cuda_get()
bozhang-hpc Jun 7, 2022
7df3d28
add cuda dual-channel put()
bozhang-hpc Jun 29, 2022
b884ae6
add dual channel put rpc at server
bozhang-hpc Jul 1, 2022
4028692
init finish of dual_channel_put
bozhang-hpc Jul 5, 2022
81c60a2
add feedback to dual channel put
bozhang-hpc Jul 6, 2022
46f4f30
add cuda dc put to dspaces_cuda_put()
bozhang-hpc Jul 6, 2022
c6f3aa1
fix host channel metadata
bozhang-hpc Jul 7, 2022
9058ac1
fix async margo_bulk_create() error
bozhang-hpc Jul 7, 2022
d712152
fix margo_wait_any() bugs; fix uninitialized od; fix margo_wait() err…
bozhang-hpc Jul 7, 2022
baab21e
move data cutting ratio to global scope
bozhang-hpc Jul 7, 2022
8c33a88
add debug timer & ratio info
bozhang-hpc Jul 7, 2022
a22b8df
rewrite margo_wait() in put_dc_rpc
bozhang-hpc Jul 7, 2022
714ade5
fix non-inited itransfer requests
bozhang-hpc Jul 8, 2022
5f25c91
rewrite wait any request due to poor performance of margo_wait_any()
bozhang-hpc Jul 8, 2022
e8a9230
fix the infinite loop that prevents callback from itransfer; rewrite …
bozhang-hpc Jul 9, 2022
36882f2
rewrite ratio tuning using expf()
bozhang-hpc Jul 10, 2022
a1532b7
enable gpudirect according to the latest mercury API
bozhang-hpc Jul 16, 2022
99d7a0a
resume to init tune method
bozhang-hpc Jul 16, 2022
667d18b
add Host & Device Memory Check
bozhang-hpc Jul 26, 2022
e7c0307
add total device check; disable hmem mercury for baseline cuda put
bozhang-hpc Jul 26, 2022
5469a6d
add hybrid cuda_get(); fix mem leak in err handling
bozhang-hpc Aug 19, 2022
6979682
add cuda_get() selection for hybrid get()
bozhang-hpc Aug 20, 2022
7508989
swap src & dst ptr
bozhang-hpc Aug 20, 2022
6da03dc
fix double free & host_od free
bozhang-hpc Aug 20, 2022
9998ad2
fix wrong data ptr in cuda_put_baseline()
bozhang-hpc Aug 25, 2022
8694f1c
enable device mem for GPUDirect at get()
bozhang-hpc Aug 25, 2022
6534d32
fix baseline cuda_get() timer
bozhang-hpc Aug 26, 2022
5c41fc4
unify dspaces_put/get() API for cuda ptr
bozhang-hpc Sep 23, 2022
e8e3684
fix deprecated margo_init for EuroPar23
bozhang-hpc May 2, 2023
117a9cb
remove multi_recv setting for mercury/2.2.0 in EuroPar23 artifact
bozhang-hpc May 2, 2023
0f6a02f
Merge branch 'europar23' into feat/GPU
bozhang-hpc Apr 17, 2024
16fd9d5
fix wrong function name
bozhang-hpc Apr 18, 2024
212b145
fix malloc ptr
bozhang-hpc Apr 18, 2024
e974e1d
add error code for utils functions
bozhang-hpc Apr 18, 2024
c68acf9
clean code for dspaces_cuda_put
bozhang-hpc Apr 18, 2024
becefd0
Merge 'GPU' branch to 'master' branch
bozhang-hpc Apr 18, 2024
85aea8d
add network protocol parse for cuda_Put()/Get() mode selection
bozhang-hpc Apr 18, 2024
89a5bf8
fix the non-blocking CUDA stream in blocking ssd_copy functions; chan…
bozhang-hpc Apr 23, 2024
3263ead
clean code for dspaces_cuda_get
bozhang-hpc May 21, 2024
26704f5
Merge branch 'master' into feat/GPU
bozhang-hpc May 21, 2024
f81fb03
add HAVE_CUDA macros & cmake definitions; add gpu_init to wan_init
bozhang-hpc May 21, 2024
8bf0283
fix optional cuda header compilation
bozhang-hpc May 21, 2024
f35b21c
fix missing lz4 lib for client lib compilation
bozhang-hpc May 23, 2024
570b48b
add author to copyright & reformat
bozhang-hpc May 23, 2024
19299ec
remove useless GDRCOPY cmake files
bozhang-hpc May 23, 2024
17931a1
Merge branch 'master' into feat/GPU
philip-davis Sep 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,31 @@
/*
* Ciprian Docan (2009) TASSL Rutgers University
* [email protected]
*
* Tong Jin (2011) TASSL Rutgers University
* [email protected]
*
* Fan Zhang (2011) TASSL Rutgers University
* [email protected]
*
* Hoang Bui (2012) TASSL Rutgers University
* [email protected]
*
* Qian Sun (2012) TASSL Rutgers University
* [email protected]
*
* Melissa Romanus Abdelbaky (2014) TASSL Rutgers University
* [email protected]
*
* Mehmet Aktas
* [email protected]
*
* Pradeep Subedi (2017) RDI2 Rutgers University
* [email protected]
*
* Philip Davis (2017) RDI2 Rutgers University
* [email protected]
*
* Bo Zhang (2024) SCI Institute, University of Utah
* [email protected]
*/
2 changes: 2 additions & 0 deletions include/dspaces-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ extern "C" {
#define dspaces_ERR_UNKNOWN_PR -7 /* Could not find server */
#define dspaces_ERR_UNKNOWN_OBJ -8 /* Could not find the object*/
#define dspaces_ERR_END -9 /* End of range for valid error codes */
#define dspaces_ERR_CUDA -10 /* Error related to the CUDA */
#define dspaces_ERR_UTILS -11

#define DS_MOD_EFAULT -1
#define DS_MOD_ENODEF -2
Expand Down
39 changes: 38 additions & 1 deletion include/ss_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@

#include <abt.h>

#ifdef HAVE_CUDA
#include <cuda.h>
#include <cuda_runtime_api.h>
#endif /* HAVE_CUDA */

#define MAX_VERSIONS 10

#define DS_CLIENT_STORAGE 0x01
Expand Down Expand Up @@ -85,6 +90,26 @@ struct obj_data {
unsigned int f_free : 1;
};

/*
A view in the matrix allows to extract any subset of values from a
matrix.
*/

struct matrix_view {
uint64_t lb[BBOX_MAX_NDIM];
uint64_t ub[BBOX_MAX_NDIM];
};

/* Generic matrix representation. */
struct matrix {
uint64_t dist[BBOX_MAX_NDIM];
int num_dims;
size_t size_elem;
enum storage_type mat_storage;
struct matrix_view mat_view;
void *pdata;
};

struct gdim_list_entry {
struct list_head entry;
char *var_name;
Expand Down Expand Up @@ -355,7 +380,7 @@ static inline hg_return_t hg_proc_name_list_t(hg_proc_t proc, void *data)
if(ret != HG_SUCCESS) {
break;
}
nlist->names = malloc(sizeof(*nlist->names) * nlist->count);
nlist->names = (hg_string_t*)malloc(sizeof(*nlist->names) * nlist->count);
for(i = 0; i < nlist->count; i++) {
ret = hg_proc_hg_string_t(proc, &nlist->names[i]);
if(ret != HG_SUCCESS) {
Expand Down Expand Up @@ -411,7 +436,14 @@ int ssd_init(struct sspace *, int);
void ssd_free(struct sspace *);
//

void matrix_init(struct matrix *, enum storage_type, struct bbox *, struct bbox *, void *, size_t);

int ssd_copy(struct obj_data *, struct obj_data *);

#ifdef HAVE_CUDA
int ssd_copy_cuda(struct obj_data *, struct obj_data *);
int ssd_copy_cuda_async(struct obj_data *, struct obj_data *, cudaStream_t *stream);
#endif /* HAVE_CUDA*/
//
long ssh_hash_elem_count(struct sspace *ss, const struct bbox *bb);
//
Expand Down Expand Up @@ -457,6 +489,11 @@ void obj_data_free(struct obj_data *od);
uint64_t obj_data_size(obj_descriptor *);
void obj_data_resize(obj_descriptor *obj_desc, uint64_t *new_dims);

#ifdef HAVE_CUDA
struct obj_data *obj_data_alloc_cuda(obj_descriptor *);
void obj_data_free_cuda(struct obj_data *od);
#endif /* HAVE_CUDA */

int obj_desc_equals(obj_descriptor *, obj_descriptor *);
int obj_desc_equals_no_owner(const obj_descriptor *, const obj_descriptor *);

Expand Down
29 changes: 29 additions & 0 deletions include/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,40 @@
#define __DS_UTIL_H_

#include <stdlib.h>
#include <stdbool.h>
#include <errno.h>
#include "dspaces-common.h"

size_t str_len(const char *str);
char *str_append_const(char *, const char *);
char *str_append(char *, char *);

#define MEM_PATH_LEN 256
typedef struct {
// Values from /proc/meminfo, in KiB or converted to MiB.
long long MemTotalKiB;
long long MemTotalMiB;
long long MemAvailableMiB; // -1 means no data available
long long SwapTotalMiB;
long long SwapTotalKiB;
long long SwapFreeMiB;
// Calculated percentages
double MemAvailablePercent; // percent of total memory that is available
double SwapFreePercent; // percent of total swap that is free
} meminfo_t;

typedef struct procinfo {
int pid;
int pidfd;
int uid;
int badness;
int oom_score_adj;
long long VmRSSkiB;
char name[MEM_PATH_LEN];
} procinfo_t;

meminfo_t parse_meminfo();

/*******************************************************
Processing parameter lists
**********************************************************/
Expand Down
59 changes: 53 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
find_package(DRC)
if(HAVE_DRC)
include_directories(${DRC_INCLUDE_DIRS})
add_definitions( -DHAVE_DRC)
add_definitions(-DHAVE_DRC)
endif()

# default: No CUDA
set(HAVE_CUDA FALSE)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
find_package(CUDAToolkit)
if(CUDAToolkit_FOUND)
enable_language(CUDA)
include_directories(${CUDAToolkit_INCLUDE_DIRS})
add_definitions(-DHAVE_CUDA)
set(HAVE_CUDA TRUE)
endif()
else()
find_package(CUDA)
if(CUDA_FOUND)
enable_language(CUDA)
include_directories(${CUDA_INCLUDE_DIRS})
add_definitions(-DHAVE_CUDA)
set(HAVE_CUDA TRUE)
endif()
endif()

# list of source files
set(dspaces-src util.c bbox.c ss_data.c dspaces-client.c dspaces-ops.c)
if(HAVE_CUDA)
list(APPEND dspaces-src ssd_copy.cu ss_data_cuda.c)
set_source_files_properties(ssd_copy.cu PROPERTIES LANGUAGE "CUDA")
endif()

# load package helper for generating cmake CONFIG packages
include (CMakePackageConfigHelpers)
Expand All @@ -16,12 +40,30 @@ set (dspaces-pkg "share/cmake/dspaces")
set (dspaces-vers "${dspaces_VERSION_MAJOR}.${dspaces_VERSION_MINOR}")

add_library(dspaces ${dspaces-src})
if(HAVE_CUDA)
set_target_properties(dspaces PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
endif()

# We need both cuda driver and cuda runtime headers and libs
# ${CUDA_LIBRARIES} returned by find_package(CUDA) only has the cuda runtime libs
# so we have to manually add -lcuda

target_link_libraries (dspaces margo m pthread liblz4)
target_include_directories (dspaces PUBLIC $<INSTALL_INTERFACE:include>)

if(HAVE_DRC)
target_link_libraries (dspaces margo m pthread ${DRC_LIBRARIES} liblz4)
target_include_directories (dspaces PUBLIC $<INSTALL_INTERFACE:include> ${DRC_INCLUDE_DIRS})
else()
target_link_libraries (dspaces margo m pthread liblz4)
target_include_directories (dspaces PUBLIC $<INSTALL_INTERFACE:include>)
target_link_libraries (dspaces ${DRC_LIBRARIES})
target_include_directories (dspaces PUBLIC ${DRC_INCLUDE_DIRS})
endif()

if(HAVE_CUDA)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
target_link_libraries (dspaces CUDA::cudart CUDA::cuda_driver)
target_include_directories (dspaces PUBLIC ${CUDAToolkit_INCLUDE_DIRS})
else()
target_link_libraries (dspaces cuda ${CUDA_LIBRARIES})
target_include_directories (dspaces PUBLIC ${CUDA_INCLUDE_DIRS})
endif()
endif()

# local include's BEFORE, in case old incompatable .h files in prefix/include
Expand All @@ -36,6 +78,11 @@ set_target_properties (dspaces
set(dspaces-server-src util.c bbox.c ss_data.c dspaces-server.c dspaces-conf.c dspaces-modules.c dspaces-logging.c toml.c)

add_library(dspaces-server ${dspaces-server-src} ${dspaces-src})

target_link_libraries (dspaces-server margo m pthread liblz4 ${CURL_LIBRARIES})
target_include_directories (dspaces-server BEFORE PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include> ${CURL_INCLUDE_DIR})

if(HAVE_DRC)
target_link_libraries (dspaces-server margo m pthread ${DRC_LIBRARIES} liblz4)
target_include_directories (dspaces-server BEFORE PUBLIC
Expand Down
Loading
Loading