Ticket #2808 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

Property for number of threads to use

Reported by: Peter Peterson Owned by: Vickie Lynch
Priority: minor Milestone: Iteration 29
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Martyn Gigg

Description

As many developer have hyper-threading turned on, and users may want to run more than one instance of mantid on a multi-user machine, add a new property to limit the total number of threads that openMP will use. OpenMP has the ability built in described here that limits the number of threads in the next openmp call. Otherwise OPENMP_NUM_THREADS is an environment variable that will limit the the application will use altogether.

Change History

comment:1 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 28 to Iteration 29

Bulk move of tickets at the end of iteration 28

comment:2 Changed 9 years ago by Vickie Lynch

  • Status changed from new to accepted

comment:3 Changed 9 years ago by Vickie Lynch

(In [11218]) Refs #2808 Properties file variable MultiThreaded.MaxCores sets the maximum number of threads for OpenMP and ThreadPool to use

comment:4 Changed 9 years ago by Vickie Lynch

(In [11219]) Refs #2808 Changes meant for branch not trunk

comment:5 Changed 9 years ago by Vickie Lynch

(In [11299]) Refs #2808 Properties file variable MultiThreaded.MaxCores sets the maximum number of threads for OpenMP and ThreadPool to use

comment:6 Changed 9 years ago by Vickie Lynch

  • Status changed from accepted to verify
  • Resolution set to fixed

Added variable to Properties File wiki page

comment:7 Changed 9 years ago by Peter Peterson

  • Status changed from verify to verifying
  • Tester set to Peter Peterson

comment:8 Changed 9 years ago by Peter Peterson

  • Status changed from verifying to reopened
  • Resolution fixed deleted

I reviewed the source and it looks good. The one dangling issue is in MultiThreaded.h the macro

#define PARALLEL_SET_NUM_THREADS omp_set_num_threads(MaxCores);

requires that callers have a variable in scope called MaxCores. Modify the macro to take the variable as an argument and modify Algorithm.cpp, then this ticket can be closed.

comment:9 Changed 9 years ago by Vickie Lynch

  • Status changed from reopened to accepted

comment:10 Changed 9 years ago by Vickie Lynch

(In [12874]) Refs #2808 Adding argument for macro

comment:11 Changed 9 years ago by Vickie Lynch

  • Status changed from accepted to verify
  • Resolution set to fixed

I ran LoadEventNexus with/without MultiThreaded.MaxCores = 2 and it used the correct number of cores.

comment:12 Changed 9 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester changed from Peter Peterson to Martyn Gigg

comment:13 Changed 9 years ago by Martyn Gigg

  • Status changed from verifying to closed

Confirmed that the property causes the correct number of cores to be used and the macro change is there.

comment:14 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 3655

Note: See TracTickets for help on using tickets.