Skip to main content

No project description provided

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lytools_hpc-0.0.3.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lytools_hpc-0.0.3-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file lytools_hpc-0.0.3.tar.gz.

File metadata

  • Download URL: lytools_hpc-0.0.3.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for lytools_hpc-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f7893d3ad3b256462b192ad3b951a505eda2398db468b1cd4ab0ee98bfb5c222
MD5 8000451752b45a6aa6e6a0a24b52f719
BLAKE2b-256 d23cb4ad529fb4a35c4faecc315aa5df22d21a573a5cb2581b024d85efdbc24f

See more details on using hashes here.

File details

Details for the file lytools_hpc-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: lytools_hpc-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for lytools_hpc-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f18d59602c835b69f6d8f1b788ccfaa216e2cb227ff345c54160d49bbee8eb89
MD5 c51d1b4e643b342ccf11da42201ab914
BLAKE2b-256 85b31366c5b7f02f561751c401bd4e07db08bd3061b090357c0bd1e89d96726b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page