Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
cdf90b84
Unverified
Commit
cdf90b84
authored
Apr 12, 2021
by
Justin Carpentier
Committed by
GitHub
Apr 12, 2021
Browse files
Merge pull request #1430 from jcarpent/topic/ci
Extend CI coverage with OpenMP
parents
68382811
36db1735
Pipeline
#14008
passed with stage
in 151 minutes and 50 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.github/workflows/macos-conda.yml
→
.github/workflows/macos-
linux-
conda.yml
View file @
cdf90b84
name
:
Build Pinocchio for Mac OS X via Conda
name
:
Build Pinocchio for Mac OS X
/Linux
via Conda
on
:
[
push
,
pull_request
]
jobs
:
pinocchio-osx-conda
:
runs-on
:
macos-latest
pinocchio-conda
:
name
:
Pinocchio on ${{ matrix.os }} with Conda
runs-on
:
${{ matrix.os }}
strategy
:
fail-fast
:
false
matrix
:
os
:
[
"
ubuntu-latest"
,
"
macos-latest"
]
steps
:
-
uses
:
actions/checkout@v2
...
...
@@ -25,6 +31,7 @@ jobs:
run
:
|
conda activate pinocchio
conda install cmake -c main
conda install llvm-openmp -c conda-forge
-
name
:
Build Pinocchio
shell
:
bash -l {0}
...
...
@@ -35,7 +42,7 @@ jobs:
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=
Debug
-DBUILD_WITH_COLLISION_SUPPORT=ON -DBUILD_ADVANCED_TESTING=ON -DBUILD_WITH_CASADI_SUPPORT=OFF -DPYTHON_EXECUTABLE=$(which python3) -DBUILD_WITH_OPENMP_SUPPORT=O
FF
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=
Release
-DBUILD_WITH_COLLISION_SUPPORT=ON -DBUILD_ADVANCED_TESTING=ON -DBUILD_WITH_CASADI_SUPPORT=OFF -DPYTHON_EXECUTABLE=$(which python3) -DBUILD_WITH_OPENMP_SUPPORT=O
N
make
make build_tests
export CTEST_OUTPUT_ON_FAILURE=1
...
...
examples/CMakeLists.txt
View file @
cdf90b84
...
...
@@ -91,6 +91,12 @@ IF(BUILD_PYTHON_INTERFACE)
)
ENDIF
(
BUILD_WITH_URDF_SUPPORT
)
ENDIF
(
hpp-fcl_FOUND
)
IF
(
BUILD_WITH_OPENMP_SUPPORT
)
LIST
(
APPEND
${
PROJECT_NAME
}
_PYTHON_EXAMPLES
run-algo-in-parallel
)
ENDIF
(
BUILD_WITH_OPENMP_SUPPORT
)
FOREACH
(
EXAMPLE
${${
PROJECT_NAME
}
_PYTHON_EXAMPLES
}
)
ADD_PYTHON_UNIT_TEST
(
"example-py-
${
EXAMPLE
}
"
"examples/
${
EXAMPLE
}
.py"
"bindings/python"
)
...
...
examples/run-algo-in-parallel.py
0 → 100644
View file @
cdf90b84
import
pinocchio
as
pin
import
numpy
as
np
model
=
pin
.
buildSampleModelHumanoid
()
model
.
lowerPositionLimit
[:
7
]
=
-
np
.
ones
(
7
)
model
.
upperPositionLimit
[:
7
]
=
+
np
.
ones
(
7
)
pool
=
pin
.
ModelPool
(
model
)
num_threads
=
pin
.
omp_get_max_threads
()
batch_size
=
128
q
=
np
.
empty
((
model
.
nq
,
batch_size
))
for
k
in
range
(
batch_size
):
q
[:,
k
]
=
pin
.
randomConfiguration
(
model
)
v
=
np
.
zeros
((
model
.
nv
,
batch_size
))
a
=
np
.
zeros
((
model
.
nv
,
batch_size
))
tau
=
np
.
zeros
((
model
.
nv
,
batch_size
))
print
(
"num_threads: {}"
.
format
(
num_threads
))
print
(
"batch_size: {}"
.
format
(
batch_size
))
# Call RNEA
res_rnea
=
np
.
empty
((
model
.
nv
,
batch_size
))
pin
.
rnea
(
num_threads
,
pool
,
q
,
v
,
a
,
res_rnea
)
# Without allocation
res_rnea2
=
pin
.
rnea
(
num_threads
,
pool
,
q
,
v
,
a
)
# With allocation
# Call ABA
res_aba
=
np
.
empty
((
model
.
nv
,
batch_size
))
pin
.
aba
(
num_threads
,
pool
,
q
,
v
,
tau
,
res_aba
)
# Without allocation
res_aba2
=
pin
.
aba
(
num_threads
,
pool
,
q
,
v
,
tau
)
# With allocation
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment