Installation on the HPC cluster Occigen (GENCI-CINES)
=====================================================

`Occigen is a GENCI-CINES HCP cluster <https://www.top500.org/system/178465>`_.

.. _occigen:

First install mercurial in python 2 because mercurial still works
better in python 2 and because there is no pip in the system python 2

.. code-block:: bash

   module load intel
   module load python/2.7.13
   pip2 install mercurial --user

We write in a file occigen_setenv.sh the commands to setup the environment:

.. literalinclude:: occigen_setenv.sh
   :language: shell

We source this file::

  source occigen_setenv.sh

Intel C++ compiler can not compiled C++ generated by Pythran so we create a
file ``.pythranrc`` with:

.. literalinclude:: occigen_.pythranrc
   :language: shell

We can then prepare the python environment:

.. code-block:: bash

   # creation of a virtualenv
   virtualenv --system-site-packages mypy
   source ~/mypy/bin/activate

   pip install mpi4py --no-deps --no-binary mpi4py
   pip install h5py --no-deps --no-binary h5py

   pip install pythran colorlog
   pip install fluiddyn

We have to build fftw3, p3dfft and pfft... For fftw3:

.. literalinclude:: occigen_install_fftw3.sh
   :language: shell

For p3dfft:

.. literalinclude:: occigen_install_p3dfft.sh
   :language: shell

For pfft:

.. literalinclude:: occigen_install_pfft.sh
   :language: shell

Finally, we can install fluidfft::

  hg clone http://bitbucket.org/fluiddyn/fluidfft
  cd fluidfft

There are two different ``site.cfg`` files for occigen, one to use fftw3 and
the other to use MKL (in this case, pfft cannot be used because it depends on
fftw3_mpi)::

  cp site.cfg.files/site.cfg.occigen_fftw3 site.cfg
  # or
  # cp site.cfg.files/site.cfg.occigen_mkl site.cfg

  make develop

You can then submit jobs using the class ``fluiddyn.cluster.cines.Occigen``.
