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.4.tar.gz (14.0 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.4-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lytools_hpc-0.0.4.tar.gz
Algorithm Hash digest
SHA256 15fcb2520554b1bb1785e0483db4a3ac9abdb0f9053599dccaf648398a0d5898
MD5 6ba1793bf4a4c45853cfd31904011b8b
BLAKE2b-256 1a20cc6e5144a1f9893502cf5ee63f077b866163597db781c687f490e7ba4917

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for lytools_hpc-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9c9187dd00d4d4e1a1f66ec0b6bc295031f05fa276dd245a54eeb3f130578001
MD5 675d4289a6cbe9097cde03b286642a61
BLAKE2b-256 d7260fe4fa8f895b0102ae273f06886d5ba00e5178db90264b2d74f0701fec96

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