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

Release files for lytools-HPC 0.0.5

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.5
File Size Uploaded
lytools_hpc-0.0.5.tar.gz 13.1 kB Details

Built distribution (wheel)

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

Total release size: 25.8 kB

Release files / lytools_hpc-0.0.5.tar.gz

Download URL lytools_hpc-0.0.5.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4c4de776ee9aac62fdb6e4ea955f472fc2d2187d0076ca5c8a254beaa4208320
BLAKE2b-256 checksum
How to use checksums
8e2ae69d9a46a00f44a457f2510a89848a1d445e73c60747d24d7d78f95c95a0
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.5-py3-none-any.whl

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

Release history Release notifications | RSS feed

0.0.7

2 release files

0.0.6

2 release files

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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