static void TestFindPrimes() { // Time fully subscribed run. double t2 = TimeFindPrimes( tbb::task_scheduler_init::automatic ); // Time parallel run that is very likely oversubscribed. double t128 = TimeFindPrimes(128); if( Verbose ) std::printf("TestFindPrimes: t2==%g t128=%g\n", t2, t128 ); // We allow the 128-thread run a little extra time to allow for thread overhead. // Theoretically, following test will fail on machine with >128 processors. // But that situation is not going to come up in the near future, // and the generalization to fix the issue is not worth the trouble. if( t128>1.10*t2 ) { std::printf("Warning: grow_by is pathetically slow: t2==%g t128=%g\n", t2, t128); } }
void TestFindPrimes() { // Time fully subscribed run. double t2 = TimeFindPrimes( tbb::task_scheduler_init::automatic ); // Time parallel run that is very likely oversubscribed. #if _XBOX double t128 = TimeFindPrimes(32); //XBOX360 can't handle too many threads #else double t128 = TimeFindPrimes(128); #endif REMARK("TestFindPrimes: t2==%g t128=%g k=%g\n", t2, t128, t128/t2); // We allow the 128-thread run a little extra time to allow for thread overhead. // Theoretically, following test will fail on machine with >128 processors. // But that situation is not going to come up in the near future, // and the generalization to fix the issue is not worth the trouble. if( t128 > 1.3*t2 ) { REPORT("Warning: grow_by is pathetically slow: t2==%g t128=%g k=%g\n", t2, t128, t128/t2); } }