---
title: HcommAclrtNotifyRecordOnThread
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/programug/commopdev/hcclopdevapi_07_0084.html
sourcePath: /source/zh/canncommercial/900/programug/commopdev/hcclopdevapi_07_0084.html
indexId: a8d053cc1ec17f68fa68b6bcfbd561da0e76d0d375b83ab030dfac29e84467af75
---
# HcommAclrtNotifyRecordOnThread

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | ☓ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | ☓ |
| Atlas 推理系列产品 | ☓ |
| Atlas 训练系列产品 | ☓ |


针对 Atlas A2 训练系列产品 / Atlas A2 推理系列产品 ，仅支持Atlas 800T A2 训练服务器、Atlas 900 A2 PoD 集群基础单元、Atlas 200T A2 Box16 异构子框。


#### 功能说明

基于acl接口创建的Notify发送同步信号，需与HcommAclrtNotifyWaitOnThread配对使用。


#### 函数原型

```
int32_t HcommAclrtNotifyRecordOnThread(ThreadHandle thread, uint64_t dstNotifyId)
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| thread | 输入 | 线程句柄，为通过HcclThreadAcquire接口获取到的threads。 ThreadHandle类型的定义请参见ThreadHandle。 |
| dstNotifyId | 输入 | 同步信号ID，为通过aclrtGetNotifyId接口获取到的notifyId。 |


#### 返回值

int32_t：接口成功返回0，其他失败。


#### 约束说明

无


#### 调用示例

```
HcclComm comm;
CommEngine engine = COMM_ENGINE_CPU_TS;
aclrtStream streams[2];
ThreadHandle threads[2];
// 申请2条流，每条流2个Notify
aclrtCreateStream(&streams[0]);
aclrtCreateStream(&streams[1]);
HcclResult result = HcclThreadAcquireWithStream(comm, engine, streams[0], 2, &threads[0]);
result = HcclThreadAcquireWithStream(comm, engine, streams[1], 2, &threads[1]);
aclrtNotify notify;
uint32_t notifyId;
aclrtCreateNotify(&(notify), ACL_NOTIFY_DEFAULT);
aclrtGetNotifyId(notify, &(notifyId));
// 发送同步信号
HcommAclrtNotifyRecordOnThread(threads[0], notifyId);
// 等待同步信号
uint32_t timeout = 1;
HcommAclrtNotifyWaitOnThread(threads[1], notifyId, timeout);
```
