You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
declare ompi_mpi_show_mca_params_file as NULL
so MPI_T_Init_thread() can be invoked without leaking memory
Signed-off-by: Gilles Gouaillardet <[email protected]>
"If mpi_show_mca_params is true, setting this string to a valid filename tells Open MPI to dump all the MCA parameter values into a file suitable for reading via the mca_param_files parameter (good for reproducability of MPI jobs)",
207
208
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
@@ -330,7 +331,8 @@ int ompi_show_all_mca_params(int32_t rank, int requested, char *nodename) {
330
331
timestamp=time(NULL);
331
332
332
333
/* Open the file if one is specified */
333
-
if (0!=strlen(ompi_mpi_show_mca_params_file)) {
334
+
if (NULL!=ompi_mpi_show_mca_params_file&&
335
+
0!=strlen(ompi_mpi_show_mca_params_file)) {
334
336
if ( NULL== (fp=fopen(ompi_mpi_show_mca_params_file, "w")) ) {
335
337
opal_output(0, "Unable to open file <%s> to write MCA parameters", ompi_mpi_show_mca_params_file);
336
338
returnOMPI_ERR_FILE_OPEN_FAILURE;
@@ -389,7 +391,8 @@ int ompi_show_all_mca_params(int32_t rank, int requested, char *nodename) {
389
391
}
390
392
391
393
/* Print the parameter */
392
-
if (0!=strlen(ompi_mpi_show_mca_params_file)) {
394
+
if (NULL!=ompi_mpi_show_mca_params_file&&
395
+
0!=strlen(ompi_mpi_show_mca_params_file)) {
393
396
fprintf(fp, "%s\n", var_dump[0]);
394
397
} else {
395
398
opal_output(0, "%s\n", var_dump[0]);
@@ -399,7 +402,8 @@ int ompi_show_all_mca_params(int32_t rank, int requested, char *nodename) {
0 commit comments