Mentions légales du service

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • rouzaudc/aevol
  • aevol/aevol
  • tgrohens/aevol
  • mfoley/aevol
  • jluisell/aevol
  • jluisell/aevol-eukaryotes
  • rouzaudc/aevol-asyncgarbage
  • elie.dumont/aevol
8 results
Show changes
Commits on Source (93)
Showing
with 7626 additions and 281 deletions
......@@ -30,6 +30,11 @@ src/post_treatments/aevol_misc_template
src/post_treatments/aevol_misc_view_generation
*.o
# ignore build dir
build/**
# ignore .idea dir (clion config)
.idea/**
# ignore the files that are generated from the user guide source
doc/user_guide/user_manual.aux
......@@ -41,11 +46,12 @@ doc/user_guide/user_manual.toc
# ignore performance records
perf.data*
# ignore example generated files
# i.e. ignore everything under examples directory
examples/*/**
# but consider param.in files
!examples/**/param.in
!examples/**/README
#ignore the tmp dir
tmp/**
cmake_minimum_required(VERSION 3.2)
project(aevol_regul)
# ============================================================================
# Require minimal version of cmake
# ============================================================================
cmake_minimum_required(VERSION 3.0.2)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(aevol_regul ${SOURCE_FILES} src/libaevol/HabitatFactory.cpp src/libaevol/HabitatFactory.h)
# ============================================================================
# Set project name and languages
# ============================================================================
project(aevol VERSION 5.0 LANGUAGES C CXX)
add_definitions(-DVERSION="${PROJECT_VERSION}")
# Temporary stuff to be fully integrated into CMake
add_definitions(-DSFMT_MEXP=607)
add_definitions(-D__X11)
add_definitions(-DDEBUG)
FIND_PACKAGE ( X11 REQUIRED )
IF ( X11_FOUND )
INCLUDE_DIRECTORIES ( ${X11_INCLUDE_DIR} )
LINK_LIBRARIES ( ${X11_LIBRARIES} )
ENDIF ( X11_FOUND )
# ============================================================================
# Get GNU standard installation directories (GNUInstallDirs module)
# ============================================================================
include(GNUInstallDirs)
# ============================================================================
# Tell CMake where to look for custom modules
# ============================================================================
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# ============================================================================
# Tell cmake where to put binary files.
# By GNU standards "executable programs that users can run" should go in
# bindir a.k.a ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}
# and "executable programs to be run by other programs rather than by users"
# in libexecdir a.k.a ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}
# ============================================================================
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
# ============================================================================
# Set build type specific compilation flags
# ============================================================================
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g")
# ============================================================================
# Tell cmake about subdirectories to look into
# ============================================================================
add_subdirectory(src)
# ============================================================================
# Adds the 'dist' target (that will use CPack)
# ============================================================================
#add_custom_target(dist COMMAND ${CMAKE_BUILD_TOOL} package_source)
# ============================================================================
# Add the 'uninstall' target (uses a custom script)
# ============================================================================
configure_file(
"${PROJECT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake)
......@@ -22,9 +22,6 @@ AC_CONFIG_MACRO_DIR([m4])
# We want to use automake
AM_INIT_AUTOMAKE
# Define C++ compilator
AC_PROG_CXX([gcc,icc])
# Detect C++11 or C++14
AX_CXX_COMPILE_STDCXX_14([noext],[optional])
AX_CXX_COMPILE_STDCXX_11([noext])
......@@ -48,6 +45,11 @@ AM_PROG_CC_C_O
# Print warning if openmp not found
AC_CHECK_HEADER([omp.h], , [AC_MSG_WARN([openmp not found - continuing without openmp support])])
# Check for boost
AX_BOOST_BASE([1.55],, [AC_MSG_ERROR([boost not found, please check that you have boost installed on your system and retry])])
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
# Initialize configure-time defined flags
AC_SUBST(AEVOLCPPFLAGS, "") # C PreProcessor flags
AC_SUBST(AEVOLCXXFLAGS, "$OPENMP_CXXFLAGS") # C++ Compile flags
......
......@@ -5,10 +5,14 @@ RELEASE HowTo
-> in all the manpages (update date too)
-> in the user guide (if needed)
2) Write an entry in the NEWS file
2) Write an entry in the NEWS file for users
and in ChangeLog for developers.
3) [TEMPORAIRE tant que les tests sont quasi inexistants]
-> Virer les tests
3) [TEMPRORARY as long as tests are scarce]
-> Remove tests directories
-> Remove references to tests in configure.ac, src/Makefile.am
3') Clean up examples: remove all computed data files
4) Run the following commands (from aevol root dir)
-> autoreconf
......@@ -17,7 +21,6 @@ RELEASE HowTo
This will generate a file called aevol-X.Y.tar.gz in aevol root dir
5) Add a version in the "files" section of the forge
-> In the "files" section click on the link to "create a new version"
-> Fill in the form with
......
./"test with man -l <file>
.TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual"
.TH AEVOL "1" "May 2016" "aevol 5.0" "User Manual"
.SH NAME
aevol \- an in silico experimental evolution platform
Aevol \- an in silico experimental evolution platform
.SH SYNOPSIS
.B aevol_create \-h
or
......@@ -11,14 +11,14 @@ or
or
.B \-\-version
.br
.B aevol_create \fR[\fB\-v\fR] \fR[\fB\-f\fI PARAM_FILE\fR] \fR[\fB\-o\fI OUTDIR\fR] \fR[\fB\-c\fI CFILE\fR] \fR[\fB\-p\fI PFILE\fR]
.B aevol_create \fR[\fB\-f\fI PARAM_FILE\fR] \fR[\fB\-C\fI CHROM_FILE\fR] \fR[\fB\-p\fI PLASMID_FILE\fR]
.SH DESCRIPTION
.B Aevol
is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome.
.TP
.B aevol_create
create an experiment with setup as specified in
.I param_file
.I PARAM_FILE
.SH OPTIONS
.TP
.B \-h, \-\-help
......@@ -32,19 +32,15 @@ print version number, then exit
.br
specify parameter file (default: param.in)
.HP
.B \-o, \-\-out
.I OUTDIR
.br
specify output directory (default "./")
.HP
.B \-c, \-\-chromosome
.I CFILE
.B \-C, \-\-chromosome
.I CHROM_FILE
.br
load chromosome from given text file instead of generating it
.HP
.B \-p, \-\-plasmid
.I PFILE
.B \-P, \-\-plasmid
.I PLASMID_FILE
.br
load plasmid from given text file instead of generating it (params must allow plasmids)
load plasmid from given text file instead of generating it
.SH "SEE ALSO"
.B aevol_run, aevol_modify, aevol_propagate
./"test with man -l <file>
.TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual"
.TH AEVOL "1" "May 2016" "aevol 5.0" "User Manual"
.SH NAME
aevol \- an in silico experimental evolution platform
Aevol \- an in silico experimental evolution platform
.SH SYNOPSIS
.B aevol_modify \-h
or
......@@ -11,14 +11,14 @@ or
or
.B \-\-version
.br
.B aevol_modify \-g\fI GENER \fR[\fB\-f\fI param_file\fR]
.B aevol_modify \fR[\fB\-T\fI TIMESTEP\fR] \fR[\fB\-F\fI PARAM_FILE\fR]
.SH DESCRIPTION
.B Aevol
is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome.
.TP
.B aevol_modify
modify an experiment as specified in
.I param_file
.I PARAM_FILE
.SH OPTIONS
.TP
.B \-h, \-\-help
......@@ -27,13 +27,13 @@ print help, then exit
.B \-V, \-\-version
print version number, then exit
.HP
.B \-g, \-\-gener
.I GENER
.B \-t, \-\-timestep
.I TIMESTEP
.br
specify generation number
specify timestep
.HP
.B \-f, \-\-file
.I param_file
.I PARAM_FILE
.br
specify parameter file (default: param.in)
.SH "SEE ALSO"
......
\"test with man -l <file>
.TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual"
./"test with man -l <file>
.TH AEVOL "1" "May 2016" "aevol 5.0" "User Manual"
.SH NAME
aevol \- an in silico experimental evolution platform
Aevol \- an in silico experimental evolution platform
.SH SYNOPSIS
.B aevol_propagate \-h
or
......@@ -11,15 +11,13 @@ or
or
.B \-\-version
.br
.B aevol_propagate \fR[\fB\-v\fR] \fR[\fB\-g\fI GENER\fR] \fR[\fB\-i\fI INDIR\fR] \fR[\fB\-o\fI OUTDIR\fR] \fR[\fB\-S\fI GENERALSEED\fR]
.br
.B aevol_propagate \fR[\fB\-v\fR] \fR[\fB\-g\fI GENER\fR] \fR[\fB\-i\fI INDIR\fR] \fR[\fB\-o\fI OUTDIR\fR] \fR[\fB\-s\fI SELSEED\fR] \fR[\fB\-m\fI MUTSEED\fR] \fR[\fB\-t\fI STOCHSEED\fR] \fR[\fB\-e\fI ENVVARSEED\fR] \fR[\fB\-n\fI ENVNOISESEED\fR]
.B aevol_propagate \fR[\fB\-t\fI TIMESTEP\fR] \fR[\fB\-K\fR] \fR[\fB\-o\fI OUTDIR\fR] \fR[\fB\-v\fR]
.SH DESCRIPTION
.B Aevol
is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome.
.TP
.B aevol_propagate
creates a fresh copy of the experiment as it was at the given generation. The generation number of the copy will be reset to 0. If you use aevol_propagate repeatedly to initialize several simulations, you should specify a different seed for each simulation, otherwise all simulations will yield exactly the same results. You can use the option -S to do so. In this case, the random drawings will be different for all random processes enabled in your simulations (mutations, stochastic gene expression, selection, migration, environmental variation, environmental noise). Alternatively, to change the random drawings for specific random processes only, do not use -S but the options -m, -s, -t, -e, -n (see below).
creates a fresh copy of the experiment as it was at the given timestep. The timestep of the copy will be reset to 0.
.SH OPTIONS
.TP
.B \-h, \-\-help
......@@ -27,54 +25,26 @@ print help, then exit
.TP
.B \-V, \-\-version
print version number, then exit
.TP
.B \-v, \-\-verbose
be verbose
.HP
.B \-g, \-\-gener
.I GENER
.B \-t, \-\-timestep
.I TIMESTEP
.br
specify generation number
(default: that contained in file last_gener.txt, if any)
.HP
.B \-i, \-\-in
.I INDIR
specify timestep to propagate
.br
specify input directory (default ".")
default: that contained in file last_gener.txt, if any
.TP
.B \-K, \-\-keep-prng-st
.br
do not alter prng states
.HP
.B \-o, \-\-out
.I OUTDIR
.br
specify output directory (default "./output")
.HP
.B \-S, \-\-general\-seed
.I GENERALSEED
specify output directory
.br
specify an integer to be used as a seed for random numbers. If you use aevol_propagate repeatedly to initialize several simulations, you should specify a different seed for each simulation, otherwise all simulations will yield exactly the same results. If you specify this general seed, random drawings will be different for all random processes enabled in your simulations (mutations, stochastic gene expression, selection, migration, environmental variation, environmental noise). To change the random drawings for a specific random process only, do not use -S but the options below.
.HP
.B \-s, \-\-sel\-seed
.I SELSEED
.br
specify an integer as a seed for random numbers needed for selection and migration (if spatial structure is enabled).
.HP
.B \-m, \-\-mut\-seed
.I MUTSEED
.br
specify an integer as a seed for random numbers needed for mutations.
.HP
.B \-t, \-\-stoch\-seed
.I STOCHSEED
.br
specify an integer as a seed for random numbers needed for stochastic gene expression.
.HP
.B \-e, \-\-env\-var\-seed
.I ENVVARSEED
.br
specify an integer as a seed for random numbers needed for environmental variation.
.HP
.B \-n, \-\-env\-noise\-seed
.I ENVNOISESEED
.br
specify an integer as a seed for random numbers needed for environmental noise.
default "./output"
.TP
.B \-v, \-\-verbose
be verbose
.SH "SEE ALSO"
.B aevol_create, aevol_run, aevol_modify
./"test with man -l <file>
.TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual"
.TH AEVOL "1" "May 2016" "aevol 5.0" "User Manual"
.SH NAME
aevol \- an in silico experimental evolution platform
Aevol \- an in silico experimental evolution platform
.SH SYNOPSIS
.B aevol_run \-h
|
......@@ -11,7 +11,7 @@ aevol \- an in silico experimental evolution platform
|
.B \-\-version
.br
.B aevol_run \fR[\fB\-r\fI GENER\fR] \fR[\fB\-n\fI NB_GENER\fR] \fR[\fB\-tvwx\fR]
.B aevol_run \fR[\fB\-b\fI TIMESTEP\fR] \fR[\fB\-e\fI TIMESTEP\fR | \fB\-n\fI NB_TIMESTEP\fR] \fR[\fB\-p\fI NB_THREADS\fR] \fR[\fB\-vwx\fR]
.SH DESCRIPTION
.B Aevol
is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome.
......@@ -26,18 +26,24 @@ print help, then exit
.B \-V, \-\-version
print version number, then exit
.HP
.B \-r, \-\-resume
.I GENER
.B \-b, \-\-begin
.I TIMESTEP
.br
specify generation to resume simulation at (default 0)
specify time t0 to resume simulation at (default read in last_gener.txt)
.HP
.B \-n, \-\-nbgener
.I NB_GENER
.B \-e, \-\-end
.I TIMESTEP
.br
specify number of generations to be run (default 1000)
specify time of the end of the simulation
.HP
.B \-n, \-\-nb-timesteps
.I NB_TIMESTEPS
.br
specify number of timesteps to be simulated (default 1000)
.TP
.B \-t, \-\-text
use text files instead of binary files when possible
.B \-p, \-\-parallel
.I NB_THREADS
run on NB_THREADS threads (use -1 for system default)
.TP
.B \-v, \-\-verbose
be verbose
......
This diff is collapsed.
doc/dev/include/link.png

189 B

/* General CSS */
body {
background-color: #fff;
color: #333;
font-family: sans-serif;
font-size: 10pt;
margin-right: 100px;
margin-left: 100px;
}
h1 {
text-align: center;
font-size: 18pt;
}
h1, h2, h3, h4, h5, h6 {
color: #06c;
margin-top: 2em;
margin-bottom: 1em;
padding: 25px;
font-weight:bold;
}
h2,
h3,
h4,
h5,
h6 {
margin-top:1.5em;
margin-bottom:.75em;
}
h1 {font-size:200%;}
h2 {font-size:167%;}
h3 {font-size:133%;}
h4 {font-size:120%;}
h5 {font-size:110%;}
table {
border: 1px solid #bbb;
border-spacing: 0;
border-collapse: collapse;
margin: 0 0 1.5em;
vertical-align: middle;
width: 100%
}
td, th {
border: 1px solid #ccc;
padding: 2px 12px;
font-size: 10pt;
}
code, samp, var {
background-color:#FAFAFA;
white-space: nowrap
}
pre {
padding:6px 10px;
background-color:#FAFAFA;
border:1px solid #bbb;
overflow:auto;
}
pre.prettyprint {
padding:6px 10px !important;
border:1px solid #bbb !important;
}
code.bad, code.badcode {
color: magenta;
}
pre.bad, pre.badcode {
background-color:#ffe6d8;
border-top:1px inset #a03;
border-left:1px inset #a03;
}
hr {
margin-top: 3.5em;
border-width: 1px;
color: #fff;
}
/* TOC CSS */
table.columns {
border: none;
}
td.two_columns {
-webkit-column-count: 2;
column-count: 2;
}
.toc_category {
font-size: 10pt;
padding-top: 1em;
padding-bottom: 1em;
border-left-width: 2px;
border-right-width: 2px;
border-color: grey;
}
.toc_stylepoint {
font-size: 10pt;
padding-top: 1em;
padding-bottom: 1em;
}
li.toc_entry {
padding-right: 1em;
display: inline;
list-style-type: none;
}
/*
* This space is required to trigger the linewrap on the links
* at href boundaries
*/
li.toc_entry::after {
content: " ";
}
li.toc_entry a {
white-space: nowrap;
}
/* Horizontal TOC */
.toc td, .toc th {
border-width: 1px 5px;
overflow: hidden;
}
/* Vertical TOC */
.toc td.two_columns {
border-width: 0px;
}
/* Special Sections */
address {
text-align: right;
}
.revision {
text-align: right;
}
.headerbox {
margin-left: 50%;
font-size: 75%;
}
.legend {
padding-top: 1em;
margin-left: 50%;
font-size: 10pt;
}
.link_button {
float: left;
display: none;
background-color: #f8f8ff;
border-color: #f0f0ff;
border-style: solid;
border-width: 1px;
font-size: 75%;
margin-top: 0;
margin-left: -50px;
padding: 24px;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
}
.ignoreLink {
padding: 0px;
}
.divider{
width:5px;
height:auto;
display:inline-block;
}
/* Style Guide semantic CSS */
.summary {
margin-top: 1em;
margin-bottom: 1em;
}
.stylebody {
margin-top: 1em;
margin-bottom: 1em;
}
.stylepoint_section {
display: block;
margin-bottom: 1em;
font-family: sans-serif;
font-weight: bold;
}
.stylepoint_subsection {
display: block;
margin-bottom: 1em;
}
.stylepoint_subsubsection {
display: block;
margin-bottom: 1em;
}
.definition:before {
content: "Definition: ";
font-weight: bold;
display: block;
margin-bottom: 1em;
}
.pros:before {
content: "Pros: ";
font-weight: bold;
display: block;
margin-bottom: 1em;
}
.cons:before {
content: "Cons: ";
font-weight: bold;
display: block;
margin-bottom: 1em;
}
.decision:before {
content: "Decision: ";
font-weight: bold;
display: block;
margin-bottom: 1em;
}
.exception:before {
content: "Exception: ";
font-weight: bold;
display: block;
margin-bottom: 1em;
}
.note:before {
content: "Note: ";
font-weight: bold;
display: block;
margin-bottom: 1em;
}
TocTypeEnum = {
VERTICAL: 1,
HORIZONTAL: 2
};
function CreateTOC(tocElement) {
// Find the toc element DIV. We'll place our TOC there.
var toc = document.getElementById(tocElement);
var tocTypeClass = toc.className;
var tocType;
switch (tocTypeClass) {
case 'horizontal_toc':
tocType = TocTypeEnum.HORIZONTAL;
break;
case 'vertical_toc':
tocType = TocTypeEnum.VERTICAL;
break;
default:
tocType = TocTypeEnum.VERTICAL;
break;
}
// If toc_levels is defined, set headingLevels to it.
// Otherwise, use default value of "h2,h3"
var headingLevels;
if (typeof toc_levels === 'undefined') {
headingLevels = 'h2,h3';
} else {
}
// Collect all section heading elements in an array
var headings = document.querySelectorAll(headingLevels);
// Add TOC title elements
var tocHeadingDiv = document.createElement('div');
toc.appendChild(tocHeadingDiv);
tocHeadingDiv.className = 'toc_title';
var tocHeading = document.createElement('h3');
toc.appendChild(tocHeading);
tocHeading.className = 'ignoreLink';
tocHeading.id = 'toc';
var tocText = document.createTextNode('Table of Contents');
tocHeading.appendChild(tocText);
// Add table and tbody
var tocTable = document.createElement('table');
if (tocType == TocTypeEnum.VERTICAL) {
tocTable.className = 'columns';
}
toc.appendChild(tocTable);
var tbody_element = document.createElement('tbody');
tbody_element.setAttribute('valign', 'top');
tbody_element.className = 'toc';
tocTable.appendChild(tbody_element);
// Get the highest level heading
var firstHeading = headings[0];
var masterLevel = parseInt(headingLevels.charAt(1));
// Get the lowest heading level
var lowestLevel = parseInt(headingLevels.charAt(headingLevels - 1));
switch (tocType) {
case TocTypeEnum.HORIZONTAL:
CreateHorizontalTOC(headings, masterLevel, lowestLevel, tbody_element);
break;
case TocTypeEnum.VERTICAL:
CreateVerticalTOC(headings, masterLevel, lowestLevel, tbody_element);
break;
default:
}
}
function CreateHorizontalTOC(
headings, masterLevel, lowestLevel, tbody_element) {
// Initialize the header counter
var h = 0;
var ignoreChildren = false;
while (h < headings.length) {
// Get current heading
var heading = headings[h];
// Get the current heading level
var level = parseInt(heading.tagName.charAt(1));
if (isNaN(level) || level < 1 || level > lowestLevel) continue;
// If level is a masterLevel, make it a TOC parent category
if ((level == masterLevel) && (!hasClass(heading, 'ignoreLink'))) {
toc_current_row = AddTOCMaster(tbody_element, heading);
ignoreChildren = false;
}
if ((level == masterLevel) && (hasClass(heading, 'ignoreLink'))) {
ignoreChildren = true;
}
if ((level != masterLevel) && (!ignoreChildren)) {
AddTOCElements(toc_current_row, heading);
}
// Advance the header counter
h++;
}
}
// Adds a master Table of Content heading
function AddTOCMaster(tocTable, heading) {
// Add the table row scaffolding
var toc_tr = document.createElement('tr');
tocTable.appendChild(toc_tr);
toc_tr.setAttribute('valign', 'top');
var toc_tr_td = document.createElement('td');
toc_tr.appendChild(toc_tr_td);
var toc_category = document.createElement('div');
toc_tr_td.appendChild(toc_category);
toc_category.className = 'toc_category';
// Create the link to this header
var link = document.createElement('a');
link.href = '#' + heading.id; // Create the anchor link
link.textContent = heading.textContent; // Link text is same as heading
toc_category.appendChild(link);
// Add the container table cell for its children
var toc_td = document.createElement('td');
toc_tr.appendChild(toc_td);
var toc_td_div = document.createElement('div');
toc_td_div.className = 'toc_stylepoint';
toc_td.appendChild(toc_td_div);
return (toc_td_div);
}
// Adds Table of Contents element to a master heading as children
function AddTOCElements(toc_div, heading) {
if (heading.offsetParent === null) {
// The element is currently hidden, so don't create a TOC entry
} else {
// Create the list item element
var toc_list_element = document.createElement('li');
toc_list_element.className = 'toc_entry';
toc_div.appendChild(toc_list_element);
// Create the link to this header
var link = document.createElement('a');
link.href = '#' + heading.id; // Create the anchor link
link.textContent = heading.textContent; // Link text is same as heading
toc_list_element.appendChild(link);
}
}
function CreateVerticalTOC(headings, masterLevel, lowestLevel, tbody_element) {
// Create the Column scaffolding
var toc_tr = document.createElement('tr');
tbody_element.appendChild(toc_tr);
var toc_tr_td = document.createElement('td');
toc_tr_td.className = 'two_columns';
toc_tr.appendChild(toc_tr_td);
// Initialize the header counter and the current row
var h = 0;
var toc_current_col = null;
var ignoreChildren = false;
while (h < headings.length) {
// Get current heading
var heading = headings[h];
// Get the current heading level
var level = parseInt(heading.tagName.charAt(1));
if (isNaN(level) || level < 1 || level > lowestLevel) continue;
// If level is a masterLevel, make it a TOC parent category
if ((level == masterLevel) && (!hasClass(heading, 'ignoreLink'))) {
if (heading.offsetParent === null) {
// The element is currently hidden, so don't create a TOC entry
} else {
var td_dl = document.createElement('dl');
toc_tr_td.appendChild(td_dl);
var td_dt = document.createElement('dt');
td_dl.appendChild(td_dt);
toc_current_col = td_dl;
// Create the link to this header
var link = document.createElement('a');
link.href = '#' + heading.id; // Create the anchor link
link.textContent = heading.textContent; // Link text is same as heading
td_dt.appendChild(link);
ignoreChildren = false;
}
}
// If level is a masterLevel but it's specified to ignore links, skip it
// and its children.
if ((level == masterLevel) && (hasClass(heading, 'ignoreLink'))) {
ignoreChildren = true;
}
if ((level != masterLevel) && (!ignoreChildren)) {
if (heading.offsetParent === null) {
// The element is currently hidden, so don't create a TOC entry
} else {
var td_dd = document.createElement('dd');
toc_current_col.appendChild(td_dd);
// Create the link to this header
var link = document.createElement('a');
link.href = '#' + heading.id; // Create the anchor link
link.textContent = heading.textContent; // Link text is same as heading
td_dd.appendChild(link);
}
}
// Advance the header counter
h++;
}
}
/*
* Utility function for finding elements with a given
* class.
*/
function hasClass(element, cls) {
return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;
}
/*
* Linkify all h2 through h4 headers, except for those marked
* "ignoreLink"
*/
// Add the link image to the element.
function LinkifyHeader(header, fileName, sizePixels) {
var link = document.createElement('a');
link.href = '#' + header.id;
link.alt = 'link to ' + header.id;
link.innerHTML =
'<img src="include/' + fileName + '"' +
' width=' + sizePixels +
' height=' + sizePixels +
' style="float:left;position:relative;bottom:5px;">';
header.appendChild(link);
}
// Find all elements of the given tag and linkify if
// they don't have 'ignoreLink' in their class.
function LinkifyHeadersForTag(tagName) {
var headers = document.getElementsByTagName(tagName);
var header;
for (var j = 0; j != headers.length; j++) {
header = headers[j];
if (!hasClass(header, 'ignoreLink') && ('id' in header)) {
if (header.id != '') {
LinkifyHeader(header, 'link.png', 21);
header.style.left = '-46px';
header.style.position = 'relative';
}
}
}
}
// Linkify all h2, h3, and h4s. h1s are titles.
function LinkifyHeaders() {
LinkifyHeadersForTag('h2');
LinkifyHeadersForTag('h3');
LinkifyHeadersForTag('h4');
}
/*
* Initialize the style guide by showing all internal
* elements and then linkifying the headers.
*/
function initStyleGuide() {
LinkifyHeaders();
CreateTOC('tocDiv');
}
###################################
# AEVOL PARAMATERS #
# AEVOL PARAMETERS #
###################################
##### 1. Initial setup ############
......@@ -9,7 +9,7 @@ INIT_POP_SIZE 1024
WORLD_SIZE 32 32
INIT_METHOD ONE_GOOD_GENE CLONE
CHROMOSOME_INITIAL_LENGTH 5000
FUZZY_FLAVOR 0
FUZZY_FLAVOR 0
##### 2. Selection ################
SELECTION_SCHEME fitness_proportionate 1000
......
......@@ -70,7 +70,7 @@ class raevol_matrix(Engine):
job_is_dead = False
# While there are combinations to treat
while len(self.sweeper.get_remaining()) > 0:
while len(self.sweeper.get_remaining()) > 0 or len(self.sweeper.get_inprogress()) > 0:
# If no job, we make a reservation and prepare the hosts for the experiments
if self.oar_job_id is None:
self.submit_all_available_best_effort(self.list_of_clusters, self.options.walltime)
......@@ -131,6 +131,9 @@ class raevol_matrix(Engine):
if not t.is_alive():
del threads[t]
logger.info('Waiting for threads to complete')
if not self.is_job_alive():
job_is_dead = True
break
sleep(20)
break
......@@ -269,6 +272,13 @@ class raevol_matrix(Engine):
bucketname = self.working_dir+'/raevol_5_mut_lat/'+slugify(comb)+'/'
logger.info(thread_name + "Killing other RAevol")
killa = Remote("killall -9 aevol_run",[host])
for killp in killa.processes:
killp.ignore_error = True
killa.run()
if os.path.isdir(bucketname) and os.path.exists(bucketname+'/last_gener.txt'):
logger.info(thread_name + "Resuming AEVOL from NFS backup")
......@@ -537,7 +547,7 @@ class raevol_matrix(Engine):
def is_job_alive(self):
rez=get_oar_job_info(self.oar_job_id)
while 'start_date' not in rez and 'Error' not in rez:
while 'start_date' not in rez and 'state' not in rez:
rez=get_oar_job_info(self.oar_job_id)
if rez['state'] == 'Error':
return False
......
......@@ -61,7 +61,7 @@ class raevol_matrix(Engine):
else:
self.oar_job_id = None
self.list_of_clusters = ['hercule','orion','taurus']
self.list_of_clusters = ['taurus','hercule','orion']
try:
# Creation of the main iterator which is used for the first control loop.
......@@ -70,7 +70,7 @@ class raevol_matrix(Engine):
job_is_dead = False
# While there are combinations to treat
while len(self.sweeper.get_remaining()) > 0:
while len(self.sweeper.get_remaining()) > 0 or len(self.sweeper.get_inprogress()) > 0:
# If no job, we make a reservation and prepare the hosts for the experiments
if self.oar_job_id is None:
self.submit_all_available_best_effort(self.list_of_clusters, self.options.walltime)
......@@ -121,26 +121,30 @@ class raevol_matrix(Engine):
if job_is_dead:
break
# Getting the next combination
comb = self.sweeper.get_next()
if not comb:
while len(threads.keys()) > 0:
tmp_threads = dict(threads)
for t in tmp_threads:
if not t.is_alive():
del threads[t]
logger.info('Waiting for threads to complete')
sleep(20)
break
host = available_hosts[0]
available_hosts = available_hosts[1:]
logger.info("Launching thread "+str(self.is_job_alive())+" "+str(len(threads.keys())))
t = Thread(target=self.workflow,
args=(comb, host, comb_dir))
threads[t] = {'host': host}
t.daemon = True
t.start()
if True: #len(threads.keys()) < 83:
# Getting the next combination
comb = self.sweeper.get_next()
if not comb:
while len(threads.keys()) > 0:
tmp_threads = dict(threads)
for t in tmp_threads:
if not t.is_alive():
del threads[t]
logger.info('Waiting for threads to complete')
if not self.is_job_alive():
job_is_dead = True
break
sleep(20)
break
host = available_hosts[0]
available_hosts = available_hosts[1:]
logger.info("Launching thread "+str(self.is_job_alive())+" "+str(len(threads.keys())))
t = Thread(target=self.workflow,
args=(comb, host, comb_dir))
threads[t] = {'host': host}
t.daemon = True
t.start()
sleep(3)
if not self.is_job_alive():
......@@ -162,8 +166,8 @@ class raevol_matrix(Engine):
def define_parameters(self):
""" """
parameters = {
'seed' : [51456165, 33263658, 7158785, 456847894, 1223144, 878944, 121145, 3587842],
'mutation' : ['5e-4','1e-4','5e-5','5e-6'],
'seed' : [51456165, 33263658, 7158785, 456847894, 1223144, 878944, 121145, 3587842, 9875026, 76469871],
'mutation' : ['5e-7','1e-7'],
'env' : ['const','lat_3','lat_all'],
'selection' : [750,2000,4000]
}
......@@ -268,6 +272,13 @@ class raevol_matrix(Engine):
bucketname = self.working_dir+'/raevol_5_mut_lat/'+slugify(comb)+'/'
logger.info(thread_name + "Killing other RAevol")
killa = Remote("killall -9 aevol_run",[host])
for killp in killa.processes:
killp.ignore_error = True
killa.run()
if os.path.isdir(bucketname) and os.path.exists(bucketname+'/last_gener.txt'):
logger.info(thread_name + "Resuming AEVOL from NFS backup")
......@@ -536,7 +547,7 @@ class raevol_matrix(Engine):
def is_job_alive(self):
rez=get_oar_job_info(self.oar_job_id)
while 'start_date' not in rez and 'Error' not in rez:
while 'start_date' not in rez and 'state' not in rez:
rez=get_oar_job_info(self.oar_job_id)
if rez['state'] == 'Error':
return False
......@@ -551,9 +562,19 @@ class raevol_matrix(Engine):
slots = compute_slots(planning, walltime)
wanted = { cluster: 0 for cluster in list_of_clusters }
start_date, end_date, resources = find_first_slot(slots, wanted)
actual_resources = { resource: n_nodes
for resource, n_nodes in resources.iteritems()
if resource in list_of_clusters and n_nodes > 0 }
g_nodes = 0
actual_resources = {}
for resource, n_nodes in resources.iteritems():
if resource in list_of_clusters and n_nodes > 0:
if g_nodes >= 83:
break
elif g_nodes + n_nodes >= 83:
l_nodes = 83 - g_nodes
actual_resources = { resource : l_nodes }
break
else:
actual_resources = { resource : n_nodes }
g_nodes += n_nodes
return start_date, end_date, actual_resources
def submit_all_available_best_effort(self,list_of_clusters, walltime):
......
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_boost_base.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# DESCRIPTION
#
# Test for the Boost C++ libraries of a particular version (or newer)
#
# If no path to the installed boost library is given the macro searchs
# under /usr, /usr/local, /opt and /opt/local and evaluates the
# $BOOST_ROOT environment variable. Further documentation is available at
# <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
#
# And sets:
#
# HAVE_BOOST
#
# LICENSE
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2009 Peter Adolphs
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 26
AC_DEFUN([AX_BOOST_BASE],
[
AC_ARG_WITH([boost],
[AS_HELP_STRING([--with-boost@<:@=ARG@:>@],
[use Boost library from a standard location (ARG=yes),
from the specified location (ARG=<path>),
or disable it (ARG=no)
@<:@ARG=yes@:>@ ])],
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ac_boost_path=""
else
want_boost="yes"
ac_boost_path="$withval"
fi
],
[want_boost="yes"])
AC_ARG_WITH([boost-libdir],
AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
[Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
[
if test -d "$withval"
then
ac_boost_lib_path="$withval"
else
AC_MSG_ERROR(--with-boost-libdir expected directory name)
fi
],
[ac_boost_lib_path=""]
)
if test "x$want_boost" = "xyes"; then
boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
if test "x$boost_lib_version_req_sub_minor" = "x" ; then
boost_lib_version_req_sub_minor="0"
fi
WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
succeeded=no
dnl On 64-bit systems check for system libraries in both lib64 and lib.
dnl The former is specified by FHS, but e.g. Debian does not adhere to
dnl this (as it rises problems for generic multi-arch support).
dnl The last entry in the list is chosen by default when no libraries
dnl are found, e.g. when only header-only libraries are installed!
libsubdirs="lib"
ax_arch=`uname -m`
case $ax_arch in
x86_64)
libsubdirs="lib64 libx32 lib lib64"
;;
ppc64|s390x|sparc64|aarch64|ppc64le)
libsubdirs="lib64 lib lib64 ppc64le"
;;
esac
dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give
dnl them priority over the other paths since, if libs are found there, they
dnl are almost assuredly the ones desired.
AC_REQUIRE([AC_CANONICAL_HOST])
libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs"
case ${host_cpu} in
i?86)
libsubdirs="lib/i386-${host_os} $libsubdirs"
;;
esac
dnl first we check the system location for boost libraries
dnl this location ist chosen if boost libraries are installed with the --layout=system option
dnl or if you install boost with RPM
if test "$ac_boost_path" != ""; then
BOOST_CPPFLAGS="-I$ac_boost_path/include"
for ac_boost_path_tmp in $libsubdirs; do
if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then
BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp"
break
fi
done
elif test "$cross_compiling" != yes; then
for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
for libsubdir in $libsubdirs ; do
if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
done
BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir"
BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
break;
fi
done
fi
dnl overwrite ld flags if we have required special directory with
dnl --with-boost-libdir parameter
if test "$ac_boost_lib_path" != ""; then
BOOST_LDFLAGS="-L$ac_boost_lib_path"
fi
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_REQUIRE([AC_PROG_CXX])
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <boost/version.hpp>
]], [[
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
]])],[
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[
])
AC_LANG_POP([C++])
dnl if we found no boost with system layout we search for boost libraries
dnl built and installed without the --layout=system option or for a staged(not installed) version
if test "x$succeeded" != "xyes"; then
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
BOOST_CPPFLAGS=
BOOST_LDFLAGS=
_version=0
if test "$ac_boost_path" != ""; then
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
V_CHECK=`expr $_version_tmp \> $_version`
if test "$V_CHECK" = "1" ; then
_version=$_version_tmp
fi
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
done
dnl if nothing found search for layout used in Windows distributions
if test -z "$BOOST_CPPFLAGS"; then
if test -d "$ac_boost_path/boost" && test -r "$ac_boost_path/boost"; then
BOOST_CPPFLAGS="-I$ac_boost_path"
fi
fi
fi
else
if test "$cross_compiling" != yes; then
for ac_boost_path in /usr /usr/local /opt /opt/local ; do
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
V_CHECK=`expr $_version_tmp \> $_version`
if test "$V_CHECK" = "1" ; then
_version=$_version_tmp
best_path=$ac_boost_path
fi
done
fi
done
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
if test "$ac_boost_lib_path" = ""; then
for libsubdir in $libsubdirs ; do
if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
done
BOOST_LDFLAGS="-L$best_path/$libsubdir"
fi
fi
if test "x$BOOST_ROOT" != "x"; then
for libsubdir in $libsubdirs ; do
if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
done
if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then
version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
V_CHECK=`expr $stage_version_shorten \>\= $_version`
if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
BOOST_CPPFLAGS="-I$BOOST_ROOT"
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
fi
fi
fi
fi
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <boost/version.hpp>
]], [[
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
]])],[
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[
])
AC_LANG_POP([C++])
fi
if test "$succeeded" != "yes" ; then
if test "$_version" = "0" ; then
AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
else
AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
fi
# execute ACTION-IF-NOT-FOUND (if present):
ifelse([$3], , :, [$3])
else
AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_LDFLAGS)
AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
# execute ACTION-IF-FOUND (if present):
ifelse([$2], , :, [$2])
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_FILESYSTEM
#
# DESCRIPTION
#
# Test for Filesystem library from the Boost C++ libraries. The macro
# requires a preceding call to AX_BOOST_BASE. Further documentation is
# available at <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_FILESYSTEM_LIB)
#
# And sets:
#
# HAVE_BOOST_FILESYSTEM
#
# LICENSE
#
# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2009 Michael Tindal
# Copyright (c) 2009 Roman Rybalko <libtorrent@romanr.info>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 26
AC_DEFUN([AX_BOOST_FILESYSTEM],
[
AC_ARG_WITH([boost-filesystem],
AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@],
[use the Filesystem library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_filesystem_lib=""
else
want_boost="yes"
ax_boost_user_filesystem_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
LIBS_SAVED=$LIBS
LIBS="$LIBS $BOOST_SYSTEM_LIB"
export LIBS
AC_CACHE_CHECK(whether the Boost::Filesystem library is available,
ax_cv_boost_filesystem,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/filesystem/path.hpp>]],
[[using namespace boost::filesystem;
path my_path( "foo/bar/data.txt" );
return 0;]])],
ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no)
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_filesystem" = "xyes"; then
AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_filesystem_lib" = "x"; then
for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
[link_filesystem="no"])
done
if test "x$link_filesystem" != "xyes"; then
for libextension in `ls -r $BOOSTLIBDIR/boost_filesystem* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
[link_filesystem="no"])
done
fi
else
for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do
AC_CHECK_LIB($ax_lib, exit,
[BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
[link_filesystem="no"])
done
fi
if test "x$ax_lib" = "x"; then
AC_MSG_ERROR(Could not find a version of the library!)
fi
if test "x$link_filesystem" != "xyes"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
LIBS="$LIBS_SAVED"
fi
])
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_boost_system.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_SYSTEM
#
# DESCRIPTION
#
# Test for System library from the Boost C++ libraries. The macro requires
# a preceding call to AX_BOOST_BASE. Further documentation is available at
# <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_SYSTEM_LIB)
#
# And sets:
#
# HAVE_BOOST_SYSTEM
#
# LICENSE
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2008 Michael Tindal
# Copyright (c) 2008 Daniel Casimiro <dan.casimiro@gmail.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 18
AC_DEFUN([AX_BOOST_SYSTEM],
[
AC_ARG_WITH([boost-system],
AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@],
[use the System library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-system=boost_system-gcc-mt ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_system_lib=""
else
want_boost="yes"
ax_boost_user_system_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_BUILD])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK(whether the Boost::System library is available,
ax_cv_boost_system,
[AC_LANG_PUSH([C++])
CXXFLAGS_SAVE=$CXXFLAGS
CXXFLAGS=
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/system/error_code.hpp>]],
[[boost::system::error_category *a = 0;]])],
ax_cv_boost_system=yes, ax_cv_boost_system=no)
CXXFLAGS=$CXXFLAGS_SAVE
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_system" = "xyes"; then
AC_SUBST(BOOST_CPPFLAGS)
AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
LDFLAGS_SAVE=$LDFLAGS
if test "x$ax_boost_user_system_lib" = "x"; then
for libextension in `ls -r $BOOSTLIBDIR/libboost_system* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
[link_system="no"])
done
if test "x$link_system" != "xyes"; then
for libextension in `ls -r $BOOSTLIBDIR/boost_system* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
[link_system="no"])
done
fi
else
for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do
AC_CHECK_LIB($ax_lib, exit,
[BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
[link_system="no"])
done
fi
if test "x$ax_lib" = "x"; then
AC_MSG_ERROR(Could not find a version of the library!)
fi
if test "x$link_system" = "xno"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])
......@@ -48,7 +48,9 @@ LDADD = $(top_srcdir)/src/libaevol/libaevol.a $(top_srcdir)/src/libaevol/SFMT-sr
bin_PROGRAMS = aevol_run aevol_create aevol_modify aevol_propagate
CLEANFILES = aevol_run aevol_create aevol_modify aevol_propagate
aevol_propagate_CPPFLAGS = $(AM_CPPFLAGS) $(BOOST_CPPFLAGS)
aevol_propagate_LDFLAGS = $(AM_LDFLAGS) $(BOOST_LDFLAGS)
aevol_propagate_LDADD = $(LDADD) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB)
aevol_run_SOURCES = aevol_run.cpp
aevol_create_SOURCES = aevol_create.cpp
......
......@@ -24,15 +24,11 @@
//
// ****************************************************************************
/** \class
* \brief
*/
const char* DEFAULT_PARAM_FILE_NAME = "param.in";
// =================================================================
// Includes
// =================================================================
// ============================================================================
// Includes
// ============================================================================
#include <cstdlib>
#include <cstdio>
#include <cstring>
......@@ -51,164 +47,95 @@ const char* DEFAULT_PARAM_FILE_NAME = "param.in";
using namespace aevol;
// =================================================================
// Function declarations
// =================================================================
// Helper functions
void print_help(char* prog_path);
void interpret_cmd_line_options(int argc, char* argv[]);
// Command-line option variables
static char* param_file_name = nullptr;
static char* chromosome_file_name = nullptr;
static char* plasmid_file_name = nullptr;
int main(int argc, char* argv[]) {
interpret_cmd_line_options(argc, argv);
int main(int argc, char* argv[])
{
// 1) Initialize command-line option variables with default values
char* param_file_name = NULL;
char* output_dir = NULL;
char* chromosome_file_name = NULL;
char* plasmid_file_name = NULL;
// 2) Define allowed options
const char * options_list = "hVf:o:c:p:";
static struct option long_options_list[] = {
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'V' },
{ "file", required_argument, NULL, 'f' },
{ "out", required_argument, NULL, 'o' },
{ "chromosome", required_argument, NULL, 'c' },
{ "plasmid", required_argument, NULL, 'p' },
{ 0, 0, 0, 0 }
};
// 3) Get actual values of the command-line options
int option;
while ((option = getopt_long(argc, argv, options_list, long_options_list, NULL)) != -1)
{
switch (option)
{
case 'h' :
{
print_help(argv[0]);
exit(EXIT_SUCCESS);
}
case 'V' :
{
Utils::PrintAevolVersion();
exit(EXIT_SUCCESS);
}
case 'f' :
{
param_file_name = new char[strlen(optarg)+1];
strcpy(param_file_name, optarg);
break;
}
case 'o' :
{
output_dir = new char[strlen(optarg)+1];
strcpy(output_dir, optarg);
break;
}
case 'c':
{
chromosome_file_name = new char [strlen(optarg)+1];
strcpy(chromosome_file_name, optarg);
break;
}
case 'p':
{
plasmid_file_name = new char [strlen(optarg)+1];
strcpy(plasmid_file_name, optarg);
break;
}
default :
{
// An error message is printed in getopt_long, we just need to exit
exit(EXIT_FAILURE);
}
}
}
// 4) Set undefined command line parameters to default values
if (param_file_name == NULL)
{
param_file_name = new char[strlen(DEFAULT_PARAM_FILE_NAME)+1];
sprintf(param_file_name, "%s", DEFAULT_PARAM_FILE_NAME);
}
// 5) Create a param loader for the parameter file
ParamLoader * my_param_loader = new ParamLoader(param_file_name);
// Create a param loader for the parameter file
ParamLoader* my_param_loader = new ParamLoader(param_file_name);
delete param_file_name;
// 6) Initialize the experiment manager
ExpManager * exp_manager = new ExpManager();
// Initialize the experiment manager
ExpManager* exp_manager = new ExpManager();
// 7) Initialize the simulation from the parameter file
// Initialize the simulation from the parameter file
int32_t lchromosome = -1;
char* chromosome;
if (chromosome_file_name != NULL)
{
if (chromosome_file_name != nullptr) {
const int max_input_chrom_size = 1000000;
char raw_chromosome[max_input_chrom_size];
FILE* chromosome_file = fopen(chromosome_file_name,"r");
if (chromosome_file==NULL)
{
printf("ERROR: failed to open source chromosome file %s\n",chromosome_file_name);
FILE* chromosome_file = fopen(chromosome_file_name, "r");
if (chromosome_file == nullptr) {
printf("ERROR: failed to open source chromosome file %s\n",
chromosome_file_name);
exit(EXIT_FAILURE);
}
if (fgets(raw_chromosome, max_input_chrom_size, chromosome_file) == NULL)
if (fgets(raw_chromosome, max_input_chrom_size, chromosome_file) == nullptr)
{
printf("ERROR: failed to read from chromosome file %s\n",chromosome_file_name);
printf("ERROR: failed to read from chromosome file %s\n",
chromosome_file_name);
exit(EXIT_FAILURE);
}
lchromosome = strlen(raw_chromosome)-1;
chromosome = new char[lchromosome]; // Warning: will become the DNA of the first individual created -> no not delete, will be freed in Dna strncpy(chromosome, raw_chromosome, lchromosome);
printf("Loading chromosome from text file %s (%" PRId32 " base pairs) \n",chromosome_file_name,lchromosome);
lchromosome = strlen(raw_chromosome) - 1;
chromosome = new char[lchromosome]; // Warning: will become the DNA of the
// first individual created -> do not
// delete, will be freed in Dna
strncpy(chromosome, raw_chromosome, lchromosome);
printf("Loading chromosome from text file %s (%" PRId32 " base pairs) \n",
chromosome_file_name, lchromosome);
fclose(chromosome_file);
}
int32_t lplasmid = -1;
char* plasmid;
if (plasmid_file_name != NULL)
{
if (plasmid_file_name != nullptr) {
const int max_input_plasmid_size = 1000000;
char raw_plasmid[max_input_plasmid_size];
FILE* plasmid_file = fopen(plasmid_file_name,"r");
if (plasmid_file==NULL)
{
printf("ERROR: failed to open source chromosome file %s\n",plasmid_file_name);
FILE* plasmid_file = fopen(plasmid_file_name, "r");
if (plasmid_file == nullptr) {
printf("ERROR: failed to open source chromosome file %s\n",
plasmid_file_name);
exit(EXIT_FAILURE);
}
if (fgets(raw_plasmid, max_input_plasmid_size, plasmid_file) == NULL)
{
printf("ERROR: failed to read from chromosome file %s\n",chromosome_file_name);
if (fgets(raw_plasmid, max_input_plasmid_size, plasmid_file) == nullptr) {
printf("ERROR: failed to read from chromosome file %s\n",
chromosome_file_name);
exit(EXIT_FAILURE);
}
lplasmid = strlen(raw_plasmid)-1;
plasmid = new char[lplasmid]; // Warning: will become the DNA of the first individual created -> no not delete, will be freed in Dna strncpy(plasmid, raw_plasmid, lplasmid);
printf("Loading plasmid from text file %s (%" PRId32 " base pairs) \n",plasmid_file_name,lplasmid);
lplasmid = strlen(raw_plasmid) - 1;
plasmid = new char[lplasmid]; // Warning: will become the DNA of the first
// individual created -> no not delete,
// will be freed in Dna
strncpy(plasmid, raw_plasmid, lplasmid);
printf("Loading plasmid from text file %s (%" PRId32 " base pairs) \n",
plasmid_file_name, lplasmid);
fclose(plasmid_file);
}
if (lchromosome > -1)
{
if (lplasmid > -1)
{
my_param_loader->load(exp_manager, true, chromosome, lchromosome, plasmid, lplasmid);
if (lchromosome > -1) {
if (lplasmid > -1) {
my_param_loader->load(exp_manager, true, chromosome, lchromosome, plasmid,
lplasmid);
}
else
{
else {
my_param_loader->load(exp_manager, true, chromosome, lchromosome);
}
}
else
{
else {
my_param_loader->load(exp_manager, true);
}
delete my_param_loader;
......@@ -219,38 +146,25 @@ int main(int argc, char* argv[])
//~ getchar();
// 8) Save the experiment
if (output_dir == NULL)
{
//printf("Debut de la sauvegarde\n");
exp_manager->Save();
}
else
{
// Save everything in the provided directory
exp_manager->save_copy(output_dir);
delete output_dir;
}
exp_manager->Save();
delete exp_manager;
}
/*!
\brief
*/
void print_help(char* prog_path)
{
void print_help(char* prog_path) {
// Get the program file-name in prog_name (strip prog_path of the path)
char* prog_name; // No new, it will point to somewhere inside prog_path
if ((prog_name = strrchr(prog_path, '/'))) prog_name++;
else prog_name = prog_path;
if ((prog_name = strrchr(prog_path, '/'))) {
prog_name++;
}
else {
prog_name = prog_path;
}
printf("******************************************************************************\n");
printf("* *\n");
......@@ -263,16 +177,74 @@ void print_help(char* prog_path)
printf("* *\n");
printf("******************************************************************************\n");
printf("\n");
printf("%s: create an experiment with setup as specified in param_file.\n", prog_name);
printf("%s: create an experiment with setup as specified in PARAM_FILE.\n",
prog_name);
printf("\n");
printf("Usage : %s -h or --help\n", prog_name);
printf(" or : %s -V or --version\n", prog_name);
printf(" or : %s [-f PARAM_FILE] [-o OUTDIR] [-c CFILE] [-p PFILE]\n", prog_name);
printf(" or : %s [-f PARAM_FILE] [-C CHROM_FILE] [-P PLASMID_FILE]\n",
prog_name);
printf("\nOptions\n");
printf(" -h, --help\n\tprint this help, then exit\n\n");
printf(" -V, --version\n\tprint version number, then exit\n\n");
printf(" -f, --file PARAM_FILE\n\tspecify parameter file (default: param.in)\n");
printf(" -o, --out OUTDIR\n\tspecify output directory (default \"./\")\n\n");
printf(" -c, --chromosome CFILE\n\tload chromosome from given text file instead of generating it\n");
printf(" -p, --plasmid PFILE\n\tload plasmid from given text file instead of generating it\n");
printf(" -h, --help\n\tprint this help, then exit\n");
printf(" -V, --version\n\tprint version number, then exit\n");
printf(" -f, --file PARAM_FILE\n");
printf("\tspecify parameter file (default: param.in)\n");
printf(" -C, --chromosome CHROM_FILE\n");
printf("\tload chromosome from given text file instead of generating it\n");
printf(" -P, --plasmid PLASMID_FILE\n");
printf("\tload plasmid from given text file instead of generating it\n");
}
void interpret_cmd_line_options(int argc, char* argv[]) {
// Define allowed options
const char* options_list = "hVf:C:P:";
static struct option long_options_list[] = {
{"help", no_argument, nullptr, 'h'},
{"version", no_argument, nullptr, 'V'},
{"file", required_argument, nullptr, 'f'},
{"chromosome", required_argument, nullptr, 'C'},
{"plasmid", required_argument, nullptr, 'P'},
{0, 0, 0, 0}
};
// Get actual values of the CLI options
int option;
while ((option = getopt_long(argc, argv, options_list, long_options_list,
nullptr)) != -1) {
switch (option) {
case 'h' : {
print_help(argv[0]);
exit(EXIT_SUCCESS);
}
case 'V' : {
Utils::PrintAevolVersion();
exit(EXIT_SUCCESS);
}
case 'f' : {
param_file_name = new char[strlen(optarg) + 1];
strcpy(param_file_name, optarg);
break;
}
case 'C': {
chromosome_file_name = new char[strlen(optarg) + 1];
strcpy(chromosome_file_name, optarg);
break;
}
case 'P': {
plasmid_file_name = new char[strlen(optarg) + 1];
strcpy(plasmid_file_name, optarg);
break;
}
default : {
// An error message is printed in getopt_long, we just need to exit
exit(EXIT_FAILURE);
}
}
}
// Set undefined command line parameters to default values
if (param_file_name == nullptr) {
param_file_name = new char[strlen(DEFAULT_PARAM_FILE_NAME) + 1];
sprintf(param_file_name, "%s", DEFAULT_PARAM_FILE_NAME);
}
}