This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int init_my_tool(bool verbose){ | |
if(verbose){ | |
gotcha_wrap(a_few_functions); | |
} | |
else{ | |
gotcha_wrap(all_the_functions); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssize_t (*orig_read)(int fildes, void *buf, size_t nbyte); | |
ssize_t read_wrapper(int fildes, void* buf, size_t nbyte){ | |
cali::Annotation("bytes_read").set(nbyte); | |
return orig_read(fildes, buf, nbyte); | |
} | |
struct gotcha_binding_t wrap_actions[] = { | |
{ "read", read_wrapper, &orig_read } | |
}; | |
void init_bytecounter_tool(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssize_t (*orig_read)(int fildes, void *buf, size_t nbyte); | |
ssize_t read_wrapper(int fildes, void* buf, size_t nbyte){ | |
TAU_REGISTER_CONTEXT_EVENT(event, "Bytes read"); | |
TAU_CONTEXT_EVENT(event, nbyte); | |
return orig_read(fildes, buf, nbyte); | |
} | |
struct gotcha_binding_t wrap_actions[] = { | |
{ "read", read_wrapper, &orig_read } | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash-4.2$ ./autogen.sh | |
Running autoreconf -i ... | |
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'. | |
libtoolize: copying file `config/ltmain.sh' | |
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'. | |
libtoolize: copying file `m4/libtool.m4' | |
libtoolize: copying file `m4/ltoptions.m4' | |
libtoolize: copying file `m4/ltsugar.m4' | |
libtoolize: copying file `m4/ltversion.m4' | |
libtoolize: copying file `m4/lt~obsolete.m4' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int MPI_Send(const void *buf, int count, | |
MPI_Datatype datatype, int dest, int tag, | |
MPI_Comm comm){ | |
// MPI Things | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int MPI_Send( /* Args */ ){ | |
// typical MPI code | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kokkos::TeamPolicy<Kokkos::Cuda> execution_policy(total_amount_of_work, | |
outer_parallelism_batch_size, | |
inner_parallelism_batch_size); | |
Kokkos::parallel_for("implement_psychics", execution_policy, | |
KOKKOS_LAMBDA (team_member outer_handle) { | |
// some outer level work | |
double sum = psychics; | |
parallel_reduce (ThreadVectorRange (outer_handle, loop_count), | |
[=] (int& i, Scalar& lsum) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern "C" void kokkosp_begin_parallel_for(const char* name, const uint32_t devID, uint64_t* kID){ | |
if(name matches a regex){ | |
jonathans_api_wrapper_start(); | |
*kID = 1; | |
} | |
} | |
extern "C" void kokkosp_end_parallel_for(uint64_t kID){ | |
if(kID==1){ | |
jonathans_api_wrapper_stop(); | |
} |
OlderNewer