ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches

The executor [see Executor.h] on a tf::Executor of Taskflow, beyond the book: TaskflowExecutor refers to the executor of Taskflow of the program, which it does not own, and runs bulk( n , f ) as a graph of Taskflow made of one for_each_index on the \( n \) indices with the dynamic partitioner of chunks of 1 (the patterns of ADS already give it blocks). More...

#include "ADS/Contract.h"
#include "ADS/parallel/Executor.h"
#include <taskflow/algorithm/for_each.hpp>
#include <taskflow/taskflow.hpp>
#include <cstddef>

Go to the source code of this file.

Classes

class  ADS::TaskflowExecutor
 the executor on an executor of Taskflow More...

Namespaces

namespace  ADS

Detailed description

The executor [see Executor.h] on a tf::Executor of Taskflow, beyond the book: TaskflowExecutor refers to the executor of Taskflow of the program, which it does not own, and runs bulk( n , f ) as a graph of Taskflow made of one for_each_index on the \( n \) indices with the dynamic partitioner of chunks of 1 (the patterns of ADS already give it blocks).

From a thread outside the executor the graph is run and waited for (run( tf ).wait()); from one of its workers, i.e., in a call nested in another, it is co-run (corun( tf )), so that the worker keeps running the tasks of Taskflow while it waits instead of holding its thread, and the calls nest. concurrency() is the number of the workers of Taskflow.

The cost is the graph, built at each call of bulk() with its nodes on the heap of Taskflow, which the executors of ADS, oneTBB and OpenMP do not pay; the patterns of ADS keep the calls of bulk() to one per loop, of at most kBlocks indices. There is no run(), since Taskflow does not promise that the tasks of a graph run at the same time.

The header is compiled where the headers of Taskflow 3.7 or later are found (<taskflow/taskflow.hpp>, or ADS_WITH_TASKFLOW, which the CMake target ADS::Taskflow defines).

The contracts [see Contract.h]: an exception thrown by \( f \) stops the claims and is thrown again by bulk().

See also
T.-W. Huang, D.-L. Lin, C.-X. Lin, Y. Lin, Taskflow: a lightweight parallel and heterogeneous task graph computing system, IEEE Transactions on Parallel and Distributed Systems 33(6), 1303-1320, 2022, doi:10.1109/TPDS.2021.3104255
Author
Donato Meoli
Dipartimento di Informatica
Università di Pisa