Use the static scheduler in ordered clause. Otherwise OpenMP uses

a scheduler it thinks is best which can be dynamic or guided. Both
sometimes let other threads continue before the block is finished.
That will crash the program with high thread counts and a cache
that is not large enough to hold old enough frames, which leads
to a crash when in some cases like transitions two different
frames are used although one is no longer in the cache.
The static scheduler always waits until the block is finished
before enabling other threads.
This commit is contained in:
eisneinechse
2018-09-07 10:44:18 -07:00
parent be979cd78c
commit 6925f6f7c2

View File

@@ -717,7 +717,8 @@ std::shared_ptr<Frame> Timeline::GetFrame(int64_t requested_frame)
#pragma omp parallel
{
// Loop through all requested frames
#pragma omp for ordered firstprivate(nearby_clips, requested_frame, minimum_frames)
// The scheduler has to be static!
#pragma omp for ordered schedule(static,1) firstprivate(nearby_clips, requested_frame, minimum_frames)
for (int64_t frame_number = requested_frame; frame_number < requested_frame + minimum_frames; frame_number++)
{
// Debug output