Skip to content

Commit

Permalink
Correcting auto-generated documentation for non-exported functions. S…
Browse files Browse the repository at this point in the history
…ome internal functions are still exported unnecessarily
  • Loading branch information
DylanKierans committed Mar 25, 2024
1 parent 99fce0e commit c294ae1
Show file tree
Hide file tree
Showing 10 changed files with 190 additions and 221 deletions.
63 changes: 8 additions & 55 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -1,64 +1,14 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' finalize_otf2_server
#' @return R_NilValue
NULL

#' Initialize static otf2 {archive} objs
#' @param archivePath Path to the archive i.e. the directory where the anchor file is located.
#' @param archiveName Name of the archive. It is used to generate sub paths e.g. "archiveName.otf2"
#' @return R_NilValue
NULL

#' Close static otf2 {archive} objs
NULL

#' Initialize static otf2 {evt_writers} objs
NULL

#' Close static otf2 {evt_writers} objs
NULL

#' Enable or disable event measurement
#' @param evt_writer Event writer linked to proc
#' @param time Timestamp
#' @param measurementMode True to enable, else disable
NULL

#' Init static otf2 {globaldefwriter} obj
NULL

#' Finalize static otf2 {globaldefwriter} obj
#' Write clock information before ending tracing
NULL

#' Define new id-value pair in globaldefwriter
#' @param stringRefValue String assigned to given id
#' @return NUM_STRINGREF
NULL

#' globalDefWriter_WriteRegion
#' Define new region description in global writer
#' @param stringRef_RegionName Name to be associated with region
#' @return regionRef id/index for string
NULL

#' Write the system tree including a definition for the location group to the global definition writer.
#' @param stringRef_name Name to be associated with SystemTreeNode (eg MyHost)
#' @param stringRef_class Class to be associated with SystemTreeNode (eg node)
NULL

#' Write a definition for the location to the global definition writer.
NULL

