Running LAMMPS on Windows

hi
After the installation of the MPICH software, it needs to be integrated into the system. For this you need to start a Command Prompt in Administrator Mode (right click on the icon and select it). Change into the MPICH2 installation directory, then into the subdirectory bin and execute smpd.exe -install.
I ran these commands but I got this error: can you help me to solve it?

C:\Program Files\Microsoft MPI\Bin>smpd.exe -install
Unknown option: -install

C:\Program Files\Microsoft MPI\Bin>

can you help me to solve it?

You installed the wrong MPI library package. You need to download and install exactly the matching package linked from the website where you downloaded the LAMMPS installer package.
The precompiled LAMMPS windows executables will not work with the MS-MPI package, which is not compatible with the compilers used to build the installer packages.

If you want to use that MPI package, you also need to install the corresponding SDK and you need to compile LAMMPS from source on Windows yourself using the Microsoft Compilers included in the Visual Studio package (the community edition of Visual Studio is available at no cost).

May i type something like this:

lmp -in in.lj

to parallel run instead?

This will not run in parallel, regardless of whether you have (the correct version of) MPI installed or not. It will not run at all, if you installed the MPI version of the LAMMPS package and not the correct MPI library package.

hi
For the MPI executable, after installing the mpich2-1.4.1p1-win-x86-64.msi and following the corresponding steps to run in parallel using this command " mpiexec -np 5 -locally lmp_mpi -in input1.txt"
i got this error:

Unable to open the HKEY_LOCAL_MACHINE\SOFTWARE\MPICH\SMPD\process\10688 registry key, error 5, Access is denied.

Unable to open the HKEY_LOCAL_MACHINE\SOFTWARE\MPICH\SMPD\process\7228 registry key, error 5, Access is denied.

Unable to open the HKEY_LOCAL_MACHINE\SOFTWARE\MPICH\SMPD\process\7096 registry key, error 5, Access is denied.

Unable to open the HKEY_LOCAL_MACHINE\SOFTWARE\MPICH\SMPD\process\9964 registry key, error 5, Access is denied.

Unable to open the HKEY_LOCAL_MACHINE\SOFTWARE\MPICH\SMPD\process\12804 registry key, error 5, Access is denied.
Setting up cg style minimization …
Unit style : metal
Current step : 0
Error posting readv, An existing connection was forcibly closed by the remote host.(10054)
unable to read the cmd header on the pmi context, Error = -1
.
Error posting readv, An existing connection was forcibly closed by the remote host.(10054)
WARNING: Ewald/disp Newton solver failed, using old method to estimate g_ewald (src/KSPACE/ewald_dipole_spin.cpp:161)
unable to read the cmd header on the pmi context, Error = -1
.
Error posting readv, An existing connection was forcibly closed by the remote host.(10054)
WARNING: Ewald/disp Newton solver failed, using old method to estimate g_ewald (src/KSPACE/ewald_dipole_spin.cpp:161)
unable to read the cmd header on the pmi context, Error = -1
.
Error posting readv, An existing connection was forcibly closed by the remote host.(10054)
WARNING: Ewald/disp Newton solver failed, using old method to estimate g_ewald (src/KSPACE/ewald_dipole_spin.cpp:161)

job aborted:
rank: node: exit code[: error message]
0: DESKTOP-IFJHG69: 123
1: DESKTOP-IFJHG69: -1073741819: process 1 exited without calling finalize
2: DESKTOP-IFJHG69: 123
3: DESKTOP-IFJHG69: 123
4: DESKTOP-IFJHG69: 123

could you help me please?
thanks

The correct command line is:

mpiexec -localonly 5 lmp_mpi -in input1.txt

I have never seen the errors you are reporting, so I have no knowledge about how to resolve them. My speculation is that you may have done the extra installation steps to register the MPI service not from a command window with administrator privilege, but that is pure speculation.

Another possible explanation is that you did not reboot since registering.

I have 3 versions of Lammps on my laptop:
8Apr2021-mpi
15Sep2022-mpi
23Oct2017
Is this not a problem?

There should be only one. Each of those will assume they are the only installed LAMMPS version.

Correction: with the more recent LAMMPS versions, the executable is not called lmp_mpi but just lmp.

The correct command line thus would be:

mpiexec -localonly 5 lmp -in input1.txt

Hello
Can you please tell me what the numbers in the following command are set for?
mpiexec -np 2 lmp_mpi -in in.lj -pk omp 2 -sf omp

I ran my input with the command “mpiexec -np 4 lammps-shell -in input.txt -pk omp 8 -sf omp”.
Then the performance is: 85.7% CPU use with 1 MPI task x 8 OpenMP threads.
Why 1 MPI task? I set it on 4

what is difference between “mpiexec -np 4 lammps-shell -in input.txt -pk omp 8 -sf omp”
and “mpiexec -np 4 lammps-shell -in input.txt” commands where both are using 8 OpenMP thread(s) per MPI task.

Please look it up in the LAMMPS manual. That is what a documentation is for.

Because the lammps-shell program is meant for interactive use, not with MPI. That is why it resets the number of threads used by default, too. This is all documented behavior. You are needlessly making your life miserable by ignoring it.

Thank you very much for your help that fixed my problem.