-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cylon] Scripts for scaling test (#670)
* [Cylon] Scripts for scaling test Signed-off-by: Arup Sarker <[email protected]> * [Cylon] Update scripts and documentation Signed-off-by: Arup Sarker <[email protected]> --------- Signed-off-by: Arup Sarker <[email protected]>
- Loading branch information
Showing
13 changed files
with
1,168 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
SHELL=/bin/bash | ||
|
||
.PHONY: load image-singularity image-docker project | ||
|
||
all: ${EXECS} | ||
|
||
login: | ||
ssh -tt rivanna "/opt/rci/bin/ijob --partition=parallel --account=bii_dsc_community --time=30:00 --ntasks-per-node=4 --nodes=2" | ||
|
||
load: | ||
./load.sh | ||
|
||
clean: | ||
rm -f *.log *.err script-*.slurm | ||
rm -r raptor-*.cfg rp.session.* | ||
|
||
rp: load | ||
python rp-experiment-setup.py | ||
|
||
cy: load | ||
python cylon-experiment-setup.py | ||
|
||
q: | ||
squeue --format="%.18i %.9P %.50j %.8u %.8T %.10M %.9l %.6D %R" --me | ||
|
||
a: | ||
squeue --format="%all" --me | ||
|
||
|
||
qq: | ||
watch squeue --format=\"%.18i %.9P %.50j %.8u %.8T %.10M %.9l %.6D %R\" --me | ||
|
||
i: | ||
cat out.log | ||
cat out.err | ||
fgrep "###" out.log | wc -l | ||
|
||
|
||
cancel: | ||
- ./cancel.sh | ||
- squeue -u ${USER} | ||
|
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,2 @@ | ||
#! /bin/sh | ||
squeue -u $USER | awk '{print $1}' | tail -n+2 | xargs scancel |
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,117 @@ | ||
import os | ||
import sys | ||
from textwrap import dedent | ||
from cloudmesh.common.util import writefile | ||
from cloudmesh.common.util import readfile | ||
from cloudmesh.common.util import banner | ||
from cloudmesh.common.console import Console | ||
|
||
counter = 0 | ||
|
||
debug = True | ||
debug = False | ||
|
||
partition="bii-gpu" | ||
|
||
partition="parallel" | ||
|
||
|
||
# (nodes, threads, rows, partition, "exclusive") | ||
combination = [\ | ||
# (1,4, 5000, "parallel", "exclusive"), # always pending | ||
(2,37, 1000000, "parallel", ""), | ||
(4,37, 35000000, "parallel", ""), | ||
(6,37, 35000000, "parallel", ""), | ||
(8,37, 35000000, "parallel", ""), | ||
(10,37, 35000000, "parallel", ""), | ||
(12,37, 35000000, "parallel", ""), | ||
(14,37, 35000000, "parallel", ""), | ||
] | ||
|
||
''' | ||
combination = [] | ||
for nodes in range(0,50): | ||
for threads in range(0,37): | ||
combination.append((nodes+1, threads+1, "parallel", "")) | ||
''' | ||
|
||
total = len(combination) | ||
jobid="-%j" | ||
# jobid="" | ||
|
||
f = open("submit.log", "w") | ||
for nodes, threads, rows, partition, exclusive in combination: | ||
counter = counter + 1 | ||
|
||
if exclusive == "exclusive": | ||
exclusive = "#SBATCH --exclusive" | ||
e = "e1" | ||
else: | ||
exclusive = "" | ||
e = "e0" | ||
|
||
usable_threads = nodes * threads | ||
|
||
''' | ||
cores_per_node = nodes * threads - 2 | ||
print (cores_per_node) | ||
config = readfile("raptor.in.cfg") | ||
config = config.replace("CORES_PER_NODE", str(cores_per_node)) | ||
config = config.replace("NO_OF_ROWS", str(rows)) | ||
print (config) | ||
cfg_filename = f"raptor-{nodes}-{threads}.cfg" | ||
writefile(cfg_filename, config) | ||
''' | ||
banner(f"SLURM {nodes} {threads} {counter}/{total}") | ||
script=dedent(f""" | ||
#!/bin/bash | ||
#SBATCH --job-name=h-n={nodes:02d}-t={threads:02d}-e={e} | ||
#SBATCH --nodes={nodes} | ||
#SBATCH --ntasks-per-node={threads} | ||
#SBATCH --time=15:00 | ||
#SBATCH --output=out-{nodes:02d}-{threads:02d}{jobid}.log | ||
#SBATCH --error=out-{nodes:02d}-{threads:02d}{jobid}.err | ||
#SBATCH --partition=parallel | ||
#SBATCH -A bii_dsc_community | ||
{exclusive} | ||
echo "..............................................................." | ||
module load gcc/9.2.0 openmpi/3.1.6 cmake/3.23.3 python/3.7.7 | ||
echo "..............................................................." | ||
source /project/bii_dsc_community/djy8hg/cylon_rp_venv/bin/activate | ||
echo "..............................................................." | ||
BUILD_PATH=/project/bii_dsc_community/djy8hg/Project/cylon/build | ||
echo "..............................................................." | ||
export LD_LIBRARY_PATH=$BUILD_PATH/arrow/install/lib64:$BUILD_PATH/glog/install/lib64:$BUILD_PATH/lib64:$BUILD_PATH/lib:$LD_LIBRARY_PATH | ||
echo "..............................................................." | ||
which python gcc g++ | ||
echo "..............................................................." | ||
lscpu | ||
echo "..............................................................." | ||
time srun --exact --nodes {nodes} --ntasks {usable_threads} python cylon_scaling.py -n {rows} | ||
echo "..............................................................." | ||
""").strip() | ||
|
||
print (script) | ||
filename = f"script-{nodes:02d}-{threads:02d}.slurm" | ||
writefile(filename, script) | ||
|
||
|
||
if not debug: | ||
|
||
r = os.system(f"sbatch {filename}") | ||
total = nodes * threads | ||
if r == 0: | ||
msg = f"{counter} submitted: nodes={nodes:02d} threads={threads:02d} total={total}" | ||
Console.ok(msg) | ||
else: | ||
msg = f"{counter} failed: nodes={nodes:02d} threads={threads:02d} total={total}" | ||
Console.error(msg) | ||
f.writelines([msg, "\n"]) | ||
f.close() |
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,2 @@ | ||
module load gcc/9.2.0 openmpi/3.1.6 cmake/3.23.3 python/3.7.7 | ||
source /project/bii_dsc_community/djy8hg/cylon_rp_venv/bin/activate |
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,55 @@ | ||
{ | ||
# resource configuration | ||
"cores_per_node" : CORES_PER_NODE, | ||
"gpus_per_node" : 0, | ||
"no_of_rows" : NO_OF_ROWS, | ||
# raptor configuration | ||
"n_masters" : 1, | ||
"n_workers" : 1, | ||
"masters_per_node" : 1, | ||
"nodes_per_worker" : 1, | ||
|
||
# extra nodes for non-raptor rp tasks | ||
"nodes_rp" : 1, | ||
# extra resources for the rp agent (optional) | ||
"nodes_agent" : 0, | ||
|
||
# pilot runtime in min | ||
"runtime" : 60, | ||
|
||
# task configuration | ||
"cores_per_task" : 1, | ||
"sleep" : 3, | ||
# These are used as the range of the for loops for defining and submitting | ||
# non-raptor and raptor tasks, respectively. | ||
"tasks_rp" : 1, | ||
"tasks_raptor" : 1, | ||
|
||
"pilot_descr": { | ||
"resource" : "uva.rivanna", | ||
"runtime" : 60, | ||
"access_schema": "interactive", | ||
"queue" : "parallel", | ||
"project" : "bii_dsc_community" | ||
}, | ||
|
||
"master_descr": { | ||
"mode" : "raptor.master", | ||
"named_env" : "cylon_rp_venv", | ||
"executable" : "./raptor_master.py" | ||
}, | ||
|
||
"worker_descr": { | ||
"mode" : "raptor.worker", | ||
"named_env" : "cylon_rp_venv", | ||
"pre_exec" : ["module load gcc/9.2.0", | ||
"module load openmpi/3.1.6", | ||
"module load python/3.7.7", | ||
"export LD_LIBRARY_PATH=$HOME/rc_arup/cylon/build/arrow/install/lib64:$HOME/rc_arup/cylon/build/glog/install/lib64:$HOME/rc_arup/cylon/build/lib64:$HOME/rc_arup/cylon/build/lib:$LD_LIBRARY_PATH" | ||
], | ||
|
||
# custom worker class | ||
"raptor_class" : "MyWorker", | ||
"raptor_file" : "./raptor_worker.py" | ||
} | ||
} |
Oops, something went wrong.