+1 vote
asked by (220 points)

1 Answer

+2 votes
answered by (25k points)

Hi, so you need to have an MPI library implementation on your computer. For example, you could use OpenMPI, MPICH, or the Intel MPI implementation (or some others).

Then you need to include the mpi.h header when you compile, by including a flag like -I/path/to/mpi/headers

For example, on my Mac I installed OpenMPI using Homebrew. So I included the flags:
-I/usr/local/Cellar/open-mpi/1.10.1/include
in my compiler flags (for my driver application, not for ITensor itself).

Also you need to include "linker" flags to link to the MPI library itself. Again, on my Mac I include the flags:
-L/usr/local/Cellar/open-mpi/1.10.1/lib -lmpi_cxx -lmpi

A good way to find out the compiler flags for your particular MPI implementation is to run the program mpicxx which is often included with many MPI implementations (it is a special compiler command that automatically includes the MPI flags). You can either use mpicxx itself as your compiler (i.e. in place of a command like gcc or clang++). Or mpicxx often includes an option called "showme" that will show you the best compiler flags to use:

mpicxx --showme

Best regards,
Miles

Welcome to ITensor Support Q&A, where you can ask questions and receive answers from other members of the community.

Formatting Tips:
  • To format code, indent by four spaces
  • To format inline LaTeX, surround it by @@ on both sides
  • To format LaTeX on its own line, surround it by $$ above and below
  • For LaTeX, it may be necessary to backslash-escape underscore characters to obtain proper formatting. So for example writing \sum\_i to represent a sum over i.
If you cannot register due to firewall issues (e.g. you cannot see the capcha box) please email Miles Stoudenmire to ask for an account.

To report ITensor bugs, please use the issue tracker.

Categories

...