Year/Month | version | Event |
---|---|---|
2010/7 | 0.0.1 | release |
2015/1 | 0.12.0 | I quit the GUI! |
2015/4 | 0.13.0 | Next version 1.Because it is 0 |
2015/7 | 1.0.0 | I reviewed the framework!(Not backwards compatible) |
2016/7 | 1.7.1 | release |
As mentioned above, version 0.13 or earlier and 1.0.0 or later are completely different. This article summarizes the installation of version 1.7.1. See slideshare here for installing versions prior to 0.13.0, albeit a slapstick.
It seems that Git (optional), Python, Pip, Numpy, Scipy should be installed in advance. (Unconfirmed) The original document states:
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 |
It can also be installed on other distributions such as RHEL and Mint. In fact, I was able to install it on CentOS 6.4 without any problems.
packages | versions |
---|---|
Python | 2.7.9 or above, 3.4.3 or more |
Numpy | 1.9.2 or more |
Scipy | 0.15.1 or more |
Git(Optional) | - |
This time, we will use the Anaconda environment created on Ubuntu 14.04 LTS.
conda create -n py27 python=2.7 anaconda
source activate py27
If you have Anaconda installed under the pyenv environment, See y_sama's 3 types of workarounds for activate collision problem when pyenv and anaconda coexist.
Since it is registered in PyPI, install it with pip. Do not install with conda (old version (0.13) is registered in anaconda)
pip install openmdao
After executing the following, if you can confirm the operation check stdout, it is OK.
PY27=`which conda`
cp ${PY27:0:-10}/lib/python2.7/site-packages/openmdao/examples/paraboloid_example.py .
python paraboloid_example.py
Operation check 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
Installed using conda. MPI of mpi4py of conda uses MPICH2
conda install mpi4py
conda install -c mutirri petsc4py
Prepare the following petsc4py_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.')
After executing the following, if you can confirm the result shown below, you can check the operation of petsc.
mpirun -np 2 python petsc_test.py
petsc operation check 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'
After executing the following, if the end of log.doe is as follows, it is OK. (Warning is output to stdout)
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
tail 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