Hi Tony. I have some comments about the new code.
1) Your version of LCIOWriter works fine. The only problem is that we need new constructors in
LCIODriver to pass the ignore list to LCIOWriter.
I have always had these constructors in my version of LCIODriver but for some reason
I forgot to put my LCIODriver in contrib.timb. With your version of LCIOWriter the new LCIODriver constructors are
public LCIODriver(String file, Collection<String> listIgnore)
{
try
{
writer = new LCIOWriter(file, listIgnore);
}
catch (IOException x)
{
throw new RuntimeException("Error opening LCIO file",x);
}
}
public LCIODriver(File file, Collection<String> listIgnore)
{
try
{
writer = new LCIOWriter(file, listIgnore);
}
catch (IOException x)
{
throw new RuntimeException("Error opening LCIO file",x);
}
}
2) LCSimLoop has one very minor problem and one major problem. The minor problem is that
the skip method in LCSimLoop should be skip(long nskip) in order to be consistent with the
long argument of SequentialRecordLoopImpl.loop(long n) .
Then the loop variable in skip should also be long. In addition,
with this change you need to cast the nskip variable to int for the rss.goToRecord call.
The major problem is that LCSimLoop is unacceptably inefficient when you have to skip large numbers of
records. It is necessary to skip large numbers of records, for example, when you want to use the first half of files
for training a neural net and the second half for doing analysis with the trained neural net.
With my version of LCSimLoop it takes 130 seconds of "don" cputime to skip 120000 ZHH events; with your version
a medium queue job on "don" hit its time limit of 1000 seconds before it had finished skipping the same 120000 ZHH events.
-- Tim
On Thu, 17 Aug 2006, Johnson, Tony S. wrote:
> Hi Tim, I put two fixes into the org.lcsim IO classes based on your code in contrib.timb.
>
> 1) Added ability for LCIOWriter to have a list of collections not to write out. The code is slightly changed from your code, but should be completely compatible.
>
> 2) Added a skip(int n) method to LCSimLoop. This provides the same functionality as your change, but is done via an extra method instead of adding an argument to the constructor. This is currently not implemented very efficiently, but is done in such a way that we can improve efficiency later without changing any user code making use of this method.
>
> Tony
>
|