Whamcloud - gitweb
69fa339b9759407bedf6097fbe4c3e93222b3715
[fs/lustre-release.git] / lnet / include / lnet / api.h
1 #ifndef P30_API_H
2 #define P30_API_H
3
4 #include "build_check.h"
5
6 #include <portals/types.h>
7
8 #ifndef PTL_NO_WRAP
9 int PtlInit(int *);
10 void PtlFini(void);
11
12 int PtlNIInit(ptl_interface_t interface, ptl_pt_index_t ptl_size_in,
13               ptl_ac_index_t acl_size_in, ptl_pid_t requested_pid,
14               ptl_handle_ni_t * interface_out);
15
16 int PtlNIInitialized(ptl_interface_t);
17
18 int PtlNIFini(ptl_handle_ni_t interface_in);
19
20 #endif
21
22 int PtlGetId(ptl_handle_ni_t ni_handle, ptl_process_id_t *id);
23
24
25 /*
26  * Network interfaces
27  */
28
29 int PtlNIStatus(ptl_handle_ni_t interface_in, ptl_sr_index_t register_in,
30                 ptl_sr_value_t * status_out);
31
32 int PtlNIDist(ptl_handle_ni_t interface_in, ptl_process_id_t process_in,
33               unsigned long *distance_out);
34
35 #ifndef PTL_NO_WRAP
36 int PtlNIHandle(ptl_handle_any_t handle_in, ptl_handle_ni_t * interface_out);
37 #endif
38
39
40 /*
41  * PtlNIDebug: 
42  *
43  * This is not an official Portals 3 API call.  It is provided
44  * by the reference implementation to allow the maintainers an
45  * easy way to turn on and off debugging information in the
46  * library.  Do not use it in code that is not intended for use
47  * with any version other than the portable reference library.
48  */
49 unsigned int PtlNIDebug(ptl_handle_ni_t ni, unsigned int mask_in);
50
51 /* 
52  * PtlNIFailNid
53  *
54  * Not an official Portals 3 API call.  It provides a way of simulating
55  * communications failures to all (nid == PTL_NID_ANY), or specific peers
56  * (via multiple calls), either until further notice (threshold == -1), or
57  * for a specific number of messages.  Passing a threshold of zero, "heals"
58  * the given peer.
59  */
60 int PtlFailNid (ptl_handle_ni_t ni, ptl_nid_t nid, unsigned int threshold);
61
62 /*
63  * PtlSnprintHandle: 
64  *
65  * This is not an official Portals 3 API call.  It is provided
66  * so that an application can print an opaque handle.
67  */
68 void PtlSnprintHandle (char *str, int str_len, ptl_handle_any_t handle);
69
70 /*
71  * Match entries
72  */
73
74 int PtlMEAttach(ptl_handle_ni_t interface_in, ptl_pt_index_t index_in,
75                 ptl_process_id_t match_id_in, ptl_match_bits_t match_bits_in,
76                 ptl_match_bits_t ignore_bits_in, ptl_unlink_t unlink_in,
77                 ptl_ins_pos_t pos_in, ptl_handle_me_t * handle_out);
78
79 int PtlMEInsert(ptl_handle_me_t current_in, ptl_process_id_t match_id_in,
80                 ptl_match_bits_t match_bits_in, ptl_match_bits_t ignore_bits_in,
81                 ptl_unlink_t unlink_in, ptl_ins_pos_t position_in,
82                 ptl_handle_me_t * handle_out);
83
84 int PtlMEUnlink(ptl_handle_me_t current_in);
85
86 int PtlMEUnlinkList(ptl_handle_me_t current_in);
87
88 int PtlTblDump(ptl_handle_ni_t ni, int index_in);
89 int PtlMEDump(ptl_handle_me_t current_in);
90
91
92
93 /*
94  * Memory descriptors
95  */
96
97 #ifndef PTL_NO_WRAP
98 int PtlMDAttach(ptl_handle_me_t current_in, ptl_md_t md_in,
99                 ptl_unlink_t unlink_in, ptl_handle_md_t * handle_out);
100
101 int PtlMDBind(ptl_handle_ni_t ni_in, ptl_md_t md_in,
102               ptl_unlink_t unlink_in, ptl_handle_md_t * handle_out);
103
104 int PtlMDUnlink(ptl_handle_md_t md_in);
105
106 int PtlMDUpdate(ptl_handle_md_t md_in, ptl_md_t * old_inout,
107                 ptl_md_t * new_inout, ptl_handle_eq_t testq_in);
108
109 #endif
110
111 /* These should not be called by users */
112 int PtlMDUpdate_internal(ptl_handle_md_t md_in, ptl_md_t * old_inout,
113                          ptl_md_t * new_inout, ptl_handle_eq_t testq_in,
114                          ptl_seq_t sequence_in);
115
116
117
118
119 /*
120  * Event queues
121  */
122 #ifndef PTL_NO_WRAP
123
124 /* These should be called by users */
125 int PtlEQAlloc(ptl_handle_ni_t ni_in, ptl_size_t count_in,
126                int (*callback) (ptl_event_t * event),
127                ptl_handle_eq_t * handle_out);
128 int PtlEQFree(ptl_handle_eq_t eventq_in);
129
130 int PtlEQCount(ptl_handle_eq_t eventq_in, ptl_size_t * count_out);
131
132 int PtlEQGet(ptl_handle_eq_t eventq_in, ptl_event_t * event_out);
133
134
135 int PtlEQWait(ptl_handle_eq_t eventq_in, ptl_event_t * event_out);
136
137 int PtlEQPoll(ptl_handle_eq_t *eventqs_in, int neq_in, int timeout,
138               ptl_event_t *event_out, int *which_out);
139 #endif
140
141 /*
142  * Access Control Table
143  */
144 int PtlACEntry(ptl_handle_ni_t ni_in, ptl_ac_index_t index_in,
145                ptl_process_id_t match_id_in, ptl_pt_index_t portal_in);
146
147
148 /*
149  * Data movement
150  */
151
152 int PtlPut(ptl_handle_md_t md_in, ptl_ack_req_t ack_req_in,
153            ptl_process_id_t target_in, ptl_pt_index_t portal_in,
154            ptl_ac_index_t cookie_in, ptl_match_bits_t match_bits_in,
155            ptl_size_t offset_in, ptl_hdr_data_t hdr_data_in);
156
157 int PtlGet(ptl_handle_md_t md_in, ptl_process_id_t target_in,
158            ptl_pt_index_t portal_in, ptl_ac_index_t cookie_in,
159            ptl_match_bits_t match_bits_in, ptl_size_t offset_in);
160
161
162
163 #endif