pibench icon indicating copy to clipboard operation
pibench copied to clipboard

API support to initialize thread-local variables for a data structure

Open nisargshah95 opened this issue 3 years ago • 0 comments

One thing I found missing was support to initialize thread-local variables of a data structure once OMP threads are created in benchmark_t::run. Maybe an optional method can be added to the base class tree_api which at least takes an int tid as input (this is returned by omp_get_thread_num() in the run method).

For eg, adding the following method to https://github.com/sfu-dis/pibench/blob/master/include/tree_api.hpp, which can be optionally implemented by wrapper classes:

/**
* Initialize thread-local variables
*/
virtual void thread_init(int tid) {
    // Do nothing
}

nisargshah95 avatar Dec 04 '20 03:12 nisargshah95