mpich
mpich copied to clipboard
mpi_t: Only expose variables from selected device
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.
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.
@raffenet Do you have examples why it may be necessary or desirable to exclude CVARs from ch3 or ch4?
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.
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.
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.