LALInferenceReadData swaps components of simulated frequency domain data when run in Docker container
I have a Docker container that contains GSL, FFTW, and various LAL packages all installed with conda. When I call LALInferenceReadData within the container to get some LALSimAdLIGO simulated data, the resulting COMPLEX16FrequencySeries has its real and imaginary components swapped. That is, each measurement in the COMPLEX16FrequencySeries that should be a + ib
is actually returned as b + ia
.
When I compile and run the same code on my own computer, outside of a Docker container, the real and imaginary components are not swapped.
Here is a script demonstrating this behavior. It computes the same simulated data using both the conda version of LALInferenceReadData and a copy-pasted version of LALInferenceReadData's source. When I compile and run this code on my local computer, both versions of the simulated data are the same (as desired).
Set trigtime to 1168989748.0000000000
Using 0.400000 seconds of padding for IFO H1
Using 0.400000 seconds of padding for IFO L1
Saved data computed with LALInferenceReadData to lalinferencereaddata_frequency_domain_data_local_computer.tsv
*** index 1000 as computed with conda-installed LALInferenceReadData: (real=-2.76371e-25, imag=8.35524e-25)
*** vs.
*** index 1000 as computed with code copy/pasted from LALInferenceReadData: (real=-2.76371e-25, imag=8.35524e-25)
Interestingly, when I compile and run it in the Docker container, the two versions are not the same. The data produced by the conda version of LALInferenceReadData has its components swapped, while the data produced by the copy-pasted code does not.
Set trigtime to 1168989748.0000000000
Using 0.400000 seconds of padding for IFO H1
Using 0.400000 seconds of padding for IFO L1
Saved data computed with LALInferenceReadData to lalinferencereaddata_frequency_domain_data_docker.tsv
*** index 1000 as computed with conda-installed LALInferenceReadData: (real=8.35524e-25, imag=-2.76371e-25)
*** vs.
*** index 1000 as computed with code copy/pasted from LALInferenceReadData: (real=-2.76371e-25, imag=8.35524e-25)
I don't think LALInferenceReadData has some subtle implementation error that only becomes apparent inside the Docker container. If that were the case, then the simulation produced by the copy/pasted code would also have its components flipped. Instead, I suspect the problem is specific to the conda install of LALInference. Perhaps there is a library incompatibility?
The script again: https://git.ligo.org/howard.deshong/bayeswave-cpp/-/tree/lalinferencereaddata-docker-issue
For reference, here are the results of conda list
in my local computer's environment (M1 Mac) and in the Docker image (Linux). Both my computer and the Docker image have the same versions of the GSL, FFTW, and the LAL libraries, although the builds are different.
My computer:
# Name Version Build Channel
boost-cpp 1.74.0 h1cb353e_8 conda-forge
bzip2 1.0.8 h3422bc3_4 conda-forge
c-ares 1.18.1 h3422bc3_0 conda-forge
c-compiler 1.5.0 h5008568_0 conda-forge
ca-certificates 2022.9.14 h4653dfc_0 conda-forge
catch2 3.1.0 hf86a087_0 conda-forge
cctools 973.0.1 hcbb26d4_10 conda-forge
cctools_osx-arm64 973.0.1 he930820_10 conda-forge
clang 14.0.4 hce30654_0 conda-forge
clang-14 14.0.4 default_h81a5282_0 conda-forge
clang-format 14.0.4 default_h81a5282_0 conda-forge
clang-format-14 14.0.4 default_h81a5282_0 conda-forge
clang-tools 14.0.4 default_h81a5282_0 conda-forge
clang_osx-arm64 14.0.4 hc634a12_2 conda-forge
clangxx 14.0.4 default_hb7ecf47_0 conda-forge
clangxx_osx-arm64 14.0.4 hb7a33d8_2 conda-forge
cmake 3.24.2 h967666c_0 conda-forge
compiler-rt 14.0.4 h4418234_0 conda-forge
compiler-rt_osx-arm64 14.0.4 hb07f8d1_0 conda-forge
cxx-compiler 1.5.0 hffc8910_0 conda-forge
expat 2.4.9 hb7217d7_0 conda-forge
********** fftw 3.3.10 nompi_h3046061_4 conda-forge **
gettext 0.19.8.1 h049c9fb_1008 conda-forge
********** gsl 2.7 h6e638da_0 conda-forge **
hdf5 1.12.2 nompi_h33dac16_100 conda-forge
icu 70.1 h6b3803e_0 conda-forge
krb5 1.19.3 he492e65_0 conda-forge
********** lalinference-data 4.1.1 hce30654_1 conda-forge
********** lalsimulation-data 4.0.2 hce30654_0 conda-forge
ld64 609 h619f069_10 conda-forge
ld64_osx-arm64 609 h132958c_10 conda-forge
ldas-tools-al 2.6.7 h354f32d_1 conda-forge
ldas-tools-framecpp 2.9.1 h6120fb8_0 conda-forge
libblas 3.9.0 16_osxarm64_openblas conda-forge
libcblas 3.9.0 16_osxarm64_openblas conda-forge
libclang 14.0.4 default_h81a5282_0 conda-forge
libclang-cpp14 14.0.4 default_h81a5282_0 conda-forge
libclang13 14.0.4 default_he70ec0d_0 conda-forge
libcurl 7.83.1 h7965298_0 conda-forge
libcxx 14.0.6 h2692d47_0 conda-forge
libedit 3.1.20191231 hc8eb9b7_2 conda-forge
libev 4.33 h642e427_1 conda-forge
libffi 3.4.2 h3422bc3_5 conda-forge
libframel 8.42.2 he4db4b2_0 conda-forge
libgfortran 5.0.0 11_3_0_hd922786_25 conda-forge
libgfortran5 11.3.0 hdaf2cc0_25 conda-forge
libglib 2.72.1 ha1047ec_0 conda-forge
libiconv 1.16 h642e427_0 conda-forge
********** liblal 7.2.2 fftw_h6e50f36_100 conda-forge
********** liblalburst 1.6.2 h50b553b_1 conda-forge
********** liblalframe 2.0.3 h1a8c8d9_0 conda-forge
********** liblalinference 4.1.1 h29b851f_1 conda-forge
********** liblalinspiral 3.0.2 h50b553b_1 conda-forge
********** liblalmetaio 3.0.2 h1a8c8d9_0 conda-forge
********** liblalsimulation 4.0.2 h689202d_0 conda-forge
libllvm14 14.0.4 h37c5ba8_0 conda-forge
libnghttp2 1.47.0 h519802c_1 conda-forge
libopenblas 0.3.21 openmp_hc731615_3 conda-forge
libssh2 1.10.0 h7a5bd25_3 conda-forge
libuv 1.44.2 he4db4b2_0 conda-forge
libzlib 1.2.12 h03a7124_3 conda-forge
llvm-openmp 14.0.4 hd125106_0 conda-forge
llvm-tools 14.0.4 h37c5ba8_0 conda-forge
make 4.3 he57ea6c_1 conda-forge
metaio 8.5.1 he1e0b03_1001 conda-forge
ncurses 6.3 h07bb92c_1 conda-forge
openssl 3.0.5 h03a7124_2 conda-forge
pcre 8.45 hbdafb3b_0 conda-forge
pkg-config 0.29.2 hab62308_1008 conda-forge
rhash 1.4.3 he4db4b2_0 conda-forge
sigtool 0.1.3 h44b9a77_0 conda-forge
tapi 1100.0.11 he4954df_0 conda-forge
xz 5.2.6 h57fd34a_0 conda-forge
zlib 1.2.12 h03a7124_3 conda-forge
zstd 1.5.2 h8128057_4 conda-forge
Docker:
# Name Version Build Channel
_openmp_mutex 4.5 2_gnu conda-forge
binutils 2.36.1 h64c2a2e_2 conda-forge
binutils_impl_linux-aarch64 2.36.1 h026399b_2 conda-forge
binutils_linux-aarch64 2.36 h7854541_10 conda-forge
boost-cpp 1.74.0 ha1c1135_8 conda-forge
bzip2 1.0.8 hf897c2e_4 conda-forge
c-ares 1.18.1 hf897c2e_0 conda-forge
c-compiler 1.4.2 h4e544f5_0 conda-forge
ca-certificates 2022.9.14 h4fd8a4c_0 conda-forge
catch2 3.1.0 hdd96247_0 conda-forge
clang 15.0.1 h8af1aa0_0 conda-forge
clang-15 15.0.1 default_ha7bf5e6_0 conda-forge
clang-format 15.0.1 default_ha7bf5e6_0 conda-forge
clang-format-15 15.0.1 default_ha7bf5e6_0 conda-forge
clang-tools 15.0.1 default_ha7bf5e6_0 conda-forge
cmake 3.24.2 hcad14f8_0 conda-forge
cxx-compiler 1.4.2 hdd96247_0 conda-forge
expat 2.4.9 ha18d298_0 conda-forge
********** fftw 3.3.10 nompi_ha1d0423_105 conda-forge
gcc 10.4.0 h27fe70b_10 conda-forge
gcc_impl_linux-aarch64 10.4.0 hbc23e19_16 conda-forge
gcc_linux-aarch64 10.4.0 h72ad2ee_10 conda-forge
********** gsl 2.7 h294027d_0 conda-forge
gxx 10.4.0 h27fe70b_10 conda-forge
gxx_impl_linux-aarch64 10.4.0 hbc23e19_16 conda-forge
gxx_linux-aarch64 10.4.0 hb08d869_10 conda-forge
hdf5 1.12.2 nompi_h3900512_100 conda-forge
icu 70.1 ha18d298_0 conda-forge
kernel-headers_linux-aarch64 4.18.0 h5b4a56d_13 conda-forge
keyutils 1.6.1 h4e544f5_0 conda-forge
krb5 1.19.3 h750e270_0 conda-forge
********** lalinference-data 4.1.1 h8af1aa0_1 conda-forge
********** lalsimulation-data 4.0.2 h8af1aa0_0 conda-forge
ld_impl_linux-aarch64 2.36.1 h02ad14f_2 conda-forge
ldas-tools-al 2.6.7 hbd9d12b_1 conda-forge
ldas-tools-framecpp 2.9.1 h99eb3dd_0 conda-forge
libblas 3.9.0 16_linuxaarch64_openblas conda-forge
libcblas 3.9.0 16_linuxaarch64_openblas conda-forge
libclang 15.0.1 default_ha7bf5e6_0 conda-forge
libclang-cpp15 15.0.1 default_ha7bf5e6_0 conda-forge
libclang13 15.0.1 default_h3684801_0 conda-forge
libcurl 7.83.1 h22f3f83_0 conda-forge
libedit 3.1.20191231 he28a2e2_2 conda-forge
libev 4.33 h516909a_1 conda-forge
libframel 8.42.2 h4e544f5_0 conda-forge
libgcc-devel_linux-aarch64 10.4.0 hf691355_16 conda-forge
libgcc-ng 12.1.0 h3242a24_16 conda-forge
libgfortran-ng 12.1.0 he9431aa_16 conda-forge
libgfortran5 12.1.0 h41d5c85_16 conda-forge
libgomp 12.1.0 h3242a24_16 conda-forge
libiconv 1.16 h6dd45c4_0 conda-forge
********** liblal 7.2.2 fftw_he26ac06_100 conda-forge
********** liblalburst 1.6.2 h8ec3ef4_1 conda-forge
********** liblalframe 2.0.3 h4e544f5_0 conda-forge
********** liblalinference 4.1.1 h1546ec1_1 conda-forge
********** liblalinspiral 3.0.2 h8ec3ef4_1 conda-forge
********** liblalmetaio 3.0.2 h4e544f5_0 conda-forge
********** liblalsimulation 4.0.2 h8ec3ef4_0 conda-forge
libllvm15 15.0.1 h71eeefc_0 conda-forge
libnghttp2 1.47.0 h674c3cc_1 conda-forge
libopenblas 0.3.21 pthreads_h6cb6f83_3 conda-forge
libsanitizer 10.4.0 h69a60c7_16 conda-forge
libssh2 1.10.0 he5a64b1_3 conda-forge
libstdcxx-devel_linux-aarch64 10.4.0 hf691355_16 conda-forge
libstdcxx-ng 12.1.0 hd01590b_16 conda-forge
libuv 1.44.2 h4e544f5_0 conda-forge
libxml2 2.9.14 h370961a_4 conda-forge
libzlib 1.2.12 h4e544f5_3 conda-forge
make 4.3 h309ac5b_1 conda-forge
metaio 8.5.1 hd8af866_1001 conda-forge
ncurses 6.3 headf329_1 conda-forge
openssl 3.0.5 h4e544f5_2 conda-forge
pkg-config 0.29.2 hb9de7d4_1008 conda-forge
rhash 1.4.3 h4e544f5_0 conda-forge
sysroot_linux-aarch64 2.17 h43d7e78_13 conda-forge
xz 5.2.6 h9cdd2b7_0 conda-forge
zlib 1.2.12 h4e544f5_3 conda-forge
zstd 1.5.2 hc1e27d5_4 conda-forge
I'd appreciate any solutions or insights you might have into this issue!