|  | 
| 17 | 17 |  * Copyright (c) 2013-2018 Intel, Inc. All rights reserved. | 
| 18 | 18 |  * Copyright (c) 2015-2018 Research Organization for Information Science | 
| 19 | 19 |  *                         and Technology (RIST). All rights reserved. | 
| 20 |  | - * Copyright (c) 2017      IBM Corporation.  All rights reserved. | 
|  | 20 | + * Copyright (c) 2017-2021 IBM Corporation.  All rights reserved. | 
| 21 | 21 |  * $COPYRIGHT$ | 
| 22 | 22 |  * | 
| 23 | 23 |  * Additional copyrights may follow | 
|  | 
| 108 | 108 | #include "orte/util/show_help.h" | 
| 109 | 109 | 
 | 
| 110 | 110 | #include "orted_submit.h" | 
|  | 111 | +#include "orted-mpir/orted_mpir.h" | 
| 111 | 112 | 
 | 
| 112 | 113 | /** | 
| 113 | 114 |  * Global struct for catching orte command line options. | 
| @@ -156,63 +157,8 @@ static void run_debugger(char *basename, opal_cmd_line_t *cmd_line, | 
| 156 | 157 |                          int argc, char *argv[], int num_procs); | 
| 157 | 158 | static void print_help(void); | 
| 158 | 159 | 
 | 
| 159 |  | -/* instance the standard MPIR interfaces */ | 
| 160 |  | -#define MPIR_MAX_PATH_LENGTH 512 | 
| 161 |  | -#define MPIR_MAX_ARG_LENGTH 1024 | 
| 162 |  | -struct MPIR_PROCDESC *MPIR_proctable = NULL; | 
| 163 |  | -int MPIR_proctable_size = 0; | 
| 164 |  | -volatile int MPIR_being_debugged = 0; | 
| 165 |  | -volatile int MPIR_debug_state = 0; | 
| 166 |  | -int MPIR_i_am_starter = 0; | 
| 167 |  | -int MPIR_partial_attach_ok = 1; | 
| 168 |  | -char MPIR_executable_path[MPIR_MAX_PATH_LENGTH] = {0}; | 
| 169 |  | -char MPIR_server_arguments[MPIR_MAX_ARG_LENGTH] = {0}; | 
| 170 |  | -volatile int MPIR_forward_output = 0; | 
| 171 |  | -volatile int MPIR_forward_comm = 0; | 
| 172 |  | -char MPIR_attach_fifo[MPIR_MAX_PATH_LENGTH] = {0}; | 
| 173 |  | -int MPIR_force_to_main = 0; | 
| 174 | 160 | static void orte_debugger_init_before_spawn(orte_job_t *jdata); | 
| 175 | 161 | 
 | 
| 176 |  | -ORTE_DECLSPEC void __opal_attribute_optnone__ MPIR_Breakpoint(void); | 
| 177 |  | - | 
| 178 |  | -/*  | 
| 179 |  | - * Attempt to prevent the compiler from optimizing out | 
| 180 |  | - * MPIR_Breakpoint(). | 
| 181 |  | - * | 
| 182 |  | - * Some older versions of automake can add -O3 to every | 
| 183 |  | - * file via CFLAGS (which was demonstrated in automake v1.13.4), | 
| 184 |  | - * so there is a possibility that the compiler will see | 
| 185 |  | - * this function as a NOOP and optimize it out on older versions. | 
| 186 |  | - * While using the current/recommended version of automake | 
| 187 |  | - * does not do this, the following will help those | 
| 188 |  | - * stuck with an older version, as well as guard against | 
| 189 |  | - * future regressions. | 
| 190 |  | - * | 
| 191 |  | - * See the following git issue for more discussion: | 
| 192 |  | - * https://github.com/open-mpi/ompi/issues/5501 | 
| 193 |  | - */ | 
| 194 |  | -volatile void* volatile orte_noop_mpir_breakpoint_ptr = NULL; | 
| 195 |  | - | 
| 196 |  | -/* | 
| 197 |  | - * Breakpoint function for parallel debuggers | 
| 198 |  | - */ | 
| 199 |  | -void MPIR_Breakpoint(void) | 
| 200 |  | -{ | 
| 201 |  | -    /*  | 
| 202 |  | -     * Actually do something with this pointer to make | 
| 203 |  | -     * sure the compiler does not optimize out this function. | 
| 204 |  | -     * The compiler should be forced to keep this | 
| 205 |  | -     * function around due to the volatile void* type. | 
| 206 |  | -     * | 
| 207 |  | -     * This pointer doesn't actually do anything other than | 
| 208 |  | -     * prevent unwanted optimization, and | 
| 209 |  | -     * *should not* be used anywhere else in the code. | 
| 210 |  | -     * So pointing this to the weeds should be OK. | 
| 211 |  | -     */ | 
| 212 |  | -    orte_noop_mpir_breakpoint_ptr = (volatile void *) 0x42; | 
| 213 |  | -    return; | 
| 214 |  | -} | 
| 215 |  | - | 
| 216 | 162 | /* local objects */ | 
| 217 | 163 | typedef struct { | 
| 218 | 164 |     opal_object_t super; | 
|  | 
0 commit comments