Running LAMMPS via Conda Forge

Hello everybody
I followed the steps below to install LAMMPS using Conda Forge on a Linux system, and also installed M3GNET and matgl for additional functionality. However, when running LAMMPS, even with the lmp -in inputfile command, it uses 100% of the CPU cores. I want to limit the CPU usage to just one core.

Installation Steps:

  1. Download the Miniconda Installer
    Download the appropriate Miniconda installer for Linux:
    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

Make the Installer Executable
After downloading, change the file permissions to make the installer executable:
chmod +x Miniconda3-latest-Linux-x86_64.sh

Run the Installer
Execute the installer:
./Miniconda3-latest-Linux-x86_64.sh

Create a New Conda Environment for LAMMPS
Create a new Conda environment called lammps-conda with Python 3.11:
conda create -n lammps-conda python=3.11

Activate the Conda Environment
Activate the newly created Conda environment:
conda activate lammps-conda

Install LAMMPS via Conda-Forge
Install LAMMPS from the Conda-Forge channel:
conda install -c conda-forge lammps

Install M3GNET and Matgl
Install the M3GNET and Matgl Python packages:
pip install M3GNET
pip install matgl

When I run LAMMPS with the command: lmp -in inputfile, It uses 100% of all available CPU cores, even though I want to limit it to just one core. I would be appreciated it if you guide me how to solve the problem
Best

The LAMMPS Conda Forge package is not maintained by the LAMMPS developers. You have to contact the people doing the Conda packaging for assistance.

My personal experience with Conda is bad. In my experience it creates more problems than it solves, and many times people that asked for help have resolved issues by installing LAMMPS in a regular fashion from the source as documented in the LAMMPS manual and not using Conda.

This seems like it could result from OpenMP parallelization with default settings. You can look up “OpenMP environment variables” (on the Internet) and try to limit the parallelization to fewer cores.

1 Like

This should not happen, because LAMMPS will reset the number of threads to 1 unless OMP_NUM_THREADS is set.

The important question here is: how is this 100% of all CPU cores determined?

If taken from the LAMMPS output, then 100% refers to a single CPU. If multiple CPUs would be used via threads, the value should be larger than 100%.