Skip to content

Commit f9e8a55

Browse files
authored
Merge pull request #2543 from ggouaillardet/topic/dll_bit_reproducible
ompi/debuggers: make the binary bit reproducible
2 parents ae056d9 + 4d8f606 commit f9e8a55

File tree

4 files changed

+42
-3
lines changed

4 files changed

+42
-3
lines changed

ompi/debuggers/ompi_common_dll.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* reserved.
77
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
88
* Copyright (c) 2012-2013 Inria. All rights reserved.
9-
* Copyright (c) 2014-2015 Research Organization for Information Science
9+
* Copyright (c) 2014-2016 Research Organization for Information Science
1010
* and Technology (RIST). All rights reserved.
1111
* Copyright (c) 2014 Intel, Inc. All rights reserved.
1212
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
@@ -44,6 +44,8 @@
4444

4545
#include "ompi_common_dll_defs.h"
4646

47+
#include <string.h>
48+
4749
/* Basic callbacks into the debugger */
4850
const mqs_basic_callbacks *mqs_basic_entrypoints = NULL;
4951

@@ -629,3 +631,20 @@ int ompi_fetch_opal_pointer_array_item(mqs_process *proc, mqs_taddr_t addr,
629631

630632
return mqs_ok;
631633
}
634+
635+
int ompi_get_lib_version(char * buf, int size) {
636+
int ret;
637+
ret = snprintf(buf, size-1, "Open MPI v%d.%d.%d%s%s%s%s%s%s%s%s%s",
638+
OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION, OMPI_RELEASE_VERSION,
639+
(strlen(OMPI_GREEK_VERSION) > 0)?OMPI_GREEK_VERSION:"",
640+
(strlen(OPAL_PACKAGE_STRING) > 0)?", package: ":"",
641+
(strlen(OPAL_PACKAGE_STRING) > 0)?OPAL_PACKAGE_STRING:"",
642+
(strlen(OPAL_IDENT_STRING)> 0)?", ident: ":"",
643+
(strlen(OPAL_IDENT_STRING)> 0)?OMPI_IDENT_STRING:"",
644+
(strlen(OMPI_REPO_REV) > 0)?", repo rev: ":"",
645+
(strlen(OMPI_REPO_REV) > 0)?OMPI_REPO_REV:"",
646+
(strlen(OMPI_RELEASE_DATE) > 0)?", ":"",
647+
(strlen(OMPI_RELEASE_DATE) > 0)?OMPI_RELEASE_DATE:"");
648+
buf[size-1] = '\0';
649+
return ret;
650+
}

ompi/debuggers/ompi_common_dll_defs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* Copyright (c) 2012-2013 Inria. All rights reserved.
88
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
99
* reserved.
10+
* Copyright (c) 2016 Research Organization for Information Science
11+
* and Technology (RIST). All rights reserved.
1012
* $COPYRIGHT$
1113
*
1214
* Additional copyrights may follow
@@ -330,4 +332,6 @@ int ompi_fetch_opal_pointer_array_info(mqs_process *proc, mqs_taddr_t addr,
330332
int ompi_fetch_opal_pointer_array_item(mqs_process *proc, mqs_taddr_t addr,
331333
mpi_process_info *p_info, int index,
332334
mqs_taddr_t *item);
335+
#define OMPI_MAX_VER_SIZE 256
336+
int ompi_get_lib_version(char *buf, int size);
333337
#endif

ompi/debuggers/ompi_mpihandles_dll.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* reserved.
66
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
77
* Copyright (c) 2012-2013 Inria. All rights reserved.
8+
* Copyright (c) 2016 Research Organization for Information Science
9+
* and Technology (RIST). All rights reserved.
810
* $COPYRIGHT$
911
*
1012
* Additional copyrights may follow
@@ -164,12 +166,17 @@ int mpidbg_interface_version_compatibility(void)
164166
}
165167

166168

169+
static char mpidbg_version_str[OMPI_MAX_VER_SIZE];
170+
167171
/* Returns a string specific to OMPI */
168172
char *mpidbg_version_string(void)
169173
{
174+
int offset;
170175
printf("mpidbg_version_string\n");
171-
return "Open MPI handle interpretation support for parallel"
172-
" debuggers compiled on " __DATE__;
176+
offset = snprintf(mpidbg_version_str, OMPI_MAX_VER_SIZE-1,
177+
"Open MPI handle interpretation support for parallel debuggers ");
178+
ompi_get_lib_version(mpidbg_version_str+offset, OMPI_MAX_VER_SIZE-offset);
179+
return mpidbg_version_str;
173180
}
174181

175182

ompi/debuggers/ompi_msgq_dll.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
99
* reserved.
1010
* Copyright (c) 2016 Intel, Inc. All rights reserved.
11+
* Copyright (c) 2016 Research Organization for Information Science
12+
* and Technology (RIST). All rights reserved.
1113
* $COPYRIGHT$
1214
*
1315
* Additional copyrights may follow
@@ -186,11 +188,18 @@ int mqs_version_compatibility (void)
186188
return MQS_INTERFACE_COMPATIBILITY;
187189
} /* mqs_version_compatibility */
188190

191+
static char mqs_version_str[OMPI_MAX_VER_SIZE];
192+
189193
/* This one can say what you like */
190194
char *mqs_version_string (void)
191195
{
192196
return "Open MPI message queue support for parallel"
193197
" debuggers compiled on " __DATE__;
198+
int offset;
199+
offset = snprintf(mqs_version_str, OMPI_MAX_VER_SIZE-1,
200+
"Open MPI message queue support for parallel debuggers ");
201+
ompi_get_lib_version(mqs_version_str+offset, OMPI_MAX_VER_SIZE-offset);
202+
return mqs_version_str;
194203
} /* mqs_version_string */
195204

196205
/* So the debugger can tell what interface width the library was compiled with */

0 commit comments

Comments
 (0)