git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1585 331e1502-861f-0410-8da2-ba01fb791d7f

This commit is contained in:
wcancino 2009-06-15 13:11:43 +00:00
commit 8643a23b1a
6 changed files with 32 additions and 11 deletions

View file

@ -47,11 +47,29 @@ SET( TESTOMP_SOURCES eigensolver.cpp
testomp.cpp testomp.cpp
) )
SET( UTILITARY_SOURCES eigensolver.cpp
likelihoodcalculator.cpp
matrixutils.cpp
probmatrixcontainer.cpp
parsimonycalculator.cpp
ProbMatrix.cpp
RandomNr.cpp
Sequences.cpp
SubsModel.cpp
phylotreeIND.cpp
treeIterator.cpp
utils.cpp
likoptimizer.cpp
utility.cpp
)
ADD_EXECUTABLE( PhyloMOEA ${PHYLOMOEA_SOURCES} ) ADD_EXECUTABLE( PhyloMOEA ${PHYLOMOEA_SOURCES} )
ADD_EXECUTABLE( testomp ${TESTOMP_SOURCES} ) ADD_EXECUTABLE( testomp ${TESTOMP_SOURCES} )
ADD_EXECUTABLE( utility ${UTILITARY_SOURCES} )
TARGET_LINK_LIBRARIES(PhyloMOEA gsl gslcblas GTL eo eoutils ga moeo cma peo rmc_mpi xml2) TARGET_LINK_LIBRARIES(PhyloMOEA gsl gslcblas GTL eo eoutils ga moeo cma peo rmc_mpi xml2)
TARGET_LINK_LIBRARIES(testomp gsl gslcblas GTL eo eoutils ga moeo cma peo rmc_mpi xml2 gomp) TARGET_LINK_LIBRARIES(testomp gsl gslcblas GTL eo eoutils ga moeo cma peo rmc_mpi xml2 gomp)
TARGET_LINK_LIBRARIES(utility gsl gslcblas GTL eo eoutils ga moeo cma peo rmc_mpi xml2 gomp)
INSTALL( TARGETS PhyloMOEA RUNTIME DESTINATION bin) INSTALL( TARGETS PhyloMOEA RUNTIME DESTINATION bin)

View file

@ -103,7 +103,7 @@ int main(int argc, char *argv[])
eoPop<PhyloMOEO> population(popsize, initializer); eoPop<PhyloMOEO> population(popsize, initializer);
peoMoeoPopEval <PhyloMOEO> eval(byobj); peoMoeoPopEval <PhyloMOEO> eval(byobj);
// Only the master node read the initial trees and writes ouput files // Only the master node read the initial trees and writes ouput files
if(getNodeRank()==1) if(getNodeRank()==1)
@ -214,6 +214,7 @@ int main(int argc, char *argv[])
peo :: run(); peo :: run();
peo :: finalize(); peo :: finalize();
//algo(population); //algo(population);
} }
if (getNodeRank()==1) if (getNodeRank()==1)

View file

@ -45,6 +45,7 @@ class PhyloMOEOParetoSolutionsArchive:public moeoUnboundedArchive<PhyloMOEO>
{ {
create_file( filename ); create_file( filename );
if(title.size()>0) os << title << endl; if(title.size()>0) os << title << endl;
os.precision(10);
for(int i=0; i<size(); i++) for(int i=0; i<size(); i++)
os << operator[](i) << std::endl; os << operator[](i) << std::endl;
os.close(); os.close();

View file

@ -310,16 +310,16 @@ double LikelihoodCalculator::calculate_likelihood()
for(int i=0; i<2; i++) for(int i=0; i<2; i++)
pthread_join(threads[i],NULL);*/ pthread_join(threads[i],NULL);*/
//cout << "calculando partials..." << endl; //cout << "calculando partials..." << endl;
struct timeval start; //struct timeval start;
gettimeofday(&start,NULL); //gettimeofday(&start,NULL);
calculate_partials( a, &b); calculate_partials( a, &b);
calculate_partials( b, &a); calculate_partials( b, &a);
//cout << "somando..." << endl; //cout << "somando..." << endl;
// sum all partials // sum all partials
lik = sum_site_liks(); lik = sum_site_liks();
struct timeval end; //struct timeval end;
gettimeofday(&end,NULL); //gettimeofday(&end,NULL);
print_elapsed_time_short(&start, &end); //print_elapsed_time_short(&start, &end);
return lik; return lik;
} }

View file

@ -1,9 +1,9 @@
/* /*
* <moeoFrontByFrontCrowdingDiversityAssignment.h> * <moeoFrontByFrontCrowdingDiversityAssignment.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 * Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2009
* (C) OPAC Team, LIFL, 2002-2007 * (C) OPAC Team, LIFL, 2002-2009
* *
* Arnaud Liefooghe * Arnaud Liefooghe, Waldo Cancino
* *
* This software is governed by the CeCILL license under French law and * This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, * abiding by the rules of distribution of free software. You can use,
@ -40,7 +40,7 @@
#include <diversity/moeoCrowdingDiversityAssignment.h> #include <diversity/moeoCrowdingDiversityAssignment.h>
#include <comparator/moeoFitnessThenDiversityComparator.h> #include <comparator/moeoFitnessThenDiversityComparator.h>
#include <moeoPtrComparator.h> #include <comparator/moeoPtrComparator.h>
/** /**
@ -49,7 +49,7 @@
* Tis strategy assigns diversity values FRONT BY FRONT. It is, for instance, used in NSGA-II. * Tis strategy assigns diversity values FRONT BY FRONT. It is, for instance, used in NSGA-II.
*/ */
template < class MOEOT > template < class MOEOT >
class moeoFrontByFrontCrowdingDiversityAssignment2 : public moeoCrowdingDiversityAssignment < MOEOT > class moeoFrontByFrontCrowdingDiversityAssignment : public moeoCrowdingDiversityAssignment < MOEOT >
{ {
public: public:

View file

@ -243,6 +243,7 @@ int ParsimonyCalculator::node_parsimony( node a, node b, unsigned char *result)
// calculate parsimony for taxon child, just union // calculate parsimony for taxon child, just union
int sum_parsy = 0; int sum_parsy = 0;
int num_inf_sites = SeqData->infsite_count(); int num_inf_sites = SeqData->infsite_count();
#pragma parallel for
for(int j=0; j< num_inf_sites; j++) for(int j=0; j< num_inf_sites; j++)
sum_parsy += set_parsimony( &set_internal[a][j*5], &set_internal[b][j*5], &result[j*5]) * SeqData->infsite_count(j); sum_parsy += set_parsimony( &set_internal[a][j*5], &set_internal[b][j*5], &result[j*5]) * SeqData->infsite_count(j);
return sum_parsy; return sum_parsy;