From 76228adc8969f2013578919d5c117416ed982438 Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Tue, 10 Jul 2012 15:35:40 +0200 Subject: [PATCH 1/5] the readme talks about eda rather than eda_sa, less simple --- edo/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/edo/README b/edo/README index 5b814b15..4217a844 100644 --- a/edo/README +++ b/edo/README @@ -33,11 +33,11 @@ In the edo/build/ directory: (Unix) > ctest Windows users, please refer to this tutorial: http://paradiseo.gforge.inria.fr/index.php?n=Paradiseo.VisualCTutorial -In the directory "application", there are several directory such as eda_sa which instantiate EDA-SA solver. +In the directory "application", there are several directory such as eda which instantiate EDA solver. -(Unix) After compilation you can run the binary "build/eda_sa" and see results. Parameters can be modified from command line. +(Unix) After compilation you can run the binary "build/eda" and see results. Parameters can be modified from command line. -(Windows) Add argument "eda_sa.param" and execute the corresponding algorithms. +(Windows) Add argument "eda.param" and execute the corresponding algorithms. Windows users, please refer to this tutorial: http://paradiseo.gforge.inria.fr/index.php?n=Paradiseo.VisualCTutorial From 144eb30bf9ca6f7e2c19af203fcb6f167261e42b Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Tue, 10 Jul 2012 15:36:02 +0200 Subject: [PATCH 2/5] NEWS file for EDO --- edo/NEWS | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 edo/NEWS diff --git a/edo/NEWS b/edo/NEWS new file mode 100644 index 00000000..caed8140 --- /dev/null +++ b/edo/NEWS @@ -0,0 +1,8 @@ +* current release + - alternative implementation of the multi-normal operators using the Eigen3 library + +* release 0.0 (2011-09-15) + - basic design for estimation of distribution algorithms and, more generally for randomized search heuristics + - continuous EDA example + - EDA using multi-normal distribution, implementation using the boost::ublas library + From 6cb15cfecffafc53716974dcd87f0e8b4bc1a116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Jean=20David=20Arjanen?= Date: Mon, 16 Jul 2012 14:18:22 +0200 Subject: [PATCH 3/5] bugfix: Windows compatibility of 'apply' and 'eoEvalUserTimeThrowException' --- eo/NEWS | 1 + eo/src/apply.h | 12 ++++++ eo/src/eoEvalUserTimeThrowException.h | 59 ++++++++++++++++++++++----- 3 files changed, 62 insertions(+), 10 deletions(-) diff --git a/eo/NEWS b/eo/NEWS index f4625d6c..28b25cb4 100644 --- a/eo/NEWS +++ b/eo/NEWS @@ -1,4 +1,5 @@ * current version + - fixed compilation issues in Microsoft Visual C++ * release 1.2 (16. May. 2011) - fixed the incremental allocation issue in variation operators which were diff --git a/eo/src/apply.h b/eo/src/apply.h index 01256e05..bbd30aa3 100644 --- a/eo/src/apply.h +++ b/eo/src/apply.h @@ -58,14 +58,26 @@ void apply(eoUF& _proc, std::vector& _pop) if (!eo::parallel.isDynamic()) { #pragma omp parallel for if(eo::parallel.isEnabled()) //default(none) shared(_proc, _pop, size) +#ifdef _MSC_VER + //Visual Studio supports only OpenMP version 2.0 in which + //an index variable must be of a signed integral type + for (long long i = 0; i < size; ++i) { _proc(_pop[i]); } +#else // _MSC_VER for (size_t i = 0; i < size; ++i) { _proc(_pop[i]); } +#endif } else { #pragma omp parallel for schedule(dynamic) if(eo::parallel.isEnabled()) +#ifdef _MSC_VER + //Visual Studio supports only OpenMP version 2.0 in which + //an index variable must be of a signed integral type + for (long long i = 0; i < size; ++i) { _proc(_pop[i]); } +#else // _MSC_VER //doesnot work with gcc 4.1.2 //default(none) shared(_proc, _pop, size) for (size_t i = 0; i < size; ++i) { _proc(_pop[i]); } +#endif } if ( eo::parallel.enableResults() ) diff --git a/eo/src/eoEvalUserTimeThrowException.h b/eo/src/eoEvalUserTimeThrowException.h index 87e47ac5..f24a246a 100644 --- a/eo/src/eoEvalUserTimeThrowException.h +++ b/eo/src/eoEvalUserTimeThrowException.h @@ -21,27 +21,30 @@ Authors: Johann Dréo */ -#ifndef __unix__ -#warning "Warning: class 'eoEvalUserTimeThrowException' is only available under UNIX systems (defining 'rusage' in 'sys/resource.h'), contributions for other systems are welcomed." -#else +#if !defined(__unix__) && !defined(_WINDOWS) +#warning "Warning: class 'eoEvalUserTimeThrowException' is only available under UNIX (defining 'rusage' in 'sys/resource.h') or Win32 (defining 'GetProcessTimes' in 'WinBase.h') systems, contributions for other systems are welcomed." +#else //!defined(__unix__) && !defined(_WINDOWS) #ifndef __EOEVALUSERTIMETHROWEXCEPTION_H__ #define __EOEVALUSERTIMETHROWEXCEPTION_H__ -#include -#include - -#include - /** Check at each evaluation if a given CPU user time contract has been reached. * * Throw an eoMaxTimeException if the given max time has been reached. * Usefull if you want to end the search independently of generations. - * This class uses (almost-)POSIX headers. + * This class uses (almost-)POSIX or Win32 headers, depending on the platform. * It uses a computation of the user time used on the CPU. For a wallclock time measure, see eoEvalTimeThrowException * * @ingroup Evaluation */ + +#include + +#ifdef __unix__ + +#include +#include + template< class EOT > class eoEvalUserTimeThrowException : public eoEvalFuncCounter< EOT > { @@ -68,5 +71,41 @@ protected: struct rusage _usage; }; +#else +#ifdef _WINDOWS +//here _WINDOWS is defined + +#include + +template< class EOT > +class eoEvalUserTimeThrowException : public eoEvalFuncCounter< EOT > +{ +public: + eoEvalUserTimeThrowException( eoEvalFunc & func, const long max ) : eoEvalFuncCounter( func, "CPU-user"), _max(max) {} + + virtual void operator() ( EOT & eo ) + { + if( eo.invalid() ) { + FILETIME dummy; + GetProcessTimes(GetCurrentProcess(), &dummy, &dummy, &dummy, &_usage); + + ULARGE_INTEGER current; + current.LowPart = _usage.dwLowDateTime; + current.HighPart = _usage.dwHighDateTime; + if( current.QuadPart >= _max ) { + throw eoMaxTimeException( current.QuadPart ); + } else { + func(eo); + } + } + } + +protected: + const long _max; + FILETIME _usage; +}; + +#endif // _WINDOWS +#endif //__unix__ #endif // __EOEVALUSERTIMETHROWEXCEPTION_H__ -#endif // __UNIX__ +#endif //!defined(__unix__) && !defined(_WINDOWS) From 018107544b67ca9ddb4e6e88e4fbc11772835108 Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Mon, 16 Jul 2012 14:46:27 +0200 Subject: [PATCH 4/5] update the NEWS --- eo/NEWS | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/eo/NEWS b/eo/NEWS index 28b25cb4..369682af 100644 --- a/eo/NEWS +++ b/eo/NEWS @@ -1,5 +1,22 @@ * current version - - fixed compilation issues in Microsoft Visual C++ + - features: + - delete the deprecated code parts (was marked as deprecated in the release 1.1) + - eoSignal: a class to handle signal with eoCheckpoint instances + - eoDetSingleBitFlip: bit flip mutation that changes exactly k bits while checking for duplicate + - eoFunctorStat: a wrapper to turn any stand-alone function and into an eoStat + - generilazed the output of an eoState: now you can change the format, comes with defaults formatting (latex and json) + - eoWrongParamTypeException: a new exception to handle cases where a wrong template is given to eoParser::valueOf + - added a getParam method to the eoParser, that raise an exception if the parameter has not been declared + - eoParserLogger features are now included in the default eoParser + - build system: + - improvements of the build architecture + - create PKGBUILD file for archlinux package manager + - a FindEO module for CMake + - bugfixes: + - fixed regression with gcc 4.7 + - fixed compilation issues in Microsoft Visual C++, related to time measurement + - added several asserts accross the framework (note: asserts are included only in debug mode) + - lot of small bugfixes :-) * release 1.2 (16. May. 2011) - fixed the incremental allocation issue in variation operators which were @@ -21,11 +38,11 @@ - GCC 4.3 compatibility - new versatile log system with several nested verbose levels - classes using intern verbose parameters marked as deprecated, please update your code accordingly if you use one of the following files: - eo/src/eoCombinedInit.h - eo/src/eoGenContinue.h - eo/src/eoProportionalCombinedOp.h - eo/src/utils/eoData.h - eo/src/utils/eoStdoutMonitor.h + eo/src/eoCombinedInit.h + eo/src/eoGenContinue.h + eo/src/eoProportionalCombinedOp.h + eo/src/utils/eoData.h + eo/src/utils/eoStdoutMonitor.h - an evaluator that throw an exception if a maximum eval numbers has been reached, independently of the number of generations - new monitor that can write on any ostream - new continuator that can catch POSIX system user signals From 3cdde2498c7ce74dc4b418aca7a59a3311ebd452 Mon Sep 17 00:00:00 2001 From: Caner Candan Date: Tue, 17 Jul 2012 11:42:49 +0200 Subject: [PATCH 5/5] * eoEvalUserTimeThrowException.h: gcc regression fixed --- eo/src/eoEvalUserTimeThrowException.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo/src/eoEvalUserTimeThrowException.h b/eo/src/eoEvalUserTimeThrowException.h index 87e47ac5..ed0145de 100644 --- a/eo/src/eoEvalUserTimeThrowException.h +++ b/eo/src/eoEvalUserTimeThrowException.h @@ -58,7 +58,7 @@ public: if( current >= _max ) { throw eoMaxTimeException( current ); } else { - func(eo); + this->func(eo); } } }