|
28 | 28 | #include "param.h" |
29 | 29 | #include "socket.h" |
30 | 30 |
|
31 | | -/* FlagCX's topo.h defines node-type macros (CPU=3, NIC=4, NET=5, ...) |
32 | | - that collide with accl::barex's device_type enumerators. They are not |
33 | | - used in this file — drop them before pulling the vendor headers. */ |
34 | | -#ifdef CPU |
35 | 31 | #undef CPU |
36 | | -#endif |
37 | | -#ifdef GPU |
38 | 32 | #undef GPU |
39 | | -#endif |
40 | | -#ifdef NIC |
41 | 33 | #undef NIC |
42 | | -#endif |
43 | | -#ifdef NET |
44 | 34 | #undef NET |
45 | | -#endif |
46 | | -#ifdef PCI |
47 | 35 | #undef PCI |
48 | | -#endif |
49 | 36 |
|
50 | 37 | #include <accl/barex/barex_types.h> |
51 | 38 | #include <accl/barex/xchannel.h> |
@@ -81,9 +68,6 @@ using namespace accl::barex; |
81 | 68 |
|
82 | 69 | namespace { |
83 | 70 |
|
84 | | -FLAGCX_PARAM(P2pAcclQpsPerCtx, "P2P_ACCL_QPS_PER_CTX", 2); |
85 | | -FLAGCX_PARAM(P2pAcclConnectTimeoutSec, "P2P_ACCL_CONNECT_TIMEOUT", 20); |
86 | | - |
87 | 71 | constexpr uint64_t kAcclHelloMagic = 0xACC1F1A6C0DE0001ull; |
88 | 72 | constexpr uint32_t kAcclNotifMagic = 0xDEADDEADu; /* same wire as ibrc */ |
89 | 73 | constexpr int kMaxNics = kFlagcxP2pMaxQpsPerEngine; /* 8, matches desc */ |
@@ -922,7 +906,8 @@ FlagcxP2pConn *flagcxAcclEngineConnect(FlagcxP2pEngine *e, const char *ipAddr, |
922 | 906 | /* data-plane channels: qpsPerCtx per client ctx. Control block shared |
923 | 907 | with callbacks; on timeout a late callback sees `abandoned` and |
924 | 908 | destroys its own channel instead of touching freed state. */ |
925 | | - const int qps = (int)flagcxParamP2pAcclQpsPerCtx(); |
| 909 | + const auto &config = flagcxP2pGlobalConfig(); |
| 910 | + const int qps = config.qpsPerConn; |
926 | 911 | const int total = qps * (int)engine->clientCtxs.size(); |
927 | 912 | auto ctl = std::make_shared<AcclConnectCtl>(total); |
928 | 913 | for (int i = 0; i < total; i++) { |
@@ -950,9 +935,8 @@ FlagcxP2pConn *flagcxAcclEngineConnect(FlagcxP2pEngine *e, const char *ipAddr, |
950 | 935 | bool allUp = false; |
951 | 936 | { |
952 | 937 | std::unique_lock<std::mutex> lk(ctl->mu); |
953 | | - ctl->cv.wait_for( |
954 | | - lk, std::chrono::seconds((int)flagcxParamP2pAcclConnectTimeoutSec()), |
955 | | - [&] { return ctl->remaining <= 0; }); |
| 938 | + ctl->cv.wait_for(lk, std::chrono::seconds(480), |
| 939 | + [&] { return ctl->remaining <= 0; }); |
956 | 940 | ctl->abandoned = true; /* late callbacks self-clean from here on */ |
957 | 941 | allUp = ctl->remaining <= 0 && !ctl->anyFailed; |
958 | 942 | conn->channels = std::move(ctl->channels); |
|
0 commit comments