Learn R Programming

⚠️There's a newer version (3.4.2) of this package.Take me there.

ParallelLogger

ParallelLogger is part of HADES.

Introduction

Support for parallel computation with progress bar, and option to stop or proceed on errors. Also provides logging to console and disk, and the logging persists in the parallel threads. Additional functions support function call automation with delayed execution (e.g. for executing functions in parallel).

Features

  • Functions for parallel computation.
  • Functions for logging, including automated logging for errors and warnings.
  • Functions used for automating analyses.

Examples

# Run a function in parallel:
fun <- function(x) {
  return (x^2)
}

cluster <- makeCluster(numberOfThreads = 3)
result <- clusterApply(cluster, 1:10, fun)
stopCluster(cluster)

# Create a file logger:
addDefaultFileLogger("log.txt")
logTrace("Hello world")

Technology

ParallelLogger is an R package.

System Requirements

Requires R (version 3.1.0 or higher)

Getting Started

In R, to install the latest stable version, install from CRAN:

install.packages("ParallelLogger")

To install the latest development version, install from the develop branch in GitHub:

install.packages("devtools")
devtools::install_github("ohdsi/ParallelLogger", ref = "develop")

User Documentation

Documentation can be found on the package website.

PDF versions of the documentation is also available:

Contributing

Read here how you can contribute to this package.

Support

  • Developer questions/comments/feedback: OHDSI Forum
  • We use the GitHub issue tracker for all bugs/issues/enhancements

Contributing

Read here how you can contribute to this package.

License

ParallelLogger is licensed under Apache License 2.0

Development

ParallelLogger is being developed in R Studio.

Development status

Ready for use

Acknowledgements

  • This project is supported in part through the National Science Foundation grant IIS 1251151.

Copy Link

Version

Install

install.packages('ParallelLogger')

Monthly Downloads

2,795

Version

2.0.0

License

Apache License 2.0

Issues

Pull Requests

Stars

Forks

Maintainer

Martijn Schuemie

Last Published

June 7th, 2020

Functions in ParallelLogger (2.0.0)

addDefaultConsoleLogger

Add the default console logger
createFileAppender

Create file appender
layoutTimestamp

Logging layout with timestamp
createEmailAppender

Create e-mail appender
layoutStackTrace

Logging layout with stack trace
logError

Log a message at the ERROR level
saveSettingsToJson

Save a settings object as JSON file
createConsoleAppender

Create console appender
createArgFunction

Create an argument function
logFatal

Log a message at the FATAL level
getLoggers

Get all registered loggers
createLogger

Create a logger
stopCluster

Stop the cluster
unregisterLogger

Unregister a logger
selectFromList

Select variables from a list of objects of the same type
logTrace

Log a message at the TRACE level
makeCluster

Create a cluster of nodes for parallel computation
logWarn

Log a message at the WARN level
logInfo

Log a message at the INFO level
excludeFromList

Exclude variables from a list of objects of the same type
loadSettingsFromJson

Load a settings object from a JSON file
layoutEmail

Logging layout for e-mail
logDebug

Log a message at the DEBUG level
layoutErrorReport

Logging layout for error report
matchInList

In a list of object of the same type, find those that match the input
registerLogger

Register a logger
layoutParallel

Logging layout for parallel computing
layoutSimple

Simple logging layout
launchLogViewer

Launch the log viewer Shiny app
addDefaultErrorReportLogger

Add the default error report logger
addDefaultFileLogger

Add the default file logger
clusterApply

Apply a function to a list using the cluster
convertJsonToSettings

Converts a JSON string to a settings object
clusterRequire

Require a package in the cluster
addDefaultEmailLogger

Add the default e-mail logger
ParallelLogger-package

ParallelLogger: Support for Parallel Computation, Logging, and Function Automation
clearLoggers

Remove all registered loggers
convertSettingsToJson

Convert a settings object to a JSON string