Skip to content
Snippets Groups Projects

Threadpool task plots

Merged Pedro Gonnet requested to merge threadpool_task_plots into master

Adds the following:

  • --enable-threadpool-debugging to the ./configure flags,
  • -Y to main.c to enable dumping threadpool timers much like the task timers.

This generates threadpool_info-step%d.dat files every -Y steps which contain the mapper function name, the id of the thread that executed it, the number of chunks processed, and the tic and toc timers for the mapper function.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
29 29 #define queue_sizeinit 100
30 30 #define queue_sizegrow 2
31 31 #define queue_search_window 8
32 #define queue_incoming_size 1024
32 #define queue_incoming_size 10240
  • Enjoy:

    with latest fix and new background shading no fake thread.

  • Pedro Gonnet Added 1 commit:

    Added 1 commit:

    • d7419412 - don't hold the thread mutex while the calling thread is working.
  • Pedro Gonnet Added 1 commit:

    Added 1 commit:

    • d9c69983 - use pthread_barrier instead of mutexes and condvars, might be faster.
  • Author Developer

    One more try: replaced our own barrier based on mutexes and cond-vars with two pthread_barriers. Can you check if this improves anything? Thanks!

    Btw, regardless whether this works or not, we should also re-think what we're doing in engine_barrier.

    Edited by Pedro Gonnet
  • Pedro Gonnet Added 1 commit:

    Added 1 commit:

    • 145b4377 - get rid of engine_check_sort_tasks, which is not needed in the new sorting scheme.
  • Peter W. Draper Added 1 commit:

    Added 1 commit:

    • b82a57ba - Use shading correctly when expanding threads
  • That is good to go and be tested thoroughly for integration into master.

  • All looks good to me, so accepting.

  • Peter W. Draper Status changed to merged

    Status changed to merged

  • Peter W. Draper mentioned in commit 58a6ff20

    mentioned in commit 58a6ff20

  • The threadpool unit test does not like these changes.

  • It is strange as I didn't see this with an interactive run. Will look more closely.

  • Hmm, this seems to be happening during the exit phase of the program and is hard to reproduce, that is add any extra configure options and it goes away and you cannot reproduce when ran in a debugger. I'm going to revert this until we understand what is going on.

  • Peter W. Draper mentioned in commit e3309772

    mentioned in commit e3309772

  • Peter W. Draper mentioned in merge request !383 (merged)

    mentioned in merge request !383 (merged)

  • Might be that the test itself needs updating following the changes in the way the threads exit the pool.

  • Probably not. We're dying in at the line:

    unsigned int max_in_before_reset = BARRIER_IN_THRESHOLD
     117                                    - BARRIER_IN_THRESHOLD % count;

    in pthread_barrier_wait, when count is zero, so maybe we have a barrier with no threads.

  • Peter W. Draper mentioned in commit b9389d4e

    mentioned in commit b9389d4e

  • Author Developer

    I think I've fixed this in threadpool_task_plots2, at least it runs clean even with --enable-sanitizer. The problem was that the threads and the barriers need to be cleaned-up explicitly and in the correct order.

    Can either of you have another look?

  • Please register or sign in to reply
    Loading