@@ -19,20 +19,19 @@ class Type(ABC):
1919 PARAMS_STANDARD_ABI = {}
2020
2121 def __init__ (self , type_name , name = None ,
22- mangle_name = lambda name : abi_internal_name (name ),
22+ mangle_name = lambda name : util . abi_internal_name (name ),
2323 count_param = None , ** kwargs ):
2424 self .type = type_name
2525 self .name = name
2626 self .count_param = count_param
27- self .mangle_name = util . abi_internal_name
27+ self .mangle_name = mangle_name
2828
2929 @staticmethod
3030 def construct (abi_type , type_name , ** kwargs ):
3131 """Construct the parameter for the given ABI and type."""
3232 if abi_type == 'ompi' :
3333 return Type .PARAMS_OMPI_ABI [type_name ](type_name , ** kwargs )
3434 elif abi_type == 'standard' :
35- # print("Checkint oug type " + str(type_name))
3635 return Type .PARAMS_STANDARD_ABI [type_name ](type_name , ** kwargs )
3736 else :
3837 raise RuntimeError (f'invalid ABI type { abi_type } ' )
@@ -82,6 +81,7 @@ def tmp_type_text(self, enable_count=False):
8281 return self .type_text (enable_count = enable_count )
8382
8483 def parameter (self , enable_count = False , ** kwargs ):
84+ """Peturn the text to be used for this parameter in the prototype declaration."""
8585 return f'{ self .type_text (enable_count = enable_count )} { self .name } '
8686
8787 @property
@@ -1688,3 +1688,174 @@ def return_code(self, name):
16881688 return [f'return { ConvertOMPIToStandard .SESSION } ({ name } );' ]
16891689
16901690
1691+ @Type .add_type ('T_ENUM' , abi_type = ['ompi' ])
1692+ class TypeTEnum (Type ):
1693+
1694+ def type_text (self , enable_count = False ):
1695+ return 'MPI_T_enum'
1696+
1697+ @Type .add_type ('T_ENUM_OUT' , abi_type = ['ompi' ])
1698+ class TypeTEnumOut (Type ):
1699+
1700+ def type_text (self , enable_count = False ):
1701+ return 'MPI_T_enum *'
1702+
1703+ @Type .add_type ('CVAR_HANDLE' , abi_type = ['ompi' ])
1704+ class TypeCvarHandle (Type ):
1705+
1706+ def type_text (self , enable_count = False ):
1707+ return 'MPI_T_cvar_handle'
1708+
1709+ @Type .add_type ('CVAR_HANDLE_OUT' , abi_type = ['ompi' ])
1710+ class TypeCvarHandle (Type ):
1711+
1712+ def type_text (self , enable_count = False ):
1713+ return 'MPI_T_cvar_handle *'
1714+
1715+ @Type .add_type ('CVAR_HANDLE_INOUT' , abi_type = ['ompi' ])
1716+ class TypeCvarHandleInOut (Type ):
1717+
1718+ def type_text (self , enable_count = False ):
1719+ return 'MPI_T_cvar_handle *'
1720+
1721+ @Type .add_type ('BIND' , abi_type = ['ompi' ])
1722+ class TypeBind (Type ):
1723+
1724+ def type_text (self , enable_count = False ):
1725+ return 'int'
1726+
1727+ @Type .add_type ('BIND_OUT' , abi_type = ['ompi' ])
1728+ class TypeBindOut (Type ):
1729+
1730+ def type_text (self , enable_count = False ):
1731+ return 'int *'
1732+
1733+ @Type .add_type ('EVENT_REGISTRATION' , abi_type = ['ompi' ])
1734+ class TypeEventRegistration (Type ):
1735+
1736+ def type_text (self , enable_count = False ):
1737+ return 'MPI_T_event_registration'
1738+
1739+ @Type .add_type ('EVENT_REGISTRATION_OUT' , abi_type = ['ompi' ])
1740+ class TypeEventRegistrationOut (Type ):
1741+
1742+ def type_text (self , enable_count = False ):
1743+ return 'MPI_T_event_registration *'
1744+
1745+ @Type .add_type ('PVAR_HANDLE' , abi_type = ['ompi' ])
1746+ class TypePvarHandle (Type ):
1747+
1748+ def type_text (self , enable_count = False ):
1749+ return 'MPI_T_pvar_handle'
1750+
1751+ @Type .add_type ('PVAR_HANDLE_OUT' , abi_type = ['ompi' ])
1752+ class TypePvarHandleOut (Type ):
1753+
1754+ def type_text (self , enable_count = False ):
1755+ return 'MPI_T_pvar_handle *'
1756+
1757+ @Type .add_type ('PVAR_HANDLE_INOUT' , abi_type = ['ompi' ])
1758+ class TypePvarHandleInout (Type ):
1759+
1760+ def type_text (self , enable_count = False ):
1761+ return 'MPI_T_pvar_handle *'
1762+
1763+ @Type .add_type ('PVAR_SESSION' , abi_type = ['ompi' ])
1764+ class TypePvarSession (Type ):
1765+
1766+ def type_text (self , enable_count = False ):
1767+ return 'MPI_T_pvar_session'
1768+
1769+ @Type .add_type ('PVAR_SESSION_OUT' , abi_type = ['ompi' ])
1770+ class TypePvarSessionOut (Type ):
1771+
1772+ def type_text (self , enable_count = False ):
1773+ return 'MPI_T_pvar_session *'
1774+
1775+ @Type .add_type ('T_VERBOSITY' , abi_type = ['ompi' ])
1776+ class TypeTVerbosity (Type ):
1777+
1778+ def type_text (self , enable_count = False ):
1779+ return 'int'
1780+
1781+ @Type .add_type ('T_VERBOSITY_OUT' , abi_type = ['ompi' ])
1782+ class TypeTVerbosityOut (Type ):
1783+
1784+ def type_text (self , enable_count = False ):
1785+ return 'int *'
1786+
1787+ @Type .add_type ('PVAR_CLASS' , abi_type = ['ompi' ])
1788+ class TypePvarClass (Type ):
1789+
1790+ def type_text (self , enable_count = False ):
1791+ return 'int'
1792+
1793+ @Type .add_type ('PVAR_CLASS_OUT' , abi_type = ['ompi' ])
1794+ class TypePvarClassOut (Type ):
1795+
1796+ def type_text (self , enable_count = False ):
1797+ return 'int *'
1798+
1799+ @Type .add_type ('CB_SAFETY' , abi_type = ['ompi' ])
1800+ class TypeCbSafety (Type ):
1801+
1802+ def type_text (self , enable_count = False ):
1803+ return 'MPI_T_cb_safety'
1804+
1805+ @Type .add_type ('SOURCE_ORDER' , abi_type = ['ompi' ])
1806+ class TypeSourceOrder (Type ):
1807+
1808+ def type_text (self , enable_count = False ):
1809+ return 'MPI_T_source_order'
1810+
1811+ @Type .add_type ('SOURCE_ORDER_OUT' , abi_type = ['ompi' ])
1812+ class TypeSourceOrderOut (Type ):
1813+
1814+ def type_text (self , enable_count = False ):
1815+ return 'MPI_T_source_order *'
1816+
1817+ @Type .add_type ('EVENT_FREE_CB_FUNCTION' , abi_type = ['ompi' ])
1818+ class TypeEventFreeCBFunction (Type ):
1819+
1820+ def type_text (self , enable_count = False ):
1821+ return 'MPI_T_event_free_cb_function'
1822+
1823+
1824+ @Type .add_type ('EVENT_DROPPED_CB_FUNCTION' , abi_type = ['ompi' ])
1825+ class TypeEventDroppedCBFunction (Type ):
1826+
1827+ def type_text (self , enable_count = False ):
1828+ return 'MPI_T_event_dropped_cb_function'
1829+
1830+ @Type .add_type ('EVENT_CB_FUNCTION' , abi_type = ['ompi' ])
1831+ class TypeEventCBFunction (Type ):
1832+
1833+ def type_text (self , enable_count = False ):
1834+ return 'MPI_T_event_cb_function'
1835+
1836+ @Type .add_type ('VOID' , abi_type = ['ompi' ])
1837+ class TypeVoid (Type ):
1838+
1839+ def type_text (self , enable_count = False ):
1840+ return 'void *'
1841+
1842+ @Type .add_type ('VOID' , abi_type = ['standard' ])
1843+ class TypeVoidStandard (StandardABIType ):
1844+
1845+ def type_text (self , enable_count = False ):
1846+ return 'void *'
1847+
1848+ @Type .add_type ('VOID_CONST' , abi_type = ['ompi' ])
1849+ class TypeVoidConst (Type ):
1850+
1851+ def type_text (self , enable_count = False ):
1852+ return 'const void *'
1853+
1854+ @Type .add_type ('VOID_CONST' , abi_type = ['standard' ])
1855+ class TypeVoidConst (StandardABIType ):
1856+
1857+ def type_text (self , enable_count = False ):
1858+ return 'const void *'
1859+
1860+
1861+
0 commit comments