HcclGroup

Function

Configures a communicator name. Each name corresponds to a communicator. After the configuration, the GetHcclContext interface can be called on the kernel side to obtain the address of the context (message area) corresponding to the communicator.

Prototype

1
2
OpMC2Def &HcclGroup(const char *value)
OpMC2Def &HcclGroup(std::vector<const char *> value)

Parameters

Parameter

Input/Output

Description

value

Input

Name of the configured communicator. Use const char * for a single communicator and std::vector<const char *> for multiple communicators.

Constraints

Before using this API, you need to register the operator as an MC2 operator through the MC2 API. After the registration, an OpMC2Def structure is returned.

The communicator name must be configured as an attribute of the REQUIRED String type. The attribute name is the communicator name.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
class MC2Custom : public OpDef {
public:
    MC2Custom(const char* name) : OpDef(name)
    {
        this->Input("x").ParamType(REQUIRED).DataType({ge::DT_FLOAT}).Format({ge::FORMAT_ND});
        this->Input("y").ParamType(REQUIRED).DataType({ge::DT_FLOAT}).Format({ge::FORMAT_ND});
        this->Output("z").ParamType(REQUIRED).DataType({ge::DT_FLOAT}).Format({ge::FORMAT_ND});
        this->Attr("group").AttrType(REQUIRED).String();
        this->AICore().AddConfig("ascendxxx");
    this->MC2().HcclGroup("group"); // Set the communicator name to group.
    }
};
OP_ADD(MC2Custom);