%ADASS_PROCEEDINGS_FORM%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% SAMPLE2.TEX -- ADASS XII (2002) ASP Conference Proceedings sample
% paper with complicated markup. Based on ADASS XI (01) version.
%
% This is a comprehensive example, meaning that we have made use of each
% of the capabilities of the LaTeX + the ASPCONF macro package that we think
% you may need to use.  If you want to see a "base-bones" sample paper,
% take a look at sample1.tex.
%
% Much of the input will be enclosed by braces (i.e., { }).  The
% percent sign, "%", denotes the start of a comment; text after it
% will be ignored by LaTeX.  You might also notice in some of the
% examples below the use of "\ " after a period; this prevents LaTeX
% from interpreting the period as the end of a sentence and putting
% extra space after it.   
% 
% You should check your paper by processing it with LaTeX.  For
% details about how to run LaTeX as well as how to print out the User
% Guide, consult the README file.  
%
% If you do not have access to the LaTeX software or a laser printer
% at your site, you can still prepare your paper following the
% instructions in the User Guide.  In such cases, the editors will
% process the file and make any necessary editorial adjustments.
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
\documentclass[11pt,twoside]{article}  % Leave intact
\usepackage{adassconf}

% If you have the old LaTeX 2.09, and not the current LaTeX2e, comment
% out the \documentclass and \usepackage lines above and uncomment
% the following:

%\documentstyle[11pt,twoside,adassconf]{article}

\begin{document}   % Leave intact

%-----------------------------------------------------------------------
%			    Paper ID Code
%-----------------------------------------------------------------------
% Enter the proper paper identification code.  The ID code for your
% paper is the session number associated with your presentation as
% published in the official conference proceedings.  You can
% find this number locating your abstract in the printed proceedings
% that you received at the meeting or on-line at the conference web
% site; the ID code is the letter/number sequence proceeding the title
% of your presentation.
%
% This will not appear in your paper; however, it allows different
% papers in the proceedings to cross-reference each other.  Note that
% you should only have one \paperID, and it should not include a
% trailing period.
%

\paperID{P10-7}
%%%% ID=P10-7

%-----------------------------------------------------------------------
%		            Paper Title 
%-----------------------------------------------------------------------
% Enter the title of the paper.
%
% EXAMPLE: \title{A Breakthrough in Astronomical Software Development}
%
% If your title is so long as to fill the page header when you print it,
% then please supply a short form as a \titlemark.
%
% EXAMPLE:
%  \title{Rapid Development for Distributed Computing, with Implications
%         for the Virtual Observatory}
%  \titlemark{Rapid Development for Distributed Computing}
%

\title{Scheduler, a distributed batch controller}
\titlemark{Scheduler, a distributed batch controller}

%-----------------------------------------------------------------------
%		          Authors of Paper
%-----------------------------------------------------------------------
% Enter the authors followed by their affiliations.  The \author and
% \affil commands may appear multiple times as necessary.  List each
% author by giving the first name or initials first followed by the
% last name.  Authors with the same affiliations should grouped
% together. 
%
% Try to limit the front matter to no more than three \author
% commands.  Group authors with the same affiliations.  Too many
% \author commands fills the first page of the paper with little
% actual text.

\author{D. Nguyen, R. Edgar, T. Gaetz, D. Jerius, M. Tibbetts}
\affil{Harvard-Smithsonian Center for Astrophysics}

% Notice that some of these authors have alternate affiliations, which
% are identified by the \altaffilmark after each name.  The actual alternate
% affiliation information is typeset in footnotes at the bottom of the
% first page, and the text itself is specified in \altaffiltext commands.
% There is a separate \altaffiltext for each alternate affiliation
% indicated above.

%-----------------------------------------------------------------------
%			 Contact Information
%-----------------------------------------------------------------------
% This information will not appear in the paper but will be used by
% the editors in case you need to be contacted concerning your
% submission.  Enter your name as the contact along with your email
% address.

\contact{Dan Nguyen}
\email{dtn@head-cfa.harvard.edu}

%-----------------------------------------------------------------------
%		      Author Index Specification
%-----------------------------------------------------------------------
% Specify how each author name should appear in the author index.  The 
% \paindex{ } should be used to indicate the primary author, and the
% \aindex for all other co-authors.  You MUST use the following
% syntax: 
%
% SYNTAX:  \aindex{LASTNAME, F. M.}
% 
% where F is the first initial and M is the second initial (if
% used).  This guarantees that authors that appear in multiple papers
% will appear only once in the author index.  

