Docker, mpi, fftw, fftw-mpi

Docker enables to create containers for your program with all the libraries installed.

This avoids to reinstall all the libraries (say mpich, fftw…) to any user and in new systems

The user just needs to pull the container from a repository. For example nonlinearxwaves/base

I write C++ scientific computing programs with mpich, fftw-mpi and random numbers libraries (as sprng5), wich I need to run in both windows and linux systems. Docker simplifies a lot the deployment but also the development of the code.

nonlinearxwaves/base is a container with all of that

After installing Docker you run

docker login

Then you pull the docker image

docker pull nonlinearxwaves/base:0.1

You list the available images with

docker images -a

You identify the image id (in this example it is ec56f7250d5a)

REPOSITORY             TAG                 IMAGE ID            CREATED             SIZE
nonlinearxwaves/base 0.1 ec56f7250d5a 42 hours ago 1.13GB

You run the image with (you must replace the image id with your image id)

docker run -i -t ec56f7250d5a 

And you are in a shell with all the libraries installed and you may compile and run your mpi application in the usual way. In this image you will be the user “user”

user@2ff281ad4621:~$

The number 2ff281ad4621 is the container id that is now running (similar to a virtual machine)

This works with Windows and Linux (and also Mac, but I did not test)

You may also create your images with the Dockerfile

Is docker fast ? or is it better not to use a container? we will test …

emacs, auctex, Sumatra.pdf in Windows 10

On Windows 10 Pro

Install MiKTeX from https://miktex.org/

Download emacs zip file in the GNU mirror. I have chosen in http://mirror.lihnidos.org/GNU/ftp/gnu/emacs/windows/ the file in the folder emacs-26 http://mirror.lihnidos.org/GNU/ftp/gnu/emacs/windows/emacs-26/emacs-26.3-x86_64.zip

Unzip the emacs file in some folder for example Downloads folder, you will have a folder with name emacs-26.1-x86.4

Inside this emacs folder, click on runemacs

Now emacs is running, but you need to install auctex and Sumatra.pdf. You may create a shortcut to runemacs in the application bar by right clicking on it

To install auctex open emacs, then “M+x package-install auctex” and hit return

M+x package-install auctex

Sumatra.pdf enables to open multiple windows with the same pdf file. Acrobat blocks the compilation if the pdf is open.

Install Sumatra.pdf from https://www.sumatrapdfreader.org

Sumatra.pdf exe file will be in “C:\Program Files\SumatraPDF”

C:\Program Files\SumatraPDF

Now you need to configure emacs for using Sumatra.pdf, this is done by modifying the .emacs file

The .emacs file is the main configuration file for emacs

You find the .emacs file in the folder “C:\Users\<USER>\AppData\Roaming”

C:\Users\YourUserNameHere\AppData\Roaming

This is a hidden folder, you need to enable showing hidden folder in windows explorer (go to options in the folder menu)

Open .emacs and add the lines at the end of the file and save

(setq TeX-PDF-mode t)
(setq TeX-source-correlate-mode t)
(setq TeX-source-correlate-method 'synctex)
(setq TeX-view-program-list
'(("Sumatra PDF" ("\"C:/Program Files/SumatraPDF/SumatraPDF.exe\" -reuse-instance"
   (mode-io-correlate " -forward-search %b %n ") " %o"))))

(eval-after-load 'tex
 '(progn
   (assq-delete-all 'output-pdf TeX-view-program-selection)
   (add-to-list 'TeX-view-program-selection '(output-pdf "Sumatra PDF")))
 )
(server-start)

Now you are set to run auctex in emacs with forward search and Sumatra.pdf