Hi Stefano,
I would like to use FLAP with an MPI code, and it would be great (and great in general) for the user to be able to alter the behavior of the --help and --version switches. At first, I was thinking it would be wonderful to be able to override the default behavior of the two methods that get called when passing the switch. However, I think an even more useful feature would be to allow some extra arguments to the init method to specify optional file handles to be used for outputing --help and --version. Specifically I think --help should go out on error_unit and --version on output_unit. But letting the user override this would be very helpful.
In my case, with MPI I would have something like this:
if (rank == 0) then
help_unit = error_unit
version_unit = output_unit
else
help_unit = null_unit ! open /dev/null somewhere above...
version_unit = null_unit
end if
call cli%init( ... help_unit=help_unit, version_unit=version_unit, ... )
This way all MPI ranks can read the command line arguments passed in, but if the user wants a help or version print out, they won't get n_ranks copies of the requested output.
Hi Stefano, I would like to use FLAP with an MPI code, and it would be great (and great in general) for the user to be able to alter the behavior of the
--help
and--version
switches. At first, I was thinking it would be wonderful to be able to override the default behavior of the two methods that get called when passing the switch. However, I think an even more useful feature would be to allow some extra arguments to theinit
method to specify optional file handles to be used for outputing--help
and--version
. Specifically I think--help
should go out onerror_unit
and--version
onoutput_unit
. But letting the user override this would be very helpful.In my case, with MPI I would have something like this:
This way all MPI ranks can read the command line arguments passed in, but if the user wants a help or version print out, they won't get
n_ranks
copies of the requested output.