1 /*
2  * Copyright (C) by Argonne National Laboratory
3  *     See COPYRIGHT in top-level directory
4  */
5 
6 #ifndef MPIR_MISC_H_INCLUDED
7 #define MPIR_MISC_H_INCLUDED
8 
9 #define MPIR_UNIVERSE_SIZE_NOT_SET -1
10 #define MPIR_UNIVERSE_SIZE_NOT_AVAILABLE -2
11 
12 #define MPIR_FINALIZE_CALLBACK_PRIO 5
13 #define MPIR_FINALIZE_CALLBACK_HANDLE_CHECK_PRIO 1
14 #define MPIR_FINALIZE_CALLBACK_DEFAULT_PRIO 0
15 #define MPIR_FINALIZE_CALLBACK_MAX_PRIO 10
16 
17 /* Define a typedef for the errflag value used by many internal
18  * functions.  If an error needs to be returned, these values can be
19  * used to signal such.  More details can be found further down in the
20  * code with the bitmasking logic */
21 typedef enum {
22     MPIR_ERR_NONE = MPI_SUCCESS,
23     MPIR_ERR_PROC_FAILED = MPIX_ERR_PROC_FAILED,
24     MPIR_ERR_OTHER = MPI_ERR_OTHER
25 } MPIR_Errflag_t;
26 
27 /*E
28   MPIR_Lang_t - Known language bindings for MPI
29 
30   A few operations in MPI need to know what language they were called from
31   or created by.  This type enumerates the possible languages so that
32   the MPI implementation can choose the correct behavior.  An example of this
33   are the keyval attribute copy and delete functions.
34 
35   Module:
36   Attribute-DS
37   E*/
38 typedef enum MPIR_Lang_t {
39     MPIR_LANG__C
40 #ifdef HAVE_FORTRAN_BINDING
41         , MPIR_LANG__FORTRAN, MPIR_LANG__FORTRAN90
42 #endif
43 #ifdef HAVE_CXX_BINDING
44         , MPIR_LANG__CXX
45 #endif
46 } MPIR_Lang_t;
47 
48 extern const char MPII_Version_string[] MPICH_API_PUBLIC;
49 extern const char MPII_Version_date[] MPICH_API_PUBLIC;
50 extern const char MPII_Version_ABI[] MPICH_API_PUBLIC;
51 extern const char MPII_Version_configure[] MPICH_API_PUBLIC;
52 extern const char MPII_Version_device[] MPICH_API_PUBLIC;
53 extern const char MPII_Version_CC[] MPICH_API_PUBLIC;
54 extern const char MPII_Version_CXX[] MPICH_API_PUBLIC;
55 extern const char MPII_Version_F77[] MPICH_API_PUBLIC;
56 extern const char MPII_Version_FC[] MPICH_API_PUBLIC;
57 extern const char MPII_Version_custom[] MPICH_API_PUBLIC;
58 
59 int MPIR_Localcopy(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
60                    void *recvbuf, MPI_Aint recvcount, MPI_Datatype recvtype);
61 
62 /*@ MPIR_Add_finalize - Add a routine to be called when MPI_Finalize is invoked
63 
64 + routine - Routine to call
65 . extra   - Void pointer to data to pass to the routine
66 - priority - Indicates the priority of this callback and controls the order
67   in which callbacks are executed.  Use a priority of zero for most handlers;
68   higher priorities will be executed first.
69 
70 Notes:
71   The routine 'MPID_Finalize' is executed with priority
72   'MPIR_FINALIZE_CALLBACK_PRIO' (currently defined as 5).  Handlers with
73   a higher priority execute before 'MPID_Finalize' is called; those with
74   a lower priority after 'MPID_Finalize' is called.
75 @*/
76 void MPIR_Add_finalize(int (*routine) (void *), void *extra, int priority);
77 
78 /* Routines for determining local and remote processes */
79 int MPIR_Find_local(struct MPIR_Comm *comm, int *local_size_p, int *local_rank_p,
80                     int **local_ranks_p, int **intranode_table);
81 int MPIR_Find_external(struct MPIR_Comm *comm, int *external_size_p, int *external_rank_p,
82                        int **external_ranks_p, int **internode_table_p);
83 int MPIR_Get_internode_rank(MPIR_Comm * comm_ptr, int r);
84 int MPIR_Get_intranode_rank(MPIR_Comm * comm_ptr, int r);
85 
86 int MPIR_Close_port_impl(const char *port_name);
87 int MPIR_Open_port_impl(MPIR_Info * info_ptr, char *port_name);
88 int MPIR_Cancel(MPIR_Request * request_ptr);
89 
90 /* Default routines for asynchronous progress thread */
91 int MPIR_Init_async_thread(void);
92 int MPIR_Finalize_async_thread(void);
93 
94 #endif /* MPIR_MISC_H_INCLUDED */
95