|
1 | | -@everywhere function defined_names(mod::Module) |
2 | | - # Exported only (default) + actually defined. Adjust all=true if you prefer. |
3 | | - [n for n in names(mod) if isdefined(mod, n)] |
4 | | -end |
5 | | - |
6 | | -@everywhere const list_problems = |
7 | | - intersect(defined_names(ADNLPProblems), defined_names(PureJuMP)) |
8 | | - |
9 | | -# The problems included should be carefully argumented and issues |
10 | | -# to create them added. |
11 | | -# TODO: tests are limited for JuMP-only problems |
12 | | -@everywhere const list_problems_not_ADNLPProblems = Symbol[] |
13 | | -@everywhere const list_problems_not_PureJuMP = Symbol[] |
14 | | - |
15 | | -@everywhere const list_problems_ADNLPProblems = |
16 | | - setdiff(list_problems, list_problems_not_ADNLPProblems) |
17 | | - |
18 | | -@everywhere const list_problems_PureJuMP = |
19 | | - setdiff(list_problems, list_problems_not_PureJuMP) |
20 | | - |
21 | | -@test setdiff(union(names(ADNLPProblems), list_problems_not_ADNLPProblems), list_problems) == |
22 | | - [:ADNLPProblems] |
23 | | -@test setdiff(union(names(PureJuMP), list_problems_not_PureJuMP), list_problems) == |
24 | | - [:PureJuMP] |
25 | | - |
26 | 1 | @everywhere function probe_missing(mod::Module, syms::Vector{Symbol}) |
27 | 2 | missing = Symbol[] |
28 | 3 | for s in syms |
|
33 | 8 | return (pid = myid(), missing = missing) |
34 | 9 | end |
35 | 10 |
|
| 11 | +const list_problems_ADNLPProblems = |
| 12 | + setdiff(list_problems, list_problems_not_ADNLPProblems) |
36 | 13 | probes = @sync begin |
37 | 14 | for pid in workers() |
38 | 15 | @async remotecall_fetch(probe_missing, pid, ADNLPProblems, list_problems_ADNLPProblems) |
39 | 16 | end |
40 | 17 | end |
41 | 18 | @info "ADNLPProblems missing per worker" probes |
42 | 19 |
|
| 20 | +const list_problems_PureJuMP = |
| 21 | + setdiff(list_problems, list_problems_not_PureJuMP) |
43 | 22 | probes = @sync begin |
44 | 23 | for pid in workers() |
45 | 24 | @async remotecall_fetch(probe_missing, pid, PureJuMP, list_problems_PureJuMP) |
46 | 25 | end |
47 | 26 | end |
48 | 27 | @info "PureJuMP missing per worker" probes |
| 28 | + |
| 29 | +@test setdiff(union(names(ADNLPProblems), list_problems_not_ADNLPProblems), list_problems) == |
| 30 | + [:ADNLPProblems] |
| 31 | +@test setdiff(union(names(PureJuMP), list_problems_not_PureJuMP), list_problems) == |
| 32 | + [:PureJuMP] |
0 commit comments