-
Notifications
You must be signed in to change notification settings - Fork 0
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
6ed6bdd
commit 07fa3e1
Showing
12 changed files
with
153 additions
and
142 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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
executor: | ||
backend: sequential | ||
data-access: | ||
mode: explicit-files | ||
files: | ||
- tests/data/nano_dimuon.root | ||
executor: | ||
backend: sequential | ||
processor: | ||
parallelize_over: files | ||
columns: | ||
- event | ||
- Muon_pt | ||
columns: 5 | ||
operation: sum |
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
from utils import run_tests | ||
|
||
|
||
def test_data_access_explicit_files(b): | ||
b.config["data-access"]["mode"] = "explicit-files" | ||
b.config["data-access"]["files"] = ["tests/data/nano_dimuon.root"] | ||
b.run() | ||
print(f"Successfully tested accessing data via explicing list of files") | ||
|
||
def test_data_access_explicit_dirs(b): | ||
b.config["data-access"]["mode"] = "explicit-dirs" | ||
b.config["data-access"]["directories"] = ["tests/data/"] | ||
b.run() | ||
print(f"Successfully tested accessing data via explicing list of directories") | ||
|
||
|
||
if __name__=='__main__': | ||
run_tests( | ||
config="tests/config-default.yaml", | ||
functions=[ | ||
test_data_access_explicit_files, | ||
test_data_access_explicit_dirs, | ||
] | ||
) | ||
|
This file was deleted.
Oops, something went wrong.
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,31 @@ | ||
from utils import run_tests | ||
|
||
|
||
def test_executor_sequential(b): | ||
b.config["executor"]["backend"] = "sequential" | ||
b.run() | ||
print(f"Successfully tested sequential executor") | ||
|
||
def test_executor_futures(b): | ||
b.config["executor"]["backend"] = "futures" | ||
b.run() | ||
print(f"Successfully tested futures executor") | ||
|
||
def test_executor_dask_local(b): | ||
b.config["executor"]["backend"] = "dask-local" | ||
b.config["executor"]["workers"] = 1 | ||
b.run() | ||
print(f"Successfully tested dask-local executor") | ||
|
||
|
||
if __name__=='__main__': | ||
run_tests( | ||
config="tests/config-default.yaml", | ||
functions=[ | ||
test_executor_sequential, | ||
test_executor_futures, | ||
test_executor_dask_local | ||
] | ||
) | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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,73 @@ | ||
from utils import run_tests | ||
|
||
|
||
def test_processor_columns_explicit(b): | ||
b.config["processor"]["columns"] = ["Muon_pt", "Muon_eta"] | ||
b.run() | ||
print(f"Successfully tested processing explicit list of columns") | ||
|
||
def test_processor_columns_number(b): | ||
b.config["processor"]["columns"] = 5 | ||
b.run() | ||
print(f"Successfully tested processing given number of columns") | ||
|
||
def test_processor_collections(b): | ||
b.config["processor"]["columns"] = [] | ||
b.config["processor"]["collections"] = ["Muon"] | ||
b.run() | ||
print(f"Successfully tested processing a collection of columns") | ||
|
||
def test_processor_operation_nothing(b): | ||
b.config["processor"]["operation"] = "nothing" | ||
b.run() | ||
print(f"Successfully tested doing nothing to specified columns") | ||
|
||
def test_processor_operation_load(b): | ||
b.config["processor"]["operation"] = "load_into_memory" | ||
b.run() | ||
print(f"Successfully tested loading specified columns into memory") | ||
|
||
def test_processor_parallelize_over_files(b): | ||
b.config["processor"]["parallelize_over"] = "files" | ||
b.config["executor"]["backend"] = "futures" | ||
b.config["data-access"]["files"] = [ | ||
"tests/data/nano_dimuon.root", | ||
"tests/data/nano_dimuon.root" | ||
] | ||
b.run() | ||
print(f"Successfully tested parallelization over files") | ||
|
||
def test_processor_parallelize_over_columns(b): | ||
b.config["processor"]["parallelize_over"] = "columns" | ||
b.config["executor"]["backend"] = "futures" | ||
b.config["processor"]["columns"] = 2 | ||
b.run() | ||
print(f"Successfully tested parallelization over files") | ||
|
||
def test_processor_parallelize_over_files_and_columns(b): | ||
b.config["processor"]["parallelize_over"] = "files_and_columns" | ||
b.config["executor"]["backend"] = "futures" | ||
b.config["data-access"]["files"] = [ | ||
"tests/data/nano_dimuon.root", | ||
"tests/data/nano_dimuon.root" | ||
] | ||
b.config["processor"]["columns"] = 2 | ||
b.run() | ||
print(f"Successfully tested parallelization over files and columns") | ||
|
||
|
||
if __name__=='__main__': | ||
run_tests( | ||
config="tests/config-default.yaml", | ||
functions=[ | ||
test_processor_columns_explicit, | ||
test_processor_columns_number, | ||
test_processor_collections, | ||
test_processor_operation_nothing, | ||
test_processor_operation_load, | ||
test_processor_parallelize_over_files, | ||
test_processor_parallelize_over_columns, | ||
test_processor_parallelize_over_files_and_columns, | ||
] | ||
) | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
import os, sys | ||
sys.path.append(os.getcwd()+"/af_benchmark") | ||
import copy | ||
from benchmark import Benchmark | ||
|
||
def run_tests(config, functions): | ||
b = Benchmark(config) | ||
for func in functions: | ||
old_config = copy.deepcopy(b.config) | ||
func(b) | ||
b.reset() | ||
b.config = old_config | ||
|