Skip to content

Instantly share code, notes, and snippets.

@DavidPoliakoff
Last active November 12, 2018 22:48
Show Gist options
  • Save DavidPoliakoff/24fa407e38221a44a35c122162b3ee3b to your computer and use it in GitHub Desktop.
Save DavidPoliakoff/24fa407e38221a44a35c122162b3ee3b to your computer and use it in GitHub Desktop.
struct gotcha_binding_t mpi_wrappers[] = {
{ "MPI_Init", mpi_init_wrapper, &orig_mpi_init_handle },
// other wrappers as desired
};
static int mpi_init_wrapper(int* argc, char*** argv )
{
typeof(&puts) orig_init = gotcha_get_wrappee(orig_mpi_init_handle);
/** do tool_things */
return orig_init(str);
}
void init_tool()
{
if(you_want_to){
result = gotcha_wrap(mpi_wrappers,
number_of_wrappers,
"myToolName");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment