oneflow.env

oneflow.env.ctrl_port(val: int) → None

Set port number used to control the execution across multiple machines. Same on every machine.

Parameters

val – a port number accessible to peer machines

oneflow.env.current_resource() → oneflow.core.job.resource_pb2.Resource
Get current resources, such as:machine nums, cpu/gpu device nums,

epoch network threed num, rdma params…

Returns

[description]

Return type

resource_util.Resource

oneflow.env.data_port(val: int) → None

Set port number used to data transfer among multiple machines. Same on every machine.

Parameters

val – a port number accessible to peer machines

oneflow.env.init() → bool

Init environment for job

Returns

[description]

Return type

bool

oneflow.env.init_bootstrap_confs(*val: list, **kargs) → None
oneflow.env.log_dir(val: str) → None

Specify a dir to store OneFlow’s logging files. If not specified, it is ./log by default.

Parameters

val (str) – string , log file path

oneflow.env.logbuflevel(val: int) → None
Log messages at a level <= this flag are buffered.

Log messages at a higher level are flushed immediately.

Parameters

val (int) – int, number of level

oneflow.env.logtostderr(val: int) → None

Set whether log messages go to stderr instead of logfiles

Parameters

val (int) – [description]

oneflow.env.machine(*val: list) → None

Set machines’ hostnames.

For instance:

oneflow.env.machine([{“addr”: “192.168.1.1”}, {“addr”: “192.168.1.2”}])

Parameters

vallist, tuple or multiple arguments of dict. First in the list is the master machine.