Skip to content

Instantly share code, notes, and snippets.

View keichi's full-sized avatar

Keichi Takahashi keichi

View GitHub Profile
[keichi@cc20dev0 keichi]$ ./oci_fio_benchmark.sh
seqread-4k: (g=0): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=io_uring, iodepth=64
fio-3.26-19-ge7e53
Starting 1 process
Jobs: 1 (f=1): [R(1)][100.0%][r=249MiB/s][r=63.6k IOPS][eta 00m:00s]
seqread-4k: (groupid=0, jobs=1): err= 0: pid=449760: Wed Mar 31 13:23:14 2021
read: IOPS=63.6k, BW=248MiB/s (260MB/s)(4096MiB/16500msec)
slat (usec): min=2, max=105, avg= 5.66, stdev= 1.02
clat (usec): min=676, max=19705, avg=1000.62, stdev=188.46
lat (usec): min=681, max=19713, avg=1006.43, stdev=188.48
[keichi@cc20dev0 keichi]$ ./oci_fio_benchmark.sh
seqread-4k: (g=0): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
fio-3.26-19-ge7e53
Starting 1 process
Jobs: 1 (f=1): [R(1)][100.0%][r=25.1MiB/s][r=6432 IOPS][eta 00m:00s]
seqread-4k: (groupid=0, jobs=1): err= 0: pid=247802: Tue Mar 30 17:39:00 2021
read: IOPS=6434, BW=25.1MiB/s (26.4MB/s)(1508MiB/60001msec)
clat (usec): min=137, max=14343, avg=154.45, stdev=27.89
lat (usec): min=138, max=14344, avg=154.63, stdev=27.89
clat percentiles (usec):
#!/usr/bin/env python3
import sys
# pip3 install requests beautifulsoup4
import requests
from bs4 import BeautifulSoup
MANDARA_USERNAME = "MANDARA username"
MANDARA_PASSWORD = "MANDARA password",
@keichi
keichi / matmul.cpp
Last active December 17, 2020 06:46
#include <chrono>
#include <iostream>
#include <random>
const int N = 1000;
const int TRIALS = 10;
// NxN matrices A, B and C
double A[N][N], B[N][N], C[N][N];
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
import tensorflow as tf
mnist = tf.keras.datasets.mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(input_shape=(28, 28)),
tf.keras.layers.Dense(128, activation="relu"),
@keichi
keichi / matvec.cpp
Last active December 10, 2020 04:03
#include <chrono>
#include <iostream>
#include <random>
const int N = 10000;
const int TRIALS = 10;
// Allocate 2D array A and 1D arrays x and y
double A[N][N], x[N], y[N];
@keichi
keichi / gist:f25f4aa07603cf787ad76641bfb851d4
Created November 24, 2020 01:13
Batch convert SVG files to PNG files
find . -name "*.svg" -exec inkscape -w 256 -h 256 {} --export-filename {}.png \;
DEBUG - [hwloc_init_cpuInfo:357] HWLOC CpuInfo Family 23 Model 49 Stepping 0 Vendor 0x0 Part 0x0 isIntel 0 numHWThreads 128 activeHWThreads 128
DEBUG - [hwloc_init_nodeTopology:520] HWLOC Thread Pool PU 0 Thread 0 Core 0 Socket 0 inCpuSet 1
DEBUG - [hwloc_init_nodeTopology:520] HWLOC Thread Pool PU 1 Thread 0 Core 1 Socket 0 inCpuSet 1
DEBUG - [hwloc_init_nodeTopology:520] HWLOC Thread Pool PU 2 Thread 0 Core 2 Socket 0 inCpuSet 1
DEBUG - [hwloc_init_nodeTopology:520] HWLOC Thread Pool PU 3 Thread 0 Core 3 Socket 0 inCpuSet 1
DEBUG - [hwloc_init_nodeTopology:520] HWLOC Thread Pool PU 4 Thread 0 Core 4 Socket 0 inCpuSet 1
DEBUG - [hwloc_init_nodeTopology:520] HWLOC Thread Pool PU 5 Thread 0 Core 5 Socket 0 inCpuSet 1
DEBUG - [hwloc_init_nodeTopology:520] HWLOC Thread Pool PU 6 Thread 0 Core 6 Socket 0 inCpuSet 1
DEBUG - [hwloc_init_nodeTopology:520] HWLOC Thread Pool PU 7 Thread 0 Core 7 Socket 0 inCpuSet 1
DEBUG - [hwloc_init_nodeTopology:520] HWLOC Thread Pool PU 8 Thread 0 Core 8 Socket 0 inCpuSet 1
cpdef fibonacci(int n):
if n < 2:
return n
cdef int a = 0
cdef int b = 1
for i in range(2, n + 1):
a, b = b, a + b