<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hi everyone,</p>
<p>Sorry if you get this multiple times (I am sending to several
email lists with significant overlap).<br>
</p>
<p>I have an annoying problem. For the PMT testing, I want to run
through a given set of tests for each PMT in one sitting (DAQ and
analysis program running continuously), which <br>
means starting the ADC DAQ on the computer end once and (currently
- ideally) letting it collect upwards of about 1000 5 second long
runs at a time for each PMT. The program<br>
runs fine for about 180 5 second sets and then core dumps with
"Too many open files (src/epoll.cpp:38)".</p>
<p>If you have encountered this problem and figured out how to solve
it (beyond the band aid suggestions given in online posts), can
you please let me know.</p>
<p>Thanks,</p>
<p>Michael <br>
</p>
<p><br>
</p>
<p>Some more details ...</p>
<p><br>
</p>
<p>I am writing both root files and binary files, for the raw data.
The code uses a separate thread to write the root trees, while it
keeps getting data from the ADC board continuously. <br>
</p>
<p>The thread that writes the root trees and stores them to file is
started only once and within it, ROOT files are opened and closed
in the same loop. The main process writes<br>
the raw data file and handles the communication with the ADC
board. The raw data files are written in a function that both
opens and closes each file that is being written.<br>
</p>
<p>There are two zmq sockets for communication with the ADC (control
and data) and each is opened and closed for each 5 second data
chunk that is being received from the ADC<br>
(each single run).</p>
<p>I scoured forums and various information sources, but most of
posts I find suggest that once needs to increase the nofile
parameter in <code data-highlighted="yes" class="hljs language-c">/proc/sys/fs/file-max
</code>or similar. <br>
I have done that, but it doesn't really change anything. It just
allows me to take more runs, but doesn't solve the problem. <br>
</p>
<p>In principle, I should be able to run this indefinitely (aside
from storage space issues).</p>
<p>Of course I could just stop the process and restart periodically
(collecting fewer runs at a time), but I want to move through a
series of PMT voltages in one run series, with<br>
as little time as possible between changing the HV. <br>
</p>
<p>I have encountered this crash every time I start the program and
run for extended periods of time (1 hour or more) and it is
driving me crazy, because I think the program is written<br>
such that there should not be "many" open files at a time (I think
maybe at most 5 at any given time).<br>
</p>
<p>The only way around this at the moment is to use a script that
restarts the ADC software end after some number of runs before
this crash occurs. That's okay, but doesn't resolve <br>
the basic problem.</p>
<p>Somehow I feel like there is either a bug in ZMQ or I am doing
something wrong (likely the latter, but some posts I found seem to
suggest the possibility of the former).</p>
<p>I don't want to throw a bunch of code at you. For now, I am just
wondering if any here has encountered a similar issue and could
guess what the problem is.</p>
<p>If anyone wants to take a look (if you have time), the code is
located here:</p>
<p><a class="moz-txt-link-freetext" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_mtgericke_MOLLER-2DIntElec-2DPMTGain-2DMeas&d=DwMDaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=g36uVog86YHKCxVC_CegSTngbdk9VILa3630Ig6h-Wk&m=Hied8sImJ2lOlg8aB9zs239BFvEIwWTVQXYSaAphHFFQEfD2vXgkLBdfPOx4LULm&s=ZDHSAPX3k2GkiE8UwbIit_aS4aNCAMi5w3gwufEDEzM&e=">https://github.com/mtgericke/MOLLER-IntElec-PMTGain-Meas</a></p>
<p>The relevant file is CMData.cxx <br>
</p>
<p>The relevant functions are:</p>
<p>void CMData::StartDataCollection() - file lines 712-733 ,
758-781, </p>
<p>void *CMData::GetServerData(void *vargp) - file line 826</p>
<p>void* CMData::FillRootTreeThread(void *vargp) - file lines 1070,
1293</p>
<p>void* CMData::GetSocket(SockType type) - file line 458</p>
<p><br>
</p>
<br>
<p><img src="cid:part1.lID0TqYH.LVU3AGnA@umanitoba.ca" alt="" width="1173" height="733"></p>
<pre class="moz-signature" cols="72">
</pre>
</body>
</html>