Pages

Working with MPI: Everything you need to know if you use HPC for science and engineering applications.

The usual questions for a beginner are.

What is MPI?
Why should we use it?
Is it a separate programming language compared to C/C++?
Is it compatible with Fortran/Python/C/C++?
What is the best language to learn MPI programming?
When do I need to use MPI programming?
What is "$PBS_O_DIR" and why should we use it in the script?
What are the commonly used tags in mpirun scripts?
What are some best practices of running MPI scripts?
What is a best program to illustrate the usefulness of MPI programming?
How to compile and run mpi program or script?
How to use laptop for dft or quantum chemistry or computational calculations?
How to compile and run mpi program or script in your laptop?
What is the difference or relation between qsub and MPI?

(add your questions. the questions will be answered one by one.)

Here I will discuss MPI and its usage in high performance computing for beginners in HPC usage.

How to know which version of MPI is installed in my cluster or supercomputer or system?

mpirun -version
You will get:
mpirun: IBM Platform MPI Community Edition: 09.x.x.x [BASELINE_MPI_POST_09xxxxx] [] Linux x86-64

How to check mpirun is successfully installed or not?

To check, simply check the version as above. In addition to that, you can run a simple program (C/C++, Fortran, or Python) that can tell you whether MPI is installed or not.

Now the simple program.

Here is a python program to check whether you have installed MPI or not (MPI Hello World program).

(if you get following error, you probably need to install the package.
"mpi_helloworld.c:10:17: fatal error: mpi.h: No such file or directory
compilation terminated."

(to be added more later)

Every compiler has an mpi version of it, usually with 'mpi' infront of it.

For example:

icpc - mpiicpc
g++ - mpig++
f90  - mpif90
f77  - mpif77
ifort - mpifort (note that one 'i' is missing here)

To run programs/codes compiled using these compilers, you need to use
"mpirun" command to run the jobs.







High performance computing using Cloud Computing: Where are we now?

I recently read an article in networkworld.com related to this topic.

The companies offer such solution is

IBM
AWS Amazon
Microsoft Azure

There is Google cloud. Does it offer similar solutions. Let us see later.

Almost all computational chemistry calculations and condensed matter theory calculations using density functional theory and other ab-initio and Monte-Carlo techniques use high performance computing (HPC) for computing. They are normally called as workstation, cluster, high performance computing, super computer, etc. These are used whenever time consuming calculations are need to be done as well as where there is a need for large memory. Large memory is needed for ab-initio calculations for storing the results such as the wave functions.

I wonder, is there any solutions where I can compile my code or commercial code or free code available on the internet such as Quantum Espresso in the cloud provides (see above in the list) and run these codes in the clouds?

My questions are:

How to use these clouds?
How much does it cost?
What is the comparison with HPC and Cloud computing?

I will post how I started using cloud computing for my high performance calculations.



How to search for a word in multiple PDF files in Linux

How to grep for a particular word in a PDF file?
Is it possible to use grep in pdf file?
How to use grep in pdf file?
Is there any command like grep to use in pdf files?

A simple solution exits. For all these questions, the answer is pdfgrep package.
There is a GitLab repository to do exactly this.

pdfgrep -R 'pattern' /path/of/the/pdf/file(s)

More on this:

See in more answers in StackOverflow 
Download the source from Gitlab 



A crash course on Fortran

Most of the condensed matter physics codes are written in Fortran and here is a quick summary of Fortran 95 language.

"
! To read a file.
    open(unit=11, file="records.txt", status="old") 
    ! The file is referred to by a 'unit number', an integer that you pick in
    ! the range 9:99. Status can be one of {'old','replace','new'}.
    read(unit=11, fmt="(3F10.2)") a, b, c
    close(11)

    ! To write a file.
    open(unit=12, file="records.txt", status="replace")
    write(12, "(F10.2,F10.2,F10.2)") c, b, a
    close(12)
"
References:
Learn Fortran95 in short duration

How to unfollow the "New answer added to:" email from ResearchGate

I frequently get "New answer added to:" update to may email from ResearchGate. But, I don't want to get this update to my mail.

How to unsubscribe from this update to email.

You can do this as follow.

  1. Go to the question. 
  2. Below the questions there will be button "FOLLOW"
  3. Click on the button once. 

That is it. You are done.

Adiabatic theorem and Born Oppenheimer Approximation

I try to understand the BO approximation here.

If we walk in mountain, some times, quit a bunch of mosquitoes like bees would fly around your head. You keep on hiking but the bees follow you by swirling around your head (and making noise too...really annoying).

Now, in molecule or materials, the nucleus can be given analogy of your head. The electrons can be given an analogy of bees around the head of a hiker. Here, the movement of the hiker's head (nucleus) does not affect the movement of bees (electron movement). This analogy may be useful for a kindergartner. But, for me, it is not enough. How to understand this really? Let us break this big problem in to pieces.

Another usual textbook discussion is the following. The mass of proton is 1837 times heavier than electron. Thus, nucleus is much much heavier than electron. Because of this, we can consider the nucleus is fixed in space and electrons are the only moving particles. This also doesn't makes sense to me. Just the higher mass consideration is not a satisfying argument to me.

So, I need a more intuitive as well as rigorous argument.

Let us start with Adiabatic theorem.

If a quantum system is changed gradually, the final state has the same state as the original state. Griffiths Quantum Mechanics beautifully explains this quantum adiabatic theorem. What if we change the system drastically?

Now, come to Born-Oppenheimer approximation. In BOA, we make use of this adiabatic theorem. Right? Where it is used? How it is used to prove it in original paper? Is there a simpler version (text book version) to understand the proof now?


Inserting symbols in MSWorld/PowerPoint

Many times, we may try to add an Angstrom (Ã… and also other symbols) symbol or degree celciums etc. But, we may need to search a lot in the insert Symbol option provided by MS Office (World and PowerPoint)

Here is the way how you can simply located those symbols.

Font: Select Normal Text
In the subset select Latin: Subset
You can find Angstrom symbol.

A straight forward way is copy the symbols here and paste in your document.

Character code is "00C5"



Hohenberg-Kohn theorems

I assume you know nothing about the Hohenberg-Kohn theorems. Here is the link for the paper that form the basis for the Kohn-Sham Density functional theory. Now, you download the paper and find skimming through the paper. You may not understand anything. Cool! It is not just you.

Here is a journey to understand Hohenberg-Kohn theorems.

The title is "Inhomogeneous electron gas". What we understand from this? We know electrons. What is electron gas? Collection of large number of electrons which behave like free electrons. Right?

Gas is defined as follow:
"a substance or matter in a state in which it will expand freely to fill the whole of a container, having no fixed shape (unlike a solid) and no fixed volume (unlike a liquid)."

Now, we may consider such gas which consist of electrons. However, materials have have nucleus which are positively charged and attract electrons and forms some weired kind of patterns/orbits/etc in the real materials. So, the electrons are not homogeneous inside a material and they must be in-homogeneous. Thus the title give some intuition on the subject of the paper.

Let us jump on the the formalism section.

First the authors start with the definition of the Hamiltonian and how it is actually written in different contributions added together.

H = T + U + V

Here, T, U and V stands for kinetic energy, electron-electron repulsion energy, and V is the electron-nucleus attractive potential energy.







List of Computational Physics and Computational Chemistry or Density Functional theory (DFT) Courses

Here is the list of Computational Physics and Computational Chemistry Courses that would be useful for learning and doing research in condensed matter physics or chemistry or biology.

LABORATORY OF COMPUTATIONAL PHYSICS (link here)
academic year 2015/16
Teacher: Maria Peressi

PY 502, Computational Physics, Fall 2018 (link here)
Department of Physics, Boston University
Instructor: Anders Sandvik

554027 Modern Fortran Programming for Chemists and Physicists (link here)
Trainer: Pekka Manninen

PhD Course and Lecture Series in Density Functional Theory  (link here)
Lecturer: Rickard Armiento, Linkoping University,

Materials simulations: Introduction to Density Functional Theory (2019) (link here)

Quantum Chemistry by Prof. Stephan P. A. Sauer (YouTube Videos Playlist)
Department of Chemistry, University of Copenhagen.

Summer Lecture Series in Theoretical Chemistry 2012: Density Functional Theory (YouTube link)
Prof. Sherrill, Georgia Institute of Technology.

Scientific Programming and Numerical Computation
from Wu-ting Tsai, National Taiwan University.



You may be interested in these posts

Error in image file conversion: convert-im6.q16: not authorized `test.eps' @ error/constitute.c/WriteImage/1037.

This error is because of the vulnerability. This allows remote execution of code using image formats. So, some Linux distributions by defaul...