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.

Python packages required:

pip install submitit redis pathos rich 

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 HPC_func import *

def my_function(x):
    return x * x

job_name = 'Your_job_name'
params_list = [1,2,3,4,5,6,7,8,9,10]
log_folder = 'Your_log_folder'
init_job(job_name, params_list)
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: Monitor the progress bar

from HPC_func import *
job_name = 'Your_job_name'
progress_bar_monitoring(job_name)

Step 4: Check the log files

from HPC_func 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.1.tar.gz (6.2 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.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lytools_hpc-0.0.1.tar.gz
  • Upload date:
  • Size: 6.2 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.1.tar.gz
Algorithm Hash digest
SHA256 87ec30a23c8713ea9033e7e5b99f749459b3ab8b1d146fc0d26522dd9c365c72
MD5 215837230937a58a91e41b141be5ab2b
BLAKE2b-256 147015294d51ba5f9e36246fbf9fee3b47c519cd8d8b3799f1e1367fe19149a4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lytools_hpc-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5d0869253ebabdd91553f4cfae2c6dabc75ed96a0112a2c394294749e829a0f
MD5 2975597ccab467bbc31c31ee40d9a7b6
BLAKE2b-256 3f3bf101e66c79f8cc52582fd97e5f8f8bd884829801857771b38668164487da

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