This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC, Fortran] Avoid race on testsuite temporary files


> On Dec 9, 2015, at 5:27 PM, Yvan Roux <yvan.roux@linaro.org> wrote:
> 
> Hi,
> 
> as it was raised in
> https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01540.html we experiment
> random failures in gfortran validation when it is run in parallel (-j
> 8).  The issues occurs because of concurrent access to the same file,
> the first two patches fixed some of them by changing the file names
> used, but there are still remaining conflicts (6 usages of foo, 8 of
> test.dat). This is easy to fix and I've a patch for that, but there is
> another issue and I'd like to have your thoughts on it.
> 
> There is a little bit more than 1000 testcases which use IO without
> explicit file names, ~150 use scratches (a temporary file named
> gfortrantmp + 6 extra char is created) and the others, which only
> specify the io unit number, use a file named fort.NN with NN the
> number of the io unit. We see conflicts on these generated files, as
> lot of testcases use the same number, the most used are:
> 
> 10 => 150
> 99 => 70
> 6  => 31
> 11 => 27
> 1  => 23
> 
> I started to change the testcases to use scratches when it is possible
> and before finding that there is that many to fix, and I also had
> conflicts on the generated scratch names.  The options I see to fix
> that are:
> 
> 1- Move all these testcases into an IO subdir and change the testsuite
> to avoid parallelism in that directory.
> 2- Use scratches when possible and improve libgfortran file name
> generation, I don't know well fortran but is it possible to change the
> file name patterns for scratches and io unit files ?
> 3- Change the io unit numbers used, as it was suggested on irc, but I
> find it a bit painful to maintain.
> 
> Any comments are welcome.

I have also investigated several races on I/O in the gfortran testsuite, and my preference is to go with [1].  Specifically, if a fortran test does I/O with filenames that can clash with some other test, then the test should be located in a sub-directory of gfortran.dg testsuite that runs its test in-order.

--
Maxim Kuvyrkov
www.linaro.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]