Skip to content

Commit d7ef2ac

Browse files
committed
Fixes getPhysicalMemory() on Mac machines (broken in previous fix).
1 parent e2ad025 commit d7ef2ac

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: ParallelLogger
22
Type: Package
33
Title: Support for Parallel Computation, Logging, and Function Automation
4-
Version: 3.4.1
5-
Date: 2025-03-28
4+
Version: 3.4.2
5+
Date: 2025-04-10
66
Authors@R: c(
77
person("Martijn", "Schuemie", email = "schuemie@ohdsi.org", role = c("aut", "cre")),
88
person("Marc", "Suchard", role = c("aut")),

NEWS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
ParallelLogger 3.4.2
2+
====================
3+
4+
Bugfixes
5+
6+
1. Fixes `getPhysicalMemory()` on Mac machines (broken in previous fix).
7+
8+
19
ParallelLogger 3.4.1
210
====================
311

R/Cluster.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ getPhysicalMemory <- function() {
339339
}
340340
} else if (os == "Linux" || os == "Darwin") {
341341
memory <- tryCatch(
342-
as.numeric(system("/usr/sbin/sysctl -n hw.memsize", intern = TRUE))/1e+09,
342+
as.numeric(system("/usr/sbin/sysctl -n hw.memsize", intern = TRUE))/1e+09, # Convert to GB
343343
error = function(e) {
344344
return(NA)
345345
},
@@ -348,7 +348,7 @@ getPhysicalMemory <- function() {
348348
}
349349
)
350350
if (!is.na(memory)) {
351-
return(memory / (1e9)) # Convert to GB
351+
return(memory)
352352
} else {
353353
memory <- tryCatch({
354354
output <- system("grep MemTotal /proc/meminfo", intern = TRUE)

0 commit comments

Comments
 (0)