Package ml.dmlc.xgboost4j.java
Class Rabit
java.lang.Object
ml.dmlc.xgboost4j.java.Rabit
Rabit global class for synchronization.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic float[]
allReduce
(float[] elements, Rabit.OpType op) perform Allreduce on distributed float vectors using operator op.private static void
checkCall
(int ret) static int
getRank()
get rank of current thread.static int
get world size of current job.static void
Initialize the rabit library on current working thread.static void
shutdown()
Shutdown the rabit engine in current working thread, equals to finalize.static void
trackerPrint
(String msg) Print the message on rabit tracker.static int
Get version number of current stored model in the thread.
-
Constructor Details
-
Rabit
public Rabit()
-
-
Method Details
-
checkCall
- Throws:
XGBoostError
-
init
Initialize the rabit library on current working thread.- Parameters:
envs
- The additional environment variables to pass to rabit.- Throws:
XGBoostError
-
shutdown
Shutdown the rabit engine in current working thread, equals to finalize.- Throws:
XGBoostError
-
trackerPrint
Print the message on rabit tracker.- Parameters:
msg
-- Throws:
XGBoostError
-
versionNumber
Get version number of current stored model in the thread. which means how many calls to CheckPoint we made so far.- Returns:
- version Number.
- Throws:
XGBoostError
-
getRank
get rank of current thread.- Returns:
- the rank.
- Throws:
XGBoostError
-
getWorldSize
get world size of current job.- Returns:
- the worldsize
- Throws:
XGBoostError
-
allReduce
perform Allreduce on distributed float vectors using operator op. This implementation of allReduce does not support customized prepare function callback in the native code, as this function is meant for testing purposes only (to test the Rabit tracker.)- Parameters:
elements
- local elements on distributed workers.op
- operator used for Allreduce.- Returns:
- All-reduced float elements according to the given operator.
-