Difference between revisions of "Function Name Prefix Convention"

From Mpich
Jump to: navigation, search
(Prefix Diagram)
(Interface Layering)
 
(20 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
* '''MPIU_''' functions are implemented by the MPI level in <tt>src/util/</tt> to be used by the MPI level and below
 
* '''MPIU_''' functions are implemented by the MPI level in <tt>src/util/</tt> to be used by the MPI level and below
 
* '''MPIR_''' MPI functionality to be used by the MPI level and below (<span style="color:#ff0000">technically a synonym for MPIU_?</span>)
 
* '''MPIR_''' MPI functionality to be used by the MPI level and below (<span style="color:#ff0000">technically a synonym for MPIU_?</span>)
* '''MPIRI_''' functions implemented in the MPI layer for use within it (<span style="color:#ff0000">does not exist today</span>)
+
* '''MPIC_''' MPI Collective helper functions to be used by the MPI level only
* '''MPIC_''' MPI Collective helper functions to be used by the MPI level only (<span style="color:#ff0000">special case of MPIRI_?</span>)
 
 
* '''MPID_''' functions are implemented by the device to be used by the MPI level in <tt>src/mpid/''<device>''</tt>
 
* '''MPID_''' functions are implemented by the device to be used by the MPI level in <tt>src/mpid/''<device>''</tt>
 
* '''MPIDU_''' device independent functionality (''only?'') in <tt>src/mpid/common</tt> or <tt>src/mpid/include</tt> to be ''optionally'' used by the device level and below, but not above.
 
* '''MPIDU_''' device independent functionality (''only?'') in <tt>src/mpid/common</tt> or <tt>src/mpid/include</tt> to be ''optionally'' used by the device level and below, but not above.
Line 30: Line 29:
  
 
== MPICH 3.3 Greenfield Refactor ==
 
== MPICH 3.3 Greenfield Refactor ==
=== Interface Layering Proposal ===
+
NOTE: Prefixes involving CH4 will use lowercase after the prefix. (e.g. MPIDI_CH4R_send)
 +
=== Interface Layering ===
 
*'''MPI layer:'''
 
*'''MPI layer:'''
 
** Up interface: MPI, MPIX
 
** Up interface: MPI, MPIX
Line 38: Line 38:
 
*'''Device layer:'''
 
*'''Device layer:'''
 
** Up interface: MPID
 
** Up interface: MPID
** Down interface: MPIDI_CH4R
+
** Down interface: MPIDIR
** Horizontal interface: MPIDI_CH4I
+
** Horizontal interface: MPIDI
** Fallback functionality: MPIDU
+
** Generic functionality: MPIDIG
 +
*'''Device independent (generic) functionality'''
 +
** Up interface: N/A
 +
** Down interface: N/A
 +
** Horizontal interface: MPIDGI
 +
** Generic functionality: MPIDG
  
 
*'''Netmod layer:'''
 
*'''Netmod layer:'''
** Up interface: MPIDI_CH4_NM
+
** Up interface: MPIDI_NM
** Horizontal interface: MPIDI_CH4_NM_OFI_, MPIDI_CH4_NM_UCX_
+
** Horizontal interface: MPIDI_OFI, MPIDI_UCX, ...
** Fallback functionality: MPIDI_CH4_NMU
+
** Generic functionality: MPIDI_NMG
  
 
*'''Shmmod layer:'''
 
*'''Shmmod layer:'''
** Up interface: MPIDI_CH4_SHM
+
** Up interface: MPIDI_SHM
** Horizontal interface: MPIDI_CH4_SHM_CMA_, ...
+
** Horizontal interface: MPIDI_CMA, MPIDI_POSIX, ...
** Fallback functionality: MPIDI_CH4_SHMU
+
** Generic functionality: MPIDI_SHMG
 +
 
 +
[[File:MPICH-CH4-Interfaces.png]]
  
 
=== Changes to be made to existing code ===
 
=== Changes to be made to existing code ===
  
* Move all independent utilities in <tt>src/util</tt> to MPL
+
* Move independent utilities in <tt>src/util</tt> to MPL
** MPL_Malloc, MPL_Free
+
** <strike>Locking primitives</strike>
** thread safety routines
+
** <strike><tt>MPL_Malloc, MPL_Free</tt></strike>
** MPIU timer code
+
** <strike>Timers</strike>
** and many more...
+
** and others...
* Export all src/mpid/common code as MPIDU
+
* <strike>Integrate MPL into ROMIO</strike>
** Devices can <tt>#define MPID_<foo> MPIDU_<foo></tt> when the common code impl is good enough
+
* Export device fallback code as MPIDU
** e.g. Segment routines
+
** <strike><tt>src/mpid/common/sched</tt></strike>
* Add MPID collective interfaces
+
** <tt>src/mpid/common/datatype</tt>
** Default collective algoritms exposed as MPIDU?
+
** default collective algorithms
 +
** and others...
  
 
[[Category:Design_Documents]]
 
[[Category:Design_Documents]]

Latest revision as of 21:06, 4 May 2016

This page describes the convention for function names in MPICH. The prefixes to function names indicate at which level the function is implemented, and by which level it is intended to be used.

I believe that this is how the prefixes were intended to be used:

An interface (e.g., MPI, ADI3, channel) is identified by a prefix (e.g., MPI, MPID, MPIDI_CH3). For a particular interface with prefix XXX, functions with the XXX_ prefix and XXXU_ prefix are part of the API, with the XXX_ functions being implemented by the lower layer and called by the upper layer, and the XXXU_ functions being implemented by the upper layer to be called by the lower layer (U may stand for "upcall"). Functions with the XXXI_ prefix are not part of the API and are implemented by the lower layer to be used internally by the lower layer, and so should not be called directly by the upper layer. E.g. For the ADI3 interface, MPID_ functions are implemented by CH3 and are called by the MPI layer. MPIDU_ functions are implemented by the MPI layer and are called by CH3. CH3 has internal functions which have the MPIDI_ prefix. Note that channels are part of the CH3 implementation, and so all channel functions should have MPIDI_ prefixes (specifically MPIDI_CH3_, MPIDI_CH3I_, etc.).

Repeating for emphasis: XXXU_ functions being implemented by the upper layer to be called by the lower layer (U may stand for "upcall")

A little more specifically:

  • MPI_ functions are implemented by the MPI level to be used by the application
  • MPIU_ functions are implemented by the MPI level in src/util/ to be used by the MPI level and below
  • MPIR_ MPI functionality to be used by the MPI level and below (technically a synonym for MPIU_?)
  • MPIC_ MPI Collective helper functions to be used by the MPI level only
  • MPID_ functions are implemented by the device to be used by the MPI level in src/mpid/<device>
  • MPIDU_ device independent functionality (only?) in src/mpid/common or src/mpid/include to be optionally used by the device level and below, but not above.
  • MPIDI_ functions are implemented at the device level (in src/mpid/<device>) to be used in the specific device implementing it and below, (not above).
  • MPL_ MPICH Portability Library - can be used anywhere inside MPICH
  • OPA_ Open Portable Atomics - can be used anywhere inside MPICH
  • In the CH3 device:
    • MPIDI_CH3_ functions are implemented by the channel in src/mpid/ch3/<channel> used by CH3
    • MPIDI_CH3U_ functions are implemented by the CH3 used by the channel (and probably CH3?) but not above
    • MPIDI_CH3I_ functions are implemented by the channel used by the channel but not above.
  • In the CH4 device:
    • MPIDI_CH4 functions implemented by CH4 to be used at the device level
    • MPIDI_CH4U_ optional transport independent functionality (e.g. MPICH active message fallback)
    • MPIDI_CH4I_ functions implemented by CH4 to be used by CH4 but not above


MPICH 3.3 Greenfield Refactor

NOTE: Prefixes involving CH4 will use lowercase after the prefix. (e.g. MPIDI_CH4R_send)

Interface Layering

  • MPI layer:
    • Up interface: MPI, MPIX
    • Down interface: MPIR
    • Horizontal interface: MPII
  • Device layer:
    • Up interface: MPID
    • Down interface: MPIDIR
    • Horizontal interface: MPIDI
    • Generic functionality: MPIDIG
  • Device independent (generic) functionality
    • Up interface: N/A
    • Down interface: N/A
    • Horizontal interface: MPIDGI
    • Generic functionality: MPIDG
  • Netmod layer:
    • Up interface: MPIDI_NM
    • Horizontal interface: MPIDI_OFI, MPIDI_UCX, ...
    • Generic functionality: MPIDI_NMG
  • Shmmod layer:
    • Up interface: MPIDI_SHM
    • Horizontal interface: MPIDI_CMA, MPIDI_POSIX, ...
    • Generic functionality: MPIDI_SHMG

MPICH-CH4-Interfaces.png

Changes to be made to existing code

  • Move independent utilities in src/util to MPL
    • Locking primitives
    • MPL_Malloc, MPL_Free
    • Timers
    • and others...
  • Integrate MPL into ROMIO
  • Export device fallback code as MPIDU
    • src/mpid/common/sched
    • src/mpid/common/datatype
    • default collective algorithms
    • and others...