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
;; With prefetch and NT stores: | |
0000000000401608 <main+0xac8> add esi,0x4 | |
000000000040160b <main+0xacb> add rcx,0x20 | |
000000000040160f <main+0xacf> cmp esi,0x7a1200 | |
0000000000401615 <main+0xad5> je 00000000004016a9 <main+0xb69> | |
000000000040161b <main+0xadb> mov rax,QWORD PTR [rsp+0x748] | |
0000000000401623 <main+0xae3> movapd xmm0,xmm3 | |
0000000000401627 <main+0xae7> mulpd xmm0,XMMWORD PTR [rax+rcx*1] | |
000000000040162c <main+0xaec> movapd xmm1,XMMWORD PTR [rax+rcx*1+0x10] |
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 python3 | |
s = set() | |
a = range(3) | |
s.update(a) | |
print(list(a)) # [0, 1, 2] | |
b = map(lambda x:10+x,a) | |
print(list(b)) # [10, 11, 12] | |
s.update(b) |
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 | |
def withvars(f): | |
def wrapper(self,*args,**kwargs): | |
tmp = self.vars.copy() | |
tmp.update(kwargs) | |
return f(self,*args,**tmp) | |
return wrapper | |
def withvars_censor(f): | |
def wrapper(self,*args,**kwargs): |
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
# Oregonator: stiff 3-variable oscillatory ODE system from chemical reactions, | |
# problem OREGO in Hairer&Wanner | |
import sys, petsc4py | |
petsc4py.init(sys.argv) | |
from petsc4py import PETSc | |
class Orego(object): | |
n = 3 |
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
## Julia implementation of solving Poisson on a square grid using Chebyshev collocation | |
# julia> load("logg.jl") | |
# julia> loggProfile(10000) | |
# error: 3.310154100518143e-7 | |
# Average time (us): 132.39421844482422 | |
function logg(m) | |
(D,xb) = cheb(m+1) # Chebyshev differentiation matrix and nodes | |
D = 2*D; xb = 0.5 + 0.5*xb # Remap to interval [0,1] | |
D2 = -(D*D)[2:end-1,2:end-1] # Negative 1D Laplacian, with Dirichlet BCs |
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 | |
from subprocess import Popen, PIPE | |
import sys, threading | |
# Each stage that we implement in Python. If processing binary data, we would | |
# read incrementally using input.read(4096), for example. The output file must | |
# be closed to flush the pipeline and allow it to clean up properly. | |
def writer(output): | |
for line in open('/usr/share/dict/words'): |
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
CC = clang | |
CFLAGS = -Wall -Wextra -pedantic -std=c99 -O1 -g # -O1 or higher needed | |
a.out : a.o xrank.o | |
$(CC) -o $@ $^ |
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
cmake_minimum_required(VERSION 2.8) | |
project(foo) | |
add_library(foo foo.cc) | |
target_link_libraries(foo ${DEP_LIBS}) | |
add_library(bar bar.cc) | |
target_link_libraries(bar foo) |
Archive:
OlderNewer