Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
kb:parallel [2017/12/11 14:06] – [Is the whole model run in parallel?] enviadminkb:parallel [2021/04/21 09:38] (current) – [Practical Issues] enviadmin
Line 3: Line 3:
 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. 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. +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.
  
-Soplease read the following sections carefully to get most of the new options of ENVI-met.+Many people have a concept what parallel computing isand 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.
  
-===== Basics ===== 
  
-==== What does Parallel Computing mean? ==== +====== Q&A on Parallel Computing with ENVI-met  ====== 
-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 Xenon processors. On servers or High-Capacity Systems, even hundreds of cores may be available.+ 
 +Please read the following sections carefully to get most of the new options of ENVI-met. 
 + 
 +~~QNA~~ 
 + 
 + 
 +=?===Basic Questions===== 
 + 
 +??? What does Parallel Computing mean? 
 +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. 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.
  
-==== Is the whole model run in parallel? ====+??? Is the whole model run in parallel? 
 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. 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.  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. 
Line 20: Line 28:
 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. 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.
  
-==== Is parallel computing always faster (than sequential computing) ? ====+??? Is parallel computing always faster (than sequential computing) ? 
 No. No.
  
Line 31: Line 39:
 Parallel computing is at its best if the packages send are large and the tasks included are heavy like in large ENVI-met models. Parallel computing is at its best if the packages send are large and the tasks included are heavy like in large ENVI-met models.
  
-===== Practical Issues=====+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. 
  
-==== I used to run several ENVI-met models in parallel. Do I have to modify some settings? ====+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.  
 + 
 + 
 +??? Can I run ENVI-met on any Supercomputer ? 
 +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===== 
 + 
 +??? I used to run several ENVI-met models in parallel. Do I have to modify some settings? 
  
 Yes. Yes.
Line 48: Line 69:
 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).  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 serveral ENVI-mets at the same time.+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. 
 + 
 + 
 +??? When I run the model, my CPU does not reach 100% usage although I told ENVI-met to use all cores 
 + 
 +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. 
 + 
 +??? I assigned only one core to ENVI-met, but still all cores are actually used when I look at the task manager 
 + 
 +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. 
 + 
 +??? I started an ENVI-met without any specific CPU usage instructions. How many CPUs cores will it use? 
 + 
 +The default setting is to use all available CPU cores, that are assigned by the operating system. How many cores this will actually be in the end, will not only depend on your computer, but also on the amount of other applications running parallel to ENVI-met. Also, the amount of cores is assigned dynamically by WINDOWS and is also requested dynamically by ENVI-met depending on the specific simulation task. In other words: If ENVI-met is operating in a model section that is not parallel, it will not request more than one core. 
 + 
 + 
  
 +===== References =====
 +  - Toub, Stephen (2010): Patterns of parallel programming, Microsoft Corp., available online: [[https://www.microsoft.com/en-us/download/details.aspx?id=19222|Patterns of parallel programming]]