A holistic microclimate model

Parallel Computing in ENVI-met

Starting with Version 4.3, ENVI-met allows parallel computing on several CPU cores in the full versions (BUSINESS/SCIENCE). The BASIC and STUDENT editions do not support parallel computing.

Parallel computing is a wonderful option to reach never observed calculation speeds, but it is also a source of pitfalls and misunderstandings. According to Stephen Toub from Microsoft [1], there are even pitfalls for pitfalls.

Many people have a concept what parallel computing is, and they want to have it in their applications, but as this is a relatively new area of computing, it contains many misunderstandings and misleading expectations we try to clarify in this Knowledge Base.

Changed Pressure Solver

With the introduction of Parallel Computing, it was neccessary to rewrite the pressure-solver used to obtain the wind field.

However, it can be noted, that the new parallel solver produces slightly different results compared to the old, sequential solver. If you want to keep the old solver for compatibility reasons, please add the following lines in your .SIM files:

[SORMODE]

SOR solver (0: classic, 1:parallel)= 0

This will be more clearer in the next release of ENVI-met.

Q&A on Parallel Computing with ENVI-met

Basic Questions

The speed of the computer CPU will most likely not increase in the near future as the 4 GHz imposes a physical boundary on conventional computer chips. In contrast, the number of CPU cores or virtual cores is increasing constantly, like the 16/32 cores now available for desktop computers with the AMD ThreadRipper or the 20/40 cores INTEL i-10 processors. On servers or High-Capacity Systems, even hundreds of cores may be available.

ENVI-met now offers the option to distribute parts of the calculation routines over several CPUs resulting in the option of a much higher computation speed.

No. Because running in parallel means, that you pack a computation task “package”, send it to the CPU core, let it be calculated and then get it back. In other words, the calculation of this package is (MUST) be independent of the tasks of other packages calculated at the same time. If you send out 200 packages, you will never know in which order and when they will actually be finished. A microclimate model like ENVI-met is based on the interactions between the different variables and elements. These interactions cannot be solved in parallel because the conditions of one element highly depend on the state of the other elements. So, after a number of parallel calculations, ENVI-met needs to gather and analyse the results and update all variables and processes before a new round of parallel computing can begin.

Some modules cannot be executed in parallel at all because they highly depend on interactions between different elements. This is why most of the time, ENVI-met cannot use 100% of your CPU.

No.

As outlined in the paragraph, parallel computing can be seen as packing calculation task “packages”, sending them to a CPU core and, once they are finished, getting them back and copying the results back to the main computer memory.

This process generates an significant overhead to the computing process which is not required when running ENVI-met in single core mode, because in single core mode, only one CPU core is working on the data and no copying and package sending is required.

If you run small models, say 50x50x20 grids, the overhead of package packing may consume all the benefits of the parallel computing. Moreover, it may be slower compared to a sequential single-core calculation.

Parallel computing is at its best if the packages send are large and the tasks included are heavy like in large ENVI-met models.

Imagine yourself going shopping with 5 friends in a supermarket. You (the main task) will be responsible for distributing the tasks (“Get a package of milk”) over your friends. You will assign the tasks, collect the items returned, delete them from your shopping list and assign new tasks to the waiting friends.

If the tasks are very easy, because the supermarket is small and well organized and the items are easy to find, your friends will be back with the assigned items very quickly and you will be very busy with your (non-parallel) coordination tasks.

In fact, you may find out that it would be actually faster to do the shopping on your own and process one item after the other on the list.

The larger the supermarket gets and the more complicated the items are to find (large models, complex calculation tasks), the more you benefit from the help of your friends. Ideally, they all require the same amount of time to fetch the items and come back to you in one block. That's the situation when parallel work will be most efficient.

Yes, if the Supercomputer runs under or supports WINDOWS. If the operating system is LINUX or other, you cannot run ENVI-met as there is no LINUX version so far.

Practical Issues

Yes. In older ENVI-met versions, each ENVI-met simulation did use ONE core, or better, the computation equivalent to one core.

Now, in the full version, by default, each simulations uses ALL available cores installed in the computer. So, if you have e.g. 8 cores in your computer, by default, each simulation will try to acquire 8 cores.

If you now start another simulation with the same settings on the same PC, the new simulation will try the same.

As a consequence, both simulations will struggle for computer resources and the execution time will be very inefficient due to this competition.

If you plan to run more than one simulation on the same computer, you should select modified Parallel Computing options in the ProjectWizard such as “HALF” (running 2 simulations) or “QUAD” (4 simulations).

You may also decide to turn of parallel computing in general (set 1 Core), because you already perform a kind of parallel computing when executing several ENVI-mets at the same time.

This questions relates, at least in parts, to the question Is the whole model run in parallel? . As described there, not all parts of ENVI-met can be run in parallel, so there is always a significant non-parallel amount of computation running on a single core.

Moreover, and this relates to the question Is parallel computing always faster (than sequential computing) ? each execution of a parallel processes requires some overhead in the main process, before the parallel task is launched. This work can also only be done non-parallel.

Also, if you simulate on a server, one user will probably not be allowed to use 100% of the CPU power as i would freeze the server.

Well, assigning one core is an over-simplification of the whole process. What it actually means is, that ENVI-met will request computing power equivalent to the computing resources of one CPU core (that is 25 tasks per CPU core). Under WINDOWS (and any other modern OS), an application does not consist only of ONE thread, even if it is “single threaded”. It is listening to messages, is corresponds with the WINDOWS system, it paints the screen output etc etc.

So, normally all the computing power demanded by an application is distributed in threads over all available CPU cores. So, setting ENVI-met to use e.g. 1 core still will cause all CPU cores to be involved in the processes unless you set up very specific settings on your computer.

References

  1. Toub, Stephen (2010): Patterns of parallel programming, Microsoft Corp., available online: Patterns of parallel programming
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information