ECP-VELOC Components
User documentation for all components
redset_util.h
Go to the documentation of this file.
1 #ifndef REDSET_UTIL_H
2 #define REDSET_UTIL_H
3 
4 #include <sys/types.h>
5 #include <sys/stat.h>
6 #include <fcntl.h>
7 
8 #include "mpi.h"
9 #include "kvtree.h"
10 
11 #define REDSET_FAILURE (1)
12 
13 #define REDSET_MAX_FILENAME (1024)
14 
15 extern int redset_debug;
16 
17 extern int redset_rank;
18 extern char* redset_hostname;
19 
20 extern int redset_mpi_buf_size;
21 extern size_t redset_page_size;
22 
28 void redset_err(const char *fmt, ...);
29 
31 void redset_warn(const char *fmt, ...);
32 
34 void redset_dbg(int level, const char *fmt, ...);
35 
37 void redset_abort(int rc, const char *fmt, ...);
38 
41 #define REDSET_MALLOC(X) redset_malloc(X, __FILE__, __LINE__);
42 void* redset_malloc(size_t size, const char* file, int line);
43 
45 void redset_free(void* ptr);
46 
48 void* redset_align_malloc(size_t size, size_t align);
49 
51 void redset_align_free(void* buf);
52 
57  const char* send_str, int send_rank,
58  char** recv_str, int recv_rank,
59  MPI_Comm comm
60 );
61 
63 int redset_alltrue(int flag, MPI_Comm comm);
64 
65 /* recursively sort a kvtree in alphabetical order */
66 void redset_sort_kvtree(kvtree* hash);
67 
68 /* allocate a set of buffers for MPI communication or redundancy encoding */
69 void** redset_buffers_alloc(int num, size_t size);
70 
71 /* free a set of buffers allocated in redset_buffers_alloc */
72 void redset_buffers_free(int num, void* pbufs);
73 
74 #endif
redset_malloc
void * redset_malloc(size_t size, const char *file, int line)
redset_sort_kvtree
void redset_sort_kvtree(kvtree *hash)
redset_debug
int redset_debug
redset_free
void redset_free(void *ptr)
redset_align_malloc
void * redset_align_malloc(size_t size, size_t align)
redset_hostname
char * redset_hostname
redset_buffers_free
void redset_buffers_free(int num, void *pbufs)
redset_warn
void redset_warn(const char *fmt,...)
redset_abort
void redset_abort(int rc, const char *fmt,...)
redset_str_sendrecv
int redset_str_sendrecv(const char *send_str, int send_rank, char **recv_str, int recv_rank, MPI_Comm comm)
kvtree.h
This file defines the data structure for a hash, which is an unordered list of elements,...
redset_align_free
void redset_align_free(void *buf)
redset_page_size
size_t redset_page_size
redset_dbg
void redset_dbg(int level, const char *fmt,...)
redset_alltrue
int redset_alltrue(int flag, MPI_Comm comm)
redset_rank
int redset_rank
redset_buffers_alloc
void ** redset_buffers_alloc(int num, size_t size)
redset_mpi_buf_size
int redset_mpi_buf_size
redset_err
void redset_err(const char *fmt,...)