[Linux]指定程序运行的cpu id

在HPC上跑计算时,有时需要指定程序运行的CPU id以便获得更好的性能,下列linux命令可以达到这个目的:

taskset -c 0-5 <command> [arguments for command]

Reference:https://unix.stackexchange.com/a/635992

发表在 积少成多 | [Linux]指定程序运行的cpu id已关闭评论

macOS Quantum espresso编译hdf5支持

使用macports直接编译QE,会找不到macports的hdf5库,尝试各种flag设置无果后,改用手工编译HDF5解决

编译安装hdf5

./configure --prefix=$HOME/opt/hdf5 --enable-fortran --enable-parallel  --enable-hl 
make && make install

注意configure时需要添加fortran支持等flag

编译安装QE

configure

F90=gfortran CC=gcc \
BLAS_LIBS="-L/opt/local/lib -lopenblas" \
LAPACK_LIBS="-L/opt/local/lib -lopenblas" \
./configure --enable-openmp --disable-parallel --enable-debug \
            --with-hdf5=$HOME/opt/hdf5

删除不支持的编译flag

生成的makefile会包含一个不支持的flag,-lrt,需要从make.inc中删除

make and test

make pw # only pw.x and related modules
cd test-suite
make run-tests-pw
发表在 笔记 | 留下评论