calculate_max_perm_per_core: Calculate the number of permutations in a null model that can...

View source: R/calculate_max_perm_per_core.R

calculate_max_perm_per_coreR Documentation

Calculate the number of permutations in a null model that can fit in RAM partitioned for a single thread

Description

Calculate the number of permutations in a null model that can fit in RAM partitioned for a single thread

Usage

calculate_max_perm_per_core(nm_RAM_per_perm, RAM, n_thread, verbose = TRUE)

Arguments

nm_RAM_per_perm

Integer, the amount of RAM needed per permutation in a null model (in bytes); this is the output from benchmark_nm

RAM

Integer, the total amount of RAM available to be used, for all threads (in bytes)

n_thread

Integer, the number of threads over which RAM will be divided

verbose

If TRUE, print messages explaining logic

Value

An integer indicating the amount of RAM that is available to be used by any given thread

Examples

data("small_phenodata")
data("small_covariates")

nm_RAM_per_perm <- mtmcskat::benchmark_nm(phenotype = small_phenodata,
                                          covariates = small_covariates,
                                          benchmark_size = 1000)

RAM <- benchmarkme::get_ram()

calculate_max_perm_per_core(nm_RAM_per_perm = nm_RAM_per_perm,
                            RAM = RAM,
                            n_thread = 2)


naglemi/mtmcskat documentation built on Aug. 23, 2023, 5:35 p.m.