SlideShare a Scribd company logo
1 of 55
Download to read offline
HPX
1
C++11 runtime system for parallel and distributed computing
HPX
2HPX — Runtime System for Parallel and Distributed Computing
• Theoretical foundation — ParalleX
• C++ conformant API
• asynchronous
• unified syntax for remote and local operations
• https://github.com/stellar-group/hpx
What is a future?
3HPX — Runtime System for Parallel and Distributed Computing
• Enables transparent synchronization with producer
• Hides thread notion
• Makes asynchrony manageable
• Allows composition of several asynchronous operations (C++17)
• Turns concurrency into parallelism
future<T>
empty value exception
What is a future?
4HPX — Runtime System for Parallel and Distributed Computing
= async(…);
executing another thread fut.get();
suspending consumer
resuming consumer
returning result
producing result
Consumer Producer
fut
hpx::future & hpx::async
5HPX — Runtime System for Parallel and Distributed Computing
• lightweight tasks
- user level context switching
- each task has its own stack
• task scheduling
- work stealing between cores
- user-defined task queue (fifo, lifo, etc.)
- enabling use of executors
Extending the future (N4538)
6HPX — Runtime System for Parallel and Distributed Computing
• future initialization
template <class T>
future<T> make_ready_future(T&& value);
• result availability
bool future<T>::is_ready() const;
Extending the future (N4538)
7HPX — Runtime System for Parallel and Distributed Computing
• sequential composition
template <class Cont>
future<result_of_t<Cont(T)>>
future<T>::then(Cont&&);
“Effects:

