| Title: | HiPerGator SLURM Interface for R |
|---|---|
| Description: | Simple interface for submitting and managing SLURM jobs on the University of Florida HiPerGator cluster. Provides authentication, data transfer, job submission, monitoring, and result retrieval with configuration management for streamlined workflows. |
| Authors: | Nicolas Gauthier [aut, cre] (ORCID: <https://orcid.org/0000-0002-2225-5827>) |
| Maintainer: | Nicolas Gauthier <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-17 09:53:27 UTC |
| Source: | https://github.com/flmnh-ai/hipergator |
Check job status
ensure_hpg_job_env(job)ensure_hpg_job_env(job)
job |
An |
refresh |
Force refresh from cluster (default: |
Status string such as "PENDING", "RUNNING", or "COMPLETED"
Establishes an SSH master connection to HiPerGator with Duo MFA support. Uses SSH multiplexing so subsequent connections are fast and don't require re-authentication.
hpg_authenticate(host = NULL, user = NULL, timeout = 60, quiet = FALSE)hpg_authenticate(host = NULL, user = NULL, timeout = 60, quiet = FALSE)
host |
SSH hostname (uses configuration if NULL) |
user |
SSH username (uses configuration if NULL) |
timeout |
Connection timeout in seconds |
quiet |
Suppress status messages (default: |
SSH target string for subsequent connections
## Not run: # Use configuration defaults target <- hpg_authenticate() # Override defaults target <- hpg_authenticate(host = "hpg", user = "myuser") ## End(Not run)## Not run: # Use configuration defaults target <- hpg_authenticate() # Override defaults target <- hpg_authenticate(host = "hpg", user = "myuser") ## End(Not run)
Cancel a running job
hpg_cancel(job)hpg_cancel(job)
job |
An |
Check if SSH master connection is active
hpg_check_connection(host = NULL, user = NULL)hpg_check_connection(host = NULL, user = NULL)
host |
SSH hostname (uses configuration if NULL) |
user |
SSH username (uses configuration if NULL) |
Logical indicating if connection is active
Create cluster configuration
hpg_cluster_config(host, user = NULL, port = 22)hpg_cluster_config(host, user = NULL, port = 22)
host |
SSH hostname |
user |
SSH username |
port |
SSH port (default: 22 for password auth, use 2222 for SSH keys) |
A cluster configuration object
## Not run: cluster <- hpg_cluster_config(host = "hpg.rc.ufl.edu", user = "myuser") cluster_with_keys <- hpg_cluster_config(host = "hpg.rc.ufl.edu", user = "myuser", port = 2222) ## End(Not run)## Not run: cluster <- hpg_cluster_config(host = "hpg.rc.ufl.edu", user = "myuser") cluster_with_keys <- hpg_cluster_config(host = "hpg.rc.ufl.edu", user = "myuser", port = 2222) ## End(Not run)
Returns a simple list containing commonly used fields (host, user, base_dir,
and timeout values) derived from the structured configuration established via
hpg_configure().
hpg_config()hpg_config()
List with host, user, port, base_dir, temp_dir, timeout_hours, poll_interval, and max_jobs.
Get current HiPerGator configuration
hpg_configuration(show = FALSE)hpg_configuration(show = FALSE)
show |
Whether to display configuration details |
Configuration list
This is the primary entry point for defining how hipergator connects to the
cluster, where it stores files, and how long it waits between status checks.
You can pass structured configuration objects created with
hpg_cluster_config(), hpg_storage_config(), and hpg_defaults(), or use
the convenience arguments to update individual fields.
hpg_configure( host = NULL, user = NULL, port = NULL, base_dir = NULL, temp_dir = NULL, timeout_hours = NULL, poll_interval = NULL, max_jobs = NULL, cluster = NULL, storage = NULL, defaults = NULL )hpg_configure( host = NULL, user = NULL, port = NULL, base_dir = NULL, temp_dir = NULL, timeout_hours = NULL, poll_interval = NULL, max_jobs = NULL, cluster = NULL, storage = NULL, defaults = NULL )
host |
Optional SSH hostname (character). |
user |
Optional SSH username (character). |
port |
Optional SSH port (numeric). |
base_dir |
Optional base directory for remote jobs (character). |
temp_dir |
Optional temporary directory under the base directory. |
timeout_hours |
Optional default timeout (hours). |
poll_interval |
Optional default polling interval (seconds). |
max_jobs |
Optional maximum concurrent jobs tracked. |
cluster |
Optional object produced by |
storage |
Optional object produced by |
defaults |
Optional object produced by |
Invisibly returns the complete structured configuration.
## Not run: hpg_configure(host = "hpg", user = "myuser", base_dir = "/blue/group/project") hpg_configure( cluster = hpg_cluster_config(host = "hpg", user = "myuser"), storage = hpg_storage_config(base_dir = "/blue/group/project") ) ## End(Not run)## Not run: hpg_configure(host = "hpg", user = "myuser", base_dir = "/blue/group/project") hpg_configure( cluster = hpg_cluster_config(host = "hpg", user = "myuser"), storage = hpg_storage_config(base_dir = "/blue/group/project") ) ## End(Not run)
Create default settings configuration
hpg_defaults(timeout_hours = 8, poll_interval = 30, max_jobs = 100)hpg_defaults(timeout_hours = 8, poll_interval = 30, max_jobs = 100)
timeout_hours |
Default job timeout in hours |
poll_interval |
Default polling interval in seconds |
max_jobs |
Maximum concurrent jobs |
A defaults configuration object
## Not run: defaults <- hpg_defaults(timeout_hours = 12, poll_interval = 60) ## End(Not run)## Not run: defaults <- hpg_defaults(timeout_hours = 12, poll_interval = 60) ## End(Not run)
Disconnect SSH master connection
hpg_disconnect(host = NULL, user = NULL)hpg_disconnect(host = NULL, user = NULL)
host |
SSH hostname (uses configuration if NULL) |
user |
SSH username (uses configuration if NULL) |
Download files from HiPerGator
hpg_download( target, remote_path, local_path, verify_files = NULL, quiet = FALSE )hpg_download( target, remote_path, local_path, verify_files = NULL, quiet = FALSE )
target |
SSH target (from hpg_authenticate) |
remote_path |
Remote file or directory path |
local_path |
Local destination path |
verify_files |
Optional character vector of files that must exist |
quiet |
Suppress status messages (default: |
## Not run: target <- hpg_authenticate() hpg_download(target, "/blue/mygroup/project/output/", "results/") ## End(Not run)## Not run: target <- hpg_authenticate() hpg_download(target, "/blue/mygroup/project/output/", "results/") ## End(Not run)
Check if remote path exists
hpg_exists(target, remote_path)hpg_exists(target, remote_path)
target |
SSH target (from hpg_authenticate) |
remote_path |
Remote path to check |
Logical indicating if path exists
Get job error information
hpg_get_error(job)hpg_get_error(job)
job |
An |
List containing error output and exit code
Create GPU resource specification
hpg_gpu(count = 1, type = NULL, memory = NULL)hpg_gpu(count = 1, type = NULL, memory = NULL)
count |
Number of GPUs |
type |
GPU type (e.g., "a100", "b200", "rtx6000") |
memory |
GPU memory requirement (optional) |
A GPU resource object
## Not run: gpu <- hpg_gpu(count = 2, type = "a100") gpu <- hpg_gpu(count = 1, type = "rtx6000", memory = "24gb") ## End(Not run)## Not run: gpu <- hpg_gpu(count = 2, type = "a100") gpu <- hpg_gpu(count = 1, type = "rtx6000", memory = "24gb") ## End(Not run)
Get detailed job information
hpg_job_info(job)hpg_job_info(job)
job |
An |
Named list with job metadata
Create directories on HiPerGator
hpg_mkdir(target, remote_paths, quiet = FALSE)hpg_mkdir(target, remote_paths, quiet = FALSE)
target |
SSH target (from hpg_authenticate) |
remote_paths |
Character vector of remote directory paths to create |
quiet |
Suppress status messages (default: |
## Not run: target <- hpg_authenticate() hpg_mkdir(target, c("/blue/mygroup/project/data", "/blue/mygroup/project/output")) ## End(Not run)## Not run: target <- hpg_authenticate() hpg_mkdir(target, c("/blue/mygroup/project/data", "/blue/mygroup/project/output")) ## End(Not run)
Reset HiPerGator configuration to defaults
hpg_reset_config()hpg_reset_config()
Reset configuration to defaults
hpg_reset_configuration()hpg_reset_configuration()
Create HiPerGator resource specification
hpg_resources( cores = 4, memory = "24gb", time = "02:00:00", partition = "hpg-turin", gpu = NULL, modules = NULL, conda_env = NULL, exclusive = FALSE )hpg_resources( cores = 4, memory = "24gb", time = "02:00:00", partition = "hpg-turin", gpu = NULL, modules = NULL, conda_env = NULL, exclusive = FALSE )
cores |
Number of CPU cores |
memory |
Memory requirement (e.g., "24gb", "500mb") |
time |
Time limit in HH:MM:SS format |
partition |
SLURM partition |
gpu |
GPU specification from hpg_gpu() or NULL |
modules |
Character vector of modules to load |
conda_env |
Conda environment to activate |
exclusive |
Whether to request exclusive node access |
A resource specification object
## Not run: # Basic CPU job resources <- hpg_resources(cores = 8, memory = "32gb", time = "04:00:00") # GPU job resources <- hpg_resources( cores = 16, memory = "64gb", time = "12:00:00", gpu = hpg_gpu(count = 2, type = "l4"), partition = "hpg-turin" ) # With environment setup resources <- hpg_resources( cores = 4, memory = "16gb", time = "02:00:00", modules = c("conda", "cuda"), conda_env = "/blue/group/envs/pytorch" ) ## End(Not run)## Not run: # Basic CPU job resources <- hpg_resources(cores = 8, memory = "32gb", time = "04:00:00") # GPU job resources <- hpg_resources( cores = 16, memory = "64gb", time = "12:00:00", gpu = hpg_gpu(count = 2, type = "l4"), partition = "hpg-turin" ) # With environment setup resources <- hpg_resources( cores = 4, memory = "16gb", time = "02:00:00", modules = c("conda", "cuda"), conda_env = "/blue/group/envs/pytorch" ) ## End(Not run)
Show current base directory and explain path resolution
hpg_show_base_dir()hpg_show_base_dir()
Show current configuration
hpg_show_config()hpg_show_config()
Create storage configuration
hpg_storage_config(base_dir, temp_dir = NULL)hpg_storage_config(base_dir, temp_dir = NULL)
base_dir |
Base directory for job files |
temp_dir |
Temporary directory (optional) |
A storage configuration object
## Not run: storage <- hpg_storage_config(base_dir = "/blue/mygroup/projects") ## End(Not run)## Not run: storage <- hpg_storage_config(base_dir = "/blue/mygroup/projects") ## End(Not run)
This is the primary entry point for launching work on the cluster. It uses the
structured configuration helpers for safe path resolution and produces the
unified job object described in new_hpg_job().
hpg_submit( resources, command, job_name = NULL, working_dir = ".", ssh_target = NULL, quiet = FALSE, ... )hpg_submit( resources, command, job_name = NULL, working_dir = ".", ssh_target = NULL, quiet = FALSE, ... )
resources |
Resource specification created with |
command |
Command to execute remotely |
job_name |
Optional SLURM job name (defaults to a timestamped value) |
working_dir |
Remote working directory relative to configured base dir |
ssh_target |
Optional SSH target override (defaults to configuration) |
quiet |
Suppress status messages (default: |
... |
Named environment variables to export before running the command |
An object of class hpg_job
## Not run: resources <- hpg_resources(cores = 8, memory = "32gb", time = "04:00:00") job <- hpg_submit(resources, "python train.py", job_name = "training_run") hpg_wait(job) ## End(Not run)## Not run: resources <- hpg_resources(cores = 8, memory = "32gb", time = "04:00:00") job <- hpg_submit(resources, "python train.py", job_name = "training_run") hpg_wait(job) ## End(Not run)
Get partition suggestions based on resources
hpg_suggest_partitions(resources)hpg_suggest_partitions(resources)
resources |
An hpg_resources object |
Character vector of suggested partitions
Upload files to HiPerGator
hpg_upload( target, local_path, remote_path, exclude_patterns = c("__pycache__", "*.pyc", ".git", ".DS_Store"), delete_extra = FALSE, quiet = FALSE )hpg_upload( target, local_path, remote_path, exclude_patterns = c("__pycache__", "*.pyc", ".git", ".DS_Store"), delete_extra = FALSE, quiet = FALSE )
target |
SSH target (from hpg_authenticate) |
local_path |
Local file or directory path |
remote_path |
Remote destination path |
exclude_patterns |
Patterns to exclude from transfer |
delete_extra |
Remove files in destination that don't exist in source |
quiet |
Suppress status messages (default: |
## Not run: target <- hpg_authenticate() hpg_upload(target, "my_data/", "/blue/mygroup/project/data/") ## End(Not run)## Not run: target <- hpg_authenticate() hpg_upload(target, "my_data/", "/blue/mygroup/project/data/") ## End(Not run)
Wait for job completion
hpg_wait( job, timeout_hours = NULL, poll_interval = NULL, show_progress = TRUE, log_path = NULL, progress_callback = NULL )hpg_wait( job, timeout_hours = NULL, poll_interval = NULL, show_progress = TRUE, log_path = NULL, progress_callback = NULL )
job |
An |
timeout_hours |
Maximum hours to wait (defaults from configuration) |
poll_interval |
Poll interval in seconds (defaults from configuration) |
show_progress |
Display progress messages |
log_path |
Optional remote path to monitor for progress updates |
progress_callback |
Optional function called with log contents during each poll |
The job object (invisibly)
hpg_job
Print method for hpg_job
## S3 method for class 'hpg_job' print(x, ...)## S3 method for class 'hpg_job' print(x, ...)