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
################################################################################################################################################################################################ | |
# Function compiler -O0 -O3 -O3 -Ofast -O3 -funroll-loops -O3 -Ofast -funroll-loops -O3 -Ofast -funroll-all-loops | |
################################################################################################################################################################################################ | |
countthem gcc 1.000x 1.000x 1.000x 1.000x 1.000x 1.000x | |
countthem_ternary gcc 1.669x 3.614x 4.397x 5.271x 6.009x 6.399x | |
countthem_simd gcc 3.414x |
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
## Timings with halotools v0.4 and Corrfunc v2.0.0. Updated on Sep 12 (random data, Corrfunc compiled with gcc6.0) | |
## Note this test is capped at 1 million because the first three codes take too long and halotools randomly subsamples | |
## particles above 1 million. The algorithm in halotools is an *exact* copy of `Corrfunc` - so the timing comparison simply | |
## tests the capability of the cython compiler. | |
## Timings generated on Oct 17, 2016, with mostly ready version of Corrfunc v2.0. Non-periodic calculations with random points. | |
## Npts kdcount cKDTree KDTree halotools Corrfunc(AVX) Corrfunc(SSE42) Corrfunc(fallback) | |
10000 0.039 0.057 0.087 0.026 0.240 0.053 0.052 | |
50000 0.381 0.399 0.936 0.121 0.226 0.224 0.214 |
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
# encoding=utf-8 | |
# para_async.py | |
import asyncio | |
import itertools | |
import aiohttp | |
@asyncio.coroutine | |
async def download(url, parts): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import (division, print_function, absolute_import, | |
unicode_literals) | |
import numpy as np | |
from Corrfunc._countpairs import countpairs_wp as wp | |
from Corrfunc._countpairs import countpairs_xi as xi | |
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
from __future__ import print_function | |
import Corrfunc | |
from Corrfunc._countpairs_mocks import countpairs_rp_pi_mocks as DDrppi_mocks | |
import numpy as np | |
def main(): | |
version = Corrfunc.__version__ | |
print("Using Corrfunc from file: {0} with version = {1}" | |
.format(Corrfunc.__file__, version)) |
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
from __future__ import print_function | |
import numpy as np | |
from Corrfunc.mocks import DDrppi_mocks | |
from Corrfunc.io import read_catalog | |
from Corrfunc.utils import convert_rp_pi_counts_to_wp | |
from Corrfunc.utils import convert_3d_counts_to_cf | |
import Corrfunc | |
from os.path import dirname, abspath, join as pjoin | |
from IPython.core.debugger import Tracer |
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
from __future__ import print_function | |
import numpy as np | |
from fast_histogram import histogram1d, histogram1d_wrapper | |
np.random.seed(42) | |
npoints=np.array([1, 10, 100])*1000000 | |
for n in npoints: | |
x = np.random.random(n) | |
_ = histogram1d_wrapper(x, range=[-1, 2], bins=30) |
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
def check_quantity_has_only_one_element(list_of_quant): | |
values = [] | |
for val, name in list_of_quant: | |
try: | |
if len(val) > 1: | |
msg = "{0} must be a scalar quantity or an 1-element array.\n"\ | |
"Found = {1} instead".format(name, val) | |
v = val[0] | |
except TypeError: | |
# scalar quantity has no len |
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
const int64_t bits_set_in_avx512_mask_float[] = { B16(0) }; | |
const uint16_t masks_per_misalignment_value_float[] = {0b1111111111111111, | |
0b0000000000000001, | |
0b0000000000000011, | |
0b0000000000000111, | |
0b0000000000001111, | |
0b0000000000011111, | |
0b0000000000111111, | |
0b0000000001111111, | |
0b0000000011111111, |
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
import seaborn as sns | |
import pandas as pd | |
import warnings | |
import matplotlib.pyplot as plt; | |
import matplotlib; | |
matplotlib.style.use('ggplot'); | |
txtfile='RSE-EOI-survey-list-anonymized-v2.csv' | |
rse_df = pd.read_csv(txtfile, |
OlderNewer