- Goal
The following script executes the solution process and:
Sets the Solution Process Settings to the
setting.Completes solutions for core settings.
Tracks how long each solution takes when solved using a different number of cores.
- Code
# Get the existing My Computer, Background solve configuration config = ExtAPI.Application.SolveConfigurations["My Computer, Background"] config.SetAsDefault() for cores in range(8,13): config.SolveProcessSettings.MaxNumberOfCores = cores Model.Analyses[0].Solution.ClearGeneratedData() # pass in True to wait for the solve to complete Model.Analyses[0].Solution.Solve(True) Model.Analyses[0].Solution.GetResults() elapsed_time = Model.Analyses[0].Solution.ElapsedRunTime print "%d cores took %d secs" % (cores, elapsed_time)