Skip to content

Commit 94d2f33

Browse files
committed
script
1 parent 6d6eae9 commit 94d2f33

File tree

4 files changed

+35
-23
lines changed

4 files changed

+35
-23
lines changed

scripts/Dockerfile.pypy3

Lines changed: 0 additions & 8 deletions
This file was deleted.

scripts/bench.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
d=$(dirname $0)
4+
5+
if [ -f /proc/cpuinfo ] ; then
6+
cat /proc/cpuinfo > cpuinfo.txt
7+
fi
8+
9+
$d/runall.py -x 2019:25 -u me --no-slow --no-64 | tee results-fast-32-me
10+
$d/runall.py -x 2019:25 -u me --no-slow | tee results-fast-me
11+
$d/runall.py -x 2019:25 -u me | tee results-me
12+
$d/runall.py -x 2019:25 --no-slow --no-64 | tee results-fast-32
13+
$d/runall.py -x 2019:25 --no-slow | tee results-fast
14+
$d/runall.py -x 2019:25 | tee results
15+
16+
if [ -f $d/../run.log ] ; then
17+
cp $d/../run.log .
18+
fi

scripts/debian-packages.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
clang
2+
llvm
3+
z3
4+
libgeos-dev
5+
libssl-dev
6+
libbz2-dev

scripts/runall.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
#!/usr/bin/env python3
22

33
import argparse
4+
import hashlib
45
import itertools
56
import os
7+
import shutil
8+
import sqlite3
69
import subprocess
710
import time
811
import typing as t
912
from collections import defaultdict
10-
from copy import deepcopy
11-
from datetime import timedelta, datetime
13+
from datetime import datetime
1214
from operator import itemgetter
1315
from pathlib import Path
1416

1517
# from zlib import crc32
16-
import sqlite3
17-
import shutil
18-
import hashlib
1918

2019
RED = "\033[91m"
2120
GREEN = "\033[92m"
@@ -229,7 +228,6 @@ def load_data(filter_year, filter_user, filter_yearday):
229228
solutions = defaultdict(dict)
230229

231230
for f in Path("data").rglob("*.in"):
232-
233231
if f.name.startswith("._"):
234232
continue
235233

@@ -304,7 +302,6 @@ def run_day(
304302
results = set()
305303

306304
for lang, (pattern, interpreter) in languages.items():
307-
308305
prog = Path(pattern.format(year=year, day=mday))
309306
key = ":".join(map(str, (year, day, crc, prog, lang.lower())))
310307

@@ -316,7 +313,6 @@ def run_day(
316313
in_cache = e is not None
317314

318315
if not in_cache and not dry_run:
319-
320316
e = run(prog, lang, interpreter, file, day_sols.get(crc), warmup[lang])
321317

322318
if e:
@@ -370,15 +366,12 @@ def run_day(
370366

371367

372368
def get_languages(filter_lang: t.Iterable[str]) -> t.Dict[str, t.Tuple[str, t.Union[str, None]]]:
373-
374369
filter_lang = set(map(str.casefold, filter_lang or ()))
375370

376371
languages = {}
377372
for lang, v in LANGUAGES.items():
378-
379373
if lang in INTERPRETERS:
380374
for lang2, interpreter in INTERPRETERS[lang].items():
381-
382375
if filter_lang and lang2.casefold() not in filter_lang:
383376
continue
384377

@@ -393,7 +386,6 @@ def get_languages(filter_lang: t.Iterable[str]) -> t.Dict[str, t.Tuple[str, t.Un
393386
# print(f"language {lang2} : interpreter {interpreter} not found")
394387
pass
395388
else:
396-
397389
if filter_lang and lang.casefold() not in filter_lang:
398390
continue
399391
languages[lang] = (v, None)
@@ -402,7 +394,6 @@ def get_languages(filter_lang: t.Iterable[str]) -> t.Dict[str, t.Tuple[str, t.Un
402394

403395

404396
def install_venv(interpreter: Path):
405-
406397
try:
407398
slug = 'import sys;print(((hasattr(sys, "subversion") and getattr(sys, "subversion")) or ("Py",))[0] + f"{sys.version_info.major}.{sys.version_info.minor}")'
408399

@@ -452,7 +443,8 @@ def main():
452443
parser.add_argument("-n", "--dry-run", action="store_true", help="do not run")
453444
parser.add_argument("--no-build", action="store_true", help="do not build")
454445
parser.add_argument("-u", "--user", dest="filter_user", metavar="USER", type=str, help="filter by user id")
455-
parser.add_argument("--no-slow", action="store_true", help="exlude slow solutions")
446+
parser.add_argument("--no-slow", action="store_true", help="exclude slow solutions")
447+
parser.add_argument("--no-64", action="store_true", help="exclude 64-bit only solutions")
456448
parser.add_argument("n", type=int, nargs="*", help="filter by year or year/day")
457449

458450
args = parser.parse_args()
@@ -468,8 +460,8 @@ def main():
468460

469461
languages = get_languages(args.language)
470462

463+
args.exclude = args.exclude or []
471464
if args.no_slow:
472-
args.exclude = args.exclude or []
473465
args.exclude.extend(
474466
" -x 2016:5 -x 2016:11 -x 2016:14 -x 2016:23"
475467
" -x 2018:21 -x 2018:23 "
@@ -479,6 +471,10 @@ def main():
479471
" -x 2022:15"
480472
" -x 2023:5 -x 2023:10 -x 2023:23".split()
481473
)
474+
if args.no_64:
475+
args.exclude.extend(
476+
" -x 2016:9 -x 2016:15" " -x 2022:11 -x 2022:20" " -x 2020:23" " -x 2023:8 -x 2023:11 -x 2023:21"
477+
)
482478

483479
filter_year = 0 if len(args.n) == 0 else int(args.n.pop(0))
484480
filter_day = set(args.n)

0 commit comments

Comments
 (0)