Learn R Programming

⚠️There's a newer version (3.4.1) 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 4.0.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("remotes")
library(remotes)
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,721

Version

3.0.1

License

Apache License 2.0

Issues

Pull Requests

Stars

Forks

Maintainer

Martijn Schuemie

Last Published

June 7th, 2022

Functions in ParallelLogger (3.0.1)

convertJsonToSettings

Converts a JSON string to a settings object
loadSettingsFromJson

Load a settings object from a JSON file
matchInList

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

Convert a settings object to a JSON string
logDebug

Log a message at the DEBUG level
registerLogger

Register a logger
clearLoggers

Remove all registered loggers
layoutEmail

Logging layout for e-mail
layoutParallel

Logging layout for parallel computing
layoutErrorReport

Logging layout for error report
addDefaultFileLogger

Add the default file logger
layoutSimple

Simple logging layout
logFatal

Log a message at the FATAL level
logError

Log a message at the ERROR level
stopCluster

Stop the cluster
unregisterLogger

Unregister a logger
createArgFunction

Create an argument function
clusterApply

Apply a function to a list using the cluster
layoutStackTrace

Logging layout with stack trace
clusterRequire

Require a package in the cluster
createConsoleAppender

Create console appender
createLogger

Create a logger
layoutTimestamp

Logging layout with timestamp
saveSettingsToJson

Save a settings object as JSON file
excludeFromList

Exclude variables from a list of objects of the same type
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
addDefaultConsoleLogger

Add the default console logger
ParallelLogger-package

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

Add the default e-mail logger
createEmailAppender

Create e-mail appender
createFileAppender

Create file appender
getLoggers

Get all registered loggers
addDefaultErrorReportLogger

Add the default error report logger
launchLogViewer

Launch the log viewer Shiny app