Line data Source code
1 : /**
2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 : * CANN Open Software License Agreement Version 2.0 (the "License").
5 : * Please refer to the License for details. You may not use this file except in compliance with the License.
6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 : * See LICENSE in the root of the software repository for the full text of the License.
9 : */
10 :
11 : #include "coll_batch_write_executor.h"
12 :
13 : namespace hccl {
14 0 : HcclResult CollBatchWriteExecutor::Orchestrate(OpParam& param, AlgResourceResponse& algRes)
15 : {
16 : (void)param;
17 : (void)algRes;
18 0 : return HCCL_SUCCESS;
19 : }
20 :
21 0 : HcclResult CollBatchWriteExecutor::CalcResRequest(const OpParam& param, AlgResourceRequest& resourceRequest)
22 : {
23 : std::vector<LevelNSubCommTransport> opTransport{
24 0 : std::vector<LevelNSubCommTransport>(static_cast<u32>(COMM_LEVEL_RESERVED))};
25 0 : CommParaInfo commCombinePara(COMM_COMBINE_ORDER, CommType::COMM_TAG_MESH);
26 0 : commCombinePara.meshSinglePlane = true;
27 0 : CHK_RET(topoMatcher_->CalcCommPlaneInfo(
28 : param.tag, commCombinePara, opTransport[COMM_COMBINE_ORDER], TransportMemType::CCL_INPUT,
29 : TransportMemType::CCL_OUTPUT));
30 :
31 0 : LevelNSubCommTransport& commTransportLevel0 = opTransport[COMM_COMBINE_ORDER];
32 0 : for (u32 subCommIndex = 0; subCommIndex < commTransportLevel0.size(); subCommIndex++) {
33 0 : for (auto& transportRequest : commTransportLevel0[subCommIndex].transportRequests) {
34 0 : transportRequest.isUsedRdma = false;
35 : }
36 : }
37 0 : resourceRequest.opTransport = opTransport;
38 0 : resourceRequest.streamNum = param.BatchWriteDataDes.queueNum;
39 0 : HCCL_INFO(
40 : "[Sdma-BatchWrite]Calc resource request for tag %s, stream number %u.", param.tag.c_str(),
41 : resourceRequest.streamNum);
42 0 : return HCCL_SUCCESS;
43 0 : }
44 :
45 : REGISTER_EXEC(BATCH_WRITE_ALG_NAME, BatchWrite, CollBatchWriteExecutor);
46 : } // namespace hccl
|