diff --git a/examples/power/Makefile b/examples/power/Makefile new file mode 100644 index 000000000..f7d02b0ef --- /dev/null +++ b/examples/power/Makefile @@ -0,0 +1,48 @@ +#**************************************************************************** +#* TAU Portable Profiling Package ** +#* http://www.cs.uoregon.edu/research/tau ** +#**************************************************************************** +#* Copyright 1997 ** +#* Department of Computer and Information Science, University of Oregon ** +#* Advanced Computing Laboratory, Los Alamos National Laboratory ** +#**************************************************************************** +####################################################################### +## pC++/Sage++ Copyright (C) 1993,1995 ## +## Indiana University University of Oregon University of Rennes ## +####################################################################### + + +TAU_MAKEFILE ?=../../include/Makefile + +include $(TAU_MAKEFILE) + +CC = TAU_MAKEFILE=$(TAU_MAKEFILE) $(TAU_PREFIX_INSTALL_DIR)/$(CONFIG_ARCH)/bin/tau_cc.sh + +PRINT = pr + +RM = /bin/rm -rf + +TARGET = matmult + +OBJS = matmult.o matmult_initialize.o +CFLAGS=-g -O2 +LDFLAGS=-g -O2 + +############################################## + +all: $(TARGET) + +install: $(TARGET) + +$(TARGET): $(OBJS) + $(CC) $(LDFLAGS) $(OBJS) -o $@ $(LIBS) + +matmult.o: matmult.c + $(CC) $(CFLAGS) -c $< -o $@ + +matmult_initialize.o: matmult_initialize.c matmult_initialize.h + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + $(RM) $(OBJS) $(TARGET) profile.* *.trc *.edf *.z MULT* *.inst.* *.pdb Comp_gnu.o +############################################## diff --git a/examples/power/README b/examples/power/README new file mode 100644 index 000000000..885466959 --- /dev/null +++ b/examples/power/README @@ -0,0 +1,35 @@ +This example illustrates TAU's API for tracking Power. To track Power, simply insert: + +TAU_TRACK_POWER(); + +in the code. An interrupt is generated every 10 seconds. To change the interrupt interval to say 1s, please insert: + +TAU_SET_INTERRUPT_INTERVAL(1); + +make + +To track Power, the following must be done: + +1. TAU must be configured to use PAPI configured with --with-component=rapl +2. The executable must not rely on any LD_LIBRARY_PATH settings. So, we typically add -Wl,-rapth,/path/to/dso while linking +in the executable. So, we configure TAU using: + + ./configure -pdt=/usr/local/packages/pdt -c++=mpicxx -cc=mpicc -fortran=mpif90 -mpilibrary=-lmpi_usempif08#-lmpi_usempi_ignore_tkr#-lmpi_mpifh#-lmpi#-Wl,-rpath,/usr/local/packages/openmpi/1.7_intel-14-tm/lib#-Wl,-rpath,/usr/local/packages/intel/14.0/compiler/lib/intel64/ -bfd=download -iowrapper -papi=/usr/local/packages/papi-5.2.0 -bfd=download -iowrapper + +make install + +3. The system on which you are running the executable must allow you to read the /dev/cpu/*/msr files: + +su +# chmod o+r /dev/cpu/*/msr +4. The executable must have special previleges to execute code. These are granted by root using: + +# setcap cap_sys_rawio=ep ./matmult + +5. The user then executes the code using: +% mpirun -np 4 ./matmult + +6. Max and min marker events trigger when the usage is beyond a threshold of the value seen during the execution. To change +the event threshold, simply set: +% export TAU_EVENT_THRESHOLD=0.01 +for capturing 1% variation in an atomic event. diff --git a/examples/power/matmult.c b/examples/power/matmult.c new file mode 100644 index 000000000..8dd0eaa32 --- /dev/null +++ b/examples/power/matmult.c @@ -0,0 +1,232 @@ +/****************************************************************************** +* OpenMp Example - Matrix Multiply - C Version +* Demonstrates a matrix multiply using OpenMP. +* +* Modified from here: +* https://computing.llnl.gov/tutorials/openMP/samples/C/omp_mm.c +* +* For PAPI_FP_INS, the exclusive count for the event: +* for (null) [OpenMP location: file:matmult.c ] +* should be 2E+06 / Number of Threads +******************************************************************************/ +#include +#include + +#include "matmult_initialize.h" + +#ifdef TAU_MPI +int provided; +#include +/* NOTE: MPI is just used to spawn multiple copies of the kernel to different ranks. +This is not a parallel implementation */ +#endif /* TAU_MPI */ + +#ifdef PTHREADS +#include +#endif /* PTHREADS */ + +#ifndef MATRIX_SIZE +#define MATRIX_SIZE 1024 +#endif + +#define NRA MATRIX_SIZE /* number of rows in matrix A */ +#define NCA MATRIX_SIZE /* number of columns in matrix A */ +#define NCB MATRIX_SIZE /* number of columns in matrix B */ + +double** allocateMatrix(int rows, int cols) { + int i; + double **matrix = (double**)malloc((sizeof(double*)) * rows); + for (i=0; i #include #include +#include int TAUDECL tau_totalnodes(int set_or_get, int value); static int tau_shmem_tagid_f=0 ; #define TAU_SHMEM_TAGID tau_shmem_tagid_f=tau_shmem_tagid_f%250 diff --git a/tools/src/common/bin/tau-common.jar b/tools/src/common/bin/tau-common.jar index 199944d36..025035d9e 100644 Binary files a/tools/src/common/bin/tau-common.jar and b/tools/src/common/bin/tau-common.jar differ diff --git a/tools/src/paraprof/bin/paraprof.jar b/tools/src/paraprof/bin/paraprof.jar index e1c78a1ce..0b037fdc5 100644 Binary files a/tools/src/paraprof/bin/paraprof.jar and b/tools/src/paraprof/bin/paraprof.jar differ diff --git a/tools/src/paraprof/src/PPUserEventProfile.java b/tools/src/paraprof/src/PPUserEventProfile.java index 0033b82ce..9c03e9702 100644 --- a/tools/src/paraprof/src/PPUserEventProfile.java +++ b/tools/src/paraprof/src/PPUserEventProfile.java @@ -104,7 +104,7 @@ public double getStdDev() { return userEventProfile.getStdDev(dataSorter.getSelectedSnapshot()); } - public String getUserEventStatString(int precision) { + public String getUserEventStatString(int precision, boolean showTotal) { int initialBufferLength = 108; int position = 0; char[] statStringArray = new char[initialBufferLength]; @@ -114,7 +114,9 @@ public String getUserEventStatString(int precision) { PPUserEventProfile.insertSpaces(statStringArray, 0, 108); String name = this.getUserEventDisplayName(); - if (name.startsWith("Memory Utilization (heap, in KB)") || name.contains("/s)")) + if (name.startsWith("Memory Utilization (heap, in KB)") + || name.contains("/s)") || !showTotal + || !this.getUserEvent().isShowTotal()) { tmpString = "-"; } diff --git a/tools/src/paraprof/src/ParaProfUtils.java b/tools/src/paraprof/src/ParaProfUtils.java index b3ff1fc02..42f077935 100644 --- a/tools/src/paraprof/src/ParaProfUtils.java +++ b/tools/src/paraprof/src/ParaProfUtils.java @@ -1218,6 +1218,9 @@ public void actionPerformed(ActionEvent e) { userEvent.setColorFlag(false); ppTrial.updateRegisteredObjects("colorEvent"); + } else if (arg.equals("Show/Hide Total")) { + userEvent.setShowTotal(!userEvent.isShowTotal()); + ppTrial.updateRegisteredObjects("colorEvent"); } else if (arg.equals("Show In Context Event Window")&&thread!=null) { @@ -1255,6 +1258,10 @@ else if (arg.equals("Show In Context Event Window")&&thread!=null) { menuItem.addActionListener(act); popup.add(menuItem); + menuItem = new JMenuItem("Show/Hide Total"); + menuItem.addActionListener(act); + popup.add(menuItem); + menuItem = createContextSourcePopUp(userEvent.getName()); if(menuItem!=null){ popup.add(menuItem); diff --git a/tools/src/paraprof/src/StatWindow.java b/tools/src/paraprof/src/StatWindow.java index 9320ddc8c..47276a3e0 100755 --- a/tools/src/paraprof/src/StatWindow.java +++ b/tools/src/paraprof/src/StatWindow.java @@ -73,6 +73,7 @@ public class StatWindow extends JFrame implements ActionListener, MenuListener, private JCheckBoxMenuItem descendingOrder = null; //private JCheckBoxMenuItem showPathTitleInReverse = null; private JCheckBoxMenuItem showMetaData = null; + private JCheckBoxMenuItem showTotal = null; private JCheckBoxMenuItem showFindPanelBox; private JScrollPane jScrollpane = null; @@ -166,6 +167,12 @@ public void windowClosing(java.awt.event.WindowEvent evt) { showMetaData.addActionListener(this); optionsMenu.add(showMetaData); + // if (userEventWindow) { + // showTotal = new JCheckBoxMenuItem("Show Total", true); + // showTotal.addActionListener(this); + // optionsMenu.add(showTotal); + // } + optionsMenu.add(new JSeparator()); descendingOrder = new JCheckBoxMenuItem("Descending Order", true); @@ -405,6 +412,9 @@ public void actionPerformed(ActionEvent evt) { panel.repaint(); } else if (arg.equals("Show Meta Data in Panel")) { this.setHeader(); + } else if (arg.equals("Show Total")) { + panel.setShowTotal(showTotal.isSelected()); + panel.repaint(); } } } catch (Exception e) { diff --git a/tools/src/paraprof/src/StatWindowPanel.java b/tools/src/paraprof/src/StatWindowPanel.java index 2510fda5b..b1cc1aa9c 100755 --- a/tools/src/paraprof/src/StatWindowPanel.java +++ b/tools/src/paraprof/src/StatWindowPanel.java @@ -58,6 +58,7 @@ public class StatWindowPanel extends JPanel implements MouseListener, Printable, private ParaProfTrial ppTrial = null; private StatWindow window = null; private boolean userEventWindow; + private boolean showTotal = true; //private List list = new ArrayList(); private List uepList = new ArrayList(); private List fpList = new ArrayList(); @@ -131,6 +132,21 @@ public static String getUserEventStatStringHeading() { } + public static String getUserEventStatStringHeading(boolean useTotal) { + + int w = 18; + String s = ""; + if (useTotal) { + s += UtilFncs.pad("Total", w); + } + s += UtilFncs.pad("NumSamples", w) + UtilFncs.pad("Max", w) + + UtilFncs.pad("Min", w) + UtilFncs.pad("Mean", w) + + UtilFncs.pad("Std. Dev", w); + + return s; + + } + public void setSearchLines(String headerString, String dashString) { if (searcher.getSearchLines() == null){// && list != null) { @@ -145,7 +161,8 @@ public void setSearchLines(String headerString, String dashString) { if (userEventWindow) { nameString = uepList.get(i).getUserEventDisplayName(); - statString = uepList.get(i).getUserEventStatString(ParaProf.defaultNumberPrecision); + statString = uepList.get(i).getUserEventStatString( + ParaProf.defaultNumberPrecision, showTotal); statString = statString + nameString; } else { nameString = fpList.get(i).getDisplayName(); @@ -267,7 +284,8 @@ public void export(Graphics2D g2D, boolean toScreen, boolean fullWindow, boolean String headerString; if (userEventWindow) { - headerString = StatWindowPanel.getUserEventStatStringHeading(); + headerString = StatWindowPanel +.getUserEventStatStringHeading(); } else { if (ppTrial.isTimeMetric()) @@ -336,7 +354,8 @@ public void export(Graphics2D g2D, boolean toScreen, boolean fullWindow, boolean if (userEventWindow) { ppUserEventProfile = uepList.get(i); - statString = ppUserEventProfile.getUserEventStatString(ParaProf.defaultNumberPrecision); + statString = ppUserEventProfile.getUserEventStatString( + ParaProf.defaultNumberPrecision, showTotal); } else { ppFunctionProfile = fpList.get(i); statString = ppFunctionProfile.getStatString(window.units()); @@ -452,4 +471,8 @@ public Searcher getSearcher() { return searcher; } + public void setShowTotal(boolean showTotal) { + this.showTotal = showTotal; + } + } \ No newline at end of file diff --git a/tools/src/paraprof/src/treetable/ContextEventModel.java b/tools/src/paraprof/src/treetable/ContextEventModel.java index 82b2b822d..1725d67cb 100644 --- a/tools/src/paraprof/src/treetable/ContextEventModel.java +++ b/tools/src/paraprof/src/treetable/ContextEventModel.java @@ -134,7 +134,12 @@ public Object getValueAt(Object node, int column) { } else { switch (column) { case 1: - if (uep.getName().startsWith("Memory Utilization (heap, in KB)") || uep.getName().contains("/s)")) { // rates are ignored for total + if (uep.getName() + .startsWith("Memory Utilization (heap, in KB)") + || uep.getName().contains("/s)") + || !uep.getUserEvent().isShowTotal()) { // rates are + // ignored for + // total return null; } else { return new Double(uep.getNumSamples(dataSorter.getSelectedSnapshot()) diff --git a/tools/src/paraprof/wrapper/ParaProf.java b/tools/src/paraprof/wrapper/ParaProf.java index 8f8a4c0d4..a784fe075 100644 --- a/tools/src/paraprof/wrapper/ParaProf.java +++ b/tools/src/paraprof/wrapper/ParaProf.java @@ -54,7 +54,7 @@ public void handle(Throwable t) throws Throwable { } } - private final static String VERSION = "Mon Sep 16 17:06:00 PDT 2013"; + private final static String VERSION = "Tue Sep 17 16:18:11 PDT 2013"; public static int defaultNumberPrecision = 6; diff --git a/tools/src/perfdmf/bin/perfdmf.jar b/tools/src/perfdmf/bin/perfdmf.jar index a9024f199..049588c34 100644 Binary files a/tools/src/perfdmf/bin/perfdmf.jar and b/tools/src/perfdmf/bin/perfdmf.jar differ diff --git a/tools/src/perfdmf/src/UserEvent.java b/tools/src/perfdmf/src/UserEvent.java index 1d146cba6..675e3dc69 100644 --- a/tools/src/perfdmf/src/UserEvent.java +++ b/tools/src/perfdmf/src/UserEvent.java @@ -23,8 +23,24 @@ public class UserEvent implements Serializable, Comparable { private boolean contextEventSet; private boolean contextEvent; + private boolean showTotal = true; - public UserEvent(String name, int id) { + /** + * @return the showTotal + */ + public boolean isShowTotal() { + return showTotal; + } + + /** + * @param showTotal + * the showTotal to set + */ + public void setShowTotal(boolean showTotal) { + this.showTotal = showTotal; + } + + public UserEvent(String name, int id) { this.name = name; this.id = id; } diff --git a/tools/src/perfexplorer/perfexplorer.jar b/tools/src/perfexplorer/perfexplorer.jar index d3549deb8..8d14be660 100644 Binary files a/tools/src/perfexplorer/perfexplorer.jar and b/tools/src/perfexplorer/perfexplorer.jar differ diff --git a/tools/src/vis/bin/vis.jar b/tools/src/vis/bin/vis.jar index f1aaa3131..3574c54df 100644 Binary files a/tools/src/vis/bin/vis.jar and b/tools/src/vis/bin/vis.jar differ