-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4448a21
commit ae98407
Showing
10 changed files
with
192 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ | |
*.zip | ||
*.text | ||
*.log | ||
*.out | ||
*.output | ||
#*.json | ||
#*.txt | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
import os | ||
import psutil | ||
|
||
__version__ = '0.1.3.2' | ||
__version__ = '0.1.3.3' | ||
__release__ = 'alpha' | ||
__date__ = '21/10/2024' | ||
__author__ = '[email protected]' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
# | ||
# Grid tuning job with init structure using Condor DAGMan | ||
# | ||
# Submit with: | ||
# condor_submit_dag gridtune.dag | ||
|
||
# Filename: job_dependency.dag | ||
JOB A gridtune_init.job # First init job | ||
JOB B gridtune_array.job # Array job | ||
|
||
# Make B depend on A finishing successfully | ||
PARENT A CHILD B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Array job | ||
|
||
executable = gridtune_task.sh | ||
arguments = "$(PROCESS) 4 $(ClusterId)" | ||
error = gridtune_array.$(CLUSTER).$(PROCESS).out | ||
output = gridtune_array.$(CLUSTER).$(PROCESS).output | ||
log = gridtune_array.$(CLUSTER).$(PROCESS).log | ||
request_gpus = 1 | ||
request_memory = 80G | ||
#requirements = TARGET.GPUs_DeviceName =?= "Tesla V100-PCIE-32GB" | ||
requirements = TARGET.GPUs_DeviceName =?= "Tesla P100-PCIE-12GB" | ||
+MaxRuntime = 86000 | ||
|
||
queue 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Initialization job | ||
|
||
executable = gridtune_task.sh | ||
arguments = "-1 1 $(ClusterId)" | ||
error = gridtune_init.$(CLUSTER).out | ||
output = gridtune_init.$(CLUSTER).output | ||
log = gridtune_init.$(CLUSTER).log | ||
request_gpus = 1 | ||
request_memory = 80G | ||
#requirements = TARGET.GPUs_DeviceName =?= "Tesla V100-PCIE-32GB" | ||
requirements = TARGET.GPUs_DeviceName =?= "Tesla P100-PCIE-12GB" | ||
+MaxRuntime = 86000 | ||
queue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
# | ||
# GPU grid tuning task | ||
|
||
echo "Grid tuning job started" | ||
pwd | ||
|
||
ICEPATH="/vols/cms/mmieskol/icenet" | ||
|
||
# ** icenet/setenv.sh uses these ** | ||
export HTC_PROCESS_ID=$1 | ||
export HTC_QUEUE_SIZE=$2 | ||
export HTC_CLUSTER_ID=$3 | ||
|
||
# Init conda | ||
source /home/hep/mmieskol/setconda.sh | ||
conda activate icenet | ||
|
||
# Init icenet | ||
mkdir $ICEPATH/tmp -p | ||
cd $ICEPATH | ||
source $ICEPATH/setenv.sh | ||
|
||
# Execute | ||
DATAPATH="/vols/cms/pfk18/phd/hgg/Jul23/NN21July/N/validations/outputs/Csplit_Jsamp/files" | ||
CONFIG="tune0_EB" | ||
maxevents=150000 | ||
source /vols/cms/mmieskol/icenet/tests/runme_zee_gridtune.sh | ||
|
||
# Create the done file when the job completes | ||
donefile="${ICEPATH}/tmp/icenet_${HTC_CLUSTER_ID}_${HTC_PROCESS_ID}.done" | ||
touch $donefile | ||
|
||
echo "Task done, created file: ${donefile}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/bash | ||
|
||
# Condor submission with first init job and then | ||
# an array job once that is finished | ||
# | ||
# Emulating DAGMan without using it. | ||
# | ||
# Run with: source submit.sh | ||
# | ||
# [email protected], 2024 | ||
|
||
ICEPATH="/vols/cms/mmieskol/icenet" | ||
|
||
TASK_SCRIPT="gridtune_task.sh" | ||
INIT_JOB="gridtune_init.job" | ||
ARRAY_JOB="gridtune_array.job" | ||
PERIOD=15 | ||
|
||
# Submit the first job | ||
echo "Submitting init job" | ||
FIRST_JOB_ID=$(condor_submit $INIT_JOB | awk '/submitted to cluster/ {print int($6)}') | ||
echo " " | ||
cat $INIT_JOB | ||
|
||
# Check if job submission was successful | ||
if [[ -z "$FIRST_JOB_ID" ]]; then | ||
echo "Error: Failed to submit the first job" | ||
exit 1 | ||
fi | ||
|
||
sleep 5 | ||
|
||
echo "First job with ID = ${FIRST_JOB_ID}" | ||
echo "Waiting for the first job to finish" | ||
|
||
# Initialize start time for cumulative waiting | ||
start_time=$(date +%s) | ||
|
||
while true; do | ||
# Check if the job is still in the queue | ||
job_status=$(condor_q $FIRST_JOB_ID -format "%d" JobStatus 2>/dev/null) | ||
|
||
# If condor_q returns nothing, check condor_history | ||
if [ -z "$job_status" ]; then | ||
# Job is no longer in the queue, check the history | ||
job_status=$(condor_history $FIRST_JOB_ID -limit 1 -format "%d" JobStatus 2>/dev/null) | ||
|
||
# Exit the loop if the job has completed | ||
if [ "$job_status" -eq "4" ]; then | ||
echo "Job completed successfully." | ||
break | ||
else | ||
echo "Job is no longer running but didn't finish as expected -- exit" | ||
exit 0 | ||
fi | ||
fi | ||
|
||
# Calculate the cumulative time spent waiting | ||
current_time=$(date +%s) | ||
elapsed_time=$((current_time - start_time)) | ||
elapsed_minutes=$((elapsed_time / 60)) | ||
elapsed_seconds=$((elapsed_time % 60)) | ||
|
||
# Otherwise, job is still in the queue, and we can wait | ||
echo "Job is still running (status: $job_status). Checking again in ${PERIOD} seconds..." | ||
echo "Cumulative waiting time: ${elapsed_minutes} minute(s) and ${elapsed_seconds} second(s)" | ||
sleep $PERIOD | ||
done | ||
|
||
# Submit the array job | ||
echo "Submitting array job" | ||
condor_submit $ARRAY_JOB | ||
echo " " | ||
cat $ARRAY_JOB |