Hi,

I'm writing an application that requires an Action to be parameterised by a
user provided function, in the style of Cole's algorithmic skeletons.

Currently the user provides these functions as Action types (since we need
to be able to serialise them and we can use them as template params).
Something along the lines of:

HPX_PLAIN_ACTION(userFn, userFn_act)
HPX_PLAIN_ACTION(skeleton<userFn_act>, skeleton_act)

Essentially giving us a new type that "captures" the user provided function.

Unfortunately for the application (recursive tree search, with several
million calls to the function), calling userFn as an action slows things
down significantly (additional allocations and synchronisation overhead).
Even defining it as a direct action still seems to add additional
synchronisation.

Ideally, for performance, I'd like to get the raw function pointer back
once I call "skeleton" on a possibly remote node. Something like:

fastTask(userFnType & fn);

template<userFn>
skeletonTask() {

userFn fn;
fastTask(fn.getRawPointer());

}

Does such a method exist? Or am I looking at this in the wrong manner? Is
there a better way to serialise raw function pointers without using the
Action interface? I know that it is only ever "skeleton" that will be
called in an async.

Many thanks,
Blair
_______________________________________________
hpx-users mailing list
[email protected]
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users

Reply via email to