From: Timo Heister Date: Wed, 2 Oct 2013 17:59:44 +0000 (+0000) Subject: do not use n_default_threads but n_threads() X-Git-Tag: v8.1.0~652 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8129f24495fbbb55919c6ba3c246d37d13b09314;p=dealii.git do not use n_default_threads but n_threads() git-svn-id: https://svn.dealii.org/trunk@31077 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-13/step-13.cc b/deal.II/examples/step-13/step-13.cc index 8e88ee8ad8..fbef4d1660 100644 --- a/deal.II/examples/step-13/step-13.cc +++ b/deal.II/examples/step-13/step-13.cc @@ -743,7 +743,7 @@ namespace Step13 // of equal size. The number of blocks is set to the default number of // threads to be used, which by default is set to the number of // processors found in your computer at startup of the program: - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); std::vector > thread_ranges = Threads::split_range (dof_handler.begin_active (), diff --git a/deal.II/examples/step-14/step-14.cc b/deal.II/examples/step-14/step-14.cc index 32d5710ce1..58359c9e97 100644 --- a/deal.II/examples/step-14/step-14.cc +++ b/deal.II/examples/step-14/step-14.cc @@ -543,7 +543,7 @@ namespace Step14 typename DoFHandler::active_cell_iterator active_cell_iterator; - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); std::vector > thread_ranges = Threads::split_range (dof_handler.begin_active (), @@ -2329,7 +2329,7 @@ namespace Step14 // Now start a number of threads which compute the error formula on // parts of all the cells, and once they are all started wait until they // have all finished: - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); Threads::ThreadGroup<> threads; for (unsigned int i=0; i::estimate_some, diff --git a/deal.II/examples/step-17/step-17.cc b/deal.II/examples/step-17/step-17.cc index cf4745d3f7..9f072eea35 100644 --- a/deal.II/examples/step-17/step-17.cc +++ b/deal.II/examples/step-17/step-17.cc @@ -780,7 +780,7 @@ namespace Step17 local_error_per_cell, ComponentMask(), 0, - multithread_info.n_default_threads, + multithread_info.n_threads(), this_mpi_process); // Now all processes have computed error indicators for their own cells diff --git a/deal.II/examples/step-18/step-18.cc b/deal.II/examples/step-18/step-18.cc index 46a8ed4e53..f587d740be 100644 --- a/deal.II/examples/step-18/step-18.cc +++ b/deal.II/examples/step-18/step-18.cc @@ -1627,7 +1627,7 @@ namespace Step18 error_per_cell, ComponentMask(), 0, - multithread_info.n_default_threads, + multithread_info.n_threads(), this_mpi_process); // Then set up a global vector into which we merge the local indicators diff --git a/deal.II/examples/step-9/step-9.cc b/deal.II/examples/step-9/step-9.cc index e95c474a59..82a9af49df 100644 --- a/deal.II/examples/step-9/step-9.cc +++ b/deal.II/examples/step-9/step-9.cc @@ -520,17 +520,13 @@ namespace Step9 // configured for multithreading, then the number of CPUs is set to one.) // However, sometimes there might be reasons to use another value. For // example, you might want to use less processors than there are in your - // system in order not to use too many computational resources. On the - // other hand, if there are several jobs running on a computer and you - // want to get a higher percentage of CPU time, it might be worth to start - // more threads than there are CPUs, as most operating systems assign - // roughly the same CPU resources to all threads presently running. For - // this reason, the MultithreadInfo class contains a - // read-write variable n_default_threads which is set to - // n_cpus by default, but can be set to another value. This - // variable is also queried by functions inside the library to determine + // system in order not to use too many computational resources. For + // this reason, the number of threads can be set by + // MultithreadInfo::set_thread_limit and the current value + // is returned by n_threads(). This + // is also queried by functions inside the library to determine // how many threads they shall create. - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); // It is worth noting, however, that this setup determines the load // distribution onto processor in a static way: it does not take into // account that some other part of our program may also be running @@ -1004,7 +1000,7 @@ namespace Step9 // as we have used the function Threads::split_range when // assembling above, there is a function that computes intervals of // roughly equal size from a larger interval. This is used here: - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); std::vector index_intervals = Threads::split_interval (0, dof_handler.get_tria().n_active_cells(), n_threads); @@ -1038,7 +1034,7 @@ namespace Step9 // finish their work: threads.join_all (); // Note that if the value of the variable - // multithread_info.n_default_threads was one, or if the + // multithread_info.n_threads() was one, or if the // library was not configured to use threads, then the sequence of // commands above reduced to a complicated way to simply call the // estimate_interval function with the whole range of cells