%\documentclass[landscape,letterpaper]{article}
\documentclass{article}
\usepackage{multicol}
\usepackage{listings}
\usepackage{parskip}
\usepackage[landscape]{geometry}
\usepackage[usenames,dvipsnames]{color} 
\usepackage{url}
\usepackage{amsmath}
\usepackage{graphics}
\usepackage{verbatim}
\usepackage{longtable}
%\usepackage{a4}%-Northamerica: {fullpage}
\usepackage{svn}%!/hg/s/linux/9/app/teTeX/11.05/texmf-dist/tex/latex/svn/svn.sty
%           --- ubuntu lacks this but has latex-svinfo - usepackage{svninfo}
\addtolength{\textheight}{52mm}
\addtolength{\topmargin}{-21mm}
\addtolength{\oddsidemargin}{-37mm}
\addtolength{\evensidemargin}{-37mm}
\addtolength{\textwidth}{74mm}
%\setlength{\columnsep}{5pt}		% default=10pt
\setlength{\columnseprule}{0pt}		% default=0pt (no line)

\newcommand\pastix{\textsc{PaStiX}}
\newcommand\scotch{\textsc{Scotch}}
\newcommand\metis{\textsc{Metis}}
\newcommand\murge{\textsc{Murge}}
%%\newcommand{\type}[1]{\textcolor{OliveGreen}{#1}}
%%\newcommand{\var}[1]{\textcolor{YellowOrange}{#1}}
%%\newcommand{\func}[1]{\textcolor{Blue}{#1}}
%%\newcommand{\st}{\raisebox{-0.5ex}{*}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   PROTOTYPES   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%      Mots cles des prototypes     %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% Type, fonction, variable
\newcommand{\type}[1]{\textbf{#1}}
\newcommand{\func}[1]{\texttt{#1}}
\newcommand{\var}[1]{\texttt{#1}}
% Mot cle fortran
\newcommand{\forkey}[1]{\texttt{#1}}

% Preprocesseur (ie : #include)
\newcommand{\preproc}[1]{\textbf{#1}}
% Included file (ie : ``pastix.h'')
\newcommand{\inc}[1]{\texttt{#1}}
% Etoile pour les pointeurs
\newcommand{\st}{\raisebox{-0.5ex}{*}}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%         Tableaux pour les prototypes               %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%% Declaration de variables en Fortran,
%%%%%%%%%%%%%%% type & :: var1, var2\\
\newenvironment{type-var}{\begin{tabular}{ll}}{\end{tabular}}

%%%%%%%%%%%%%%% Functions fortran :
%%%%%%%%%%%%%%% call func ( & var1, var2\\
%%%%%%%%%%%%%%%             & var3)\\
\newenvironment{type-func-vars}{\begin{tabular}{l@{ }l}}{\end{tabular}}

%%%%%%%%%%%%%%% Fonction C avec une colonne de paramètre
%%%%%%%%%%%%%%% type func ( & type & modifier & var,\\
%%%%%%%%%%%%%%%             & type & modifier & var );\\
\newenvironment{type-func-type-mod-var}{\begin{tabular}{l@{ }l@{ }l@{
      }l}}{\end{tabular}}
%%%%%%%%%%%%%%% Fonction C avec deux colonne de paramètre
%%%%%%%%%%%%%%% type func ( & type & modifier & var, & type & modifier & var,\\
%%%%%%%%%%%%%%%             & type & modifier & var, & type & modifier & var );\\
\newenvironment{type-func-type-mod-var-type-mod-var}{\begin{tabular}{l@{
      }l@{ }l@{ }l@{ }l@{ }l@{ }l@{ }l@{ }}}{\end{tabular}} 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%            Remplissage des tableaux pour les prototypes            %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%% Ligne du type :
%%%%%%%%%%%%%%% type func ( & type & modifier & var,
\newcommand{\tftmv}[5]{\type{#1} \func{#2} ( & \type{#3} & #4 &
  \var{#5}}

%%%%%%%%%%%%%%% Ligne du type :
%%%%%%%%%%%%%%%             & type & modifier & var,
\newcommand{\tmv}[3]{& \type{#1} & #2 & \var{#3}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%        Tableaux d'arguments     %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{arguments}{\begin{tabular}{p{30mm}p{96mm}}}{\end{tabular}}
\newenvironment{returns}{Returns~:\\\begin{arguments}}{\end{arguments}}
% Ligne de description des arguments de la fonction (tableau à deux case)
\newcommand{\argdesc}[2]{\texttt{#1} & #2\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%     Description de fonctions     %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\descript}[2]{\par#1}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%                       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%   TABLEAUX SPECIAUX   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%                       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% API: Titre + 3 colonnnes
% | Titre                          |
% | mot cle | nombre | description |
\newenvironment{tabIbis}[1]{\begin{tabular}{|p{35mm}|p{3mm}|p{73mm}|}\hline\multicolumn{3}{|l|}{#1}\\\hline}{\end{tabular}}

% i/dparm.tex : 5 colonnes
% | param | index | description | default | IN/OUT |
\newenvironment{tabParameters}[3]{
  %%\begin{small}
    \begin{longtable}{|p{45mm}|p{10mm}|p{135mm}|p{40mm}|p{15mm}|}
      %%\caption[#1]{#2} \label{#3} \\
      \hline
      \multicolumn{5}{|c|}{#2}\\
      \hline
      Keyword                                  & Index & Definition                                                   & Default          & IN/OUT \\
      \hline
      \endfirsthead

      %%\multicolumn{5}{c}{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
      \hline
      \multicolumn{5}{|l|}{... continued from previous page} \\
      \hline
      Keyword                                  & Index & Definition                                                   & Default          & IN/OUT \\
      \hline
      \endhead

      \hline \multicolumn{5}{|r|}{Continued on next page ...} \\ \hline
      \endfoot

      \hline
      \endlastfoot
}{
    \end{longtable}
  %%\end{small}
}

% 2 colonnes
\newenvironment{tabIII}{\begin{tabular}{|p{32mm}|p{90mm}|}}{\end{tabular}}
\newenvironment{tabIIIbis}{\begin{tabular}{|p{35mm}|p{85mm}|}}{\end{tabular}}
\newenvironment{tabIV}{\begin{tabular}{|p{60mm}|p{60mm}|}}{\end{tabular}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%                       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%   TITRES SPECIAUX     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%                       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand*{\tabIIItitle}[1]{\multicolumn{2}{|l|}{#1}}
\newcommand{\Sect}[1]{\par\noindent\medskip\normalsize\textbf{#1}
  \vskip -.2ex plus 1ex minus 1ex \small}
\newcommand{\Sectbis}[2]{\par\noindent\medskip\large\textbf{#1}\small\ #2
  \vskip -.2ex plus 1ex minus 1ex \small}
\newcommand{\Sectii}[1]{\par\noindent\medskip\normalsize\textbf{#1}
  \vskip -.2ex plus 1ex minus 1ex \small}
\newcommand{\Sectiii}[2]{\par\noindent\medskip\small\textbf{#1}#2
  \hrule\small}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%                       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%   Multi colonnes      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%                       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\raggedcolumns%\raggedbottom
\setlength{\columnseprule}{.4pt}% default 0
\setlength{\columnsep}{22pt}% default is less (18 pt?)
\pagestyle{empty}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%                       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%   Document            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%                       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

%\svnid{$Id$}

\SVN $Date$
%% \svnidlong
%% {$HeadURL$}
%% {$LastChangedDate$}
%% {$LastChangedRevision$}
%% {$LastChangedBy$}

%\begin{multicols}{1}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% CLASSICAL PASTIX   %%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{center}
  {\LARGE \pastix{} version 5.2 Quick Reference Guide}
  %  {\small \pastix{} Version 5.1}% {\footnotesize --- needs \em{more} updating!}}
  \\[1ex] {\tiny \SVNDate}%\SVNRev}
  %           \footnotesize \today
\end{center}

%\begin{enumerate}
%\item  \textsc{Nota Bene:} S is the \emph{language},
%  R is one \emph{dialect}!
%\item This is a list of the more widely used \textbf{key - shortcuts}.
%  Many more are available, and most are accessible from the Emacs
%  \textbf{Menus} such as \texttt{iESS}, \texttt{ESS}, etc.
%NN  \vspace*{-3ex}
%\end{enumerate}
%\end{multicols}
%NN \rule{\textwidth}{.2pt}%----------------------------------------------------
\begin{multicols}{2}
  \Sect{Calling \pastix{} with a global matrix}
  
  \hrule
  
  \input{../fonctions/pastix_proto_C}
  
  \vskip 0.3 cm
  \hrule
  
  \input{../fonctions/pastix_proto_F}

  \hrule
  %\begin{multicols}{2}
  \input{../fonctions/pastix_arguments}
  \hrule
  In the current release, the matrix must be given in Compressed
  Sparse Column format in Fortran numbering (starts from 1). 
  
  \begin{multicols}{2}
    CSC matrix example :
    $  
    \begin{pmatrix} 
      1 & 0 & 0 & 0 & 0\\
      0 & 3 & 0 & 0 & 0\\ 
      2 & 0 & 5 & 0 & 0\\  
      0 & 4 & 6 & 7 & 0\\
      0 & 0 & 0 & 0 & 8\\
    \end{pmatrix}
    $\\
    \begin{tabular}{lcl}
      colptr & = & $\{1,3,5,7,8,9\}$\\
      row    & = & $\{1,3,2,4,3,4,4,5\}$\\
      avals  & = & $\{1,2,3,4,5,6,7,8\}$\\
    \end{tabular}
  \end{multicols}

  \vskip 3 cm
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%%%%%% DISTRIBUTED MATRIX %%%%%%%%%
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \Sect{Calling \pastix{} with a local matrix}

  \hrule

  \input{../fonctions/dpastix_proto_C}

  \hrule

  \input{../fonctions/dpastix_proto_F}
  \hrule
  
  Additional parameter :

  \begin{arguments}
    \argdesc{loc2glb}{Local to global column number correspondance,
      all columns must be distributed once and loc2glob must be ordered increasingly.}
  \end{arguments}\\
  \hrule
  %% The only parameters changing from classical \pastix{} call are
  %% the ones corresponding to the CSC matrix.\\
  %% The CSC matrix is now distributed.\\

  %% \begin{tabI}
  %%   \texttt{colptr}  & Tabular indicating start of each column in row and avals tabulars.\\
  %%   \texttt{row}     & Line indexes for each local column.\\
  %%   \texttt{avals}   & Values of the local part of the matrix.\\
  %%   \texttt{loc2glb} & global number of each local columns.
  %% \end{tabI}
  The distribution of the CSC matrix is given through the loc2glb vector (see example below).

  \begin{multicols}{2}
    dCSC matrix example :\\

    $  
    \begin{pmatrix} 
      P_1 & P_2 & P_1 & P_2 & P_1\\
      1   & 0   & 0   & 0   & 0\\
      0   & 3   & 0   & 0   &  0\\ 
      2   & 0   & 5   & 0   & 0\\  
      0   & 4   & 6   & 7   & 0\\
      0   & 0   & 0   & 0   & 8\\
    \end{pmatrix}
    $\\
    \vskip 2 cm
    On processor one : \\
    \begin{tabular}{lcl}
      colptr  & = & $\{1,3,5,6\}$\\
      row     & = & $\{1,3,3,4,5\}$\\
      avals   & = & $\{1,2,5,6,8\}$\\
      loc2glb & = & $\{1,3,5\}$\\
    \end{tabular}

    On processor two : \\
    \begin{tabular}{lcl}
      colptr   & = & $\{1,3,4\}$\\
      row      & = & $\{2,4,4\}$\\
      avals    & = & $\{3,4,7\}$\\
      loc2glb  & = & $\{2,4\}$\\
    \end{tabular}
  \end{multicols}
\end{multicols}
\newpage

\Sect{Integer and real parameters (iparm and dparm)}
%%    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

\input{iparm.tex}
%%    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\input{dparm.tex}
\newpage

\Sect{\pastix{} API : Macros}
%%    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{multicols}{2}

  \input{api.tex}
\end{multicols}
\newpage
\Sect{\pastix{} API : Functions}
\begin{multicols}{2}
  \input{apifunctions.tex}
\end{multicols}
\newpage
\begin{multicols}{2}
\Sect{\pastix{} API : Murge Interface}
\input{murge.tex}
\end{multicols}
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% COMPILATION        %%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{multicols}{2}

  \begin{center}
    {\LARGE How-to compile \pastix{}}
  \end{center}
  \Sect{Requirements}
  The \pastix{} team recommends that you get the \scotch{}
  (\url{http://gforge.inria.fr/projects/scotch/}) and compile it.\\ 
  Then go into \pastix{} directory. Select the config file corresponding
  to your machine in \texttt{\$\{PASTIX\_DIR\}/config/} and copy it to
  \texttt{\$\{PASTIX\_DIR\}/config.in}.\\ 
  Now edit this file, select the options you want, and set the correct
  path for \texttt{\$\{SCOTCH\_HOME\}}.\\ 
  If you want to use \metis{}, you also have to compile it and edit the
  path in \texttt{config.in}.

  \Sect{Compilation}

  \begin{tabIII}
    \hline
    \tabIIItitle{Makefile tags (from the root directory)}\\
    \hline
    \texttt{make help    }       & print this help\\
    \texttt{make all     }       & build \pastix{} library\\
    \texttt{make debug   }       & build \pastix{} library in debug mode\\
    \texttt{make drivers }       & build matrix drivers library\\
    \texttt{make debug drivers } & build matrix drivers library in debug mode\\
    \texttt{make examples}       & build examples (will run \texttt{'make all'} and \texttt{'drivers'} if required)\\
    \texttt{make murge   }       & build \murge{} examples\\
    \texttt{make python}         & Build python wrapper and run an example\\
    \texttt{make clean   }       & remove all binaries and objects directories\\
    \texttt{make cleanall}       & remove all binaries, objects and dependencies directories\\
    \hline 
  \end{tabIII}

  \Sect{Compilation options (\texttt{config.in})}

  \begin{tabIII}
    \hline
    \tabIIItitle{General options} \\
    \hline
    \texttt{-DDISTRIBUTED}         & Enable distributed mode \texttt{dpastix} (PT-Scotch required)\\
    \texttt{-DFORCE\_LONG}         & Use long integers\\
    \texttt{-DFORCE\_DOUBLE}       & Use double floating coefficients\\
    \texttt{-DFORCE\_COMPLEX}      & Use complex coefficients\\
    \texttt{-DFORCE\_NOMPI}        & Compile without MPI support\\
    \texttt{-DFORCE\_NOSMP}        & Compile without Thread support\\
    %  \texttt{-DONLY\_LOAD\_SYMBMTX} & Will only load the symbol matrix and make a fake factorization\\
    \hline
  \end{tabIII}

  \begin{tabIII}
    \hline
    \tabIIItitle{Preprocessing options} \\
    \hline
    \texttt{-DMETIS}           & Use Metis ordering library (needs \texttt{-L\$\{METIS\_HOME\} -lmetis)}\\
    \texttt{-DWITH\_SCOTCH}    & Activate Scotch ordering library\\
    \hline
  \end{tabIII}

  \begin{tabIII}
    \hline
    \tabIIItitle{Solver options - \textit{See \texttt{\$PASTIX\_HOME/sopalin/src/sopalin\_define.h}}}\\
    \hline
    \texttt{-DNUMA\_ALLOC}      & Allocate the coefficient vector locally on each thread.\\
    \texttt{-DNO\_MPI\_TYPE}    & Copy into communication buffers to avoid using MPI types.\\
    \texttt{-DTEST\_IRECV}      & Use nonblocking receives\\
    \texttt{-DTHREAD\_COMM}     & Receive on dedicated threads (persistent communications).\\
    \texttt{-DPASTIX\_FUNNELED} & Use main thread for all communications.\\
    %  \texttt{-DNOSMP\_RAFF}     & Uses threads in refinement functions.\\
    \hline 
  \end{tabIII}

  \begin{tabIII}
    \hline
    \tabIIItitle{Statistics and Debug options - \textit{See \texttt{\$PASTIX\_HOME/sopalin/src/sopalin\_define.h}}}\\
    \hline
    \texttt{-DMEMORY\_USAGE}   & Show memory allocations (may slow down execution)\\
    \texttt{-DSTATS\_SOPALIN}  & Show parallelization memory overhead\\
    \texttt{-DVERIF\_MPI}      & Check MPI Communications for success\\
    \texttt{-DFLAG\_ASSERT}    & Adds some checks during factorization\\
    %    \texttt{-DTRACE\_SOPALIN}  & Generate a trace file for PAJE\\
    \hline
  \end{tabIII}
  \vskip 6 cm

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%%%%%% Details            %%%%%%%%%
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \input{details.tex}


  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%%%%%% ADVANCED           %%%%%%%%%
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  \newpage
%%  \input{advanced.tex}
\end{multicols}
\end{document}
