Merge branch 'master' into openmp
This commit is contained in:
commit
534b8a73ad
90 changed files with 7670 additions and 12 deletions
|
|
@ -65,6 +65,9 @@ INCLUDE(Dart OPTIONNAL)
|
|||
# now create config headers
|
||||
CONFIGURE_FILE(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
|
||||
# now create config install_symlink script file
|
||||
CONFIGURE_FILE(install_symlink.py.cmake ${CMAKE_CURRENT_BINARY_DIR}/install_symlink.py)
|
||||
|
||||
# Set a special flag if the environment is windows (should do the same in a config.g file)
|
||||
IF (WIN32)
|
||||
ADD_DEFINITIONS(-D_WINDOWS=1)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
mkdir debug
|
||||
mkdir -p debug
|
||||
cd debug
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug ..
|
||||
make
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
mkdir release
|
||||
mkdir -p release
|
||||
cd release
|
||||
cmake ..
|
||||
make
|
||||
|
|
|
|||
52
eo/install_symlink.py.cmake
Executable file
52
eo/install_symlink.py.cmake
Executable file
|
|
@ -0,0 +1,52 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
#NAME = "@PROJECT_NAME@"
|
||||
NAME = "eo"
|
||||
SOURCE = "@CMAKE_SOURCE_DIR@"
|
||||
BINARY = "@CMAKE_BINARY_DIR@"
|
||||
PREFIX = "/usr"
|
||||
|
||||
DATA = {
|
||||
'dirs': [ "%s/share/%s" % (PREFIX, NAME) ],
|
||||
'links': [ ("%s/src" % SOURCE, "%s/include/%s" % (PREFIX, NAME)),
|
||||
("%s/doc" % BINARY, "%s/share/%s/doc" % (PREFIX, NAME)),
|
||||
("%s/%s.pc" % (BINARY, NAME), "%s/lib/pkgconfig/%s.pc" % (PREFIX, NAME)),
|
||||
]
|
||||
}
|
||||
|
||||
LIBRARIES = ["libcma.a", "libeo.a", "libeoutils.a", "libes.a", "libga.a"]
|
||||
DATA['links'] += [ ("%s/lib/%s" % (BINARY, lib), "%s/lib/%s" % (PREFIX, lib)) for lib in LIBRARIES ]
|
||||
|
||||
import os, sys
|
||||
|
||||
def isroot():
|
||||
if os.getuid() != 0:
|
||||
print '[WARNING] you have to be root'
|
||||
return False
|
||||
return True
|
||||
|
||||
def uninstall():
|
||||
for dummy, link in DATA['links']: os.remove(link)
|
||||
for dirname in DATA['dirs']: os.rmdir(dirname)
|
||||
print 'All symlinks have been removed.'
|
||||
|
||||
def install():
|
||||
for dirname in DATA['dirs']: os.mkdir(dirname)
|
||||
for src, dst in DATA['links']: os.symlink(src, dst)
|
||||
print 'All symlinks have been installed.'
|
||||
|
||||
def data():
|
||||
from pprint import pprint
|
||||
pprint(DATA, width=200)
|
||||
|
||||
if __name__ == '__main__':
|
||||
if not isroot():
|
||||
sys.exit()
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print 'Usage: %s [install|uninstall|data]' % sys.argv[0]
|
||||
sys.exit()
|
||||
|
||||
if sys.argv[1] == 'install': install()
|
||||
elif sys.argv[1] == 'uninstall': uninstall()
|
||||
elif sys.argv[1] == 'data': data()
|
||||
|
|
@ -264,13 +264,13 @@ public:
|
|||
|
||||
// eoDualStatSwitch( eoStat<EOT,T> & stat_feasible, eoStat<EOT,T> & stat_unfeasible, std::string sep=" " ) :
|
||||
eoDualStatSwitch( EOSTAT & stat_feasible, EOSTAT & stat_unfeasible, std::string sep=" " ) :
|
||||
_stat_feasible(stat_feasible),
|
||||
_stat_unfeasible(stat_unfeasible),
|
||||
_sep(sep),
|
||||
eoStat<EOT,std::string>(
|
||||
"?"+sep+"?",
|
||||
stat_feasible.longName()+sep+stat_unfeasible.longName()
|
||||
)
|
||||
),
|
||||
_stat_feasible(stat_feasible),
|
||||
_stat_unfeasible(stat_unfeasible),
|
||||
_sep(sep)
|
||||
{ }
|
||||
|
||||
virtual void operator()( const eoPop<EOT> & pop )
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ template< class EOT >
|
|||
class eoEvalUserTimeThrowException : public eoEvalFuncCounter< EOT >
|
||||
{
|
||||
public:
|
||||
eoEvalUserTimeThrowException( eoEvalFunc<EOT> & func, long max ) : _max(max), eoEvalFuncCounter<EOT>( func, "CPU-user") {}
|
||||
eoEvalUserTimeThrowException( eoEvalFunc<EOT> & func, const long max ) : eoEvalFuncCounter<EOT>( func, "CPU-user"), _max(max) {}
|
||||
|
||||
virtual void operator() ( EOT & eo )
|
||||
{
|
||||
|
|
@ -47,8 +47,9 @@ public:
|
|||
|
||||
getrusage(RUSAGE_SELF,&_usage);
|
||||
|
||||
if( _usage.ru_utime.tv_sec >= _max ) {
|
||||
throw eoMaxTimeException( _usage.ru_utime.tv_sec );
|
||||
long current = _usage.ru_utime.tv_sec;
|
||||
if( current >= _max ) {
|
||||
throw eoMaxTimeException( current );
|
||||
} else {
|
||||
func(eo);
|
||||
}
|
||||
|
|
@ -56,6 +57,6 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
long _max;
|
||||
const long _max;
|
||||
struct rusage _usage;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public:
|
|||
virtual const char* what() const throw()
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << "STOP in eoMaxTimeException: the maximum number of wallclock seconds has been reached (" << _elapsed << ").";
|
||||
ss << "STOP in eoMaxTimeException: the maximum number of allowed seconds has been reached (" << _elapsed << ").";
|
||||
return ss.str().c_str();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
// EO includes
|
||||
#include <eoPop.h> // eoPop
|
||||
#include <eoFunctor.h> // eoMerge
|
||||
#include <utils/eoLogger.h>
|
||||
|
||||
/**
|
||||
* eoMerge: Base class for elitist replacement algorithms.
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@ public:
|
|||
/** Do the job: simple loop over the offspring */
|
||||
void operator()(eoPop<EOT> & _parents, eoPop<EOT> & _offspring)
|
||||
{
|
||||
apply<EOT>(eval, _offspring);
|
||||
(void)_parents;
|
||||
apply<EOT>(eval, _offspring);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include <eoPop.h> // eoPop
|
||||
#include <eoFunctor.h> // eoReduce
|
||||
#include <utils/selectors.h>
|
||||
#include <utils/eoLogger.h>
|
||||
|
||||
/**
|
||||
* eoReduce: .reduce the new generation to the specified size
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ public :
|
|||
eoOStreamMonitor( std::ostream & _out, bool _verbose=true, std::string _delim = "\t", unsigned int _width=20, char _fill=' ' ) :
|
||||
out(_out), delim(_delim), width(_width), fill(_fill), firsttime(true)
|
||||
{
|
||||
(void)_verbose;
|
||||
eo::log << eo::warnings << "WARNING: the use of the verbose parameter in eoOStreamMonitor constructor is deprecated and will be removed in the next release" << std::endl;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue