Medial Code Documentation
Loading...
Searching...
No Matches
c_api.h
Go to the documentation of this file.
1
7#ifndef RABIT_C_API_H_
8#define RABIT_C_API_H_
9
10#ifdef __cplusplus
11#define RABIT_EXTERN_C extern "C"
12#include <cstdio>
13#else
14#define RABIT_EXTERN_C
15#include <stdio.h>
16#endif // __cplusplus
17
18#if defined(_MSC_VER) || defined(_WIN32)
19#define RABIT_DLL RABIT_EXTERN_C __declspec(dllexport)
20#else
21#define RABIT_DLL RABIT_EXTERN_C __attribute__ ((visibility ("default")))
22#endif // defined(_MSC_VER) || defined(_WIN32)
23
25typedef unsigned long rbt_ulong; // NOLINT(*)
26
37RABIT_DLL bool RabitInit(int argc, char *argv[]);
38
44RABIT_DLL int RabitFinalize(void);
45
50RABIT_DLL int RabitGetRingPrevRank(void);
51
56RABIT_DLL int RabitGetRank(void);
57
62RABIT_DLL int RabitGetWorldSize(void);
63
68RABIT_DLL int RabitIsDistributed(void);
69
76RABIT_DLL int RabitTrackerPrint(const char *msg);
83RABIT_DLL void RabitGetProcessorName(char *out_name,
84 rbt_ulong *out_len,
85 rbt_ulong max_len);
94RABIT_DLL int RabitBroadcast(void *sendrecv_data, rbt_ulong size, int root);
95
112RABIT_DLL int RabitAllgather(void *sendrecvbuf, size_t total_size,
113 size_t beginIndex, size_t size_node_slice,
114 size_t size_prev_slice, int enum_dtype);
115
134RABIT_DLL int RabitAllreduce(void *sendrecvbuf, size_t count, int enum_dtype,
135 int enum_op, void (*prepare_fun)(void *arg),
136 void *prepare_arg);
137
143RABIT_DLL int RabitVersionNumber(void);
144
145
155RABIT_DLL int RabitLinkTag(void);
156
157#endif // RABIT_C_API_H_
RABIT_DLL int RabitGetRank(void)
get rank of current process
Definition rabit_c_api.cc:278
RABIT_DLL int RabitBroadcast(void *sendrecv_data, rbt_ulong size, int root)
broadcast an memory region to all others from root
Definition rabit_c_api.cc:308
RABIT_DLL int RabitLinkTag(void)
a Dummy function, used to cause force link of C API into the DLL.
Definition rabit_c_api.cc:340
RABIT_DLL int RabitAllreduce(void *sendrecvbuf, size_t count, int enum_dtype, int enum_op, void(*prepare_fun)(void *arg), void *prepare_arg)
perform in-place allreduce, on sendrecvbuf this function is NOT thread-safe
Definition rabit_c_api.cc:325
RABIT_DLL int RabitAllgather(void *sendrecvbuf, size_t total_size, size_t beginIndex, size_t size_node_slice, size_t size_prev_slice, int enum_dtype)
Allgather function, each node have a segment of data in the ring of sendrecvbuf, the data provided by...
Definition rabit_c_api.cc:315
RABIT_DLL int RabitGetWorldSize(void)
get total number of process
Definition rabit_c_api.cc:282
unsigned long rbt_ulong
rabit unsigned long type
Definition c_api.h:25
RABIT_DLL bool RabitInit(int argc, char *argv[])
initialize the rabit module, call this once before using anything The additional arguments is not nec...
Definition rabit_c_api.cc:258
RABIT_DLL void RabitGetProcessorName(char *out_name, rbt_ulong *out_len, rbt_ulong max_len)
get name of processor
Definition rabit_c_api.cc:297
RABIT_DLL int RabitGetRingPrevRank(void)
get rank of previous process in ring topology
Definition rabit_c_api.cc:274
RABIT_DLL int RabitIsDistributed(void)
get rank of current process
Definition rabit_c_api.cc:286
RABIT_DLL int RabitFinalize(void)
finalize the rabit engine, call this function after you finished all jobs.
Definition rabit_c_api.cc:266
RABIT_DLL int RabitTrackerPrint(const char *msg)
print the msg to the tracker, this function can be used to communicate the information of the progres...
Definition rabit_c_api.cc:290
RABIT_DLL int RabitVersionNumber(void)
Definition rabit_c_api.cc:336