Parallel Group setup & mpi4py/OpenMDAO 2.2.X - openmdao

I am trying to use the parallelization with mpi/openmdao.
I have tried on various ubuntu computers as well as ubuntu bash on windows (a windows 10 feature)
The dependencies work fine independently (i.e. import petsc4py and import mpi4py works fine and I can run the tests of these similar to the links: https://openmdao.readthedocs.io/en/1.7.3/getting-started/mpi_linux.html &
http://mpi4py.scipy.org/docs/usrman/install.html)
But the Paralel Group code in the openmdao 2.2. manual does not work.
For each attempt (varying computers) i seem to get another error most of them seemed like compatibility errors (i.e. I install petsc4py which breaks numpy or mpi4py installation causing proble in the existing openmdao core. )
On some computers I had my own openmpi and petsc installed but conda install command already installs those as far as I see.
Eventually I have tried these steps on a newly started amazon instance
but had similar problems.
sudo apt-get install build-essential
wget http://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh
bash Anacond*
sudo apt-get install libibnetdisc-dev
sudo apt-get install libblas-dev libatlas-dev liblapack-dev
conda install mpi4py
conda install -c conda-forge petsc4py
if i check ''conda list'' onone of the computers the abbreviated output is ;
mpi 1.0 mpich conda-forge
mpi4py 3.0.0 py36_mpich_1 conda-forge
mpich 3.2.1 1 conda-forge
mpich2 1.4.1p1 0 anaconda
mpmath 1.0.0 py36hfeacd6b_2
msgpack-python 0.5.1 py36h6bb024c_0
multipledispatch 0.4.9 py36h41da3fb_0
mumps 5.0.2 blas_openblas_208 [blas_openblas]
conda-forge
numpy 1.14.3 py36_blas_openblas_200 [blas_openblas] conda-forge
numpydoc 0.7.0 py36h18f165f_0
openblas 0.2.20 8 conda-forge
openmdao 2.2.1 <pip>
openpyxl 2.4.10 py36_0
openssl 1.0.2o 0 conda-forge
petsc 3.9.1 blas_openblas_0 [blas_openblas]
conda-forge
petsc4py 3.9.1 py36_0 conda-forge
pexpect 4.3.1 py36_0
pickleshare 0.7.4 py36h63277f8_0
pillow 5.0.0 py36h3deb7b8_0
pip 10.0.1 <pip
On the same system if try to run
mpirun -n 2 python my_par_model.py
based on the manual code this is what i get
Does anyone have a suggestion where it could be failing or what steps i could follow for ubuntu implementation of anconda/openmdao/petsc/mpi4py and succesful run of paralel openmdao ?

You could take a look at the installation implementation for linux that exists in our .travis.yml file? https://github.com/OpenMDAO/OpenMDAO/blob/master/.travis.yml
This works for installing and testing OpenMDAO from scratch on Trusty Tahr instances on Travis CI. One difference I see at first glance would be our use of pip to install mpi and PETSc into the conda-installed python.

I think MPI compatibility was the main issue. I was not aware that it had to be openmpi and indeed conda install command installs the mpich and possibly causing a problem with openmdao.
I will continue doing more tests but for a working system starting from a brand new installation of ubuntu-16.04.4-desktop-amd64.iso I followed these steps;
(Steps that take time are the openmpi installation and petsc4py pip instalattion.)
1 ) For some dependencies (taken from https://gist.github.com/mrosemeier/088115b2e34f319b913a)
sudo apt-get install libibnetdisc-dev
sudo apt-get install libblas-dev libatlas-dev liblapack-dev
2) Download/Install OpenMPI (mostly taken from http://lsi.ugr.es/jmantas/pdp/ayuda/datos/instalaciones/Install_OpenMPI_en.pdf)
wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.0.tar.gz
tar -xzf openmpi-3.1.0.tar.gz
cd openmpi-*
./configure --prefix="/home/$USER/.openmpi"
make
sudo make install
echo export PATH="$PATH:/home/$USER/.openmpi/bin" >> /home/$USER/.bashrc
echo export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/$USER/.openmpi/lib/" >> /home/$USER/.bashrc
3) MINICONDA & Rest (mostly taken from https://github.com/OpenMDAO/OpenMDAO/blob/master/.travis.yml)
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh Minicond* # agree to add to the path etc.
conda install --yes python=3.6
conda install --yes numpy==1.14 scipy=0.19.1 nose sphinx mock swig pip;
pip install --upgrade pip;
pip install mpi4py
pip install petsc4py==3.9.1
#petsc4py Gives an error failed building wheel for petsc but then installs petsc itself, afterwards, petsc4py is also installed
sudo apt install git # in the cases git does not exist
# not sure why we need this part but i followed
pip install redbaron;
pip install git+https://github.com/OpenMDAO/testflo.git;
pip install coverage;
pip install git+https://github.com/swryan/coveralls-python#work;
# pyoptsparse and openmdao
git clone https://github.com/mdolab/pyoptsparse.git;
cd pyoptsparse;
python setup.py install;
cd ..;
conda install --yes matplotlib;
git clone http://github.com/OpenMDAO/OpenMDAO
cd OpenMDAO
pip install .
# optional
conda install spyder
4) Check the versions
mpirun --version : Open MPI 3.1.0
python --version : 3.6.5
pip --version :
pip 10.0.1 from /home/user/miniconda3/lib/python3.6/site-packages/pip (python 3.6)
conda list : (note that there is no mpich or similar in the conda list)
openmdao 2.2.1 <pip>
mpi4py 3.0.0 <pip>
petsc 3.9.2 <pip>
petsc4py 3.9.1 <pip>

