Hardware Performance Monitor (HPM) Toolkit Users Guide
|
|
|
- Dwayne Lynch
- 10 years ago
- Views:
Transcription
1 Hardware Performance Monitor (HPM) Toolkit Users Guide Christoph Pospiech Advanced Computing Technology Center IBM Research Phone: Fax: Version June 23, 2010 c International Business Machines Corp. 2007, 2008, 2009 All Rights Reserved LICENSE TERMS The IBM High Performance Computing Toolkit (IHPCT) is distributed under a nontransferable, nonexclusive, and revocable license. The HPM software is provided AS IS. IBM makes no warranties, expressed or implied, including the implied warranties of merchantability and fitness for a particular purpose. IBM has no obligation to defend or indemnify against any claim of infringement, including, but not limited to, patents, copyright, trade secret, or intellectual property rights of any kind. IBM is under no obligation to maintain, correct, or otherwise support this software. IBM does not represent that the HPM Toolkit will be made generally available. IBM does not represent that any software made generally available will be similar to or compatible with the HPM Toolkit. 1
2 Contents 1 The HPM Toolkit 4 2 hpccount Quick Start Usage Events and Groups Multiplexing Derived Metrics What are Derived Metrics MFlop Issues Latency Computation Inheritance Considerations for MPI Parallel Programs General Considerations Distributors Aggregators Plug-ins shipped with the Tool Kit User defined Plug-ins Detailed Interface Description Getting the plug-ins to work Shared Object Trouble Shooting libhpc Quick Start
3 3.2 Events and Groups BlueGene counter issues BlueGene counter design BlueGene/P counter control BlueGene/P output control Multiplexing Derived Metrics What are Derived Metrics MFlop Issues Latency Computation Inheritance Inclusive and Exclusive Values What are Exclusive Values? Parent-Child Relations Handling of Overlap Issues Computation of Exclusive Values for Derived Metrics Function Reference Measurement Overhead Output Examples of Use C and C Fortran Multi-Threaded Program Instrumentation Issues Considerations for MPI Parallel Programs
4 General Considerations Distributors Aggregators Plug-ins shipped with the Tool Kit User defined Plug-ins Detailed Interface Description Getting the plug-ins to work Compiling and Linking Dynamic Linking Static Linking hpcstat Quick Start Usage Events and Groups Reference List of Environment Variables Derived Metrics Description The HPM Toolkit The HPM Toolkit was developed for performance measurement of applications running on IBM systems supporting the following processors and operating systems: PPC970 AIX 5L or Linux 4
5 Power4 AIX 5L or Linux Power5 AIX 5L or Linux Power5+ AIX 5L or Linux Power6 AIX 5L or Linux BG/L Linux BG/P Linux The HPM Toolkit consists of: An utility hpccount, which starts an application and provides at the end of execution wall clock time, hardware performance counters information, derived hardware metrics, and resource utilization statistics 12 An instrumentation library libhpc, which provides instrumented programs with a summary output containing the above information for each instrumented region in a program (resource utilization statistics is provided only once, for the whole section of the program that is instrumented). This library supports serial and parallel (MPI, threaded, and mixed mode) applications, written in Fortran, C, and C++. An utility hpcstat (depreciated) 2 A graphical user interface PeekPerf, for graphical visualization of the performance file generated by libhpc. This is described in a separate document. Requirements: On AIX 5L On Linux bos.pmapi, which is a product level file set provided with the AIX distribution, but not installed by default. 1 For more information on the resource utilization statistics, please refer to the getrusage man pages. 2 hpccount and hpcstat are not available on BG/L and BG/P 5
6 The kernel has to be recompiled with the perfctr patch. The patch can be obtained from the following URL mikpe/linux/perfctr/2.7/....../perfctr tar.gz libperfctr.a compiled with 32-bit and 64-bit addressing (gcc -m32 and gcc -m64). The sources can be obtained from the following URL mikpe/linux/perfctr/2.7/....../perfctr tar.gz On BG/L or BG/P none The owner and developer for the previous HPM versions 1 and 2 was Luiz DeRose (ACTC). 2 hpccount 2.1 Quick Start hpccount is essentially used the same way as the time command; the user just types hpccount <program> As a result, hpccount appends various performance information at the end of the screen (i.e. stdout) output. In particular it prints resource utilization statistics, hardware performance counter information and derived hardware metrics. The resource usage statistics is directly taken from a call to getrusage(). For more information on the resource utilization statistics, please refer to the getrusage man pages. In particular, on Linux the man page for getrusage() states that not all fields are meaningful under Linux. The corresponding lines in hpccount output have the value n/a. 2.2 Usage Sequential or shared memory programs 6
7 hpccount [-o <name>] [-u] [-n] [-x] [-g <group>] \ [-a <plugin>] <program> MPI or hybrid parallel programs poe hpccount [-o <name>] [-u] [-n] [-x] [-g <group>] \ [-a <plugin>] <program> mpirun hpccount [-o <name>] [-u] [-n] [-x] [-g <group>] \ [-a <plugin>] <program> or hpccount [-h] [-l] [-c] where: <program> program to be executed -h displays this help message -o <name> copies output to file <name> -u make the file name <name> unique -n no hpccount output in stdout when "-o" flag is used -x adds formulas for derived metrics -g <group> PM_API group number -a <plugin> aggregate counters using the plugin <plugin> -l list groups -c list counters and events Detailed descriptions of selected options -o <name> copies output to file <name>. The file name can be specified via option -o or via environment variable HPM OUTPUT NAME. The option takes precedence if there are conflicting specifications. The name <name>is actually expanded into three different file names. 7
8 <name>.hpm is the file name for ASCII output which is basically a one-to-one copy of the screen output. <name>.viz is the filename for XML output. <name>.csv is the filename for output as comma separated value file. This is not yet implemented in the current release. Which of these output files are generated is governed by three additional environment variables. If none of those are set, only the ASCII output is generated. If at least one is set, the following rules apply. HPM ASC OUTPUT If set to Y[...], y[...] or 1, triggers the ASCII output. HPM VIZ OUTPUT If set to Y[...], y[...] or 1, triggers the XML output. HPM CSV OUTPUT If set to Y[...], y[...] or 1, triggers the csv output. This is not yet implemented in the current release. Unless the -a option is chosen (see section 2.7 Considerations for MPI Parallel Programs below), there is one output for each MPI task. To avoid directing all output to the same file, the user is advised to have a different name for each MPI task (using e.g. the -u flag below) or direct the file to a non-shared file system. -u make the file name <name>(specified via -o) unique. A string _<hostname>_<process_id>_<date>_<time> is inserted before the last. in the file name. If the file name has no., the string is appended to the file name. If the only occurrence of. is the first character of the file name, the string is prepended, but the leading is skipped. If the host name contains. ( long form ), only the portion preceding the first. is taken. In case a batch queuing system is used, the host name is taken from the execution host, not the submitting host. Similarly for MPI parallel programs, the host name is taken from the node where the MPI task is running. The addition of the process id enforces different file names for MPI tasks running on the same node. 8
9 If used for an MPI parallel program, hpccount tries to extract the MPI task id (or MPI rank with respect to MPI COMM WORLD) from the MPI environment. If successful, the process id is replaced with the MPI task id. The date is given as dd.mm.yyyy, the time is given by hh.mm.ss in 24h format using the local time zone. This flag is only active when the -o flag is used. -n no hpccount output in stdout when -o flag is used. This flag is only active when the -o flag is used. Alternatively the environment variable HPM STDOUT= no can be used. -x adds formulas for derived metrics For an explanation on derived metrics see section 2.5 below. For a formula reference see section 5.2 below. Alternatively the environment variable HPM PRINT FORMULA = yes can be used. -g <group[,<group>,...]> specify group number(s) for an explanation on groups see sections 2.3 on Events and Groups and 2.4 on Multiplexing below. -a <plug-in> aggregate counters using the plug-in <plug-in>. -l list groups for an explanation on groups see section 2.3 on Events and Groups below. -c list counters and events for an explanation on groups see section 2.3 on Events and Groups below. 9
10 2.3 Events and Groups The hardware performance counters information is the value of special CPU registers that are incremented at certain events. The number of such registers is different for each architecture. Processor Architecture Number of performance counter registers PPC970 8 Power4 8 Power5 6 Power5+ 6 Power6 6 BG/L 52 BG/P 256 On both AIX and Linux, kernel extensions provide counter virtualization, i.e. the user sees private counter values for his application. On a technical side, the counting of the special CPU registers is frozen and the values are saved whenever the application process is taken off the CPU and another process gets scheduled. The counting is resumed when the user application gets scheduled on the CPU. The special CPU registers can count different events. On the Power CPUs there are restrictions which registers can count what events. A call to hpccount -c will list all CPU counting registers and the events they can be monitoring. Even more, there are lots of rules restricting the concurrent use of different events. Each valid combination of assignments of events to hardware counting registers is called a group. To make handling easier, a list of valid groups is provided. A call to hpccount -l will list all available groups and the events they are monitoring. The -g option is provided to select a specific group to be counted by hpccount. If -g is not specified, a default group will be taken according to the following table. 10
11 Processor Architecture Number of groups Default group PPC Power Power5 148(140) 137 Power Power BG/L 16 0 BG/P 4 0,1 The number of groups for Power5 is 140 for AIX 5.2, and 148 for Linux and AIX 5.3. The reason for this difference are different versions of bos.pmapi.the last group (139) was changed and 8 new groups were appended. If HPM is called with hpccount -g <a_new_group_number> on AIX 5.2, it returns the following error message. hpccount ERROR - pm_set_program_mygroup: pm_api : event group ID is invalid 2.4 Multiplexing The idea behind multiplexing is to run several groups concurrently. This is accomplished by running the first group for a short time interval, then switching to the next group for the next short time interval, and keep doing this in a round robin fashion for the groups until the event counting is eventually stopped. HPM supports multiplexing only on AIX5. The groups are specified as a comma separated list. OR hpccount -g 1,2 <program> export HPM_EVENT_SET= 1,2 hpccount <program> 11
12 On Operating systems other than AIX5 this leads to the following error message. HPM ERROR - Multiplexing not supported: too many groups or events specified: 2 Of course multiplexing means that neither of the groups has been run on the whole code. Likewise it is unknown what fraction of the code was measured with which group. It is assumed that the workload is sufficiently uniform that the measured event counts can be (more or less) safely calibrated as if the groups have been run separately on the whole code. The default time interval for measuring one group on the application is 100ms. If the total execution time is shorter than this time interval, only the first group in the list will be measured. All other counter values are 0. This might result in NaNQ values for some derived metrics (see section 2.5 on derived metrics), if the formula for computing the derived metric requires division by the counter value 0. The duration of this time interval can be controlled by setting the following environment variable. export HPM_SLICE_DURATION=<integer value in ms> This value is passed directly to AIX (more precisely bos.pmapi). AIX requires the value to lie between 10ms an 30s. The form of the output depends on the chosen aggregator (see sub section on Aggregators). Without specifying an aggregator (i.e. with the default aggregator), the data for each group is printed in a separate section with separate timing information. To have these data joined into one big group with more counters, one should use the local merge aggregator (loc merge.so), which described below. 2.5 Derived Metrics What are Derived Metrics Some of the events are difficult to interpret. Sometimes a combination of events provide better information. In the sequel, such a recombination of 12
13 basic events will be called derived metric. HPM also provides a list of derived metrics, which are defined in section Derived Metrics Description below. Since each derived metric has its own set of ingredients, not all derived metrics are printed for each group. HPM automatically finds those derived metrics which are computable and prints them. As a convenience to the user, the option -x will print not only the value of the derived metric, but also its definition MFlop Issues The two most popular derived metrics are the MFlop/s rate and the percentage of peak performance. The default group is chosen to make those two derived metrics available without special choice of the -g parameter. For Power5, there is no group that supports enough counters to compute a MFlop/s rate. So an Algebraic MFlop/s rate was invented to bridge this gap. This derived metric counts floating point adds, subs and mults (including FMAs), but misses divides and square roots. If the latter two only occur in negligible numbers (which is desirable for a HPC code anyway), the Algebraic MFlop/s rate coincides with the usual definition of MFlop/s. Again, different counter groups can be used to check this hypothesis. Group 137 (which exploits the Algebraic MFlop/s rate ) is chosen the default group for Power5. The derived metric percent of peak performance was added new in this version. For all, PPC970, Power4 and Power5, this is based on user time rather than wall clock time, as the result stays correct if multi-threaded (e.g. OpenMP) applications are run. For Power5, this is based on Algebraic MFlop/s. This has not been tested on AIX 5.3, particularly when SMT is active. Flip-flop blues: Compared to the previous version, the meanings of MFlip/s and MFlop/s are swapped. Not only many users were confused by the name MFlip/s being used for what they expected to be MFlop/s. Also Ptools (notably PAPI) is using a different nomenclature. HPM derived metric naming was changed to conform with this emerging standard. On Power4, PPC970 and Power6 also weighted MFlop/s are available. These are like odinary MFlop/s, except that divisions enter the evaluation with a weight different from the other floating point operations. The weight factor is 13
14 provided by the user through the evironment variable HPM DIV WEIGHT. If set to 1, the weighted MFlop/s coincide with the ordinary MFlop/s. HPM DIV WEIGHT can take any positive integer number. If this environment variable is not set, no weighted MFlop/s are computed Latency Computation In addition, users can provide estimations of memory, cache, and TLB miss latencies for the computation of derived metrics, with the following environment variables (please notice that not all flags are valid in all systems): HPM MEM LATENCY latency for a memory load. HPM AVG L3 LATENCY average latency for an L3 load. HPM L3 LATENCY latency for an L3 load within a MCM. HPM L35 LATENCY latency for an L3 load outside of the MCM. HPM AVG L2 LATENCY average latency for an L2 load. HPM L2 LATENCY latency for an L2 load from the processor. HPM L25 LATENCY latency for an L2 load from the same MCM. HPM L275 LATENCY latency for an L2 load from another MCM. HPM TLB LATENCY latency for a TLB miss. When computing derived metrics that take into consideration estimated latencies for L2 or L3, the HPM Toolkit will use the provided average latency only if the other latencies for the same cache level are not provided. For example, it will only use the value set in HPM AVG L3 LATENCY, if at least one of the values of HPM L3 LATENCY and HPM L35 LATENCY is not set. If environment variables are frequently used, they can be collected in a file like this. 14
15 $ cat docs/examples/hpm\_flags.env-example export HPM\_MEM\_LATENCY=400 export HPM\_L3\_LATENCY=102 export HPM\_L35\_LATENCY=150 export HPM\_L2\_LATENCY=12 export HPM\_L25\_LATENCY=72 export HPM\_L275\_LATENCY=108 export HPM\_TLB\_LATENCY=700 export HPM\_DIV\_WEIGHT=5 The following command would enable these environment variables. $. docs/examples/hpm\_flags.env-example 2.6 Inheritance On both, AIX and Linux, the counter virtualization and the group (i.e. set of events) that is actually monitored is inherited from the process to any of its children. Children in this context means threads or processes spawned by the parent process. AIX and Linux, however differ in the ability of the parent process to access the counter values of its children. On AIX all counter values of a process group can be collected. On Linux counter values are only available to the parent, if the child has finished. hpccount makes use of this inheritance. Therefore, if hpccount is called for a program, the returned counter values are the sum of the counter values of the program and all of the threads and processes spawned by it - at the time the values are collected. For Linux this has to be restricted to the sum of counter values of all children that have finished at the time the values are collected. Even the latter is enough to catch the values of all threads of an OpenMP program. Also, suppose some user is using a program to bind threads to CPUs. Further, suppose this program is called taskset and it would be used like this. 15
16 hpccount taskset -c <num> <program_name> hpccount would first enable hardware event counting for the application /usr/bin/taskset. This command then spawns the program <program name>, which inherits all event counter settings. At the end hpccount would print counter values (and derived metrics) based on the sum of events for taskset and the called program. Since taskset is a very slim application, the hpccount results would vastly represent the performance of the program <program name> which is what the user intended. 2.7 Considerations for MPI Parallel Programs General Considerations hpccount is an inherently sequential program, looking only at the hardware performance counters of a single process (and its children, as explained in section 2.6 Inheritance). When started with poe or mpirun, one instance of hpccount is running for each MPI task. Unless additional action is taken as described in the following sub sections, all these instances of hpccount are completely ignorant of each other. Consequently, each instance is writing its own output. If the option -o is used, each instance is using the same file name, which results in writing into the same file, if a parallel file system is used. Of course, this can be (and should be) prevented by making the file names unique through the -u option or the HPM UNIQUE FILE NAME environment variable. Still it might be an unwanted side effect to have that many output files. For this reason the -a option (or equivalently, the environment variable HPM AGGREGATE ) triggers some aggregation before (possibly) restricting the output to a subset of MPI tasks. This formulation is deliberately vague, because there can be many ways to aggregate hardware performance counter information across MPI tasks. One way is to take averages, but maximum or minimum values could be also thought of. The situation is further complicated by allowing to run different groups on different MPI tasks. After all, the instances of hpccount are independent, which should allow for this strategy. On architectures that allow for multiplexing (as described in section 2.4 Multiplexing), some tasks could use multiplexing, others may not. Of course averages, maxima and minima should only be taken on groups which are alike. 16
17 Therefore the -a option and the environment variable HPM AGGREGATE take a value, which is the name of a plug-in that defines the aggregation strategy. Each plug-in is a shared object file containing two functions called distributor and aggregator Distributors The motivating example for the distributor function is allowing a different hardware counter group on each MPI task. Of course this should be trivially possible if different environment variable settings (or different hpccount options) can be passed to different MPI tasks. Although many MPI stacks allow for MPMD (multiple program multiple data) execution, it might be tedious and impractical to use the MPMD machinery just to vary the counting groups across the MPI tasks. Therefore, the distributor is a subroutine that determines the MPI task id (or MPI rank with respect to MPI COMM WORLD) from the MPI environment for the current process, and (re)sets environment variables depending on this information. The environment variable may be any environment variable, not just HPM EVENT SET, which motivated this function. Consequently, the distributor is called before any environment variable is evaluated by HPM. Command line options for hpccount and hpcstat trigger (re)setting the corresponding environment variables, which are then passed to the distributor. Thus, the setting from the distributor takes precedence over both, options and global environment variable settings. Of course, the aggregator has to adapt to the HPM group settings done by the distributor. This is why distributors and aggregators always come in pairs. Each plug-in is containing just one such pair Aggregators The motivating example is the aggregation of the hardware counter data across the MPI tasks. In the simplest case this could be an average of the corresponding values. Hence this function is called after the hardware counter data have been gathered, before the derived metrics are computed. 17
18 before these data are printed, In a generalized view, the aggregator is taking the raw results and rearranges them for output. Also, depending on the information of the MPI task id (or MPI rank with respect to MPI COMM WORLD) the aggregator sets (or doesn t set) a flag to mark the current MPI task for HPM printing Plug-ins shipped with the Tool Kit The following plug-ins are shipped with the toolkit. They can be found in $(IHPCT_BASE)/lib or $(IHPCT_BASE)/lib64 mirror.so is the plug-in that is called when no plug-in is requested. The aggregator is mirroring the raw hardware counter data in a one-to-one fashion into the output function. Hence this name. It is also flagging each MPI task as printing task. The corresponding distributor is a void function. This plug-in doesn t use MPI and also works in a non-mpi context. loc merge.so does a local merge on each MPI task separately. It is identical to the mirror.so plug-in except for those MPI tasks that change the hardware counter groups in the course of the measurement (e.g. by multi-plexing). The different counter data, which are collected for only part of the measuring interval, are proportionally extended to the whole interval and joined into one big group that is entering derived metrics computation. This way, more derived metrics can be determined at the risk of computing garbage. The user is responsible for using this plug-in only when it makes sense to use it. It is also flagging each MPI task as printing task. The corresponding distributor is a void function. This plug-in doesn t use MPI and also works in a non-mpi context. single.so does the same as mirror.so, but only prints the results for one MPI task. The printing task can be specified via environment variable HPM PRINT TASK. This environment variable should be set to the value of the MPI rank with respect to the communicator MPI COMM - WORLD. The default value is 0. The output on all other tasks is 18
19 discarded. This plug-in uses MPI functions and can t be used in a sequential context. average.so is a plug-in for taking averages across MPI tasks. The distributor is reading the environment variable HPM EVENT SET (which is supposed to be a comma separated list of group numbers) and distributes these group numbers in a round robin fashion to the MPI tasks. In case multi-plexing is available, the groups that are multiplexed are also specified by a comma separated list. The environment variable HPM ROUND ROBIN CLUSTER is used to separate round robin distribution among MPI tasks from multiplexing. If the value of HPM ROUND ROBIN CLUSTER is an integer m > 0, then the comma separated list HPM EVENT SET is split in a list of m- tupels, and the round robin distribution is applied to the resulting list of m-tupels. The default value for HPM ROUND ROBIN CLUSTER is 1. The aggregator is first building a MPI communicator of all tasks with equal hardware performance counting scenario. The communicator groups may be different from the original round robin distribution. This may happen if the conting group has been changed on some of the MPI tasks after the first setting by the distributor. Next the aggregator is taking the average across the subgroups formed by this communicator. Finally it is flagging the MPI rank 0 in each group as printing host. This plug-in uses MPI functions and can t be used in a sequential context. poe hpccount -procs 6 -a average.so \ -g 0,1,5,25,29,30,31,32,44,45,52,94,112,114,153 \ -nuxo climber./clb.x > climber.out 2>&1 MPI task HPM group numbers export HPM_ROUND_ROBIN_CLUSTER=3 poe hpccount -procs 6 -a average.so \ -g 0,1,5,25,29,30,31,32,44,45,52,94,112,114,153 \ -nuxo climber./clb.x > climber.out 2>&1 19
20 MPI task HPM group numbers 0 0, 1, , 29, , 32, , 52, , 114, , 1, User defined Plug-ins There can be no doubt that this set of plug-ins can only be a first starter kit and many more might be desirable. Rather than taking the average one could think of taking maximum or minimum. There is also the possibility of taking kind of a history merge.so by blending in results from previous measurements. Chances are that however big the list of shipped plug-ins may be, the one just needed is missing from the set ( Murphy s law of HPM plugins ). The only viable solution comes with disclosing the interface between plug-in and tool and allowing for user defined plug-ins. The easiest way to enable users to write their own plug-ins is by providing examples. Hence the plug-ins described above are provided in source code together with the Makefile that was used to generate the shared objects files. These files can be found in the following place. $(IHPCT_BASE)/examples/plugins Detailed Interface Description Each distributor and aggregator is a function returning an integer which is 0 on success and! = 0 on error. In most cases the errors occur when calling a system call like malloc(), which sets the errno variable. If the distributor or aggregator returns the value of errno as return code, the calling HPM tool sees to an expansion of this errno code into a readable error message. If returning the errno is not viable, the function should return a negative value. The function prototypes are defined in the following file. $(IHPCT_BASE)/include/hpc_agg.h 20
21 This is a very short file with the following contents. #include "hpc_data.h" int distributor(void); int aggregator(int num_in, hpm_event_vector in, int *num_out, hpm_event_vector *out, int *is_print_task); The distributor has no parameters and is only required to (re)set environment variables ( via setenv() ). The aggregator takes the current hpm values on each task as an input vector in and returns the aggregated values on the output vector out on selected or all MPI tasks. To have utmost flexibility, the aggregator is responsible to allocate the memory needed to hold the output vector out. The definition of the data types used for in and out are provided in the following file. $(IHPCT_BASE)/include/hpc_data.h Finally the aggregator is supposed to set (or unset) a flag to mark the current MPI task for HPM printing. Form the above definitions it is apparent that the interface is defined in C-Language. While it is in principle possible to use another language for programming plug-ins, the user is responsible for using the same memory layout for the input and output variables. There is no explicit FORTRAN interface provided. The hpc event vector in is a vector or list of num in entries of type hpc data item. The latter is a struct containing members that describe the definition and the results of a single hardware performance counting task. /* NAME INDEX */ #define HPM_NTIM 8 #define HPM_TIME_WALLCLOCK 0 #define HPM_TIME_CYCLE 1 #define HPM_TIME_USER 2 21
22 #define HPM_TIME_SYSTEM 3 #define HPM_TIME_START 4 #define HPM_TIME_STOP 5 #define HPM_TIME_OVERHEAD 6 #define HPM_TIME_INIT 7 typedef struct { int num_data; hpm_event_info *data; double times[hpm_ntim]; int is_mplex_cont; int is_rusage; int mpi_task_id; int instr_id; int count; int is_exclusive; int xml_element_id; char *description; char *xml_descr; } hpm_data_item; typedef hpm_data_item *hpm_event_vector; Counting the events from a certain HPM group on one MPI task is represented by a single element of type hpc data item. If multiplexing is used, the results span several consecutive elements, each dedicated to one HPM group that take part in the multiplex setting. On all but the first element the member is mplex cont is set to TRUE to indicate that these elements are continuations of the first element belonging to the same multiplex setup. If HPM groups are changed during the measurement, the results for different groups are recorded in different vector elements, but no is mplex cont flag is set. This way results obtained via multiplexing can be distinguished from results obtained by ordinary group change. If libhpc and several instrumented sections are used, each instrumented code section will use separate elements of type hpc data item to record the results. Each of these will have the member instr id set with the 22
23 first argument of hpmstart and the logical member is exclusive set to TRUE or FALSE depending on whether the element hold inclusive or exclusive counter results (see section 3.7 Inclusive and Exclusive Values for details). Then all these different elements are concatenated into a single vector. Finally, hpccount, libhpc and hpcstat prepend the data from a call to getrusage() to this vector, so the rusage data form the vector element with index 0. This vector element is the only element with struct member is rusage set to TRUE to distinguish it from ordinary hardware performance counter data. The output vector is of the same format. Each vector element enters the derived metrics computation separately (unless is rusage == TRUE ). Then all vector elements (and the corresponding derived metrics) are printed in the order given by the vector out. The output of each vector element will be preceded by the string given in member description (which may include line feeds as appropriate). The XML output will be marked with the text given in xml descr. This way the input vector in is providing a complete picture of what has been measured on each MPI task. The output vector out is allowing complete control on what is printed on which MPI task in what order Getting the plug-ins to work The plug-ins have been compiled with the following Makefile using this command. $(IHPCT_BASE)/examples/plugins/Makefile <g>make ARCH=<appropriate_archtitecture> The include files for the various architectures are provided in subdirectory make. The user is asked to note a couple of subtleties. The Makefile distinguishes sequential (specified in PLUGIN SRC) and parallel plug-ins (specified in PLUGIN PAR SRC). The latter 23
24 are compiled and linked with the MPI wrapper script for the compiler/ linker. Unlike a static library, generation of a shared object requires linking, not just compilation. On BG/L there are no shared objects, so ordinary object files are generated. On BG/L and BG/P just everything is parallel. If the MPI software stack requires the parallel applications to be linked with a special start-up code (like poe remote main() for IBM MPI on AIX), the shared object has to carry this start-up code. hpccount is a sequential application. Therefore the start-up code has to be loaded and activated when the plug-in is loaded at run time. This turns the sequential application hpccount into a parallel application on the fly. This sounds complicated but works pretty seamlessly, at least for IBM MPI for user space protocol and MPICH and its variants. No further user action is required to make this work. There are, however, some restrictions to be observed when writing plugin code. The MPI standard document disallows calling MPI Init() twice on the same process. It appears that this is indeed not supported on the majority of MPI software stacks, not even if an MPI Finalize() is called between the two invocations of MPI Init(). hpccount is starting the user application via fork() and exec(). If hpccount would be starting MPI init() prior to the fork() (i.e. in the distributor), chances are that the parallel environment would be inherited across fork() and exec() and hence would collide with the MPI Init() from the user application. Even an MPI Finalize() at the end of the distributor does not help for the MPI Init() calls in the user application and the aggregator. Hence the distributor must not call any MPI function.. The MPI task id should be extracted by inspecting environment variables that have been set by the MPI software stack. The aggregator, however, is executed in a different process than the user application, so it cannot participate from the parallel environment of the user application. It is usually fired up after the user application has finalized its MPI environment. Sitting on a different process the aggregator can and should initiate its own parallel environment. Fortunately, all tested MPI software stacks reacted cooperative when hpccount out of a sudden turned into a parallel application and tried to reuse the parallel set up from the previously ended user application. The good news is that hpccount turns parallel after the user 24
25 application has ended. Hence there is no competition for interconnect resources between hpccount and the user application. hpccount uses a call to dlopen() to access the plug-in and makes use of its functions. There is no dlopen() on BG/L, but there is no fork() - and hence no hpccount on BG/L and BG/P either. The sequential plug-ins are independent on the MPI software stack. Hence they can be continued to be used even if the MPI software is changed. The parallel plugins have to be re-compilated against the new MPI software stack. 2.8 Shared Object Trouble Shooting Occasionally one of the following error messages occur. Problem: hpccount: error while loading shared libraries: libperfctr.so.6: cannot open shared object file: No such file or directory Solution: The Linux versions are based on the perfctr kernel extension and libperfctr.a. Either libperfctr.a (more precisely libperfctr.so.6) is not there; please check the prerequisites 1. Or the library exists, but resides in an unusual place. In the latter case, please use the environment variable LD LIBRARY PATH like in the following example. export LD_LIBRARY_PATH=~/perfctr /usr.lib Problem: hpccount: error while loading shared libraries: liblicense.so: cannot open shared object file: No such file or directory Solution: Most probably, liblicense.so is searched in the wrong place. Please execute the following command (for bash). export LD_LIBRARY_PATH=$IHPCT_BASE/lib:\ $IHPCT_BASE/lib64:$LD_LIBRARY_PATH 25
26 Problem: $ hpccount -a not_there.so hostname HPM ERROR - Dynamic link error at dlopen(): not_there.so: cannot open shared object file: No such file or directory Solution: Either the plug-in is really not there (as the name indicates), or it is not found. In the latter case, (for bash) please execute the following command. export LD_LIBRARY_PATH=$IHPCT_BASE/lib:\ $IHPCT_BASE/lib64:$LD_LIBRARY_PATH 3 libhpc 3.1 Quick Start hpccount (see section 2) provides hardware performance counter information and derived hardware metrics (see section 2.5) for the whole program. If this information is required for only part of the program, instrumentation with libhpc is required. Libhpc is a library that provides a programming interface to start and stop performance counting for an application program. The part of the application program between start and stop of performance counting will be called an instrumentation section. Any such instrumentation section will be assigned a unique integer number as section identifier. A simple case of an instrumented program may look as follows. hpminit( tasked, my program ); hpmstart( 1, outer call ); do_work(); hpmstart( 2, computing meaning of life ); do_more_work(); hpmstop( 2 ); hpmstop( 1 ); hpmterminate( taskid ); 26
27 Calls to hpminit() and hpmterminate() embrace the instrumented part, every instrumentation section starts with hpmstart() and ends with hpm- Stop(). The section identifier is the first parameter to the latter two functions. As shown in the example, libhpc supports multiple instrumentation sections, overlapping instrumentation sections, and each instrumented section can be called multiple times. When hpmterminate() is encountered, the counted values are collected and printed. The program above provides an example of two properly nested instrumentation sections. For section 1 we can consider the exclusive time and exclusive counter values. By that we mean the difference of the values for section 1 and section 2. The original values for section 1 would be called inclusive values for matter of distinction. The terms inclusive and exclusive for the embracing instrumentation section are chosen to indicate whether counter values and times for the contained sections are included or excluded. For more details see section 3.7 on inclusive and exclusive values. Libhpc supports OpenMP and threaded applications. There is only a thread safe version of libhpc. Either a thread-safe linker invocation (e.g. xlc r, xlf r) should be used or the libpthreads.a must be included in the list of libraries. For details on how to compile and link an application with Libhpc please go to section 3.14 on compiling and linking. Notice that libhpc collects information and performs summarization during run-time. Thus, there could be a considerable overhead if instrumentation sections are inserted inside inner loops. Libhpc uses the same set of hardware counters events used by hpccount (see section 2). If some error occurs the program is not automatically stopped. libhpc rather sets some error indicator and let the user handle the error. For details see section 3.8 on function reference. 3.2 Events and Groups The hardware performance counters information is the value of special CPU registers that are incremented at certain events. The number of such registers is different for each architecture. 27
28 Processor Architecture Number of performance counter registers PPC970 8 Power4 8 Power5 6 Power5+ 6 Power6 6 BG/L 52 BG/P 256 On both AIX and Linux, kernel extensions provide counter virtualization, i.e. the user sees private counter values for his application. On a technical side, the counting of the special CPU registers is frozen and the values are saved whenever the application process is taken off the CPU and another process gets scheduled. The counting is resumed when the user application gets scheduled on the CPU. On BlueGene, however, things are slightly different, as the currently booted partition only runs the user application and nothing else. Hence there is no counter virtualization. This has a couple of consequences as detailed in sub section 3.3 on BlueGene counter issues. The special CPU registers can count different events. On the Power CPUs there are restrictions which registers can count what events. A call to hpccount -c will list all CPU counting registers and the events they can be monitoring. Even more, on AIX and Linux there are lots of rules restricting the concurrent use of different events. Each valid combination of assignments of events to hardware counting registers is called a group. To make handling easier, a list of valid groups is provided. A call to hpccount -l will list all available groups and the events they are monitoring. The group or event set to be used can be selected via the environment variable: HPM EVENT SET. If the environment variable HPM EVENT SET is not specified, a default group will be taken according to the following table. 28
29 Processor Architecture Number of groups Default group PPC Power Power5 148(140) 137 Power Power BG/L 16 0 BG/P 4 0 The number of groups for Power5 is 140 for AIX 5.2, and 148 for Linux and AIX 5.3. The reason for this difference are different versions of bos.pmapi.the last group (139) was changed and 8 new groups were appended. If HPM is called with export HPM_EVENT_SET=<a_new_group_number> on AIX 5.2, it returns the following error message. hpccount ERROR - pm_set_program_mygroup: pm_api : event group ID is invalid On BG/P, there are 4 groups, but only the first two are intended for use by application developers. The system default setting is group 0 on even numbered compute cards, group 1 on odd numbered compute cards. This system default is carried over to libhpc without change. This should obliviate the need to change the group via HPM EVENT SET in many cases. 3.3 BlueGene counter issues BlueGene counter design On BlueGene the user boots a partition which then runs his application, the compute node kernel and nothing else. Hence there is no need to virtualize the counters, i.e. to start and stop to counters whenever the application is scheduled on or taken off the CPU. On BG/L, there are no threads either. Particularly in coprocessor mode, there is a one-to-one map of compute nodes 29
30 to MPI tasks. So the user has to start and stop the counters on a compute node and he gets the results for the MPI task that is running on this compute node. On BG/P things are more complicated, as there are three different modes (VN, DUAL and SMP) and various scenarios of deploying threads and tasks on the four cores of a compute node. Nevertheless there is only one set of counters per compute node. Moreover, the documentation strongly recommends that only one core should start, stop and read the counters BlueGene/P counter control There is only one instance of performance counter interface per compute node. All tasks or threads running on this node have to share this interface. BGP UPC has 4 basic modes: modes 0, 1 are the main modes mode 0 gives info on processors 0 and 1 mode 1 gives info on processors 2 and 3 modes 2, 3 are mostly hold events useful to vhdl designers The following rules describe default mode. Regardless of DUAL/VN mode (for SMP see below). even numbered compute cards use BGP UPC MODE 0 odd numbered compute cards use BGP UPC MODE 1 The compute card numbering id defined via the component card number from the universal component identifier. The UPC documentation strongly recommends that only one core (or the thread running on this core) controls the performance counter interface. HPM implements this recommendation by defining the the notion of one core (or thread) having the UPC control. This thread is actually executing the counter start and stop commands. For the other cores on the same compute node the start and stop calls are empty calls. 30
31 Even then, depending on the scenario, the controling thread may collect data for other threads or MPI tasks. This can be a problem as the other threads or MPI tasks may run asynchronously. Hence the exact statement currently executed by the other threads or tasks are in the program is unknown. Therefore it is unclear for what part of the program the counter information is collected. To minimize this effect, the controlling core is chosen depending on the value of HPM EVENT SET (which translates to the BGP UPC mode). core 0 for BGP UPC MODE 0 or default mode with even card number. core 2 for BGP UPC MODE 1 or default mode with odd card number. core 0 for BGP UPC MODE 2 and BGP UPC MODE 3 The user can overrule this choice by setting the environment variable HPM UPC CONTROL to some value in {0, 1, 2, 3}. The default choice is appropriate for VN or DUAL modes where core 0 or 2 are always running the master thread of some process (MPI task). In SMP mode, UPC mode 1 is measuring core 2 and 3 which translates to thread 2 and 3. These threads might not have been spawned at all. This could happen if the code is running 2 threads per MPI task but is using SMP mode to get more memory per thread. To accomodate for that, the default group in SMP mode is set to 0 on all compute nodes. Introducing the concept of cores (or threads) having UPC control also implies that all other cores (or threads) execute empty start or stop commands. To mark these results as invalid, the current HPM group is set to HPM INVALID GROUP. This has consequences when HPM AGGREGATE == average.so (see descriptions of plugins at ). The MPI communicator files all occurences of HPM INVALID GROUP into a separate MPI task group. This way, garbage values are filtered out when averages are taken BlueGene/P output control Depending on the plugin that is used, not all MPI tasks are generating files. On BlueGene/P this is further restricted as output is suppressed for all MPI 31
32 tasks that don t have UPC control. Without this extra filter, result files for HPM INVALID GROUP would spam the output directory. For HPM AGGREGATE == average.so, this means that the garbage results are collected in a separate MPI task group, but printing of this averaged garbage is suppressed. For HPM AGGREGATE == single.so, printing is restricted to only one MPI task and may be suppressed alltogether if the printing task happens to be a task without UPC control. 3.4 Multiplexing The idea behind multiplexing is to run several groups concurrently. This is accomplished by running the first group for a short time interval, then switching to the next group for the next short time interval, and keep doing this in a round robin fashion for the groups until the event counting is eventually stopped. HPM supports multiplexing only on AIX5. The groups are specified as a comma separated list. export HPM_EVENT_SET= 1,2 On Operating systems other than AIX5 this leads to the following error message. HPM ERROR - Multiplexing not supported: too many groups or events specified: 2 Of course multiplexing means that neither of the groups has been run on the whole code. Likewise it is unknown what fraction of the code was measured with which group. It is assumed that the workload is sufficiently uniform that the measured event counts can be (more or less) safely calibrated as if the groups have been run separately on the whole code. The default time interval for measuring one group on the application is 100ms. If the total execution time is shorter than this time interval, only the first group in the list will be measured. All other counter values are 0. This might result in NaNQ values for some derived metrics (see section 3.5 on derived metrics), if the formula for computing the derived metric requires division by the counter value 0. 32
33 The duration of this time interval can be controlled by setting the following environment variable. export HPM_SLICE_DURATION=<integer value in ms> This value is passed directly to AIX (more precisely bos.pmapi). AIX requires the value to lie between 10ms an 30s. The form of the output depends on the chosen aggregator (see sub section on Aggregators). Without specifying an aggregator (i.e. with the default aggregator), the data for each group is printed in a separate section with separate timing information. To have these data joined into one big group with more counters, one should use the local merge aggregator (loc merge.so), which described below. 3.5 Derived Metrics What are Derived Metrics Some of the events are difficult to interpret. Sometimes a combination of events provide better information. In the sequel, such a recombination of basic events will be called derived metric. HPM also provides a list of derived metrics, which are defined in section Derived Metrics Description below. Since each derived metric has its own set of ingredients, not all derived metrics are printed for each group. HPM automatically finds those derived metrics which are computable and prints them. As a convenience to the user, not only the value of the derived metric, but also its definition will be printed out, if the environment variable HPM PRINT FORMULA is set MFlop Issues The two most popular derived metrics are the MFlop/s rate and the percentage of peak performance. The default group is chosen to make those two derived metrics available without special choice of the environment variable HPM EVENT SET. For Power5, there is no group that supports enough counters to compute a MFlop/s rate. So an Algebraic MFlop/s rate was invented to bridge 33
34 this gap. This derived metric counts floating point adds, subs and mults (including FMAs), but misses divides and square roots. If the latter two only occur in negligible numbers (which is desirable for a HPC code anyway), the Algebraic MFlop/s rate coincides with the usual definition of MFlop/s. Again, different counter groups can be used to check this hypothesis. Group 137 (which exploits the Algebraic MFlop/s rate ) is chosen the default group for Power5. The derived metric percent of peak performance was added new in this version. For all, PPC970, Power4 and Power5, this is based on user time rather than wall clock time, as the result stays correct if multithreaded (e.g. OpenMP) applications are run. For Power5, this is based on Algebraic MFlop/s. This has not been tested on AIX 5.3, particularly when SMT is active. Flip-flop blues: Compared to the previous version, the meanings of MFlip/s and MFlop/s are swapped. Not only many users were confused by the name MFlip/s being used for what they expected to be MFlop/s. Also Ptools (notably PAPI) is using a different nomenclature. HPM derived metric naming was changed to conform with this emerging standard. On Power4, PPC970 and Power6 also weighted MFlop/s are available. These are like odinary MFlop/s, except that divisions enter the evaluation with a weight different from the other floating point operations. The weight factor is provided by the user through the evironment variable HPM DIV WEIGHT. If set to 1, the weighted MFlop/s coincide with the ordinary MFlop/s. HPM DIV WEIGHT can take any positive integer number. If this environment variable is not set, no weighted MFlop/s are computed Latency Computation In addition, users can provide estimations of memory, cache, and TLB miss latencies for the computation of derived metrics, with the following environment variables (please notice that not all flags are valid in all systems): HPM MEM LATENCY latency for a memory load. HPM AVG L3 LATENCY average latency for an L3 load. HPM L3 LATENCY latency for an L3 load within a MCM. 34
35 HPM L35 LATENCY latency for an L3 load outside of the MCM. HPM AVG L2 LATENCY average latency for an L2 load. HPM L2 LATENCY latency for an L2 load from the processor. HPM L25 LATENCY latency for an L2 load from the same MCM. HPM L275 LATENCY latency for an L2 load from another MCM. HPM TLB LATENCY latency for a TLB miss. When computing derived metrics that take into consideration estimated latencies for L2 or L3, the HPM Toolkit will use the provided average latency only if the other latencies for the same cache level are not provided. For example, it will only use the value set in HPM AVG L3 LATENCY, if at least one of the values of HPM L3 LATENCY and HPM L35 LATENCY is not set. If environment variables are frequently used, they can be collected in a file like this. $ cat docs/examples/hpm\_flags.env-example export HPM\_MEM\_LATENCY=400 export HPM\_L3\_LATENCY=102 export HPM\_L35\_LATENCY=150 export HPM\_L2\_LATENCY=12 export HPM\_L25\_LATENCY=72 export HPM\_L275\_LATENCY=108 export HPM\_TLB\_LATENCY=700 export HPM\_DIV\_WEIGHT=5 The following command would enable these environment variables. $. cat docs/examples/hpm\_flags.env-example 3.6 Inheritance The counter virtualization and the group (i.e. set of events) that is actually monitored is inherited from the process to any of its children, inparticular 35
36 threads that are spawned vi OpenMP. But there are differences among the various operating systems. On AIX all counter values of a process group can be collected. On Linux and Blue Gene counter values are only available to the parent, when the child has finished. To make use of that concept, libhpc provides two flavors of start and stop functions. hpmstart and hpmstop start and stop counting on all processes and threads of a process group. hpmtstart and hpmtstop start and stop counting only for the thread from which they are called. On Linux and Blue Gene the first flavor of start and stop routines can not be properly implemented, because the parent has no access to the counting environment of the child before this child has ended. Therefore the functionality of hpmstart/hpmstop is disabled on Linux and Blue Gene. The calls to hpmstart/hpmstop are folded into calls to hpmtstart/hpmtstop. As a result, they are identical and can be freely mixed on Linux and Blue Gene. This is, however, not advisable to do, as an instrumentation like this would not port to AIX. 3.7 Inclusive and Exclusive Values What are Exclusive Values? For a motivation of the term exclusive values please look at sub section 3.1 Quick Start above. This program snippet provides an example of two properly nested instrumentation sections. For section 1 we can consider the exclusive time and and exclusive counter values. By that we mean the difference of the values for section 1 and section 2. The original values for section 1 would be called inclusive values for matter of distinction. The terms inclusive and exclusive for the embracing instrumentation section are chosen 36
37 to indicate whether counter values and times for the contained sections are included or excluded. Of course the extra computation of exclusive values generates overhead which is not always wanted. Therefore the computation of exclusive values is only carried out if the environment variable HPM EXCLUSIVE VALUES is set to Y[...], y[...] or 1 or if the HPM ONLY EXCLUSIVE parameter is used as outlined in the following section. The exact definition of exclusive is based on parent-child relations among the instrumented sections. Roughly spoken, the exclusive value for the parent is derived from the inclusive value of the parent reduced by the inclusive value of all children. In previous versions of HPM, instrumented sections had to be properly nested. This generated a natural parent-child relation. Since the children didn t overlap (if there was more than one child anyway), the exclusive duration was naturally defined to be the inclusive duration of the parent minus the sum of the inclusive durations of all children. In this version of HPM, instrumented sections need not be to be properly nested, but can overlap in arbitrary fashion. Unfortunately, this destroys (or at least obscures) the natural parent-child relations among instrumented sections and complicates the definition of exclusive values Parent-Child Relations HPM provides an automatic search for parents, which is supposed to closely mimic the behavior for strictly nested instrumented regions. It roughly follows the way that the previous version of HPM was going. For strictly nested instrumented sections, the call to hpmstart or hpmtstart for the parent has to occur prior to the corresponding call for the child. In a multi-threaded environment, however, this causes problems, if the children are executed on different threads. In a kind of race condition, a child may mistake his brother for his father. This generates weird parent child relations, which change with every execution of the program. Actually, the previous version of HPM could exhibit this behavior in certain circumstances. To avoid the race condition safely, the search is restricted to calls from the own thread only, as only these exhibit a race condition free call history. The parent found in this history is the last call of the same kind (i.e. both were started with hpmstart or both are started with hpmtstart or their corresponding FORTRAN equivalences) that has not posted a matching hpmstop or hpmtstop meanwhile. If no 37
38 parent is found that matches these rules, the child is declared an orphan. As a consequence, automatic parent child relations are never established across different threads. There may be situations where the automatic parent child relations prove unsatisfactory. To help this matter, new calls in the HPM API have been introduced to enable the user to establish the relations of his choice. These functions are hpmstartx and hpmtstartx and their FORTRAN equivalents. The additional x in the function name could be interpreted as extended or explicit. The first two parameters of this function are the instrumented section ID and the ID of the parent instrumented section. The user has the following choices for the parent ID. HPM AUTO PARENT This triggers the automatic search and is equivalent the classical start routines hpmstart and hpmtstart. Indeed the classical routines are implemented through calls to hpmstartx and hpmtstartx with parent ID specified as HPM AUTO PARENT. HPM ONLY EXCLUSIVE This is essentially the same as the previous HPM AUTO PARENT, but sets the exclusive flag to TRUE on this instance only. The environment variable HPM EXCLUSIVE VALUES sets this flag globally for all instrumented sections. HPM NO PARENT This suppresses any parent child relations. an integer This has to point to an instrumented section with the following restrictions. It has to exist when the call to hpmstartx or hpmtstartx is made. It has to be of the same kind (i.e. both were started with hpm- Start or both are started with hpmtstart or their corresponding FORTRAN equivalences) Otherwise HPM will exit with an error message like the following. hpccount ERROR - Illegal instance id specified In the very last consequence, the user is responsible for establishing meaningful parent child relations. The good news is that these parent child relations only affect the computation of exclusive values. In the worst case, these are just bogus, but this wouldn t effect any other result. 38
39 3.7.3 Handling of Overlap Issues As the user can establish almost arbitrary parent child relations, the definition of the explicit duration or explicit counter values is far from being obvious. Each instrumented section can be represented by the corresponding subset of the time line. Actually this subset is a finite union of intervals with the left or lower boundaries marked by calls to hpmstart[x]/hpmtstart[x], the right or upper boundaries are marked by calls to hpmstop/hpmtstop. The duration is just the accumulated length of this union of intervals. The counter values are the number of those events that occur within this subset of time. Basically, the exclusive times and values are the times and values, when no child has a concurrent instrumented section. Hence the main step in defining the meaning of exclusive values is defining the subset of the time line to which they are associated. This is done in several steps. Represent the parent and every child by the corresponding subset of the time line (henceforth called the parent set and the child sets). Take the union of the child sets. Reduce the parent set by the portion that is overlapping with this union. Using set theoretic terms, we take the difference of the parent set with the union of the child sets. The exclusive duration is just the accumulated length of the resulting union of intervals. The exclusive counter values are the number of those events that occur within this subset of time Computation of Exclusive Values for Derived Metrics The task of computing exclusive values for derived metrics may sound complicated at first. But it is actually very simple, given the work already done in the previous subsections. The basic observation is that we are given a subset of the time line that is associated to the notion of exclusive values. There is no need to care about the way how this set was constructed; just 39
40 assume the interval boundaries are marked by calls to hpmstart and hpm- Stop for a new virtual instrumented section. In this case it is obvious how to compute the derived metrics - just apply the usual definitions! 3.8 Function Reference The subroutines provided by libhpc have no return value. In case of some error the global integer variable hpm error count is updated. The user is encouraged to check this variable to have his application gracefully exit from HPM errors. As it is difficult for FORTRAN programs to accesss C global variables, there is a logical function f_hpm_error() which returns TRUE if an error occurred inside libhpc and FALSE otherwise. For parallel FORTRAN programs the user is encouraged to implement a subroutine like this. C Error Check SUBROUTINE F_HPM_ERRCHK INTEGER ierr LOGICAL f_hpm_error EXTERNAL f_hpm_error IF ( f_hpm_error() ) THEN CALL MPI_Abort(MPI_COMM_WORLD, 4, ierr) END IF RETURN END A parallel C version would look like this. #ifdef HPM #include "libhpc.h" #define hpm_errchk if (hpm_error_count) \ MPI_Abort(MPI_COMM_WORLD,4) #endif /* HPM */ 40
41 The API provided by libhpc is now descibed in detail. hpminit( taskid, progname ) f_hpminit( taskid, progname ) taskid is an integer value. It is now depreciated. In earlier version this was indicating the node ID. It is no longer used and can be set to any value. progname is a string with the program name. If the environment Variable HPM OUTPUT NAME is not set, this string will be used as a default value for the output name. hpmstart( instid, label ) f_hpmstart( instid, label ) instid is the instrumented section ID. It should be > 0 and To run a program with more than 1000 instrumented sections, the user should set the environment variable HPM NUM INST PTS. In this case, instid should be less than the value set for HPM NUM INST PTS. Label is a string containing a label, which is displayed by PeekPerf. hpmstartx( instid, par\_id, label ) f_hpmstartx( instid, par\_id, label ) instid is the instrumented section ID. It should be > 0 and To run a program with more than 1000 instrumented sections, the user should set the environment variable HPM NUM INST PTS. In this case, instid should be less than the value set for HPM NUM INST PTS. par ID is the instrumentation ID of the parent section (see section 3.7 Inclusive and Exclusive Values) Label is a string containing a label, which is displayed by PeekPerf. hpmstop( instid ) f_hpmstop( instid ) 41
42 For each call to hpmstart, there should be a corresponding call to hpmstop with matching instid. If not provided explicitely, in implicit call to hpmstop will be made at hpmterminate. hpmtstart( instid, label ) f_hpmtstart( instid, label ) hpmtstartx( instid, par\_id, label ) f_hpmtstartx( instid, par\_id, label ) hpmtstop( instid ) f_hpmtstop( instid ) In order to instrument threaded applications, one should use the pair hpmtstart and hpmtstop to start and stop the counters independently on each thread. Notice that two distinct threads using the same instid will generate an error. See the Section 3.12 on multi-threaded issues for examples. hpmgettimeandcounters( numcounters, time, values ) f_gettimeandcounters ( numcounters, time, values ) hpmgetcounters( values ) f_hpmgetcounters ( values ) These functions have been temporarily disabled in this release. They will be reintroduced in the next release. hpmterminate( taskid ) f_hpmterminate( taskid ) All active instrumented code sections will receive an hpmstop This function will generate the output. If the program exits without calling hpmterminate, no performance information will be generated. 42
43 3.9 Measurement Overhead As in previous versions of HPM, the instrumentation overhead is caught by calls to the wall clock timer at entry and exit of calls to hpmstart[x], hpm- Stop, hpmtstart[x], hpmtstop. The previous version tried to eliminate (or hide) the overhead from the measured results. The current version just prints the timing of the accumulated overhead (separate for every instrumented section) in the ASCII output (*.hpm file). The idea is to let the user decide what to do with this information. If the overhead is several orders of magnitude smaller than the total duration of the instrumented section, he can safely ignore the overhead timing. If the overhead is in the same order as the total duration of the instrumented section, he may wonder whether to trust the results anyway. If the overhead is within 20% of the measured wall clock time, a warning is printed to the ASCII output file. To make the use of libhpc thread safe, mutexes are set around each call to hpmstart[x], hpmstop, hpmtstart[x], hpmtstop, which adds to the measurement overhead. If the user is running on one thread only, the setting of the mutexes can be suppressed by setting the environment variable HPM USE PTHREAD MUTEX to 0, no or NO Output If no environment variable is specified, libhpc will write two files. These contain (at least roughly) the same information, but use different formats. The file name can be specified via environment variable HPM OUTPUT NAME=<name>. If HPM OUTPUT NAME is not set, the string progname as specified in the second parameter to hpminit is taken as default (see sub section 3.8 Function Reference above). The name <name>is actually expanded into three different file names. 43
44 <name>.hpm is the file name for ASCII output which is basically a one-to-one copy of the screen output. <name>.viz is the filename for XML output. <name>.csv is the filename for output as comma separated value file. This is not yet implemented in the current release. Which of these output files are generated is governed by three additional environment variables. If none of those are set, the ASCII and the XML output is generated. If at least one is set, the following rules apply. HPM ASC OUTPUT If set to Y[...], y[...] or 1, triggers the ASCII output. HPM VIZ OUTPUT If set to Y[...], y[...] or 1, triggers the XML output. HPM CSV OUTPUT If set to Y[...], y[...] or 1, triggers the csv output. This is not yet implemented in the current release. The filename can be made unique by setting the environment variable HPM UNIQUE FILE NAME=1. This triggers the following changes. A string _<hostname>_<process_id>_<date>_<time> is inserted before the last. in the file name. If the file name has no., the string is appended to the file name. If the only occurrence of. is the first character of the file name, the string is prepended, but the leading is skipped. If the host name contains. ( long form ), only the portion preceding the first. is taken. In case a batch queuing system is used, the host name is taken from the execution host, not the submitting host. Similarly for MPI parallel programs, the host name is taken from the node where the MPI task is running. The addition of the process id enforces different file names for MPI tasks running on the same node. If used for an MPI parallel program, hpccount tries to extract the MPI task id (or MPI rank with respect to MPI COMM WORLD) from the MPI environment. If successful, the process id is replaced with the MPI task id. 44
45 The date is given as dd.mm.yyyy, the time is given by hh.mm.ss in 24h format using the local time zone. By default there is no output to stdout. This can be changed via setting the environment variable HPM STDOUT to either 1, yes or YES. In this case, the contents of the ASCII output file are copied to stdout. If the environment variable HPM PRINT FORMULA is set to either 1, yes or YES, the ASCII output of each derived metric is followed by the formula used to compute this derived metric. For details on derived metrics see section Examples of Use The following examples show how to instrument a code with calls to libhpc. For details on how to compile and link an application with Libhpc please go to section 3.14 on compiling and linking C and C++ declaration: #include "libhpc.h" use: hpminit( 0, "my program" ); if (hpm_error_count) exit(4); hpmstart( 1, "outer call" ); if (hpm_error_count) exit(4); do\_work(); hpmstart( 2, "computing meaning of life" ); if (hpm_error_count) exit(4); do\_more\_work(); hpmstop( 2 ); if (hpm_error_count) exit(4); hpmstop( 1 ); if (hpm_error_count) exit(4); hpmterminate( taskid ); if (hpm_error_count) exit(4); 45
46 The syntax for C and C++ is the same. libhpc routines are declared as having extern C linkage in C Fortran Fortran programs should call the functions with prefix f. Also, notice that the following declaration is required on all source files that have instrumentation calls. declaration: #include "f_hpc.h" use: call f_hpminit( 0, "my_program" ) if (hpm_error_count > 0) call exit(4) call f_hpmstart( 1, "Do Loop" ) if (hpm_error_count > 0) call exit(4) do <some_loop_header> call do_work() call f_hpmstart( 5, "computing meaning of life" ); if (hpm_error_count > 0) call exit(4) call do_more\_work(); call f_hpmstop( 5 ); if (hpm_error_count > 0) call exit(4) end do call f_hpmstop( 1 ) if (hpm_error_count > 0) call exit(4) call f_hpmterminate( taskid ) if (hpm_error_count > 0) call exit(4) 3.12 Multi-Threaded Program Instrumentation Issues When placing instrumentation inside of parallel regions, one should use different ID numbers for each thread, as shown in the following Fortran example:!$omp PARALLEL!$OMP&PRIVATE (instid) instid = 30+omp\_get\_thread\_num() 46
47 call f\_hpmtstart( instid, "computing meaning of life" )!$OMP DO do... do\_work() end do call f\_hpmtstop( instid )!$OMP END PARALLEL If two threads are using the same ID numbers for call to hpmtstart or hpmtstop, libhpc will exit with the following error message. hpmcount ERROR - Instance ID on wrong thread There is a subtlety for currently only AIX, which supports true hpmstart/ hpmstop routines. See the subsection 3.6 Inheritance for an explanation of the difference between hpmstart/hpmstop and hpmtstart/hpmtstop. It is legal to use hpmstart/hpmstop inside of a parallel region, but this use is strongly discouraged. To understand this, one has to recall that the different threads of a workgroup run totally unsynchronized. A call to hpmstart would not only record the values of the calling thread, but also of all other threads in the same process group. Only the calling thread is at a defined point in the program; the other threads might be at any other statement in the parallel region. So basically, numbers of apples are added to numbers of pears, and the result is almost ever some bogus number. Thus, hpmtstart/hpmtstop should be used inside parallel regions. Outside of the parallel region (in particular embracing a parallel section), it can well make sense to use hpmstart/hpmstop. In a parallel section, several threads are spawned to take over part of the workload. hpmstart/hpmstop would catch the activity of all spawned threads, hpmtstart/hpmtstop only considers the thread that is active before and after the parallel section Considerations for MPI Parallel Programs General Considerations libhpc is inherently sequential, looking only at the hardware performance counters of a single process (and its children, as explained in section
48 Inheritance). When started with poe or mpirun, each MPI task is doing its own hardware performance counting and these instances are completely ignorant of each other unless additional action is taken as described in the following sub sections. Consequently, each instance is writing its own output. If the environment variable HPM OUTPUT NAME is used, each instance is using the same file name, which results in writing into the same file, if a parallel file system is used. Of course, this can be (and should be) prevented by making the file names unique through the HPM UNIQUE FILE NAME environment variable. Still it might be an unwanted side effect to have that many output files. For this reason the the environment variable HPM AGGREGATE triggers some aggregation before (possibly) restricting the output to a subset of MPI tasks. This formulation is deliberately vague, because there can be many ways to aggregate hardware performance counter information across MPI tasks. One way is to take averages, but maximum or minimum values could be also thought of. The situation is further complicated by allowing to run different groups on different MPI tasks. On architectures that allow for multiplexing (as described in section 3.4 Multiplexing), some tasks could use multiplexing, others may not. Of course averages, maximum and minimum values should only be taken on groups which are alike. Therefore the environment variable HPM AGGREGATE take a value, which is the name of a plug-in that defines the aggregation strategy. Each plug-in is a shared object file containing two functions called distributor and aggregator. On Blue Gene/L there are no shared objects. Therefore the plug-ins are simple object files. The HPM AGGREGATE environment variable is not used on Blue Gene/L, but the plug-ins are statically linked with the library Distributors The motivating example for the distributor function is allowing a different hardware counter group on each MPI task. Therefore, the distributor is a subroutine that determines the MPI task id (or MPI rank with respect to MPI COMM WORLD) from the MPI environment for the current process, and (re)sets environment variables depending on this information. The environment variable may be any environment variable, not just HPM EVENT SET, which motivated this function. 48
49 Consequently, the distributor is called before any environment variable is evaluated by HPM. The settings of the evironment variables done in the distributor take precedence over global settings. Of course, the aggregator has to adapt to the HPM group settings done by the distributor. This is why distributors and aggregators always come in pairs. Each plug-in is containing just one such pair Aggregators The motivating example is the aggregation of the hardware counter data across the MPI tasks. In the simplest case this could be an average of the corresponding values. Hence this function is called after the hardware counter data have been gathered, before the derived metrics are computed. before these data are printed, In a generalized view, the aggregator is taking the raw results and rearranges them for output. Also, depending on the information of the MPI task id (or MPI rank with respect to MPI COMM WORLD) the aggregator sets (or doesn t set) a flag to mark the current MPI task for HPM printing Plug-ins shipped with the Tool Kit The following plug-ins are shipped with the toolkit. They can be found in $(IHPCT_BASE)/lib or $(IHPCT_BASE)/lib64 mirror.so is the plug-in that is called when no plug-in is requested. The aggregator is mirroring the raw hardware counter data in a one-to-one fashion into the output function. Hence this name. It is also flagging each MPI task as printing task. The corresponding distributor is a void function. This plug-in doesn t use MPI and also works in a non-mpi context. 49
50 loc merge.so does a local merge on each MPI task separately. It is identical to the mirror.so plug-in except for those MPI tasks that change the hardware counter groups in the course of the measurement (e.g. by multi-plexing). The different counter data, which are collected for only part of the measuring interval, are proportionally extended to the whole interval and joined into one big group that is entering derived metrics computation. This way, more derived metrics can be determined at the risk of computing garbage. The user is responsible for using this plug-in only when it makes sense to use it. It is also flagging each MPI task as printing task. The corresponding distributor is a void function. This plug-in doesn t use MPI and also works in a non-mpi context. single.so does the same as mirror.so, but only prints the results for one MPI task. The printing task can be specified via environment variable HPM PRINT TASK. This environment variable should be set to the value of the MPI rank with respect to the communicator MPI COMM - WORLD. The default value is 0. The output on all other tasks is discarded. This plug-in uses MPI functions and can t be used in a sequential context. average.so is a plug-in for taking averages across MPI tasks. The distributor is reading the environment variable HPM EVENT SET (which is supposed to be a comma separated list of group numbers) and distributes these group numbers in a round robin fashion to the MPI tasks. In case multi-plexing is available, the groups that are multiplexed are also specified by a comma separated list. The environment variable HPM ROUND ROBIN CLUSTER is used to separate round robin distribution among MPI tasks from multiplexing. If the value of HPM ROUND ROBIN CLUSTER is an integer m > 0, then the comma separated list HPM EVENT SET is split in a list of m- tupels, and the round robin distribution is applied to the resulting list of m-tupels. The default value for HPM ROUND ROBIN CLUSTER is 1. The aggregator is first building a MPI communicator of all tasks with equal hardware performance counting scenario. The communicator groups may be different from the original round robin distribution. This may happen if the conting group has been changed on some of the MPI tasks after the first setting by the distributor. Next the aggregator is taking the average across the subgroups formed by this communicator. Finally it is flagging the MPI rank 0 in each group as printing host. This plug-in uses MPI functions and can t be used in a sequential context. 50
51 User defined Plug-ins There can be no doubt that this set of plug-ins can only be a first starter kit and many more might be desirable. Rather than taking the average one could think of taking maximum or minimum. There is also the possibility of taking kind of a history merge.so by blending in results from previous measurements. Chances are that however big the list of shipped plug-ins may be, the one just needed is missing from the set ( Murphy s law of HPM plugins ). The only viable solution comes with disclosing the interface between plug-in and tool and allowing for user defined plug-ins. The easiest way to enable users to write their own plug-ins is by providing examples. Hence the plug-ins described above are provided in source code together with the Makefile that was used to generate the shared objects files. These files can be found in the following place. $(IHPCT_BASE)/examples/plugins Detailed Interface Description Each distributor and aggregator is a function returning an integer which is 0 on success and! = 0 on error. In most cases the errors occur when calling a system call like malloc(), which sets the errno variable. If the distributor or aggregator returns the value of errno as return code, the calling HPM tool sees to an expansion of this errno code into a readable error message. If returning the errno is not viable, the function should return a negative value. The function prototypes are defined in the following file. $(IHPCT_BASE)/include/hpc_agg.h This is a very short file with the following contents. #include "hpc_data.h" int distributor(void); int aggregator(int num_in, hpm_event_vector in, int *num_out, hpm_event_vector *out, int *is_print_task); 51
52 The distributor has no parameters and is only required to (re)set environment variables ( via setenv() ). The aggregator takes the current hpm values on each task as an input vector in and returns the aggregated values on the output vector out on selected or all MPI tasks. To have utmost flexibility, the aggregator is responsible to allocate the memory needed to hold the output vector out. The definition of the data types used for in and out are provided in the following file. $(IHPCT_BASE)/include/hpc_data.h Finally the aggregator is supposed to set (or unset) a flag to mark the current MPI task for HPM printing. Form the above definitions it is apparent that the interface is defined in C-Language. While it is in principle possible to use another language for programming plug-ins, the user is responsible for using the same memory layout for the input and output variables. There is no explicit FORTRAN interface provided. The hpc event vector in is a vector or list of num in entries of type hpc data item. The latter is a struct containing members that describe the definition and the results of a single hardware performance counting task. /* NAME INDEX */ #define HPM_NTIM 8 #define HPM_TIME_WALLCLOCK 0 #define HPM_TIME_CYCLE 1 #define HPM_TIME_USER 2 #define HPM_TIME_SYSTEM 3 #define HPM_TIME_START 4 #define HPM_TIME_STOP 5 #define HPM_TIME_OVERHEAD 6 #define HPM_TIME_INIT 7 typedef struct { int num_data; hpm_event_info *data; double times[hpm_ntim]; 52
53 int int int int int int int char char } hpm_data_item; is_mplex_cont; is_rusage; mpi_task_id; instr_id; count; is_exclusive; xml_element_id; *description; *xml_descr; typedef hpm_data_item *hpm_event_vector; Counting the events from a certain HPM group on one MPI task is represented by a single element of type hpc data item. If multiplexing is used, the results span several consecutive elements, each dedicated to one HPM group that take part in the multiplex setting. On all but the first element the member is mplex cont is set to TRUE to indicate that these elements are continuations of the first element belonging to the same multiplex setup. If HPM groups are changed during the measurement, the results for different groups are recorded in different vector elements, but no is mplex cont flag is set. This way results obtained via multiplexing can be distinguished from results obtained by ordinary group change. If several instrumented sections are used, each instrumented code section will use separate elements of type hpc data item to record the results. Each of these will have the member instr id set with the first argument of hpmstart and the logical member is exclusive set to TRUE or FALSE depending on whether the element hold inclusive or exclusive counter results (see section 3.7 Inclusive and Exclusive Values for details). Then all these different elements are concatenated into a single vector. Finally, the data from a call to getrusage() is prepended to this vector. So the rusage data form the vector element with index 0. This vector element is the only element with struct member is rusage set to TRUE to distinguish it from ordinary hardware performance counter data. 53
54 The output vector is of the same format. Each vector element enters the derived metrics computation separately (unless is rusage == TRUE ). Then all vector elements (and the corresponding derived metrics) are printed in the order given by the vector out. The output of each vector element will be preceded by the string given in member description (which may include line feeds as appropriate). The XML output will be marked with the text given in xml descr. This way the input vector in is providing a complete picture of what has been measured on each MPI task. The output vector out is allowing complete control on what is printed on which MPI task in what order Getting the plug-ins to work The plug-ins have been compiled with the following Makefile $(IHPCT_BASE)/examples/plugins/Makefile using this command. <g>make ARCH=<appropriate_archtitecture> The include files for the various architectures are provided in subdirectory make. The user is asked to note a couple of subtleties. The Makefile distinguishes sequential (specified in PLUGIN SRC) and parallel plug-ins (specified in PLUGIN PAR SRC). The latter are compiled and linked with the MPI wrapper script for the compiler/ linker. Unlike a static library, generation of a shared object requires linking, not just compilation. On BG/L there are no shared objects, so ordinary object files are generated. On BG/L and BG/P just everything is parallel. If the MPI software stack requires the parallel applications to be linked with a special start-up code (like poe remote main() for IBM MPI on AIX), the shared object has to carry this start-up code. hpccount is a sequential application. Therefore the start-up code has to be loaded and activated when the plug-in is loaded at run time. This turns the 54
55 sequential application hpccount into a parallel application on the fly. This sounds complicated but works pretty seamlessly, at least for IBM MPI in user space protocol and MPICH and its variants. No further user action is required to make this work. There are, however, some restrictions to be observed when writing plugin code. The MPI standard document disallows calling MPI Init() twice on the same process. It appears that this is indeed not supported on the majority of MPI software stacks, not even if an MPI Finalize() is called between the two invocations of MPI Init(). The distributor is called by hpminit(). If it would contain MPI calls, this would enforce to have MPI Init() prior to hpminit(). To lift this restriction, the distributor must not call any MPI function. If the distributor is supposed to work with hpccount as well, this restriction is required as well (see for details). The MPI task id should be extracted by inspecting environment variables that have been set by the MPI software stack. The aggregator, however, usually can t avoid calling MPI functions. Before calling MPI Init(), it has to check whether the instrumented application has already done so. If the instrumented application is an MPI application, it cannot be called after MPI Finalize(). The aggregator is called by hpmterminate(). Hence hpmterminate() has to be called between the calls to MPI Init() and MPI Finalize(). libhpc uses a call to dlopen() to access the plug-in and makes use of its functions. There is no dlopen() on Blue Gene/L, so plug-ins are statically linked to the application. On Blue Gene/P, both ways to access the plug-ins can be used Compiling and Linking Dynamic Linking libhpc inspects the value of HPM AGGREGATE at run time and links to the appropriate distributor and aggregator (see section 3.13 for details) via a call to dlopen at run time. This in general requires dynamic linking of the application. In many cases this is transparent to the user. 55
56 The easiest way to find the right compile and link options is to inspect the examples.. /usr/local/ihpct_2.2/env_sh # replace the above PATH with the actual location # where HPCT is installed. cp -r $IHPCT_BASE/examples/hpm. cd hpm ls make gmake ARCH=power_aix swim_mpi redblacksor # replace power_aix with the actual architecture # you are compiling on. # inspect the sub directory make for getting # the right value for ARCH. On AIX the following compile and link statement can be observed from the above gmake command. For better readability, the echoes from gmake are splitted over several lines. Also PATH names have been replaced with the environment variable $IHPCT BASE wherever appropriate. mpxlf_r -c -O3 -q64 -g -I$IHPCT_BASE/include \ -qsuffix=cpp=f -qrealsize=8 -WF,-DHPM swim_mpi.f mpxlf_r -O3 swim_mpi.o -o swim_mpi -q64 \ -lxlf90 -L$IHPCT_BASE/lib64 -lhpc -llicense \ -lpmapi -lm xlc_r -O3 -DHPM -q64 -g -I$IHPCT_BASE/include \ -DHPM -DDYNAMIC -DPRINT -c redblacksor.c xlc_r -O3 -DHPM -q64 -g -I$IHPCT_BASE/include \ -DHPM -DDYNAMIC -DPRINT -c relax.c xlc_r -O3 -q64 -g -I$IHPCT_BASE/include \ -DHPM -DDYNAMIC -DPRINT redblacksor.o relax.o \ -o redblacksor -q64 -lxlf90 -L$IHPCT_BASE/lib64 \ -lhpc -llicense -lpmapi -lm On Linux, the same gmake command leads to the following statements. Please note that compared to the statements above, there is no -lpmapi (or rather -lperfctr). This is due to the different way how the GNU loader handles unresolved external references in subsequent libraries. 56
57 mpfort -c -O3 -q64 -g -I$IHPCT_BASE/include \ -qsuffix=cpp=f -qrealsize=8 -WF,-DHPM swim_mpi.f mpfort -O3 swim_mpi.o -o swim_mpi -q64 \ -L$IHPCT_BASE/lib64 -lhpc -llicense xlc_r -O3 -DHPM -q64 -g -I$IHPCT_BASE/include \ -DHPM -DDYNAMIC -DPRINT -c redblacksor.c xlc_r -O3 -DHPM -q64 -g -I$IHPCT_BASE/include \ -DHPM -DDYNAMIC -DPRINT -c relax.c xlc_r -O3 -q64 -g -I$IHPCT_BASE/include \ -DHPM -DDYNAMIC -DPRINT redblacksor.o relax.o \ -o redblacksor -q64 -L$IHPCT_BASE/lib64 -lhpc -llicense Finally, on BlueGene/P, the following statements can be observed. Please note the -dynamic in the linker statement. This is necessary, because the default linkage is static on BlueGene. /bgsys/drivers/ppcfloor/comm/bin/mpif90 -c \ -O3 -g -I$IHPCT_BASE/include \ -x f77-cpp-input -std=gnu -Wp,-DHPM swim_mpi.f /bgsys/drivers/ppcfloor/comm/bin/mpif90 -O3 \ swim_mpi.o -o swim_mpi -dynamic \ -L$IHPCT_BASE/lib -llicense -lhpc /bgsys/drivers/ppcfloor/comm/bin/mpicc -O3 -DHPM -g \ -I$IHPCT_BASE/include -DHPM -DDYNAMIC -DPRINT \ -c redblacksor.c /bgsys/drivers/ppcfloor/comm/bin/mpicc -O3 -DHPM -g \ -I$IHPCT_BASE/include -DHPM -DDYNAMIC -DPRINT \ -c relax.c /bgsys/drivers/ppcfloor/comm/bin/mpicc -O3 -g \ -I$IHPCT_BASE/include -DHPM -DDYNAMIC -DPRINT \ redblacksor.o relax.o -o redblacksor -dynamic \ -L$IHPCT_BASE/lib -llicense -lhpc Please note that on BlueGene/P, the targets involving OpenMP do not compile with the options given in the example Makefile. If mpicc is being replaced by mpixlc r, the -dynamic has to be replaced by -qnostaticlink for mpixlc r and -Wl,-dy for mpixlf90 r. 57
58 /bgsys/drivers/ppcfloor/comm/bin/mpixlf90\_r -O3 -g \ -qarch=450 -qtune=450 \ -qfixed -c -I../../include -DHPM swim_mpi.f /bgsys/drivers/ppcfloor/comm/bin/mpixlf90\_r -Wl,-dy -O3 \ -qarch=450 -qtune=450 \ -qfixed swim_mpi.o -o swim_mpi \ -L../../lib -lhpc -llicense /bgsys/drivers/ppcfloor/comm/bin/mpixlc_r -O3 -DHPM -g \ -I$IHPCT_BASE/include -DHPM -DDYNAMIC -DPRINT \ -c redblacksor.c /bgsys/drivers/ppcfloor/comm/bin/mpixlc_r -O3 -DHPM -g \ -I$IHPCT_BASE/include -DHPM -DDYNAMIC -DPRINT \ -c relax.c /bgsys/drivers/ppcfloor/comm/bin/mpixlc_r -O3 -g \ -I$IHPCT_BASE/include -DHPM -DDYNAMIC -DPRINT \ redblacksor.o relax.o -o redblacksor -qnostaticlink \ -L$IHPCT_BASE/lib -llicense -lhpc Also, please note that on BlueGene/P, environment variables have to be passed to the MPI tasks. This is demonstrated in the following example. export LD_LIBRARY_PATH=\ $IHPCT_BASE/lib:/bgsys/drivers/ppcfloor/runtime/SPI mpirun -np 8 -mode VN -partition r000n120-c16i1 \ -env BG_MAXALIGNEXP=1 \ -env LD_LIBRARY_PATH=$LD_LIBRARY_PATH \ -env HPM_UNIQUE_FILE_NAME=yes \ -env HPM_AGGREGATE=average.so./swim_mpi Static Linking If, for some reason, dynamic linking is not an option, there is also a plan b. For instance, the current version of TotalView on BlueGene/P does not support dynamic linking. Also the targets involving OpenMP in the above example appear to require a different linkage. To do this, the call to dlopen (as well as the other dlxxx calls) are linked to a fake library. This fake library turns the aggregator and distributor into unresolved external references. Hence the plugin needs to be statically linked to 58
59 the application as well. As a result, the environment variable HPM AGGREGATE will be disregarded. This is easiest and most needed on BlueGene/P. Here the following link statements will do. The second example is a serial program, so taking the average plugin does not make sense - although is does not hurt, as on BG/P, everything is a parallel program. /bgsys/drivers/ppcfloor/comm/bin/mpif90 -c \ -O3 -g -I$IHPCT_BASE/include \ -x f77-cpp-input -std=gnu -Wp,-DHPM swim_mpi.f /bgsys/drivers/ppcfloor/comm/bin/mpif90 -O3 \ swim_mpi.o -o swim_mpi \ -L$IHPCT_BASE/lib -lhpc -llicense \ $IHPCT_BASE/lib/fake_dlfcn.o \ $IHPCT_BASE/lib/average.o /bgsys/drivers/ppcfloor/comm/bin/mpicc -O3 -DHPM -g \ -I$IHPCT_BASE/include -DHPM -DDYNAMIC -DPRINT \ -c redblacksor.c /bgsys/drivers/ppcfloor/comm/bin/mpicc -O3 -DHPM -g \ -I$IHPCT_BASE/include -DHPM -DDYNAMIC -DPRINT \ -c relax.c /bgsys/drivers/ppcfloor/comm/bin/mpicc -O3 -g \ -I$IHPCT_BASE/include -DHPM -DDYNAMIC -DPRINT \ redblacksor.o relax.o -o redblacksor \ -L$IHPCT_BASE/lib -lhpc -llicense -lm \ $IHPCT_BASE/lib/fake_dlfcn.o \ $IHPCT_BASE/lib/mirror.o On AIX, the commands look just accordingly. The only changes are that libhpc and liblicense are specified explicitely in static form to force the linker to resolve them by static linking. MPI is still linked dynamically. mpxlf_r -c -O3 -q64 -g -I$IHPCT_BASE/include \ -qsuffix=cpp=f -qrealsize=8 -WF,-DHPM swim_mpi.f mpxlf_r -O3 swim_mpi.o -o swim_mpi -q64 \ $IHPCT_BASE/lib64/libhpc.a \ $IHPCT_BASE/lib64/fake_dlfcn.o \ $IHPCT_BASE/lib64/average.o \ 59
60 $IHPCT_BASE/lib64/liblicense.a \ -lpmapi -lm xlc_r -O3 -DHPM -q64 -g -I$IHPCT_BASE/include \ -DHPM -DDYNAMIC -DPRINT -c redblacksor.c xlc_r -O3 -DHPM -q64 -g -I$IHPCT_BASE/include \ -DHPM -DDYNAMIC -DPRINT -c relax.c xlc_r -O3 -q64 -g -I$IHPCT_BASE/include \ -DHPM -DDYNAMIC -DPRINT redblacksor.o relax.o \ -o redblacksor -q64 -lxlf90 \ $IHPCT_BASE/lib64/libhpc.a \ $IHPCT_BASE/lib64/fake_dlfcn.o \ $IHPCT_BASE/lib64/mirror.o \ $IHPCT_BASE/lib64/liblicense.a \ -lpmapi -lm On linux, disabling the dlopen and dlsym calls generates conflicts with other libraries that make use of these functions, like libxlfmath.so. Unfortunately, this rules out the xl-compilers for this exercise. The GNU compilers, however, generate executables that work correctly. export MP_COMPILER=gfortran mpfort -c -O3 -m64 -g -I$IHPCT_BASE/include \ -x f77-cpp-input -std=gnu -Wp,-DHPM swim_mpi.f mpfort -O3 swim_mpi.o -o swim_mpi -m64 \ $IHPCT_BASE/lib64/libhpc.a \ $IHPCT_BASE/lib64/fake_dlfcn.o \ $IHPCT_BASE/lib64/average.o \ $IHPCT_BASE/lib64/liblicense.a \ -L/opt/perfctr /64/lib -lperfctr gcc -O3 -DHPM -m64 -g -I$IHPCT_BASE/include \ -DHPM -DDYNAMIC -DPRINT -c redblacksor.c gcc -O3 -DHPM -m64 -g -I$IHPCT_BASE/include \ -DHPM -DDYNAMIC -DPRINT -c relax.c gcc -O3 -m64 -g -I$IHPCT_BASE/include \ -DHPM -DDYNAMIC -DPRINT redblacksor.o relax.o \ -o redblacksor \ $IHPCT_BASE/lib64/libhpc.a \ $IHPCT_BASE/lib64/fake_dlfcn.o \ 60
61 $IHPCT_BASE/lib64/mirror.o \ $IHPCT_BASE/lib64/liblicense.a \ -L/opt/perfctr /64/lib -lperfctr -lm 4 hpcstat 4.1 Quick Start hpcstat is a simple system wide monitor based on hardware performance counters. For most of the functionality of hpcstat, root priviliges are required. The usage is very similar to that of the vmstat command. For a start the (root) user simply types the following. hpcstat As a result, hpcstat lists various performance information on the screen (i.e.stdout output). In particular it prints resource utilization statistics, hardware performance counter information and derived hardware metrics. The resource usage statistics is directly taken from a call to getrusage(). For more information on the resource utilization statistics, please refer to the getrusage man pages. In particular, on Linux the man page for getrusage() states that not all fields are meaningful under Linux. The corresponding lines in hpcstat output have the value n/a. 4.2 Usage Detailed descriptions of selected options -o <name> copies output to file <name>. For parallel programs the user is advised to have a different name for each MPI task (using e.g. the -u flag below) or direct the file to a non-shared file system. 61
62 -u make the file name <name>(specified via -o) unique. A string _<hostname>_<process_id>_<date>_<time> is inserted before the last. in the file name. If the file name has no., the string is appended to the file name. If the only occurance of. is the first character of the file name, the string is prepended, but the leading is skipped. If the hostname contains. ( long form ), only the portion preceding the first. is taken. In case a batch queuing system is used, the hostname is taken from the execution host, not the submitting host. Similarly for MPI parallel programs, the hostname is taken from the node where the MPI task is running. The addition of the process id enforces different file names for MPI tasks running on the same node. The date is given as dd.mm.yyyy, the time is given by hh:mm.ss in 24h format using the local time zone. The file name created that way contains a : to make the time easily recognizable. Unfortunately, some Windows versions don t like : in file names. Please remember to rename the file before transferring it to a Windows system. This flag is only active when the -o flag is used. -n no hpcstat output in stdout when -o flag is used. This flag is only active when the -o flag is used. -x adds formulas for derived metrics -g <group[,<group>,...]> specify group number(s) -l list groups for an explanation on groups see sections 2.3 on Events and Groups and 2.4 on Multiplexing below. for an explanation on groups see section 2.3 on Events and Groups below. 62
63 -c list counters and events for an explanation on groups see section 2.3 on Events and Groups below. 4.3 Events and Groups The hardware performance counters information is the value of special CPU registers that are incremented at certain events. The number of such registers is different for each architecture. Processor Architecture Number of performance counter registers PPC970 8 Power4 8 Power5 6 Power5+ 6 Power6 6 BG/L 52 BG/P 256 On both AIX and Linux, kernel extensions provide counter virtualization, i.e. the user sees private counter values for his application. On a technical side, the counting of the special CPU registers is frozen and the values are saved whenever the application process is taken off the CPU and another process gets scheduled. The counting is resumed when the user application gets scheduled on the CPU. The special CPU registers can count different events. On the Power CPUs the are restrictions which registers can count what events. A call to hpcstat -c will list all CPU counting registers and the events they can be monitoring. Even more, there are lots of rules restricting the concurrent use of different events. Each valid combination of assignments of events to hardware counting registers is called a group. To make handling easier, a list of valid groups is provided. A call to hpcstat -l will list all available groups and the events they are monitoring. The -g option is provided to select a secific group to be counted by hpcstat. If -g is not specified, a default group will be taken according to the following table. 63
64 Processor Architecture Number of groups Default group PPC Power Power5 148(140) 137 Power Power BG/L 16 0 BG/P 4 0 The number of groups for Power5 is 140 for AIX 5.2, and 148 for Linux and AIX 5.3. The reason for this difference are different versions of bos.pmapi.the last group (139) was changed and 8 new groups were appended. If HPM is called with hpcstat -g <a_new_group_number> on AIX 5.2, it returns the following error message. hpcstat ERROR - pm_set_program_mygroup: pm_api : event group ID is invalid 64
65 5 Reference 5.1 List of Environment Variables Environment variable Text reference HPM AGGREGATE 2.7.1, HPM ASC OUTPUT 2.2, 3.10 HPM DIV WEIGHT 2.5.2, HPM EVENT SET 3.2 HPM EXCLUSIVE VALUES 3.7 HPM L25 LATENCY 2.5.3, HPM L275 LATENCY 2.5.3, HPM L2 LATENCY 2.5.3, HPM L35 LATENCY 2.5.3, HPM L3 LATENCY 2.5.3, HPM MEM LATENCY 2.5.3, HPM NUM INST PTS 3.8 HPM OUTPUT NAME 2.2, 3.10 HPM PRINT FORMULA 2.2, 3.10, 3.5 HPM PRINT TASK 2.7.4, , HPM ROUND ROBIN CLUSTER 2.7.4, HPM SLICE DURATION 2.4, 3.4 HPM STDOUT 2.2, 3.10 HPM TLB LATENCY 2.5.3, HPM UNIQUE FILE NAME 2.2, 3.10 HPM UPC CONTROL 3.3.2, HPM USE PTHREAD MUTEX 3.9 HPM VIZ OUTPUT 2.2, Derived Metrics Description Utilization rate * user_time / wall_clock_time Total FP load and store operations fp_tot_ls = (PM_LSU_LDF + PM_FPU_STF) *
66 MIPS PM_INST_CMPL * / wall_clock_time Instructions per cycle (double)pm_inst_cmpl / PM_CYC Instructions per run cycle (double)pm_inst_cmpl / PM_RUN_CYC Instructions per load/store (double)pm_inst_cmpl/(pm_ld_ref_l1 + PM_ST_REF_L1) % Instructions dispatched that completed * PM_INST_CMPL / PM_INST_DISP Fixed point operations per Cycle (double)pm_fxu_fin / PM_CYC Fixed point operations per load/stores (double)pm_inst_cmpl/(pm_ld_ref_l1 + PM_ST_REF_L1) Branches mispredicted percentage 100.0* (PM_BR_MPRED_CR + PM_BR_MPRED_TA) / PM_BR_ISSUED number of loads per load miss (double)pm_ld_ref_l1 / PM_LD_MISS_L1 number of stores per store miss (double)pm_st_ref_l1 / PM_ST_MISS_L1 number of load/stores per L1 miss ( (double)pm_ld_ref_l1 + (double)pm_st_ref_l1) / ((double)pm_st_miss_l1 + (double)pm_ld_miss_l1) L1 cache hit rate * (1.0 - ((double)pm_ld_ref_l1 + (double)pm_st_ref_l1) / ((double)pm_st_miss_l1 + (double)pm_ld_miss_l1)) number of loads per TLB miss (double)pm_ld_ref_l1 / PM_DTLB_MISS 66
67 number of loads/stores per TLB miss ((double)pm_ld_ref_l1 + (double)pm_st_ref_l1) / PM_DTLB_MISS Total Loads from L2 tot_ld_l2 = sum((double)pm_data_from_l2*) / (1024*1024) L2 load traffic L1_cache_line_size * tot_ld_l2 L2 load bandwidth per processor L1_cache_line_size * tot_ld_l2 / wall_clock_time Estimated latency from loads from L2 ( HPM_L2_LATENCY*(double)PM_DATA_FROM_L2 + HPM_L25_LATENCY*(double)sum(PM_DATA_FROM_L25*) + HPM_L275_LATENCY*(double)sum(PM_DATA_FROM_L275*)) * cycle_time % loads from L2 per cycle * tot_ld_l2 / PM_CYC Total Loads from local L2 tot_ld_l_l2 = (double)pm_data_from_l2 / (1024*1024) local L2 load traffic L1_cache_line_size * tot_ld_l_l2 local L2 load bandwidth per processor L1_cache_line_size * tot_ld_l_l2 / wall_clock_time Estimated latency from loads from local L2 HPM_L2_LATENCY * (double)pm_data_from_l2 * cycle_time % loads from local L2 per cycle * (double)pm_data_from_l2 / PM_CYC Total Loads from L3 tot_ld_l3 = sum((double)pm_data_from_l3*) / (1024*1024) L3 load traffic 67
68 L2_cache_line_size * tot_ld_l3 L3 load bandwidth per processor L2_cache_line_size * tot_ld_l2 / wall_clock_time Estimated latency from loads from L3 ( HPM_L3_LATENCY*(double)PM_DATA_FROM_L3 + HPM_L35_LATENCY*(double)PM_DATA_FROM_L35) * cycle_time % loads from L3 per cycle * (double)sum(pm_data_from_l3*) / PM_CYC Total Loads from local L3 tot_ld_l_l3 = (double)pm_data_from_l3 / (1024*1024) local L3 load traffic L2_cache_line_size * tot_ld_l_l3 local L3 load bandwidth per processor L2_cache_line_size * tot_ld_l_l3 / wall_clock_time Estimated latency from loads from local L3 HPM_L3_LATENCY * (double)pm_data_from_l3 * cycle_time % loads from local L3 per cycle * (double)pm_data_from_l3 / PM_CYC Total Loads from memory tot_ld_mem = (double)pm_data_from_mem / (1024*1024) memory load traffic L3_cache_line_size * tot_ld_mem memory load bandwidth per processor L3_cache_line_size * tot_ld_mem / wall_clock_time Estimated latency from loads from memory HPM_MEM_LATENCY * (double)pm_data_from_mem * cycle_time % loads from memory per cycle * (double)pm_data_from_mem / PM_CYC 68
69 Total Loads from local memory tot_ld_lmem = (double)pm_data_from_lmem / (1024*1024) local memory load traffic L3_cache_line_size * tot_ld_lmem local memory load bandwidth per processor L3_cache_line_size * tot_ld_lmem / wall_clock_time Estimated latency from loads from local memory HPM_MEM_LATENCY * (double)pm_data_from_lmem * cycle_time % loads from local memory per cycle (double)pm_data_from_lmem / PM_CYC % TLB misses per cycle * (double)pm_dtlb_miss / PM_CYC % TLB misses per run cycle * (double)pm_dtlb_miss / PM_RUN_CYC Estimated latency from TLB misses HPM_TLB_LATENCY * (double)pm_dtlb_miss * cycle_time HW float point instructions (flips) (flips = (double) PM_FPU_FIN) * or -- (flips = (double)(pm_fpu0_fin + PM_FPU1_FIN))* HW float point instructions per cycle flips / PM_CYC HW float point instructions per run cycle flips / PM_RUN_CYC HW floating point instr. rate (HW flips / WCT) flips * / wall_clock_time HW floating point instructions/ user time flips * / user_time 69
70 Total floating point operations (flops = (double)(pm_fpu0_fin + PM_FPU1_FIN +PM_FPU_FMA - PM_FPU_STF )) * Total floating point operations on Blue Gene/P (flops = (double)(bgp_pux_fpu_add_sub_1 + BGP_PUx_FPU_MULT_1 + 2*BGP_PUx_FPU_FMA_2 + 2*BGP_PUx_FPU_ADD_SUB_2 + 2*BGP_PUx_FPU_MULT_2 + 4*BGP_PUx_FPU_FMA_4 + BGP_PUx_FPU_DIV_1 + BGP_PUx_FPU_OTHER_NON_STORAGE_OPS + 2*BGP_PUx_FPU_DUAL_PIPE_OTHER_NON_STORAGE_OPS)) * Flop rate (flops / WCT) flops * / wall_clock_time Flops / user time flops * / user_time Algebraic floating point operations (aflops = (double)(pm_fpu_1flop + 2*PM_FPU_FMA)) * Algebraic floating point operations on Blue Gene/P (aflops = (double)(bgp_pux_fpu_add_sub_1 + BGP_PUx_FPU_MULT_1 + 2*BGP_PUx_FPU_FMA_2 + 2*BGP_PUx_FPU_ADD_SUB_2 + 2*BGP_PUx_FPU_MULT_2 + 4*BGP_PUx_FPU_FMA_4)) * Algebraic flop rate (flops / WCT) aflops * / wall_clock_time Algebraic flops / user time aflops * / user_time Weighted Floating Point operations (wflops = flops + (HPM_DIV_WEIGHT-1)*PM_FPU_FDIV) * Weighted Floating Point operations on Blue Gene/P (wflops = flops + (HPM_DIV_WEIGHT-1)*BGP_PUx_FPU_DIV_1) * Weighted flop rate (flops / WCT) 70
71 wflops * / wall_clock_time Weighted flops / user time wflops * / user_time FMA percentage * 2*PM_FPU_FMA / flops (on Power4) * 2*PM_FPU_FMA / aflops (on Power5) * 2*PM_FPU_FMA / flops (on Power6) * (2*BGP_PUx_FPU_FMA_2 + 4*BGP_PUx_FPU_FMA_4)/ flops (on Blue Gene/P) Computation intensity flops / fp_tot_ls % of peak performance * flops * cycle_time/ (4*user_time) (on Power4) * aflops * cycle_time/ (4*user_time) (on Power5) * flops * cycle_time/ (4*user_time) (on Power6) * flops * cycle_time/ (4*user_time) (on Blue Gene/P) 71
Multi-Threading Performance on Commodity Multi-Core Processors
Multi-Threading Performance on Commodity Multi-Core Processors Jie Chen and William Watson III Scientific Computing Group Jefferson Lab 12000 Jefferson Ave. Newport News, VA 23606 Organization Introduction
Performance Evaluation of NAS Parallel Benchmarks on Intel Xeon Phi
Performance Evaluation of NAS Parallel Benchmarks on Intel Xeon Phi ICPP 6 th International Workshop on Parallel Programming Models and Systems Software for High-End Computing October 1, 2013 Lyon, France
RTI Monitoring Library Getting Started Guide
RTI Monitoring Library Getting Started Guide Version 5.1.0 2011-2013 Real-Time Innovations, Inc. All rights reserved. Printed in U.S.A. First printing. December 2013. Trademarks Real-Time Innovations,
Chapter 1 - Web Server Management and Cluster Topology
Objectives At the end of this chapter, participants will be able to understand: Web server management options provided by Network Deployment Clustered Application Servers Cluster creation and management
An Implementation Of Multiprocessor Linux
An Implementation Of Multiprocessor Linux This document describes the implementation of a simple SMP Linux kernel extension and how to use this to develop SMP Linux kernels for architectures other than
10.04.2008. Thomas Fahrig Senior Developer Hypervisor Team. Hypervisor Architecture Terminology Goals Basics Details
Thomas Fahrig Senior Developer Hypervisor Team Hypervisor Architecture Terminology Goals Basics Details Scheduling Interval External Interrupt Handling Reserves, Weights and Caps Context Switch Waiting
Libmonitor: A Tool for First-Party Monitoring
Libmonitor: A Tool for First-Party Monitoring Mark W. Krentel Dept. of Computer Science Rice University 6100 Main St., Houston, TX 77005 [email protected] ABSTRACT Libmonitor is a library that provides
The programming language C. sws1 1
The programming language C sws1 1 The programming language C invented by Dennis Ritchie in early 1970s who used it to write the first Hello World program C was used to write UNIX Standardised as K&C (Kernighan
MPI and Hybrid Programming Models. William Gropp www.cs.illinois.edu/~wgropp
MPI and Hybrid Programming Models William Gropp www.cs.illinois.edu/~wgropp 2 What is a Hybrid Model? Combination of several parallel programming models in the same program May be mixed in the same source
The Double-layer Master-Slave Model : A Hybrid Approach to Parallel Programming for Multicore Clusters
The Double-layer Master-Slave Model : A Hybrid Approach to Parallel Programming for Multicore Clusters User s Manual for the HPCVL DMSM Library Gang Liu and Hartmut L. Schmider High Performance Computing
Debugging with TotalView
Tim Cramer 17.03.2015 IT Center der RWTH Aachen University Why to use a Debugger? If your program goes haywire, you may... ( wand (... buy a magic... read the source code again and again and...... enrich
Chapter 3 Application Monitors
Chapter 3 Application Monitors AppMetrics utilizes application monitors to organize data collection and analysis per application server. An application monitor is defined on the AppMetrics manager computer
Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification
Introduction Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification Advanced Topics in Software Engineering 1 Concurrent Programs Characterized by
INTEGRATING MICROSOFT DYNAMICS CRM WITH SIMEGO DS3
INTEGRATING MICROSOFT DYNAMICS CRM WITH SIMEGO DS3 Often the most compelling way to introduce yourself to a software product is to try deliver value as soon as possible. Simego DS3 is designed to get you
Debugging and Profiling Lab. Carlos Rosales, Kent Milfeld and Yaakoub Y. El Kharma [email protected]
Debugging and Profiling Lab Carlos Rosales, Kent Milfeld and Yaakoub Y. El Kharma [email protected] Setup Login to Ranger: - ssh -X [email protected] Make sure you can export graphics
Performance Monitoring of Parallel Scientific Applications
Performance Monitoring of Parallel Scientific Applications Abstract. David Skinner National Energy Research Scientific Computing Center Lawrence Berkeley National Laboratory This paper introduces an infrastructure
Operating Systems 4 th Class
Operating Systems 4 th Class Lecture 1 Operating Systems Operating systems are essential part of any computer system. Therefore, a course in operating systems is an essential part of any computer science
Using RADIUS Agent for Transparent User Identification
Using RADIUS Agent for Transparent User Identification Using RADIUS Agent Web Security Solutions Version 7.7, 7.8 Websense RADIUS Agent works together with the RADIUS server and RADIUS clients in your
Efficient database auditing
Topicus Fincare Efficient database auditing And entity reversion Dennis Windhouwer Supervised by: Pim van den Broek, Jasper Laagland and Johan te Winkel 9 April 2014 SUMMARY Topicus wants their current
OpenMP & MPI CISC 879. Tristan Vanderbruggen & John Cavazos Dept of Computer & Information Sciences University of Delaware
OpenMP & MPI CISC 879 Tristan Vanderbruggen & John Cavazos Dept of Computer & Information Sciences University of Delaware 1 Lecture Overview Introduction OpenMP MPI Model Language extension: directives-based
RAID Basics Training Guide
RAID Basics Training Guide Discover a Higher Level of Performance RAID matters. Rely on Intel RAID. Table of Contents 1. What is RAID? 2. RAID Levels RAID 0 RAID 1 RAID 5 RAID 6 RAID 10 RAID 0+1 RAID 1E
Performance Workload Design
Performance Workload Design The goal of this paper is to show the basic principles involved in designing a workload for performance and scalability testing. We will understand how to achieve these principles
Running applications on the Cray XC30 4/12/2015
Running applications on the Cray XC30 4/12/2015 1 Running on compute nodes By default, users do not log in and run applications on the compute nodes directly. Instead they launch jobs on compute nodes
SLURM Workload Manager
SLURM Workload Manager What is SLURM? SLURM (Simple Linux Utility for Resource Management) is the native scheduler software that runs on ASTI's HPC cluster. Free and open-source job scheduler for the Linux
Memory Debugging with TotalView on AIX and Linux/Power
S cico m P Austin Aug 2004 Memory Debugging with TotalView on AIX and Linux/Power Chris Gottbrath Memory Debugging in AIX and Linux-Power Clusters Intro: Define the problem and terms What are Memory bugs?
Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas
CS 110B - Rule Storage Classes Page 18-1 Attributes are distinctive features of a variable. Data type, int or double for example, is an attribute. Storage class is another attribute. There are four storage
Directions for VMware Ready Testing for Application Software
Directions for VMware Ready Testing for Application Software Introduction To be awarded the VMware ready logo for your product requires a modest amount of engineering work, assuming that the pre-requisites
- An Essential Building Block for Stable and Reliable Compute Clusters
Ferdinand Geier ParTec Cluster Competence Center GmbH, V. 1.4, March 2005 Cluster Middleware - An Essential Building Block for Stable and Reliable Compute Clusters Contents: Compute Clusters a Real Alternative
Resource Scheduling Best Practice in Hybrid Clusters
Available online at www.prace-ri.eu Partnership for Advanced Computing in Europe Resource Scheduling Best Practice in Hybrid Clusters C. Cavazzoni a, A. Federico b, D. Galetti a, G. Morelli b, A. Pieretti
SAN Conceptual and Design Basics
TECHNICAL NOTE VMware Infrastructure 3 SAN Conceptual and Design Basics VMware ESX Server can be used in conjunction with a SAN (storage area network), a specialized high speed network that connects computer
Performance Characteristics of VMFS and RDM VMware ESX Server 3.0.1
Performance Study Performance Characteristics of and RDM VMware ESX Server 3.0.1 VMware ESX Server offers three choices for managing disk access in a virtual machine VMware Virtual Machine File System
LOAD BALANCING DISTRIBUTED OPERATING SYSTEMS, SCALABILITY, SS 2015. Hermann Härtig
LOAD BALANCING DISTRIBUTED OPERATING SYSTEMS, SCALABILITY, SS 2015 Hermann Härtig ISSUES starting points independent Unix processes and block synchronous execution who does it load migration mechanism
Performance Tuning Guide for ECM 2.0
Performance Tuning Guide for ECM 2.0 Rev: 20 December 2012 Sitecore ECM 2.0 Performance Tuning Guide for ECM 2.0 A developer's guide to optimizing the performance of Sitecore ECM The information contained
WebSphere Business Monitor
WebSphere Business Monitor Monitor models 2010 IBM Corporation This presentation should provide an overview of monitor models in WebSphere Business Monitor. WBPM_Monitor_MonitorModels.ppt Page 1 of 25
MOSIX: High performance Linux farm
MOSIX: High performance Linux farm Paolo Mastroserio [[email protected]] Francesco Maria Taurino [[email protected]] Gennaro Tortone [[email protected]] Napoli Index overview on Linux farm farm
ESX 4 Patch Management Guide ESX 4.0
ESX 4 Patch Management Guide ESX 4.0 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition. To check for more recent
Improved metrics collection and correlation for the CERN cloud storage test framework
Improved metrics collection and correlation for the CERN cloud storage test framework September 2013 Author: Carolina Lindqvist Supervisors: Maitane Zotes Seppo Heikkila CERN openlab Summer Student Report
16.1 MAPREDUCE. For personal use only, not for distribution. 333
For personal use only, not for distribution. 333 16.1 MAPREDUCE Initially designed by the Google labs and used internally by Google, the MAPREDUCE distributed programming model is now promoted by several
TPCalc : a throughput calculator for computer architecture studies
TPCalc : a throughput calculator for computer architecture studies Pierre Michaud Stijn Eyerman Wouter Rogiest IRISA/INRIA Ghent University Ghent University [email protected] [email protected]
Maximize Performance and Scalability of RADIOSS* Structural Analysis Software on Intel Xeon Processor E7 v2 Family-Based Platforms
Maximize Performance and Scalability of RADIOSS* Structural Analysis Software on Family-Based Platforms Executive Summary Complex simulations of structural and systems performance, such as car crash simulations,
Web Analytics Understand your web visitors without web logs or page tags and keep all your data inside your firewall.
Web Analytics Understand your web visitors without web logs or page tags and keep all your data inside your firewall. 5401 Butler Street, Suite 200 Pittsburgh, PA 15201 +1 (412) 408 3167 www.metronomelabs.com
Real Time Programming: Concepts
Real Time Programming: Concepts Radek Pelánek Plan at first we will study basic concepts related to real time programming then we will have a look at specific programming languages and study how they realize
Grid 101. Grid 101. Josh Hegie. [email protected] http://hpc.unr.edu
Grid 101 Josh Hegie [email protected] http://hpc.unr.edu Accessing the Grid Outline 1 Accessing the Grid 2 Working on the Grid 3 Submitting Jobs with SGE 4 Compiling 5 MPI 6 Questions? Accessing the Grid Logging
Running a Workflow on a PowerCenter Grid
Running a Workflow on a PowerCenter Grid 2010-2014 Informatica Corporation. No part of this document may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording or otherwise)
IBM Tivoli Composite Application Manager for Microsoft Applications: Microsoft Hyper-V Server Agent Version 6.3.1 Fix Pack 2.
IBM Tivoli Composite Application Manager for Microsoft Applications: Microsoft Hyper-V Server Agent Version 6.3.1 Fix Pack 2 Reference IBM Tivoli Composite Application Manager for Microsoft Applications:
SysPatrol - Server Security Monitor
SysPatrol Server Security Monitor User Manual Version 2.2 Sep 2013 www.flexense.com www.syspatrol.com 1 Product Overview SysPatrol is a server security monitoring solution allowing one to monitor one or
What Is Specific in Load Testing?
What Is Specific in Load Testing? Testing of multi-user applications under realistic and stress loads is really the only way to ensure appropriate performance and reliability in production. Load testing
SLURM Resources isolation through cgroups. Yiannis Georgiou email: [email protected] Matthieu Hautreux email: matthieu.hautreux@cea.
SLURM Resources isolation through cgroups Yiannis Georgiou email: [email protected] Matthieu Hautreux email: [email protected] Outline Introduction to cgroups Cgroups implementation upon
File Management. Chapter 12
Chapter 12 File Management File is the basic element of most of the applications, since the input to an application, as well as its output, is usually a file. They also typically outlive the execution
-------- Overview --------
------------------------------------------------------------------- Intel(R) Trace Analyzer and Collector 9.1 Update 1 for Windows* OS Release Notes -------------------------------------------------------------------
Intel Data Direct I/O Technology (Intel DDIO): A Primer >
Intel Data Direct I/O Technology (Intel DDIO): A Primer > Technical Brief February 2012 Revision 1.0 Legal Statements INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE,
PART IV Performance oriented design, Performance testing, Performance tuning & Performance solutions. Outline. Performance oriented design
PART IV Performance oriented design, Performance testing, Performance tuning & Performance solutions Slide 1 Outline Principles for performance oriented design Performance testing Performance tuning General
CS 2112 Spring 2014. 0 Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions
CS 2112 Spring 2014 Assignment 3 Data Structures and Web Filtering Due: March 4, 2014 11:59 PM Implementing spam blacklists and web filters requires matching candidate domain names and URLs very rapidly
Parallelization: Binary Tree Traversal
By Aaron Weeden and Patrick Royal Shodor Education Foundation, Inc. August 2012 Introduction: According to Moore s law, the number of transistors on a computer chip doubles roughly every two years. First
Data Integrator. Pervasive Software, Inc. 12365-B Riata Trace Parkway Austin, Texas 78727 USA
Data Integrator Event Management Guide Pervasive Software, Inc. 12365-B Riata Trace Parkway Austin, Texas 78727 USA Telephone: 888.296.5969 or 512.231.6000 Fax: 512.231.6010 Email: [email protected]
Chapter 5 Linux Load Balancing Mechanisms
Chapter 5 Linux Load Balancing Mechanisms Load balancing mechanisms in multiprocessor systems have two compatible objectives. One is to prevent processors from being idle while others processors still
NVIDIA Tools For Profiling And Monitoring. David Goodwin
NVIDIA Tools For Profiling And Monitoring David Goodwin Outline CUDA Profiling and Monitoring Libraries Tools Technologies Directions CScADS Summer 2012 Workshop on Performance Tools for Extreme Scale
Laboratory Report. An Appendix to SELinux & grsecurity: A Side-by-Side Comparison of Mandatory Access Control & Access Control List Implementations
Laboratory Report An Appendix to SELinux & grsecurity: A Side-by-Side Comparison of Mandatory Access Control & Access Control List Implementations 1. Hardware Configuration We configured our testbed on
How to use PDFlib products with PHP
How to use PDFlib products with PHP Last change: July 13, 2011 Latest PDFlib version covered in this document: 8.0.3 Latest version of this document available at: www.pdflib.com/developer/technical-documentation
Streamline Computing Linux Cluster User Training. ( Nottingham University)
1 Streamline Computing Linux Cluster User Training ( Nottingham University) 3 User Training Agenda System Overview System Access Description of Cluster Environment Code Development Job Schedulers Running
Obtaining Hardware Performance Metrics for the BlueGene/L Supercomputer
Obtaining Hardware Performance Metrics for the BlueGene/L Supercomputer Pedro Mindlin, José R. Brunheroto, Luiz DeRose, and José E. Moreira pamindli,brunhe,laderose,jmoreira @us.ibm.com IBM Thomas J. Watson
A Brief Survery of Linux Performance Engineering. Philip J. Mucci University of Tennessee, Knoxville [email protected]
A Brief Survery of Linux Performance Engineering Philip J. Mucci University of Tennessee, Knoxville [email protected] Overview On chip Hardware Performance Counters Linux Performance Counter Infrastructure
Overview. Lecture 1: an introduction to CUDA. Hardware view. Hardware view. hardware view software view CUDA programming
Overview Lecture 1: an introduction to CUDA Mike Giles [email protected] hardware view software view Oxford University Mathematical Institute Oxford e-research Centre Lecture 1 p. 1 Lecture 1 p.
End-user Tools for Application Performance Analysis Using Hardware Counters
1 End-user Tools for Application Performance Analysis Using Hardware Counters K. London, J. Dongarra, S. Moore, P. Mucci, K. Seymour, T. Spencer Abstract One purpose of the end-user tools described in
BLM 413E - Parallel Programming Lecture 3
BLM 413E - Parallel Programming Lecture 3 FSMVU Bilgisayar Mühendisliği Öğr. Gör. Musa AYDIN 14.10.2015 2015-2016 M.A. 1 Parallel Programming Models Parallel Programming Models Overview There are several
Optimizing the Performance of Your Longview Application
Optimizing the Performance of Your Longview Application François Lalonde, Director Application Support May 15, 2013 Disclaimer This presentation is provided to you solely for information purposes, is not
Introduction 1 Performance on Hosted Server 1. Benchmarks 2. System Requirements 7 Load Balancing 7
Introduction 1 Performance on Hosted Server 1 Figure 1: Real World Performance 1 Benchmarks 2 System configuration used for benchmarks 2 Figure 2a: New tickets per minute on E5440 processors 3 Figure 2b:
ODEX Enterprise. Introduction to ODEX Enterprise 3 for users of ODEX Enterprise 2
ODEX Enterprise Introduction to ODEX Enterprise 3 for users of ODEX Enterprise 2 Copyright Data Interchange Plc Peterborough, England, 2013. All rights reserved. No part of this document may be disclosed
New Tools Using the Hardware Pertbrmaiihe... Monitor to Help Users Tune Programs on the Cray X-MP*
ANL/CP--7 4428 _' DE92 001926 New Tools Using the Hardware Pertbrmaiihe... Monitor to Help Users Tune Programs on the Cray X-MP* D. E. Engert, L. Rudsinski J. Doak Argonne National Laboratory Cray Research
Long-term monitoring of apparent latency in PREEMPT RT Linux real-time systems
Long-term monitoring of apparent latency in PREEMPT RT Linux real-time systems Carsten Emde Open Source Automation Development Lab (OSADL) eg Aichhalder Str. 39, 78713 Schramberg, Germany [email protected]
Parallel and Distributed Computing Programming Assignment 1
Parallel and Distributed Computing Programming Assignment 1 Due Monday, February 7 For programming assignment 1, you should write two C programs. One should provide an estimate of the performance of ping-pong
ELEC 377. Operating Systems. Week 1 Class 3
Operating Systems Week 1 Class 3 Last Class! Computer System Structure, Controllers! Interrupts & Traps! I/O structure and device queues.! Storage Structure & Caching! Hardware Protection! Dual Mode Operation
So today we shall continue our discussion on the search engines and web crawlers. (Refer Slide Time: 01:02)
Internet Technology Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No #39 Search Engines and Web Crawler :: Part 2 So today we
MAQAO Performance Analysis and Optimization Tool
MAQAO Performance Analysis and Optimization Tool Andres S. CHARIF-RUBIAL [email protected] Performance Evaluation Team, University of Versailles S-Q-Y http://www.maqao.org VI-HPS 18 th Grenoble 18/22
Webapps Vulnerability Report
Tuesday, May 1, 2012 Webapps Vulnerability Report Introduction This report provides detailed information of every vulnerability that was found and successfully exploited by CORE Impact Professional during
Leak Check Version 2.1 for Linux TM
Leak Check Version 2.1 for Linux TM User s Guide Including Leak Analyzer For x86 Servers Document Number DLC20-L-021-1 Copyright 2003-2009 Dynamic Memory Solutions LLC www.dynamic-memory.com Notices Information
Enhanced Connector Applications SupportPac VP01 for IBM WebSphere Business Events 3.0.0
Enhanced Connector Applications SupportPac VP01 for IBM WebSphere Business Events 3.0.0 Third edition (May 2012). Copyright International Business Machines Corporation 2012. US Government Users Restricted
Performance Application Programming Interface
/************************************************************************************ ** Notes on Performance Application Programming Interface ** ** Intended audience: Those who would like to learn more
EVALUATION. WA1844 WebSphere Process Server 7.0 Programming Using WebSphere Integration COPY. Developer
WA1844 WebSphere Process Server 7.0 Programming Using WebSphere Integration Developer Web Age Solutions Inc. USA: 1-877-517-6540 Canada: 1-866-206-4644 Web: http://www.webagesolutions.com Chapter 6 - Introduction
IBM SmartCloud Workload Automation - Software as a Service. Agent Installation and Uninstallation Messages
IBM SmartCloud Workload Automation - Software as a Service Agent Installation and Uninstallation Messages IBM SmartCloud Workload Automation - Software as a Service Agent Installation and Uninstallation
Tivoli Log File Agent Version 6.2.3 Fix Pack 2. User's Guide SC14-7484-03
Tivoli Log File Agent Version 6.2.3 Fix Pack 2 User's Guide SC14-7484-03 Tivoli Log File Agent Version 6.2.3 Fix Pack 2 User's Guide SC14-7484-03 Note Before using this information and the product it
Contributions to Gang Scheduling
CHAPTER 7 Contributions to Gang Scheduling In this Chapter, we present two techniques to improve Gang Scheduling policies by adopting the ideas of this Thesis. The first one, Performance- Driven Gang Scheduling,
Tivoli IBM Tivoli Web Response Monitor and IBM Tivoli Web Segment Analyzer
Tivoli IBM Tivoli Web Response Monitor and IBM Tivoli Web Segment Analyzer Version 2.0.0 Notes for Fixpack 1.2.0-TIV-W3_Analyzer-IF0003 Tivoli IBM Tivoli Web Response Monitor and IBM Tivoli Web Segment
Object Oriented Software Design
Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 28, 2010 G. Lipari (Scuola Superiore Sant Anna) Introduction
Sources: On the Web: Slides will be available on:
C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,
PTC Integrity Eclipse and IBM Rational Development Platform Guide
PTC Integrity Eclipse and IBM Rational Development Platform Guide The PTC Integrity integration with Eclipse Platform and the IBM Rational Software Development Platform series allows you to access Integrity
Introduction to Synoptic
Introduction to Synoptic 1 Introduction Synoptic is a tool that summarizes log files. More exactly, Synoptic takes a set of log files, and some rules that tell it how to interpret lines in those logs,
HPC Wales Skills Academy Course Catalogue 2015
HPC Wales Skills Academy Course Catalogue 2015 Overview The HPC Wales Skills Academy provides a variety of courses and workshops aimed at building skills in High Performance Computing (HPC). Our courses
LOCKSS on LINUX. CentOS6 Installation Manual 08/22/2013
LOCKSS on LINUX CentOS6 Installation Manual 08/22/2013 1 Table of Contents Overview... 3 LOCKSS Hardware... 5 Installation Checklist... 6 BIOS Settings... 9 Installation... 10 Firewall Configuration...
Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization
Lesson Objectives To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization AE3B33OSD Lesson 1 / Page 2 What is an Operating System? A
Evaluation of Nagios for Real-time Cloud Virtual Machine Monitoring
University of Victoria Faculty of Engineering Fall 2009 Work Term Report Evaluation of Nagios for Real-time Cloud Virtual Machine Monitoring Department of Physics University of Victoria Victoria, BC Michael
Service Availability TM Forum Application Interface Specification
Service Availability TM Forum Application Interface Specification Information Model Management Service SAI-AIS-IMM-A.02.0 This specification was reissued on September, under the Artistic License 2.0. The
Cloud computing is a marketing term that means different things to different people. In this presentation, we look at the pros and cons of using
Cloud computing is a marketing term that means different things to different people. In this presentation, we look at the pros and cons of using Amazon Web Services rather than setting up a physical server
Optimizing Application Performance with CUDA Profiling Tools
Optimizing Application Performance with CUDA Profiling Tools Why Profile? Application Code GPU Compute-Intensive Functions Rest of Sequential CPU Code CPU 100 s of cores 10,000 s of threads Great memory
Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur
Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No. # 26 Real - Time POSIX. (Contd.) Ok Good morning, so let us get
NVIDIA CUDA GETTING STARTED GUIDE FOR MICROSOFT WINDOWS
NVIDIA CUDA GETTING STARTED GUIDE FOR MICROSOFT WINDOWS DU-05349-001_v6.0 February 2014 Installation and Verification on TABLE OF CONTENTS Chapter 1. Introduction...1 1.1. System Requirements... 1 1.2.
DiskPulse DISK CHANGE MONITOR
DiskPulse DISK CHANGE MONITOR User Manual Version 7.9 Oct 2015 www.diskpulse.com [email protected] 1 1 DiskPulse Overview...3 2 DiskPulse Product Versions...5 3 Using Desktop Product Version...6 3.1 Product
