--- trunk/gadget/ecosystem.cc 2015/07/23 19:00:38 11 +++ trunk/gadget/ecosystem.cc 2015/07/24 18:36:24 12 @@ -117,24 +117,14 @@ for (j = 0; j < numThr; j++) EcoSystems[j]->Update(v); #endif - optvec[i]->OptimiseLikelihood(); - this->writeOptValues(); - } -} - #ifdef GADGET_OPENMP -void Ecosystem::OptimiseOMP() { - int i; - for (i = 0; i < optvec.Size(); ++i) { - optvec[i]->OptimiseLikelihoodOMP(); - int j, numThr = omp_get_max_threads ( ); - DoubleVector v = this->getValues(); - for (j = 0; j < numThr; j++) - EcoSystems[j]->Update(v); + optvec[i]->OptimiseLikelihoodOMP(); +#else + optvec[i]->OptimiseLikelihood(); +#endif this->writeOptValues(); } } -#endif double Ecosystem::SimulateAndUpdate(const DoubleVector& x) { int i, j; @@ -194,27 +184,6 @@ handle.logMessage(LOGINFO, "\nThe overall likelihood score is", this->getLikelihood()); } -//#ifdef GADGET_OPENMP -//void Ecosystem::writeOptValuesOMP() { -// int i; -// DoubleVector tmpvec(likevec.Size(), 0.0); -// for (i = 0; i < likevec.Size(); ++i) -// tmpvec[i] = likevec[i]->getUnweightedLikelihood(); -// -// int iters = 0, numThr = omp_get_max_threads ( ); -// for (i = 0; i < numThr; i++) -// iters += EcoSystems[i]->getFuncEval(); -// handle.logMessage(LOGINFO, "\nAfter a total of", funceval+iters, "function evaluations the best point found is"); -// keeper->writeBestValues(); -// handle.logMessage(LOGINFO, "\nThe scores from each likelihood component are"); -// handle.logMessage(LOGINFO, tmpvec); -// if (!isZero(keeper->getBestLikelihoodScore())) // no better point has been found -// handle.logMessage(LOGINFO, "\nThe overall likelihood score is", keeper->getBestLikelihoodScore()); -// else -// handle.logMessage(LOGINFO, "\nThe overall likelihood score is", this->getLikelihood()); -//} -//#endif - void Ecosystem::writeInitialInformation(const char* const filename) { keeper->openPrintFile(filename); keeper->writeInitialInformation(likevec);