[Darshan-commits] [Git][darshan/darshan][issue-223-mmap-hugepages] disable mmap wrapper for dynamic linking

Philip Carns xgitlab at cels.anl.gov
Fri Feb 3 14:57:18 CST 2017


Philip Carns pushed to branch issue-223-mmap-hugepages at darshan / darshan


Commits:
90de4de4 by Phil Carns at 2017-02-03T20:56:46+00:00
disable mmap wrapper for dynamic linking

see #223

- - - - -


3 changed files:

- ChangeLog
- darshan-runtime/Makefile.in
- darshan-runtime/lib/darshan-posix.c


Changes:

=====================================
ChangeLog
=====================================
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,7 +16,10 @@ Darshan-3.1.3-pre1
   applications (contributed by Cristian Simarro)
 * skip instrumentation attempts for anonymous mmap() calls; this avoids a
   potentential deadlock condition when used with hugepages on Cray systems.
-  Reported by Glenn Lockwood and Cristian Simarro.
+  Reported by Glenn Lockwood for static linking case.
+* disable instrumentation for mmap when dynamically linking; this avoids a
+  potential deadlock condition on Cray systems using dynamically linked
+  executabes.  Reported by Cristian Simarro for dynamic linking case.
 * fix segmentation fault in statistics collection for applications that issue
   operations with a large number of distince access sizes or strides on the
   same file.  Reported by Glenn Lockwood.


=====================================
darshan-runtime/Makefile.in
=====================================
--- a/darshan-runtime/Makefile.in
+++ b/darshan-runtime/Makefile.in
@@ -87,7 +87,7 @@ lib/darshan-null.po: lib/darshan-null.c darshan.h darshan-dynamic.h darshan-comm
 	$(CC) $(CFLAGS_SHARED) -c $< -o $@
 
 lib/darshan-posix.o: lib/darshan-posix.c darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-posix-log-format.h | lib
-	$(CC) $(CFLAGS) -c $< -o $@
+	$(CC) $(CFLAGS) -DDARSHAN_WRAP_MMAP -c $< -o $@
 
 lib/darshan-posix.po: lib/darshan-posix.c darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-posix-log-format.h | lib
 	$(CC) $(CFLAGS_SHARED) -c $< -o $@


=====================================
darshan-runtime/lib/darshan-posix.c
=====================================
--- a/darshan-runtime/lib/darshan-posix.c
+++ b/darshan-runtime/lib/darshan-posix.c
@@ -62,8 +62,10 @@ DARSHAN_FORWARD_DECL(__lxstat, int, (int vers, const char* path, struct stat *bu
 DARSHAN_FORWARD_DECL(__lxstat64, int, (int vers, const char* path, struct stat64 *buf));
 DARSHAN_FORWARD_DECL(__fxstat, int, (int vers, int fd, struct stat *buf));
 DARSHAN_FORWARD_DECL(__fxstat64, int, (int vers, int fd, struct stat64 *buf));
+#ifdef DARSHAN_WRAP_MMAP
 DARSHAN_FORWARD_DECL(mmap, void*, (void *addr, size_t length, int prot, int flags, int fd, off_t offset));
 DARSHAN_FORWARD_DECL(mmap64, void*, (void *addr, size_t length, int prot, int flags, int fd, off64_t offset));
+#endif /* DARSHAN_WRAP_MMAP */
 DARSHAN_FORWARD_DECL(fsync, int, (int fd));
 DARSHAN_FORWARD_DECL(fdatasync, int, (int fd));
 DARSHAN_FORWARD_DECL(close, int, (int fd));
@@ -917,6 +919,7 @@ int DARSHAN_DECL(__fxstat64)(int vers, int fd, struct stat64 *buf)
     return(ret);
 }
 
+#ifdef DARSHAN_WRAP_MMAP
 void* DARSHAN_DECL(mmap)(void *addr, size_t length, int prot, int flags,
     int fd, off_t offset)
 {
@@ -947,7 +950,9 @@ void* DARSHAN_DECL(mmap)(void *addr, size_t length, int prot, int flags,
 
     return(ret);
 }
+#endif /* DARSHAN_WRAP_MMAP */
 
+#ifdef DARSHAN_WRAP_MMAP
 void* DARSHAN_DECL(mmap64)(void *addr, size_t length, int prot, int flags,
     int fd, off64_t offset)
 {
@@ -978,6 +983,7 @@ void* DARSHAN_DECL(mmap64)(void *addr, size_t length, int prot, int flags,
 
     return(ret);
 }
+#endif /* DARSHAN_WRAP_MMAP */
 
 int DARSHAN_DECL(fsync)(int fd)
 {



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/90de4de4177cd8327c6c91acd640004ced776675
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20170203/85404cc2/attachment-0001.html>


More information about the Darshan-commits mailing list