* eoParallel: added the call to omp_set_num_threads to define the number of threads with parameters
This commit is contained in:
parent
534b8a73ad
commit
2044d92eff
3 changed files with 22 additions and 2 deletions
|
|
@ -2,6 +2,8 @@
|
|||
// t-eoParallel.cpp
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <omp.h>
|
||||
|
||||
#include <eo>
|
||||
#include <es/make_real.h>
|
||||
//#include <apply.h>
|
||||
|
|
@ -40,6 +42,14 @@ int main(int ac, char** av)
|
|||
|
||||
eo::log << eo::quiet << "DONE!" << std::endl;
|
||||
|
||||
#pragma omp parallel
|
||||
{
|
||||
if ( 0 == omp_get_thread_num() )
|
||||
{
|
||||
eo::log << "num of threads: " << omp_get_num_threads() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue