Skip to content

Commit

Permalink
Merge branch 'main' into release/0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
wenhuiuy committed Feb 7, 2024
2 parents 2993e5d + 7d9eebb commit f2e63dd
Show file tree
Hide file tree
Showing 71 changed files with 2,509 additions and 447 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Suggest to add labels
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@v4
# Execute only when no labels have been applied to the pull request
if: toJSON(github.event.pull_request.labels.*.name) == '{}'
with:
Expand Down
4 changes: 2 additions & 2 deletions doc/source/getting-started/SERVER_PRE_README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Run an example on the client side
hostname = "localhost"
if len(sys.argv) > 1:
hostname = sys.argv[1]
solution = DynaSolution(hostname)
solution = launch_dynapre(ip = hostname)
......
#. The function of DynaSolution() can download and start the preprocessing server automatically.
#. The function of launch_dynapre() can download and start the preprocessing server automatically.
2 changes: 1 addition & 1 deletion doc/source/getting-started/SERVER_SOLVER_README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Run an example on the client side
hostname = "localhost"
port = "5000"
dyna=solver.DynaSolver(hostname,port) # connect to the server
dyna=launch_dyna(ip = hostname,port = port) # connect to the server
dyna.push("./output/ball_plate.k") # push an input file
dyna.start_locally(input = "ball_plate.k",nproc=1)
Expand Down
6 changes: 3 additions & 3 deletions doc/source/getting-started/example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ the Python file from ``examples/Explicit/ball_plate.py``.
import os
import sys
from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynamech import (
DynaMech,
Velocity,
Expand All @@ -34,7 +34,7 @@ the Python file from ``examples/Explicit/ball_plate.py``.
hostname = "localhost"
if len(sys.argv) > 1:
hostname = sys.argv[1]
solution = DynaSolution(hostname)
solution = launch_dynapre(ip = hostname)
fns = []
path = examples.ball_plate + os.sep
Expand Down Expand Up @@ -98,7 +98,7 @@ you can get the Python file from ``examples/solver/ball_plate_solver.py``.
hostname = "localhost"
port = "5000"
dyna=solver.DynaSolver(hostname,port) # connect to the container
dyna=launch_dyna(ip = hostname,port = port) # connect to the container
dyna.push("./output/ball_plate.k") # push an input file
dyna.start(4) # start 4 ranks of mppdyna
dyna.run("i=ball_plate.k memory=10m ncycle=20000") # begin execution
Expand Down
2 changes: 1 addition & 1 deletion docker/pre/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Prerequisites
instructions from `this page <https://docs.docker.com/engine/install/>`_.

* Download the latest Linux release artifacts for the ``pre`` Docker container:
`linux-binaries.zip <https://github.com/ansys/pydyna/releases/download/v0.4.3/linux-binaries.zip>`_.
`linux-binaries.zip <https://github.com/ansys/pydyna/releases/download/v0.4.6/linux-binaries.zip>`_.

* Move this ZIP file to the ``docker/pre`` directory.

Expand Down
56 changes: 27 additions & 29 deletions docker/solver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ LABEL "com.ansys.description"="Ansys MPPDYNA with gRPC server"

# install some missing stuff we want/need

RUN yum -y install openssh-clients openssh-server bind-utils sudo python3
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install grpcio
RUN python3 -m pip install grpcio-tools
RUN python3 -m pip install protobuf==4.21.0
RUN yum -y install openssh-clients openssh-server bind-utils sudo python3 unzip &>/dev/null && yum clean all
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install grpcio && \
python3 -m pip install grpcio-tools && \
python3 -m pip install protobuf==4.21.0
#
ENV USER mpirun
ENV HOME /home/mpirun
Expand All @@ -27,16 +27,15 @@ ENV LSTC_LICENSE_SERVER license
ENV SSHDIR ${HOME}/.ssh


RUN groupadd ${USER}
RUN useradd -g ${USER} -d ${HOME} ${USER} && \
RUN groupadd ${USER} && useradd -g ${USER} -d ${HOME} ${USER} && \
echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
#
RUN mkdir -p /ansys_inc/lib
RUN mkdir -p /rundir
RUN mkdir /var/run/sshd
RUN mkdir -p ${SSHDIR}
RUN chown -R ${USER}:${USER} /rundir
RUN chmod -R 755 /rundir
RUN mkdir -p /ansys_inc/lib && \
mkdir -p /rundir && \
mkdir /var/run/sshd && \
mkdir -p ${SSHDIR} && \
chown -R ${USER}:${USER} /rundir && \
chmod -R 755 /rundir
WORKDIR /rundir

# set up the runtime environment variables for
Expand Down Expand Up @@ -73,29 +72,28 @@ RUN echo "export PATH=/opt/openmpi/bin:\${PATH}" >> ${HOME}/.bashrc
#RUN ssh-keygen -A


RUN ssh-keygen -q -b 2048 -f ${SSHDIR}/id_rsa -N ""
RUN chmod 700 ${SSHDIR} && chmod -R 600 ${SSHDIR}/id_rsa
RUN echo "Host *" > ${SSHDIR}/config
RUN echo " StrictHostKeyChecking no" >> ${SSHDIR}/config
RUN cp ${SSHDIR}/id_rsa.pub ${SSHDIR}/authorized_keys
RUN ssh-keygen -A
RUN ssh-keygen -q -b 2048 -f ${SSHDIR}/id_rsa -N "" && \
chmod 700 ${SSHDIR} && chmod -R 600 ${SSHDIR}/id_rsa && \
echo "Host *" > ${SSHDIR}/config && \
echo " StrictHostKeyChecking no" >> ${SSHDIR}/config && \
cp ${SSHDIR}/id_rsa.pub ${SSHDIR}/authorized_keys && \
ssh-keygen -A

RUN chmod -R 600 ${SSHDIR}* && \
chown -R ${USER}:${USER} ${SSHDIR}

RUN chown -R ${USER}:${USER} ${HOME}
chown -R ${USER}:${USER} ${SSHDIR} && \
chown -R ${USER}:${USER} ${HOME}

# Copy the openmpi libraries

RUN yum install -y unzip
COPY mppdyna_docker_centos7.zip .
RUN unzip -qu mppdyna_docker_centos7.zip && rm mppdyna_docker_centos7.zip
RUN mkdir -p /opt/openmpi
RUN cp -r mpi/* /opt/openmpi
RUN chmod -R 777 /opt/openmpi
RUN unzip -qu mppdyna_docker_centos7.zip && \
rm mppdyna_docker_centos7.zip && \
mkdir -p /opt/openmpi && \
cp -r mpi/* /opt/openmpi && \
chmod -R 777 /opt/openmpi && \

# The executable will go in /ansys_inc, and the
# ifort runtime libraries in /ansys_inc/lib

RUN cp -rpu docker_dir/* /ansys_inc/
RUN chmod -R 777 /ansys_inc/
cp -rpu docker_dir/* /ansys_inc/ && \
chmod -R 777 /ansys_inc/
2 changes: 1 addition & 1 deletion docker/solver/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Prerequisites
instructions from `this page <https://docs.docker.com/engine/install/>`_.

* Download the latest Linux release artifacts for the ``solver`` Docker container:
`mppdyna_docker_centos7.zip <https://github.com/ansys/pydyna/releases/download/v0.4.3/mppdyna_docker_centos7.zip>`_.
`mppdyna_docker_centos7.zip <https://github.com/ansys/pydyna/releases/download/v0.4.6/mppdyna_docker_centos7.zip>`_.

* Move this ZIP file to the ``docker/solver`` directory.

Expand Down
4 changes: 2 additions & 2 deletions examples/Airbag/airbag_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import sys


from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynamech import (
DynaMech,
Airbag,
Expand Down Expand Up @@ -58,7 +58,7 @@
# The ``DynaSolution`` class is like a workflow orchestrator.
# It inherits methods from other classes and helps create a complete workflow.
#
airbag_solution = DynaSolution(hostname)
airbag_solution = launch_dynapre(ip = hostname)
fns = []
# path = sys.path[0] + os.sep + "input" + os.sep + "airbag_deploy" + os.sep
path = examples.airbag_deploy + os.sep
Expand Down
4 changes: 2 additions & 2 deletions examples/EM/em_resistive_heating.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import os
import sys

from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynaem import (
DynaEM,
NodeSet,
Expand All @@ -31,7 +31,7 @@
if len(sys.argv) > 1:
hostname = sys.argv[1]

solution = DynaSolution(hostname)
solution = launch_dynapre(ip = hostname)
fns = []
path = examples.em_resistive_heating + os.sep
fns.append(path + "em_resistive_heating.k")
Expand Down
4 changes: 2 additions & 2 deletions examples/EM/em_resistive_heating_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
import sys

from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynaem import (
DynaEM,
PartSet,
Expand All @@ -32,7 +32,7 @@
if len(sys.argv) > 1:
hostname = sys.argv[1]

solution = DynaSolution(hostname)
solution = launch_dynapre(ip = hostname)
fns = []
path = examples.em_resistive_heating_2d + os.sep
fns.append(path + "em_resistive_heating_2d.k")
Expand Down
4 changes: 2 additions & 2 deletions examples/EM/em_resistive_heating_2d_isopots.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import os
import sys

from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynaem import (
DynaEM,
PartSet,
Expand All @@ -38,7 +38,7 @@
if len(sys.argv) > 1:
hostname = sys.argv[1]

solution = DynaSolution(hostname)
solution = launch_dynapre(ip = hostname)
fns = []
path = examples.em_resistive_heating_2d_isopots + os.sep
fns.append(path + "em_resistive_heating_2d_isopots.k")
Expand Down
4 changes: 2 additions & 2 deletions examples/EM/em_resistive_heating_2d_multi_isopots.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
import sys

from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynaem import (
DynaEM,
PartSet,
Expand All @@ -36,7 +36,7 @@
if len(sys.argv) > 1:
hostname = sys.argv[1]

solution = DynaSolution(hostname)
solution = launch_dynapre(ip = hostname)
fns = []
path = examples.em_resistive_heating_2d_multi_isopots + os.sep
fns.append(path + "em_resistive_heating_2d_multi_isopots.k")
Expand Down
4 changes: 2 additions & 2 deletions examples/EM/em_rlc_define_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import os
import sys

from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynaem import (
DynaEM,
NodeSet,
Expand All @@ -31,7 +31,7 @@
if len(sys.argv) > 1:
hostname = sys.argv[1]

solution = DynaSolution(hostname)
solution = launch_dynapre(ip = hostname)
fns = []
path = examples.em_rlc_define_func + os.sep
fns.append(path + "em_rlc_define_func.k")
Expand Down
4 changes: 2 additions & 2 deletions examples/EM/em_rlc_isopotential.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import os
import sys

from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynaem import (
DynaEM,
NodeSet,
Expand All @@ -32,7 +32,7 @@
if len(sys.argv) > 1:
hostname = sys.argv[1]

solution = DynaSolution(hostname)
solution = launch_dynapre(ip = hostname)
fns = []
path = examples.em_rlc_isopotential + os.sep
fns.append(path + "em_rlc_isopotential.k")
Expand Down
4 changes: 2 additions & 2 deletions examples/EM/railgun/em_railgun.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
import sys

from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynaem import (
DynaEM,
Circuit,
Expand All @@ -32,7 +32,7 @@
if len(sys.argv) > 1:
hostname = sys.argv[1]

solution = DynaSolution(hostname)
solution = launch_dynapre(ip = hostname)
fns = []
path = examples.em_railgun + os.sep
fns.append(path + "em_railgun.k")
Expand Down
4 changes: 2 additions & 2 deletions examples/Explicit/ball_plate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import sys


from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynamech import (
DynaMech,
Velocity,
Expand Down Expand Up @@ -54,7 +54,7 @@
hostname = "localhost"
if len(sys.argv) > 1:
hostname = sys.argv[1]
solution = DynaSolution(hostname)
solution = launch_dynapre(ip = hostname)

###############################################################################
# Start the solution workflow
Expand Down
4 changes: 2 additions & 2 deletions examples/Explicit/belted_dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import sys


from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynamech import (
DynaMech,
Velocity,
Expand Down Expand Up @@ -61,7 +61,7 @@
hostname = "localhost"
if len(sys.argv) > 1:
hostname = sys.argv[1]
dummy_solution = DynaSolution(hostname)
dummy_solution = launch_dynapre(ip = hostname)

###############################################################################
# Start the solution workflow
Expand Down
4 changes: 2 additions & 2 deletions examples/ICFD/icfd_cylinderflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import sys


from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynaicfd import (
DynaICFD,
ICFDAnalysis,
Expand All @@ -28,7 +28,7 @@
if len(sys.argv) > 1:
hostname = sys.argv[1]

icfd_solution = DynaSolution(hostname)
icfd_solution = launch_dynapre(ip = hostname)
# Import the initial mesh data(nodes and elements)
fns = []
path = examples.cylinder_flow + os.sep
Expand Down
4 changes: 2 additions & 2 deletions examples/ICFD/icfd_dam_break.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import sys


from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynaicfd import (
DynaICFD,
MatICFD,
Expand All @@ -31,7 +31,7 @@
if len(sys.argv) > 1:
hostname = sys.argv[1]

solution = DynaSolution(hostname)
solution = launch_dynapre(ip = hostname)
# Import the initial mesh data(nodes and elements)
fns = []
path = examples.dam_break + os.sep
Expand Down
4 changes: 2 additions & 2 deletions examples/ICFD/icfd_dem_coupling.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import sys


from ansys.dyna.core.pre.dynasolution import DynaSolution
from ansys.dyna.core.pre import launch_dynapre
from ansys.dyna.core.pre.dynaicfd import (
DynaICFD,
MatICFD,
Expand All @@ -37,7 +37,7 @@
if len(sys.argv) > 1:
hostname = sys.argv[1]

solution = DynaSolution(hostname)
solution = launch_dynapre(ip = hostname)
# Import the initial mesh data(nodes and elements)
fns = []
path = examples.dem_coupling + os.sep
Expand Down
Loading

0 comments on commit f2e63dd

Please sign in to comment.