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