Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unit number specification for usage and version output #61

Closed
zbeekman opened this issue Apr 8, 2016 · 1 comment
Closed

unit number specification for usage and version output #61

zbeekman opened this issue Apr 8, 2016 · 1 comment

Comments

@zbeekman
Copy link
Contributor

zbeekman commented Apr 8, 2016

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.

@zbeekman
Copy link
Contributor Author

zbeekman commented Apr 8, 2016

I will have PR soon for this...

@szaghi szaghi closed this as completed in #62 Apr 8, 2016
szaghi added a commit that referenced this issue Apr 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant