From 09e953d73565c8a0d19c53098db7b2a678faeb2f Mon Sep 17 00:00:00 2001 From: allen Date: Sun, 6 Jul 2003 12:28:44 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r2, which included commits to RCS files with non-trunk default branches. git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/TimerReport/trunk@3 d0051148-8e13-4bef-be1d-f6c572c85f9f --- README | 12 +++++ doc/documentation.tex | 135 +++++++++++++++++++++++++++++++++++++++++++++++ interface.ccl | 13 +++++ param.ccl | 25 +++++++++ schedule.ccl | 22 ++++++++ src/Output.c | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/make.code.defn | 9 ++++ 7 files changed, 359 insertions(+) create mode 100644 README create mode 100644 doc/documentation.tex create mode 100644 interface.ccl create mode 100644 param.ccl create mode 100644 schedule.ccl create mode 100644 src/Output.c create mode 100644 src/make.code.defn diff --git a/README b/README new file mode 100644 index 0000000..4f188d6 --- /dev/null +++ b/README @@ -0,0 +1,12 @@ +CVS info : $Header$ + +Cactus Code Thorn TimerReport +Thorn Author(s) : Cactus Maintainers +Thorn Maintainer(s) : Cactus Maintainers +-------------------------------------------------------------------------- + +Purpose of the thorn: + +Simplistic additional timer information. This thorn provides timer details +to screen at different iterations and before checkpoints depending on +parameter settings. \ No newline at end of file diff --git a/doc/documentation.tex b/doc/documentation.tex new file mode 100644 index 0000000..d7d02fc --- /dev/null +++ b/doc/documentation.tex @@ -0,0 +1,135 @@ +% *======================================================================* +% Cactus Thorn template for ThornGuide documentation +% Author: Ian Kelley +% Date: Sun Jun 02, 2002 +% $Header$ +% +% Thorn documentation in the latex file doc/documentation.tex +% will be included in ThornGuides built with the Cactus make system. +% The scripts employed by the make system automatically include +% pages about variables, parameters and scheduling parsed from the +% relevent thorn CCL files. +% +% This template contains guidelines which help to assure that your +% documentation will be correctly added to ThornGuides. More +% information is available in the Cactus UsersGuide. +% +% Guidelines: +% - Do not change anything before the line +% % START CACTUS THORNGUIDE", +% except for filling in the title, author, date etc. fields. +% - Each of these fields should only be on ONE line. +% - Author names should be sparated with a \\ or a comma +% - You can define your own macros, but they must appear after +% the START CACTUS THORNGUIDE line, and must not redefine standard +% latex commands. +% - To avoid name clashes with other thorns, 'labels', 'citations', +% 'references', and 'image' names should conform to the following +% convention: +% ARRANGEMENT_THORN_LABEL +% For example, an image wave.eps in the arrangement CactusWave and +% thorn WaveToyC should be renamed to CactusWave_WaveToyC_wave.eps +% - Graphics should only be included using the graphix package. +% More specifically, with the "includegraphics" command. Do +% not specify any graphic file extensions in your .tex file. This +% will allow us (later) to create a PDF version of the ThornGuide +% via pdflatex. | +% - References should be included with the latex "bibitem" command. +% - Use \begin{abstract}...\end{abstract} instead of \abstract{...} +% - Do not use \appendix, instead include any appendices you need as +% standard sections. +% - For the benefit of our Perl scripts, and for future extensions, +% please use simple latex. +% +% *======================================================================* +% +% Example of including a graphic image: +% \begin{figure}[ht] +% \begin{center} +% \includegraphics[width=6cm]{MyArrangement_MyThorn_MyFigure} +% \end{center} +% \caption{Illustration of this and that} +% \label{MyArrangement_MyThorn_MyLabel} +% \end{figure} +% +% Example of using a label: +% \label{MyArrangement_MyThorn_MyLabel} +% +% Example of a citation: +% \cite{MyArrangement_MyThorn_Author99} +% +% Example of including a reference +% \bibitem{MyArrangement_MyThorn_Author99} +% {J. Author, {\em The Title of the Book, Journal, or periodical}, 1 (1999), +% 1--16. {\tt http://www.nowhere.com/}} +% +% *======================================================================* + +% If you are using CVS use this line to give version information +% $Header$ + +\documentclass{article} + +% Use the Cactus ThornGuide style file +% (Automatically used from Cactus distribution, if you have a +% thorn without the Cactus Flesh download this from the Cactus +% homepage at www.cactuscode.org) +\usepackage{../../../../doc/ThornGuide/cactus} + +\begin{document} + +% The author of the documentation +\author{Cactus Maintainers \textless cactusmaint@cactuscode.org\textgreater} + +% The title of the document (not necessarily the name of the Thorn) +\title{Obtaining Reports of Timer Information} + +% the date your document was last changed, if your document is in CVS, +% please use: +% \date{$ $Date$ $} +\date{July 06 2003} + +\maketitle + +% Do not delete next line +% START CACTUS THORNGUIDE + +% Add all definitions used in this documentation here +% \def\mydef etc + +% Add an abstract for this thorn's documentation +\begin{abstract} + +This thorn provides mechanisms for obtaining different information from +timers during a Cactus run. Currently there are only simple reports to screen +but in the future more configurable options will be added. + +\end{abstract} + +% The following sections are suggestive only. +% Remove them or add your own. + +\section{Using This Thorn} + +To use this thorn you only need to include it in your ActiveThorns +parameter and set the relevent parameters. With default parameters +the thorn does nothing. + +Current options are to output the timing report to screen at the next +iteration (via a steering interface), before each checkpoint, at a +given iteration, or at periodic iteration intervals. + +\subsection{Obtaining This Thorn} + +Available as part of the Cactus Computational Toolkit in arrangement +CactusUtils. + +\subsection{Support and Feedback} + +To the Cactus Team at {\tt cactusmaint@cactuscode.org} or through the +Bug/Feature Request web pages at {\tt www.cactuscode.org}. + +% Do not delete next line +% END CACTUS THORNGUIDE + +\end{document} diff --git a/interface.ccl b/interface.ccl new file mode 100644 index 0000000..0210e53 --- /dev/null +++ b/interface.ccl @@ -0,0 +1,13 @@ +# Interface definition for thorn TimerReport +# $Header$ + +implements: timerreport +inherits: + +private: + +int triggergroup type=SCALAR +{ +triggervar +} "For triggering output" + diff --git a/param.ccl b/param.ccl new file mode 100644 index 0000000..20240a2 --- /dev/null +++ b/param.ccl @@ -0,0 +1,25 @@ +# Parameter definitions for thorn TimerReport +# $Header$ + +private: + +INT out_every "How often to output timer report to screen" STEERABLE=ALWAYS +{ + 0 :: "Never (default)" + 1:* :: "Every so many iterations" +} 0 + +INT out_at "Output timer information at a given iteration" STEERABLE=ALWAYS +{ + -1 :: "Never (default)" + 0:* :: "At this iteration" +} -1 + +BOOLEAN before_checkpoint "Before a checkpoint" STEERABLE=ALWAYS +{ +} "no" + +BOOLEAN next "On next iteration" STEERABLE=ALWAYS +{ +} "no" + diff --git a/schedule.ccl b/schedule.ccl new file mode 100644 index 0000000..6a1be64 --- /dev/null +++ b/schedule.ccl @@ -0,0 +1,22 @@ +# Schedule definitions for thorn TimerReport +# $Header$ + + +SCHEDULE TimerReport_Startup AT CCTK_STARTUP +{ + LANG: C +} "Startup routine" + +SCHEDULE TimerReport_Output AT CCTK_ANALYSIS +{ + LANG: C + TRIGGERS: triggergroup +} "Print the timer report" + +if (before_checkpoint) +{ + SCHEDULE TimerReport_Output AT CCTK_CHECKPOINT + { + LANG: C + } "Print the timer report" +} \ No newline at end of file diff --git a/src/Output.c b/src/Output.c new file mode 100644 index 0000000..226ecb5 --- /dev/null +++ b/src/Output.c @@ -0,0 +1,143 @@ + /*@@ + @file Output.c + @date July 6 2003 + @author Gabrielle Allen + @desc + Functions to deal with making TimerReport an IO method + @enddesc + @version $Id$ + @@*/ + +#include "cctk.h" +#include "cctk_Parameters.h" +#include "cctk_Arguments.h" + +#include "cctk_Schedule.h" + +static const char *rcsid = "$Header$"; + +CCTK_FILEVERSION(CactusUtils_TimerReport_Output_c) + +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ + +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + +int TimerReport_TimeForOutput (const cGH *GH, int vindex); + +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ + +/******************************************************************** + ******************** External Routines ************************ + ********************************************************************/ + +void TimerReport_Startup (void); + + + /*@@ + @routine TimerReport_Startup + @date Sun 6th July 2003 + @author Gabrielle Allen + @desc + The startup registration routine for TimerReport. + Registers TimerReport as an IO Method and provide the + only necessary method TimeForOutput + @enddesc + @calls CCTK_RegisterGHExtensionSetupGH +@@*/ +void TimerReport_Startup (void) +{ + int handle; + + handle = CCTK_RegisterIOMethod ("TimerReport"); + CCTK_RegisterIOMethodTimeToOutput (handle, TimerReport_TimeForOutput); +} + + +/******************************************************************** + ******************** Internal Routines ************************ + ********************************************************************/ + +int TimerReport_TimeForOutput (const cGH *GH, int vindex); + + /*@@ + @routine TimerReport_TimeForOutput + @date July 6 2003 + @author Gabrielle Allen + @desc + Decides if it is time to output timer information + @enddesc + @calls CheckSteerableParameters + + @var GH + @vdesc Pointer to CCTK GH + @vtype const cGH * + @vio in + @endvar + @var vindex + @vdesc index of variable to check for output + @vtype int + @vio in + @endvar + + @returntype int + @returndesc + true/false (1 or 0) if analysis should be called + @endreturndesc +@@*/ +int TimerReport_TimeForOutput (const cGH *GH, int vindex) +{ + DECLARE_CCTK_PARAMETERS + + int retval=0; + + if (vindex==CCTK_VarIndex("timerreport::triggervar")) + { + if (next || out_at == GH->cctk_iteration) + { + retval = 1; + } + else if (out_every) + { + if (GH->cctk_iteration%out_every == 0) + { + retval = 1; + } + } + } + + return retval; +} + + /*@@ + @routine TimerReport_Output + @date July 6 2003 + @author Gabrielle Allen + @desc + Output the timer table + @enddesc + @calls +@@*/ +void TimerReport_Output(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + CCTK_SchedulePrintTimes(NULL); + + if (next) + { + CCTK_ParameterSet("next", CCTK_THORNSTRING, "no"); + } + + return; +} diff --git a/src/make.code.defn b/src/make.code.defn new file mode 100644 index 0000000..618714b --- /dev/null +++ b/src/make.code.defn @@ -0,0 +1,9 @@ +# Main make.code.defn file for thorn TimerReport +# $Header$ + +# Source files in this directory +SRCS = Output.c + +# Subdirectories containing source files +SUBDIRS = + -- cgit v1.2.3