% TEXINPUTS=.:$HOME/git/bvtex: latexmk  -pdf <main>.tex
\documentclass[xcolor=dvipsnames]{beamer}

\input{defaults}
\input{beamer/preamble}

\setbeamertemplate{navigation symbols}{}
% \setbeamertemplate{background}[grid][step=1cm]

\usepackage{siunitx}
\usepackage{xmpmulti}
\usepackage[export]{adjustbox}
\usepackage{ulem}
\usepackage[outline]{contour}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\usetikzlibrary{positioning}

\definecolor{bvtitlecolor}{rgb}{0.98, 0.92, 0.84}
\definecolor{bvoutline}{rgb}{0.1, 0.1, 0.1}

\renewcommand{\bvtitleauthor}{Brett Viren}
\renewcommand{\bvtit}{reduc}
\renewcommand{\bvtitle}{\LARGE Data Reduction Proposal and Computing Requirements}
\renewcommand{\bvevent}{\Large pD-SP DAQ / S\&C\\DUNE Collaboration Meeting\\25 Jan 2017}
\renewcommand{\bvbeamerbackground}{}


\def\Put(#1,#2)#3{\leavevmode\makebox(0,0){\put(#1,#2){#3}}}


\begin{document}
\input{beamer/title.tex}
\input{beamer/toc.tex}

\section{Proposal for Initial Data Reduction Process}

\input{reduc.tex}


\section{Data Formatting Issues}

\begin{frame} 
  \frametitle{Data Formatting Issues}

  Expect that:
  \begin{itemize}
  \item Reduction process directly reads raw data files into working memory.
  \item Any fragment types not touched are saved to output as-is.
    \begin{itemize}\footnotesize
    \item (just nominal plan, see next slide for opportunities)
    \end{itemize}
  \item Write reduced data, packed similarly to raw data (ie, \texttt{artdaq::Fragment}) 
  \item[$\Rightarrow$] develop a ``reduced DAL'' which is sister to the ``raw DAL''\footnote{Data Access Library, some more details \href{https://indico.fnal.gov/getFile.py/access?contribId=4&resId=0&materialId=slides&confId=13679}{here}}
  \end{itemize}
  
\end{frame}

\section{Additional Opportunities}
\begin{frame}
  \frametitle{Additional Opportunities?}
  \begin{itemize}
  \item Basic proposal addresses only TPC data.
  \item Process provides opportunity for additional processing.
  \item Best to not require substantially more CPU/RAM.
  \item Maybe:
    \begin{itemize}\footnotesize
    \item Merge in any out-of-band Beam Info?
    \item Data reduction on non-TPC fragment types?
    \item Any reformatting or other ``convenience'' operations that
      help downstream read non-TPC data?
    \end{itemize}
  \end{itemize}
  If there are proponents for any ideas, let's discuss!
  
\end{frame}

\begin{frame} 
  \frametitle{CPU and RAM Estimation}
  \begin{itemize}
  \item LArSoft RAM overhead assumed 1--2 GB.  Reduction adds negligible
    if 1 APA at a time, o.w. worse case: +1.2 GB.
  \item CPU time: 45 sec/APA/trig $\equiv$ 4.5 min/pD-SP/trig.
  \item 10 Hz trig $\Rightarrow$ 2700 cores to keep up with beam cycle
    \begin{itemize}\footnotesize
      \item or 6750 cores to keep up with in-spill 25 Hz
    \end{itemize}
  \item Assume computer = 2 CPUs / 20 cores $\rightarrow$ 135 computers with 64
    GB RAM each! (at worse case)
  \item[$\therefore$] Mitigate RAM pressure: use plain-art /
    stand-alone code, hold only 1 APA in memory, increase node count to 150:
  \end{itemize}
  To keep up with beam cycle we need to allocate:
  \begin{center}
    \textbf{3000 cores with 2 GB RAM each}
  \end{center}
  \footnotesize
  \begin{itemize}
  \item \textbf{Exclusive CPU} but only during actual protoDUNE/SP running.
  \item Need to better understand the \textbf{RAM requirement}.
  \item Any additional \textbf{processing beyond TPC} needs understanding.
  \end{itemize}
\end{frame}

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
