Skip to content

Instantly share code, notes, and snippets.

@kempj
kempj / dataflow_exec.cpp
Created November 18, 2017 01:19
dataflow with executor example
#include <hpx/hpx.hpp>
#include <hpx/dataflow.hpp>
#include <hpx/parallel/executors/thread_pool_executors.hpp>
#include <iostream>
using hpx::threads::executors::local_priority_queue_executor;
using hpx::shared_future;
using hpx::dataflow;
using hpx::async;
#0 add (ec=..., stacksize=hpx::threads::thread_stacksize_small, run_now=false, initial_state=hpx::threads::pending, desc=0x7ffff78b2b21 "<unknown>",
f=..., this=0x7ffff7fe3e70) at /home/jeremy/hpx/include/hpx/runtime/threads/thread_executor.hpp:166
#1 hpx::lcos::detail::task_base<void>::apply (this=0xec0c00, priority=priority@entry=hpx::threads::thread_priority_default,
stacksize=stacksize@entry=hpx::threads::thread_stacksize_small, ec=...) at /home/jeremy/hpx/include/hpx/lcos/detail/future_data.hpp:596
#2 0x0000000000453b41 in apply (ec=..., stacksize=hpx::threads::thread_stacksize_small, priority=hpx::threads::thread_priority_default,
this=0x7ffff7fe3d70) at /home/jeremy/hpx/include/hpx/lcos/local/packaged_task.hpp:212
#3 async<void (&)(int, int), int&, int&> (f=@0x4534a0: {void (int, int)} 0x4534a0 <print_ints(int, int)>, a1=<synthetic pointer>,
a0=<synthetic pointer>, sched=...) at /home/jeremy/hpx/include/hpx/preprocessed/async_5.hpp:227
#4 thread_setup (i=0, exec=...) at exec_te
jeremy@T420:~/code/research/hpxMP$ make par-test
LD_PRELOAD=./libopenmp.so.1 ./omp-tests/omp-par
./omp-tests/omp-par: ./libopenmp.so.1: no version information available (required by ./omp-tests/omp-par)
Starting HPX OpenMP runtime
{stack-trace}: 10 frames:
0x2b61b92b0f45 : hpx::util::backtrace::backtrace(unsigned long) + 0x81 in /home/jeremy/hpxd/lib/hpx/libhpxd.so.0
0x2b61b92c1e86 : hpx::util::trace_on_new_stack() + 0x1e in /home/jeremy/hpxd/lib/hpx/libhpxd.so.0
0x2b61b92be6b5 : hpx::detail::backtrace() + 0x18 in /home/jeremy/hpxd/lib/hpx/libhpxd.so.0
0x2b61b92c232f : boost::exception_ptr hpx::detail::get_exception<hpx::exception>(hpx::exception const&, std::string const&, std::string const&, long) + 0x92 in /home/jeremy/hpxd/lib/hpx/libhpxd.so.0
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<hpx::exception> >'
what(): global applier object is not accessible: HPX(invalid_status)
Aborted (core dumped)
LD_PRELOAD=./libopenmp.so ./omp-tests/bots/bin/strassen.openuh.omp-tasks -n 8192 -c
Computing sequential Strassen algorithm (n=8192) completed!
Computing parallel Strassen algorithm (n=8192) Starting HPX OpenMP runtime
HPX OpenMP runtime has started
completed!
Program = Strassen
Parameters = N=8192:Y=64
Model = OpenMP (using tasks)
Embedded cut-off = none
{what}: Segmentation fault
{config}:
HPX_HAVE_NATIVE_TLS=ON
HPX_HAVE_STACKTRACES=ON
HPX_HAVE_COMPRESSION_BZIP2=OFF
HPX_HAVE_COMPRESSION_SNAPPY=OFF
HPX_HAVE_COMPRESSION_ZLIB=OFF
HPX_HAVE_PARCEL_COALESCING=ON
HPX_HAVE_PARCELPORT_SHMEM=OFF
HPX_HAVE_PARCELPORT_IBVERBS=OFF
#include "hpxMP.h"
#include <iostream>
#include <cstdlib>
#include <vector>
#include <string>
#include <hpx/hpx.hpp>
#include <hpx/hpx_fwd.hpp>
#include <hpx/hpx_init.hpp>
#include <hpx/runtime/threads/topology.hpp>
make
g++ -fPIC -c hpxMP.cpp -o hpxMP.o `pkg-config --cflags --libs hpx_application`
hpxMP.cpp: In constructor ‘initialize_hpx::initialize_hpx(int, omp_micro, frame_pointer_t)’:
hpxMP.cpp:115:56: error: invalid initialization of non-const reference of type ‘std::basic_string<char>&’ from an rvalue of type ‘std::string {aka std::basic_string<char>}’
boost::algorithm::token_compress_on);
^
In file included from /home/jeremy/hpx/include/hpx/runtime/components/component_registry.hpp:24:0,
from /home/jeremy/hpx/include/hpx/include/components.hpp:11,
from /home/jeremy/hpx/include/hpx/include/runtime.hpp:11,
from /home/jeremy/hpx/include/hpx/hpx.hpp:11,
hpxMP.cpp: In constructor ‘initialize_hpx::initialize_hpx(int, omp_micro, frame_pointer_t)’:
hpxMP.cpp:115:56: error: invalid initialization of non-const reference of type ‘std::basic_string<char>&’ from an rvalue of type ‘std::string {aka std::basic_string<char>}’
boost::algorithm::token_compress_on);
^
In file included from /home/jeremy/hpx/include/hpx/runtime/components/component_registry.hpp:24:0,
from /home/jeremy/hpx/include/hpx/include/components.hpp:11,
from /home/jeremy/hpx/include/hpx/include/runtime.hpp:11,
from /home/jeremy/hpx/include/hpx/hpx.hpp:11,
from hpxMP.cpp:7:
/home/jeremy/boost/include/boost/algorithm/string/split.hpp:140:35: error: in passing argument 1 of ‘SequenceSequenceT& boost::algorithm::split(SequenceSequenceT&, RangeT&, PredicateT, boost::algorithm::token_compress_mode_type) [with SequenceSequenceT = std::basic_string<char>; RangeT = st
make
g++ -fPIC -c hpxMP.cpp -o hpxMP.o `pkg-config --cflags --libs hpx_application`
hpxMP.cpp: In function ‘void __ompc_fork(int, omp_micro, frame_pointer_t)’:
hpxMP.cpp:111:52: error: invalid initialization of non-const reference of type ‘std::basic_string<char>&’ from an rvalue of type ‘std::string {aka std::basic_string<char>}’
boost::algorithm::token_compress_on);
^
In file included from /home/jeremy/hpx/include/hpx/runtime/components/component_registry.hpp:24:0,
from /home/jeremy/hpx/include/hpx/include/components.hpp:11,
from /home/jeremy/hpx/include/hpx/include/runtime.hpp:11,
from /home/jeremy/hpx/include/hpx/hpx.hpp:11,