Skip to contents

Polls a backgrounded NlmeJob via NlmeJobStatus until the engine reports "Finished", then materialises the typed result. Remote-results download (when applicable) and CSV/log parsing are handled by the class-specific method body. collectJob() is the single canonical entry point for any runInBackground = TRUE run.

Usage

collectJob(job, timeout = Inf, pollInterval = 5, ...)

# S4 method for class 'BootNlmeJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)

# S4 method for class 'FitNlmeJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)

# S4 method for class 'StepwiseNlmeJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)

# S4 method for class 'ShotgunNlmeJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)

# S4 method for class 'ProfileNlmeJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)

# S4 method for class 'SortByNlmeJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)

# S4 method for class 'NlmeSimulationJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)

Arguments

job

An NLME job object returned by a wrapper invoked with runInBackground = TRUE (bootstrap, fitmodel, stepwiseSearch, shotgunSearch, profilePertubate, sortfit, vpcmodel, simmodel).

timeout

Maximum time to wait, in seconds. Inf (the default) waits indefinitely.

pollInterval

Seconds between status checks. Defaults to 5.

...

Reserved for class-specific arguments; currently unused.

Value

A class-specific result object. For BootNlmeJob, an rsnlme_boot. For FitNlmeJob and SortByNlmeJob, the same result list fitmodel / sortfit produces. For StepwiseNlmeJob and ShotgunNlmeJob, an scmSearchResult (zero-row when Overall.csv is missing). For ProfileNlmeJob, a profileResult data frame (zero-row when Profile.csv is missing). For NlmeSimulationJob, the same named list of data.tables that vpcmodel / simmodel produces, with additive runMode/runTime/RsNLMEVersion list elements.

Details

Background jobs are only started on Linux hosts (local hostType "linux" or remote "linux" / "RHEL" / "UBUNTU"). Wrappers on Windows do not support runInBackground = TRUE; see ?fitmodel for the platform rule shared by all job executors.

Dispatches on BootNlmeJob, FitNlmeJob, StepwiseNlmeJob, ShotgunNlmeJob, ProfileNlmeJob, SortByNlmeJob, and NlmeSimulationJob (the shared class behind both vpcmodel and simmodel, discriminated by its validated runMode slot).

Functions

  • collectJob(BootNlmeJob): Wait for a backgrounded BootNlmeJob to finish and return its rsnlme_boot. Downloads remote artefacts idempotently when file.path(localDir, "BootOverall.csv") is absent, then reads the bootstrap CSVs from job@localDir into the typed rsnlme_boot (forwarding job@boot for replicate counts / confidence level and job@argsList$engine for the engine attribute) and – if job@saveResult is TRUE – writes the result to <localDir>/bootstrap_<sanitizedModelName>_<YYYYMMDD_HHMMSS>.rds, where sanitizedModelName is job@model@modelInfo@modelName with every character outside [A-Za-z0-9._-] replaced by _ (falling back to model when empty) and the timestamp is job@runStart formatted as YYYYMMDD_HHMMSS in local time.

  • collectJob(FitNlmeJob): Wait for a backgrounded FitNlmeJob to finish and return the same result list that fitmodel's foreground branch produces. Downloads remote artefacts idempotently when file.path(localDir, "nlme7engine.log") is absent, then reads engine outputs via .get_resultList() and – if job@saveResult is TRUE – writes the result to <localDir>/fitmodel_<sanitizedModelName>_<YYYYMMDD_HHMMSS>.rds, where sanitizedModelName is job@model@modelInfo@modelName with every character outside [A-Za-z0-9._-] replaced by _ (falling back to model when empty) and the timestamp is job@runStart formatted as YYYYMMDD_HHMMSS in local time.

  • collectJob(StepwiseNlmeJob): Wait for a backgrounded StepwiseNlmeJob to finish and return the same scmSearchResult that stepwiseSearch's foreground branch produces. Downloads remote artefacts idempotently when file.path(localDir, "Overall.csv") is absent, then reads the search results via .read_covsearch_results() (which archives the run folder when job@archiveResults is TRUE) and applies the stepwise-only BestScenario flag from Stepwise.txt. Returns an empty scmSearchResult (zero-row, searchType attribute set) when Overall.csv is missing.

  • collectJob(ShotgunNlmeJob): Wait for a backgrounded ShotgunNlmeJob to finish and return the same scmSearchResult that shotgunSearch's foreground branch produces. Downloads remote artefacts idempotently when file.path(localDir, "Overall.csv") is absent, then reads the search results via .read_covsearch_results() (which archives the run folder when job@archiveResults is TRUE). Returns an empty scmSearchResult (zero-row, searchType attribute set) when Overall.csv is missing.

  • collectJob(ProfileNlmeJob): Wait for a backgrounded ProfileNlmeJob to finish and return the same profileResult that profilePertubate's foreground branch produces. Downloads remote artefacts idempotently when file.path(localDir, "Profile.csv") is absent, then reads the profile table via .read_profile_results() and – if job@saveResult is TRUE – writes a self-describing profile_<sanitizedModelName>_<YYYYMMDD_HHMMSS>.rds alongside the result, where sanitizedModelName is job@model@modelInfo@modelName with every character outside [A-Za-z0-9._-] replaced by _ (falling back to model when empty) and the timestamp is job@runStart formatted as YYYYMMDD_HHMMSS in local time. Returns an empty profileResult (zero-row, runMode = "profile" attribute set) when Profile.csv is missing.

  • collectJob(SortByNlmeJob): Wait for a backgrounded SortByNlmeJob to finish and return the same result list that sortfit's foreground branch produces. Downloads remote artefacts idempotently when file.path(localDir, "nlme7engine.log") is absent, then reads engine outputs via .get_resultList() (the shared fitmodel/sortfit reader) with runMode = "sortfit" and – if job@saveResult is TRUE – writes the result to <localDir>/sortfit_<sanitizedModelName>_<YYYYMMDD_HHMMSS>.rds, where sanitizedModelName is job@model@modelInfo@modelName with every character outside [A-Za-z0-9._-] replaced by _ (falling back to model when empty) and the timestamp is job@runStart formatted as YYYYMMDD_HHMMSS in local time.

  • collectJob(NlmeSimulationJob): Wait for a backgrounded NlmeSimulationJob (constructed by either vpcmodel or simmodel) to finish and return the same named list of data.tables the foreground branch produces. Sentinel is mode-specific: predout.csv when job@params@isPopulation is TRUE (population runs), otherwise simout.csv (individual runs). Reads the engine output via .read_vpcsim_results() and attaches the canonical runMode / runTime / RsNLMEVersion list elements.