dataflow.get_running_instance_id

Applicable Products

Product

Supported

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

Function Description

Obtains IDs of running instances of the current UDF during execution. This information is sourced from the logic_device_list configuration in the data_flow_deploy_info.json file.

Prototype

1
get_running_instance_id()

Parameters

None

Returns

IDs of running instances of the current UDF. The data type is int.

Examples

1
2
3
4
5
6
import dataflow as df

@df.pyflow
def func():
    print('running instance_id = ', df.get_running_instance_id())
    return a + b

Constraints

This API must be used with the pyflow decorator.