分类 technique 下的文章

CPU 结构:
threads per core : 超线程
cores per socket : 每个 socket 核数
sockets

MPI

每个 mpi 进程有 affinity mask,长度为 CPU cores
--bind-to core : affinity mask 中只有对应 core 一位被 set
--bind-to socket : affinity mask 中 socket 对应 所有 core 被 set
--bind-to none

--map-by node
--map-by socket
--map-by node:PE=8 : PE为每个进程分配的物理核数

多机

hostfile :

i1 slots=2 max-slots=8
i2 slots=2 max-slots=8
`which mpirun`  -np 2 --host i1:1,i2:1 hostname
`which mpirun` -np 4 --hostfile ./hostfile hostname

使用脚本时开头要加 #!/bin/bash

OMP

OMP_DISPLAY_ENV=true 输出 OMP 绑定情况
OMP_PLACES=threads, OMP_PLACES=cores,
OMP_PLACES=sockets

hyperthread cpu 分布:/sys/devices/system/cpu/cpu0/topology$ cat thread_siblings_list

#include <omp.h>
#include <sched.h>

    #pragma omp parallel 
    {
        int id = omp_get_thread_num();
        int max_threads = omp_get_num_threads();
        int cpuid = sched_getcpu();
        printf("hello from cpu: %d thread: %d out of %d threads @ rank = %d\n", cpuid, id, max_threads, rank);
    }

BLAS : basic linear algebra subprograms (low level)
LAPACK : linear algebra package (high level,在 BLAS 之上)
ScaLAPACK : scalable LAPACK,支持 MPI 的 LAPACK

Intel MKL : 包含 BLAS, LAPACK, ScaLAPACK

ELPA : eigenvalue solvers for petaflop applications

cuBLAS

使用 cublasCreate 创建 cuBLAS library context 的 handle,
一个 context 关联一个 device
cuBLAS library context 绑定 CUDA context

用来记一些 tmux 之类工具的奇妙用法

tmux

ctrl+b s : 切换panel
Ctrl+b :set synchronize-panes : 多窗口同步输入

开一个坑整理linux的奇妙命令

kill -s 9 $pid  # 强行停止
ps -aux #显示所有进程
watch -n 0.1 [exec] #间隔0.1s运行exec显示输出
chmod -R #对所有子文件夹chmod
nohup [command] & #将指令放在后台运行
~/.bash_history #bash历史,向下为更新
file [file] #查看文件信息
ln -s $SOURCE_DIR $TAR_DIR #创建软链接
pstree [username] #查看进程树
sudo netstat -tulpn #查看开放端口(t:tcp,u:udp,l:listening socket,p:pid and name, n:numerical address)
ls -d .v* #所有符合表达式的文件
ls -d .v*/ #所有符合表达式的目录
ls -Sl #按文件大小排序
[exec] >> [file] #追加输出
[exec] > /dev/null #抛弃输出
find [path] -name "*.c" #按文件名查找目录
find [path] -name "*.c" -exec grep  "str" {} + #查找目录下指定文件名的文件中包含的字符串str
env #查看目前环境变量
sudo systemctl start [service] #启动服务
readlink [file] #读取符号链接file的指向,-f 递归查找直到实际文件
dmesg #查看ring message 信息,包含开机信息及异常信息
nl [file] #将文件每行前添加行号,并输出
apropos [func] #查找man page
lsof [file] #查看打开文件的进程
lsof -t [file] | xargs kill -9 #kill所有打开文件file的进程
wall "[message]" #向所有用户终端发送信息 message
wget -e "https_proxy=127.0.0.1:10987" [url] #wget使用代理
cloc #统计目录代码行数

- 阅读剩余部分 -