Goddard-Fortran-Ecosystem / pFUnit

Parallel Fortran Unit Testing Framework
Other
171 stars 45 forks source link

Coarray support status inquiry #291

Open SMijin opened 3 years ago

SMijin commented 3 years ago

Hi, my apologies if this is not the place to ask this, but I didn't want to start emailing people directly. I'm preparing to start development on a project that's likely to use coarrays, and am trying to figure out the current extent of CAF unit testing. After a cursory search online I found the CAF_TestCase conference proceedings paper, but no source code or anything. Is that available somewhere, and if not, are there any issues with using coarray sintax with pFUnit in the single image/serial case?

tclune commented 3 years ago

This is the right place to ask. The main authors of that paper did have some prototype code that was never properly integrated. Mainly this was because they had based it on pFUnit 3, and I'd moved to pFUnit 4 by the time the attempt had been made. (A major rewrite.)

But I've also been waiting for robust support for CAF teams. Without teams, pFUnit is limited to running a given test on all images, which can be a rather severe limitation. With teams, it should be very straightforward to create a CAF subclass of ParameterizedTestCase and provide nice CAF support int the framework. I don't use CAF much myself, but would be very happy to work with someone that has access to robust CAF teams support.

As things stand, one can still test CAF code if the mechanism uses MPI under the hood. On then just implements the test as if it were an MPI unit test except that within the test itself you can use CAF mechanism. And you must specify "*" as the number of processes for the test otherwise any CAF synchronizations will hang.

SMijin commented 3 years ago

Thanks for the detailed reply! Good to know that the MPI support in pFUnit extends to CAF at least partially. I guess an option for testing with less than the absolute max number of images is to change the coarray image number environment variable at runtime and run the tests individually, but that's a bit hacky and inconvenient. My use case will primarily be on Intel systems, so the under-the-hood MPI helps there.

As for teams, I think Intel (and maybe Cray, which uses a different CAF implementation) have some teams support, but haven't checked in detail how robust they are. I do know gfortran lags with F2018 features.

tclune commented 3 years ago

Yes - I've not looked in a while myself, but I suspect that Intel support is good enough for this purpose. And now that we have Intel in our CI suite, that may be sufficient to robustly support it.

I don't use CAF in my day-to-day work which is why I'd much prefer helping someone else implement the CAF extension. I could easily provide a skeleton that highlights where some thought is needed about how to manage the teams. Presumably the existing tests for the MpiTestCase could be more-or-less directly translated to cover this new extension, though I'd also one something that exercises CAF in some nontrivial way (e.g., allocate a CAF object.

SMijin commented 3 years ago

I guess the main hurdle there is getting someone with good enough CAF knowledge who can also convince their superiors that it is useful allocating time to implement robust unit testing on something that relatively few people use. My own experience with CAF is still very limited, so I wouldn't be comfortable playing around with pFUnit development just yet.

Given that there is at least some support for CAF, albeit in MPI form, I'll definitely be using pFUnit with CAF in the project I'm planning. I might ask you for that skeleton if there's no official support further down the line, i.e. by the time I'm both comfortable enough with CAF and the project justifies spending time perfecting the unit tests. I'm afraid I can't promise anything, though.

Good luck with the development and thanks for the clarification!