— The function creates a shared state that is associated with the returned
future object. Additionally, when the object's shared state is ready, the
continuation is called on an unspecified thread of execution…
— Any value returned from the continuation is stored as the result in the
shared state of the resulting future.”
Extending the future (N4538)
8HPX — Runtime System for Parallel and Distributed Computing
• sequential composition: HPX extension
template <class Cont>
future<result_of_t<Cont(T)>>
future<T>::then(hpx::launch::policy, Cont&&);
template <class Exec, class Cont>
future<result_of_t<Cont(T)>>
future<T>::then(Exec&, Cont&&);
Extending the future (N4538)
9HPX — Runtime System for Parallel and Distributed Computing
• parallel composition
template <class InputIt>
future<vector<future<T>>>
when_all(InputIt first, InputIt last);
template <class... Futures>
future<tuple<future<Futures>...>>
when_all(Futures&&… futures);
Extending the future (N4538)
10HPX — Runtime System for Parallel and Distributed Computing
• parallel composition
template <class InputIt>
future<when_any_result<vector<future<T>>>>
when_any(InputIt first, InputIt last);
template <class... Futures>
future<when_any_result<tuple<future<Futures>...>>>
when_any(Futures&&... futures);
Extending the future (N4538)
11HPX — Runtime System for Parallel and Distributed Computing
• parallel composition: HPX extension
template <class InputIt>
future<when_some_result<vector<future<T>>>>
when_some(size_t n, InputIt f, InputIt l);
template <class... Futures>
future<when_some_result<tuple<future<Futures>...>>>
when_some(size_t n, Futures&&... futures);
Futurization?
12HPX — Runtime System for Parallel and Distributed Computing
• delay direct execution in order to avoid synchronization
• code no longer executes result but generates an
execution tree representing the original algorithm
T foo(…){}
rvalue
T res = foo(…)
future<T> foo(…){}
make_ready_future(rvalue)
future<T> res = async(foo, …)
Example: recursive digital filter
13HPX — Runtime System for Parallel and Distributed Computing
y[n] = a0x[n] + a1x[n 1] + a2x[n 2] + a3x[n 3] + ...
+b1y[n 1] + b2y[n 2] + b3y[n 3] + ...
• generic recursive filter
Example: recursive digital filter
14HPX — Runtime System for Parallel and Distributed Computing
y[n] = a0x[n] + a1x[n 1] + a2x[n 2] + a3x[n 3] + ...
+b1y[n 1] + b2y[n 2] + b3y[n 3] + ...
• generic recursive filter
• single-pole high-pass filter
y[n] = a0x[n] + a1x[n 1] + b1y[n 1]
a0 = 0.93
a1 = 0.93
b1 = 0.86
Example: single-pole recursive filter
15HPX — Runtime System for Parallel and Distributed Computing
// y(n) = b(2)*y(n-1) + a(0)*x(n) + a(1)*x(n-1);
double filter(const std::vector<double>& x,
size_t n)
{
double yn_1 =
n ? filter(x, n - 1)
: 0. ;
return
(b1 * yn_1 ) +
(a0 * x[n]) + (a1 * x[n-1]);
;
}
Example: futurized single-pole recursive filter
16HPX — Runtime System for Parallel and Distributed Computing
// y(n) = b(2)*y(n-1) + a(0)*x(n) + a(1)*x(n-1);
future<double> filter(const std::vector<double>& x,
size_t n)
{
future<double> yn_1 =
n ? async(filter, std::ref(x), n - 1)
: make_ready_future(0.);
return yn_1.then(
[&x, n](future<double>&& yn_1)
{
return (b1 * yn_1.get()) +
(a0 * x[n]) + (a1 * x[n-1]);
});
}
Example: narrow band-pass filter
17HPX — Runtime System for Parallel and Distributed Computing
y(n) = a0 ⇤ x(n) + a1 ⇤ x(n 1) + a2 ⇤ x(n 2)+
b1 ⇤ y(n 1) + b2 ⇤ y(n 2);
BW = 0.033
f = 0.2
a0 = 0.092
a1 = 0.004
a2 = 0.096
b1 = 0.556
b2 = 0.811
Example: narrow band-pass filter
18HPX — Runtime System for Parallel and Distributed Computing
// y(n) = b(1)*y(n-1) + b(2)*y(n-2) +
// a(0)*x(n) + a(1)*x(n-1) + a(2)*x(n-2);
double
filter(const std::vector<double>& x, size_t n)
{
double yn_1 = n > 1 ?
filter(x, n - 1) :
0.;
double yn_2 = n > 1 ?
filter(x, n - 2) :
0.;
return (b1 * yn_1) + (b2 * yn_2)
+ (a0 * x[n]) + (a1 * x[n-1]) + (a2 * x[n-2]);
}
Example: futurized narrow band-pass filter
19HPX — Runtime System for Parallel and Distributed Computing
// y(n) = b(1)*y(n-1) + b(2)*y(n-2) +
// a(0)*x(n) + a(1)*x(n-1) + a(2)*x(n-2);
future<double>
filter(const std::vector<double>& x, size_t n)
{
future<double> yn_1 = n > 1 ?
async(filter, std::ref(x), n - 1) :
make_ready_future(0.);
future<double> yn_2 = n > 1 ?
filter(x, n - 2) :
make_ready_future(0.);
return when_all(yn_1, yn_2).then(...);
}
Example: futurized narrow band-pass filter
20HPX — Runtime System for Parallel and Distributed Computing
future<double> yn_1 = ...
future<double> yn_2 = ...
return when_all(yn_1, yn_2).then(
[&x, n](future<tuple<future<double>,
future<double>>> val)
{
auto unwrapped = val.get();
auto yn_1 = get<0>(unwrapped).get();
auto yn_2 = get<1>(unwrapped).get();
return (b1 * yn_1) + (b2 * yn_2) +
(a0 * x[n]) + (a1 * x[n-1]) +
(a2 * x[n-2]);
});
Example: futurized narrow band-pass filter
21HPX — Runtime System for Parallel and Distributed Computing
future<double> yn_1 = ...
future<double> yn_2 = ...
return async(
[&x, n](future<double> yn_1,
future<double> yn_2)
{
return (b1 * yn_1.get()) + (b2 * yn_2.get())
+ (a0 * x[n]) + (a1 * x[n-1]) +
(a2 * x[n-2]);
},
std::move(yn_1), std::move(yn_2));
Example: futurized narrow band-pass filter
22HPX — Runtime System for Parallel and Distributed Computing
future<double> yn_1 = ...
future<double> yn_2 = ...
return dataflow(
[&x, n](future<double> yn_1,
future<double> yn_2)
{
return (b1 * yn_1.get()) + (b2 * yn_2.get())
+ (a0 * x[n]) + (a1 * x[n-1]) +
(a2 * x[n-2]);
},
std::move(yn_1), std::move(yn_2));
Example: futurized narrow band-pass filter
23HPX — Runtime System for Parallel and Distributed Computing
future<double> yn_1 = ...
future<double> yn_2 = ...
return (b1 * await yn_1) + (b2 * await yn_2)
+ (a0 * x[n]) + (a1 * x[n-1]) + (a2 * x[n-2]);
Example: filter execution time for
24HPX — Runtime System for Parallel and Distributed Computing
filter_serial: 1.42561
filter_futurized: 54.9641
y(35)
Example: narrow band-pass filter
25HPX — Runtime System for Parallel and Distributed Computing
future<double>
filter(const std::vector<double>& x, size_t n)
{
if (n < threshold)
return make_ready_future(filter_serial(x, n));
future<double> yn_1 = n > 1 ?
async(filter, std::ref(x), n - 1) :
make_ready_future(0.);
future<double> yn_2 = n > 1 ?
filter(x, n - 2) :
make_ready_future(0.);
return dataflow(...);
}
Example: futurized narrow band-pass filter
26HPX — Runtime System for Parallel and Distributed Computing
relativetime
0.01
0.1
1
10
100
Threshold
futurized serial
y(35)
Futures on distributed systems
Futures on distributed systems
28HPX — Runtime System for Parallel and Distributed Computing
int calculate();
void foo()
{
std::future<int> result =
std::async(calculate);
...
std::cout << result.get() << std::endl;
...
}
Futures on distributed systems
29HPX — Runtime System for Parallel and Distributed Computing
int calculate();
void foo()
{
hpx::future<int> result =
hpx::async(calculate);
...
std::cout << result.get() << std::endl;
...
}
Futures on distributed systems
30HPX — Runtime System for Parallel and Distributed Computing
int calculate();
HPX_PLAIN_ACTION(calculate, calculate_action);
void foo()
{
hpx::future<int> result =
hpx::async(calculate);
...
std::cout << result.get() << std::endl;
...
}
Futures on distributed systems
31HPX — Runtime System for Parallel and Distributed Computing
int calculate();
HPX_PLAIN_ACTION(calculate, calculate_action);
void foo()
{
hpx::id_type where =
hpx::find_remote_localities()[0];
hpx::future<int> result =
hpx::async(calculate);
...
std::cout << result.get() << std::endl;
...
}
Futures on distributed systems
32HPX — Runtime System for Parallel and Distributed Computing
int calculate();
HPX_PLAIN_ACTION(calculate, calculate_action);
void foo()
{
hpx::id_type where =
hpx::find_remote_localities()[0];
hpx::future<int> result =
hpx::async(calculate_action{}, where);
...
std::cout << result.get() << std::endl;
...
}
Futures on distributed systems
33HPX — Runtime System for Parallel and Distributed Computing
Locality 1 Locality 2
future.get();
future
call to
hpx::async(…);
Futures on distributed systems
34HPX — Runtime System for Parallel and Distributed Computing
namespace boost { namespace math {
template <class T1, class T2>
some_result_type cyl_bessel_j(T1 v, T2 x);
}}
Jv(x) = (
1
2
z)v
1X
k=0
( 1
4 z2
)k
k! (v + k + 1))
Futures on distributed systems
35HPX — Runtime System for Parallel and Distributed Computing
namespace boost { namespace math {
template <class T1, class T2>
some_result_type cyl_bessel_j(T1 v, T2 x);
}}
namespace boost { namespace math {
template <class T1, class T2>
struct cyl_bessel_j_action:
hpx::actions::make_action<
some_result_type (*)(T1, T2),
&cyl_bessel_j<T1, T2>,
cyl_bessel_j_action<T1, T2>
> {};
}}
Futures on distributed systems
36HPX — Runtime System for Parallel and Distributed Computing
int main()
{
boost::math::cyl_bessel_j_action<double, double>
bessel_action;
std::vector<hpx::future<double>> res;
for (const auto& loc : hpx::find_all_localities())
res.push_back(
hpx::async(bessel_action, loc, 2., 3.);
}
HPX task invocation overview
37HPX — Runtime System for Parallel and Distributed Computing
R f(p…)
Synchronous

(returns R)
Asynchronous

(returns future<R>)
Fire & forget

(return void)
Functions f(p…); async(f, p…); apply(f, p…);
Actions
HPX_ACTION(f, a);

a{}(id, p…);
HPX_ACTION(f, a);

async(a{}, id, p…);
HPX_ACTION(f, a);

apply(a{}, id, p…);
C++
C++ stdlib
HPX
Writing an HPX component
38HPX — Runtime System for Parallel and Distributed Computing
struct remote_object
{
void apply_call();
};
int main()
{
remote_object obj{some_locality};
obj.apply_call();
}
Writing an HPX component
39HPX — Runtime System for Parallel and Distributed Computing
struct remote_object_component:
hpx::components::simple_component_base<
remote_object_component>
{
void call() const
{
std::cout << "hey" << std::endl;
}
HPX_DEFINE_COMPONENT_ACTION(
remote_object_component, call, call_action);
};
Writing an HPX component
40HPX — Runtime System for Parallel and Distributed Computing
struct remote_object_component:
hpx::components::simple_component_base<
remote_object_component>
{
void call() const
{
std::cout << "hey" << std::endl;
}
HPX_DEFINE_COMPONENT_ACTION(
remote_object_component, call, call_action);
};
HPX_REGISTER_COMPONENT(remote_object_component);
HPX_REGISTER_ACTION(remote_object_component::call_action);
Writing an HPX component
41HPX — Runtime System for Parallel and Distributed Computing
struct remote_object_component;
int main()
{
hpx::id_type where =
hpx::find_remote_localities()[0];
hpx::future<hpx::id_type> remote =
hpx::new_<remote_object_component>(where);
//prints hey on second locality
hpx::apply(call_action{}, remote.get());
}
Writing an HPX client for component
42HPX — Runtime System for Parallel and Distributed Computing
struct remote_object:
hpx::components::client_base<
remote_object, remote_object_component>
{
using base_type = ...;
remote_object(hpx::id_type where): base_type{
hpx::new_<remote_object_component>(where)}
{}
void apply_call() const
{
hpx::apply(call_action{}, get_id());
}
};
Writing an HPX client for component
43HPX — Runtime System for Parallel and Distributed Computing
int main()
{
hpx::id_type where =
hpx::find_remote_localities()[0];
remote_object obj{where};
obj.apply_call();
return 0;
}
Writing an HPX client for component
44HPX — Runtime System for Parallel and Distributed Computing
Locality 1 Locality 2
Global Address Space
struct remote_object_component:
simple_component_base<…>
struct remote_object:
client_base<…>
Writing multiple HPX clients
45HPX — Runtime System for Parallel and Distributed Computing
int main()
{
std::vector<hpx::id_type> locs =
hpx::find_all_localities();
std::vector<remote_object> objs {
locs.cbegin(), locs.cend()};
for (const auto& obj : objs)
obj.apply_call();
}
Writing multiple HPX clients
46HPX — Runtime System for Parallel and Distributed Computing
Locality 1 Locality 2 Locality N
Global Address Space
HPX: distributed point of view
47HPX — Runtime System for Parallel and Distributed Computing
HPX parallel algorithms
48HPX — Runtime System for Parallel and Distributed Computing
HPX parallel algorithms
49HPX — Runtime System for Parallel and Distributed Computing
template<class ExecutionPolicy,
class InputIterator, class Function>
void for_each(ExecutionPolicy&& exec,
InputIterator first, InputIterator last,
Function f);
• Execution policy
sequential_execution_policy
parallel_execution_policy
parallel_vector_execution_policy
hpx(std)::parallel::seq
hpx(std)::parallel::par
hpx(std)::parallel::par_vec
HPX parallel algorithms
50HPX — Runtime System for Parallel and Distributed Computing
template<class ExecutionPolicy,
class InputIterator, class Function>
void for_each(ExecutionPolicy&& exec,
InputIterator first, InputIterator last,
Function f);
• Execution policy
sequential_execution_policy
parallel_execution_policy
parallel_vector_execution_policy
sequential_task_execution_policy
parallel_task_execution_policy
hpx::parallel::seq(task)
hpx::parallel::par(task)
HPX
hpx(std)::parallel::seq
hpx(std)::parallel::par
hpx(std)::parallel::par_vec
HPX map reduce algorithm example
51HPX — Runtime System for Parallel and Distributed Computing
template <class T, class Mapper, class Reducer>
T map_reduce(const std::vector<T>& input,
Mapper mapper, Reducer reducer)
{
// ???
}
HPX map reduce algorithm example
52HPX — Runtime System for Parallel and Distributed Computing
template <class T, class Mapper, class Reducer>
T map_reduce(const std::vector<T>& input,
Mapper mapper, Reducer reducer)
{
std::vector<T> temp(input.size());
std::transform(std::begin(input), std::end(input),
std::begin(temp), mapper);
return std::accumulate(std::begin(temp),
std::end(temp), T{}, reducer);
}
HPX map reduce algorithm example
53HPX — Runtime System for Parallel and Distributed Computing
template <class T, class Mapper, class Reducer>
future<T> map_reduce(const std::vector<T>& input,
Mapper mapper, Reducer reducer)
{
auto temp = std::make_shared<std::vector>(
input.size());
auto mapped = transform(par(task), std::begin(input),
std::end(input), std::begin(*temp), mapper);
return mapped.then(
[temp, reducer](auto)
{
return reduce(par(task), std::begin(*temp),
std::end(*temp), T{}, reducer);
});
}
HPX map reduce algorithm example
54HPX — Runtime System for Parallel and Distributed Computing
template <class T, class Mapper, class Reducer>
future<T> map_reduce(const std::vector<T>& input,
Mapper mapper, Reducer reducer)
{
using namespace hpx::parallel;
return transform_reduce(par(task), std::begin(input),
std::end(input), mapper, T{}, reducer);
}
Thank you for your attention!
HPX — Runtime System for Parallel and Distributed Computing
• https://github.com/stellar-group/hpx

More Related Content

What's hot

Introduction to NumPy for Machine Learning Programmers
Introduction to NumPy for Machine Learning ProgrammersIntroduction to NumPy for Machine Learning Programmers
Introduction to NumPy for Machine Learning ProgrammersKimikazu Kato
 
Pytorch for tf_developers
Pytorch for tf_developersPytorch for tf_developers
Pytorch for tf_developersAbdul Muneer
 
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlowRajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlowAI Frontiers
 
Recommendation System --Theory and Practice
Recommendation System --Theory and PracticeRecommendation System --Theory and Practice
Recommendation System --Theory and PracticeKimikazu Kato
 
Tensor board
Tensor boardTensor board
Tensor boardSung Kim
 
Introduction to Tensorflow
Introduction to TensorflowIntroduction to Tensorflow
Introduction to TensorflowTzar Umang
 
Introducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlowIntroducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlowEtsuji Nakai
 
Machine Learning Live
Machine Learning LiveMachine Learning Live
Machine Learning LiveMike Anderson
 
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...David Walker
 
Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++Satalia
 
Algorithem complexity in data sructure
Algorithem complexity in data sructureAlgorithem complexity in data sructure
Algorithem complexity in data sructureKumar
 
Clojure: The Art of Abstraction
Clojure: The Art of AbstractionClojure: The Art of Abstraction
Clojure: The Art of AbstractionAlex Miller
 
Deep Learning, Scala, and Spark
Deep Learning, Scala, and SparkDeep Learning, Scala, and Spark
Deep Learning, Scala, and SparkOswald Campesato
 
Machine learning with scikit-learn
Machine learning with scikit-learnMachine learning with scikit-learn
Machine learning with scikit-learnQingkai Kong
 

What's hot (20)

Introduction to NumPy for Machine Learning Programmers
Introduction to NumPy for Machine Learning ProgrammersIntroduction to NumPy for Machine Learning Programmers
Introduction to NumPy for Machine Learning Programmers
 
Pytorch for tf_developers
Pytorch for tf_developersPytorch for tf_developers
Pytorch for tf_developers
 
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlowRajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
 
Survey onhpcs languages
Survey onhpcs languagesSurvey onhpcs languages
Survey onhpcs languages
 
Recommendation System --Theory and Practice
Recommendation System --Theory and PracticeRecommendation System --Theory and Practice
Recommendation System --Theory and Practice
 
Tensor board
Tensor boardTensor board
Tensor board
 
Introduction to Tensorflow
Introduction to TensorflowIntroduction to Tensorflow
Introduction to Tensorflow
 
Introducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlowIntroducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlow
 
Machine Learning Live
Machine Learning LiveMachine Learning Live
Machine Learning Live
 
Nx tutorial basics
Nx tutorial basicsNx tutorial basics
Nx tutorial basics
 
Dma
DmaDma
Dma
 
Python classes in mumbai
Python classes in mumbaiPython classes in mumbai
Python classes in mumbai
 
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
 
Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++
 
Algorithem complexity in data sructure
Algorithem complexity in data sructureAlgorithem complexity in data sructure
Algorithem complexity in data sructure
 
Clojure: The Art of Abstraction
Clojure: The Art of AbstractionClojure: The Art of Abstraction
Clojure: The Art of Abstraction
 
Deep Learning, Scala, and Spark
Deep Learning, Scala, and SparkDeep Learning, Scala, and Spark
Deep Learning, Scala, and Spark
 
Computational Complexity
Computational ComplexityComputational Complexity
Computational Complexity
 
Time andspacecomplexity
Time andspacecomplexityTime andspacecomplexity
Time andspacecomplexity
 
Machine learning with scikit-learn
Machine learning with scikit-learnMachine learning with scikit-learn
Machine learning with scikit-learn
 

Viewers also liked

Ranges calendar-novosibirsk-2015-08
Ranges calendar-novosibirsk-2015-08Ranges calendar-novosibirsk-2015-08
Ranges calendar-novosibirsk-2015-08Platonov Sergey
 
Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++Platonov Sergey
 
Визуализация автомобильных маршрутов
Визуализация автомобильных маршрутовВизуализация автомобильных маршрутов
Визуализация автомобильных маршрутовPlatonov Sergey
 
One definition rule - что это такое, и как с этим жить
One definition rule - что это такое, и как с этим житьOne definition rule - что это такое, и как с этим жить
One definition rule - что это такое, и как с этим житьPlatonov Sergey
 
Использование maven для сборки больших модульных c++ проектов на примере Odin...
Использование maven для сборки больших модульных c++ проектов на примере Odin...Использование maven для сборки больших модульных c++ проектов на примере Odin...
Использование maven для сборки больших модульных c++ проектов на примере Odin...Platonov Sergey
 
Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведения
Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведенияДракон в мешке: от LLVM к C++ и проблемам неопределенного поведения
Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведенияPlatonov Sergey
 
DI в C++ тонкости и нюансы
DI в C++ тонкости и нюансыDI в C++ тонкости и нюансы
DI в C++ тонкости и нюансыPlatonov Sergey
 
Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...
Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...
Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...Platonov Sergey
 
QML\Qt Quick на практике
QML\Qt Quick на практикеQML\Qt Quick на практике
QML\Qt Quick на практикеPlatonov Sergey
 
Дмитрий Кашицын, Вывод типов в динамических и не очень языках II
Дмитрий Кашицын, Вывод типов в динамических и не очень языках IIДмитрий Кашицын, Вывод типов в динамических и не очень языках II
Дмитрий Кашицын, Вывод типов в динамических и не очень языках IIPlatonov Sergey
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Platonov Sergey
 
Павел Беликов, Опыт мигрирования крупного проекта с Windows-only на Linux
Павел Беликов, Опыт мигрирования крупного проекта с Windows-only на LinuxПавел Беликов, Опыт мигрирования крупного проекта с Windows-only на Linux
Павел Беликов, Опыт мигрирования крупного проекта с Windows-only на LinuxPlatonov Sergey
 
Тененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговлеТененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговлеPlatonov Sergey
 
Дмитрий Кашицын, Вывод типов в динамических и не очень языках I
Дмитрий Кашицын, Вывод типов в динамических и не очень языках IДмитрий Кашицын, Вывод типов в динамических и не очень языках I
Дмитрий Кашицын, Вывод типов в динамических и не очень языках IPlatonov Sergey
 
Антон Бикинеев, Reflection in C++Next
Антон Бикинеев,  Reflection in C++NextАнтон Бикинеев,  Reflection in C++Next
Антон Бикинеев, Reflection in C++NextSergey Platonov
 
Григорий Демченко, Универсальный адаптер
Григорий Демченко, Универсальный адаптерГригорий Демченко, Универсальный адаптер
Григорий Демченко, Универсальный адаптерSergey Platonov
 
Использование юнит-тестов для повышения качества разработки
Использование юнит-тестов для повышения качества разработкиИспользование юнит-тестов для повышения качества разработки
Использование юнит-тестов для повышения качества разработкиvictor-yastrebov
 
Сергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и Javascript
Сергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и JavascriptСергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и Javascript
Сергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и JavascriptSergey Platonov
 

Viewers also liked (20)

Ranges calendar-novosibirsk-2015-08
Ranges calendar-novosibirsk-2015-08Ranges calendar-novosibirsk-2015-08
Ranges calendar-novosibirsk-2015-08
 
Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++
 
Визуализация автомобильных маршрутов
Визуализация автомобильных маршрутовВизуализация автомобильных маршрутов
Визуализация автомобильных маршрутов
 
One definition rule - что это такое, и как с этим жить
One definition rule - что это такое, и как с этим житьOne definition rule - что это такое, и как с этим жить
One definition rule - что это такое, и как с этим жить
 
Использование maven для сборки больших модульных c++ проектов на примере Odin...
Использование maven для сборки больших модульных c++ проектов на примере Odin...Использование maven для сборки больших модульных c++ проектов на примере Odin...
Использование maven для сборки больших модульных c++ проектов на примере Odin...
 
Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведения
Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведенияДракон в мешке: от LLVM к C++ и проблемам неопределенного поведения
Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведения
 
DI в C++ тонкости и нюансы
DI в C++ тонкости и нюансыDI в C++ тонкости и нюансы
DI в C++ тонкости и нюансы
 
Concepts lite
Concepts liteConcepts lite
Concepts lite
 
Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...
Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...
Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...
 
C++ exceptions
C++ exceptionsC++ exceptions
C++ exceptions
 
QML\Qt Quick на практике
QML\Qt Quick на практикеQML\Qt Quick на практике
QML\Qt Quick на практике
 
Дмитрий Кашицын, Вывод типов в динамических и не очень языках II
Дмитрий Кашицын, Вывод типов в динамических и не очень языках IIДмитрий Кашицын, Вывод типов в динамических и не очень языках II
Дмитрий Кашицын, Вывод типов в динамических и не очень языках II
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.
 
Павел Беликов, Опыт мигрирования крупного проекта с Windows-only на Linux
Павел Беликов, Опыт мигрирования крупного проекта с Windows-only на LinuxПавел Беликов, Опыт мигрирования крупного проекта с Windows-only на Linux
Павел Беликов, Опыт мигрирования крупного проекта с Windows-only на Linux
 
Тененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговлеТененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговле
 
Дмитрий Кашицын, Вывод типов в динамических и не очень языках I
Дмитрий Кашицын, Вывод типов в динамических и не очень языках IДмитрий Кашицын, Вывод типов в динамических и не очень языках I
Дмитрий Кашицын, Вывод типов в динамических и не очень языках I
 
Антон Бикинеев, Reflection in C++Next
Антон Бикинеев,  Reflection in C++NextАнтон Бикинеев,  Reflection in C++Next
Антон Бикинеев, Reflection in C++Next
 
Григорий Демченко, Универсальный адаптер
Григорий Демченко, Универсальный адаптерГригорий Демченко, Универсальный адаптер
Григорий Демченко, Универсальный адаптер
 
Использование юнит-тестов для повышения качества разработки
Использование юнит-тестов для повышения качества разработкиИспользование юнит-тестов для повышения качества разработки
Использование юнит-тестов для повышения качества разработки
 
Сергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и Javascript
Сергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и JavascriptСергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и Javascript
Сергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и Javascript
 

Similar to HPX: C++11 runtime система для параллельных и распределённых вычислений

Hpx runtime system
Hpx runtime systemHpx runtime system
Hpx runtime systemcorehard_by
 
SFSCON23 - Emily Bourne Yaman Güçlü - Pyccel write Python code, get Fortran ...
SFSCON23 - Emily Bourne Yaman Güçlü - Pyccel  write Python code, get Fortran ...SFSCON23 - Emily Bourne Yaman Güçlü - Pyccel  write Python code, get Fortran ...
SFSCON23 - Emily Bourne Yaman Güçlü - Pyccel write Python code, get Fortran ...South Tyrol Free Software Conference
 
NVIDIA HPC ソフトウエア斜め読み
NVIDIA HPC ソフトウエア斜め読みNVIDIA HPC ソフトウエア斜め読み
NVIDIA HPC ソフトウエア斜め読みNVIDIA Japan
 
A Future for R: Parallel and Distributed Processing in R for Everyone
A Future for R: Parallel and Distributed Processing in R for EveryoneA Future for R: Parallel and Distributed Processing in R for Everyone
A Future for R: Parallel and Distributed Processing in R for Everyoneinside-BigData.com
 
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014PyData
 
Effective Modern C++ - Item 35 & 36
Effective Modern C++ - Item 35 & 36Effective Modern C++ - Item 35 & 36
Effective Modern C++ - Item 35 & 36Chih-Hsuan Kuo
 
Столпы функционального программирования для адептов ООП, Николай Мозговой
Столпы функционального программирования для адептов ООП, Николай МозговойСтолпы функционального программирования для адептов ООП, Николай Мозговой
Столпы функционального программирования для адептов ООП, Николай МозговойSigma Software
 
5_2019_01_12!09_25_57_AM.ppt
5_2019_01_12!09_25_57_AM.ppt5_2019_01_12!09_25_57_AM.ppt
5_2019_01_12!09_25_57_AM.pptaboma2hawi
 
Flux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul DixFlux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul DixInfluxData
 
Java 8 lambda expressions
Java 8 lambda expressionsJava 8 lambda expressions
Java 8 lambda expressionsLogan Chien
 
Numba: Array-oriented Python Compiler for NumPy
Numba: Array-oriented Python Compiler for NumPyNumba: Array-oriented Python Compiler for NumPy
Numba: Array-oriented Python Compiler for NumPyTravis Oliphant
 
24-TensorFlow-Clipper.pptxnjjjjnjjjjjjmm
24-TensorFlow-Clipper.pptxnjjjjnjjjjjjmm24-TensorFlow-Clipper.pptxnjjjjnjjjjjjmm
24-TensorFlow-Clipper.pptxnjjjjnjjjjjjmmSasidharaKashyapChat
 
Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013aleks-f
 
Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...
Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...
Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...InfluxData
 
Overview of Chainer and Its Features
Overview of Chainer and Its FeaturesOverview of Chainer and Its Features
Overview of Chainer and Its FeaturesSeiya Tokui
 
Introduction to Chainer
Introduction to ChainerIntroduction to Chainer
Introduction to ChainerSeiya Tokui
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programmingAlberto Labarga
 
Compiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual MachinesCompiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual MachinesEelco Visser
 
От Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей РодионовОт Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей РодионовYandex
 

Similar to HPX: C++11 runtime система для параллельных и распределённых вычислений (20)

Hpx runtime system
Hpx runtime systemHpx runtime system
Hpx runtime system
 
SFSCON23 - Emily Bourne Yaman Güçlü - Pyccel write Python code, get Fortran ...
SFSCON23 - Emily Bourne Yaman Güçlü - Pyccel  write Python code, get Fortran ...SFSCON23 - Emily Bourne Yaman Güçlü - Pyccel  write Python code, get Fortran ...
SFSCON23 - Emily Bourne Yaman Güçlü - Pyccel write Python code, get Fortran ...
 
NVIDIA HPC ソフトウエア斜め読み
NVIDIA HPC ソフトウエア斜め読みNVIDIA HPC ソフトウエア斜め読み
NVIDIA HPC ソフトウエア斜め読み
 
A Future for R: Parallel and Distributed Processing in R for Everyone
A Future for R: Parallel and Distributed Processing in R for EveryoneA Future for R: Parallel and Distributed Processing in R for Everyone
A Future for R: Parallel and Distributed Processing in R for Everyone
 
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
 
Effective Modern C++ - Item 35 & 36
Effective Modern C++ - Item 35 & 36Effective Modern C++ - Item 35 & 36
Effective Modern C++ - Item 35 & 36
 
Столпы функционального программирования для адептов ООП, Николай Мозговой
Столпы функционального программирования для адептов ООП, Николай МозговойСтолпы функционального программирования для адептов ООП, Николай Мозговой
Столпы функционального программирования для адептов ООП, Николай Мозговой
 
5_2019_01_12!09_25_57_AM.ppt
5_2019_01_12!09_25_57_AM.ppt5_2019_01_12!09_25_57_AM.ppt
5_2019_01_12!09_25_57_AM.ppt
 
Flux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul DixFlux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul Dix
 
SCIPY-SYMPY.pdf
SCIPY-SYMPY.pdfSCIPY-SYMPY.pdf
SCIPY-SYMPY.pdf
 
Java 8 lambda expressions
Java 8 lambda expressionsJava 8 lambda expressions
Java 8 lambda expressions
 
Numba: Array-oriented Python Compiler for NumPy
Numba: Array-oriented Python Compiler for NumPyNumba: Array-oriented Python Compiler for NumPy
Numba: Array-oriented Python Compiler for NumPy
 
24-TensorFlow-Clipper.pptxnjjjjnjjjjjjmm
24-TensorFlow-Clipper.pptxnjjjjnjjjjjjmm24-TensorFlow-Clipper.pptxnjjjjnjjjjjjmm
24-TensorFlow-Clipper.pptxnjjjjnjjjjjjmm
 
Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013
 
Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...
Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...
Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...
 
Overview of Chainer and Its Features
Overview of Chainer and Its FeaturesOverview of Chainer and Its Features
Overview of Chainer and Its Features
 
Introduction to Chainer
Introduction to ChainerIntroduction to Chainer
Introduction to Chainer
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programming
 
Compiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual MachinesCompiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual Machines
 
От Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей РодионовОт Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей Родионов
 

More from Platonov Sergey

Евгений Зуев, С++ в России: Стандарт языка и его реализация
Евгений Зуев, С++ в России: Стандарт языка и его реализацияЕвгений Зуев, С++ в России: Стандарт языка и его реализация
Евгений Зуев, С++ в России: Стандарт языка и его реализацияPlatonov Sergey
 
Алексей Кутумов, C++ без исключений, часть 3
Алексей Кутумов,  C++ без исключений, часть 3Алексей Кутумов,  C++ без исключений, часть 3
Алексей Кутумов, C++ без исключений, часть 3Platonov Sergey
 
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...Platonov Sergey
 
Аскетичная разработка браузера
Аскетичная разработка браузераАскетичная разработка браузера
Аскетичная разработка браузераPlatonov Sergey
 
Денис Кормалев Метаобъектная система Qt
Денис Кормалев Метаобъектная система QtДенис Кормалев Метаобъектная система Qt
Денис Кормалев Метаобъектная система QtPlatonov Sergey
 
Максим Хижинский Lock-free maps
Максим Хижинский Lock-free mapsМаксим Хижинский Lock-free maps
Максим Хижинский Lock-free mapsPlatonov Sergey
 
Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...
Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...
Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...Platonov Sergey
 
High quality library from scratch
High quality library from scratchHigh quality library from scratch
High quality library from scratchPlatonov Sergey
 
С++ without new and delete
С++ without new and deleteС++ without new and delete
С++ without new and deletePlatonov Sergey
 
Categories for the Working C++ Programmer
Categories for the Working C++ ProgrammerCategories for the Working C++ Programmer
Categories for the Working C++ ProgrammerPlatonov Sergey
 
Библиотека Boost с нуля на примере Boost.DLL
Библиотека Boost с нуля на примере Boost.DLLБиблиотека Boost с нуля на примере Boost.DLL
Библиотека Boost с нуля на примере Boost.DLLPlatonov Sergey
 
Оптимизация трассирования с использованием Expression templates
Оптимизация трассирования с использованием Expression templatesОптимизация трассирования с использованием Expression templates
Оптимизация трассирования с использованием Expression templatesPlatonov Sergey
 
Практика Lock-free. RealTime-сервер
Практика Lock-free. RealTime-серверПрактика Lock-free. RealTime-сервер
Практика Lock-free. RealTime-серверPlatonov Sergey
 
С++ without new and delete
С++ without new and deleteС++ without new and delete
С++ without new and deletePlatonov Sergey
 

More from Platonov Sergey (14)

Евгений Зуев, С++ в России: Стандарт языка и его реализация
Евгений Зуев, С++ в России: Стандарт языка и его реализацияЕвгений Зуев, С++ в России: Стандарт языка и его реализация
Евгений Зуев, С++ в России: Стандарт языка и его реализация
 
Алексей Кутумов, C++ без исключений, часть 3
Алексей Кутумов,  C++ без исключений, часть 3Алексей Кутумов,  C++ без исключений, часть 3
Алексей Кутумов, C++ без исключений, часть 3
 
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
 
Аскетичная разработка браузера
Аскетичная разработка браузераАскетичная разработка браузера
Аскетичная разработка браузера
 
Денис Кормалев Метаобъектная система Qt
Денис Кормалев Метаобъектная система QtДенис Кормалев Метаобъектная система Qt
Денис Кормалев Метаобъектная система Qt
 
Максим Хижинский Lock-free maps
Максим Хижинский Lock-free mapsМаксим Хижинский Lock-free maps
Максим Хижинский Lock-free maps
 
Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...
Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...
Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...
 
High quality library from scratch
High quality library from scratchHigh quality library from scratch
High quality library from scratch
 
С++ without new and delete
С++ without new and deleteС++ without new and delete
С++ without new and delete
 
Categories for the Working C++ Programmer
Categories for the Working C++ ProgrammerCategories for the Working C++ Programmer
Categories for the Working C++ Programmer
 
Библиотека Boost с нуля на примере Boost.DLL
Библиотека Boost с нуля на примере Boost.DLLБиблиотека Boost с нуля на примере Boost.DLL
Библиотека Boost с нуля на примере Boost.DLL
 
Оптимизация трассирования с использованием Expression templates
Оптимизация трассирования с использованием Expression templatesОптимизация трассирования с использованием Expression templates
Оптимизация трассирования с использованием Expression templates
 
Практика Lock-free. RealTime-сервер
Практика Lock-free. RealTime-серверПрактика Lock-free. RealTime-сервер
Практика Lock-free. RealTime-сервер
 
С++ without new and delete
С++ without new and deleteС++ without new and delete
С++ without new and delete
 

Recently uploaded

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Recently uploaded (20)

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 

HPX: C++11 runtime система для параллельных и распределённых вычислений

  • 1. HPX 1 C++11 runtime system for parallel and distributed computing
  • 2. HPX 2HPX — Runtime System for Parallel and Distributed Computing • Theoretical foundation — ParalleX • C++ conformant API • asynchronous • unified syntax for remote and local operations • https://github.com/stellar-group/hpx
  • 3. What is a future? 3HPX — Runtime System for Parallel and Distributed Computing • Enables transparent synchronization with producer • Hides thread notion • Makes asynchrony manageable • Allows composition of several asynchronous operations (C++17) • Turns concurrency into parallelism future<T> empty value exception
  • 4. What is a future? 4HPX — Runtime System for Parallel and Distributed Computing = async(…); executing another thread fut.get(); suspending consumer resuming consumer returning result producing result Consumer Producer fut
  • 5. hpx::future & hpx::async 5HPX — Runtime System for Parallel and Distributed Computing • lightweight tasks - user level context switching - each task has its own stack • task scheduling - work stealing between cores - user-defined task queue (fifo, lifo, etc.) - enabling use of executors
  • 6. Extending the future (N4538) 6HPX — Runtime System for Parallel and Distributed Computing • future initialization template <class T> future<T> make_ready_future(T&& value); • result availability bool future<T>::is_ready() const;
  • 7. Extending the future (N4538) 7HPX — Runtime System for Parallel and Distributed Computing • sequential composition template <class Cont> future<result_of_t<Cont(T)>> future<T>::then(Cont&&); “Effects: — The function creates a shared state that is associated with the returned future object. Additionally, when the object's shared state is ready, the continuation is called on an unspecified thread of execution… — Any value returned from the continuation is stored as the result in the shared state of the resulting future.”
  • 8. Extending the future (N4538) 8HPX — Runtime System for Parallel and Distributed Computing • sequential composition: HPX extension template <class Cont> future<result_of_t<Cont(T)>> future<T>::then(hpx::launch::policy, Cont&&); template <class Exec, class Cont> future<result_of_t<Cont(T)>> future<T>::then(Exec&, Cont&&);
  • 9. Extending the future (N4538) 9HPX — Runtime System for Parallel and Distributed Computing • parallel composition template <class InputIt> future<vector<future<T>>> when_all(InputIt first, InputIt last); template <class... Futures> future<tuple<future<Futures>...>> when_all(Futures&&… futures);
  • 10. Extending the future (N4538) 10HPX — Runtime System for Parallel and Distributed Computing • parallel composition template <class InputIt> future<when_any_result<vector<future<T>>>> when_any(InputIt first, InputIt last); template <class... Futures> future<when_any_result<tuple<future<Futures>...>>> when_any(Futures&&... futures);
  • 11. Extending the future (N4538) 11HPX — Runtime System for Parallel and Distributed Computing • parallel composition: HPX extension template <class InputIt> future<when_some_result<vector<future<T>>>> when_some(size_t n, InputIt f, InputIt l); template <class... Futures> future<when_some_result<tuple<future<Futures>...>>> when_some(size_t n, Futures&&... futures);
  • 12. Futurization? 12HPX — Runtime System for Parallel and Distributed Computing • delay direct execution in order to avoid synchronization • code no longer executes result but generates an execution tree representing the original algorithm T foo(…){} rvalue T res = foo(…) future<T> foo(…){} make_ready_future(rvalue) future<T> res = async(foo, …)
  • 13. Example: recursive digital filter 13HPX — Runtime System for Parallel and Distributed Computing y[n] = a0x[n] + a1x[n 1] + a2x[n 2] + a3x[n 3] + ... +b1y[n 1] + b2y[n 2] + b3y[n 3] + ... • generic recursive filter
  • 14. Example: recursive digital filter 14HPX — Runtime System for Parallel and Distributed Computing y[n] = a0x[n] + a1x[n 1] + a2x[n 2] + a3x[n 3] + ... +b1y[n 1] + b2y[n 2] + b3y[n 3] + ... • generic recursive filter • single-pole high-pass filter y[n] = a0x[n] + a1x[n 1] + b1y[n 1] a0 = 0.93 a1 = 0.93 b1 = 0.86
  • 15. Example: single-pole recursive filter 15HPX — Runtime System for Parallel and Distributed Computing // y(n) = b(2)*y(n-1) + a(0)*x(n) + a(1)*x(n-1); double filter(const std::vector<double>& x, size_t n) { double yn_1 = n ? filter(x, n - 1) : 0. ; return (b1 * yn_1 ) + (a0 * x[n]) + (a1 * x[n-1]); ; }
  • 16. Example: futurized single-pole recursive filter 16HPX — Runtime System for Parallel and Distributed Computing // y(n) = b(2)*y(n-1) + a(0)*x(n) + a(1)*x(n-1); future<double> filter(const std::vector<double>& x, size_t n) { future<double> yn_1 = n ? async(filter, std::ref(x), n - 1) : make_ready_future(0.); return yn_1.then( [&x, n](future<double>&& yn_1) { return (b1 * yn_1.get()) + (a0 * x[n]) + (a1 * x[n-1]); }); }
  • 17. Example: narrow band-pass filter 17HPX — Runtime System for Parallel and Distributed Computing y(n) = a0 ⇤ x(n) + a1 ⇤ x(n 1) + a2 ⇤ x(n 2)+ b1 ⇤ y(n 1) + b2 ⇤ y(n 2); BW = 0.033 f = 0.2 a0 = 0.092 a1 = 0.004 a2 = 0.096 b1 = 0.556 b2 = 0.811
  • 18. Example: narrow band-pass filter 18HPX — Runtime System for Parallel and Distributed Computing // y(n) = b(1)*y(n-1) + b(2)*y(n-2) + // a(0)*x(n) + a(1)*x(n-1) + a(2)*x(n-2); double filter(const std::vector<double>& x, size_t n) { double yn_1 = n > 1 ? filter(x, n - 1) : 0.; double yn_2 = n > 1 ? filter(x, n - 2) : 0.; return (b1 * yn_1) + (b2 * yn_2) + (a0 * x[n]) + (a1 * x[n-1]) + (a2 * x[n-2]); }
  • 19. Example: futurized narrow band-pass filter 19HPX — Runtime System for Parallel and Distributed Computing // y(n) = b(1)*y(n-1) + b(2)*y(n-2) + // a(0)*x(n) + a(1)*x(n-1) + a(2)*x(n-2); future<double> filter(const std::vector<double>& x, size_t n) { future<double> yn_1 = n > 1 ? async(filter, std::ref(x), n - 1) : make_ready_future(0.); future<double> yn_2 = n > 1 ? filter(x, n - 2) : make_ready_future(0.); return when_all(yn_1, yn_2).then(...); }
  • 20. Example: futurized narrow band-pass filter 20HPX — Runtime System for Parallel and Distributed Computing future<double> yn_1 = ... future<double> yn_2 = ... return when_all(yn_1, yn_2).then( [&x, n](future<tuple<future<double>, future<double>>> val) { auto unwrapped = val.get(); auto yn_1 = get<0>(unwrapped).get(); auto yn_2 = get<1>(unwrapped).get(); return (b1 * yn_1) + (b2 * yn_2) + (a0 * x[n]) + (a1 * x[n-1]) + (a2 * x[n-2]); });
  • 21. Example: futurized narrow band-pass filter 21HPX — Runtime System for Parallel and Distributed Computing future<double> yn_1 = ... future<double> yn_2 = ... return async( [&x, n](future<double> yn_1, future<double> yn_2) { return (b1 * yn_1.get()) + (b2 * yn_2.get()) + (a0 * x[n]) + (a1 * x[n-1]) + (a2 * x[n-2]); }, std::move(yn_1), std::move(yn_2));
  • 22. Example: futurized narrow band-pass filter 22HPX — Runtime System for Parallel and Distributed Computing future<double> yn_1 = ... future<double> yn_2 = ... return dataflow( [&x, n](future<double> yn_1, future<double> yn_2) { return (b1 * yn_1.get()) + (b2 * yn_2.get()) + (a0 * x[n]) + (a1 * x[n-1]) + (a2 * x[n-2]); }, std::move(yn_1), std::move(yn_2));
  • 23. Example: futurized narrow band-pass filter 23HPX — Runtime System for Parallel and Distributed Computing future<double> yn_1 = ... future<double> yn_2 = ... return (b1 * await yn_1) + (b2 * await yn_2) + (a0 * x[n]) + (a1 * x[n-1]) + (a2 * x[n-2]);
  • 24. Example: filter execution time for 24HPX — Runtime System for Parallel and Distributed Computing filter_serial: 1.42561 filter_futurized: 54.9641 y(35)
  • 25. Example: narrow band-pass filter 25HPX — Runtime System for Parallel and Distributed Computing future<double> filter(const std::vector<double>& x, size_t n) { if (n < threshold) return make_ready_future(filter_serial(x, n)); future<double> yn_1 = n > 1 ? async(filter, std::ref(x), n - 1) : make_ready_future(0.); future<double> yn_2 = n > 1 ? filter(x, n - 2) : make_ready_future(0.); return dataflow(...); }
  • 26. Example: futurized narrow band-pass filter 26HPX — Runtime System for Parallel and Distributed Computing relativetime 0.01 0.1 1 10 100 Threshold futurized serial y(35)
  • 28. Futures on distributed systems 28HPX — Runtime System for Parallel and Distributed Computing int calculate(); void foo() { std::future<int> result = std::async(calculate); ... std::cout << result.get() << std::endl; ... }
  • 29. Futures on distributed systems 29HPX — Runtime System for Parallel and Distributed Computing int calculate(); void foo() { hpx::future<int> result = hpx::async(calculate); ... std::cout << result.get() << std::endl; ... }
  • 30. Futures on distributed systems 30HPX — Runtime System for Parallel and Distributed Computing int calculate(); HPX_PLAIN_ACTION(calculate, calculate_action); void foo() { hpx::future<int> result = hpx::async(calculate); ... std::cout << result.get() << std::endl; ... }
  • 31. Futures on distributed systems 31HPX — Runtime System for Parallel and Distributed Computing int calculate(); HPX_PLAIN_ACTION(calculate, calculate_action); void foo() { hpx::id_type where = hpx::find_remote_localities()[0]; hpx::future<int> result = hpx::async(calculate); ... std::cout << result.get() << std::endl; ... }
  • 32. Futures on distributed systems 32HPX — Runtime System for Parallel and Distributed Computing int calculate(); HPX_PLAIN_ACTION(calculate, calculate_action); void foo() { hpx::id_type where = hpx::find_remote_localities()[0]; hpx::future<int> result = hpx::async(calculate_action{}, where); ... std::cout << result.get() << std::endl; ... }
  • 33. Futures on distributed systems 33HPX — Runtime System for Parallel and Distributed Computing Locality 1 Locality 2 future.get(); future call to hpx::async(…);
  • 34. Futures on distributed systems 34HPX — Runtime System for Parallel and Distributed Computing namespace boost { namespace math { template <class T1, class T2> some_result_type cyl_bessel_j(T1 v, T2 x); }} Jv(x) = ( 1 2 z)v 1X k=0 ( 1 4 z2 )k k! (v + k + 1))
  • 35. Futures on distributed systems 35HPX — Runtime System for Parallel and Distributed Computing namespace boost { namespace math { template <class T1, class T2> some_result_type cyl_bessel_j(T1 v, T2 x); }} namespace boost { namespace math { template <class T1, class T2> struct cyl_bessel_j_action: hpx::actions::make_action< some_result_type (*)(T1, T2), &cyl_bessel_j<T1, T2>, cyl_bessel_j_action<T1, T2> > {}; }}
  • 36. Futures on distributed systems 36HPX — Runtime System for Parallel and Distributed Computing int main() { boost::math::cyl_bessel_j_action<double, double> bessel_action; std::vector<hpx::future<double>> res; for (const auto& loc : hpx::find_all_localities()) res.push_back( hpx::async(bessel_action, loc, 2., 3.); }
  • 37. HPX task invocation overview 37HPX — Runtime System for Parallel and Distributed Computing R f(p…) Synchronous (returns R) Asynchronous (returns future<R>) Fire & forget (return void) Functions f(p…); async(f, p…); apply(f, p…); Actions HPX_ACTION(f, a); a{}(id, p…); HPX_ACTION(f, a); async(a{}, id, p…); HPX_ACTION(f, a); apply(a{}, id, p…); C++ C++ stdlib HPX
  • 38. Writing an HPX component 38HPX — Runtime System for Parallel and Distributed Computing struct remote_object { void apply_call(); }; int main() { remote_object obj{some_locality}; obj.apply_call(); }
  • 39. Writing an HPX component 39HPX — Runtime System for Parallel and Distributed Computing struct remote_object_component: hpx::components::simple_component_base< remote_object_component> { void call() const { std::cout << "hey" << std::endl; } HPX_DEFINE_COMPONENT_ACTION( remote_object_component, call, call_action); };
  • 40. Writing an HPX component 40HPX — Runtime System for Parallel and Distributed Computing struct remote_object_component: hpx::components::simple_component_base< remote_object_component> { void call() const { std::cout << "hey" << std::endl; } HPX_DEFINE_COMPONENT_ACTION( remote_object_component, call, call_action); }; HPX_REGISTER_COMPONENT(remote_object_component); HPX_REGISTER_ACTION(remote_object_component::call_action);
  • 41. Writing an HPX component 41HPX — Runtime System for Parallel and Distributed Computing struct remote_object_component; int main() { hpx::id_type where = hpx::find_remote_localities()[0]; hpx::future<hpx::id_type> remote = hpx::new_<remote_object_component>(where); //prints hey on second locality hpx::apply(call_action{}, remote.get()); }
  • 42. Writing an HPX client for component 42HPX — Runtime System for Parallel and Distributed Computing struct remote_object: hpx::components::client_base< remote_object, remote_object_component> { using base_type = ...; remote_object(hpx::id_type where): base_type{ hpx::new_<remote_object_component>(where)} {} void apply_call() const { hpx::apply(call_action{}, get_id()); } };
  • 43. Writing an HPX client for component 43HPX — Runtime System for Parallel and Distributed Computing int main() { hpx::id_type where = hpx::find_remote_localities()[0]; remote_object obj{where}; obj.apply_call(); return 0; }
  • 44. Writing an HPX client for component 44HPX — Runtime System for Parallel and Distributed Computing Locality 1 Locality 2 Global Address Space struct remote_object_component: simple_component_base<…> struct remote_object: client_base<…>
  • 45. Writing multiple HPX clients 45HPX — Runtime System for Parallel and Distributed Computing int main() { std::vector<hpx::id_type> locs = hpx::find_all_localities(); std::vector<remote_object> objs { locs.cbegin(), locs.cend()}; for (const auto& obj : objs) obj.apply_call(); }
  • 46. Writing multiple HPX clients 46HPX — Runtime System for Parallel and Distributed Computing Locality 1 Locality 2 Locality N Global Address Space
  • 47. HPX: distributed point of view 47HPX — Runtime System for Parallel and Distributed Computing
  • 48. HPX parallel algorithms 48HPX — Runtime System for Parallel and Distributed Computing
  • 49. HPX parallel algorithms 49HPX — Runtime System for Parallel and Distributed Computing template<class ExecutionPolicy, class InputIterator, class Function> void for_each(ExecutionPolicy&& exec, InputIterator first, InputIterator last, Function f); • Execution policy sequential_execution_policy parallel_execution_policy parallel_vector_execution_policy hpx(std)::parallel::seq hpx(std)::parallel::par hpx(std)::parallel::par_vec
  • 50. HPX parallel algorithms 50HPX — Runtime System for Parallel and Distributed Computing template<class ExecutionPolicy, class InputIterator, class Function> void for_each(ExecutionPolicy&& exec, InputIterator first, InputIterator last, Function f); • Execution policy sequential_execution_policy parallel_execution_policy parallel_vector_execution_policy sequential_task_execution_policy parallel_task_execution_policy hpx::parallel::seq(task) hpx::parallel::par(task) HPX hpx(std)::parallel::seq hpx(std)::parallel::par hpx(std)::parallel::par_vec
  • 51. HPX map reduce algorithm example 51HPX — Runtime System for Parallel and Distributed Computing template <class T, class Mapper, class Reducer> T map_reduce(const std::vector<T>& input, Mapper mapper, Reducer reducer) { // ??? }
  • 52. HPX map reduce algorithm example 52HPX — Runtime System for Parallel and Distributed Computing template <class T, class Mapper, class Reducer> T map_reduce(const std::vector<T>& input, Mapper mapper, Reducer reducer) { std::vector<T> temp(input.size()); std::transform(std::begin(input), std::end(input), std::begin(temp), mapper); return std::accumulate(std::begin(temp), std::end(temp), T{}, reducer); }
  • 53. HPX map reduce algorithm example 53HPX — Runtime System for Parallel and Distributed Computing template <class T, class Mapper, class Reducer> future<T> map_reduce(const std::vector<T>& input, Mapper mapper, Reducer reducer) { auto temp = std::make_shared<std::vector>( input.size()); auto mapped = transform(par(task), std::begin(input), std::end(input), std::begin(*temp), mapper); return mapped.then( [temp, reducer](auto) { return reduce(par(task), std::begin(*temp), std::end(*temp), T{}, reducer); }); }
  • 54. HPX map reduce algorithm example 54HPX — Runtime System for Parallel and Distributed Computing template <class T, class Mapper, class Reducer> future<T> map_reduce(const std::vector<T>& input, Mapper mapper, Reducer reducer) { using namespace hpx::parallel; return transform_reduce(par(task), std::begin(input), std::end(input), mapper, T{}, reducer); }
  • 55. Thank you for your attention! HPX — Runtime System for Parallel and Distributed Computing • https://github.com/stellar-group/hpx