Installation of OpenMDAO (version 1.7.1)

Overview of OpenMDAO

What is OpenMDAO?

Competitive horse


History of OpenMDAO

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.


Install OpenMDAO

Prerequisite environment

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.


Installation

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

Operation check

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

MPI related installation

Installed using conda. MPI of mpi4py of conda uses MPICH2

conda install mpi4py
conda install -c mutirri petsc4py

Operation check of 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'

OpenMDAO MPI operation check

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

Summary

Recommended Posts

Installation of OpenMDAO (version 1.7.1)
Installation of Anaconda3
Installation of CentOS 8
Introduction of ferenOS 1 (installation)
[Linux] Installation of nvm
Installation of Python 3.3 rc1
Installation of matplotlib (Python 3.3.2)
Installation of dlib, cv2
Align the version of chromedriver_binary
CentOS 8 installation procedure (latest version)
Reinforcement learning 2 Installation of chainerrl
Installation of ChEMBL webresource client
Version upgrade of python Anaconda
Check OpenSSL version of python 2.6
Source installation and installation of Python
[Python] Tuple version of prefecture pull-down
Test the version of the argparse module
Raise the version of pyenv itself
Installation of SciPy and matplotlib (Python)
Installation of OMC Cloud Agent --Linux-
Easy installation of OpenCV on RaspberryPi 3+
Correct the version Conflict of pip and execute the library installation normally.
Install an older version of Tensorflow
Installation of scikit-learn (Mac OS X)
pyenv-change the python version of virtualenv
Ideone> Python version: 3.5 (as of August 29, 2017)
Change the Python version of Homebrew
Installation of Python, SciPy, matplotlib (Windows)
Installation and easy usage of pytest
[2021 version] Python installation Windows 10 (64bit) edition
Introduction of ferenOS 3 (package update, installation)
Installation of Visual studio code and installation of python
Summary of Oracle Database XE installation procedure
How to check the version of Django
About the virtual environment of python version 3.7
Installation of psutil fails on MacOS Cataline
[Python] Try pydash of the Python version of lodash
Migemo version of the: find command,: mfind
Pleasanter .NetCore version installation (CentOS7 .NetCore2.2 SQL Server 2019)
[MacOS] Installation of Go (Go language) using goenv
mysqlclient installation error solution [Mac, Windows version]
[AWS] Summary of CLI installation error countermeasures
Introduction to Scapy ① (From installation to execution of Scapy)
A guide to batch installation of version control tools for major scripting languages