Skip to content

Commit c747a1b

Browse files
authored
Merge pull request #8758 from rhc54/topic/bkpt
Add a soft "breakpoint" capability
2 parents 76acb74 + f97d081 commit c747a1b

File tree

6 files changed

+59
-55
lines changed

6 files changed

+59
-55
lines changed

3rd-party/openpmix

Submodule openpmix updated 48 files

contrib/platform/intel/bend/linux

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,21 @@
11
enable_orterun_prefix_by_default=yes
2-
enable_mpi_thread_multiple=no
3-
enable_mem_debug=no
2+
enable_oshmem=no
3+
enable_sensors=no
44
enable_mem_profile=no
55
enable_debug_symbols=yes
66
enable_binaries=yes
7-
enable_heterogeneous=no
87
enable_picky=yes
98
enable_debug=yes
109
enable_shared=yes
1110
enable_static=no
12-
enable_memchecker=no
11+
enable_io_romio=no
1312
enable_ipv6=no
13+
enable_man_pages=no
1414
enable_mpi_fortran=no
15-
enable_mpi_cxx=no
16-
enable_mpi_cxx_seek=no
17-
enable_cxx_exceptions=no
18-
enable_mpi_java=no
19-
enable_io_romio=no
20-
enable_contrib_no_build=libnbc
21-
enable_install_libpmix=yes
15+
enable_memchecker=no
16+
enable_mca_no_build=memchecker,coll-adapt,coll-cuda,coll-demo,coll-ftagree,coll-han,coll-hcoll,coll-inter,coll-libnbc,coll-monitoring,coll-portals4,coll-tuned,common-monitoring,common-ompio,fbtl,fcoll,fs,io,mtl,osc,pml-cm,pml-monitoring,pml-ucx,pml-v,sharedfp,topo,vprotocol,btl-ofi,btl-portals4,btl-smcuda,btl-uct,btl-ugni,btl-usnic,common-cuda,common-ofi,common-ucx
17+
enable_contrib_no_build=libompitrace
2218
with_memory_manager=no
23-
with_tm=no
24-
with_psm=no
25-
with_psm2=no
2619
with_devel_headers=yes
27-
with_libfabric=no
28-
with_portals=no
29-
with_valgrind=no
30-
if [ -n "$SLURMHOME" ] ; then
31-
with_slurm=$SLURMHOME
32-
with_pmi=$SLURMHOME
33-
else
34-
with_slurm=no
35-
fi
20+
with_xgrid=no
21+
with_slurm=no

contrib/platform/intel/bend/mac

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
enable_orcm=no
21
enable_oshmem=no
32
enable_sensors=no
4-
enable_mpi_thread_multiple=yes
5-
enable_mem_debug=yes
63
enable_mem_profile=no
74
enable_debug_symbols=yes
85
enable_binaries=yes
9-
enable_heterogeneous=yes
106
enable_picky=yes
117
enable_debug=yes
128
enable_shared=yes
139
enable_static=no
1410
enable_io_romio=no
1511
enable_ipv6=no
12+
enable_man_pages=no
1613
enable_mpi_fortran=no
17-
enable_mpi_cxx=no
18-
enable_mpi_cxx_seek=no
1914
enable_memchecker=no
20-
enable_mca_no_build=memchecker
21-
enable_contrib_no_build=libnbc
15+
enable_mca_no_build=memchecker,coll-adapt,coll-cuda,coll-demo,coll-ftagree,coll-han,coll-hcoll,coll-inter,coll-libnbc,coll-monitoring,coll-portals4,coll-tuned,common-monitoring,common-ompio,fbtl,fcoll,fs,io,mtl,osc,pml-cm,pml-monitoring,pml-ucx,pml-v,sharedfp,topo,vprotocol,btl-ofi,btl-portals4,btl-smcuda,btl-uct,btl-ugni,btl-usnic,common-cuda,common-ofi,common-ucx
16+
enable_contrib_no_build=libompitrace
2217
with_memory_manager=no
2318
with_devel_headers=yes
2419
with_xgrid=no

ompi/runtime/ompi_rte.c

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,32 +1051,35 @@ static void _release_fn(size_t refid, pmix_status_t status,
10511051
debugger_event_active = false;
10521052
}
10531053

