Conversation
- cosmo3D_v33.c: adapt free_class_structs, run_class, CLASS_sigma8, get_class_s8, get_class_As, and p_class to support CLASS v3.3 API (struct fourier/harmonic/thermodynamics/perturbations/transfer, input_read_from_file, fourier_pk_at_k_and_z) via #if CLASS_V33 / #else guards; the else branch covers both CLASS_V29 and unversioned class - cosmo3D_v33.c: fix sigma8 shooting bugs visible in v33: read sigma8 before free_class_structs in get_class_s8; free between double run_class calls in get_class_As - cosmo3D_v33.c: add HMCode runmode variants (HMcode2020, HMcode2016, HMcode2020_baryonic_feedback, etc.) routing to P_type=4; class/CLASS runmodes call halofit; pass hmcode_version and log10T_heat_hmcode (t_agn) to CLASS parser - structs.c: add t_agn field to pdeltapara for log10T_heat_hmcode Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
distortions_free guards on has_distortions so it is a no-op for mPk runs, but omitting it would leak if distortions are ever enabled. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Note that makefiles for v33 requires linking C++ standard library - add "-lc++" to your project Makefile. Here's a minimal example CLASS33_DIR := ../cosmolike_core/class_v33 opt_home_CLASS33 := -std=c99 -Wno-missing-braces -Wno-missing-field-initializers class_v33: |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Suggestion cannot be applied right now. Please check back later.
modified cosmo3D.c to support CLASS v3.3
get_class_s8, get_class_As, and p_class to support CLASS v3.3 API
(struct fourier/harmonic/thermodynamics/perturbations/transfer,
input_read_from_file, fourier_pk_at_k_and_z) via #if CLASS_V33 / #else
guards; the else branch covers both CLASS_V29 and unversioned class
before free_class_structs in get_class_s8; free between double
run_class calls in get_class_As
HMcode2016, HMcode2020_baryonic_feedback, etc.) routing to P_type=4;
class/CLASS runmodes call halofit; pass hmcode_version and
log10T_heat_hmcode (t_agn) to CLASS parser
I tested that this is fully backward compatible, defaults to the class version that's shipped with cosmolike_core, and that changes at the data vector level are typically < 0.1% between different class versions (all with halofit) if the amplitude is specified in terms of A_s. This difference is slightly larger is sigma_8 is specified, due to updates to the sigma_8 shooting algorithm.
I also checked that class structures are freed completely between difference calls and did not see any indication of memory leaks in a short MCMC with 10000 samples.