Jahr/Mond | version | Veranstaltung |
---|---|---|
2010/7 | 0.0.1 | Veröffentlichung |
2015/1 | 0.12.0 | Ich beende die GUI! |
2015/4 | 0.13.0 | Nächste Version 1.Weil es 0 ist |
2015/7 | 1.0.0 | Ich habe das Framework überprüft!(Nicht abwärtskompatibel) |
2016/7 | 1.7.1 | Veröffentlichung |
Wie oben erwähnt, sind die Versionen 0.13 und früher sowie 1.0.0 und höher völlig unterschiedlich. Dieser Artikel fasst die Installation von Version 1.7.1 zusammen. Informationen zur Installation von Versionen vor 0.13.0 finden Sie unter Slideshare hier, wenn auch mit einem Slapstick.
Es scheint, dass Git (optional), Python, Pip, Numpy, Scipy im Voraus installiert werden sollten. (Nicht bestätigt) Das Originaldokument besagt:
OS | Versions | ||
---|---|---|---|
Mac OS X | Mavericks(10.9.5) | Yosemite(10.10.5) | El Capitan(10.11.x) |
Ubuntu | Trusty Tahr (14.04.2 LTS) | Vivid Vervet (15.04) | Xenial Xerus (16.04 LTS) |
Windows | 7 | 8 | 10 |
Es kann auch auf anderen Distributionen wie RHEL und Mint installiert werden. Tatsächlich konnte ich es ohne Probleme unter CentOS 6.4 installieren.
packages | versions |
---|---|
Python | 2.7.9 oder höher, 3.4.3 oder mehr |
Numpy | 1.9.2 oder mehr |
Scipy | 0.15.1 oder mehr |
Git(Optional) | - |
Dieses Mal verwenden wir die Anaconda-Umgebung, die unter Ubuntu 14.04 LTS erstellt wurde.
conda create -n py27 python=2.7 anaconda
source activate py27
Wenn Sie Anaconda in der Pyenv-Umgebung installiert haben, Siehe y_samas 3 Arten von Problemumgehungen zum Aktivieren von Kollisionsproblemen bei gleichzeitiger Existenz von Pyenv und Anaconda.
Da es in PyPI registriert ist, installieren Sie es mit pip. Nicht mit conda installieren (alte Version (0.13) ist in anaconda registriert)
pip install openmdao
Wenn Sie nach dem Ausführen der folgenden Schritte die Funktionsprüfung stdout bestätigen können, ist dies in Ordnung.
PY27=`which conda`
cp ${PY27:0:-10}/lib/python2.7/site-packages/openmdao/examples/paraboloid_example.py .
python paraboloid_example.py
Funktionsprüfung stdout
##############################################
Setup: Checking root problem for potential issues...
No recorders have been specified, so no data will be saved.
Setup: Check of root problem complete.
##############################################
-15.0
Installiert mit conda. MPI von mpi4py von conda verwendet MPICH2
conda install mpi4py
conda install -c mutirri petsc4py
Bereiten Sie die folgende Haustiere vor.c4py_test.py
petsc4py_test.py
from petsc4py import PETSc
rank = PETSc.COMM_WORLD.getRank()
num_ranks = PETSc.COMM_WORLD.getSize()
x = PETSc.Vec().createMPI(4) # VecCreateMPI: Creates a parallel vector. size=4
x.setValues([0,1,2,3], [10,20,30,40]) # VecSetValues: Inserts or adds values into certain locations of a vector. x[0]=10, x[1]=20, x[2]=30, x[3]=40
print ('Rank',rank,'has this portion of the MPI vector:', x.getArray() ) # VecGetArray: Returns a pointer to a contiguous array that contains this processor's portion of the vector data.
vec_sum = x.sum() # VecSum: Computes the sum of all the components of a vector. 10+20+30+40=100
if rank == 0:
print ('Sum of all elements of vector x is',vec_sum,'and was computed using',num_ranks,'MPI processes.')
Wenn Sie nach dem Ausführen der folgenden Schritte das unten gezeigte Ergebnis bestätigen können, können Sie den Betrieb von Haustiere überprüfen.
mpirun -np 2 python petsc_test.py
Haustiere überprüfen stdout
(('Rank', 1, 'has this portion of the MPI vector:',
'Rank', 0, 'has this portion of the MPI vector:',
array([ 10., 20.]))
array([ 30., 40.]))
('Sum of all elements of vector x is',
100.0, 'and was computed using'
Wenn nach dem Ausführen des Folgenden das Ende von log.doe wie folgt lautet, ist es OK. (Warnung wird an stdout ausgegeben)
PY27=`which conda`
cp ${PY27:0:-10}/lib/python2.7/site-packages/openmdao/examples/doe_example.py .
mpirun -np 5 python doe_example.py >log.doe
tail -10 log.doe
Schwanz stdout
const.c: 3.0
dut.y: 13304.993403
indep_var.x: 4434.99780099
Timestamp: 1480262524.502128
Iteration Coordinate: rank3:Driver|1
Iteration succeeded: yes
Unknowns:
const.c: 3.0
dut.y: 13266.2297346
indep_var.x: 4422.07657819
Recommended Posts