[PATCH] D18013: Using MPI for Profiling Data Reduction

Daniel Waters via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 12:26:31 PST 2016


grotdunst marked 10 inline comments as done.

================
Comment at: lib/profile/InstrProfilingFile.c:20
@@ +19,3 @@
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
----------------
davidxl wrote:
> is fcntl.h needed here?
It seems to be needed for file truncation in Windows. Therefore, this has been kept, but inside the _MSC_VER guard.

================
Comment at: lib/profile/InstrProfilingFile.c:86
@@ -74,2 +85,3 @@
   const char *Filename;
+#ifdef _MSC_VER
   FILE *File;
----------------
silvas wrote:
> Let's split this change into a separate patch for a focused discussion on the requirements and possible solutions.
I decided to not separate the patches because file truncation and profiling data reduction are still logically connected. The __llvm_write_prof_data variable is used within this file, but its initialization needs to be kept in the new file that hooks to MPI_Finalize so that the new implementation and function hooks will be used by the linker.

================
Comment at: lib/profile/InstrProfilingReduce.c:15
@@ +14,3 @@
+#include <mpi.h>
+COMPILER_RT_VISIBILITY int __llvm_write_prof_data = 1;
+COMPILER_RT_VISIBILITY int MPI_Finalize() {
----------------
davidxl wrote:
> Define this variable unconditionally in InstrProfiling.c file.
This change was not made, because otherwise the linker will not be forced to use this file, thereby bringing in the expanded implementation of MPI_Finalize and the new stub functions.

================
Comment at: test/profile/instrprof-reduce.c:16
@@ +15,3 @@
+int PMPI_Finalize() { return 0; }
+int MPI_Finalize();
+
----------------
davidxl wrote:
> when HAVE_MPI_H is not defined, will this test case link? MPI_Finalize is not defined anywhere.
A stub implementation of MPI_Finalize has now been included that will be used when HAVE_MPI_H is not defined.


http://reviews.llvm.org/D18013





More information about the llvm-commits mailing list