[Assorted-commits] SF.net SVN: assorted: [622] numa-bench/trunk/src/chew.cc
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-03-12 20:44:49
|
Revision: 622 http://assorted.svn.sourceforge.net/assorted/?rev=622&view=rev Author: yangzhang Date: 2008-03-12 13:44:56 -0700 (Wed, 12 Mar 2008) Log Message: ----------- ported to tile64 Modified Paths: -------------- numa-bench/trunk/src/chew.cc Modified: numa-bench/trunk/src/chew.cc =================================================================== --- numa-bench/trunk/src/chew.cc 2008-03-12 20:41:57 UTC (rev 621) +++ numa-bench/trunk/src/chew.cc 2008-03-12 20:44:56 UTC (rev 622) @@ -1,6 +1,7 @@ #include <fstream> #include <iostream> +#include <pthread.h> #include <sched.h> #ifdef HAVE_NUMA @@ -8,6 +9,7 @@ #endif #include <boost/bind.hpp> +#include <boost/scoped_array.hpp> #include <commons/check.h> #include <commons/rand.h> @@ -15,12 +17,19 @@ #include <commons/time.h> #include <commons/boost/threads.h> +#ifdef TILE64 +#include <commons/pthread/barrier.h> +#endif + using namespace boost; using namespace commons; using namespace std; // TODO Make into command line flags? -const bool debug = false, pretouch = true, do_warmup = false, use_numa = false; +const bool debug = false, pretouch = true, do_warmup = false; +#ifdef HAVE_NUMA +const bool use_numa = false; +#endif pthread_barrier_t cross_barrier, startup_barrier; pthread_mutex_t iomutex; void*** partitions; @@ -321,7 +330,7 @@ if (config.par) { // Chew the memory area from each core in parallel (and also chew own). - pthread_t ts[config.nworkers]; + scoped_array<pthread_t> ts(new pthread_t[config.nworkers]); check(0 == pthread_barrier_init(&cross_barrier, NULL, config.nworkers)); check(0 == pthread_barrier_init(&startup_barrier, NULL, config.nworkers)); for (unsigned int i = 0; i < config.nworkers; i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |