Closed MatthewHambley closed 5 months ago
My apologies for my slow response on this issue. I have replicated the issue and am looking into it. The test should have been detected as requiring MPI, but somehow that is being lost by the time the boiler plate is being generated.
Documentation? Guilty. The documentation from pfunit-3 is horribly outdated and realistically I'm never going to get around to writing good documentation for the current pfunit. Just juggling too many different bits of software these days. I do try to maintain a decent set of useful examples in the parallel repository pFUnit_demos. There I have an mpi demo and a parameterized demo, but not anything at the intersection. A 1st step would be to build your reproducer (once working) into such an example there.
OK - I see now. When you define your own pFUnit TestCase extension, you need to indicate to the preprocessor that you've done that. Otherwise it just assumes a simple test case. The preprocessor is not smart enough to see your declaration class(example_test_type)
and infer that it extended the MpiTestCase vs anything else.
A few other issues:
private
is generally not a good thing to put in the test suite. It interferes with accessibility. If you use it be sure to declare all the actual tests to be public.@test
anntation.I have attached a suitably updated version with a few comments about what changes. This compiles for me. my_mtc.tar.gz
hmm. Circling back, and realized that maybe the constructor=...
is not needed in your simple example. It now compiles without that bit after making the other changes.
I suspect you'll run into more issues as you make this more fully featured. Should be quiet this week (AGU fall meeting takes away many of the scientists in the org), so hope for a faster turnaround in communication.
I have made some progress so the specific issues noted here are resolved. I will raise other issues for further related problems.
I'm looking to migrate an existing suite of unit tests implemented using pFUnit v3 to v4.
Our
MpiTestCase
tests are failing to compile with the errorError: Derived type ‘mpitestparameter’ at (1) is being used before it is defined
. This is being thrown from the generated portion of the source code. Sure enough the wrapper is importingFunit
which doesn't have the parallel support ofpFUnit
.Since this seems to be hardwired in the processor there doesn't seem a way this could ever work.
Minimal test case attached. mtc.tar.gz
This highlights a second issue which is that I couldn't find any good user documentation which explains how to use the framework. There are a few bits and pieces here and there but nothing comprehensive. I ended up having to scrutinise the framework source code.
The examples also look to be the same as the ones which were somewhat out of date for v3. Do these give a good starting point for the neophyte user?