#' Fork and initialize zeromq sockets for writing globalDef definitions
#' @param max_nprocs Maximum number of R processes (ie evtWriters required)
#' @param archivePath Path to otf2 archive
#' @param archiveName Name of otf2 archive
#' @return R_NilValue
init_otf2_logger <- function(max_nprocs, archivePath = "./rTrace", archiveName = "rTrace") {
.Call('_rTrace_init_otf2_logger', PACKAGE = 'rTrace', max_nprocs, archivePath, archiveName)
#' @param flag_print_pids True to print pids of parent and child procs
#' @return <0 if error, 0 if R master, else >0 if child
init_otf2_logger <- function(max_nprocs, archivePath = "./rTrace", archiveName = "rTrace", flag_print_pids = FALSE) {
.Call('_rTrace_init_otf2_logger', PACKAGE = 'rTrace', max_nprocs, archivePath, archiveName, flag_print_pids)
}

#' assign_regionRef_array_master
Expand All @@ -78,7 +28,7 @@ assign_regionRef_array_slave <- function(num_funcs) {
}

#' get_regionRef_from_array_slave
#' @param func_index Index of function to fet regionRef for
#' @param func_index Index of function to get regionRef for
#' @return regionRef
get_regionRef_from_array_slave <- function(func_index) {
.Call('_rTrace_get_regionRef_from_array_slave', PACKAGE = 'rTrace', func_index)
Expand Down Expand Up @@ -111,6 +61,7 @@ finalize_EvtWriter_client <- function() {
}

#' finalize_otf2_client
#' @description Send signal to server to stop collecting event information
#' @return R_NilValue
finalize_otf2_client <- function() {
.Call('_rTrace_finalize_otf2_client', PACKAGE = 'rTrace')
Expand Down Expand Up @@ -164,6 +115,7 @@ set_maxUsedLocationRef_client <- function(nprocs) {
}

#' print_errnos
#' @description Print error numbers relating to zmq sockets
#' @return R_NilValue
print_errnos <- function() {
.Call('_rTrace_print_errnos', PACKAGE = 'rTrace')
Expand Down Expand Up @@ -193,6 +145,7 @@ get_regionRef_array_master <- function(nprocs) {
}

#' get_regionRef_array_slave
#' @description Requests regionRef array from logger proc
#' @param num_funcs Total number of functions in R namespace
#' @return R_NilValue
get_regionRef_array_slave <- function(num_funcs) {
Expand Down
22 changes: 1 addition & 21 deletions R/r_fork_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ get_fork_wrapper_expression <- function() {
exit_exp <- expression( {
on.exit({
## DEBUGGING
print(paste0("makeForkCluster nnodes: ", nnodes))
#print(paste0("makeForkCluster nnodes: ", nnodes))

# Set r proc IDs - note master=0
clusterApply(cl, 1:as.integer(nnodes), function(x){ set_locationRef(x); })
Expand Down Expand Up @@ -307,7 +307,6 @@ get_psock_wrapper_expression <- function() {
# Save instrumentation state
INSTRUMENTATION_ENABLED_BEFORE <- is_instrumentation_enabled()

## DEBUGGING
if (pkg.env$INSTRUMENTATION_ENABLED) {
## Append to depth counter
pkg.env$FUNCTION_DEPTH <- pkg.env$FUNCTION_DEPTH + 1
Expand Down Expand Up @@ -336,13 +335,6 @@ get_psock_wrapper_expression <- function() {
# WARNING: muster go after master_init_slave(), after importing function
clusterApply(cl, 1:nnodes, function(x){ set_locationRef(x); })

## DEBUGGING
clusterEvalQ(cl, print(.packages()))
print(.packages())

# YOU ARE HERE #1
## DEBUGGING - Check if func_list are equal or nej

# Reopen sockets on all procs
clusterEvalQ(cl, {open_EvtWriterSocket_client()});

Expand Down Expand Up @@ -393,10 +385,6 @@ master_init_slave <- function(cl) {
pkg_cmd <- paste0(tmp, pkg_cmd)
}

## DEBUGGING
print("package_list: ")
print(pkg_cmd)

# Exports libraries
parallel::clusterExport(cl, c("pkg_cmd"), envir=environment())
parallel::clusterEvalQ(cl, eval(parse(text = pkg_cmd)))
Expand All @@ -419,13 +407,5 @@ master_init_slave <- function(cl) {
user_func_list <- get_user_function_list()
parallel::clusterExport(cl, names(user_func_list), envir=.GlobalEnv)

## DEBUGGING
#print(names(user_func_list))

## Assign regionRef_array on slave
#parallel::clusterEvalQ(cl, assign_regionRef_array_slave(
# sum(get_num_functions(flag_user_functions = T))
#))

}

1 change: 0 additions & 1 deletion R/r_instrument_ll.R
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ try_insert_instrumentation <- function(func_info, func_ptrs, env_is_locked,
# Get new body for funcs of type: {fork_function, end_fork_function, default}
body(func_ptr) <- get_new_function_body(func_ptr, func_name, regionRef)

## DEBUGGING: Comment out to disable compiling for testing
## TODO: Add check for if compiled before, recompile
#func_ptr <- compiler::cmpfun(func_ptr)

Expand Down
2 changes: 1 addition & 1 deletion man/finalize_otf2_client.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_regionRef_array_slave.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_regionRef_from_array_slave.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions man/init_otf2_logger.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/print_errnos.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// init_otf2_logger
RcppExport int init_otf2_logger(int max_nprocs, Rcpp::String archivePath, Rcpp::String archiveName);
RcppExport SEXP _rTrace_init_otf2_logger(SEXP max_nprocsSEXP, SEXP archivePathSEXP, SEXP archiveNameSEXP) {
RcppExport int init_otf2_logger(int max_nprocs, Rcpp::String archivePath, Rcpp::String archiveName, bool flag_print_pids);
RcppExport SEXP _rTrace_init_otf2_logger(SEXP max_nprocsSEXP, SEXP archivePathSEXP, SEXP archiveNameSEXP, SEXP flag_print_pidsSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< int >::type max_nprocs(max_nprocsSEXP);
Rcpp::traits::input_parameter< Rcpp::String >::type archivePath(archivePathSEXP);
Rcpp::traits::input_parameter< Rcpp::String >::type archiveName(archiveNameSEXP);
rcpp_result_gen = Rcpp::wrap(init_otf2_logger(max_nprocs, archivePath, archiveName));
Rcpp::traits::input_parameter< bool >::type flag_print_pids(flag_print_pidsSEXP);
rcpp_result_gen = Rcpp::wrap(init_otf2_logger(max_nprocs, archivePath, archiveName, flag_print_pids));
return rcpp_result_gen;
END_RCPP
}
Expand Down Expand Up @@ -247,7 +248,7 @@ END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
{"_rTrace_init_otf2_logger", (DL_FUNC) &_rTrace_init_otf2_logger, 3},
{"_rTrace_init_otf2_logger", (DL_FUNC) &_rTrace_init_otf2_logger, 4},
{"_rTrace_assign_regionRef_array_master", (DL_FUNC) &_rTrace_assign_regionRef_array_master, 1},
{"_rTrace_assign_regionRef_array_slave", (DL_FUNC) &_rTrace_assign_regionRef_array_slave, 1},
{"_rTrace_get_regionRef_from_array_slave", (DL_FUNC) &_rTrace_get_regionRef_from_array_slave, 1},
Expand Down
Loading

0 comments on commit c294ae1

Please sign in to comment.