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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lytools_hpc-0.0.2.tar.gz.
File metadata
- Download URL: lytools_hpc-0.0.2.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bd38f343118713f0476dd1a196df7f8b19a33d58327beba429a0ca719b11962
|
|
| MD5 |
f7d6e33dcfc96a15ad0f3937c63beffe
|
|
| BLAKE2b-256 |
206090bf2aff6fb1f9b448df90333e2e674b7b63cd510aedd47fb15cfe22cadb
|
File details
Details for the file lytools_hpc-0.0.2-py3-none-any.whl.
File metadata
- Download URL: lytools_hpc-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
300e46df2d7507a3d9e433b2540d8a356c1bfc45eec88343c7928b852ab1ae6c
|
|
| MD5 |
6607fbde51f60f9429bbad43d622f037
|
|
| BLAKE2b-256 |
a1889488e7457f2d4a8529478dc2da96292a929ebf3aba604cac64f1708397e4
|