FIX: Support PhaseRecord pickling, switch SymEngine backend to LLVM (configurable) #264
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
…faults to LLVM compiling everywhere.
…ng cyipopt" This reverts commit 49ff4c1.
bocklund added a commit to PhasesResearchLab/ESPEI that referenced this pull request
Feb 21, 2020
…iving force (#115) Calculating the driving force error for phase boundary data is typically the most computationally intensive part of running ESPEI. ** Requires pycalphad/pycalphad#264 to run these commits in parallel!** This PR tries to optimize (and simplify) calculating the ZPF error by doing the following: 1. Introduces a `PhaseRegion` NamedTuple that describes the data to calculate for each phase boundary set, instead of passing around all the data lists disparately. * This significantly reduces the complexity of the driving force calculation. * The `PhaseRegion` gets its own PhaseRecords for the calculation and contains all the relevant equilibrium arguments for that specific data. This therefore fixes a bug for mixing data types across different systems, e.g. fitting a ternary database with binary data, which used to fail because the callables/PhaseRecords would be built for the ternary, but there were only composition information for the binary and the PhaseRecords were not re-computed each time. For this reason, pycalphad/pycalphad#264 is required to run ESPEI in parallel, since SymEngine Lambda compiled objects cannot be pickled. * PhaseRecords are now updated for each parameter set that is calculated. This is an optimization that prevents recalculating the constraints and recompiling the constraints every time equilibrium is called, since each tieline point in the PhaseRegion will always have the same conditions and therefore constraints. 2. "Shadow functions" are implemented that shadow pycalphad's `calculate` (`calculate_`) and `equilibrium` (`equilibrium_`). These are optimized versions of pycalphad's functions that operate directly on the species, phase records, and other pycalphad internal objects as much as possible to optimize calls. 3. A `no_op_equilibrium_` "shadow function" (it doesn't really shadow anything, but exists in the same vein) which doesn't actually call `solve_eq_at_conditions` and instead just treats the `starting_point` solution as the equilibrium solution. This can give large speedups (I have already seen 3x-10x for ZPF data in certain tests systems) 4. An `approximate_equilibrium` setting in the ESPEI yaml files, which defaults to False. Closes #99
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge.