What's the thread-safe model relationship between ucx & ibverbs? #10028
-
Recently, I've been using UCP APIs for my own project and have benefited from its RMA operations. Before that, I used ibverbs to develop RDMA-related applications, and as far as I know, the ibverbs APIs are totally thread-safe, meaning that you can use the same resources in multiple threads. However, when I try to use UCP rather than directly using ibverbs, things turn out differently. It turns out that the Another interesting thing I learned is that the ib interface does not support if (ucs_derived_of(worker, uct_priv_worker_t)->thread_mode == UCS_THREAD_MODE_MULTI) {
ucs_error("IB transports do not support multi-threaded worker");
return UCS_ERR_INVALID_PARAM;
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @Yangfisher1 , |
Beta Was this translation helpful? Give feedback.
-
I see, but I'm asking whether it is possible to directly share resources with RDMA components since the ibverbs APIs are totally thread-safe. |
Beta Was this translation helpful? Give feedback.
No, because of MMIO usage by UCT, which is different from ibverbs.
We recommend using the UCP layer APIs, which ensure MT safety.
In case you need to share UCT resources between threads, use
UCS_THREAD_MODE_SERIALIZED
and ensure their synchronization.