Skip to content

Commit 13db61f

Browse files
committed
Looks like I messed up the merge, oops, fixing it
1 parent adb9e2d commit 13db61f

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

src/mtg/initialisation.jl

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,6 @@ function init_simulation(mtg, mapping; nsteps=1, outputs=nothing, type_promotion
327327
@assert false "Error : Mapping status at $organ_with_vector level contains a vector. If this was intentional, call the function generate_models_from_status_vectors on your mapping before calling run!. And bear in mind this is not meant for production. If this wasn't intentional, then it's likely an issue on the mapping definition, or an unusual model."
328328
end
329329

330-
# preliminary_check_timestep_data(mapping, orchestrator)
331-
332330
soft_dep_graph_roots, hard_dep_dict = hard_dependencies(mapping; verbose=false, orchestrator=orchestrator)
333331

334332
# Get the status of each node by node type, pre-initialised considering multi-scale variables:
@@ -338,28 +336,6 @@ function init_simulation(mtg, mapping; nsteps=1, outputs=nothing, type_promotion
338336
# Get the status of each node by node type, pre-initialised considering multi-scale variables:
339337
statuses, status_templates, reverse_multiscale_mapping, vars_need_init =
340338
init_statuses(mtg, mapping, soft_dep_graph_roots; type_promotion=type_promotion, verbose=verbose, check=check, orchestrator=orchestrator)
341-
342-
343-
# First step, get the hard-dependency graph and create SoftDependencyNodes for each hard-dependency root. In other word, we want
344-
# only the nodes that are not hard-dependency of other nodes. These nodes are taken as roots for the soft-dependency graph because they
345-
# are independant.
346-
# Second step, compute the soft-dependency graph between SoftDependencyNodes computed in the first step. To do so, we search the
347-
# inputs of each process into the outputs of the other processes, at the same scale, but also between scales. Then we keep only the
348-
# nodes that have no soft-dependencies, and we set them as root nodes of the soft-dependency graph. The other nodes are set as children
349-
# of the nodes that they depend on.
350-
dep_graph = soft_dependencies_multiscale(soft_dep_graphs_roots, reverse_multiscale_mapping, hard_dep_dict)
351-
# During the building of the soft-dependency graph, we identified the inputs and outputs of each dependency node,
352-
# and also defined **inputs** as MappedVar if they are multiscale, i.e. if they take their values from another scale.
353-
# What we are missing is that we need to also define **outputs** as multiscale if they are needed by another scale.
354-
355-
# Checking that the graph is acyclic:
356-
iscyclic, cycle_vec = is_graph_cyclic(dep_graph; warn=false)
357-
# Note: we could do that in `soft_dependencies_multiscale` but we prefer to keep the function as simple as possible, and
358-
# usable on its own.
359-
360-
iscyclic && error("Cyclic dependency detected in the graph. Cycle: \n $(print_cycle(cycle_vec)) \n You can break the cycle using the `PreviousTimeStep` variable in the mapping.")
361-
# Third step, we identify which
362-
363339
# Print an info if models are declared for nodes that don't exist in the MTG:
364340
if check && any(x -> length(last(x)) == 0, statuses)
365341
model_no_node = join(findall(x -> length(x) == 0, statuses), ", ")

0 commit comments

Comments
 (0)