-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
15 changed files
with
189 additions
and
18 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
publications/2023-neurips/cluster/slurm/apptainer/batchjoblarge.sh
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 @@ | ||
#!/bin/sh | ||
#SBATCH --partition=general --qos=long | ||
#SBATCH --time=168:00:00 | ||
#SBATCH --mincpus=2 | ||
#SBATCH --mem=36000 | ||
#SBATCH --job-name=lcdbL | ||
#SBATCH --output=lcdbL%a.txt | ||
#SBATCH --error=lcdbL%a.txt | ||
#SBATCH --array=1-83 | ||
ulimit -n 8000 | ||
cd /tudelft.net/staff-bulk/ewi/insy/PRLab/Staff/tjviering/lcdbpyexp/code/publications/2023-neurips/ | ||
rsync openml_cache /tmp/tjviering/ -r -v --ignore-existing | ||
cd /tudelft.net/staff-bulk/ewi/insy/PRLab/Staff/tjviering/ | ||
srun apptainer exec -c --bind /tudelft.net/staff-bulk/ewi/insy/PRLab/Staff/tjviering/lcdbpyexp/code/publications/2023-neurips:/mnt,/tmp:/tmp test6_re2.sif /bin/bash -c "mkdir -p ~/.config/ && mkdir -p ~/.config/openml/ && echo 'cachedir=/tmp/tjviering/openml_cache/' > ~/.config/openml/config && source activate /opt/conda/envs/lcdb && pip install py_experimenter==1.2 pynisher && mkdir -p /tmp/tjviering/ && mkdir -p /tmp/tjviering/${SLURM_ARRAY_TASK_ID} && rm -rf /tmp/tjviering/${SLURM_ARRAY_TASK_ID}/lcdb && cd /tmp/tjviering/${SLURM_ARRAY_TASK_ID} && git clone https://github.com/fmohr/lcdb.git && source activate /opt/conda/envs/lcdb && cd lcdb/publications/2023-neurips && pip install . && cd /mnt && ~/.local/bin/lcdb run --config config/knn_large.cfg --executor-name B{$SLURM_ARRAY_TASK_ID}" |
14 changes: 14 additions & 0 deletions
14
publications/2023-neurips/cluster/slurm/apptainer/batchjobmedium.sh
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 @@ | ||
#!/bin/sh | ||
#SBATCH --partition=general --qos=long | ||
#SBATCH --time=168:00:00 | ||
#SBATCH --mincpus=2 | ||
#SBATCH --mem=12000 | ||
#SBATCH --job-name=lcdbM | ||
#SBATCH --output=lcdbM%a.txt | ||
#SBATCH --error=lcdbM%a.txt | ||
#SBATCH --array=1-146 | ||
ulimit -n 8000 | ||
cd /tudelft.net/staff-bulk/ewi/insy/PRLab/Staff/tjviering/lcdbpyexp/code/publications/2023-neurips/ | ||
rsync openml_cache /tmp/tjviering/ -r -v --ignore-existing | ||
cd /tudelft.net/staff-bulk/ewi/insy/PRLab/Staff/tjviering/ | ||
srun apptainer exec -c --bind /tudelft.net/staff-bulk/ewi/insy/PRLab/Staff/tjviering/lcdbpyexp/code/publications/2023-neurips:/mnt,/tmp:/tmp test6_re2.sif /bin/bash -c "mkdir -p ~/.config/ && mkdir -p ~/.config/openml/ && echo 'cachedir=/tmp/tjviering/openml_cache/' > ~/.config/openml/config && source activate /opt/conda/envs/lcdb && pip install py_experimenter==1.2 pynisher && mkdir -p /tmp/tjviering/ && mkdir -p /tmp/tjviering/${SLURM_ARRAY_TASK_ID} && rm -rf /tmp/tjviering/${SLURM_ARRAY_TASK_ID}/lcdb && cd /tmp/tjviering/${SLURM_ARRAY_TASK_ID} && git clone https://github.com/fmohr/lcdb.git && source activate /opt/conda/envs/lcdb && cd lcdb/publications/2023-neurips && pip install . && cd /mnt && ~/.local/bin/lcdb run --config config/knn_medium.cfg --executor-name B{$SLURM_ARRAY_TASK_ID}" |
14 changes: 14 additions & 0 deletions
14
publications/2023-neurips/cluster/slurm/apptainer/batchjobsmall.sh
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 @@ | ||
#!/bin/sh | ||
#SBATCH --partition=general --qos=long | ||
#SBATCH --time=168:00:00 | ||
#SBATCH --mincpus=2 | ||
#SBATCH --mem=6000 | ||
#SBATCH --job-name=lcdbS | ||
#SBATCH --output=lcdbS%a.txt | ||
#SBATCH --error=lcdbS%a.txt | ||
#SBATCH --array=1-115 | ||
ulimit -n 8000 | ||
cd /tudelft.net/staff-bulk/ewi/insy/PRLab/Staff/tjviering/lcdbpyexp/code/publications/2023-neurips/ | ||
rsync openml_cache /tmp/tjviering/ -r -v --ignore-existing | ||
cd /tudelft.net/staff-bulk/ewi/insy/PRLab/Staff/tjviering/ | ||
srun apptainer exec -c --bind /tudelft.net/staff-bulk/ewi/insy/PRLab/Staff/tjviering/lcdbpyexp/code/publications/2023-neurips:/mnt,/tmp:/tmp test6_re2.sif /bin/bash -c "mkdir -p ~/.config/ && mkdir -p ~/.config/openml/ && echo 'cachedir=/tmp/tjviering/openml_cache/' > ~/.config/openml/config && source activate /opt/conda/envs/lcdb && pip install py_experimenter==1.2 pynisher && mkdir -p /tmp/tjviering/ && mkdir -p /tmp/tjviering/${SLURM_ARRAY_TASK_ID} && rm -rf /tmp/tjviering/${SLURM_ARRAY_TASK_ID}/lcdb && cd /tmp/tjviering/${SLURM_ARRAY_TASK_ID} && git clone https://github.com/fmohr/lcdb.git && source activate /opt/conda/envs/lcdb && cd lcdb/publications/2023-neurips && pip install . && cd /mnt && ~/.local/bin/lcdb run --config config/knn_small.cfg --executor-name B{$SLURM_ARRAY_TASK_ID}" |
71 changes: 71 additions & 0 deletions
71
publications/2023-neurips/cluster/slurm/apptainer/ssh_killjobs_server.py
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,71 @@ | ||
import json | ||
import pymysql | ||
import pandas as pd | ||
import time | ||
|
||
pw2 = 'database_password' | ||
|
||
def postprocess_table(table_name): | ||
|
||
cnx = pymysql.connect(host='lcdb_experiments.ewi.tudelft.nl', user='lcdb', passwd=pw2, db='db_lcdb') | ||
query = '''select * from %s where postprocess=1;''' % table_name | ||
to_process = pd.read_sql_query(query, cnx) | ||
|
||
print('found %d rows for processing...' % len(to_process)) | ||
|
||
query_list = [] | ||
|
||
for i in range(0, len(to_process)): | ||
print('working on row %d' % i) | ||
|
||
row = to_process.iloc[i] | ||
|
||
query = '''select * from %s where workflow='%s' and openmlid=%d and hyperparameters='%s' and status='created';''' % ( | ||
table_name, row.workflow, row.openmlid, row.hyperparameters) | ||
|
||
datas = pd.read_sql_query(query, cnx) | ||
if len(datas) < 1: | ||
print('this row doesnt have any jobs remaining... too bad!') | ||
else: | ||
trainsize_small = json.loads(row.train_sizes)[0] | ||
|
||
trainsizes_todo = [] | ||
for train_size in datas['train_sizes'].unique(): | ||
train_size_ = json.loads(train_size) | ||
if train_size_[0] > trainsize_small: | ||
trainsizes_todo.append(train_size) | ||
|
||
for trainsize in trainsizes_todo: | ||
query_list.append( | ||
'''update %s set status='skipped' where workflow='%s' and openmlid=%d and hyperparameters='%s' and status='created' and train_sizes='%s';''' % ( | ||
table_name, row.workflow, row.openmlid, row.hyperparameters, trainsize)) | ||
|
||
query_list.append('''update %s set postprocess=0 where id=%d''' % (table_name, row.ID)) | ||
|
||
print('I have to execute %d queries... Lets get to work!' % len(query_list)) | ||
|
||
affected_rows = [] | ||
if len(query_list) > 0: | ||
cursor = cnx.cursor() | ||
for query in query_list: | ||
print('performing query: %s' % query) | ||
tmp = (cursor.execute(query)) | ||
print('rows affected: %d' % tmp) | ||
affected_rows.append(tmp) | ||
cursor.close() | ||
cnx.commit() | ||
cnx.close() | ||
|
||
|
||
while True: | ||
try: | ||
print('trying small...') | ||
postprocess_table('jobs_small') | ||
print('trying medium...') | ||
postprocess_table('jobs_medium') | ||
print('trying large...') | ||
postprocess_table('jobs_large') | ||
except Exception as e: | ||
print('failed with error %s' % str(e)) | ||
print('going to sleep for 5 min...') | ||
time.sleep(60*5) |
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
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
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
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