public class Communicator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Communicator.DataType |
static class |
Communicator.OpType |
Modifier and Type | Field and Description |
---|---|
static Map<String,String> |
communicatorEnvs |
static List<String> |
mockList |
Constructor and Description |
---|
Communicator() |
Modifier and Type | Method and Description |
---|---|
static float[] |
allReduce(float[] elements,
Communicator.OpType op)
perform Allreduce on distributed float vectors using operator op.
|
static void |
communicatorPrint(String msg)
Print the message via the communicator.
|
static int |
getRank()
get rank of current thread.
|
static int |
getWorldSize()
get world size of current job.
|
static void |
init(Map<String,String> envs)
Initialize the collective communicator on current working thread.
|
static void |
shutdown()
Shutdown the communicator in current working thread, equals to finalize.
|
public static void init(Map<String,String> envs) throws XGBoostError
envs
- The additional environment variables to pass to the communicator.XGBoostError
public static void shutdown() throws XGBoostError
XGBoostError
public static void communicatorPrint(String msg) throws XGBoostError
msg
- XGBoostError
public static int getRank() throws XGBoostError
XGBoostError
public static int getWorldSize() throws XGBoostError
XGBoostError
public static float[] allReduce(float[] elements, Communicator.OpType op)
elements
- local elements on distributed workers.op
- operator used for Allreduce.Copyright © 2023. All rights reserved.