+1 vote
asked by (650 points)

I have a technique problem: the itensor can automatically parallelize (multiple CPU cores are occupied) in one of my machine (call A), while in another machine (call B), it doesn't (one CPU core is occupied). To configuration of A, B are listed as follows

A: Ubuntu 16.04, with g++, lapack, BLAS, MKL installed

B: CentOS, with g++, lapack installed

Is there anything being missed in machine B ? Thank you

1 Answer

0 votes
answered by (70.1k points)

Hi Junjie,
Each BLAS implementation uses its own internal rules about when and how to parallelize things. So presumably each one looks at the resources available on the computer and the size of the matrices and then launches some number of threads. So I'll have to refer you to the documentation of the BLAS/Lapack distribution on your machine B to know why it's not parallelizing.

But often you can provide an environment variable to control, somewhat, the parallelism. For example, many of the BLAS implementations recognize the OMPNUMTHREADS environment variable. So, for example, if you set it to 1 then you will forbid multicore parallelization by your BLAS, or you can set it higher to see what gives the best results.

My experience has been that MKL in particular is pretty smart about parallelizing and that it does so even without any environment variables set.

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.