Commit 8499df21 authored by Ondrej Vysocky's avatar Ondrej Vysocky

FIX removed pinning to current thread position - not working on DAVIDE #69

parent 9e29b5c0
......@@ -289,6 +289,7 @@ Specify following parameters to zero if you do not want to tune the selected sys
- Both frequencies can be specified as integer in Hz (default), kHz, MHz or GHz.
* `export MERIC_NUM_THREADS=24`
- Number of openMP threads that should be used to run the application.
- *IMPORTANT:* When using hyper-threading, thread pinning should be specified, otherwise DVFS may not work.
* `export MERIC_PWRCAP_POWER=100000`
- Average processor PKG power in milliwatts under the selected time window.
* `export MERIC_PWRCAP_TIME=3000`
......
......@@ -569,14 +569,6 @@ void Environment::init(int system, RegionParameters defaultParameter, int rank)
initHWSizes();
RAPL::initCountersUnits();
systemType = system;
//SET AFFINITY
#pragma omp parallel
{
cpu_set_t cpu_set;
CPU_ZERO(&cpu_set);
CPU_SET(sched_getcpu(), &cpu_set);
sched_setaffinity(0, sizeof(cpu_set_t), &cpu_set);
}
if(!rank)
{
......@@ -673,6 +665,19 @@ void Environment::init(int system, RegionParameters defaultParameter, int rank)
powercap(defaultParameter.powerCapPKG, defaultParameter.powerCapPKGtime);
}
threadNumber(defaultParameter.nthreads);
/* //Set affinity
#pragma omp parallel
{
#pragma omp critical
MERIC_INFO << omp_get_thread_num() << " -- " << sched_getcpu() << std::endl;
cpu_set_t cpu_set;
CPU_ZERO(&cpu_set);
CPU_SET(sched_getcpu(), &cpu_set); //current position
//CPU_SET(omp_get_thread_num(), &cpu_set); //position according its thread num
sched_setaffinity(0, sizeof(cpu_set_t), &cpu_set);
}
*/
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment