Skip to content

feat: using dpf instead of reader in "results" module #1300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 184 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
987447c
Initial commit
germa89 Jul 27, 2022
86a9a6b
Implementing RST properties.
germa89 Aug 5, 2022
545224f
Adding many ``nodal_***`` methods.
germa89 Aug 6, 2022
4613453
Replacing reader class with new one to check.
germa89 Aug 6, 2022
7304cdd
Adding static case example
germa89 Aug 7, 2022
867dc11
Reorganising examples
germa89 Aug 7, 2022
9bb50ec
Using DPF Result class
germa89 Aug 11, 2022
902215d
Adding some unit tests.
germa89 Aug 11, 2022
92f8943
Big second revision v(2.0)
germa89 Aug 11, 2022
478f259
Adding to requirements
germa89 Aug 11, 2022
d3d419f
Added some switching properties (`_mode_rst`)
germa89 Sep 16, 2022
1b22690
Adding ECT to ignored words
germa89 Sep 16, 2022
174d68c
Merge branch 'main' into feat/using-dpf-for-results
germa89 Sep 16, 2022
19cd8fb
Merge branch 'main' into feat/using-dpf-for-results
germa89 Sep 16, 2022
9bbed37
Fixing set docstring.
germa89 Sep 19, 2022
41e9d11
Adding canonical examples.
germa89 Sep 19, 2022
3ecc8fd
Fixing typo in post
germa89 Sep 19, 2022
d7c3936
Adding ``element_stress`` and refactoring to use core and not post.
germa89 Sep 20, 2022
79a5510
broken code backup
germa89 Oct 5, 2022
12ad51d
Skipping logic implemented in DPF
germa89 Oct 6, 2022
dd3d90b
Adding more examples and section title.
germa89 Oct 6, 2022
d4c015e
Renaming and reordering canonical examples
germa89 Oct 6, 2022
a05cb51
Unit tests
germa89 Oct 6, 2022
b5afcba
Fixing stress tests, adding parametrization on direction.
germa89 Oct 7, 2022
1274686
Implemented results:
germa89 Oct 7, 2022
46a41cd
Allow magicwords definition when instantiating CommandListingOutput c…
germa89 Oct 14, 2022
ce51dcd
Wraping ``set,list`` with the command output listing class
germa89 Oct 14, 2022
b6c0152
Exposing ``set`` in post_processing using ``mapdl.set("list")``
germa89 Oct 14, 2022
79196ea
Updating docs
germa89 Oct 14, 2022
96d7708
Improving docs
germa89 Oct 14, 2022
7e3c4ce
Fixing lathe issue.
germa89 Oct 14, 2022
5b11f91
making sure were the argument is a string
germa89 Oct 14, 2022
737bb98
Fixing table references
germa89 Oct 14, 2022
60998b8
Adding PyDPF to the documentation mapping
germa89 Oct 14, 2022
56d1e1b
Adding more cannonical examples
germa89 Oct 14, 2022
5b157d9
Fixing unit test
germa89 Oct 14, 2022
c8fe42f
Exposing 'columns_names'.
germa89 Oct 14, 2022
a626426
Fixing building issue.
germa89 Oct 14, 2022
bede0b1
Main DPF workflow and architecture implemented.
germa89 Oct 14, 2022
0e136c1
Implementing unit tests
germa89 Oct 14, 2022
8abff6f
Merge branch 'feat/-adding-set-to-post' into feat/using-dpf-for-results
germa89 Oct 14, 2022
3181996
Renaming method set to step
germa89 Oct 14, 2022
d4067c8
Merge branch 'feat/-adding-set-to-post' into feat/using-dpf-for-results
germa89 Oct 14, 2022
36a069b
removing test_dpf file
germa89 Oct 17, 2022
f0f98da
Merge branch 'main' into feat/using-dpf-for-results
germa89 Oct 17, 2022
746ab9f
added axisymmetric example
germa89 Oct 18, 2022
c08d431
Implemented distributed methods, available results, etc...
germa89 Oct 18, 2022
0025818
Keeping previous MAPDL structure
germa89 Oct 18, 2022
93e0fc4
Some docstring fixes
germa89 Oct 19, 2022
a62a3b6
Adding more examples
germa89 Oct 19, 2022
132a4de
bypassing everything if DPF is installed.
germa89 Oct 19, 2022
d6d73e0
Making sure we update the Model when we instantiate (maybe it is bett…
germa89 Oct 19, 2022
86c3d2d
initializing model because of reader
germa89 Oct 19, 2022
f6c1524
Adding cyclic and mesh tests
germa89 Oct 19, 2022
c54f0bb
simplifying RST loading
germa89 Oct 19, 2022
04a22c3
Assuming DPF is always remote.
germa89 Oct 19, 2022
82b0881
Merge branch 'main' into feat/using-dpf-for-results
germa89 Oct 25, 2022
7c3eada
Adding connect to server function
germa89 Oct 25, 2022
7b919d8
supporting docker images for cicd
germa89 Oct 26, 2022
ba4cce0
Merge branch 'main' into feat/using-dpf-for-results
germa89 Oct 26, 2022
6b8890e
merging test_dpf and test_result
germa89 Nov 2, 2022
84a2110
Merge branch 'main' into feat/using-dpf-for-results
germa89 Nov 2, 2022
53f1ab8
Attempting to implement local logic.
germa89 Nov 16, 2022
afa858b
Merge branch 'main' into feat/using-dpf-for-results
germa89 Nov 21, 2022
c65647e
Merge branch 'main' into feat/using-dpf-for-results
germa89 Dec 22, 2022
4dce037
adding get_mapdl_envvar
germa89 Dec 22, 2022
855c065
Adding on_docker check
germa89 Dec 22, 2022
9ca373f
Fixing typos
germa89 Dec 22, 2022
9d04678
Setting default dpf for building the gallery.
germa89 Dec 22, 2022
15cdd1c
Merge branch 'main' into feat/using-dpf-for-results
germa89 Dec 28, 2022
f34920b
chore: merge remote-tracking branch 'origin/main' into feat/using-dpf…
germa89 May 20, 2025
25ae201
ci: auto fixes from pre-commit.com hooks.
pre-commit-ci[bot] May 20, 2025
e0e03cc
chore: adding changelog file 1300.miscellaneous.md [dependabot-skip]
pyansys-ci-bot May 20, 2025
6b17936
feat: finishing previous merge
germa89 May 20, 2025
5a97f16
fix: update copyright notices and improve comments in source and test…
germa89 May 20, 2025
fd788a2
Merge branch 'feat/using-dpf-for-results' of https://github.com/ansys…
germa89 May 20, 2025
cba2fe0
refactor: reorganize canonical examples into __init__.py
germa89 May 20, 2025
0811fdc
fix: update import path for _MapdlCore and modify file upload logic i…
germa89 May 20, 2025
7de8bb2
chore: adding changelog file 1300.miscellaneous.md [dependabot-skip]
pyansys-ci-bot May 20, 2025
e512ac0
fix: enable DPFResult to check if the DPF server is on the same machi…
germa89 May 22, 2025
ef0dc5f
refactor: improve validation logic in test_result.py and update selec…
germa89 May 22, 2025
a771adc
refactor: enhance error reporting in pytest output for better debugging
germa89 May 22, 2025
8322eec
chore: merge remote-tracking branch 'origin/main' into feat/using-dpf…
germa89 May 22, 2025
08b7371
fix: avoid circular import
germa89 May 22, 2025
82d117c
feat: add DPF dependency checks and conditional imports in result han…
germa89 May 23, 2025
f4551b2
chore: merge remote-tracking branch 'origin/main' into feat/using-dpf…
germa89 May 23, 2025
bf602ec
fix: update DPF import path and enhance type hints in result handling
germa89 May 23, 2025
c492605
refactor: remove assert
germa89 May 23, 2025
2239284
fix: remote working mode
germa89 May 23, 2025
6315e06
fix: update Dockerfiles and docker-compose files to use v25.2-ubuntu-…
germa89 May 28, 2025
749ef51
chore: merge remote-tracking branch 'origin/main' into feat/using-dpf…
germa89 Jun 2, 2025
32f6635
feat: add PYMAPDL_ADDITIONAL_SWITCHES to pytest report header
germa89 Jun 10, 2025
212cdff
feat: add material properties retrieval to result and corresponding t…
germa89 Jun 10, 2025
35413ae
chore: merge remote-tracking branch 'origin/main' into feat/using-dpf…
germa89 Jun 10, 2025
099f123
chore: adding changelog file 1300.miscellaneous.md [dependabot-skip]
pyansys-ci-bot Jun 10, 2025
2e62ab1
feat: add element_lookup, and notimplemented methods. update tests fo…
germa89 Jun 11, 2025
b97e932
chore: merge branch 'feat/using-dpf-for-results' of https://github.co…
germa89 Jun 11, 2025
efe9be5
feat: reducing line length that gets printed in the pytest summary
germa89 Jun 11, 2025
d6fa8f6
feat: adding node and element components attributes and their tests
germa89 Jun 11, 2025
cd957fb
fix: typo
germa89 Jun 11, 2025
81cee0f
Merge branch 'main' into feat/using-dpf-for-results
germa89 Jun 11, 2025
1650933
refactor: remove test for non-local result download
germa89 Jun 11, 2025
88c35d5
refactor: partial codacy clean up
germa89 Jun 11, 2025
76e043c
refactor: using 'get_fields' instead of the MATERIAL_PROPERTIES
germa89 Jun 12, 2025
5138a84
feat: adding class switch using 'use_reader_backend'.
germa89 Jun 12, 2025
d69e7a0
fix: unit tests by using the DPFResult class apart from mapdl.result
germa89 Jun 13, 2025
310b80c
fix: update remote processing logic to handle CICD versions
germa89 Jun 13, 2025
f740019
feat: add TEST_DPF_BACKEND environment variable to control DPF test e…
germa89 Jun 13, 2025
77a273e
chore: merge remote-tracking branch 'origin/main' into feat/using-dpf…
germa89 Jun 13, 2025
78f3b3d
chore: adding changelog file 1300.maintenance.md [dependabot-skip]
pyansys-ci-bot Jun 13, 2025
f43d40c
chore: update test_result.py documentation and comments for clarity
germa89 Jun 13, 2025
4494513
fix: correct conditional syntax in build_matrix.sh for remote processing
germa89 Jun 13, 2025
05df447
Merge branch 'feat/using-dpf-for-results' of https://github.com/ansys…
germa89 Jun 13, 2025
2f814eb
fix: update patch decorator to use version_from_path for consistency
germa89 Jun 13, 2025
4c7645a
chore: update test_result.py documentation for improved clarity
germa89 Jun 13, 2025
41ff1a0
fix: update patch decorator to use autospec and side_effect for versi…
germa89 Jun 13, 2025
d7797d7
chore: merge remote-tracking branch 'origin/main' into feat/using-dpf…
germa89 Jun 16, 2025
2159ff4
chore: merge remote-tracking branch 'origin/main' into feat/using-dpf…
germa89 Jun 16, 2025
1daf7e4
fix: add DPF backend testing for CICD MAPDL version in workflows
germa89 Jun 16, 2025
312be6e
fix: some codacy issues
germa89 Jun 17, 2025
74b1d37
chore: merge remote-tracking branch 'origin/main' into feat/using-dpf…
germa89 Jun 17, 2025
f256b23
fix: strip whitespace from downloaded raw object in MapdlGrpc class
germa89 Jun 17, 2025
08c9d13
refactor: moving parse ip to misc
germa89 Jun 17, 2025
96c8524
feat: returning float in inquire if possible.
germa89 Jun 17, 2025
104a6fd
feat: adding method to check if MAPDL and DPF server are on the same …
germa89 Jun 17, 2025
c6f5f2e
feat: check if DPF is remote based on comparing IPs.
germa89 Jun 17, 2025
99367d7
feat: allow returning bool in 'mapdl.inquire'
germa89 Jun 17, 2025
3b98eed
feat: returning full path of RST file always, even on remote
germa89 Jun 17, 2025
a7a66c7
feat: clean up RST attributes
germa89 Jun 17, 2025
b36ccaa
fix: pytest error printing
germa89 Jun 17, 2025
bd387ef
feat: download RST file to temporary directory in test fixture
Jun 17, 2025
c36d6cf
fix: correct platform attribute reference in file path construction
Jun 17, 2025
88240c3
fix: streamline connection logic in DPFResult class
Jun 17, 2025
f5ae558
ci: auto fixes from pre-commit.com hooks.
pre-commit-ci[bot] Jun 17, 2025
ad6e9e8
refactor: remove unused import and clean up xfail reason formatting
Jun 17, 2025
d97b9d2
chore: merge remote-tracking branch 'origin/main' into feat/using-dpf…
Jun 17, 2025
ad5ad30
Apply suggestions from code review
germa89 Jun 18, 2025
400db37
fix: handle non-interactive mode in _MapdlCommandExtended class
Jun 18, 2025
33a7188
fix: correct assignment syntax in DPFResult class
Jun 18, 2025
a1b1f2a
ci: auto fixes from pre-commit.com hooks.
pre-commit-ci[bot] Jun 18, 2025
7282669
junk: empty commit to trigger CICD
Jun 18, 2025
f21bbf2
fix: enhance DPFResult class with temporary directory handling and sa…
Jun 18, 2025
8c4444e
fix: refactor Example class to use properties for example_name and ap…
Jun 18, 2025
977eb94
fix: skip cyclic test due to DPF segfault issue
germa89 Jun 18, 2025
59ac804
fix: update skip decorator for cyclic test to use pytest.mark.skip
Jun 18, 2025
957be2a
fix: add debug logging for DPF server IP and executable checks in DPF…
germa89 Jun 18, 2025
8954c34
fix: update test-remote workflow for improved compatibility with GitH…
germa89 Jun 19, 2025
b63307b
fix: bind DPF port for CICD version in start_mapdl.sh
germa89 Jun 19, 2025
3652a05
fix: add second DPF port for MAPDL pool testing in test-remote workflow
germa89 Jun 19, 2025
89bfc2b
fix: improving logging and delaying server connection to the first usage
germa89 Jun 19, 2025
a17f98b
fix: not existing attribute _is_remote
germa89 Jun 19, 2025
3a85827
fix: add logging for docker ps output and move log files in collect_m…
germa89 Jun 19, 2025
0b1b30f
chore: merge remote-tracking branch 'origin/main' into feat/using-dpf…
germa89 Jun 19, 2025
e9cb9ed
fix: quote DPF_ARG variable in docker run command for proper handling
germa89 Jun 19, 2025
359eedb
refactor: remove unnecessary import of pytest in test_result.py
germa89 Jun 19, 2025
2b52c57
fix: import parse_ip_route in result.py to resolve missing function i…
germa89 Jun 19, 2025
4886d22
refactor: remove redundant import of _HAS_DPF in mapdl_core.py
germa89 Jun 19, 2025
bcabb8e
refactor: comment out unused old attributes in DPFResult class
germa89 Jun 19, 2025
75452f4
fix: simplify exception handling in validate function in test_result.py
germa89 Jun 19, 2025
7020a6e
fix: add docker ps command to log running containers in test-remote.yml
germa89 Jun 19, 2025
27cb122
fix: update DPF port binding logic in start_mapdl.sh
germa89 Jun 19, 2025
7abb286
feat: adding docker ps output
germa89 Jun 20, 2025
b76cebb
fix: log DPF_ARG and DB_INT_PORT when binding DPF port in start_mapdl.sh
germa89 Jun 20, 2025
3433a44
fix: ensure DPF_ARG is correctly expanded in docker run command in st…
germa89 Jun 20, 2025
f427e90
fix: correct variable expansion for LICENSE_SERVER and DB_INT_PORT in…
germa89 Jun 20, 2025
aa0cb46
fix: update file-name format for remote and local mapdl versions in C…
germa89 Jun 20, 2025
deac590
chore: merge remote-tracking branch 'origin/main' into feat/using-dpf…
germa89 Jun 20, 2025
d832587
fix: correct syntax for conditional check on MAPDL_VERSION in start_m…
germa89 Jun 20, 2025
6f4e65b
fix: update DPF_PORT and DPF_PORT2 values in test-remote.yml
germa89 Jun 20, 2025
ebbbb2f
fix: enhance start_mapdl.sh script with detailed usage instructions a…
germa89 Jun 20, 2025
b8d7173
fix: enable docker image pull in start_mapdl.sh script
germa89 Jun 20, 2025
a1a47a8
fix: correct syntax for environment variable in docker command in sta…
germa89 Jun 20, 2025
c99948e
fix: remove health check command from docker run in start_mapdl.sh
germa89 Jun 20, 2025
fcfbf41
fix: simplify docker command entrypoint and instance name syntax in s…
germa89 Jun 20, 2025
540b476
fix: add docker ps and process listing commands to log collection script
germa89 Jun 20, 2025
50b0481
refactor: adding more logging
germa89 Jun 20, 2025
e0bec34
fix: correct log file naming and improve log collection in collect_ma…
germa89 Jun 20, 2025
c3c5f3c
fix: streamline log collection process by removing unnecessary log moves
germa89 Jun 20, 2025
381f971
fix: add docker ps command to log collection scripts for better proce…
germa89 Jun 20, 2025
04d2d57
fix: ensure proper variable usage and improve logging for DPF server …
germa89 Jun 20, 2025
2661755
fix: add docker ps command for better visibility before starting DPF …
germa89 Jun 20, 2025
38ff0b5
fix: reorder DPF server startup steps for improved execution flow
germa89 Jun 20, 2025
7ac2043
fix: comment out specific node assertions in test for clarity and fut…
germa89 Jun 23, 2025
55fd609
fix: reduce maxfail in pytest arguments for improved test stability
germa89 Jun 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .ci/collect_mapdl_logs_remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ mkdir "$LOG_NAMES" && echo "Successfully generated directory $LOG_NAMES"
echo "Collecting MAPDL logs..."

(docker exec "$MAPDL_INSTANCE" /bin/bash -c "mkdir -p /mapdl_logs && echo 'Successfully created directory inside docker container'") || echo "Failed to create a directory inside docker container for logs."

(docker exec "$MAPDL_INSTANCE" /bin/bash -c "mv ./*.log /mapdl_logs") || echo "Failed to move the logs files."

(docker exec "$MAPDL_INSTANCE" /bin/bash -c "ps aux > /mapdl_logs/docker_processes_end.log") || echo "Failed to get the processes from the docker container"

(docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$FILE*.out' > /dev/null ;then mv -f /file*.out /mapdl_logs && echo 'Successfully moved out files.'; fi") || echo "Failed to move the 'out' files into a local file"
(docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$FILE*.err' > /dev/null ;then mv -f /file*.err /mapdl_logs && echo 'Successfully moved err files.'; fi") || echo "Failed to move the 'err' files into a local file"
(docker exec "$MAPDL_INSTANCE" /bin/bash -c "if compgen -G '$FILE*.log' > /dev/null ;then mv -f /file*.log /mapdl_logs && echo 'Successfully moved log files.'; fi") || echo "Failed to move the 'log' files into a local file"
Expand All @@ -24,14 +29,12 @@ docker cp "$MAPDL_INSTANCE":/mapdl_logs/. ./"$LOG_NAMES"/. || echo "Failed to co

####
echo "Collecting local build logs..."
ls -la

echo "Collecting docker run log..."
mv log.txt ./"$LOG_NAMES"/log.txt || echo "MAPDL run docker log not found."
mv log_dpf.txt ./"$LOG_NAMES"/log_dpf.txt || echo "DPF run docker log not found."
docker ps > /"$LOG_NAMES"/docker_ps_end.log || echo "Failed to print the docker ps"

echo "Moving docker launch log..."
mv mapdl_launch_0.log ./"$LOG_NAMES"/mapdl_launch_0.log || echo "MAPDL launch docker log not found."
mv mapdl_launch_1.log ./"$LOG_NAMES"/mapdl_launch_1.log || echo "MAPDL launch docker log not found."
echo "Collecting logs..."
mv ./*.log ./"$LOG_NAMES"/ || echo "MAPDL run docker log not found."

echo "Moving the profiling files..."
mkdir -p ./"$LOG_NAMES"/prof
Expand Down
99 changes: 76 additions & 23 deletions .ci/start_mapdl.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,35 @@
#!/bin/bash
# This script is used to start a MAPDL instance in a Docker container.
#
# Usage:
# ------
# This script is intended to be run in a CI/CD environment where the necessary environment variables are set.
#
# Required environment variables:
# -------------------------------
#
# - DISTRIBUTED_MODE: The mode of operation for MAPDL (e.g., "smp", "dmp").
# - DPF_PORT: The port for the DPF service (e.g., 50055).
# - INSTANCE_NAME: The name of the MAPDL instance (e.g., "MAPDL_0").
# - LICENSE_SERVER: The address of the license server (e.g., "123.123.123.123").
# - MAPDL_PACKAGE: The Docker image package name (e.g., ansys/mapdl).
# - MAPDL_VERSION: The version of the MAPDL image to use (e.g., "v25.2-ubuntu-cicd").
# - PYMAPDL_DB_PORT: The port for the PyMAPDL database service (e.g., 50056).
# - PYMAPDL_PORT: The port for the PyMAPDL service (e.g., 50052).
#
# Example:
# --------
#
# export DISTRIBUTED_MODE="smp"
# export DPF_PORT=50055
# export INSTANCE_NAME=MAPDL_0
# export LICENSE_SERVER="123.123.123.123"
# export MAPDL_PACKAGE=ghcr.io/ansys/mapdl
# export MAPDL_VERSION=v25.2-ubuntu-cicd
# export PYMAPDL_DB_PORT=50056
# export PYMAPDL_PORT=50052
# ./start_mapdl.sh
#
echo "MAPDL Instance name: $INSTANCE_NAME"
echo "MAPDL_VERSION: $MAPDL_VERSION"

Expand Down Expand Up @@ -29,29 +60,51 @@ else
export P_SCHEMA=/ansys_inc/ansys/ac4/schema
fi;

if [[ $MAPDL_VERSION == *"cicd"* ]] ; then
echo "It is a CICD version, binding DPF port too"
export DPF_ARG="-p ${DPF_PORT}:50055"
export DB_INT_PORT=50056

echo "DPF_ARG: $DPF_ARG"
echo "DB_INT_PORT: $DB_INT_PORT"
else
export DPF_ARG=""
export DB_INT_PORT=50055
fi;

echo "EXEC_PATH: $EXEC_PATH"
echo "P_SCHEMA: $P_SCHEMA"

docker run \
--entrypoint "/bin/bash" \
--name "$INSTANCE_NAME" \
--restart always \
--health-cmd="ps aux | grep \"[/]ansys_inc/.*ansys\.e.*grpc\" -q && echo 0 || echo 1" \
--health-interval=0.5s \
--health-retries=4 \
--health-timeout=0.5s \
--health-start-period=10s \
-e ANSYSLMD_LICENSE_FILE=1055@"$LICENSE_SERVER" \
-e ANSYS_LOCK="OFF" \
-p "$PYMAPDL_PORT":50052 \
-p "$PYMAPDL_DB_PORT":50055 \
--shm-size=2gb \
-e I_MPI_SHM_LMT=shm \
-e P_SCHEMA="$P_SCHEMA" \
-w /jobs \
-u=0:0 \
--memory=6656MB \
--memory-swap=16896MB \
"$MAPDL_IMAGE" "$EXEC_PATH" -grpc -dir /jobs -"$DISTRIBUTED_MODE" -np 2 -db -5000 -m -5000 - > log.txt &

grep -q 'Server listening on' <(timeout 60 tail -f log.txt)
# Building docker command
CMD=$(cat <<-_EOT_
run \
--entrypoint /bin/bash \
--name ${INSTANCE_NAME} \
--restart always \
--health-interval=0.5s \
--health-retries=4 \
--health-timeout=0.5s \
--health-start-period=10s \
-e ANSYSLMD_LICENSE_FILE=1055@${LICENSE_SERVER} \
-e ANSYS_LOCK="OFF" \
-p ${PYMAPDL_PORT}:50052 \
-p ${PYMAPDL_DB_PORT}:${DB_INT_PORT} \
${DPF_ARG} \
--shm-size=2gb \
-e I_MPI_SHM_LMT=shm \
-e P_SCHEMA="$P_SCHEMA" \
-w /jobs \
-u=0:0 \
--memory=6656MB \
--memory-swap=16896MB \
${MAPDL_IMAGE} ${EXEC_PATH} -grpc -dir /jobs -${DISTRIBUTED_MODE} -np 2 -db -5000 -m -5000 -
_EOT_
)

echo "Running docker command: "
echo "docker ${CMD}"
docker ${CMD} > ${INSTANCE_NAME}.log &
grep -q 'Server listening on' <(timeout 60 tail -f ${INSTANCE_NAME}.log)

echo "Content of ${INSTANCE_NAME}.log:"
cat ${INSTANCE_NAME}.log
8 changes: 6 additions & 2 deletions .ci/waiting_services.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
#!/bin/bash
echo "::group:: Docker services" && docker ps && echo "::endgroup::"

echo "Waiting for the MAPDL service to be up..."
nc -v -z localhost "$PYMAPDL_PORT"

echo "::group:: ps aux Output" && ps aux && echo "::endgroup::"

echo "Waiting for MAPDL port is open..."

echo "::group:: Waiting for the MAPDL port to be open..."
while ! nc -z localhost "$PYMAPDL_PORT"; do
sleep 0.1
sleep 0.1
done
echo "::endgroup::"
echo "MAPDL service is up!"


echo "::group:: Waiting for the DPF port to be open..."
while ! nc -z localhost "$DPF_PORT"; do
sleep 0.1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
username: ${{ github.actor }}
with:
mapdl-version: "${{ matrix.mapdl-version }}"
file-name: "${{ matrix.mapdl-version }}-remote"
file-name: "remote-${{ matrix.mapdl-version }}"


build-test-local-matrix:
Expand Down Expand Up @@ -221,7 +221,7 @@ jobs:
testing-minimal: false
pytest-arguments: '--reset_only_failed --add_missing_images'
mapdl-version: ${{ matrix.mapdl-version }}
file-name: "${{ matrix.mapdl-version }}-local"
file-name: "local-${{ matrix.mapdl-version }}"
tags: "local"
latest-version: "252"
test_dpf: ${{ contains(matrix.mapdl-version, 'cicd') }}
Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:
contents: write
steps:
- name: "Download the library artifacts from build-library step"
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ${{ env.PACKAGE_NAME }}-artifacts
path: ${{ env.PACKAGE_NAME }}-artifacts
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ jobs:
else export ON_STUDENT=false; export TAG_STUDENT="non-student";
fi

if [[ "${{ inputs.mapdl-version }}" == *"cicd"* ]]; then
echo "CICD MAPDL version detected, testing DPF backend for results module.";
echo "TEST_DPF_BACKEND=true" >> $GITHUB_ENV;
fi

echo "ON_STUDENT: $ON_STUDENT"
echo "TAG_STUDENT: $TAG_STUDENT"
echo "ON_STUDENT=$(echo $ON_STUDENT)" >> $GITHUB_OUTPUT
Expand Down
44 changes: 33 additions & 11 deletions .github/workflows/test-remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ jobs:
PYMAPDL_DB_PORT: 21002 # default won't work on GitHub runners
PYMAPDL_DB_PORT2: 21003 # default won't work on GitHub runners
DPF_DOCKER_IMAGE: ghcr.io/ansys/mapdl:v25.2-rocky-dpf-standalone
DPF_PORT: 21004
DPF_PORT: 21014
DPF_PORT2: 21015
DPF_START_SERVER: False
HAS_DPF: True
PYTEST_ARGUMENTS: '-vvv -ra --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile --report-log-exclude-logs-on-passed-tests --strict-markers'
TEST_DPF_BACKEND: false
PYTEST_ARGUMENTS: '-vvv -ra --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=1 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile --report-log-exclude-logs-on-passed-tests --strict-markers'
MAPDL_PACKAGE: ghcr.io/ansys/mapdl

steps:
Expand Down Expand Up @@ -105,11 +107,20 @@ jobs:
shell: bash
run: |
export ON_SAME_CONTAINER=false

if [[ "${{ inputs.mapdl-version }}" == *"ubuntu"* ]];
then export ON_UBUNTU=true; export TAG_UBUNTU="ubuntu";
else export ON_UBUNTU=false; export TAG_UBUNTU="centos";
if [[ "${{ inputs.mapdl-version }}" == *"cicd"* ]]; then export ON_SAME_CONTAINER="true"; fi
fi

if [[ "${{ inputs.mapdl-version }}" == *"cicd"* ]]; then
echo "CICD MAPDL version detected, testing DPF backend for results module.";
echo "TEST_DPF_BACKEND=true" >> $GITHUB_ENV;

echo "It should be run on the same container as MAPDL";
export ON_SAME_CONTAINER=true;
fi

echo "ON_UBUNTU: $ON_UBUNTU"
echo "TAG_UBUNTU: $TAG_UBUNTU"
echo "ON_SAME_CONTAINER: $ON_SAME_CONTAINER"
Expand Down Expand Up @@ -143,11 +154,14 @@ jobs:
echo "Launching first MAPDL instance..."
export INSTANCE_NAME=MAPDL_0
.ci/start_mapdl.sh &> mapdl_launch_0.log & export DOCKER_PID_0=$!

echo "Launching a second instance for MAPDL pool testing..."
export PYMAPDL_PORT=${{ env.PYMAPDL_PORT2 }}
export PYMAPDL_DB_PORT=${{ env.PYMAPDL_DB_PORT2 }}
export INSTANCE_NAME=MAPDL_1
export DPF_PORT=${{ env.DPF_PORT2 }}
.ci/start_mapdl.sh &> mapdl_launch_1.log & export DOCKER_PID_1=$!

echo "Launching MAPDL service 0 at PID: $DOCKER_PID_0"
echo "Launching MAPDL service 1 at PID: $DOCKER_PID_1"
echo "DOCKER_PID_0=$(echo $DOCKER_PID_0)" >> $GITHUB_OUTPUT
Expand All @@ -159,14 +173,7 @@ jobs:
env:
ANSYS_DPF_ACCEPT_LA: Y
run: |
docker pull $DPF_DOCKER_IMAGE && docker run -d --name dpfserver --env ANSYS_DPF_ACCEPT_LA=Y -p ${{ env.DPF_PORT }}:50052 $DPF_DOCKER_IMAGE && echo "DPF Server active on port ${{ env.DPF_PORT }}." > log_dpf.txt &

- name: "Start DPF server on same container as MAPDL"
if: ${{ steps.ubuntu_check.outputs.ON_SAME_CONTAINER == 'true' }}
shell: bash
run: |
echo "Starting DPF server on same MAPDL container..."
docker exec MAPDL_0 /bin/bash -c "/ansys_inc/v252/aisol/bin/linx64/Ans.Dpf.Grpc.sh --port ${{ env.DPF_PORT }} &" &> log_dpf.txt &
docker pull $DPF_DOCKER_IMAGE && docker run -d --name dpfserver --env ANSYS_DPF_ACCEPT_LA=Y -p ${{ env.DPF_PORT }}:50052 $DPF_DOCKER_IMAGE && echo "DPF Server active on port ${{ env.DPF_PORT }}." > log_dpf.log &

- name: "Getting files change filters"
uses: dorny/paths-filter@v3
Expand Down Expand Up @@ -215,12 +222,27 @@ jobs:
run: |
python -m pip install .[tests]

- name: "Start DPF server on same container as MAPDL"
if: ${{ steps.ubuntu_check.outputs.ON_SAME_CONTAINER == 'true' }}
shell: bash
env:
MAPDL_INSTANCE: "MAPDL_0"
DPF_PORT: "${{ env.DPF_PORT }}"
run: |
docker ps
echo "Starting DPF server on same MAPDL container: ${MAPDL_INSTANCE}"
docker exec MAPDL_0 /bin/bash -c "/ansys_inc/v252/aisol/bin/linx64/Ans.Dpf.Grpc.sh --port ${DPF_PORT} &"

- name: "Waiting for the services to be up"
shell: bash
env:
PYMAPDL_PORT: ${{ env.PYMAPDL_PORT }}
PYMAPDL_PORT2: ${{ env.PYMAPDL_PORT2 }}
MAPDL_INSTANCE: MAPDL_0
run: |
docker ps > docker_ps_start.log || echo "Failed to get the docker images from the docker container"
(docker exec "${MAPDL_INSTANCE}" /bin/bash -c "ps aux > docker_processes_start.log") || echo "Failed to get the processes from the docker container"

.ci/waiting_services.sh

- name: "Unit testing"
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/1300.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Feat: using dpf instead of reader in "results" module
5 changes: 3 additions & 2 deletions src/ansys/mapdl/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@
# Import related globals
_HAS_ATP: bool = is_installed("ansys.tools.path")
_HAS_CLICK: bool = is_installed("click")
_HAS_PIM: bool = is_installed("ansys.platform.instancemanagement")
_HAS_DPF: bool = is_installed("ansys.dpf.core")
_HAS_MATPLOTLIB: bool = is_installed("matplotlib")
_HAS_PANDAS: bool = is_installed("pandas")
_HAS_PIM: bool = is_installed("ansys.platform.instancemanagement")
_HAS_PYANSYS_REPORT: bool = is_installed("ansys.tools.report")
_HAS_PYVISTA: bool = is_installed("pyvista")
_HAS_REQUESTS: bool = is_installed("requests")
_HAS_TQDM: bool = is_installed("tqdm")
_HAS_MATPLOTLIB: bool = is_installed("matplotlib")
_HAS_VISUALIZER: bool = (
is_installed("ansys.tools.visualization_interface") and _HAS_MATPLOTLIB
)
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/_commands/post1_/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def set(
``to_array`` on the object returning from ``mapdl.set("list")``.

sbstep
Substep number (within Lstep). Defaults to the last substep of the
Substep number (within ``Lstep``). Defaults to the last substep of the
load step (except in a buckling or modal analysis). For a buckling
(``ANTYPE,BUCKLE``) or modal (``ANTYPE,MODAL``) analysis, ``Sbstep``
corresponds to the mode number. Specify ``Sbstep = LAST`` to store the
Expand Down
7 changes: 5 additions & 2 deletions src/ansys/mapdl/core/examples/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from .downloads import (
from ansys.mapdl.core.examples.downloads import (
download_bracket,
download_cfx_mapping_example_data,
download_manifold_example_data,
)
from .verif_files import vmfiles

# Canonical Examples
from ansys.mapdl.core.examples.examples import *
from ansys.mapdl.core.examples.verif_files import vmfiles
19 changes: 17 additions & 2 deletions src/ansys/mapdl/core/examples/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,25 @@
import os

# get location of this folder and the example files
dir_path: str = os.path.dirname(os.path.realpath(__file__))
__dir_path: str = os.path.dirname(os.path.realpath(__file__))

# add any files you'd like to import here. For example:
wing_model: str = os.path.join(dir_path, "wing.dat")
wing_model: str = os.path.join(__dir_path, "wing.dat")

# Verification files
from ansys.mapdl.core.examples.verif_files import vmfiles

laterally_loaded_tapered_support_structure = vmfiles["vm5"]
pinched_cylinder = vmfiles["vm6"]
transient_thermal_stress_in_a_cylinder = vmfiles["vm33"]
elongation_of_a_solid_bar = vmfiles["vm37"]
natural_frequency_of_a_piezoelectric_transducer = vmfiles["vm175"]
frequency_response_of_electrical_input_admittance = vmfiles["vm176"]
electrothermal_microactuator_analysis = vmfiles["vm223"]
piezoelectric_rectangular_strip_under_pure_bending_load = vmfiles["vm231"]
transient_response_of_a_ball_impacting_a_flexible_surface = vmfiles["vm65"]
threed_nonaxisymmetric_vibration_of_a_stretched_membrane = vmfiles["vm155"]
modal_analysis_of_a_cyclic_symmetric_annular_plate = vmfiles["vm244"]

# be sure to add the input file directly in this directory
# This way, files can be loaded with:
Expand Down
Loading
Loading