Add additional MDI examples

This commit is contained in:
taylor-a-barnes
2021-04-26 16:41:24 -04:00
parent 4a0b71f66b
commit 2854ea29a5
2 changed files with 23 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#!/bin/bash
# sample launch scripts
# TCP, running LAMMPS on one proc
python driver.py -mdi "-name driver -role DRIVER -method TCP -port 8021" &
@ -8,6 +9,20 @@ python driver.py -mdi "-name driver -role DRIVER -method TCP -port 8021" &
wait
# TCP, running LAMMPS on two procs
python driver.py -mdi "-name driver -role DRIVER -method TCP -port 8021" &
mpiexec -n 2 ../../../src/lmp_mdi -mdi "-name LAMMPS -role ENGINE -method TCP -port 8021 -hostname localhost" -in lammps.in > lammps.out &
wait
# MPI, running LAMMPS on one proc
mpirun -n 1 python driver.py -mdi "-name driver -role DRIVER -method MPI" : -n 1 ../../../src/lmp_mdi -mdi "-name LAMMPS -role ENGINE -method MPI"
mpiexec -n 1 python driver.py -mdi "-name driver -role DRIVER -method MPI" : \
-n 1 ../../../src/lmp_mdi -mdi "-name LAMMPS -role ENGINE -method MPI -out lammps.out" -in lammps.in
# MPI, running LAMMPS on two procs
mpirun -n 1 python driver.py -mdi "-name driver -role DRIVER -method MPI" : \
-n 2 ../../../src/lmp_mdi -mdi "-name LAMMPS -role ENGINE -method MPI -out lammps.out" -in lammps.in

View File

@ -1,6 +1,13 @@
import sys
import mdi
use_mpi4py = False
try:
from mpi4py import MPI
use_mpi4py = True
except:
pass
# Initialize the MDI Library
mdi.MDI_Init(sys.argv[2])