Related

How to install turicreate in ubuntu22?

It had Python 3.10.4 installed already and turicreate requires python 3.7
So how can I do it?
If you have not already installed pip alongside python, run:
sudo apt install python3-pip
And after that:
pip3 install turicreate

Installing R 4.1 from source on newly installed Ubuntu 20.04

I tried to install R 4.1 on a newly set-up Ubuntu 20.04. After some struggle with the repositories and keys, I chose to install from source.
Visited https://www.r-project.org/ to download latest version of R. Ran ./configure multiple times to note the requirement of various libraries which you may note as follows. I am hoping this will save significant amount of time for anyone intending to build from source. Suggestions welcome for speeding up the process or better solution. However my intention is to share entire set of libraries that I had to install on a naked installation of 20.04 on which the very first package I tried to install was R 4.1 (from source).
Directory where you downloaded the tar.gz (e.g. R-4.1.2.tar.gz in my case)
cd Downloads
Untar
tar -xvzf R-4.1.2.tar.gz
Enter directory
cd R-4.1.2
As root
sudo su
Try validating configuration (encountered many errors throughout and following libraries were installed)
./configure
Installed various libraries:
apt-get install build-essential
apt-get install gfortran
apt-get install fort77
apt-get install libreadline-dev
apt-get install xorg-dev
apt-get install liblzma-dev libblas-dev
apt-get install gcc-multilib
apt-get install libbz2-dev
apt-get install libpcre2-dev
apt-get install libcurl4-openssl-dev
apt install default-jdk
make
make install
The above set worked for me and I am hopeful it may be of help.

Install Qt5 on Ubuntu 21.04

During previous Ubuntu releases, one could easily install Qt 5 by using:
sudo apt install qt5-default
qt5-default package is no longer included with Ubuntu 21.04.
How can I install the Qt 5 development package on Ubuntu 21.04?
qt5-default package is missed in ubuntu 21.04 repository, so you should just install all base packages by yourself by running command below
sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools

Some problems with installing JupyterLab

Installed JupiterLab, but ran into a problem in the terminal.
> Terminals not available (error was No module named 'winpty.cywinpty')
Tried the following commands:
First
pip install pywinpty
Requirement already satisfied: pywinpty in c:\python38\lib\site-packages (0.5.7)
Second (version)
Python --version 3.8.3
jupyter-lab --version
2.1.5
ipython --version
7.16.1
Third
import winpty
conda install pywinpty
and others don't get rid of startup errors
On Windows it can be solved by installing pywinpty from the wheel provided here: https://www.lfd.uci.edu/~gohlke/pythonlibs/ .
Just download (the wheel) and install it via:
pip install -I the_wheel_name_you_have_downloaded

error installing "rgl" package, version 0.100.19 in anaconda/jupyter-notebook. Ubuntu 18.04

I like to install "rgl" package version 0.100.19 (since the other package depends on this version) in anaconda/jupyter notebook environment and received error.
configure: error: X11 not found but required, configure aborted
I tried
sudo apt-get install xorg
sudo apt-get install libx11-dev
sudo apt-get install libglu1-mesa-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install r-cran-rgl
conda install -c conda-forge xorg-libx11
conda install -c anaconda mesa
but, they did not help yet.
install.packages("rgl")
configure: error: X11 not found but required, configure aborted
I came across this problem, my solution was to:
$ conda install r-rgl
It seems like the conda install goes to the conda R (see this with which R), and the way I found to get rgl installed on conda's R version was via conda install.

Resources