Skip to content

Commit

Permalink
Add progress to selected cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
tfiedor committed Jul 30, 2024
1 parent 8355a79 commit 36aecac
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion perun/fuzz/evaluate/by_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_initial_coverage(
# run program with each seed
log.minor_info("Running program with seeds")
log.increase_indent()
for seed in seeds:
for seed in log.progress(seeds, description="Running Seeds"):
prepare_workspace(fuzzing_config.coverage.gcno_path)

command = " ".join([os.path.abspath(executable.cmd), seed.path])
Expand Down
3 changes: 2 additions & 1 deletion perun/fuzz/evaluate/by_perun.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import perun.check.factory as check
import perun.logic.runner as run
from perun.utils.structs import PerformanceChange
from perun.utils import log

if TYPE_CHECKING:
from perun.fuzz.structs import Mutation
Expand Down Expand Up @@ -58,7 +59,7 @@ def baseline_testing(
)
)

for file in seeds[1:]:
for file in log.progress(seeds[1:], description="Running Seeds"):
# target profile
target_pg = list(
run.generate_profiles_for(
Expand Down
2 changes: 1 addition & 1 deletion perun/logic/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def add(
"""
perun_log.major_info("Adding profiles")
added_profile_count = 0
for profile_name in profile_names:
for profile_name in perun_log.progress(profile_names, description="Adding Profiles"):
# Test if the given profile exists (This should hold always, or not?)
reg_rel_path = os.path.relpath(profile_name)
if not os.path.exists(profile_name):
Expand Down
2 changes: 1 addition & 1 deletion perun/logic/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def generate_jobs_on_current_working_dir(
log.major_info("Running Jobs")
log.increase_indent()
job_counter = 1
for job_cmd, workloads_per_cmd in job_matrix.items():
for job_cmd, workloads_per_cmd in log.progress(job_matrix.items(), "Running Jobs"):
for workload, jobs_per_workload in workloads_per_cmd.items():
# Prepare the specification
generator_spec = workload_generators_specs.get(
Expand Down
7 changes: 5 additions & 2 deletions perun/profile/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# Perun Imports
from perun.postprocess.regression_analysis import transform
from perun.profile import query
from perun.utils import log
from perun.utils.common import common_kit

if TYPE_CHECKING:
Expand Down Expand Up @@ -72,7 +73,9 @@ def resources_to_pandas_dataframe(profile: Profile) -> pandas.DataFrame:
values["snapshots"] = array.array("I")

# All resources at this point should be flat
for snapshot, resource in profile.all_resources(flatten_values=True):
for snapshot, resource in log.progress(
profile.all_resources(flatten_values=True), "Converting To Pandas"
):
values["snapshots"].append(snapshot)
for resource_key in resource_keys:
values[resource_key].append(resource.get(resource_key, numpy.nan))
Expand All @@ -95,7 +98,7 @@ def models_to_pandas_dataframe(profile: Profile) -> pandas.DataFrame:
model_keys = list(query.all_model_fields_of(profile))
values: dict[str, list[Any]] = {key: [] for key in model_keys}

for _, model in profile.all_models():
for _, model in log.progress(profile.all_models(), description="Converting To Pandas"):
flattened_resources = dict(list(query.all_items_of(model)))
for model_key in model_keys:
values[model_key].append(flattened_resources.get(model_key, numpy.nan))
Expand Down
2 changes: 1 addition & 1 deletion perun/view_diff/flamegraph/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def generate_flamegraphs(
:param width: width of the flame graph
"""
flamegraphs = []
for i, dtype in enumerate(data_types):
for i, dtype in log.progress(enumerate(data_types), description="Generating Flamegraphs"):
try:
data_type = mapping.from_readable_key(dtype)
lhs_graph = flamegraph_factory.draw_flame_graph(
Expand Down

0 comments on commit 36aecac

Please sign in to comment.