Skip to content

Commit

Permalink
Add excludelist back in and refactor it to take new names
Browse files Browse the repository at this point in the history
  • Loading branch information
nbelakovski committed Apr 21, 2024
1 parent e467c47 commit 093ee23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions python/profiles/excludelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ def excludelist(problem_type):
'TOINTPSP',
'VARDIM',
]
elif problem_type == 'bound':
elif problem_type == 'bobyqa':
# For the following problems, the classical bobyqa (single-precision) encounters SEGFAULT.
excludelist += ['MGH17LS']
elif problem_type == 'adjacency linear':
elif problem_type == 'lincoa':
excludelist += [
'DALLASM',
'TARGUS',
]
elif problem_type == 'quadratic other':
elif problem_type == 'cobyla':
# The following problems were observed to take excessive time during tests GitHub Actions and
# make the tests run overtime. Some of them may not be very time-consuming during a "plain"
# test but become more challenging with some perturbations or variations. The excessive time may
Expand Down
12 changes: 9 additions & 3 deletions python/profiles/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,20 +269,22 @@ def run_three_benchmarks(matlab_fun, python_fun, algorithm, cutest_problem_names
os.environ['NONDEFAULT_PYTHON'] = "False"
algorithm = algorithm.lower()
ALGORITHM = algorithm.upper()
run_benchmark([matlab_fun, python_fun], [f'MATLAB-{ALGORITHM}', f'Python-{ALGORITHM}'], cutest_problem_names, benchmark_id=f'{algorithm}_default_options', n_jobs=n_jobs, project_x0=True)
project_x0 = algorithm == 'lincoa'
run_benchmark([matlab_fun, python_fun], [f'MATLAB-{ALGORITHM}', f'Python-{ALGORITHM}'], cutest_problem_names, benchmark_id=f'{algorithm}_default_options', n_jobs=n_jobs, project_x0=project_x0)
if not default_only:
os.environ['NONDEFAULT_MATLAB'] = "True"
os.environ['NONDEFAULT_PYTHON'] = "True"
run_benchmark([matlab_fun, python_fun], [f'MATLAB-{ALGORITHM}', f'Python-{ALGORITHM}'], cutest_problem_names, benchmark_id=f'{algorithm}_nondefault_options', n_jobs=n_jobs, project_x0=True)
run_benchmark([matlab_fun, python_fun], [f'MATLAB-{ALGORITHM}', f'Python-{ALGORITHM}'], cutest_problem_names, benchmark_id=f'{algorithm}_nondefault_options', n_jobs=n_jobs, project_x0=project_x0)
os.environ['NONDEFAULT_MATLAB'] = "True"
os.environ['NONDEFAULT_PYTHON'] = "False"
run_benchmark([matlab_fun, python_fun], [f'MATLAB-{ALGORITHM}', f'Python-{ALGORITHM}'], cutest_problem_names, benchmark_id=f'{algorithm}_different_options', n_jobs=n_jobs, project_x0=True)
run_benchmark([matlab_fun, python_fun], [f'MATLAB-{ALGORITHM}', f'Python-{ALGORITHM}'], cutest_problem_names, benchmark_id=f'{algorithm}_different_options', n_jobs=n_jobs, project_x0=project_x0)

if args.newuoa:
start = time()
print("Running profiles for NEWUOA")
with open('uobyqa_newuoa.txt') as f:
cutest_problem_names = f.read().splitlines()
cutest_problem_names = list(filter(lambda x: x not in excludelist('unconstrained'), cutest_problem_names))
run_three_benchmarks(matlab_newuoa, python_newuoa, 'newuoa', cutest_problem_names, args.default_only, args.n_jobs)
print(f'Completed NEWUOA profile in {time() - start:.2f} seconds')

Expand All @@ -291,6 +293,7 @@ def run_three_benchmarks(matlab_fun, python_fun, algorithm, cutest_problem_names
print("Running profiles for UOBYQA")
with open('uobyqa_newuoa.txt') as f:
cutest_problem_names = f.read().splitlines()
cutest_problem_names = list(filter(lambda x: x not in excludelist('unconstrained'), cutest_problem_names))
run_three_benchmarks(matlab_uobyqa, python_uobyqa, 'uobyqa', cutest_problem_names, args.default_only, args.n_jobs)
print(f'Completed UOBYQA profile in {time() - start:.2f} seconds')

Expand All @@ -299,6 +302,7 @@ def run_three_benchmarks(matlab_fun, python_fun, algorithm, cutest_problem_names
print("Running profiles for BOBYQA")
with open('bobyqa.txt') as f:
cutest_problem_names = f.read().splitlines()
cutest_problem_names = list(filter(lambda x: x not in excludelist('bobyqa'), cutest_problem_names))
run_three_benchmarks(matlab_bobyqa, python_bobyqa, 'bobyqa', cutest_problem_names, args.default_only, args.n_jobs)
print(f'Completed BOBYQA profile in {time() - start:.2f} seconds')

Expand All @@ -307,6 +311,7 @@ def run_three_benchmarks(matlab_fun, python_fun, algorithm, cutest_problem_names
print("Running profiles for LINCOA")
with open('lincoa.txt') as f:
cutest_problem_names = f.read().splitlines()
cutest_problem_names = list(filter(lambda x: x not in excludelist('lincoa'), cutest_problem_names))
run_three_benchmarks(matlab_lincoa, python_lincoa, 'lincoa', cutest_problem_names, args.default_only, args.n_jobs)
print(f'Completed LINCOA profile in {time() - start:.2f} seconds')

Expand All @@ -315,5 +320,6 @@ def run_three_benchmarks(matlab_fun, python_fun, algorithm, cutest_problem_names
print("Running profiles for COBYLA")
with open('cobyla.txt') as f:
cutest_problem_names = f.read().splitlines()
cutest_problem_names = list(filter(lambda x: x not in excludelist('cobyla'), cutest_problem_names))
run_three_benchmarks(matlab_cobyla, python_cobyla, 'cobyla', cutest_problem_names, args.default_only, args.n_jobs)
print(f'Completed COBYLA profile in {time() - start:.2f} seconds')

0 comments on commit 093ee23

Please sign in to comment.