diff --git a/HySoP/hysop/problem/problem.py b/HySoP/hysop/problem/problem.py index d5d961c63e2cff975a514b081f55c4137a8c3de2..758bcbdda5aeeb11cd7502a08cd9776c8381848c 100644 --- a/HySoP/hysop/problem/problem.py +++ b/HySoP/hysop/problem/problem.py @@ -74,7 +74,18 @@ class Problem(object): if __VERBOSE__: print "==== Variables initialization ====" - # \todo find a way to set self.input properly. + # Build variables list to initialize + # These are operators input variables that are not output of + # previous operators in the operator stack + self.input += self.operators[-1].input + for op in self.operators[:-1][::-1]: + for v in op.output: + if v in self.input: + self.input.remove(v) + for v in op.input: + if not v in self.input: + self.input.append(v) + for v in self.input: v.initialize() @@ -113,22 +124,12 @@ class Problem(object): op.apply(self.simulation) self.simulation.advance() - print "\n\n End solving\n" - print "=== Timings ===" - if (self.domain.topologies.values()[0].rank == 0): - for op in self.operators: - op.printComputeTime() - self.time_info[0] += op.time_info[0] - self.time_info[1] += op.time_info[1] - print "\n" - print "===\n" - @debug def finalize(self): """ Finalize method """ - print "==== Finalization ====" + print "\n\n==== End ====" ## We terminate monitors before operators. for op in self.operators: if isinstance(op, Monitoring):