Skip to main content

HPC Functions

Monitoring you jobs with a progress bar.

This requires a Redis server to store the progress information. The following steps will guide you through setting up the Redis server and using submitit with a progress bar.

Installation:

pip install lytools_HPC 

Step 1: Deploy a Redis service

DO NOT deploy it on a HPC nodes. You can use your local machine or a server with a public IP address.

Deploy redis via Docker

Compose file for Redis server:

services:
  redis-progress:
    image: redis:7
    container_name: redis-progress
    restart: unless-stopped

    ports:
      - "6379:6379"

    volumes:
      - ./redis_data:/data

    command: >
      redis-server
      --appendonly yes
      --requirepass yourpassword
      --maxmemory 2gb
      --maxmemory-policy allkeys-lru
      
    deploy:
      resources:
        limits:
          memory: 3g

docker compose up -d # Start the Redis server

Test Redis connection

import redis
r = redis.Redis(host='your_redis_host', port=6379, password='yourpassword')
r.set('test_key', 'test_value')
print(r.get('test_key').decode())

Create redis connection configuration file

Location: ~/.config/redis/redis.conf

your_redis_host
6379
yourpassword

Step 2: Submit your jobs

from lytools_HPC import *

def my_function(params):
    x,y = params
    return x * y

job_name = 'Your_job_name'
x_list = [1,2,3,4,5,6,7,8,9,10]
y_list = [2,3,4,5,6,7,8,9,10,11]
params_list = list(zip(x_list,y_list))
log_folder = 'Your_log_folder'
sumbit_jobs_array(my_function, params_list, log_folder,
                  job_name=job_name,
                  job_number_limit=1,
                  parallel_process_per_task=2,
                  slurm_array_parallelism=1,
                  parallel_process_p_or_t='p',
                  cpus_per_task=10,
                  mem_gb=2,
                  timeout_min=10,
                  slurm_partition="general",
                  exclude_nodes=None,
                  pbar_update_freq=1,
                  )

Step 3: Check the log files

from lytools_HPC import *
log_folder = 'Your_log_folder'
Check_logs(log_folder).read_err_files() # Read error files
Check_logs(log_folder).read_out_files() # Read output files

Metadata

Release files for lytools-HPC 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lytools-HPC 0.0.10
File Size Uploaded Provenance
lytools_hpc-0.0.10.tar.gz 13.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lytools-HPC 0.0.10
File Interpreter ABI Platform
lytools_hpc-0.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 25.8 kB

Release files / lytools_hpc-0.0.10.tar.gz

Download URL lytools_hpc-0.0.10.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
82b4deaf7bb87b6331abda447e55296994b73a5df981882e935af9c0257fbb61
BLAKE2b-256 checksum
How to use checksums
4529d2c7f9a8b73a5e9f33d8b189410f35e05cfdc718f0404ed2fe641c2f58e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / lytools_hpc-0.0.10-py3-none-any.whl

Download URL lytools_hpc-0.0.10-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c6934b1ef3d271c45dbf23cefbfa00a9c2d85bc01c554d7dc5386e133420866
BLAKE2b-256 checksum
How to use checksums
9a206413014210171cafb3c2c57507d57a8a983bd719fda0fc4dc73c399b4287
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Security for lytools-HPC 0.0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page