parsec
parsec copied to clipboard
Remote completion callback should be an AM tag, not a a function pointer disguised as AM tag
Original post: https://bitbucket.org/icldistcomp/parsec/pull-requests/217#comment-210854865
The semantic of the r_tag
parameter to parsec_ce_put_fn_t
and parsec_ce_get_fn_t
needs clarification: since it is parsec_ce_tag_t
it appears to be a previously registered AM tag. However, the revamp MPI backend treats it as a function pointer. The reason this works right now is that in the remote_deps
implementation a function pointer is passed along with the request for data, which is then transferred back as part of the GET and eventually invoked where it came from (the remote that asked for the data). This way it is safe but taking a function’s address on one process and calling it on another is generally not guaranteed to work, thanks to ASLR.
The only safe way is to treat the tag as a tag, not a function pointer. We should probably store the tags in an array (instead of a hash table) for fast lookup, too.