mpich icon indicating copy to clipboard operation
mpich copied to clipboard

mpi_t: Only expose variables from selected device

Open raffenet opened this issue 5 years ago • 5 comments

Currently, there is no way to exclude cvars from ch3 which building ch4 and vice-versa. A nice features for users would be to only expose the variables which are supported by the device selected at build-time.

raffenet avatar Aug 12 '19 20:08 raffenet

The CVAR description block can add an option called config; then the script, maint/extractcvars.in, can be made to accept a command-line option to only select those CVARs with matching config options. Those CVAR by default does not have the config attributes will be selected automatically.

We need to change the workflow to have extractcvar run as a configure command to make this work.

hzhou avatar Aug 12 '19 21:08 hzhou

@raffenet Do you have examples why it may be necessary or desirable to exclude CVARs from ch3 or ch4?

hzhou avatar Aug 12 '19 21:08 hzhou

This was requested by one of our downstream partners. I will follow up for some clarification. In the meantime, one example I can think of is the mpivars command. Running it will show users a large number of useless control variables.

raffenet avatar Aug 13 '19 14:08 raffenet

We already have a categorty for each cvar. If we just want to exclude ch3 cvars from ch4 or vice versa, we could simply exclude the CH3 category or CH4 category based on device config option. If we would like a more scalable option -- to exclude any symbols that are not in the active configured-in set -- a solution is to parse the mpichconf.h for all the configured macros; then have each CVAR annotated with a required configure macro. The most difficult/tedious part is to annotate all the feature-dependent CVARs.

hzhou avatar Aug 13 '19 14:08 hzhou

If we define macros in mpichconf.h such as MPIDI_DEVICE_CH3, MPIDI_DEVICE_CH4_OFI, etc. then we could macro-guard mpir_cvar.h and mpir_cvar.c, hopefully, achieve what is intended by this issue.

hzhou avatar Jul 16 '22 03:07 hzhou