VivaMP - a tool for OpenMPAuthor: Evgeniy RyzhkovDate: 20.11.2009At present, Viva64 and VivaMP software products are included in PVS-Studio as parts of it and are nolonger distributed as separate applications. Please use PVS-Studio program to obtain the necessarypossibilities of code verification.AbstractThe tool for programmers VivaMP is intended for helping OpenMP-based parallel software developers.The article gives a brief description of the program product.OpenMP parallel programming technology: advantages anddisadvantagesThe modern processor (whether in a desktop or in a laptop) has several cores. Most often there are twocores and more rarely three or four. But very soon even eight cores in a usual desktop computer will bea common thing. Thats why the most progressive software developers start thinking right now how tomake their programs parallel. That is how to load all the available processors cores. And although itwould be an absolutely correct solution to develop a new parallel version of the program product, it isactually the existing sequential version that is usually "parallelized". There are many different parallelprogramming technologies but we are interested first of all in OpenMP technology as the mostpromising for systems with common memory, that is the most promising for paralleling programsintended for desktop computers. It allows you to make the existing program parallel by rewriting itsseparate sections. All this seems (and actually is) very attractive to developers but here we face aproblem. Support of OpenMP technology is implemented in existing developing means so that it is veryeasy to make errors which are not diagnosed . Because of this developing OpenMP-solutionsbecomes even more complicated.A tool for supporting OpenMP-solution developersTo make the process of developing OpenMP-solutions less complicated OOO "Program VerificationSystems" creating program products in the sphere of code analysis has developed the program productVivaMP (http://www.viva64.com/vivamp-tool/).VivaMP is a C/C++ code analyzer intended for searching errors in existing OpenMP-programs and forsimplifying the process of developing new OpenMP-programs. If there are errors in a parallel programwhich cannot be diagnosed by the compiler VivaMP will find them. After that the developer can easilycorrect these errors using the Help system embedded into VivaMP.Technically, VivaMP tool is implemented as an add-in module (AddIn) for Visual Studio 2005/2008(figure 1).
Figure 1 - VivaMP tool is embedded into Microsoft Visual Studio 2005/2008 environmentAfter testing a separate file, project or whole solution the analyzer prints the list of potential errors thedeveloper should look through into Error List. You can get information on each error in the Help systemintegrating into MSDN.VivaMP tool allows you to: • find old errors in existing OpenMP-solutions; • detect errors in new OpenMP-solutions being developed; • get information on correcting errors in the Help system; • increase performance of OpenMP-based solutions;
• investigate most of the possible errors in OpenMP-solutions using both the documentation and the demo-program ParallelSample attached to the VivaMP distribution kit.The stated ways of using VivaMP make this tool useful both for first-time OpenMP-programmers andtheir more experienced colleagues.Advantages of static analysis over other methods of searching parallelerrorsVivaMP tool is a static code analyzer. This means that unlike dynamic analyzers it doesnt requirelaunching the program being tested to detect errors, and the result of the static analyzers work doesntdepend on the execution environment. Static analysis allows you to test the code which receives controlrarely or which is executed when processing rare errors.Verification of parallel programs with the help of static analysis method is considered to be difficult andineffective as it is impossible to detect errors occurring when different program parts interact. But incase of OpenMP technology you can effectively use static analysis. It is because of OpenMP technologys"local" character. As a rule, parallel code in programs is gathered in one place and this helps performdetailed static analysis for detecting errors. To learn more about this subject see the article "Testingparallel programs" .ConclusionIf you develop parallel programs using OpenMP technology you need to get acquainted with VivaMPtool (http://www.viva64.com/vivamp-tool/). It will help you make development of OpenMP-solutionsmuch simpler and quicker.References 1. Alexey Kolosov, Evgeniy Ryzhkov, Andrey Karpov. 32 OpenMP Traps For C++ Developers. http://www.viva64.com/art-3-2-1023467288.html 2. Andrey Karpov. Testing parallel programs. http://www.viva64.com/art-3-2-548461019.html