likwid-4.3.1/000077500000000000000000000000001322364552400130105ustar00rootroot00000000000000likwid-4.3.1/.gitattributes000066400000000000000000000000311322364552400156750ustar00rootroot00000000000000make/config_git.mk ident likwid-4.3.1/.travis.yml000066400000000000000000000005651322364552400151270ustar00rootroot00000000000000language: c compiler: gcc install: true dist: trusty sudo: required script: - make && sudo make install - /usr/local/bin/likwid-topology -c -C -g - /usr/local/bin/likwid-pin -p - sudo modprobe msr - ls -la /dev/cpu/* - ls -la /usr/local/sbin/* - make -C test streamGCC - /usr/local/bin/likwid-perfctr -i - /usr/local/bin/likwid-bench -t copy -w N:100MB:2 likwid-4.3.1/CHANGELOG000066400000000000000000000131201322364552400142170ustar00rootroot00000000000000# Changelog 4.3.1 - Fix for setting/getting turbo mode in frequency module - Exchanged two events in perf. groups of Intel Skylake X # Changelog 4.3.0 - Support for Intel Skylake SP architecture (core, uncore, energy) - Support for AMD Zen architecture (core, l2, energy) - Pinning strategy 'balanced' # Changelog 4.2.1 - Fix for logical selection strings - likwid-agent: general update - likwid-mpirun: Improved SLURM support - likwid-mpirun: Print metrics sorted as they are listen in perf. group - likwid-perfctr: Print metrics/events as header in timeline mode - likwid-setFrequency: Commandline options to set min, max and current frequency - Pinning-Library: Automatically detect and skip shepard threads - Intel Broadwell: Added support for E3 (like Desktop), Fix for L3 group - Intel IvyBridge: Fix for PCU fixed-purpose counters - Intel Skylake: Fix for events CYCLE_ACTIVITY, new event L2_LINES_OUT - Intel Xeon Phi (KNL): Fix for overflow register, Update for ENERGY group - Intel SandyBridge: Fix for L3CACHE group - Event/Counter list contains only usable counters and events # Changelog 4.2.0 - Support for Intel Xeon Phi (Knights Landing): Core, Uncore, RAPL - Support for Uncore counters of some desktop chips (SandyBridge, IvyBridge, Haswell, Broadwell and Skylake) - Basic support for Linux perf_event interface instead of native access. Currently only core-local counters working, Uncore is experimental - Support to build against a existing Lua installation (5.1 - 5.3 tested) - Support for CPU frequency manipulation, Lua interface updated - Access module checks for LLNL's msr_safe kernel module - Support for counter registers that are only available when HyperThreading is off - Fix for non-HyperThreading counters (PMC4-7) on Intel Broadwell - Socket measurements can be used for all cores on the socket in metric formulas. - likwid-perfctr: Timeline mode without executable runs until user presses Ctrl+c - likwid-perfctr: New CYCLE_ACTIVITY groups - likwid-perfctr: New PORT_USAGE groups (only with deactivated HyperThreading) - likwid-perfctr: Regions are sorted in output as they are executed by the code - likwid-powermeter: Read Uncore frequency settings and performance energy bias - likwid-powermeter: Update of energy unit for DRAM domain for Intel Broadwell D/EP and Intel Xeon Phi (Knights Landing) - likwid-bench: Fix for 'cycles per update' metric - likwid-bench: Vector lengths are sanitized for thread count and loop stride - likwid-topology: Increase robustness - likwid-mpirun: Some fixes # Changelog 4.1.2 - Fix for likwid-powermeter: Use proper energy unit - Fix for performance groups for Intel Broadwell (D/EP): DATA and FALSE_SHARE - Reduce number of started access daemons - Clean Uncore unit local control registers (needed for simultaneous use of LIKWID 3 and 4) - Clean config, filter and counter registers at *_finalize function - Fix for likwid-features and likwid-perfctr # Changelog 4.1.1 - Fix for Uncore handling for EP/EN/EX systems - Minor fix for Uncore handling for Intel desktop systems - Fix in generic readCounters function - Support for Intel Goldmont (untested) - Fixes for likwid-mpirun # Changelog 4.1.0 - Support for Intel Skylake (Core + Uncore) - Support for Intel Broadwell (Core + Uncore) - Support for Intel Broadwell D (Core + Uncore) - Support for Intel Broadwell EP/EN/EX (Core + Uncore) - Support for Intel Airmont (Core) - Uncore support for Intel SandyBridge, IvyBridge and Haswell - Performance group and event set handling in library - Internal calculator for derived metrics - Improvement of Marker API - Get results/metrics of last measurement cycle - Fixed most memory leaks - Respect 'Intel PMU sharing guide' - Update of internal Lua to 5.3 - More examples (C++11 threads,Cilk+, TBB) - Test suite for executables and library - Accuracy checker supports multiple CPUs - Security checked access daemon - Likwid-bench supports Integer benchmarks - Likwid-bench selects interation count automatically - Likwid-bench has new FMA related benchmarks - Likwid-mpirun supports SLURM job scheduler - New tool likwid-features # Changelog 4.0.1 - likwid-bench: Iteration determination is done serially - likwid-bench: Manual selection of iterations possible - likwid-perfctr: Set cpuset to all CPUs not only the first - likwid-pin: Set cpuset to all CPUs not only the first - likwid-accuracy.py: Enhanced plotting functions, use only instrumented likwid-bench - likwid-accessD: Check for allowed register for PCI accesses - Add models HASWELL_M1 (0x45) and HASWELL_M2 (0x46) to likwid-powermeter and likwid-accessD - New test application using Cilk and Marker API - New test application using C++11 threads and Marker API - likwid-agent: gmetric version check for --group option and s/\s*/_/ in metric names - likwid-powermeter: Print RAPL domain name - Marker API: Initialize access already at likwid_markerInit() - Marker API: likwid_markerThreadInit() only pins if not already pinned # Changelog 4.0.0 - Support for Intel Broadwell - Uncore support for all Uncore-aware architectures - Nehalem (EX) - Westmere (EX) - SandyBridge EP - IvyBridge EP - Haswell EP - Measure multiple event sets in a round-robin fashion (no multiplexing!) - Event options to filter the counter increments - Whole LIKWID functionality is exposed as API for C/C++ and Lua - New functions in the Marker API to switch event sets and get intermediate results - Topology code relies on hwloc. CPUID is still included but only as fallback - Most LIKWID applications are written in Lua (only exception likwid-bench) - Monitoring daemon likwid-agent with multiple output backends - More performance groups likwid-4.3.1/COPYING000066400000000000000000000773311322364552400140560ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS likwid-4.3.1/INSTALL000066400000000000000000000201601322364552400140400ustar00rootroot00000000000000== Basic build == 1. Edit config.mk. Follow the comments there. Optionally you can change compiler settings in include_[GCC|CLANG|ICC|MIC].mk. Please note that only the default compiler flags GCC are supported and tested. For 32 bit builds the only supported compiler setting is GCCX86. 2. make (Builds hwloc, lua, Likwid libraries, access daemons and likwid-bench) 3. make install (this is required for likwid-pin and if you use the accessDaemon) Only the default flags set are tested. As it is not possible to test all compiler setting variants the Intel icc compiler and Clang is only build tested. A basic function test is done for the icc binary. The only variant fully tested is gcc with default compiler flags. It is therefore recommended to use gcc with the default flags. If you want to use and build the Fortran interface you can mix GCC with the Intel Fortran Compiler (default setup). You can change the Fortran compiler in make/include_[GCC|CLANG|ICC|MIC].mk. *NOTICE* All generated files are located in the [GCC|ICC|CLANG|MIC|GCCX86] build directory. This includes the dependency files, object files. The generated source files and the pas and assembly files for likwid-bench are build in bench/[GCC|ICC|CLANG|MIC|GCCX86]. If you debug your likwid-bench benchmarks you can look at all intermediate build files and also the final assembly code. == Build on Xeon Phi (Knights Corner) == This section is _only_ for Knights Corner, for Knights Landing use default installation method! For builds for the Xeon Phi (Knights Corner) coprocessor, the accessDaemon and the frequency daemon are disabled. Moreover, the access mode is set to 'direct'. This was made because it is important to run as few processes as possible on the Xeon Phi and the accessDaemon would start one process per hardware thread. In order to build Likwid for the Xeon Phi processor, you have to change the RPATHS variable in make/include_MIC.mk to point to the folder with the Intel libraries like libimf.so. This is crucial because when using an suid-root executable, the LD_LIBRARY_PATH gets lost but Likwid still needs to know where the Intel libraries reside. After installation change the owner of likwid-lua to root and set the suid-root bit for likwid-lua: chown root /likwid-lua chmod u+s /likwid-lua Afterwards Likwid can be used as anywhere else. == Known problems == On very old systems with old kernels (< 2.6.7) or old glibc versions likwid is build with reduced funtionality. This includes missing support for NUMA and pinning. likwid-setFrequencies can only be used if the acpi_cpufreq module is loaded. It is not possible to fix the frequency with the intel_pstate module. == Additional Targets == make clean - clean the object directory make distclean - clean also the executables/libraries make uninstall - delete installed files make docs - generate html documentation using doxygen make local - set paths in Lua files to work from current directory (for testing only! Uses already installed access daemons and libraries. Often you have to set the LD_LIBRARY_PATH to the contain the current folder) == Dependencies == Most parts of the Likwid suite do not have external dependencies that need to be installed before you can build Likwid. If external libraries are used, they are shipped with Likwid. Included dependencies: - hwloc - Lua - Perl Template toolkit Build dependencies: - C compiler (commonly gcc, but clang and icc are also possible) - make - Perl Runtime dependencies for likwid-perfscope: - gnuplot Runtime dependencies for likwid-agent (if enabled in configfile): - gmetric (Output to Ganglia Monitoring System) - rrdtool (Output to RRDs) - logger (Output to syslog) For the HTML documentation you further need doxygen. == Build accessDaemon == Change path for the accessDaemon: 1. Edit config.mk and configure path in ACCESSDAEMON variable. You can overwrite it later in likwid.cfg 2. Set the desired default ACCESSMODE. You can overwrite this on the command line or likwid.cfg. 2. make will also build the accessDaemon 3. Install with (sudo) make install With the standard make install target the daemon will also be installed in to the path in $ACCESSDAEMON. It also sets the user to root and the suid bit. == Setup of msr module == likwid-perfctr, likwid-powermeter, likwid-agent, require the Linux msr kernel module. This module is part of most standard distro kernels. You have to be root to do the initial setup. 1. Check if the msr module is loaded with 'lsmod | grep msr'. There should be an output. 2. If the module is not loaded, load it with 'modprobe msr'. For automatic loading at startup consult your distros documentation how to do so, commonly by adding 'msr' to /etc/modules. 3. Adopt access rights on the msr device files for normal user. To allow everybody access you can use 'chmod o+rw /dev/cpu/*/msr'. This is only recommended on save single user desktop systems and might be not enough to grant access to anybody because of POSIX capabilites or other security features of your distro. As a general access to the msr registers is not desired on security sensitive systems, you can either implement a more sophisticated access rights settings with e.g. setgid. A common solution used on many other device files, e.g. for audio, is to introduce a group and make a chown on the msr device files to that group or use dbus rules. Now if you execute likwid-perfctr with setgid on that group the executing user can use the tool but cannot directly write or read the msr device files. A secure solution is to use the accessDaemon, which encapsulates the access to the msr device files and performs an address check for allowed registers. For more information how to setup look at the HTML documentation. A demo for a root exploit involving the msr device files was published. As a consequence the security settings for access to the msr device files are tightened in recent kernels. The exploit used a specify register to alter the entry point for the current process to a malware. The daemon grants access only to hardware performance counter related registers. Just setting the file access rights or using suid root on the access daemon is not sufficient anymore for some distros. You have to register your binary at the libcap now to get access. This is only necessary if above setup does not work. You register the necessary capability by calling sudo setcap cap_sys_rawio+ep EXECUTABLE on the executables. Not all file systems support capabilities. The only feasable way is to register the likwid-accessD and proxy all access over it. If you have still problems please let me know on the likwid mailing list: http://groups.google.com/group/likwid-users == Building LIKWID with perf_event kernel backend == When setting USE_PERF_EVENT in config.mk, the perf_event kernel interface is used to programm the counters instead of the way through the msr kernel module and PCI devices. The event and counter lists are the same. The perf_event interface handles the counter allocation itself, thus the counters provided to LIKWID might not be the ones perf_event uses internally. The support is tested for the core-local fixed- and general-purpose counters. The paranoid setting requires to be 1 or less. It is also able to use it for Uncore counters but the support is experimental and requires a paranoid setting of 0 or less. Currently no counter options are supported. paranoid setting: /proc/sys/kernel/perf_event_paranoid == Linking applications with LIKWID lib == Commonly the LIKWID C library can be used as all other libraries by setting the include (-I) and library path (-L) and add -llikwid to the command line. ==== Internal hwloc library ==== The included hwloc library shouldn't make a problem as all hwloc functions are prefixed with 'likwid_'. ==== Internal Lua library and interpreter ==== The included Lua libray might cause problems because the functions are not renamed and might interfere with the other Lua library functions. Maybe it works if the versions of Lua are the same (5.3.2). The Lua interpreter is renamed at installation to likwid-lua, so does not overwrite other interpreters. likwid-4.3.1/Makefile000066400000000000000000000702161322364552400144560ustar00rootroot00000000000000# ======================================================================================= # # Filename: Makefile # # Description: Central Makefile # # Version: 4.3.1 # Released: 04.01.2018 # # Author: Jan Treibig (jt), jan.treibig@gmail.com # Project: likwid # # Copyright (C) 2018 RRZE, University Erlangen-Nuremberg # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program. If not, see . # # ======================================================================================= SRC_DIR = ./src DOC_DIR = ./doc GROUP_DIR = ./groups FILTER_DIR = ./filters MAKE_DIR = ./make Q ?= @ #DO NOT EDIT BELOW # Dependency chains: # *.[ch] -> *.o -> executables # *.ptt -> *.pas -> *.s -> *.o -> executables # *.txt -> *.h (generated) include ./config.mk include $(MAKE_DIR)/include_$(COMPILER).mk include $(MAKE_DIR)/config_git.mk include $(MAKE_DIR)/config_checks.mk include $(MAKE_DIR)/config_defines.mk INCLUDES += -I./src/includes -I$(LUA_INCLUDE_DIR) -I$(HWLOC_FOLDER)/include -I$(BUILD_DIR) LIBS += -ldl ifeq ($(LUA_INTERNAL),false) LIBS += -l$(LUA_LIB_NAME) endif #CONFIGURE BUILD SYSTEM BUILD_DIR = ./$(COMPILER) Q ?= @ GENGROUPLOCK = .gengroup VPATH = $(SRC_DIR) OBJ = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.c)) OBJ += $(patsubst $(SRC_DIR)/%.cc, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.cc)) OBJ += $(patsubst $(SRC_DIR)/%.S, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.S)) ifeq ($(FILTER_HWLOC_OBJ),yes) OBJ := $(filter-out $(BUILD_DIR)/topology_hwloc.o,$(OBJ)) OBJ := $(filter-out $(BUILD_DIR)/numa_hwloc.o,$(OBJ)) OBJ := $(filter-out $(BUILD_DIR)/pci_hwloc.o,$(OBJ)) endif ifneq ($(FORTRAN_INTERFACE),true) OBJ := $(filter-out $(BUILD_DIR)/likwid_f90_interface.o,$(OBJ)) endif PERFMONHEADERS = $(patsubst $(SRC_DIR)/includes/%.txt, $(BUILD_DIR)/%.h,$(wildcard $(SRC_DIR)/includes/*.txt)) OBJ_LUA = $(wildcard ./ext/lua/$(COMPILER)/*.o) OBJ_HWLOC = $(wildcard ./ext/hwloc/$(COMPILER)/*.o) FILTERS := $(filter-out ./filters/README,$(wildcard ./filters/*)) L_APPS = likwid-perfctr \ likwid-pin \ likwid-powermeter \ likwid-topology \ likwid-memsweeper \ likwid-mpirun \ likwid-features \ likwid-perfscope \ likwid-genTopoCfg C_APPS = bench/likwid-bench L_HELPER = likwid.lua ifeq ($(BUILDFREQ),true) L_APPS += likwid-setFrequencies endif CPPFLAGS := $(CPPFLAGS) $(DEFINES) $(INCLUDES) all: $(BUILD_DIR) $(PERFMONHEADERS) $(OBJ) $(TARGET_LIB) $(FORTRAN_IF) $(PINLIB) $(L_APPS) $(L_HELPER) $(DAEMON_TARGET) $(FREQ_TARGET) $(BENCH_TARGET) tags: @echo "===> GENERATE TAGS" $(Q)ctags -R docs: @echo "===> GENERATE DOXYGEN DOCS" @cp doc/lua-doxygen.md doc/lua-doxygen.md.safe @cp doc/likwid-doxygen.md doc/likwid-doxygen.md.safe @sed -i -e s+''+$(PREFIX)+g -e s+''+$(VERSION)+g -e s+''+'$(DATE)'+g -e s+''+$(RELEASE)+g -e s+''+$(MINOR)+g -e s+''+$(GITCOMMIT)+g doc/lua-doxygen.md @sed -i -e s+''+$(PREFIX)+g -e s+''+$(VERSION)+g -e s+''+'$(DATE)'+g -e s+''+$(RELEASE)+g -e s+''+$(MINOR)+g -e s+''+$(GITCOMMIT)+g doc/likwid-doxygen.md $(Q)doxygen doc/Doxyfile @mv doc/lua-doxygen.md.safe doc/lua-doxygen.md @mv doc/likwid-doxygen.md.safe doc/likwid-doxygen.md $(L_APPS): $(addprefix $(SRC_DIR)/applications/,$(addsuffix .lua,$(L_APPS))) @echo "===> ADJUSTING $@" @if [ "$(ACCESSMODE)" = "direct" ]; then sed -i -e s/"access_mode = 1"/"access_mode = 0"/g $(SRC_DIR)/applications/$@.lua;fi @sed -e s/''/$(subst /,\\/,$(INSTALLED_BINPREFIX))/g \ -e s/''/$(subst /,\\/,$(INSTALLED_PREFIX))/g \ -e s/''/$(VERSION).$(RELEASE).$(MINOR)/g \ -e s/''/$(DATE)/g \ -e s/''/$(RELEASE)/g \ -e s/''/$(MINOR)/g \ -e s/''/$(GITCOMMIT)/g \ $(addprefix $(SRC_DIR)/applications/,$(addsuffix .lua,$@)) > $@ @if [ "$(LUA_INTERNAL)" = "false" ]; then \ sed -i -e s+"$(subst /,\\/,$(INSTALLED_BINPREFIX))/likwid-lua"+"$(LUA_BIN)/$(LUA_LIB_NAME)"+ $@; \ fi @if [ "$(ACCESSMODE)" = "direct" ]; then sed -i -e s/"access_mode = 0"/"access_mode = 1"/g $(SRC_DIR)/applications/$@.lua;fi $(L_HELPER): @echo "===> ADJUSTING $@" @sed -e s/''/$(subst /,\\/,$(PREFIX))/g \ -e s/''/$(subst /,\\/,$(INSTALLED_LIBPREFIX))/g \ -e s/''/$(subst /,\\/,$(INSTALLED_PREFIX))/g \ -e s/''/$(subst /,\\/,$(LIKWIDGROUPPATH))/g \ -e s/''/$(subst /,\\/,$(LIBLIKWIDPIN))/g \ -e s/''/$(VERSION)/g \ -e s/''/$(RELEASE)/g \ -e s/''/$(MINOR)/g \ -e s/''/$(GITCOMMIT)/g \ $(SRC_DIR)/applications/$@ > $@ $(STATIC_TARGET_LIB): $(BUILD_DIR) $(PERFMONHEADERS) $(OBJ) $(TARGET_HWLOC_LIB) $(TARGET_LUA_LIB) @echo "===> CREATE STATIC LIB $(TARGET_LIB)" $(Q)${AR} -crus $(STATIC_TARGET_LIB) $(OBJ) $(TARGET_HWLOC_LIB) $(TARGET_LUA_LIB) $(DYNAMIC_TARGET_LIB): $(BUILD_DIR) $(PERFMONHEADERS) $(OBJ) $(TARGET_HWLOC_LIB) $(TARGET_LUA_LIB) @echo "===> CREATE SHARED LIB $(TARGET_LIB)" $(Q)${CC} $(DEBUG_FLAGS) $(SHARED_LFLAGS) -Wl,-soname,$(TARGET_LIB).$(VERSION).$(RELEASE) $(SHARED_CFLAGS) -o $(DYNAMIC_TARGET_LIB) $(OBJ) $(LIBS) $(TARGET_HWLOC_LIB) $(TARGET_LUA_LIB) $(RPATHS) @ln -sf $(TARGET_LIB) $(TARGET_LIB).$(VERSION).$(RELEASE) @sed -e s+'@PREFIX@'+$(PREFIX)+g make/likwid-config.cmake > likwid-config.cmake $(DAEMON_TARGET): $(SRC_DIR)/access-daemon/accessDaemon.c @echo "===> BUILD access daemon likwid-accessD" $(Q)$(MAKE) -C $(SRC_DIR)/access-daemon likwid-accessD $(FREQ_TARGET): $(SRC_DIR)/access-daemon/setFreq.c @echo "===> BUILD frequency daemon likwid-setFreq" $(Q)$(MAKE) -C $(SRC_DIR)/access-daemon likwid-setFreq $(BUILD_DIR): @mkdir $(BUILD_DIR) $(PINLIB): @echo "===> CREATE LIB $(PINLIB)" $(Q)$(MAKE) -C src/pthread-overload/ $(PINLIB) @ln -sf $(PINLIB) $(PINLIB).$(VERSION).$(RELEASE) $(GENGROUPLOCK): $(foreach directory,$(shell ls $(GROUP_DIR)), $(wildcard $(GROUP_DIR)/$(directory)/*.txt)) @echo "===> GENERATE GROUP HEADERS" $(Q)$(GEN_GROUPS) ./groups $(BUILD_DIR) ./perl/templates $(Q)touch $(GENGROUPLOCK) $(FORTRAN_IF): $(SRC_DIR)/likwid.f90 @echo "===> COMPILE FORTRAN INTERFACE $@" $(Q)$(FC) -c $(FCFLAGS) $< @rm -f likwid.o ifeq ($(LUA_INTERNAL),true) $(TARGET_LUA_LIB): @echo "===> ENTER $(LUA_FOLDER)" $(Q)$(MAKE) --no-print-directory -C $(LUA_FOLDER) $(MAKECMDGOALS) @ln -sf $(LUA_FOLDER)/liblikwid-lua.so liblikwid-lua.so.$(VERSION).$(RELEASE) else $(TARGET_LUA_LIB): @echo "===> EXTERNAL LUA" endif $(TARGET_HWLOC_LIB): @echo "===> ENTER $(HWLOC_FOLDER)" $(Q)$(MAKE) --no-print-directory -C $(HWLOC_FOLDER) $(MAKECMDGOALS) @ln -sf $(HWLOC_FOLDER)/liblikwid-hwloc.so liblikwid-hwloc.so.$(VERSION).$(RELEASE) $(BENCH_TARGET): @echo "===> ENTER $(BENCH_FOLDER)" $(Q)$(MAKE) --no-print-directory -C $(BENCH_FOLDER) $(MAKECMDGOALS) #PATTERN RULES $(BUILD_DIR)/%.o: %.c @echo "===> COMPILE $@" $(Q)$(CC) -c $(DEBUG_FLAGS) $(CFLAGS) $(ANSI_CFLAGS) $(CPPFLAGS) $< -o $@ $(Q)$(CC) $(DEBUG_FLAGS) $(CPPFLAGS) -MT $(@:.d=.o) -MM $< > $(BUILD_DIR)/$*.d $(BUILD_DIR)/%.o: %.cc @echo "===> COMPILE $@" $(Q)$(CXX) -c $(DEBUG_FLAGS) $(CXXFLAGS) $(CPPFLAGS) $< -o $@ $(Q)$(CXX) $(DEBUG_FLAGS) $(CXXFLAGS) $(CPPFLAGS) -MT $(@:.d=.o) -MM $< > $(BUILD_DIR)/$*.d $(BUILD_DIR)/%.o: %.S @echo "===> COMPILE $@" $(Q)$(CPP) $(CPPFLAGS) $< -o $@.tmp $(Q)$(AS) $(ASFLAGS) $@.tmp -o $@ @rm $@.tmp $(BUILD_DIR)/%.h: $(SRC_DIR)/includes/%.txt @echo "===> GENERATE HEADER $@" $(Q)$(GEN_PMHEADER) $< $@ ifeq ($(findstring $(MAKECMDGOALS),clean),) -include $(OBJ:.o=.d) endif .PHONY: clean distclean install uninstall help $(TARGET_LUA_LIB) $(TARGET_HWLOC_LIB) $(BENCH_TARGET) .PRECIOUS: $(BUILD_DIR)/%.pas .NOTPARALLEL: clean: $(TARGET_LUA_LIB) $(TARGET_HWLOC_LIB) $(BENCH_TARGET) @echo "===> CLEAN" @for APP in $(L_APPS); do \ rm -f $$APP; \ done @rm -f likwid.lua @rm -f $(STATIC_TARGET_LIB) @rm -f $(DYNAMIC_TARGET_LIB) @rm -f $(PINLIB) @rm -f $(FORTRAN_IF_NAME) @rm -f $(FREQ_TARGET) $(DAEMON_TARGET) distclean: $(TARGET_LUA_LIB) $(TARGET_HWLOC_LIB) $(BENCH_TARGET) @echo "===> DIST CLEAN" @for APP in $(L_APPS); do \ rm -f $$APP; \ done @rm -f likwid.lua @rm -f $(STATIC_TARGET_LIB) @rm -f $(DYNAMIC_TARGET_LIB) @rm -f $(PINLIB) @rm -f $(FORTRAN_IF_NAME) @rm -f $(FREQ_TARGET) $(DAEMON_TARGET) @rm -rf $(BUILD_DIR) @rm -f $(GENGROUPLOCK) @rm -rf doc/html @rm -f tags ifeq ($(BUILDDAEMON),true) ifneq ($(COMPILER),MIC) install_daemon: @echo "===> INSTALL access daemon to $(ACCESSDAEMON)" @mkdir -p `dirname $(ACCESSDAEMON)` @install -m 4755 $(INSTALL_CHOWN) $(DAEMON_TARGET) $(ACCESSDAEMON) move_daemon: @echo "===> MOVE access daemon from $(ACCESSDAEMON) to $(INSTALLED_ACCESSDAEMON)" @mkdir -p `dirname $(INSTALLED_ACCESSDAEMON)` @install -m 4755 $(INSTALL_CHOWN) $(ACCESSDAEMON) $(INSTALLED_ACCESSDAEMON) uninstall_daemon: @echo "===> REMOVING access daemon from $(ACCESSDAEMON)" @rm -f $(ACCESSDAEMON) uninstall_daemon_moved: @echo "===> REMOVING access daemon from $(INSTALLED_ACCESSDAEMON)" @rm -f $(INSTALLED_ACCESSDAEMON) else install_daemon: @echo "===> No INSTALL of the access daemon" move_daemon: @echo "===> No MOVE of the access daemon" uninstall_daemon: @echo "===> No UNINSTALL of the access daemon" uninstall_daemon_moved: @echo "===> No UNINSTALL of the access daemon" endif else install_daemon: @echo "===> No INSTALL of the access daemon" move_daemon: @echo "===> No MOVE of the access daemon" uninstall_daemon: @echo "===> No UNINSTALL of the access daemon" uninstall_daemon_moved: @echo "===> No UNINSTALL of the access daemon" endif ifeq ($(BUILDFREQ),true) ifneq ($(COMPILER),MIC) install_freq: @echo "===> INSTALL setFrequencies tool to $(PREFIX)/sbin/$(FREQ_TARGET)" @mkdir -p $(PREFIX)/sbin @install -m 4755 $(INSTALL_CHOWN) $(FREQ_TARGET) $(PREFIX)/sbin/$(FREQ_TARGET) move_freq: @echo "===> MOVE setFrequencies tool from $(PREFIX)/sbin/$(FREQ_TARGET) to $(INSTALLED_PREFIX)/sbin/$(FREQ_TARGET)" @mkdir -p $(INSTALLED_PREFIX)/sbin @install -m 4755 $(INSTALL_CHOWN) $(PREFIX)/sbin/$(FREQ_TARGET) $(INSTALLED_PREFIX)/sbin/$(FREQ_TARGET) uninstall_freq: @echo "===> REMOVING setFrequencies tool from $(PREFIX)/sbin/$(FREQ_TARGET)" @rm -f $(PREFIX)/sbin/$(FREQ_TARGET) uninstall_freq_moved: @echo "===> REMOVING setFrequencies tool from $(INSTALLED_PREFIX)/sbin/$(FREQ_TARGET)" @rm -f $(INSTALLED_PREFIX)/sbin/$(FREQ_TARGET) else install_freq: @echo "===> No INSTALL of setFrequencies tool" move_freq: @echo "===> No MOVE of setFrequencies tool" uninstall_freq: @echo "===> No UNINSTALL of setFrequencies tool" uninstall_freq_moved: @echo "===> No UNINSTALL of setFrequencies tool" endif else install_freq: @echo "===> No INSTALL of setFrequencies tool" move_freq: @echo "===> No MOVE of setFrequencies tool" uninstall_freq: @echo "===> No UNINSTALL of setFrequencies tool" uninstall_freq_moved: @echo "===> No UNINSTALL of setFrequencies tool" endif install: install_daemon install_freq @echo "===> INSTALL applications to $(BINPREFIX)" @mkdir -p $(BINPREFIX) @chmod 755 $(BINPREFIX) @for APP in $(L_APPS); do \ install -m 755 $$APP $(BINPREFIX); \ done @for APP in $(C_APPS); do \ install -m 755 $$APP $(BINPREFIX); \ done @if [ "$(LUA_INTERNAL)" = "true" ]; then \ install -m 755 ext/lua/lua $(BINPREFIX)/$(LUA_LIB_NAME); \ fi @echo "===> INSTALL helper applications to $(BINPREFIX)" @install -m 755 perl/feedGnuplot $(BINPREFIX) @echo "===> INSTALL lua to likwid interface to $(PREFIX)/share/lua" @mkdir -p $(PREFIX)/share/lua @chmod 755 $(PREFIX)/share/lua @install -m 644 likwid.lua $(PREFIX)/share/lua @echo "===> INSTALL libraries to $(LIBPREFIX)" @mkdir -p $(LIBPREFIX) @chmod 755 $(LIBPREFIX) @install -m 755 $(TARGET_LIB) $(LIBPREFIX)/$(TARGET_LIB).$(VERSION).$(RELEASE) @install -m 755 liblikwidpin.so $(LIBPREFIX)/liblikwidpin.so.$(VERSION).$(RELEASE) @install -m 755 $(TARGET_HWLOC_LIB) $(LIBPREFIX)/$(shell basename $(TARGET_HWLOC_LIB)).$(VERSION).$(RELEASE) @if [ "$(LUA_INTERNAL)" = "true" ]; then \ install -m 755 $(TARGET_LUA_LIB) $(LIBPREFIX)/$(shell basename $(TARGET_LUA_LIB)).$(VERSION).$(RELEASE); \ fi @cd $(LIBPREFIX) && ln -fs $(TARGET_LIB).$(VERSION).$(RELEASE) $(TARGET_LIB) @cd $(LIBPREFIX) && ln -fs $(TARGET_LIB).$(VERSION).$(RELEASE) $(TARGET_LIB).$(VERSION) @cd $(LIBPREFIX) && ln -fs $(PINLIB).$(VERSION).$(RELEASE) $(PINLIB) @cd $(LIBPREFIX) && ln -fs $(PINLIB).$(VERSION).$(RELEASE) $(PINLIB).$(VERSION) @cd $(LIBPREFIX) && ln -fs $(shell basename $(TARGET_HWLOC_LIB)).$(VERSION).$(RELEASE) $(shell basename $(TARGET_HWLOC_LIB)) @cd $(LIBPREFIX) && ln -fs $(shell basename $(TARGET_HWLOC_LIB)).$(VERSION).$(RELEASE) $(shell basename $(TARGET_HWLOC_LIB)).$(VERSION) @if [ "$(LUA_INTERNAL)" = "true" ]; then \ cd $(LIBPREFIX) && ln -fs $(shell basename $(TARGET_LUA_LIB)).$(VERSION).$(RELEASE) $(shell basename $(TARGET_LUA_LIB)); \ cd $(LIBPREFIX) && ln -fs $(shell basename $(TARGET_LUA_LIB)).$(VERSION).$(RELEASE) $(shell basename $(TARGET_LUA_LIB)).$(VERSION); \ fi @echo "===> INSTALL man pages to $(MANPREFIX)/man1" @mkdir -p $(MANPREFIX)/man1 @chmod 755 $(MANPREFIX)/man1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" < $(DOC_DIR)/likwid-topology.1 > $(MANPREFIX)/man1/likwid-topology.1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" -e "s++$(PREFIX)+g" < $(DOC_DIR)/likwid-perfctr.1 > $(MANPREFIX)/man1/likwid-perfctr.1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" < $(DOC_DIR)/likwid-powermeter.1 > $(MANPREFIX)/man1/likwid-powermeter.1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" < $(DOC_DIR)/likwid-pin.1 > $(MANPREFIX)/man1/likwid-pin.1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" < $(DOC_DIR)/feedGnuplot.1 > $(MANPREFIX)/man1/feedGnuplot.1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" < $(DOC_DIR)/likwid-accessD.1 > $(MANPREFIX)/man1/likwid-accessD.1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" < $(DOC_DIR)/likwid-genTopoCfg.1 > $(MANPREFIX)/man1/likwid-genTopoCfg.1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" < $(DOC_DIR)/likwid-memsweeper.1 > $(MANPREFIX)/man1/likwid-memsweeper.1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" < $(DOC_DIR)/likwid-mpirun.1 > $(MANPREFIX)/man1/likwid-mpirun.1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" < $(DOC_DIR)/likwid-perfscope.1 > $(MANPREFIX)/man1/likwid-perfscope.1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" < $(DOC_DIR)/likwid-setFreq.1 > $(MANPREFIX)/man1/likwid-setFreq.1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" < $(DOC_DIR)/likwid-features.1 > $(MANPREFIX)/man1/likwid-features.1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" < $(DOC_DIR)/likwid-bench.1 > $(MANPREFIX)/man1/likwid-bench.1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" < $(DOC_DIR)/likwid-setFrequencies.1 > $(MANPREFIX)/man1/likwid-setFrequencies.1 @sed -e "s/.TH LUA/.TH LIKWID-LUA/g" -e "s/lua - Lua interpreter/likwid-lua - Lua interpreter included in LIKWID/g" -e "s/.B lua/.B likwid-lua/g" -e "s/.BR luac (1)//g" $(DOC_DIR)/likwid-lua.1 > $(MANPREFIX)/man1/likwid-lua.1 @chmod 644 $(MANPREFIX)/man1/likwid-* @echo "===> INSTALL headers to $(PREFIX)/include" @mkdir -p $(PREFIX)/include @chmod 755 $(PREFIX)/include @install -m 644 src/includes/likwid.h $(PREFIX)/include/ @install -m 644 src/includes/bstrlib.h $(PREFIX)/include/ $(FORTRAN_INSTALL) @echo "===> INSTALL groups to $(PREFIX)/share/likwid/perfgroups" @mkdir -p $(PREFIX)/share/likwid/perfgroups @chmod 755 $(PREFIX)/share/likwid @chmod 755 $(PREFIX)/share/likwid/perfgroups @cp -rf groups/* $(PREFIX)/share/likwid/perfgroups @chmod 755 $(PREFIX)/share/likwid/perfgroups/* @find $(PREFIX)/share/likwid/perfgroups -name "*.txt" -exec chmod 644 {} \; @echo "===> INSTALL docs and examples to $(PREFIX)/share/likwid/docs" @mkdir -p $(PREFIX)/share/likwid/docs @chmod 755 $(PREFIX)/share/likwid/docs @install -m 644 doc/bstrlib.txt $(PREFIX)/share/likwid/docs @mkdir -p $(PREFIX)/share/likwid/examples @chmod 755 $(PREFIX)/share/likwid/examples @install -m 644 examples/* $(PREFIX)/share/likwid/examples @echo "===> INSTALL filters to $(abspath $(PREFIX)/share/likwid/filter)" @mkdir -p $(abspath $(PREFIX)/share/likwid/filter) @chmod 755 $(abspath $(PREFIX)/share/likwid/filter) @for F in $(FILTERS); do \ install -m 755 $$F $(abspath $(PREFIX)/share/likwid/filter); \ done @install -m 644 likwid-config.cmake $(LIBPREFIX) move: move_daemon move_freq @echo "===> MOVE applications from $(BINPREFIX) to $(INSTALLED_BINPREFIX)" @mkdir -p $(INSTALLED_BINPREFIX) @chmod 755 $(INSTALLED_BINPREFIX) @for APP in $(L_APPS); do \ install -m 755 $(BINPREFIX)/$$APP $(INSTALLED_BINPREFIX); \ done @for APP in $(C_APPS); do \ install -m 755 $(BINPREFIX)/`basename $$APP` $(INSTALLED_BINPREFIX); \ done @install -m 755 $(BINPREFIX)/likwid-lua $(INSTALLED_BINPREFIX)/likwid-lua @echo "===> MOVE helper applications from $(BINPREFIX) to $(INSTALLED_BINPREFIX)" @install -m 755 $(BINPREFIX)/feedGnuplot $(INSTALLED_BINPREFIX) @echo "===> MOVE lua to likwid interface from $(PREFIX)/share/lua to $(INSTALLED_PREFIX)/share/lua" @mkdir -p $(INSTALLED_PREFIX)/share/lua @chmod 755 $(INSTALLED_PREFIX)/share/lua @install -m 644 $(PREFIX)/share/lua/likwid.lua $(INSTALLED_PREFIX)/share/lua @echo "===> MOVE libraries from $(LIBPREFIX) to $(INSTALLED_LIBPREFIX)" @mkdir -p $(INSTALLED_LIBPREFIX) @chmod 755 $(INSTALLED_LIBPREFIX) @install -m 755 $(LIBPREFIX)/$(TARGET_LIB).$(VERSION).$(RELEASE) $(INSTALLED_LIBPREFIX)/$(TARGET_LIB).$(VERSION).$(RELEASE) @install -m 755 $(LIBPREFIX)/$(PINLIB).$(VERSION).$(RELEASE) $(INSTALLED_LIBPREFIX)/$(PINLIB).$(VERSION).$(RELEASE) @install -m 755 $(LIBPREFIX)/$(shell basename $(TARGET_HWLOC_LIB)).$(VERSION).$(RELEASE) $(INSTALLED_LIBPREFIX)/$(shell basename $(TARGET_HWLOC_LIB)).$(VERSION).$(RELEASE) @install -m 755 $(LIBPREFIX)/$(shell basename $(TARGET_LUA_LIB)).$(VERSION).$(RELEASE) $(INSTALLED_LIBPREFIX)/$(shell basename $(TARGET_LUA_LIB)).$(VERSION).$(RELEASE) @cd $(INSTALLED_LIBPREFIX) && ln -fs $(TARGET_LIB).$(VERSION).$(RELEASE) $(TARGET_LIB) @cd $(INSTALLED_LIBPREFIX) && ln -fs $(TARGET_LIB).$(VERSION).$(RELEASE) $(TARGET_LIB).$(VERSION) @cd $(INSTALLED_LIBPREFIX) && ln -fs $(PINLIB).$(VERSION).$(RELEASE) $(PINLIB) @cd $(INSTALLED_LIBPREFIX) && ln -fs $(PINLIB).$(VERSION).$(RELEASE) $(PINLIB).$(VERSION) @cd $(INSTALLED_LIBPREFIX) && ln -fs $(shell basename $(TARGET_HWLOC_LIB)).$(VERSION).$(RELEASE) $(shell basename $(TARGET_HWLOC_LIB)) @cd $(INSTALLED_LIBPREFIX) && ln -fs $(shell basename $(TARGET_HWLOC_LIB)).$(VERSION).$(RELEASE) $(shell basename $(TARGET_HWLOC_LIB)).$(VERSION) @cd $(INSTALLED_LIBPREFIX) && ln -fs $(shell basename $(TARGET_LUA_LIB)).$(VERSION).$(RELEASE) $(shell basename $(TARGET_LUA_LIB)) @cd $(INSTALLED_LIBPREFIX) && ln -fs $(shell basename $(TARGET_LUA_LIB)).$(VERSION).$(RELEASE) $(shell basename $(TARGET_LUA_LIB)).$(VERSION) @echo "===> MOVE man pages from $(MANPREFIX)/man1 to $(INSTALLED_MANPREFIX)/man1" @mkdir -p $(INSTALLED_MANPREFIX)/man1 @chmod 755 $(INSTALLED_MANPREFIX)/man1 @install -m 644 $(MANPREFIX)/man1/*.1 $(INSTALLED_MANPREFIX)/man1 @echo "===> MOVE headers from $(PREFIX)/include to $(INSTALLED_PREFIX)/include" @mkdir -p $(INSTALLED_PREFIX)/include @chmod 755 $(INSTALLED_PREFIX)/include @install -m 644 $(PREFIX)/include/likwid.h $(INSTALLED_PREFIX)/include/likwid.h @install -m 644 $(PREFIX)/include/bstrlib.h $(INSTALLED_PREFIX)/include/bstrlib.h @if [ -e $(PREFIX)/include/likwid.mod ]; then install $(PREFIX)/include/likwid.mod $(INSTALLED_PREFIX)/include/likwid.mod; fi @echo "===> MOVE groups from $(PREFIX)/share/likwid/perfgroups to $(INSTALLED_PREFIX)/share/likwid/perfgroups" @mkdir -p $(INSTALLED_PREFIX)/share/likwid/perfgroups @chmod 755 $(INSTALLED_PREFIX)/share/likwid @chmod 755 $(INSTALLED_PREFIX)/share/likwid/perfgroups @cp -rf $(PREFIX)/share/likwid/perfgroups/* $(INSTALLED_PREFIX)/share/likwid/perfgroups @chmod 755 $(INSTALLED_PREFIX)/share/likwid/perfgroups/* @find $(INSTALLED_PREFIX)/share/likwid/perfgroups -name "*.txt" -exec chmod 644 {} \; @mkdir -p $(INSTALLED_PREFIX)/share/likwid/docs @chmod 755 $(INSTALLED_PREFIX)/share/likwid/docs @install -m 644 $(PREFIX)/share/likwid/docs/bstrlib.txt $(INSTALLED_PREFIX)/share/likwid/docs @mkdir -p $(INSTALLED_PREFIX)/share/likwid/examples @chmod 755 $(INSTALLED_PREFIX)/share/likwid/examples @install -m 644 examples/* $(INSTALLED_PREFIX)/share/likwid/examples @echo "===> MOVE filters from $(abspath $(PREFIX)/share/likwid/filter) to $(LIKWIDFILTERPATH)" @mkdir -p $(LIKWIDFILTERPATH) @chmod 755 $(LIKWIDFILTERPATH) @cp -f $(abspath $(PREFIX)/share/likwid/filter)/* $(LIKWIDFILTERPATH) @chmod 755 $(LIKWIDFILTERPATH)/* @install -m 644 $(LIBPREFIX)/likwid-config.cmake $(INSTALLED_LIBPREFIX) uninstall: uninstall_daemon uninstall_freq @echo "===> REMOVING applications from $(PREFIX)/bin" @rm -f $(addprefix $(BINPREFIX)/,$(addsuffix .lua,$(L_APPS))) @for APP in $(L_APPS); do \ rm -f $(BINPREFIX)/$$APP; \ done @for APP in $(C_APPS); do \ rm -f $(BINPREFIX)/$$APP; \ done @rm -f $(BINPREFIX)/feedGnuplot @rm -f $(BINPREFIX)/likwid-lua @rm -f $(BINPREFIX)/likwid-bench @echo "===> REMOVING Lua to likwid interface from $(PREFIX)/share/lua" @rm -rf $(PREFIX)/share/lua/likwid.lua @echo "===> REMOVING libs from $(LIBPREFIX)" @rm -f $(LIBPREFIX)/liblikwid* @echo "===> REMOVING man pages from $(MANPREFIX)/man1" @rm -f $(addprefix $(MANPREFIX)/man1/,$(addsuffix .1,$(L_APPS))) @rm -f $(MANPREFIX)/man1/feedGnuplot.1 @rm -f $(MANPREFIX)/man1/likwid-setFreq.1 @rm -f $(MANPREFIX)/man1/likwid-accessD.1 @rm -f $(MANPREFIX)/man1/likwid-lua.1 @rm -f $(MANPREFIX)/man1/likwid-bench.1 @echo "===> REMOVING header from $(PREFIX)/include" @rm -f $(PREFIX)/include/likwid.h @rm -f $(PREFIX)/include/bstrlib.h $(FORTRAN_REMOVE) @echo "===> REMOVING filter, groups and default configs from $(PREFIX)/share/likwid" @rm -rf $(abspath $(PREFIX)/share/likwid/filter) @rm -rf $(PREFIX)/share/likwid/perfgroups @rm -rf $(PREFIX)/share/likwid/docs @rm -rf $(PREFIX)/share/likwid/examples @rm -rf $(PREFIX)/share/likwid @rm -rf $(LIBPREFIX)/likwid-config.cmake uninstall_moved: uninstall_daemon_moved uninstall_freq_moved @echo "===> REMOVING applications from $(INSTALLED_PREFIX)/bin" @rm -f $(addprefix $(INSTALLED_BINPREFIX)/,$(addsuffix .lua,$(L_APPS))) @for APP in $(L_APPS); do \ rm -f $(INSTALLED_BINPREFIX)/$$APP; \ done @for APP in $(C_APPS); do \ rm -f $(INSTALLED_BINPREFIX)/$$APP; \ done @rm -f $(INSTALLED_BINPREFIX)/feedGnuplot @rm -f $(INSTALLED_BINPREFIX)/likwid-lua @rm -f $(INSTALLED_BINPREFIX)/likwid-bench @echo "===> REMOVING Lua to likwid interface from $(INSTALLED_PREFIX)/share/lua" @rm -rf $(INSTALLED_PREFIX)/share/lua/likwid.lua @echo "===> REMOVING libs from $(INSTALLED_LIBPREFIX)" @rm -f $(INSTALLED_LIBPREFIX)/liblikwid* @echo "===> REMOVING man pages from $(INSTALLED_MANPREFIX)/man1" @rm -f $(addprefix $(INSTALLED_MANPREFIX)/man1/,$(addsuffix .1,$(L_APPS))) @rm -f $(INSTALLED_MANPREFIX)/man1/feedGnuplot.1 @rm -f $(INSTALLED_MANPREFIX)/man1/likwid-setFreq.1 @rm -f $(INSTALLED_MANPREFIX)/man1/likwid-accessD.1 @rm -f $(INSTALLED_MANPREFIX)/man1/likwid-lua.1 @rm -f $(INSTALLED_MANPREFIX)/man1/likwid-bench.1 @echo "===> REMOVING header from $(INSTALLED_PREFIX)/include" @rm -f $(INSTALLED_PREFIX)/include/likwid.h @rm -f $(INSTALLED_PREFIX)/include/bstrlib.h $(FORTRAN_REMOVE) @echo "===> REMOVING filter, groups and default configs from $(INSTALLED_PREFIX)/share/likwid" @rm -rf $(LIKWIDFILTERPATH) @rm -rf $(INSTALLED_PREFIX)/share/likwid/perfgroups @rm -rf $(INSTALLED_PREFIX)/share/likwid/docs @rm -rf $(INSTALLED_PREFIX)/share/likwid/examples @rm -rf $(INSTALLED_PREFIX)/share/likwid @rm -rf $(INSTALLED_LIBPREFIX)/likwid-config.cmake local: $(L_APPS) likwid.lua @echo "===> Setting Lua scripts to run from current directory" @PWD=$(shell pwd) @for APP in $(L_APPS); do \ sed -i -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(RELEASE)/g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" -e "s+$(PREFIX)/bin/likwid-lua+$(PWD)/ext/lua/lua+" -e "s+$(PREFIX)/share/lua/?.lua+$(PWD)/?.lua+" -e "s+$(PREFIX)/bin/likwid-pin+$(PWD)/likwid-pin+" -e "s+$(PREFIX)/bin/likwid-perfctr+$(PWD)/likwid-perfctr+" $$APP; \ chmod +x $$APP; \ done @sed -i -e "s//$(VERSION)/g" -e "s//$(DATE)/g" -e "s//$(RELEASE)/g" -e "s+$(PREFIX)/lib+$(PWD)+g" -e "s+$(PREFIX)/share/likwid/perfgroups+$(PWD)/groups+g" -e "s//$(GITCOMMIT)/g" -e "s//$(MINOR)/g" likwid.lua; @ln -sf liblikwid.so liblikwid.so.$(VERSION) @ln -sf ext/hwloc/liblikwid-hwloc.so liblikwid-hwloc.so.$(VERSION) @ln -sf ext/lua/liblikwid-lua.so liblikwid-lua.so.$(VERSION) @ln -sf liblikwid.so liblikwid.so.$(VERSION).$(RELEASE) @ln -sf ext/hwloc/liblikwid-hwloc.so liblikwid-hwloc.so.$(VERSION).$(RELEASE) @ln -sf ext/lua/liblikwid-lua.so liblikwid-lua.so.$(VERSION).$(RELEASE) @echo "export LD_LIBRARY_PATH=$(PWD):$$LD_LIBRARY_PATH" testit: test/test-likwidAPI.c make -C test test-likwidAPI test/test-likwidAPI make -C test/executable_tests help: @echo "Help for building LIKWID:" @echo @echo "Common make targets:" @echo "- make : build anything (integrate already compiled files)" @echo "- make clean : clean library and executables, keep compiled files" @echo "- make distclean : clean anything" @echo "- make docs : Build documentation (requires Doxygen)" @echo "- make install : Copy compiled files to $(PREFIX)" @echo "- make move : Copy files from $(PREFIX) to $(INSTALLED_PREFIX)" @echo "- make uninstall : Delete files from $(PREFIX)" @echo "- make uninstall_moved : Delete files from $(INSTALLED_PREFIX)" @echo @echo "Compiler selection can be done in config.mk at COMPILER:" @echo "- GCC : Use GCC for C code and Intel Fortran compiler for Fortran interface (default)" @echo "- GCCX86 : Use GCC for C code. No Fortran compiler set (only for 32 bit builds)" @echo "- CLANG: Use CLANG for C code and Intel Fortran compiler for Fortran interface (unsupported, may fail)" @echo "- ICC: Use Intel C compiler for C code and Intel Fortran compiler for Fortran interface (unsupported, may fail)" @echo "- MIC: Build for Intel Xeon Phi. Use Intel C compiler for C code and\n Intel Fortran compiler for Fortran interface (unsupported)" @echo @echo "LIKWID runs only in INSTALLED_PREFIX = $(INSTALLED_PREFIX)" @echo "You can change it in config.mk, but it is recommended to keep INSTALLED_PREFIX = PREFIX" @echo "The PREFIX is used for temporary install directories (e.g. for packaging)." @echo "LIKWID will not run in PREFIX, it has to be in INSTALLED_PREFIX." @echo "The common configuration is INSTALLED_PREFIX = PREFIX, so changing PREFIX is enough." @echo "If PREFIX and INSTALLED_PREFIX differ, you have to move anything after 'make install' to" @echo "the INSTALLED_PREFIX. You can also use 'make move' which does the job for you." likwid-4.3.1/README.md000066400000000000000000000114441322364552400142730ustar00rootroot00000000000000-------------------------------------------------------------------------------- Introduction -------------------------------------------------------------------------------- Likwid is a simple to install and use toolsuite of command line applications for performance oriented programmers. It works for Intel and AMD processors on the Linux operating system. [![Build Status](https://travis-ci.org/RRZE-HPC/likwid.svg?branch=master)](https://travis-ci.org/RRZE-HPC/likwid) It consists of: - likwid-topology: print thread, cache and NUMA topology - likwid-perfctr: configure and read out hardware performance counters on Intel and AMD processors - likwid-powermeter: read out RAPL Energy information and get info about Turbo mode steps - likwid-pin: pin your threaded application (pthread, Intel and gcc OpenMP to dedicated processors) - likwid-bench: Micro benchmarking platform - likwid-features: Print and manipulate cpu features like hardware prefetchers - likwid-genTopoCfg: Dumps topology information to a file - likwid-mpirun: Wrapper to start MPI and Hybrid MPI/OpenMP applications (Supports Intel MPI, OpenMPI and MPICH) - likwid-perfscope: Frontend to the timeline mode of likwid-perfctr, plots live graphs of performance metrics using gnuplot - likwid-agent: Monitoring agent for hardware performance counters - likwid-memsweeper: Sweep memory of NUMA domains and evict cachelines from the last level cache - likwid-setFrequencies: Tool to control the CPU frequency For further information please take a look at the [Wiki](https://github.com/RRZE-HPC/likwid/wiki). -------------------------------------------------------------------------------- Supported architectures -------------------------------------------------------------------------------- Intel - Intel Atom - Intel Pentium M - Intel Core2 - Intel Nehalem - Intel NehalemEX - Intel Westmere - Intel WestmereEX - Intel Xeon Phi (KNC) - Intel Silvermont & Airmont - Intel Goldmont - Intel SandyBridge - Intel SandyBridge EP/EN - Intel IvyBridge - Intel IvyBridge EP/EN/EX - Intel Haswell - Intel Haswell EP/EN/EX - Intel Broadwell - Intel Broadwell D - Intel Broadwell EP - Intel Skylake - Intel Skylake SP - Intel Xeon Phi (KNL) AMD - AMD K8 - AMD K10 - AMD Interlagos - AMD Kabini - AMD Zen -------------------------------------------------------------------------------- Download, Build and Install -------------------------------------------------------------------------------- You can get the releases of LIKWID at: http://ftp.fau.de/pub/likwid/ For build and installation hints see INSTALL file or check the build instructions page in the wiki https://github.com/RRZE-HPC/likwid/wiki/Build For quick install: ``` $ tar -xjf likwid-.tar.bz2 $ cd likwid- $ vi config.mk (configure build, e.g. change installation prefix) $ make $ sudo make install (sudo required to install the access daemon with proper permissions) ``` -------------------------------------------------------------------------------- Documentation -------------------------------------------------------------------------------- For a detailed documentation on the usage of the tools have a look at the html documentation build with doxygen. Call make docs or after installation, look at the man pages. There is also a wiki at the github page: https://github.com/rrze-likwid/likwid/wiki If you have problems or suggestions please let me know on the likwid mailing list: http://groups.google.com/group/likwid-users or if it is bug, add an issue at: https://github.com/rrze-likwid/likwid/issues -------------------------------------------------------------------------------- Extras -------------------------------------------------------------------------------- - If you want to use the Marker API with Java, you can find the Java module here: https://github.com/jlewandowski/likwid-java-api - For Python you can find an interface to the LIKWID API here: https://github.com/RRZE-HPC/pylikwid -------------------------------------------------------------------------------- Survey -------------------------------------------------------------------------------- We opened a survey at the user mailing list to get a feeling who uses LIKWID and how. Moreover we would be interested if you are missing a feature or what annoys you when using LIKWID. Link to the survey: https://groups.google.com/forum/#!topic/likwid-users/F7TDho3k7ps -------------------------------------------------------------------------------- Funding -------------------------------------------------------------------------------- LIKWID development was funded by BMBF Germany under the FEPA project, grant 01IH13009. Since 2017 the development is further funded by BMBF Germany under the SeASiTe project, grant 01IH16012A.
BMBF logo
likwid-4.3.1/bench/000077500000000000000000000000001322364552400140675ustar00rootroot00000000000000likwid-4.3.1/bench/Makefile000066400000000000000000000104351322364552400155320ustar00rootroot00000000000000# # ======================================================================================= # # Filename: Makefile # # Description: likwid-bench Makefile # # Version: # Released: # # Author: Jan Treibig (jt), jan.treibig@gmail.com # Project: likwid # # Copyright (C) 2016 Jan Treibig # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program. If not, see . # # ======================================================================================= SRC_DIR = ./src MAKE_DIR = ../make #DO NOT EDIT BELOW # Dependency chains: # *.[ch] -> *.o -> executables # *.ptt -> *.pas -> *.s -> *.o -> executables # *.txt -> *.h (generated) include ../config.mk include $(MAKE_DIR)/include_$(COMPILER).mk include $(MAKE_DIR)/config_checks.mk include $(MAKE_DIR)/config_defines.mk #INCLUDES += -I./includes -I../src/includes -I../ext/hwloc/include -I../$(COMPILER) -I$(BUILD_DIR) INCLUDES += -I./includes -I$(BUILD_DIR) -I../src/includes LIBS += CFLAGS := $(filter-out -fvisibility=hidden, $(CFLAGS)) #CONFIGURE BUILD SYSTEM BUILD_DIR = ./$(COMPILER) Q ?= @ ifeq ($(COMPILER),MIC) BENCH_DIR = ./phi else ifeq ($(COMPILER),GCCX86) BENCH_DIR = ./x86 else BENCH_DIR = ./x86-64 endif endif SHARED_TARGET_LIB := -L.. -L../ext/hwloc/ -L$(LUA_LIB_DIR) -llikwid -llikwid-hwloc -l$(LUA_LIB_NAME) STATIC_TARGET_LIB := ../liblikwid.a ../ext/hwloc/liblikwid-hwloc.a $(LUA_LIB_DIR)/lib$(LUA_LIB_NAME).a TARGET_LIB = $(SHARED_TARGET_LIB) BENCH_LIBS := ifeq ($(INSTRUMENT_BENCH),true) DEFINES += -DLIKWID_PERFMON endif ifeq ($(DEBUG),true) DEBUG_FLAGS = -g DEFINES += -DDEBUG_LIKWID else DEBUG_FLAGS = endif VPATH = $(SRC_DIR) OBJ = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.c)) ifeq ($(SHARED_LIBRARY),false) OBJ := $(filter-out $(BUILD_DIR)/bstrlib.o,$(OBJ)) TARGET_LIB = $(STATIC_TARGET_LIB) endif OBJ_BENCH = $(patsubst $(BENCH_DIR)/%.ptt, $(BUILD_DIR)/%.o,$(wildcard $(BENCH_DIR)/*.ptt)) BENCH = $(shell basename $(BENCH_TARGET)) CPPFLAGS := $(CPPFLAGS) $(DEFINES) $(INCLUDES) all: $(BUILD_DIR) $(OBJ) $(OBJ_BENCH) $(BENCH_TARGET) $(BENCH_TARGET): $(BENCH) $(BENCH): likwid-bench.c $(BUILD_DIR) $(OBJ) $(OBJ_BENCH) @echo "===> LINKING $(BENCH)" $(Q)${CC} $(DEBUG_FLAGS) $(CFLAGS) $(ANSI_CFLAGS) $(CPPFLAGS) ${LFLAGS} likwid-bench.c $(BENCH_LIBS) $(OBJ_BENCH) $(OBJ) -o $(BENCH) $(TARGET_LIB) $(LIBS) $(RPATHS) $(BUILD_DIR): @mkdir $(BUILD_DIR) #PATTERN RULES $(BUILD_DIR)/%.o: %.c @echo "===> COMPILE C $@" $(Q)$(CC) -g -c $(DEBUG_FLAGS) $(CFLAGS) $(ANSI_CFLAGS) $(CPPFLAGS) $(TARGET_LIB) $< -o $@ $(Q)$(CC) -g $(DEBUG_FLAGS) $(CPPFLAGS) -MT $(@:.d=.o) -MM $< > $(BUILD_DIR)/$*.d $(BUILD_DIR)/%.pas: $(BENCH_DIR)/%.ptt @echo "===> GENERATE BENCHMARKS" $(Q)$(GEN_PAS) $(BENCH_DIR) $(BUILD_DIR) ./perl/templates $(BUILD_DIR)/%.o: $(BUILD_DIR)/%.pas @echo "===> ASSEMBLE $@" $(Q)$(PAS) -i $(PASFLAGS) -o $(BUILD_DIR)/$*.s $< '$(DEFINES)' $(Q)$(AS) $(ASFLAGS) $(BUILD_DIR)/$*.s -o $@ ifeq ($(findstring $(MAKECMDGOALS),clean),) -include $(OBJ:.o=.d) endif .PHONY: clean distclean install uninstall .PRECIOUS: $(BUILD_DIR)/%.pas .NOTPARALLEL: clean: @rm -rf likwid-bench distclean: @rm -rf $(BUILD_DIR) @rm -rf likwid-bench install: @echo "===> INSTALL applications to $(BINPREFIX)" cp -f likwid-bench $(BINPREFIX) @echo "===> INSTALL man pages to $(MANPREFIX)/man1" @mkdir -p $(MANPREFIX)/man1 @sed -e "s//$(VERSION)/g" -e "s//$(DATE)/g" < $(DOC_DIR)/likwid-bench.1 > $(MANPREFIX)/man1/likwid-bench.1 uninstall: @echo "===> REMOVING applications from $(BINPREFIX)" rm -rf $(BINPREFIX)/likwid-bench @echo "===> REMOVING man pages from $(MANPREFIX)/man1" @rm -f $(MANPREFIX)/man1/likwid-bench.1 likwid-4.3.1/bench/includes/000077500000000000000000000000001322364552400156755ustar00rootroot00000000000000likwid-4.3.1/bench/includes/allocator.h000066400000000000000000000032611322364552400200300ustar00rootroot00000000000000/* * ======================================================================================= * * Filename: allocator.h * * Description: Header File allocator Module. * * Version: 4.3.1 * Released: 04.01.2018 * * Author: Jan Treibig (jt), jan.treibig@gmail.com * Project: none * * Copyright (C) 2018 RRZE, University Erlangen-Nuremberg * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . * * ======================================================================================= */ #ifndef ALLOCATOR_H #define ALLOCATOR_H #include #include #include #define LLU_CAST (unsigned long long) extern void allocator_init(int numVectors); extern void allocator_finalize(); extern size_t allocator_dataTypeLength(DataType type); extern void allocator_allocateVector(void** ptr, int alignment, uint64_t size, int offset, DataType type, int stride, bstring domain); #endif /*ALLOCATOR_H*/ likwid-4.3.1/bench/includes/allocator_types.h000066400000000000000000000026001322364552400212500ustar00rootroot00000000000000/* * ======================================================================================= * * Filename: allocator_types.h * * Description: Header File types of allocator Module. * * Version: 4.3.1 * Released: 04.01.2018 * * Author: Thomas Roehl (tr), thomas.roehl@googlemail.com * Project: none * * Copyright (C) 2018 RRZE, University Erlangen-Nuremberg * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . * * ======================================================================================= */ #ifndef ALLOCATOR_TYPES_H #define ALLOCATOR_TYPES_H #include #include typedef struct { void* ptr; size_t size; off_t offset; DataType type; } allocation; #endif likwid-4.3.1/bench/includes/barrier.h000066400000000000000000000036031322364552400174760ustar00rootroot00000000000000/* * ======================================================================================= * * Filename: barrier.h * * Description: Header File barrier Module * * Version: 4.3.1 * Released: 04.01.2018 * * Author: Jan Treibig (jt), jan.treibig@gmail.com * Project: likwid * * Copyright (C) 2018 RRZE, University Erlangen-Nuremberg * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . * * ======================================================================================= */ #ifndef BARRIER_H #define BARRIER_H #include /** * @brief Initialize the barrier module * @param numberOfThreads The total number of threads in the barrier */ extern void barrier_init(int numberOfGroups); /** * @brief Register a thread for a barrier * @param threadId The id of the thread to register */ extern int barrier_registerGroup(int numThreads); extern void barrier_registerThread(BarrierData* barr, int groupsId, int threadId); /** * @brief Synchronize threads * @param threadId The id of the calling thread * @param numberOfThreads Total number of threads in the barrier */ extern void barrier_synchronize(BarrierData* barr); extern void barrier_destroy(BarrierData* barr); #endif /*BARRIER_H*/ likwid-4.3.1/bench/includes/barrier_types.h000066400000000000000000000027771322364552400207350ustar00rootroot00000000000000/* * ======================================================================================= * * Filename: barrier_types.h * * Description: Type Definitions for barrier Module * * Version: 4.3.1 * Released: 04.01.2018 * * Author: Jan Treibig (jt), jan.treibig@gmail.com * Project: likwid * * Copyright (C) 2018 RRZE, University Erlangen-Nuremberg * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . * * ======================================================================================= */ #ifndef BARRIER_TYPES_H #define BARRIER_TYPES_H #include typedef struct { int numberOfThreads; int offset; int val; int* index; volatile int* bval; } BarrierData; typedef struct { int* groupBval; int numberOfThreads; } BarrierGroup; #endif /*BARRIER_TYPES_H*/ likwid-4.3.1/bench/includes/bstrlib.h000077700000000000000000000000001322364552400243372../../src/includes/bstrlib.hustar00rootroot00000000000000likwid-4.3.1/bench/includes/likwid.h000077700000000000000000000000001322364552400240032../../src/includes/likwid.hustar00rootroot00000000000000likwid-4.3.1/bench/includes/strUtil.h000066400000000000000000000033701322364552400175170ustar00rootroot00000000000000/* * ======================================================================================= * Filename: strUtil.h * * Description: Some sting functions * * Version: 4.3.1 * Released: 04.01.2018 * * Author: Jan Treibig (jt), jan.treibig@gmail.com * Project: likwid * * Copyright (C) 2018 RRZE, University Erlangen-Nuremberg * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . * * ======================================================================================= */ #ifndef STRUTIL_H #define STRUTIL_H #include #include #include #include #include #include #include #include typedef struct { bstring domain; int offset; void* ptr; } Stream; typedef struct { uint32_t numberOfThreads; int* processorIds; uint64_t size; Stream* streams; } Workgroup; extern int bstr_to_workgroup(Workgroup* group, const_bstring str, DataType type, int numberOfStreams); extern void workgroups_destroy(Workgroup** groupList, int numberOfGroups, int numberOfStreams); #endif likwid-4.3.1/bench/includes/test_types.h000066400000000000000000000047241322364552400202600ustar00rootroot00000000000000/* * ======================================================================================= * * Filename: test_types.h * * Description: Type definitions for benchmarking framework * * Version: 4.3.1 * Released: 04.01.2018 * * Author: Jan Treibig (jt), jan.treibig@gmail.com * Project: likwid * * Copyright (C) 2018 RRZE, University Erlangen-Nuremberg * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . * * ======================================================================================= */ #ifndef TEST_TYPES_H #define TEST_TYPES_H #include #include typedef void (*FuncPrototype)(); typedef enum { SINGLE = 0, DOUBLE, INT} DataType; typedef enum { STREAM_1 = 1, STREAM_2, STREAM_3, STREAM_4, STREAM_5, STREAM_6, STREAM_7, STREAM_8, STREAM_9, STREAM_10, STREAM_11, STREAM_12, STREAM_13, STREAM_14, STREAM_15, STREAM_16, STREAM_17, STREAM_18, STREAM_19, STREAM_20, STREAM_21, STREAM_22, STREAM_23, STREAM_24, STREAM_25, STREAM_26, STREAM_27, STREAM_28, STREAM_29, STREAM_30, STREAM_31, STREAM_32, STREAM_33, STREAM_34, STREAM_35, STREAM_36, STREAM_37, STREAM_38, MAX_STREAMS} Pattern; typedef struct { char* name; Pattern streams; DataType type ; int stride; FuncPrototype kernel; int flops; int bytes; char* desc; int loads; int stores; int branches; int instr_const; int instr_loop; int uops; } TestCase; typedef struct { uint64_t size; uint64_t iter; uint32_t min_runtime; const TestCase* test; uint64_t cycles; uint32_t numberOfThreads; int* processors; void** streams; } ThreadUserData; #endif /*TEST_TYPES_H*/ likwid-4.3.1/bench/includes/threads.h000066400000000000000000000065351322364552400175110ustar00rootroot00000000000000/* * ======================================================================================= * * Filename: threads.h * * Description: Header file of pthread interface module * * Version: 4.3.1 * Released: 04.01.2018 * * Author: Jan Treibig (jt), jan.treibig@gmail.com * Project: likwid * * Copyright (C) 2018 RRZE, University Erlangen-Nuremberg * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . * * ======================================================================================= */ #ifndef THREADS_H #define THREADS_H #include #include #define THREADS_BARRIER pthread_barrier_wait(&threads_barrier) #define MIN_ITERATIONS 10 extern pthread_barrier_t threads_barrier; extern ThreadData* threads_data; extern ThreadGroup* threads_groups; /** * @brief Test the maximal possible thread count * @return numberOfThreads The number of available threads */ extern int threads_test(void); /** * @brief Initialization of the thread module * @param numberOfThreads The total number of threads */ extern void threads_init(int numberOfThreads); /** * @brief Create all threads * @param startRoutine thread entry function pointer */ extern void threads_create(void *(*startRoutine)(void*)); /** * @brief Register User thread data for all threads * @param data Reference to the user data structo * @param func Optional function pointer to copy data */ extern void threads_registerDataAll( ThreadUserData* data, threads_copyDataFunc func); /** * @brief Register User thread data for one thread * @param threadId thread Id * @param data Reference to the user data structo * @param func Optional function pointer to copy data */ extern void threads_registerDataThread( int threadId, ThreadUserData* data, threads_copyDataFunc func); /** * @brief Register User thread data for a thread group * @param groupId group Id * @param data Reference to the user data structo * @param func Optional function pointer to copy data */ extern void threads_registerDataGroup( int groupId, ThreadUserData* data, threads_copyDataFunc func); extern size_t threads_updateIterations(int groupId, size_t demandIter); /** * @brief Join the threads and free pthread related data structures * @param */ extern void threads_join(void); /** * @brief Free memory of thread data structures * @param numberOfGroups The number of groups to destroy */ extern void threads_destroy(int numberOfGroups, int numberOfStreams); /** * @brief Create Thread groups * @param numberOfGroups The number of groups to create */ extern void threads_createGroups(int numberOfGroups); #endif /* THREADS_H */ likwid-4.3.1/bench/includes/threads_types.h000066400000000000000000000033401322364552400207240ustar00rootroot00000000000000/* * ======================================================================================= * * Filename: threads_types.h * * Description: Types file for threads module. * * Version: 4.3.1 * Released: 04.01.2018 * * Author: Jan Treibig (jt), jan.treibig@gmail.com * Project: likwid * * Copyright (C) 2018 RRZE, University Erlangen-Nuremberg * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . * * ======================================================================================= */ #ifndef THREADS_TYPES_H #define THREADS_TYPES_H #include #include typedef struct { int globalNumberOfThreads; int numberOfThreads; int globalThreadId; int threadId; int numberOfGroups; int groupId; double time; uint64_t cycles; ThreadUserData data; } ThreadData; typedef struct { int numberOfThreads; int* threadIds; } ThreadGroup; typedef void (*threads_copyDataFunc)(ThreadUserData* src,ThreadUserData* dst); #endif /*THREADS_TYPES_H*/ likwid-4.3.1/bench/likwid-bench.c000066400000000000000000000517021322364552400166000ustar00rootroot00000000000000/* * ======================================================================================= * * Filename: likwid-bench.c * * Description: A flexible and extensible benchmarking toolbox * * Version: 4.3.1 * Released: 04.01.2018 * * Author: Jan Treibig (jt), jan.treibig@gmail.com * Project: likwid * * Copyright (C) 2018 RRZE, University Erlangen-Nuremberg * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . * * ======================================================================================= */ /* ##### HEADER FILE INCLUDES ######################################### */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) extern void* runTest(void* arg); extern void* getIterSingle(void* arg); /* ##### MACROS - LOCAL TO THIS SOURCE FILE ######################### */ #define HELP_MSG printf("Threaded Memory Hierarchy Benchmark -- Version %d.%d \n\n",VERSION,RELEASE); \ printf("\n"); \ printf("Supported Options:\n"); \ printf("-h\t\t Help message\n"); \ printf("-a\t\t List available benchmarks \n"); \ printf("-d\t\t Delimiter used for physical core list (default ,) \n"); \ printf("-p\t\t List available thread domains\n"); \ printf("\t\t or the physical ids of the cores selected by the -c expression \n"); \ printf("-s