File tree 2 files changed +36
-0
lines changed 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 12
12
#include "utils/ucc_log.h"
13
13
#include "utils/ucc_list.h"
14
14
#include "utils/ucc_string.h"
15
+ #include "utils/ucc_debug.h"
15
16
#include "ucc_progress_queue.h"
16
17
17
18
static uint32_t ucc_context_seq_num = 0 ;
@@ -633,6 +634,9 @@ ucc_status_t ucc_context_create_proc_info(ucc_lib_h lib,
633
634
b_params .thread_mode = lib -> attr .thread_mode ;
634
635
if (params -> mask & UCC_CONTEXT_PARAM_FIELD_OOB ) {
635
636
ctx -> rank = params -> oob .oob_ep ;
637
+ #ifdef ENABLE_DEBUG
638
+ ucc_check_wait_for_debugger (ctx -> rank );
639
+ #endif
636
640
}
637
641
status = ucc_create_tl_contexts (ctx , config , b_params );
638
642
if (UCC_OK != status ) {
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) 2020-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
+ *
4
+ * See file LICENSE for terms.
5
+ */
6
+
7
+ #ifndef UCC_DEBUG_H_
8
+ #define UCC_DEBUG_H_
9
+
10
+ #include "config.h"
11
+ #include "ucc/api/ucc.h"
12
+
13
+ static inline void ucc_check_wait_for_debugger (ucc_rank_t ctx_rank )
14
+ {
15
+ const char * wait_for_rank ;
16
+ if (NULL != (wait_for_rank = getenv ("UCC_DEBUGGER_WAIT" ))) {
17
+ volatile int waiting = 1 ;
18
+ if (atoi (wait_for_rank ) == ctx_rank ) {
19
+ char hostname [256 ];
20
+ gethostname (hostname , sizeof (hostname ));
21
+ printf ("PID %d (ctx rank %d) waiting for attach on %s\n"
22
+ "Set var waiting = 0 in debugger to continue\n" ,
23
+ getpid (), ctx_rank , hostname );
24
+ while (waiting ) {
25
+ sleep (1 );
26
+ }
27
+ }
28
+ }
29
+ }
30
+
31
+ #endif
32
+
You can’t perform that action at this time.
0 commit comments