Skip to content
Permalink
Browse files

modifications to empirical data set benchmarking; if custom topology …

…used with newtree option, then it is used in last replicate
  • Loading branch information...
ayresdl committed Mar 5, 2019
1 parent 6eac6de commit 2edfc40cadcd63f36c45439d90b15b43d67b8b09
Showing with 52 additions and 14 deletions.
  1. +1 −1 benchmarks/v3-app-note/run_benchmarks_pll_empirical.py
  2. +51 −13 examples/synthetictest/synthetictest.cpp
@@ -34,7 +34,7 @@ def main():

seed_list = range(1,11)

extra_args = ['--randomtree', '--stdrand', '--fulltiming', '--newparameters', '--reroot']
extra_args = ['--randomtree', '--stdrand', '--fulltiming', '--newparameters', '--reroot', '--newtree']

throughput_re = re.compile('tree throughput total: (.*) M partials/second')

@@ -1988,23 +1988,24 @@ void runBeagle(int resource,
}
}

gt_srand(randomSeed); // reset the random seed...

#ifdef HAVE_PLL
if (!pllOnly) {
#endif

if ((treenewick || randomTree) && eigenCount==1 && !unrooted) {
generateNewTree(ntaxa, rerootTrees, pectinate, postorderTraversal, dynamicScaling,
edgeCount, internalCount, unpartOpsCount, partitionCount, beagleOpCount,
#ifdef HAVE_PLL
pllTest, pll_operations,
#endif
#ifdef HAVE_NCL
treenewick,
(newTreePerRep ? NULL : treenewick),
#endif
operations);
}

gt_srand(randomSeed); // reset the random seed...

#ifdef HAVE_PLL
if (!pllOnly) {
#endif
// replicate loop
for (int i=0; i<nreps; i++){

@@ -2023,7 +2024,7 @@ void runBeagle(int resource,
}
}

if (newTreePerRep) {
if (newTreePerRep && i > 0 && i != (nreps-1)) {
generateNewTree(ntaxa, rerootTrees, pectinate, postorderTraversal, dynamicScaling,
edgeCount, internalCount, unpartOpsCount, partitionCount, beagleOpCount,
#ifdef HAVE_PLL
@@ -2034,6 +2035,20 @@ void runBeagle(int resource,
#endif
operations);

for(int j=0; j<edgeCount; j++) {
edgeLengths[j] = gt_rand() / (double) GT_RAND_MAX;
}
} else if (newTreePerRep && treenewick && i == (nreps-1)) {
generateNewTree(ntaxa, rerootTrees, pectinate, postorderTraversal, dynamicScaling,
edgeCount, internalCount, unpartOpsCount, partitionCount, beagleOpCount,
#ifdef HAVE_PLL
pllTest, pll_operations,
#endif
#ifdef HAVE_NCL
treenewick,
#endif
operations);

for(int j=0; j<edgeCount; j++) {
edgeLengths[j] = gt_rand() / (double) GT_RAND_MAX;
}
@@ -2307,7 +2322,7 @@ void runBeagle(int resource,
// unsigned long long flopsTotal = partialsTotal * flopsPerPartial;
// std::cout << " compute throughput: " << (flopsTotal/getTimeDiff(time2, time3))/1000000.0 << " GFLOPS " << std::endl;

if (i == 0 || getTimeDiff(time0, time5) < bestTimeTotal) {
if (i == 0 || getTimeDiff(time0, time5) < bestTimeTotal || (treenewick && i == (nreps-1))) {
bestTimeTotal = getTimeDiff(time0, time5);
bestTimeSetPartitions = getTimeDiff(time0, time1);
bestTimeUpdateTransitionMatrices = getTimeDiff(time1, time2);
@@ -2475,6 +2490,18 @@ void runBeagle(int resource,

gt_srand(randomSeed); // reset the random seed...

if ((treenewick || randomTree) && eigenCount==1 && !unrooted) {
generateNewTree(ntaxa, rerootTrees, pectinate, postorderTraversal, dynamicScaling,
edgeCount, internalCount, unpartOpsCount, partitionCount, beagleOpCount,
#ifdef HAVE_PLL
pllTest, pll_operations,
#endif
#ifdef HAVE_NCL
(newTreePerRep ? NULL : treenewick),
#endif
operations);
}

for (int i=0; i<nreps; i++){

if (newDataPerRep) {
@@ -2499,7 +2526,7 @@ void runBeagle(int resource,
}


if (newTreePerRep && randomTree && eigenCount==1 && !unrooted) {
if (newTreePerRep && randomTree && eigenCount==1 && !unrooted && i > 0 && i != (nreps-1)) {
generateNewTree(ntaxa, rerootTrees, pectinate, postorderTraversal,
dynamicScaling,
edgeCount, internalCount, unpartOpsCount, partitionCount, beagleOpCount,
@@ -2509,6 +2536,20 @@ void runBeagle(int resource,
#endif
operations);

for(int j=0; j<edgeCount; j++) {
edgeLengths[j] = gt_rand() / (double) GT_RAND_MAX;
}
} else if (newTreePerRep && treenewick && i == (nreps-1)) {
generateNewTree(ntaxa, rerootTrees, pectinate, postorderTraversal, dynamicScaling,
edgeCount, internalCount, unpartOpsCount, partitionCount, beagleOpCount,
#ifdef HAVE_PLL
pllTest, pll_operations,
#endif
#ifdef HAVE_NCL
treenewick,
#endif
operations);

for(int j=0; j<edgeCount; j++) {
edgeLengths[j] = gt_rand() / (double) GT_RAND_MAX;
}
@@ -2592,7 +2633,7 @@ void runBeagle(int resource,
gettimeofday(&time5,NULL);


if (i == 0 || getTimeDiff(time0, time5) < pll_bestTimeTotal) {
if (i == 0 || getTimeDiff(time0, time5) < pll_bestTimeTotal || (treenewick && i == (nreps-1))) {
pll_bestTimeTotal = getTimeDiff(time0, time5);
pll_bestTimeSetPartitions = getTimeDiff(time0, time1);
pll_bestTimeUpdateTransitionMatrices = getTimeDiff(time1, time2);
@@ -3036,9 +3077,6 @@ void interpretCommandLineParameters(int argc, const char* argv[],

if (*newTreePerRep && *unrooted)
abort("new tree per replicate can only be used with rooted trees");

if (*newTreePerRep && treenewick)
abort("new tree per replicate cannot be used with tree from Newick file");
}

int main( int argc, const char* argv[] )

0 comments on commit 2edfc40

Please sign in to comment.
You can’t perform that action at this time.