\documentclass[a4paper, twoside]{article}
\usepackage[margin=12mm, verbose]{geometry}
\usepackage{graphicx, here, multicol}
\usepackage{charter, courier}
\usepackage[OT1,T1]{fontenc} %use TeX encoding then Type 1.
%\usepackage[protrusion=true,expansion=true]{microtype} % Better typography
\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm} % Math packages
\usepackage{lettrine} % dropped capital letter
\usepackage{booktabs} % Horizontal rules in tables
\usepackage{sectsty} % Enables custom section titles
\allsectionsfont{\large\color{prace-orange}\usefont{OT1}{phv}{m}{n}}
\usepackage[small,labelfont=bf,up,textfont=up]{caption}
\usepackage[cmyk]{xcolor} 
\definecolor{prace-orange}{rgb}{1.0,0.42, 0.1} % 255, 107, 25
\definecolor{prace-darkblue}{rgb}{0.1, 0.19, 0.48} % 25, 49, 123
\definecolor{prace-lightblue}{rgb}{0.52, 0.81, 0.94} %132, 206, 239
\newcommand{\highlight}[1]{\textcolor{prace-orange}{#1}}
\definecolor{link}{rgb}{0.1, 0.19, 0.48}  
\usepackage[superscript,biblabel]{cite}
\usepackage{calc,wrapfig}
\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum'


\usepackage[colorlinks=true, linkcolor=link, anchorcolor=link,citecolor=link,
filecolor=link, menucolor=link,urlcolor=prace-darkblue]{hyperref}

%To automatically convert Inkscape SVG into PDF or EPS use:
% pdflatex -synctex=1  --enable-write1 sohpc-template.tex
\newcommand{\includegraphicsvg}[2][]{%
  \ifnum\pdfstrcmp{\pdffilemoddate{./#2.svg}}%
  {\pdffilemoddate{../gen/#2.pdf}}>0%
  {\immediate\write18{inkscape -z -D --file=./#2.svg %
      --export-pdf=#2.pdf --export-eps=#2.eps %
      --export-area-drawing}}\fi%
  \includegraphics[#1]{#2}%
}

% http://tex.stackexchange.com/questions/59166/span-column-in-a-multicols-environment
\newcounter{tempcolnum}
\makeatletter
\newcommand{\multicolinterrupt}[1]{% Stuff to span rows
\setcounter{tempcolnum}{\col@number}
\end{multicols}
#1%
\begin{multicols}{\value{tempcolnum}}
}
\makeatother

\hyphenation{SoHPC AntiSpam} % do not hyphenate
\pagestyle{empty}

\usepackage{titling}

\pretitle{\vspace*{-100pt} \begin{flushleft}
    \usefont{OT1}{phv}{m}{n}\selectfont\large}

\title{Automating fusion research through} % Your article title

\posttitle{\par\end{flushleft}\vskip 0.5ex}

\renewcommand{\maketitlehookb}{\par\noindent\flushleft%
\fontsize{45}{50}\usefont{OT1}{phv}{m}{n}\selectfont%
\highlight{Scientific} workflows} 

\preauthor{\vskip 0.9ex \begin{flushleft}\large
    \usefont{OT1}{phv}{b}{sl} \color{prace-orange}}

\author{Evguenia Usoskina} % Name and surname

\postauthor{\par\end{flushleft}}

\predate{}\date{} \postdate{\vspace{-50pt}}

\begin{document}
\noindent
\begin{minipage}{0.4\linewidth}
  \maketitle
  \thispagestyle{empty}
  \fontsize{14pt}{20pt}\usefont{OT1}{phv}{m}{n}\selectfont
  \raggedright
\end{minipage}\hfill%
\begin{minipage}{0.6\textwidth}
  \includegraphics[width=\linewidth]{workflow}
\end{minipage}
\vskip 30pt
\frenchspacing
\begin{minipage}{1\linewidth}
  \thispagestyle{empty}
  \fontsize{14pt}{20pt}\usefont{OT1}{phv}{m}{n}\selectfont
  \raggedright
  This project involves source code modification for an open sourced visualisation tool VisIt and integrating the changes into a an actor for a scientific workflow software Kepler. The final outcome is a software patch, the application of which will aid researchers in visualisations of fusion reactor simulations. 
\vspace{10mm}
\end{minipage}\hfill

\begin{multicols}{3}

\lettrine[lines=4,nindent=0em]{\highlight{T}}{}The essence the project is adding new functionality to existing software. However, as software is only a means to an end, a question arises right away: what is it going to be used for? The answer is an exciting one: for simulations of a fusion reactor! Fusion is a fascinating and currently a very ''hot'' subject.

The reactor simulated in the project is tokamak: a word derived from Russian for ''toroidal chamber with magnetic coils'', which is essentially a very large doughnut-shaped vacuum chamber. A gas of ionised deuterium and tritium particles is pumped into the vacuum, until a high density is reached. Then, a beam of high velocity neutral deuterium particles is fired into the chamber to collide with the gas particles, increasing the temperature of the system greatly. A pulse of electric current is then induced, heating the system even further, and turning ionised gas into plasma. The high temperatures of around 100 million degrees Celsius cause the deuterium and tritium particles to fuse together, thus releasing energy, just as happens inside stars. Joint European Torus (hereafter affectionately called JET) is the world's largest tokamak fusion reactor located in Oxfordshire, UK. From the official JET website, it ''investigates the potential of fusion power as a safe, clean and virtually limitless energy source for future generations''. To see what JET looks like in action, click here. However, not all the research is done experimentally - simulations also play an important role in understanding the science. While simulating plasma behaviour is relatively easy, problems arise when trying to model what happens near the walls of the tokamak: the high voltage drop causes a so-called '''singularity'' - something that is virtually impossible to model. That is the sort of cutting-edge science we will be working with - assisting in visualising JET reactions using HPC.

There are numerous benefits to using nuclear fusion, as it is one of the most promising options for generating large amounts of carbon-free energy in the future. According to current estimates, the costs of using fusion energy can be comparable with that of fission, renewables and fossils.

As described earlier, the fuel used in fusion is tritium and deuterium, and their supply is essentially inexhaustible. While deuterium can be extracted from water, tritium can be produced from lithium, which is found in the earth's crust.

In addition to that, there are numerous other advantages of fusion, namely:

\begin{itemize}
\item No emission of harmful toxins
\item Only helium is produced in the process, which is already abundant in the atmosphere and will not contribute to global warming
\item Efficiency: 1kg of fusion can provide the same amount of energy as 10 million kg of fossil fuels
\item Safety: as only small amounts of fuel are used at a time, large-scale nuclear accidents are virtually impossible
\end{itemize}

%\begin{wrapfigure}[11]{l}[\columnwidth+\columnsep]{1.3\columnwidth}
 % \color{yellow}\rule{\linewidth}{4cm}\color{black}
%\end{wrapfigure}


\section*{VisIt}
VisIt is an interactive visualisation tool used for graphical analysis of scientific data. It is a client-server application: the client sends the commands for visualisation to the server, which computes the data using high-performance parallel resources to generate the visualisation that is shown in the client's display. Thanks to this operation, it can handle very large data set sizes in the terascale range. For this reason, VisIt is ideal for visualising complex simulations such as the ones of the tokamak fusion reactor, which is precisely the one I am going to work with. It is also possible to run it on your own computer with small data sets in the kilobyte range.

\begin{figure*}[t!]
  %\color{yellow}\rule{2\columnwidth+\columnsep}{10cm}%
 % \hspace{\columnsep}\color{yellow}\rule{1.0\columnwidth}{8cm}
 \includegraphics[width=\linewidth]{Project-logo}
  %\color{black}
  \caption*{A simple workflow created with Kepler}
  \label{fig:large}
\end{figure*}

VisIt's paradigm is to create one or more plots in a visualisation window. If there is more than one visible plot at the same time, they are combined. It is possible to apply operators to the variables used to create the plots. One example of an operator could be the Slice: if you have a 3D plot you can ''cut'' a slice of it and just show that slice. In that case, it will use a portion of the data to create the plot.

\section*{Kepler}
SWFs are used to automate and record data transformations, and in my case come in the form of software. For example, imagine a researcher who wishes to simulate molecular dynamics. This works in the following way: he has some initial input data (i.e. the initial positions of particles, their velocities, etc.), which he then feeds into his program. For the purpose of scientific workflows, we can treat the program as a black box - we don't care how it performs the data transformation, or what language it is written in - all that concerns us is the output. Thus, for the molecular dynamics example we want the output to be the states of the particles after a given time period. This is an example of a very simple scientific workflow - we have transformed the initial data. However, usually more than one such transformation is required, where data is passed between different programs, often written in different languages.

The main goal of SWF is to ease scientific research. If a simulation requires multiple data manipulations (as real simulations almost always would!), one could manually ''move'' the data from one program to another, but not only is that tiresome, but also very prone to mistakes. On the other hand, if one first creates a workflow, the process becomes automated - all that is needed is to ''feed'' in the data and receive the final output, much like merging all the little ''black boxes'' (separate programs) into one big ''black box'' (the workflow), which can be ''zoomed into'' and edited, if desired.

Another goal of SCWF, often overlooked, is provenance. Provenance means providing evidence of reproducibility of scientific findings. Scientific work is of good provenance if it is documented in such detail that it can be reproduced without doubts. Data provenance means that is it archived, recorded how it was collected, and under what conditions transformations were done. In principle, evidence (input data) should not be contaminated in any case. All of this may sound like some definitions from archaeology, art history, bio-informatics and other fields of science where data is difficult to collect. However in computational science provenance is just as important �all the findings have to be reproducible.

Despite computing being heavily used in the business field, a major portion of it is coming from the sciences. What is more, scientific research is becoming more and more computationally intensive now - it is no longer possible for a scientist to sit in his office with a just logarithmic ruler and perform calculations. That is why workflows are an essential tool in High Performance Computing (HPC), where the submitted jobs can be very complicated and take a very long time (thus making mistakes becomes progressively more expensive, and automation of the process is essential).

\lipsum[1-5]

Over 100 different scientific workflow products now exist, providing different functionalities, but the one I am working with is Kepler. The image shows my first workflow created in Kepler - a ''Hello World!'' program I wrote. What happens is the ''actor'' (or the black box), called HelloWorld outputs the desired sentence, and the display actor (another black box) displays that output.

\begin{figure}[H]
  %\color{yellow}\rule{\linewidth}{4cm}\color{black}
  \includegraphics[width=\linewidth]{blackbox}
  \caption{As far as scientific workflows are concerned, all the calculations are black boxes - the user only cares about the input and output!}
  \label{fig:blackbox}
\end{figure}


%\multicolinterrupt{\textcolor{prace-darkblue}{VisIt is open sourced, which means that anyone is free to look at the source code and modify it.}}
\section*{Code modifications}

VisIt is a visualisation software used for presenting data in an intuitive way. It is widely used by scientists, specifically for visualising very large datasets that require using HPC and parallelising tasks.

VisIt is open sourced, which means that anyone is free to look at the source code and modify it. To clarify the latter - one is free to modify the code for his or her own use, however, if one feels he has made an improvement that could greatly benefit the whole community, the modification can be submitted to the main developers of the code in Lawrence Livermore National Laboratory. This is done in a form of a patch - a diff file, containing the differences between your version and the original source code. The so-called "benevolent dictators"  (ie. the main developers) will review and make the final verdict upon all the suggested changes, and if the changes are approved, the patch will be publicly released.

Unfortunately, software development follows Murphy's laws when it comes to bugs - if a program is useful, it will have to be changed. Note that here I'm referring to bugs not only as a software failing to perform something correctly, but also to the case where an option to perform something is not there (the software failing to have a functionality it is expected to have). The first version of VisIt was released in 2002, while the current version is 2.6.2, and it's no surprise that new features are continuously added.

My task involved fixing a few of such bugs/functionality deficiencies. More specifically, I started by modifying the VisIt Java library. While VisIt itself is written in C++, this library allows for using VisIt through a Java program. The biggest problem I set out to tackle was the fact that if the user manually closed VisIt, Java didn't register it, fruitlessly continuing its communication attempts, and hung, getting no reply.

So, one may wonder why would one want to write a Java library for a software written in C++? Kepler uses actors that are written in Java. One of these is a VisIt Kepler actor, which lets the user visualise the desired dataset with VisIt. That�s where my modifications come in handy - if the VisIt session is closed manually, it is still desirable to be able to open it again, without  stalling the workflow.

After editing and re-factoring code, following functionalities have been added to the VisIt Kepler actor:

\begin{enumerate}
\item \textbf{additional input} - the user can now specify more initial parameters, such as the inclusion of GUIs, previous session name, etc.
\item \textbf{manual closing} - the user can now close VisIt and re-open it again
\item \textbf{session restore} - it is now possible to restore a previously saved VisIt session
\item \textbf{customised Graphical User Interface (GUI)} - allows the user to easily control VisIt
\end{enumerate}



%Use citations as superscript\cite{Figueredo:2009dg} if absolutely necessary.

\newcommand{\sohpcinfo}[1]{\par\vspace{1ex}\footnotesize
  \textcolor{prace-lightblue}{PRACE SoHPC}%
  \textcolor{prace-darkblue}{#1}\\[0.5ex]\scriptsize
}

\noindent\begin{minipage}[b]{0.7\linewidth}
\begin{flushleft}
  \usefont{OT1}{phv}{m}{n}\selectfont
  \sohpcinfo{Project Title}
  \href{http://summerofhpc.prace-ri.eu/projectsnick/slovenia-ulfme-scientific-workflows/}{Visualization support for scientific workflows with VisIt Kepler Actor}
  \sohpcinfo{Site}
  University of Ljubljana, Slovenia
  \sohpcinfo{Authors}
  \href{mailto:name@example.com}{\theauthor}
  \sohpcinfo{Mentor}
  dr.\ Leon Kos
\end{flushleft}
\end{minipage}\hfill%
\begin{minipage}[b]{0.3\linewidth}
  %\color{prace-lightblue}\rule{\linewidth}{2.5cm}\par
  \includegraphics[width=\linewidth]{Jane}
  \tiny\theauthor 
\end{minipage}%
%\vspace{-1.5ex}% any of information below is optional
%\begin{flushleft}
  %\sohpcinfo{Contact}
 % Name, Surname, Institution\\
  %Phone: +12 324 4445 5556\\
 % E-mail: \href{mailto:leon.kos@lecad.si}{leon.kos@lecad.fs.uni-lj.si}
 % \sohpcinfo{Software applied}
 % Virtuoso
 % \sohpcinfo{More Information}
 % \href{http://www.virtouso.org}{www.virtouso.org}
%  \sohpcinfo{Acknowledgement}
 %I would like to thank Leon, Luna and Mathi for support and help with the project
 % \sohpcinfo{References}
%\end{flushleft}
%\renewcommand\refname{}
%\begin{thebibliography}{9}
%\vspace*{-8ex}  % adjust this
%\scriptsize
%\bibitem[1]{Figueredo:2009dg}
%Figueredo, A.~J. and Wolf, P. S.~A. (2009).
%\newblock Assortative pairing and life history strategy - a cross-cultural
%  study.
%\newblock {\em Human Nature}, 20:317--330.
%\end{thebibliography}

\end{multicols}
\end{document} 

%%Local Variables:
%%% mode: latex
%%% TeX-parse-self: t
%%% TeX-auto-save: t
%%% TeX-source-specials-mode: t
%%% TeX-PDF-mode: t
%%% TeX-output-view-style: (("^pdf$" "." "okular --unique %o#src:%n${PWD}/%b"))
%%% LaTeX-command: "pdflatex -synctex=1  --enable-write1"
%%% TeX-master: t
%%% ispell-local-dictionary: "british"
%%% End:
%%% In Okular, go to Settings > Configure Okular > Editor > Select emacs
%%% client. Then use Shift+Left Click for inverse search.
