This note documents the ch4 API scripting interface.

With PR 4836, ch4 netmod/shm API is declared in src/mpid/ch4/ch4_api.txt, and
they are generated by running maint/gen_ch4_api.py in autogen. Following files
will get generated:
    src/mpid/ch4/netmod/include/netmod.h
    src/mpid/ch4/netmod/include/netmod_impl.h
    src/mpid/ch4/netmod/ofi/func_table.c
    src/mpid/ch4/netmod/ofi/ofi_noinline.h.c
    src/mpid/ch4/netmod/ucx/func_table.c
    src/mpid/ch4/netmod/ucx/ofi_noinline.h.c
    src/mpid/ch4/netmod/stubnm/func_table.c
    src/mpid/ch4/netmod/stubnm/ofi_noinline.h.c
    src/mpid/ch4/shm/include/shm.h

The layout of ch4_api.txt is as following:

---- example of ch4_api.txt ----
Non Native API:
    mpi_init_hook: int
        NM: rank, size, appnum, tag_bits, init_comm
        SHM: rank, size, tag_bits
    ...

Native API:
    mpi_isend: int
        ...
    ...

PARAM:
    addr: MPIDI_av_entry_t *
    ...
---- end of ch4_api.txt

Section headings, i.e. "Non Native API", "Native API", and "PARAM", need start at the beginning of the line immediately followed by ':'. All other specifications require to be start with some spaces.

The api is specified with "name", followed by ':', followed by "return type". Flexible spaces are allowed.

Immediately follow the api name line should specify parameters for netmod api (NM) and shm api. Both may be present or either could be missing -- indicating a NM/SHM specific API.

'*' immediately after NM/SHM indicate whether the api function should be inlined. All inlined function require explicitly marked by the '*'.

The parameters are supplied with name only. There type is looked up from the "PARAM" section below. In the case of same parameter name ever being used with different type, use -# prefix, e.g. buf-2. The number suffix is needed for type look up, they will not be generated as part of parameter name.

