Skip to content

Instantly share code, notes, and snippets.

@hkaiser
hkaiser / functor.cpp
Created July 5, 2012 23:50 — forked from pesterie/functor.cpp
register functor
#include <hpx/hpx.hpp>
#include <hpx/hpx_init.hpp>
#include <hpx/runtime/actions/plain_action.hpp>
#include <hpx/components/dataflow/dataflow.hpp>
#include <iostream>
#include <cstdlib>
template<class T>
struct add_
# $HPX_INI points to hpx.ini below
HPX_INI=D:/Devel/hpx_applications/hpx.ini
#########################################################################
# hpx.ini
[hpx]
ini_path=$[hpx.ini_path];D:/Devel/hpx_applications/had_amr/build/Debug.vc10/Debug/lib/hpx
#########################################################################
# had_amr.ini
-a = --hpx:agas
-c = --hpx:console
-h = --hpx:help
--help = --hpx:help
-I = --hpx:ini
-l = --hpx:localities
-p = --hpx:app-config
-q = --hpx:queuing
-r = --hpx:run-agas-server
-t = --hpx:threads
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1>Build started 8/16/2012 8:32:05 AM.
1>InitializeBuildStatus:
1> Creating "x64\Debug\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>FinalizeBuildStatus:
1> Deleting file "x64\Debug\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild".
1> Touching "x64\Debug\ZERO_CHECK\ZERO_CHECK.lastbuildstate".
1>
1>Build succeeded.
1>
/
TEST in particle 1 my_pdl 0 mype 0
TEST left 9 right 1
TEST in particle 0 my_pdl 0 mype 1
TEST left 0 right 2
TEST in particle 0 my_pdl 0 mype 2
TEST left 1 right 3
TEST in particle 0 my_pdl 0 mype 3
TEST left 2 right 4
TEST in particle 0 my_pdl 0 mype 4
void f()
{
//use dynamic loading to load and invoke visit here
}
template<
void (*F)()
>
struct action
{
template <class T>
auto futurized(const T& t)
{
auto fut = hpx::async(...);
return fut.then(
[&t](auto){...});
}
int main()
{
struct comp {};
void foo(comp const& c)
{
async(&foo, std::ref(c));
}
void bar(comp && c)
{
async(&foo, std::move(c));
response addressing_service::service(
request const& req
, error_code& ec
)
{
return client_->service(req, ec);
}
Configuration after runtime start:
----------------------------------
============================
[application]
[hpx]
'affinity' : 'pu'
'bind' : 'balanced'
'cmd_line' : 'hello_world.exe --hpx:dump-config'
'component_path' : '$[hpx.location];$[system.executable_prefix]' -> 'D:\Devel\hpx\build\All.vc14\Debug;D:\Devel\hpx\build\All.vc14\Debug'
'component_path_suffixes' : '/lib/hpx;/bin/hpx'