* eoParallel: added the parameter enableResults
This commit is contained in:
parent
a911c98f64
commit
85d02cbdb3
3 changed files with 11 additions and 3 deletions
|
|
@ -61,8 +61,11 @@ void apply(eoUF<EOT&, void>& _proc, std::vector<EOT>& _pop)
|
||||||
|
|
||||||
double t2 = omp_get_wtime();
|
double t2 = omp_get_wtime();
|
||||||
|
|
||||||
eoLogger log;
|
if ( eo::parallel.enableResults() )
|
||||||
log << eo::file(eo::parallel.prefix()) << t2 - t1 << ' ';
|
{
|
||||||
|
eoLogger log;
|
||||||
|
log << eo::file(eo::parallel.prefix()) << t2 - t1 << ' ';
|
||||||
|
}
|
||||||
|
|
||||||
#else // _OPENMP
|
#else // _OPENMP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,8 @@ eoParallel::eoParallel() :
|
||||||
_isEnabled( false, "parallelize-loop", "Enable memory shared parallelization into evaluation's loops", '\0' ),
|
_isEnabled( false, "parallelize-loop", "Enable memory shared parallelization into evaluation's loops", '\0' ),
|
||||||
_isDynamic( false, "parallelize-dynamic", "Enable dynamic memory shared parallelization", '\0' ),
|
_isDynamic( false, "parallelize-dynamic", "Enable dynamic memory shared parallelization", '\0' ),
|
||||||
_prefix( "results", "parallelize-prefix", "Here's the prefix filename where the results are going to be stored", '\0' ),
|
_prefix( "results", "parallelize-prefix", "Here's the prefix filename where the results are going to be stored", '\0' ),
|
||||||
_nthreads( 0, "parallelize-nthreads", "Define the number of threads you want to use, nthreads = 0 means you want to use all threads available", '\0' )
|
_nthreads( 0, "parallelize-nthreads", "Define the number of threads you want to use, nthreads = 0 means you want to use all threads available", '\0' ),
|
||||||
|
_enableResults( false, "parallelize-enable-results", "Enable the generation of results", '\0' )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
std::string eoParallel::className() const
|
std::string eoParallel::className() const
|
||||||
|
|
@ -71,6 +72,7 @@ void eoParallel::_createParameters( eoParser& parser )
|
||||||
parser.processParam( _isDynamic, section );
|
parser.processParam( _isDynamic, section );
|
||||||
parser.processParam( _prefix, section );
|
parser.processParam( _prefix, section );
|
||||||
parser.processParam( _nthreads, section );
|
parser.processParam( _nthreads, section );
|
||||||
|
parser.processParam( _enableResults, section );
|
||||||
}
|
}
|
||||||
|
|
||||||
void make_parallel(eoParser& parser)
|
void make_parallel(eoParser& parser)
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,8 @@ public:
|
||||||
|
|
||||||
inline unsigned int nthreads() const { return _nthreads.value(); }
|
inline unsigned int nthreads() const { return _nthreads.value(); }
|
||||||
|
|
||||||
|
inline bool enableResults() const { return _enableResults.value(); }
|
||||||
|
|
||||||
friend void make_parallel(eoParser&);
|
friend void make_parallel(eoParser&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -64,6 +66,7 @@ private:
|
||||||
eoValueParam<bool> _isDynamic;
|
eoValueParam<bool> _isDynamic;
|
||||||
eoValueParam<std::string> _prefix;
|
eoValueParam<std::string> _prefix;
|
||||||
eoValueParam<unsigned int> _nthreads;
|
eoValueParam<unsigned int> _nthreads;
|
||||||
|
eoValueParam<bool> _enableResults;
|
||||||
};
|
};
|
||||||
|
|
||||||
void make_parallel(eoParser&);
|
void make_parallel(eoParser&);
|
||||||
|
|
|
||||||
Reference in a new issue