summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2019-11-11 16:05:05 +0200
committerPanu Matilainen <pmatilai@redhat.com>2019-11-18 12:46:29 +0200
commit4ab51b55f4bebc7a931007ff28f75136875cd31f (patch)
tree4f8600893dcea7598bbbe342e72460560efc4721
parent6bf37ce21be543e0bc6cc4d161876a3826371696 (diff)
downloadrpm-4ab51b55f4bebc7a931007ff28f75136875cd31f.tar.gz
Preserve processing order in file classification
The order of file classification isn't interesting in itself, but arbitrary order makes contents of RPMTAG_CLASSDICT non-deterministic which is not nice for reproducable builds. Tell OMP to handle the class dictionary in order. Cancellation points are not allowed in ordered construct so we need to drop that. It doesn't change the actual results, just means that we run a little longer in case errors are encountered. Fixes #934 (cherry picked from commit 3691d99c8bf8c81a3130333f9cbfaef704b8686f)
-rw-r--r--build/rpmfc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 77fdc72c4..53c6ecce0 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -1120,7 +1120,7 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode)
#pragma omp cancel parallel
}
- #pragma omp for reduction(+:nerrors)
+ #pragma omp for ordered reduction(+:nerrors)
for (int ix = 0; ix < fc->nfiles; ix++) {
rpmsid ftypeId;
const char * ftype;
@@ -1164,7 +1164,6 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode)
/* only executable files are critical to dep extraction */
if (is_executable) {
nerrors++;
- #pragma omp cancel for
}
/* unrecognized non-executables get treated as "data" */
ftype = "data";
@@ -1185,6 +1184,7 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode)
fc->fcolor[ix] = fcolor;
/* Add to file class dictionary and index array */
+ #pragma omp ordered
if (fcolor != RPMFC_WHITE && (fcolor & RPMFC_INCLUDE)) {
ftypeId = rpmstrPoolId(fc->cdict, ftype, 1);
#pragma omp atomic