■
Transferring data in AiiDA
■
How to compile LAMMPS with polymlp on macOS (arm) with conda-forge compilers
conda create -n lammps conda activate lammps conda install compilers tree
- Download latest LAMMPS source code https://github.com/lammps/lammps.
- Download polymlp source code (lammps-polymlp-package) https://github.com/sekocha/lammps-polymlp-package.
Supposed directory structure:
% tree lammps lammps-polymlp-package -d -L 1 lammps ├── bench ├── cmake ├── doc ├── examples ├── fortran ├── lib ├── potentials ├── python ├── src ├── tools └── unittest lammps-polymlp-package ├── lib └── src
Go to LAMMPS source code directory (lammps
). In the following of this post, shell commands are performed with respect to this directory.
Copy source code of polymlp in LAMMPS source code directory.
% cp -r ../lammps-polymlp-package/lib/polymlp lib/ % cp -r ../lammps-polymlp-package/src/POLYMLP src/
Add polymlp
to the list of PACKAGE
in src/Makefile
cat src/Makefile ... PACKAGE = \ adios \ amoeba \ ... poems \ polymlp \ ptm \ ... ml-iap \ phonon ...
Modify lib/polymlp/Makefile.lammps
% cat lib/polymlp/Makefile.lammps polymlp_INC = -fopenmp -DLAMMPS_EXCEPTIONS polymlp_PATH = -L../../lib/polymlp polymlp_SYSINC = -I${CONDA_PREFIX}/include polymlp_SYSLIB = -L${CONDA_PREFIX}/lib -lomp
Copy a specific Makefile for setting conda environment.
% cp src/MAKE/Makefile.serial src/MAKE/Makefile.conda
Modify src/MAKE/Makefile.conda
% cat src/MAKE/Makefile.conda ... CC = ${CONDA_PREFIX}/bin/clang++ CCFLAGS = -g -O3 -std=c++11 SHFLAGS = -fPIC DEPFLAGS = -M LINK = ${CONDA_PREFIX}/bin/clang++ LINKFLAGS = -g -O3 -std=c++11 LIB = SIZE = size ARCHIVE = ${CONDA_PREFIX}/bin/ar ARFLAGS = -rc SHLIBFLAGS = -shared -rdynamic ...
Make LAMMPS with polymlp
% ulimit -s unlimited % cd src % make yes-polymlp % make ps % make mpi-stubs % make conda
Executable lmp_conda
is created in src
directory. Note that the compilation of polymlp_gtinv_data.cpp
requires large stacksize, so before compilation, ulimit -s unlimite
may be executed.
At run time,
export DYLD_LIBRARY_PATH=$CONDA_PREFIX/lib
is required. It is convenient if this environment variable is written in $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
.
Precomputed polymlp data for elements are found at http://cms.mtl.kyoto-u.ac.jp/seko/mlp-repository/index.html.
■
LAMMPS crystal structure relaxation
Quite many options exist in LAMMPS, and I googled to find how to optimize crystal structure.
LAMMPSで格子変形を許して構造緩和をする - lan496の日記
It seems no fix
command results in relaxation of internal atomic positions only...
Pymatgen can handle LAMMPS input/output files.
pymatgen.io.lammps.data module — pymatgen 2023.5.10 documentation
■
Upgrade conda-forge postgresql from 14 to 15
Assume having old postgresql (v14) db directory exists at
/home/username/aiida-proj/psql
Upgrade postgresql (14 -> 15) of the current conda env (myproj)
Create a new conda env (psql) with old postgresql (14).
initdb -D /home/username/myproj/psql15 cp /home/username/myproj/psql/pg_hba.conf /home/username/myproj/psql15/ cp /home/username/myproj/psql/postgresql.conf /home/username/myproj/psql15/ pg_upgrade --old-datadir=/home/username/myproj/psql --new-datadir=/home/username/myproj/psql15 --old-bindir=/home/username/.miniforge/envs/psql/bin --new-bindir=/home/username/.miniforge/envs/myproj/bin --old-options '-c config_file=/home/username/myproj/psql/postgresql.conf' --new-options '-c config_file=/home/username/myproj/psql15/postgresql.conf' --check
If all OK, remove --check
and rerun the above again.
mv /home/username/myproj/psql /home/username/myproj/psql14 ln -s /home/username/myproj/psql15 /home/username/myproj/psql
■
Ganglia web frontend
Ubuntu 22.04ではPHPのバージョンアップが理由でGanglia web frontendが動かない。MonitorとGmetadは動く。Ganglia web frontendのためにUbuntu 20.04のVM(KVM)を用意して設定を行った。
# cat sites-enabled/ganglia.conf Alias /ganglia /usr/share/ganglia-webfrontend <Directory "/usr/share/ganglia-webfrontend"> AllowOverride All Order allow,deny Allow from all Deny from none </Directory>
/usr/share/ganglia-webfrontend/conf_default.php
の変更。
$conf['default_metric'] = "cpu_report";
バグフィックス(https://github.com/ganglia/ganglia-web/pull/309) /usr/share/ganglia-webfrontend/cluster_view.php
$context_metrics = array();
VMの/etc/ganglia/gmetad.conf
data_source "mycluster" 60 192.168.122.1:8649
クラスタ側ではgmetadとgmondが走っていてrrdが蓄積される。VMからクラスタにアクセスしてVM上でganglia web frontendを使う。
VMの/etc/ganglia/gmetad.conf
data_source "my_cluster" 60 192.168.122.1:8649
VMからクラスタ(ここでは192.168.122.1)にアクセスできるようにする。クラスタ側の設定:
ufw allow from 192.168.122.0/24
手元のマシンからポートフォワーディングでVMのapacheに接続。
ssh -L 8080:192.168.122.xxx:80 mycluster
手元のマシンのブラウザでhttp://localhost:8080/ganglia/にアクセスすると見れる。