Skip to content

Commit 644892f

Browse files
committed
Update to new HPX API
1 parent d61ad27 commit 644892f

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

lecture11.tex

+15-15
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ \section{Parallel algorithms}
281281
#include<hpx/include/parallel_reduce.hpp>
282282
#include<vector>
283283

284-
hpx::parallel::v1::reduce(
285-
hpx::parallel::execution::par,
284+
hpx::ranges::reduce(
285+
hpx::execution::par,
286286
values.begin(),values.end(),0);
287287

288288
\end{lstlisting}
@@ -297,19 +297,19 @@ \section{Parallel algorithms}
297297
\begin{lstlisting}
298298
auto f =
299299

300-
hpx::parallel::v1::reduce(
301-
hpx::parallel::execution::par(
302-
hpx::parallel::execution::task),
300+
hpx::ranges::reduce(
301+
hpx::execution::par(
302+
hpx::execution::task),
303303
values.begin(),
304304
values.end(),0);
305305

306306
std::cout<< f.get();
307307
\end{lstlisting}
308308

309309
\begin{itemize}
310-
\item \lstinline|hpx::parallel::execution::par| Parallel execution
311-
\item \lstinline|hpx::parallel::execution::seq| Sequential execution
312-
\item \lstinline|hpx::parallel::execution::task| Task-based execution
310+
\item \lstinline|hpx::execution::par| Parallel execution
311+
\item \lstinline|hpx::execution::seq| Sequential execution
312+
\item \lstinline|hpx::execution::task| Task-based execution
313313
\end{itemize}
314314

315315
\end{frame}
@@ -321,19 +321,19 @@ \section{Parallel algorithms}
321321
\begin{lstlisting}
322322
#include<hpx/include/parallel_executor_parameters.hpp>
323323

324-
hpx::parallel::execution::static_chunk_size scs(10);
325-
hpx::parallel::v1::reduce(
326-
hpx::parallel::execution::par.with(scs),
324+
hpx::execution::static_chunk_size scs(10);
325+
hpx::ranges::reduce(
326+
hpx::execution::par.with(scs),
327327
values.begin(),
328328
values.end(),0);
329329
\end{lstlisting}
330330

331331
\begin{itemize}
332-
\item \lstinline|hpx::parallel::execution::static_chunk_size| \\
332+
\item \lstinline|hpx::execution::static_chunk_size| \\
333333
Loop iterations are divided into pieces of a given size and then assigned to threads.
334-
\item \lstinline|hpx::parallel::execution::auto_chunk_size| \\
334+
\item \lstinline|hpx::execution::auto_chunk_size| \\
335335
Pieces are determined based on the first 1\% of the total loop iterations.
336-
\item \lstinline|hpx::parallel::execution::dynamic_chunk_size| \\
336+
\item \lstinline|hpx::execution::dynamic_chunk_size| \\
337337
Dynamically scheduled among the cores and if one core finished it gets dynamically assigned a new chunk.
338338
\end{itemize}
339339

@@ -351,7 +351,7 @@ \section{Parallel algorithms}
351351
std::vector<double> values = {1,2,3,4,5,6,7,8,9};
352352

353353
hpx::parallel::for_loop(
354-
hpx::parallel::execution::par,
354+
hpx::execution::par,
355355
0,
356356
values.size();
357357
[](boost::uint64_t i)

lecture15.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ \section{Simulation control}
249249
{
250250
// Set the boundary conditions in parallel
251251
auto range = boost::irange(b, np);
252-
using hpx::parallel::execution::par;
252+
using hpx::execution::par;
253253
hpx::parallel::for_each(par, std::begin(range),
254254
std::end(range),[&U, nx](std::size_t i)
255255
{

0 commit comments

Comments
 (0)