1054-
/*
1055-
* Wait for a debugger if asked. We support two ways of waiting for
1056-
* attaching debuggers
1057-
*/
1058-
void ompi_rte_wait_for_debugger(void)
1054+
void ompi_rte_breakpoint(char *name)
10591055
{
10601056
pmix_info_t directive;
10611057
char *evar;
1062-
int time, code = PMIX_ERR_DEBUGGER_RELEASE;
1063-
pmix_info_t info;
1058+
int rc, code = PMIX_DEBUGGER_RELEASE;
1059+
pmix_info_t info[2];
1060+
uint32_t u32, *u32ptr;
1061+
opal_process_name_t pname;
1062+
1063+
if (NULL != name
1064+
&& NULL != (evar = getenv("OMPI_BREAKPOINT"))
1065+
&& 0 != strcasecmp(evar, name)) {
1066+
/* they don't want to stop here */
1067+
return;
1068+
}
10641069

10651070
/* check PMIx to see if we are under a debugger */
1066-
if (NULL == getenv("PMIX_DEBUG_WAIT_FOR_NOTIFY") &&
1067-
NULL == getenv("PMIX_TEST_DEBUGGER_ATTACH")) {
1071+
u32ptr = &u32;
1072+
pname.jobid = opal_process_info.my_name.jobid;
1073+
pname.vpid = OPAL_VPID_WILDCARD;
1074+
OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, "PMIX_DEBUG_STOP_IN_APP",
1075+
&pname, &u32ptr, PMIX_PROC_RANK);
1076+
if (PMIX_SUCCESS != rc) {
10681077
/* if not, just return */
10691078
return;
10701079
}
1071-
1072-
/* if we are being debugged, then we need to find
1073-
* the correct plug-ins
1074-
*/
1075-
ompi_debugger_setup_dlls();
1076-
1077-
if (NULL != (evar = getenv("PMIX_TEST_DEBUGGER_SLEEP"))) {
1078-
time = strtol(evar, NULL, 10);
1079-
sleep(time);
1080+
/* are we included? */
1081+
if (!PMIX_CHECK_RANK(u32, opal_process_info.myprocid.rank)) {
1082+
/* no - ignore it */
10801083
return;
10811084
}
10821085

@@ -1086,11 +1089,13 @@ void ompi_rte_wait_for_debugger(void)
10861089
PMIX_INFO_DESTRUCT(&directive);
10871090

10881091
/* notify the host that we are waiting */
1089-
PMIX_INFO_LOAD(&info, PMIX_EVENT_NON_DEFAULT, NULL, PMIX_BOOL);
1090-
PMIx_Notify_event(PMIX_DEBUG_WAITING_FOR_NOTIFY,
1092+
PMIX_INFO_LOAD(&info[0], PMIX_EVENT_NON_DEFAULT, NULL, PMIX_BOOL);
1093+
PMIX_INFO_LOAD(&info[1], PMIX_BREAKPOINT, "mpi-init", PMIX_STRING);
1094+
PMIx_Notify_event(PMIX_READY_FOR_DEBUG,
10911095
&opal_process_info.myprocid,
1092-
PMIX_RANGE_RM, &info, 1, NULL, NULL);
1093-
PMIX_INFO_DESTRUCT(&info);
1096+
PMIX_RANGE_RM, info, 2, NULL, NULL);
1097+
PMIX_INFO_DESTRUCT(&info[0]);
1098+
PMIX_INFO_DESTRUCT(&info[1]);
10941099

10951100
/* let the MPI progress engine run while we wait for debugger release */
10961101
OMPI_WAIT_FOR_COMPLETION(debugger_event_active);
@@ -1099,6 +1104,22 @@ void ompi_rte_wait_for_debugger(void)
10991104
PMIx_Deregister_event_handler(handler, NULL, NULL);
11001105
}
11011106

1107+
/*
1108+
* Wait for a debugger if asked. We support two ways of waiting for
1109+
* attaching debuggers
1110+
*/
1111+
void ompi_rte_wait_for_debugger(void)
1112+
{
1113+
if (NULL != getenv("PMIX_TEST_DEBUGGER_ATTACH")
1114+
|| NULL == getenv("OMPI_BREAKPOINT")) {
1115+
ompi_rte_breakpoint(NULL);
1116+
return;
1117+
}
1118+
1119+
/* check for the "mpi-init" breakpoint */
1120+
ompi_rte_breakpoint("mpi-init");
1121+
}
1122+
11021123
static int _setup_top_session_dir(char **sdir)
11031124
{
11041125
char *tmpdir;

ompi/runtime/ompi_rte.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ OMPI_DECLSPEC int ompi_rte_convert_string_to_process_name(opal_process_name_t *n
216216
OMPI_DECLSPEC int ompi_rte_convert_process_name_to_string(char** name_string,
217217
const opal_process_name_t *name);
218218

219+
OMPI_DECLSPEC void ompi_rte_breakpoint(char *name);
220+
219221
#define OMPI_LOCAL_JOBID(n) \
220222
( (n) & 0x0000ffff)
221223
#define OMPI_JOB_FAMILY(n) \

0 commit comments

Comments
 (0)