float run(unsigned kind, unsigned call, size_t threads_number,
              size_t alloc_size, unsigned mem_operations_num)
    {
        TaskFactory task_factory;
        std::vector<Thread *> threads;
        std::vector<Task *> tasks;
        TypesConf func_calls;
        TypesConf allocator_types;

        func_calls.enable_type(FunctionCalls::FREE);
        func_calls.enable_type(call);
        allocator_types.enable_type(kind);

        TaskConf conf = {
            mem_operations_num, //number of memory operations
            {
                mem_operations_num, //number of memory operations
                alloc_size, //min. size of single allocation
                alloc_size //max. size of single allocatioion
            },
            func_calls, //enable function calls
            allocator_types, //enable allocators
            11, //random seed
            false, //do not log memory operations and statistics to csv file
        };

        for (int i=0; i<threads_number; i++) {
            Task *task = task_factory.create(conf);
            tasks.push_back(task);
            threads.push_back(new Thread(task));
            conf.seed += 1;
        }

        ThreadsManager threads_manager(threads);
        threads_manager.start();
        threads_manager.barrier();

        TimeStats time_stats;
        for (int i=0; i<tasks.size(); i++) {
            time_stats += tasks[i]->get_results();
        }

        return time_stats.stats[kind][call].total_time;
    }
    void run()
    {
        unsigned mem_operations_num = 10;
        size_t threads_number = 50;
        bool touch_memory = true;
        size_t size_1MB = 1024*1024;
        size_t alignment = 2*size_1MB;
        size_t alloc_size = 4*size_1MB;

        std::vector<Thread*> threads;
        std::vector<Task*> tasks;

        TimerSysTime timer;
        timer.start();

        // This bug occurs more frequently under stress of multithreaded allocations.
        for (int i=0; i<threads_number; i++) {
		Task* task = new HugePageUnmap(mem_operations_num, touch_memory, alignment, alloc_size, HBW_PAGESIZE_2MB);
		tasks.push_back(task);
		threads.push_back(new Thread(task));
        }

        float elapsed_time = timer.getElapsedTime();

        ThreadsManager threads_manager(threads);
        threads_manager.start();
        threads_manager.barrier();
        threads_manager.release();

        //task release
        for (int i=0; i<tasks.size(); i++) {
		delete tasks[i];
        }

        RecordProperty("threads_number", threads_number);
        RecordProperty("memory_operations_per_thread", mem_operations_num);
        RecordProperty("elapsed_time", elapsed_time);
    }