<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 15:57:26 JST 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>PFS-JIRA</title>
    <link>https://pfspipe.ipmu.jp/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.3.4</version>
        <build-number>803005</build-number>
        <build-date>13-09-2019</build-date>
    </build-info>


<item>
            <title>[PIPE2D-761] Restructure reduceExposure to process visit one-by-one</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/PIPE2D-761</link>
                <project id="10002" key="PIPE2D">DRP 2-D Pipeline</project>
                    <description>&lt;p&gt;reduceExposure currently appears to process all the data requested before writing any of it out, processing all the e.g. b data before starting on r.&lt;/p&gt;

&lt;p&gt;This blows up its memory footprint and frustrates anyone waiting for a given visit to finish. &#160;&lt;/p&gt;

&lt;p&gt;Please restructure things to process all the arms for a given visit, write out the results, and clean up memory before proceeding to the next visit.&lt;/p&gt;</description>
                <environment></environment>
        <key id="15431">PIPE2D-761</key>
            <summary>Restructure reduceExposure to process visit one-by-one</summary>
                <type id="10001" iconUrl="https://pfspipe.ipmu.jp/jira/secure/viewavatar?size=xsmall&amp;avatarId=10515&amp;avatarType=issuetype">Story</type>
                                            <priority id="10000" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/priorities/medium.svg">Normal</priority>
                        <status id="10002" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/statuses/generic.png" description="The issue is resolved, reviewed, and merged">Done</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="price">price</assignee>
                                    <reporter username="rhl">rhl</reporter>
                        <labels>
                    </labels>
                <created>Sat, 6 Mar 2021 20:33:02 +0000</created>
                <updated>Thu, 11 Mar 2021 21:07:13 +0000</updated>
                            <resolved>Thu, 11 Mar 2021 21:07:13 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                <comments>
                            <comment id="18756" author="price" created="Sat, 6 Mar 2021 21:35:33 +0000"  >&lt;p&gt;&lt;tt&gt;reduceExposure&lt;/tt&gt; acts like &lt;tt&gt;processCcd&lt;/tt&gt;: it most certainly writes out the results as you go along. As for the memory footprint, I&apos;m not sure, but I don&apos;t think there&apos;s any reason why it should be different than &lt;tt&gt;processCcd&lt;/tt&gt;.&lt;/p&gt;</comment>
                            <comment id="18761" author="rhl" created="Sun, 7 Mar 2021 16:18:23 +0000"  >&lt;p&gt;I don&apos;t think so. &#160;It processes all the data to form &lt;tt&gt;exposureList&lt;/tt&gt; before starting any extractions, then loops over all the exposures, and then finally calls &lt;tt&gt;self.write&lt;/tt&gt;. &#160;Please check.&lt;/p&gt;</comment>
                            <comment id="18773" author="price" created="Mon, 8 Mar 2021 15:52:09 +0000"  >&lt;p&gt;I&apos;m sorry, you&apos;re right that it works through an &lt;tt&gt;exposureList&lt;/tt&gt;. However, I believe that &lt;tt&gt;exposureList&lt;/tt&gt; consists only of exposures from the same visit (i.e., all arms from all spectrographs), so we truly do &lt;a href=&quot;https://github.com/Subaru-PFS/drp_stella/blob/master/python/pfs/drp/stella/reduceExposure.py#L69-L77&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;parallelise over visits&lt;/a&gt;. The reason for this is that we want to derive a single 2D sky subtraction solution from all exposures in the same visit, and that has to happen before we extract the spectra.&lt;/p&gt;

&lt;p&gt;I propose that we should create a new &lt;tt&gt;CmdLineTask&lt;/tt&gt; to perform a single-arm spectra extraction, which will allow faster processing of SuNSS data.&lt;/p&gt;</comment>
                            <comment id="18816" author="rhl" created="Wed, 10 Mar 2021 22:35:19 +0000"  >&lt;p&gt;I thought I&apos;d commented on this already...&lt;/p&gt;

&lt;p&gt;I think we want to pass in a list of visits and do the right thing (process all 12 arms for each visit before proceeding to the next visit), and each visit is independent (and may have its own pfsConfig).&lt;/p&gt;

&lt;p&gt;I don&apos;t think we need a new command; &#160;if I process a single spectrograph and two bands it&apos;ll process all of that visit before moving on.&lt;/p&gt;</comment>
                            <comment id="18817" author="price" created="Wed, 10 Mar 2021 22:39:50 +0000"  >&lt;p&gt;When you say, &quot;we want to pass in a list of visits&quot;, are you referring to using the &lt;tt&gt;ReduceExposureTask&lt;/tt&gt; directly in python, and therefore working around the &lt;tt&gt;ReduceExposureRunner&lt;/tt&gt; that ensures we operate on a visit at a time?&lt;/p&gt;</comment>
                            <comment id="18825" author="rhl" created="Thu, 11 Mar 2021 02:40:32 +0000"  >&lt;p&gt;I&apos;m talking about the command line. &#160;If I run&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
 reduceExposure.py /projects/HSC/PFS/Subaru --id visit=50000..500100 arm=b^r&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;logging suggests that it runs ISR (etc.) and extracts spectra and writes pfsArm files from all the &lt;tt&gt;b&lt;/tt&gt; visits in turn before starting on the &lt;tt&gt;r&lt;/tt&gt; ones.  We only have one spectrograph, but from what you say it&apos;d have handled all 4 spectrographs in &lt;tt&gt;b&lt;/tt&gt; before doing the extraction.  I&apos;d like to process all the &lt;tt&gt;b&lt;/tt&gt; &lt;em&gt;and&lt;/em&gt; all the &lt;tt&gt;r&lt;/tt&gt; before moving on to the next visit, but as I can achieve this (more or less) by running two jobs, one for b and one for r, this isn&apos;t all that urgent.  If we add an option (or a new command) to also run the merge step this will become important again.&lt;/p&gt;

&lt;p&gt;I am still worried about when it releases the memory, as it seemed to crash on very long visit lists, but that&apos;s a different issue.  Maybe this was just a problem on the mountain on small memory machines (I just processed 632 b^r visits on tiger without problems).&lt;/p&gt;</comment>
                            <comment id="18835" author="price" created="Thu, 11 Mar 2021 16:29:07 +0000"  >&lt;p&gt;So the &lt;tt&gt;ReduceExposureTask&lt;/tt&gt; is fine and doesn&apos;t need to be restructured (it operates on all arms of the same kind in an exposure, and that&apos;s the way it needs to operate for sky subtraction), but the request is to change the order of the inputs that it receives, which is set by the &lt;tt&gt;ReduceExposureRunner&lt;/tt&gt;. I&apos;ve made a small change which reorders the inputs so that it iterates over visits more quickly than arms.&lt;/p&gt;

&lt;p&gt;Note that I&apos;m not sure how python&apos;s &lt;tt&gt;multiprocessing&lt;/tt&gt; (used when we specify a &lt;tt&gt;-j&lt;/tt&gt; flag) will change the ordering we provide, but hopefully it will do something approaching FIFO.&lt;/p&gt;</comment>
                            <comment id="18839" author="hassan" created="Thu, 11 Mar 2021 21:03:02 +0000"  >&lt;p&gt;Approved with no additional changes requested.&lt;/p&gt;</comment>
                            <comment id="18841" author="price" created="Thu, 11 Mar 2021 21:07:13 +0000"  >&lt;p&gt;Merged to master.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_10500" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|zzs47y:zzzzw</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10100" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                        <customfieldname>Reviewers</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>hassan</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10005" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="102">2DDRP-2021 A3</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    </customfields>
    </item>
</channel>
</rss>