여러 HPC 클러스터와의 상호 작용을 지원하기위한 라이브러리 및 명령 줄 인터페이스
단일 인터페이스를 사용하여 가장 인기있는 HPC 작업 일정 시스템과 상호 작용할 수있는 기능을 제공하고 작업 제출 스크립트를 생성 할 수 있습니다.
SGE, LSF 및 SLURM으로 테스트 (개발중인 PBS/토크 지원)
MyCluster는 PYPI에서 설치할 수 있습니다.
pip install mycluster
MyCluster는 이메일 주소를 제출 파일에 작성하여 스케줄러에서 업데이트를받을 수 있습니다. 명령 줄에이를 제공하거나 구성 파일에 저장할 수 있습니다. 구성 파일 실행에 이메일을 저장하려면 다음과 같습니다.
mycluster configure
기본적으로 MyCluster는 기본 스케줄러를 시도하고 감지하지만 MyCluster_sched 환경 변수를 설정하여 재정의 할 수 있습니다. 이것은 mycluster.schedulers.base.Scheduler class를 구현하는 Python 클래스의 문자열 이름으로 설정해야합니다.
경우에 따라 추가 매개 변수 또는 스케줄러 명령을 포함하려는 경우 제출 템플릿을 무시할 수 있습니다. 이를 수행하려면 MyCluster_template 환경 변수를 사용하려는 Jinja 템플릿으로 설정하십시오. 기본 템플릿은 MyCluster/스케줄러/템플릿을 참조하십시오.
MyClusyter는 "MyCluster"CLI 명령을 설치하여 명령 줄을 통해 로컬 스케줄러와 상호 작용합니다.
인쇄 명령 도움말
mycluster <command> --help
모든 대기열을 나열하십시오
mycluster queues
작업을 나열하십시오
mycluster list
새로 제출 파일을 작성하고 자세한 제출 옵션은 help를 참조하십시오.
mycluster create JOBFILE QUEUE RUNSCRIPT
작업 파일을 제출하십시오
mycluster submit JOBFILE
직업을 취소하십시오
mycluster cancel JOBID
job_script에서 실행할 runscript는 다음과 같은 사전 정의 된 환경 변수를 사용할 수 있습니다.
export NUM_TASKS=
export TASKS_PER_NODE=
export THREADS_PER_TASK=
export NUM_NODES=
# OpenMP configuration
export OMP_NUM_THREADS= $THREADS_PER_TASK
# Default mpiexec commnads for each flavour of mpi
export OMPI_CMD= " mpiexec -n $NUM_TASKS -npernode $TASKS_PER_NODE -bysocket -bind-to-socket "
export MVAPICH_CMD= " mpiexec -n $NUM_TASKS -ppn $TASKS_PER_NODE -bind-to-socket "
export IMPI_CMD= " mpiexec -n $NUM_TASKS -ppn $TASKS_PER_NODE " MyCluster는 MyCluster 모듈을 사용하여 프로그래밍 방식으로 사용할 수 있습니다. 모든 스케줄러는 Base mycluster.schedulers.base.Scheduler class를 구현합니다.
import mycluster
# Detect the local scheduler
scheduler = mycluster . detect_scheduling_sys ()
print ( f"Scheduler loaded: { scheduler . scheduler_type () } " )
# Create a batch script to submit a 48 task run of script.sh to the skylake queue
script = scheduler . create ( "skylake" , 48 , "my_job" , "script.sh" , "01:00:00" , tasks_per_node = 24 )
# Write to a file
with open ( "mysub.job" , "w" ) as f :
f . write ( script )
# Submit the batch script
job_id = scheduler . submit ( "mysub.job" )
# Check the status of the job
print ( scheduler . get_job_details ( job_id ))
# Cancel the job
scheduler . delete ( job_id )