How to compile LAMMPS with polymlp on macOS (arm) with conda-forge compilers

conda create -n lammps
conda activate lammps
conda install compilers tree

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

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

手元のマシンからポートフォワーディングでVMapacheに接続。

ssh -L 8080:192.168.122.xxx:80 mycluster

手元のマシンのブラウザでhttp://localhost:8080/ganglia/にアクセスすると見れる。

Updating the kernel modules for the Symantec Linux Agent

https://techdocs.broadcom.com/us/en/symantec-security-software/endpoint-security-and-management/endpoint-security/sescloud/Installing-the-Symantec-Agent-and-enrolling-devices/Updating-kernel-modules-for-the-Symantec-Endpoint-Protection-Linux-client.html