Class Rabit


  • public class Rabit
    extends Object
    Rabit global class for synchronization.
    • Constructor Detail

      • Rabit

        public Rabit()
    • Method Detail

      • init

        public static void init​(Map<String,​String> envs)
                         throws XGBoostError
        Initialize the rabit library on current working thread.
        Parameters:
        envs - The additional environment variables to pass to rabit.
        Throws:
        XGBoostError
      • shutdown

        public static void shutdown()
                             throws XGBoostError
        Shutdown the rabit engine in current working thread, equals to finalize.
        Throws:
        XGBoostError
      • trackerPrint

        public static void trackerPrint​(String msg)
                                 throws XGBoostError
        Print the message on rabit tracker.
        Parameters:
        msg -
        Throws:
        XGBoostError
      • versionNumber

        public static int versionNumber()
                                 throws XGBoostError
        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

        public static int getRank()
                           throws XGBoostError
        get rank of current thread.
        Returns:
        the rank.
        Throws:
        XGBoostError
      • getWorldSize

        public static int getWorldSize()
                                throws XGBoostError
        get world size of current job.
        Returns:
        the worldsize
        Throws:
        XGBoostError
      • allReduce

        public static float[] allReduce​(float[] elements,
                                        Rabit.OpType op)
        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.