提交 d027cec4 编写于 作者: D dev@dev.com

Add benchmark

上级 38312b12
......@@ -161,6 +161,7 @@ int main(int argc, char * argv[])
if (rbat<batch)
rbat = batch;
printf ("Batch %lld ", rbat);
clock_t start_time = clock();
#pragma omp parallel for
for (unsigned long long t = test; t<test+rbat;t+=2)
{
......@@ -224,10 +225,11 @@ int main(int argc, char * argv[])
for (int i=0;i<numthreads;++i)
file_pos[i] = 1;
test += rbat;
//输出
if (set_results.size())
{
printf (",%d primes, last Primer: %lld \n", set_results.size(),*set_results.rbegin());
printf (",%d primes, last Primer: %lld ,", set_results.size(),*set_results.rbegin());
fseeko64(fp,0,SEEK_END);
unsigned long long ttl = ftello64(fp)/8;
for(auto p = set_results.begin();p!=set_results.end();++p)
......@@ -237,6 +239,13 @@ int main(int argc, char * argv[])
}
fflush(fpTxt);
fflush(fp);
clock_t end_time = clock();
clock_t spent = end_time - start_time;
if (spent)
{
printf (" %lld / s", rbat * CLOCKS_PER_SEC/ (spent));
}
printf ("\n");
}
else {
printf (", empty\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册