Skip to content

Commit

Permalink
Tried to fix one of the unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMair committed Dec 15, 2023
1 parent fb42784 commit 0438ad6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions test/runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ end

function get_heterogeneous_config()
return Dict{Symbol,Any}(
:x => IterableVariable([1, 2]),
:x => IterableVariable([1, 2, 3]),
:y => IterableVariable([1, 2]),
)
end
Expand Down Expand Up @@ -92,11 +92,11 @@ end

trials = get_trials_by_name(database, experiment.name)
for pid in ps
max_threads = maximum([t.results[:num_threads] for t in trials if t.results[:distributed_id] == pid])
max_threads = min(max_threads, length([true for t in trials if t.results[:distributed_id] == pid]))
thread_ids = [t.results[:thread_id] for t in trials if t.results[:distributed_id] == pid]
unique_threads = length(unique(thread_ids))
@test unique_threads == 2
@test unique_threads == length(thread_ids)

@test unique_threads == max_threads
end
# Cleanup
rmprocs(ps...)
Expand Down
6 changes: 4 additions & 2 deletions test/trial_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ function run_heterogeneous_experiment(config, trial_id)

# Simulate work
s = 0.0
for i in 1:500000000
s += rand() / 1000
for i in 1:100000000
s += rand() / 10000
end

results[:sum] = s

return results
end

0 comments on commit 0438ad6

Please sign in to comment.