\paindex{Nguyen, D.}
\aindex{Edgar, R.}
\aindex{Gaetz, T.}
\aindex{Jerius, D.}
\aindex{Tibbetts, M.}

%-----------------------------------------------------------------------
%                     Author list for page header
%-----------------------------------------------------------------------
% Please supply a list of author last names for the page header. in
% one of these formats:
%
% EXAMPLES:
% \authormark{LASTNAME}
% \authormark{LASTNAME1 \& LASTNAME2}
% \authormark{LASTNAME1, LASTNAME2, ... \& LASTNAMEn}
% \authormark{LASTNAME et al.}
%
% Use the "et al." form in the case of seven or more authors, or if
% the preferred form is too long to fit in the header.

%\authormark{Djorgovski, King, \& Biemesderfer}
\authormark{Nguyen, Edgar, Gaetz, Jerius, Tibbetts}

%-----------------------------------------------------------------------
%			Subject Index keywords
%-----------------------------------------------------------------------
% Enter up to 6 keywords describing your paper.  These will NOT be
% printed as part of your paper; however, they will be used to
% generate the subject index for the proceedings.  There is no
% standard list; however, you can consult the indices for past ADASS
% proceedings (http://iraf.noao.edu/ADASS/adass.html). 

\keywords{computing: distributed}

%-----------------------------------------------------------------------
%			       Abstract
%-----------------------------------------------------------------------
% Type abstract in the space below.  Consult the User Guide and Latex
% Information file for a list of supported macros (e.g. for typesetting 
% special symbols). Do not leave a blank line between \begin{abstract} 
% and the start of your text.

\begin{abstract}          % Leave intact
As part of our effort to support the calibration of the Chandra X-ray
Observatory's High Resolution Mirror Assembly (HRMA), we often have
to run many computationally intensive simulation programs.  In order to
maximize our efficiency we have written a suite of programs to
distribute batch jobs by exploiting idle workstations during
non-work hours.  We discuss the system architecture of the 
Scheduler programs which were written to facilitate the tedious task of
submitting a large number of batch jobs.  As a demonstration of the
capabilities of the Scheduler program, we describe its use in the
analysis of ground calibration data. We also compare the
efficiency of the Scheduler to the Sun's Grid Engine.
\end{abstract}

%-----------------------------------------------------------------------
%			      Main Body
%-----------------------------------------------------------------------
% Place the text for the main body of the paper here.  You should use
% the \section command to label the various sections; use of
% \subsection is optional.  Significant words in section titles should
% be capitalized.  Sections and subsections will be numbered
% automatically. 

\section{Introduction}

Personal workstations are often idle for extended period of time,
especially during non-work hours.
We often have to run a large number of ray-traces, up to 1 million
jobs, so Scheduler was written to exploit the computational power
of idle workstations during non-work hours.
Our batch jobs may last only a few tens of seconds so using a
backend SQL database will yield unacceptable long
transaction times, instead the batch queues are now kept in memory
to reduce the per-job scheduling costs.
Scheduler is a distributed batch job controller using the
client/server paradigm for batch jobs submission,
Figure ~\ref{P10-7:T1.10-fig-1} shows the architecture of the Scheduler system.
The program has the following features: A centralized batch job
submission and job control across heterogeneous systems.  Workstations
are assigned to classes, and can be members of several classes.
The user can specify the class of workstations on which to run a batch-job.
The user can dynamically add and remove workstations to the pool of
workstations. The user can kill and suspend jobs.  Each workstation
has its own non-work hours schedule. The owner of each workstation
can override its current non-work hours schedule.

\section{The Server}

Scheduler was implemented using the Remote Method Invocation (RMI)
capabilities of Java.  RMI was chosen because the server and the
clients are Java applications and RMI allows applications to call
object methods located remotely without having to deal with the low
level networking details.  The architecture and runtime
dynamics of the system can be summarized as follows:

\begin{figure}
\epsscale{.80}
\plotone{P10-7_f1.eps}
\caption{Architecture of the Scheduler.\label{P10-7:T1.10-fig-1}}
\end{figure}

The remote object registry, rmiregistry, must first be started on a
specified port on the current host. The remote object registry is a
naming service used by RMI server to bind objects to names. Once an
object has been registered, the clients can look up remote objects and
make remote method invocations.
The server can be started once the remote object registry is up and 
running.  The server makes its methods available for remote
invocation by binding it to a name in the RMI registry. The server is
the centralized processor to carry out the following tasks: 
The server is the central repository for batch jobs submission.
The server dispenses the appropriate batch job upon request from
idled clients.
The server relays commands for the clients to suspend or terminate
processing.

% In this section, we see the use of the \subsection command to set off
% an independent subsection.  We only have one here; usually there would
% be several.
%
% We show the use of several of the displayed math environments
% described in the User Guide, and you get a healthy dose of
% mathematical typesetting examples.  Also, observe the use of the LaTeX
% \label command after the \subsection to give a symbolic tag to the
% subsection for cross-referencing in a \ref command.  LaTeX
% automatically numbers the sections, equations, tables, etc. as it
% goes, so in general you don't know what number something is going to
% have.  We'll refer to the "hairymath" section a little later.

\section{The Clients}

The client obtains a reference to the server remote object by looking
up the name which the server had register itself as with the rmiregistry.
Once the client has the server remote object, it can invoke methods on 
it as if it were a local object. The tasks of the clients are:
The client must verify that it is not within the black-out period
before requesting work.
If the client determines that it is within the black-out period, 
it sleeps until the next available time zone.  While sleeping, the
client must periodically check to make sure that it has not been sent a
signal to be terminated.
The client continues to request work from the server until the
list of batch jobs is exhausted.

There are numerous programs and scripts to monitor the progess of the
batch jobs and to summarize the workload distributions based on the log 
file generated by the server.

% In these sections, we see some additional math-related markup, and we
% have references to one of the tables (occurs later in the document)
% and the "hairymath" section immediately preceding this one.
%
% In the second paragraph, note the use of in-text math ($stuff$) including
% a couple of the miscellaneous symbol commands defined in the macro package.
%
% This is the last section of the paper, so there is an \acknowledgments
% section at the end of the main body.

\section{Disadvantages of Scheduler}

We do not have the software development resources required to
implement a system secure enough to run with superuser privileges.
In order to avoid security problems, Scheduler runs as a
non-privileged user, this means that a separate instance of the
server and the clients must be started for each user in order that
jobs be run with correct access permissions to disk space, etc.
Scheduler does not implement a mechanism to arbitrate resources
between users; each job ``network'' is ignorant of any other.  Thus,
cooperation between users is required to prevent the client machines
from being overburdened.  We have a small group of users, so this
has not been a problem.
The drawbacks with the current design of the current Scheduler are:
It is a single user cooperative multi tasking system.
The batch job queue is non-persistent.
All jobs must complete before the batch queue can be changed.
The Java Virtual Machine (JVM) can be a memory intensive application.
It implements primitive first in first out (FIFO) job and
batch queues.

\section{Application}

As a demonstration of the Scheduler's capabilities, 
we compare the ground based calibration measurements to the SAOsac
model (Jerius 2003) to determine the pointing of Chandra's High
Resolution Mirror Assembly(HRMA) during testing at the X-Ray
Calibration Facility (XRCF).

The HRMA was mounted to multiple stages which could raise or lower the 
front and rear of the mirrors or move them side to side.
Changes in the position of the source 
or inaccuracies in the HRMA stage positions could lead to uncertainty
in the absolute pointing of the HRMA. As the shape of the line
response function (LRF) changes as a function of HRMA pointing, it is
possible to use the LRF measurements to determine the pointing.
Measuring the HRMA pointing during the XRCF testing proved to be a
nontrivial task[1].

We determine the pointing of the HRMA by optimizing the fit between 
the data and simulated LRF measurements, letting the simulations 
explore the parameter space consisting of the HRMA yaw and pitch and 
the aperture XY position in the focal plane. Presumably, the best fit 
pointing will indicate the absolute pointing of the HRMA at the XRCF.  
In order to get a fair sampling of the mirror models, each HRMA 
pointing was simulated with 100 different realizations of the model,
see Figures ~\ref{P10-7:T1.10-fig-2}.

\begin{figure}
\epsscale{.80}
\plottwo{P10-7_f2.eps}{P10-7_f3.eps}
\caption{Simulated focal plane image of the horizontal scan with
apertures overlaid. Line response function for the simulation.\label{P10-7:T1.10-fig-2}}
\end{figure}

\section{Performance Analysis}

The Scheduler is a fairly efficient program, the following table is a
comparison of the execution time of 100 realizations of raytraces
using Scheduler versus the Sun's Grid Engine.

\begin{table}
\caption{Scheduler versus Sun's Grid Engine. \label{P10-7:T1.10-tbl-1}}
\scriptsize
\begin{tabular}{lcr}
\tableline\tableline
Manager & Average Time & Standard Deviation \\
\tableline
Scheduler         & 00:01:57.70 &  2.003 secs \nl
Sun's Grid Engine & 00:03:06.09 & 55.827 secs \nl
\tableline
\end{tabular}
\end{table}

% Tables can be generated using the deluxetable environment, the same
% environment used in the AASTeX macro package.  Here \scriptsize
% was used to force the table to fit on the printed page.
%
% Column headings are specified within a \tablehead command, using the
% \colhead command to specify each column heading (or the LaTex command
% \multicolumn may be used).  The data is entered between the \startdata
% and \enddata commands.  Use the & as a column delimiter and end each
% data line with \nl.  For details see the User Guide.

Keeping the list of batch jobs in memory reduces the Scheduler's overhead.
The following table compares the time of Scheduler versus the Sun's
Grid Engine when the list of batch jobs contains jobs which are
short in duration.

\begin{table}
\caption{Scheduler versus Sun's Grid Engine. \label{P10-7:T1.10-tbl-2}}
\scriptsize
\begin{tabular}{lcr}
\tableline\tableline
Num & Scheduler & Sun's Grid Engine \\
\tableline
100   & 00:00:17.61 & 00:00:26.00 \nl
1000  & 00:01:18.81 & 00:04:50.00 \nl
10000 & 00:12:01.90 & 01:13:03.00 \nl
\tableline
\end{tabular}
\end{table}

% Text for table footnotes must follow the tabular environment but must
% be inside the table environment.  Note that it is OK to put \ref's
% in \tablenotetext's.

% That's the end of the main body of the paper.  Now we will have some
% back matter.
%
%-----------------------------------------------------------------------
%			      References
%-----------------------------------------------------------------------
% Now comes the reference list.  Since we typed out the citations ourselves,
% the reference list is enclosed in a "references" environment.  Each
% new reference begins with a \reference command which sets up the proper
% indentation.  Typography that may be required in the reference list by
% the editorial staff must be included by the author.
%
% Observe the "standard" order for bibliographic material: author name(s),
% publication year, journal name, volume, and page number for articles.
% Some journal names are available as macros; see the package
% instructions for a listing of which ones have been "macro-ized".
%
% There is no need to engage in any other typographic manipulation.
%
% List your references below within the reference environment
% (i.e. between the \begin{references} and \end{references} tags).
% Each new reference should begin with a \reference command which sets
% up the proper indentation.  Observe the following order when listing
% bibliographical information for each reference:  author name(s),
% publication year, journal name, volume, and page number for
% articles.  Note that many journal names are available as macros; see
% the User Guide for a listing "macro-ized" journals.   
%
% Note the following are some of the tricks that can be used:
%
%   o  \& is used to format an ampersand symbol (&).
%   o  \'e and \`e puts an accent agu and accent grave, respectively,
%      over the letter e.  See the User Guide for details on
%      formatting special characters.
%   o  "\ " after a period prevents LaTeX from interpreting the period 
%      as an end of a sentence.
%   o  \aj is a macro that expands to "Astron. J."  See the User Guide
%      for a full list of journal macros
%   o  \adassviii is a macro that expands to the full title, editor,
%      and publishing information for the ADASS VIII conference
%      proceedings.  Such macros are defined for ADASS conferences I
%      through X.
%   o  When referencing a paper in the current volume, use the
%      \adassviii and \paperref macros.  The argument to \paperref is
%      the paper ID code for the paper you are referencing.  See the 
%      note in the "Paper ID Code" section above for details on how to 
%      determine the paper ID code for the paper you reference.  
%
% Finally, we have a little acknowledgments section.

\acknowledgments
This work is supported by the Chandra X-ray Center under NASA
contract NAS8-39073.

\begin{references}
\reference Edgar, R. XRCF Phase 1 Testing: Analysis Results,
Appendix D: HRMA Pointing at XRCF
\reference Jerius, D. et al. The Role of Modeling in the Calibration 
of Chandra's Optics,
Proc. SPIE, Vol. 5165, X-Ray and Gamma-Ray Instrumentation for Astronomy XIII
\end{references}

% Do not place any material after the references section

\end{document}  % Leave intact
