IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40021


Ignore:
Timestamp:
Apr 28, 2017, 4:51:12 AM (9 years ago)
Author:
eugene
Message:

updates to pantasks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/release.2015/ps1.datasystem/datasystem.tex

    r40020 r40021  
    311311stage is completed, summary information about the stage is written
    312312back to the database.  In this way, the database records this history
    313 of the processing, and also provides the information needed to
     313of the processing, and also provides the information needed by
    314314successive processing stages to begin their own tasks.
    315315
     
    319319This same database engine also has instances for other cameras
    320320processed by the IPP, e.g., GPC2, the test cameras TC1, TC3, and the
    321 Imaging Sky Probe (ISP).
     321Imaging Sky Probe (ISP).  In general, processing information for
     322different cameras is separate in differnt processing database; merging
     323of output products takes place in DVO.
    322324
    323325Within the processing database, the various processing stages are
     
    371373occurs, the system will not process an exposure through subsequent
    372374stages without the component that has failed temporarily.  Since many
    373 of the \ippdbcolumn{fault}s which occur are ephemeral, the processing
    374 stages are set up to occasional clear and re-try the faulted entries.
    375 Thus, automatic processing is able to keep the data flowing even in
    376 the face of occasional network glitches or hardware crashes.
     375of the \ippdbcolumn{fault}s which occur are ephemeral due to current
     376conditions of the processing cluster, the processing stages are set up
     377to occasionally clear and re-try the faulted entries.  Some faults
     378represent software bugs and in the early stages of processing were
     379accumulated until the corresponding software issue could be addressed;
     380since the start of the PS1 Science Consortium Surveys, these types of
     381faults have largely been eliminated.  Thus, automatic processing is
     382able to keep the data flowing even in the face of occasional network
     383glitches or hardware crashes.
     384
     385\note{start of section needed a re-read}
    377386
    378387\subsection{Summit copy}
     
    641650\label{sec:warp}
    642651
     652\note{need to describe the RINGS.V3 tessellation and others}
     653
    643654The \ippstage{warp} stage moves the data from a given exposure beyond
    644655away from being camera specific and towards a uniform sky oriented
     
    752763entry, no \ippmisc{advance} job is required.
    753764
     765\note{end of section needed a re-read}
     766
    754767\subsection{Stack Photometry}
    755768\label{sec:staticsky}
     
    759772deferred to the \ippstage{staticsky} stage.  This separation is
    760773maintained because the photometry analysis of the \ippstage{stack}
    761 images is performed on all 5 filters simultaneously.  By deferring
    762 this analysis, the processing system may also decouple the generation
    763 of the pixels from the source detection.  This makes the sequencing of
    764 analysis somewhat easier and less subject to blocks due to a failure
    765 in the stacking analysis.  Similar to the \ippstage{stack} stage, an
    766 entry is created in the \ippdbtable{staticskyRun} table, linked to a
    767 series of rows in the \ippdbtable{staticskyInput} table by a common
    768 \ippdbcolumn{sky\_id}, each of which also contains the appropriate
    769 \ippdbcolumn{stack\_id} entries for the skycell under consideration.
     774images, including convolved galaxy model fitting, is performed on all
     7755 filters simultaneously.  By deferring this analysis, the processing
     776system may also decouple the generation of the pixels from the source
     777detection.  This makes the sequencing of analysis somewhat easier and
     778less subject to blocks due to a failure in the stacking analysis.
     779Similar to the \ippstage{stack} stage, an entry is created in the
     780\ippdbtable{staticskyRun} table, linked to a series of rows in the
     781\ippdbtable{staticskyInput} table by a common \ippdbcolumn{sky\_id},
     782each of which also contains the appropriate \ippdbcolumn{stack\_id}
     783entries for the skycell under consideration.
    770784
    771785The input images are passed to the \ippprog{psphotStack} program,
     
    840854
    841855Any measurement which relies on a good knowledge of the PSF at the
    842 location of an object either needs to determine the PSF variations
    843 present in the \ippstage{stack} image, or the measurement will be
    844 somewhat degraded.  The highly textured PSF variations make this a
    845 very challenging problem: not only would such a PSF model require an
    846 unusually fine-grained PSF model, there would likely not be enough PSF
    847 stars in a given \ippstage{stack} image to determine the model at the
    848 resolution required.  The IPP photometry analysis code uses a PSF
    849 model with 2D variations using a grid of at most $6\times 6$ samples
    850 per skycell, a number reasonably well-matched to the density of stars
    851 at most moderate Galactic latitudes.  This scale is far too large to
    852 track the fine-grained changes apparent in the stack images.
     856location of an object needs to determine the PSF variations present in
     857the \ippstage{stack} image, or the measurement will be somewhat
     858degraded.  The highly textured PSF variations make this a very
     859challenging problem: not only would such a PSF model need to be highly
     860fine-grained, there would likely not be enough PSF stars in a given
     861\ippstage{stack} image to determine the model at the resolution
     862required.  The IPP photometry analysis code uses a PSF model with 2D
     863variations using a grid of at most $6\times 6$ samples per skycell, a
     864number reasonably well-matched to the density of stars at most
     865moderate Galactic latitudes for the PS1 3$\pi$ depths.  This scale is
     866far too large to track the fine-grained changes apparent in the stack
     867images.
    853868
    854869Thus PSF photometry as well as convolved galaxy models in the stack
     
    865880individual warp images used to generate the stack.  This
    866881\ippstage{fullforce} analysis is performed on all warps for a single
    867 skycell and filter as a single unit, as this matches the arrangement
    868 of the input source catalog from the \ippstage{skycal} stage.  When
    869 processing is queued for this stage, an entry is added to the
    870 \ippdbtable{fullForceRun} primary database table linking to the
    871 specific \ippdbcolumn{skycal\_id} entry that will be used as the
    872 catalog for the photometry.  The \ippdbcolumn{warp\_id} values for the
    873 input \ippstage{warp} stage images that contributed to the
    874 \ippstage{stack} associated with that \ippdbcolumn{skycal\_id} are
     882skycell and filter as a single unit within the processing database,
     883while individual warps are processed individually in parallel as
     884separate processing jobs. 
     885
     886When processing is queued for this stage, an entry is added to the
     887\ippdbtable{fullForceRun} primary database table with a reference to
     888the corresponding stack and \ippdbcolumn{skycal\_id} entry that is the
     889input source of detections to be measured.  The \ippdbcolumn{warp\_id}
     890values for the input \ippstage{warp} stage images that contributed to
     891the \ippstage{stack} associated with that \ippdbcolumn{skycal\_id} are
    875892then added to the \ippdbtable{fullForceInput} table, linked to the
    876893primary table by the \ippdbcolumn{ff\_id} identifier.  The individual
     
    884901the same stars for all warps to the extent possible (PSF stars which
    885902are excessively masked on a particular image are not used to model the
    886 PSF).  \note{this doesn't seem correct, as each warp is run
    887   independently. EAM: not true!}  The PSF model is fitted to all of the known source
    888 positions in the warp images.  Aperture magnitudes, Kron magnitudes,
    889 and moments are also measured at this stage for each warp.  Note that
    890 the flux measurement for a faint, but significant, source from the
    891 stack image may be at a low significance (less than the $5\sigma$
    892 criterion used when the photometry is not run in this forced mode) in
    893 any individual warp image; the flux may even be negative for specific
    894 warps.  When combined together, these low-significance measurements
    895 will result in a signficant measurement as the signal-to-noise
    896 increases by the square root of the number of measurements.
     903PSF).  The PSF model is fitted to all of the known source positions in
     904the warp images.  Aperture magnitudes, Kron magnitudes, and moments
     905are also measured at this stage for each warp.  Note that the flux
     906measurement for a faint, but significant, source from the stack image
     907may be at a low significance (less than the $5\sigma$ criterion used
     908when the photometry is not run in this forced mode) in any individual
     909warp image; the flux may even be negative for specific warps.  When
     910combined together, these low-significance measurements will result in
     911a signficant measurement as the signal-to-noise increases by the
     912square root of the number of measurements.  \note{The individual warp
     913measurements are combined together to generate averages values within
     914DVO.}
    897915
    898916Upon completion of the forced photometry (for point sources as well as
     
    901919that combination of \ippdbcolumn{ff\_id} and \ippdbcolumn{warp\_id}.
    902920Once all of the entries in the \ippdbtable{fullForceInput} table have
    903 finished, a summary operation is run to generate an appropriate
    904 average value for each measurement, by combining the measurements from
    905 each of the inputs.  The output catalogs listed in the
    906 \ippdbtable{fullForceResult} table are passed to the
     921finished, a summary operation is run to combine the galaxy photometry
     922analysis measurements into a single value.  The output catalogs listed
     923in the \ippdbtable{fullForceResult} table are passed to the
    907924\ippprog{psphotFullForceSummary} to do this averaging.  \note{describe
    908925  what is done} When this completes, an entry is added to the
     
    10311048entry as such.
    10321049
    1033 \section{Post-Processing : Database Ingest \& Calibration}
     1050\section{Post-Processing : Database Ingest and Calibration}
    10341051\label{sec:postprocessing}
     1052
     1053\begin{verbatim}
     1054DVO section outline or list of topics:
     1055
     1056* schema overview [ignoring sky partitioning]
     1057  * measurements -> objects
     1058  * images
     1059* object definition
     1060* tables in detail
     1061* adding other data types (2mass, etc)
     1062* storage details
     1063  * FITS
     1064  * compressed FITS
     1065* sky partitioning
     1066* parallelized DVO
     1067* addstar / ingest process [stage -> this goes elsewhere]
     1068* dvo shell description?
     1069\end{verbatim}
    10351070
    10361071\subsection{DVO}
     
    13981433\note{Default to pointing to Flewelling et al 2017?}
    13991434
    1400 \subsection{PSPS Load \& Merge}
     1435\subsection{PSPS Load and Merge}
    14011436\label{sec:psps}
    14021437\note{Default as well to pointing to Flewelling et al 2017?}
    14031438
    1404 \section{Operations \& Automation}
    1405 
    1406 \subsection{Pantasks \& Parallel Processing}
     1439\section{Operations and Automation}
     1440
     1441\subsection{Pantasks and Parallel Processing}
    14071442\label{sec:pantasks}
    14081443
     
    14141449the logical links to relate the results of one analysis stage to
    14151450another.  In order to make a complete system which can run
    1416 automatically, it is necessary to have a process which can use the
     1451automatically, it is necessary to have a software system which can use the
    14171452contents of the processing database to generate the commands
    14181453corresponding to the analysis stages.  This system needs to (1)
    14191454regularly examine the database to find items from stages which are
    1420 ready to be processed, (2) to have rules which define how to construct
    1421 the appropriate commands, (3) to cause those commands to be executed
    1422 within the processing system, (4) to monitor the active processing
    1423 jobs for completion, and (5) to check on the results of those
     1455ready to be processed, (2) have rules which define how to construct
     1456the appropriate commands, (3) cause those commands to be executed
     1457within the processing system, (4) monitor the active processing
     1458jobs for completion, and (5) check on the results of those
    14241459commands and update the processing database as needed.  Within the
    14251460Pan-STARRS IPP, the top-level management of these operations is
     
    14301465might be run and to regularly generate new commands based on that
    14311466concept.  The ``tasks'' are defined using the opihi scripting language
    1432 (also shared by DVO and other user-interative programs  within the
    1433 IPP). 
     1467(also shared by DVO and other user-interative programs within the
     1468IPP).
    14341469
    14351470Pantasks repeatedly checks each task in an attempt to generate a new
    1436 command: we say pantasks attempts to 'execute' the task.  Tasks may
    1437 specify the time between execution attempts, with a 1 second default.
     1471command: we say pantasks attempts to 'execute' the task in each of
     1472these attempts.  Tasks may specify the time between execution
     1473attempts, with a 1 second default.
    14381474
    14391475Each task must at a minimum define a command to generate.  Commands
     
    14411477command is explicity defined in the task block (see code example in
    14421478Figure~\ref{fig:task_example1}) and is identical each time the task is
    1443 execute.  For a task with a dynamic command, the command is defined
    1444 within a special block of the task, called \code{task.exec}.  This
    1445 block is a snipet of code (in the opihi language) which is run when
    1446 the task is executed.  The \code{task.exec} code may refer to
    1447 variables or other data structures defined by the opihi langage within
    1448 the pantasks environment.  Within a single \ippprog{pantasks}
    1449 instance, all opihi variables and data structures have global context
    1450 (\ie, all are visible to all tasks).  Variables are by default global,
    1451 but within the context of an opihi macro (equivalent of a function
    1452 call), variables may be locally-scoped.  Other data structures (see
    1453 below) are global and must be protected with name space choices.
    1454 
    1455 Within the \ippprog{task.exec} macro, at some point the command to be
    1456 run must be defined with the function 'command'.  Once the
    1457 \ippprog{task.exec} macro exits successfully, the command is the added
    1458 to the list of jobs to be run within the UNIX environment.  Jobs
    1459 may be run in one of two ways: locally or via the parallel processing
    1460 system.  The task, or the \ippprog{task.exec} macro, uses the 'host'
    1461 command to define how to run the job.  If the host is set to 'local',
    1462 then the job is run in the background by pantasks itself (using the
    1463 C \code{execvp} function).  Otherwise, the job is sent to the parallel
    1464 processing system to be run on another machine within the cluster.
    1465 If the host is set to the special value 'anyhost', then the parallel
    1466 processing system is allowed to choose the processing computer
    1467 arbitrarily.  Any other value is taken to be the DNS name of the
    1468 computer on which this job should run.  If the option \code{-required}
    1469 is supplied to the \code{host} command, then the parallel processing
    1470 system must ensure that the job only runs on the specifically named
    1471 system.  Otherwise, the parallel processing system may choose to
    1472 redirect the command to another computer (based on whatever rules are
    1473 defined for the parallel processing system).
    1474 
    1475 When the \ippprog{task.exec} macro is run, the code may choose (e.g., based
    1476 on tests of some global variables) to exit the macro with an error
    1477 condition, e.g., with the 'break' command.  In this circumstance, no
    1478 job is produced by the task.  The task will try again the next time it
    1479 is executed.  This feature allows for the user to set processing
    1480 blocks which depend on some external tests.  For example, some task
    1481 may check external network connectivity and set a
     1479executed.  A dynamic command is defined within a special block of the
     1480task, called \code{task.exec}.  This block is a snipet of code (in the
     1481opihi language) which is run each time the task is executed.  The
     1482\code{task.exec} code may refer to variables or other data structures
     1483defined by the opihi language within the pantasks environment.  Within
     1484a single \ippprog{pantasks} instance, all opihi variables and data
     1485structures have global context (\ie, all are visible to all tasks).
     1486Variables are by default global, but within the context of an opihi
     1487macro (equivalent of a function call), variables may be
     1488locally-scoped.  Other data structures (see below) are global and must
     1489be protected with name space choices.
     1490
     1491Within the \ippprog{task.exec} macro, the command to be run must be
     1492defined with the function 'command'.  Once the \ippprog{task.exec}
     1493macro exits successfully, the defined command is the added to the list of jobs
     1494to be run within the UNIX environment.  Jobs may be run in one of two
     1495ways: locally or via the parallel processing system.  The task, or the
     1496\ippprog{task.exec} macro, uses the 'host' command to define how to
     1497run the job.  If the host is set to 'local', then the job is run in
     1498the background by pantasks itself (using the C \code{execvp}
     1499function).  Otherwise, the job is sent to the parallel processing
     1500system to be run on another machine within the cluster.  If the host
     1501is set to the special value 'anyhost', then the parallel processing
     1502system is allowed to choose the processing computer arbitrarily.  Any
     1503other value is taken to be the DNS name of the computer on which this
     1504job should run.  If the option \code{-required} is supplied to the
     1505\code{host} command, then the parallel processing system must ensure
     1506that the job only runs on the specifically named computer.  Otherwise,
     1507the parallel processing system may choose to redirect the command to
     1508another computer (based on whatever rules are defined for the parallel
     1509processing system).
     1510
     1511When the \ippprog{task.exec} macro is run, the code may choose (e.g.,
     1512based on tests of some global variables) to exit the macro with an
     1513error condition, e.g., with the 'break' command.  In this
     1514circumstance, no job is produced by the task.  The task will be tried
     1515again the next time it is executed.  This feature allows for the user
     1516to set processing blocks which depend on some external tests.  For
     1517example, some task may check external network connectivity and set a
    14821518variable based on the network status; other tasks may then choose to
    14831519wait until the network is available before attempting to run.
     
    14861522behavior in detail.  Note that the options below may be dynamically
    14871523reset by the \ippprog{task.exec} macro.   
     1524
     1525\note{this section probably has too much detail; move this into an
     1526  online user guide?}
    14881527
    14891528The option 'npending' may be used to limit the number of jobs which
     
    15321571across many machines in the computing cluster.  The parallel
    15331572processing system used by \ippprog{pantasks} is an independent
    1534 software system (and alternatives are possible).  The default parallel
    1535 processing system is a program called \ippprog{pcontrol}.
     1573software system.  The default parallel processing system is a program
     1574called \ippprog{pcontrol}\footnote{Alternatives are possible: e.g.,
     1575  {\tt condor} has been experimentally integrated with
     1576  \ippprog{pantasks} for tests}.
    15361577
    15371578This program is based on the same \ippprog{opihi} shell language used
    15381579by \ippprog{pantasks}.  The two programs communicate via a shared set
    15391580of pipes: \ippprog{pantasks} sends commands to the standard input of
    1540 the \ippproc{pcontrol}, and accepts back responses on the standard
     1581the \ippprog{pcontrol}, and accepts back responses on the standard
    15411582output and standard error. 
    15421583
    1543 \ippprog{pcontrol} maintains a list of jobs and a list of hosts,
    1544 computers on which a job could be run.  Jobs may have one of several
    1545 states: pending (ready to run), running, jobs which are
    1546 running
     1584\ippprog{pcontrol} maintains a list of jobs (commands to be run) and a
     1585list of hosts (computers on which a job could be run).  Jobs may have
     1586one of several states: pending (ready to run), running (jobs which are
     1587running), exit (job has completed), busy (job is being checked by
     1588\ippprog{pcontrol}), crash (job has exited with a signal(?), normally
     1589segv).
     1590
     1591Similarly, the hosts may also have one of several states: off, down,
     1592busy, idle, etc.  A single host can accept a single job at a time.
     1593Multiple hosts instances corresponding to the same machine may be
     1594specified allowing a single computer to run more than one simultaneous
     1595job. 
     1596
     1597During operation, pcontrol accepts new jobs from pantasks and adds
     1598them to the list of jobs to execute.  It also accepts from pantasks
     1599the names of computers on which it is allowed to run those jobs.
     1600
     1601When pcontrol is provided with the name of a computer, it will attempt
     1602to make an connection to that machine via ssh (or rsh?).  When a
     1603connection is made, the remote shell is used to run a special
     1604interface program call \ippprog{pclient}.  This program accepts
     1605command lines from pcontrol and is responsible for executing the
     1606individual commands in the local shell environment.  A single ssh
     1607connection to a remote host keeps a single pclient shell running for a
     1608somewhat arbirarly long time, excuting many shell commands as needed.
     1609This architecture avoids wasting overhead making the ssh connection to
     1610the remote machine each time a command is executed, allowing for rapid
     1611excution of many commands.  As a result, a single job within the IPP
     1612architecture is allowed to be very light and short running if needed.
     1613
     1614After pcontrol sends a job (commands) to a specific pclient, it checks
     1615back occasionally to see if the command has been run and executed.  If
     1616it has finished, then pcontrol will query for the exit status, the
     1617standard output and standard error streams from the command.  (where
     1618do these go, back to pantasks?), with the results associated with the
     1619job statistics.  At that point, the pclient on the remote machine is
     1620ready to accept a new job from pcontrol.  If any jobs are pending in
     1621the list of jobs known to pcontrol, it will send those jobs to any
     1622machines which are idle.
     1623
     1624While pcontrol interacts with the many remote machines, it
     1625occasionally interacts with pantasks to report the results from the
     1626jobs it has been monitoring.  Pantasks occasionally requests a list of
     1627the completed jobs.  It then requests the status information for each
     1628completed job, including the standard error and standard output.  As
     1629pantasks receives this completion information, the jobs are removed
     1630from the list managed by pcontrol.  Thus pcontrol maintains at most a
     1631modest list of jobs which are 'in flight', leaving all interpretation
     1632work to pantasks.
     1633
     1634At the pantasks level, the tasks define how pantasks should use the
     1635exit status and output products from each job.  For example, the
     1636stderr and stdout may be specified to go to a file (with static name
     1637or name dependent on the specific job).  The task may define different
     1638behavior depending on the exit code from the job. 
    15471639
    15481640\note{discuss pclient}
     
    15541646
    15551647\end{verbatim}
    1556 
    1557 These commands may the be run by the pantasks program
    1558 directly, or they may be passed to another program which
    1559 
    1560 * task vs job
    15611648
    15621649\begin{figure}
     
    15721659end 
    15731660\end{verbatim}
    1574 
    1575  \caption{\label{fig:peaks} Illustration of peak finding and culling peaks within a
    1576     footprint.  Insignificant peaks within the footprint of a brighter
    1577     peak are ignored in further processing. }
     1661 \caption{\label{fig:simple.static.task} Example of a simple static
     1662   task in the opihi-based scripting language used by pantasks. }
    15781663  \end{center}
    15791664\end{figure}
    1580 
    1581 
    15821665
    15831666\note{this section needs to be re-written : pclient vs pcontrol vs pantasks}
     
    16601743\note{I'm not convinced this is the right place for it, but it felt like a natural extension of the ``advance''}.
    16611744
    1662 \note{wording..}
    1663 Beyond the warp stage, there is no longer a single ``next'' stage into
    1664 which data can be queued.  Because of this, more robust methods are
    1665 used to advance the data.  For processing data that is actively being
    1666 observed at the summit, this is handled by a set of ``nightly
    1667 science'' tasks and an associated \ippmisc{ippScript}.  The goal of
    1668 these tasks is to ensure that exposures are correctly paired into sets
    1669 of \ippstage{warp}-\ippstage{warp} difference images, and that nightly
     1745\note{wording..}  Beyond the warp stage, there is no longer a single
     1746``next'' stage into which data can be queued.  Because of this, more
     1747sophisticated methods are used to advance the data.  For processing
     1748data that is actively being observed at the summit, this is handled by
     1749a set of ``nightly science'' tasks and an associated
     1750\ippmisc{ippScript}.  The goal of these tasks is to ensure that
     1751exposures are correctly paired into sets of
     1752\ippstage{warp}-\ippstage{warp} difference images, and that nightly
    16701753stacks are generated for MD fields.
    16711754
     
    17421825\subsection{Nebulous}
    17431826\label{sec:nebulous}
    1744 Storing the large volume of data that is generated by the GPC1 camera
    1745 was recognized early in the Pan-STARRS project as a major concern.
    1746 The \ippprog{Nebulous} system was designed to organize this data.  The
    1747 main components of this system are a database storing the locations of
    1748 the files, with a Simple Object Access Protocol (SOAP) interface
    1749 between the database and the other IPP programs \note{define / mention
    1750   http}.  The actual files are stored on a collection of computers
    1751 with substantial disk partitions in the IPP cluster, shared within the
    1752 cluster via NFS.  This distribution of files is useful to balance the
    1753 disk I/O, as this parallelizes the load.
     1827
     1828A major concern recognized early in the Pan-STARRS project is the
     1829challenge of storing and managing the large volume of data that is
     1830generated by the GPC1 camera.  The \ippprog{Nebulous} system was
     1831designed to organize this data.  The main components of this system
     1832are a database storing the locations of the files, with a Simple
     1833Object Access Protocol (SOAP) interface between the database and the
     1834other IPP programs \note{define / mention http}.  The actual files are
     1835stored on a collection of computers with substantial disk partitions
     1836in the IPP cluster, shared within the cluster via NFS.  This
     1837distribution of files is useful to balance the disk I/O, as this
     1838parallelizes the load.
    17541839
    17551840The original design of \ippprog{Nebulous} was intended to aid in the
Note: See TracChangeset for help on using the changeset viewer.