Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Do not execute MCer code in MCed mode in MC_remove_ignore_heap()
[simgrid.git] / src / bindings / java / jmsg_task.h
1 /* Functions related to the java task instances.                            */
2
3 /* Copyright (c) 2007-2014. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #ifndef MSG_JTASK_H
10 #define MSG_JTASK_H
11
12 #include <jni.h>
13 #include "simgrid/msg.h"
14
15
16 /**
17  * This function associated a native task to a java task instance.
18  *
19  * @param jtask                 The java task instance.
20  * @param task                  The native task to bind.
21  * @param env                   The environment of the current thread.
22  *
23  * @exception                   If the class Task is not found the function throws 
24  *                                              the ClassNotFoundException. If the field bind of 
25  *                                              this class is not found the function throws the exception 
26  *                                              NotSuchFieldException.  
27  */
28 void jtask_bind(jobject jtask, msg_task_t task, JNIEnv * env);
29
30 /**
31  * This function returns a native task from a java task instance.
32  *
33  * @param jtask                 The java task object from which get the native task.
34  * @param env                   The environment of the current thread.
35  *
36  * @return                              The function returns the native task associated to the
37  *                                              java task object.
38  *
39  * @exception                   If the class Task is not found the function throws 
40  *                                              the ClassNotFoundException. If the field bind of 
41  *                                              this class is not found the function throws the exception 
42  *                                              NotSuchFieldException.  
43  */
44 msg_task_t jtask_to_native_task(jobject jtask, JNIEnv * env);
45
46 /**
47  * This function tests if a java task instance is valid.
48  * A java task object is valid if it is bind to a native 
49  * task.
50  *
51  * @param jtask                 The java task to test the validity.
52  * @param env                   The environment of the current thread.
53  *
54  * @return                              If the java task is valid the function returns true.
55  *                                              Otherwise the function returns false.
56  */
57 jboolean jtask_is_valid(jobject jtask, JNIEnv * env);
58
59 /*
60  * Class                org_simgrid_msg_Task
61  * Method               nativeInit
62  * Signature    ();
63  */
64 JNIEXPORT void JNICALL
65 Java_org_simgrid_msg_Task_nativeInit(JNIEnv *env, jclass cls);
66
67 /*
68  * Class                org_simgrid_msg_Task
69  * Method               create
70  */
71 JNIEXPORT void JNICALL
72 Java_org_simgrid_msg_Task_create
73                 (JNIEnv * env, jobject jtask, jstring jname, jdouble jcomputeDuration, jdouble jmessageSize);
74 /*
75  * Class                org_simgrid_msg_Task
76  * Method               parallelCreate
77  */
78 JNIEXPORT void JNICALL
79 Java_org_simgrid_msg_Task_parallelCreate
80                 (JNIEnv *, jobject,
81      jstring, jobjectArray,
82      jdoubleArray,
83      jdoubleArray);
84 /*
85  * Class                org_simgrid_msg_Task
86  * Method               destroy
87  * Signature    (Lsimgrid/msg/Task;)V
88  */
89 /* JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_destroy */
90 /*     (JNIEnv *, jobject); */
91
92 /*
93  * Class                org_simgrid_msg_Task
94  * Method               cancel
95  * Signature    ()V
96  */
97 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_cancel
98     (JNIEnv *, jobject);
99
100 /*
101  * Class                org_simgrid_msg_Task
102  * Method               execute
103  * Signature    ()V
104  */
105 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_execute
106     (JNIEnv *, jobject);
107
108 /*
109  * Class                org_simgrid_msg_Task
110  * Method               setBound
111  * Signature    ()V
112  */
113 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBound
114     (JNIEnv *, jobject, jdouble);
115
116 /*
117  * Class                org_simgrid_msg_Task
118  * Method               getName
119  * Signature    ()Ljava/lang/String;
120  */
121 JNIEXPORT jstring JNICALL Java_org_simgrid_msg_Task_getName
122     (JNIEnv *, jobject);
123
124 /*
125  * Class                org_simgrid_msg_Task
126  * Method               getSender
127  * Signature    ()Lsimgrid/msg/Process;
128  */
129 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSender
130     (JNIEnv *, jobject);
131 /*
132  * Class                org_simgrid_msg_Task
133  * Method               getSource
134  * Signature    ()Lsimgrid/msg/Host;
135  */
136 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSource
137     (JNIEnv *, jobject);
138 /*
139  * Class                org_simgrid_msg_Task
140  * Method               getFlopsAmount
141  * Signature    ()D
142  */
143 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Task_getFlopsAmount
144     (JNIEnv *, jobject);
145
146 /**
147  * Class                org_simgrid_msg_Task
148  * Method               setName
149  * Signature    (Ljava/lang/string;)V
150  */
151 JNIEXPORT void JNICALL
152 Java_org_simgrid_msg_Task_setName(JNIEnv *env, jobject jtask, jobject jname);
153 /*
154  * Class                org_simgrid_msg_Task
155  * Method               setPriority
156  * Signature    (D)V
157  */
158 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority
159     (JNIEnv *, jobject, jdouble);
160 /**
161  * Class                org_simgrid_msg_Task
162  * Method               setComputeDuration
163  * Signature    (D)V
164  */
165 JNIEXPORT void JNICALL
166 Java_org_simgrid_msg_Task_setFlopsAmount
167                 (JNIEnv *env, jobject jtask, jdouble computationAmount);
168                 
169                 /**
170  * Class                org_simgrid_msg_Task
171  * Method               setDataSize
172  * Signature    (D)V
173  */
174 JNIEXPORT void JNICALL
175 Java_org_simgrid_msg_Task_setBytesAmount
176                 (JNIEnv *env, jobject jtask, jdouble dataSize);
177                 
178 /**
179  * Class                org_simgrid_msg_Task
180  * Method               send
181  */
182 JNIEXPORT void JNICALL
183     Java_org_simgrid_msg_Task_send
184     (JNIEnv *, jobject, jstring, jdouble);
185
186 /**
187  * Class                org_simgrid_msg_Task
188  * Method               sendBounded
189  */
190 JNIEXPORT void JNICALL
191     Java_org_simgrid_msg_Task_sendBounded
192     (JNIEnv *, jobject, jstring, jdouble, jdouble);
193
194
195 /**
196  * Class                org_simgrid_msg_Task
197  * Method               receive
198  */
199 JNIEXPORT jobject JNICALL
200     Java_org_simgrid_msg_Task_receive
201     (JNIEnv *, jclass, jstring, jdouble, jobject);
202
203 /**
204  * Class                org_simgrid_msg_Task
205  * Method               irecv
206  * Signature    (Ljava/lang/String;)Lorg/simgrid/msg/Comm;
207  */
208 JNIEXPORT jobject JNICALL
209 Java_org_simgrid_msg_Task_irecv(JNIEnv * env, jclass cls, jstring jmailbox);
210 /**
211  * Class                org_simgrid_msg_Task
212  * Method               receiveBounded
213  */
214 JNIEXPORT jobject JNICALL
215 Java_org_simgrid_msg_Task_receiveBounded(JNIEnv * env, jclass cls,
216                                          jstring jalias, jdouble jtimeout,
217                                          jobject jhost, jdouble rate);
218 /**
219  * Class                org_simgrid_msg_Task
220  * Method               irecvBounded
221  */
222 JNIEXPORT jobject JNICALL
223 Java_org_simgrid_msg_Task_irecvBounded(JNIEnv * env, jclass cls,
224                                        jstring jmailbox, jdouble rate);
225 /**
226  * Class                org_simgrid_msg_Task
227  * Method               isend
228  * Signature    (Lorg/simgrid/msg/Task;Ljava/lang/String;)Lorg/simgrid/msg/Comm;
229  */
230 JNIEXPORT jobject JNICALL
231 Java_org_simgrid_msg_Task_isend(JNIEnv *env, jobject jtask, jstring jmailbox);
232 /**
233  * Class                org_simgrid_msg_Task
234  * Method               isendBounded
235  */
236 JNIEXPORT jobject JNICALL
237 Java_org_simgrid_msg_Task_isendBounded(JNIEnv *env, jobject jtask, jstring jmailbox, jdouble maxrate);
238
239 /**
240  * Class                org_simgrid_msg_Task
241  * Method               dsend
242  */
243 JNIEXPORT void JNICALL
244 Java_org_simgrid_msg_Task_dsend(JNIEnv * env, jobject jtask,
245                                 jstring jalias);
246
247 /**
248  * Class                org_simgrid_msg_Task
249  * Method               dsendBounded
250  */
251 JNIEXPORT void JNICALL
252 Java_org_simgrid_msg_Task_dsendBounded(JNIEnv * env, jobject jtask,
253                                 jstring jalias, jdouble maxrate);
254
255 /**
256  * Class                org_simgrid_msg_Task
257  * Method               listen
258  */
259 JNIEXPORT jboolean JNICALL
260 Java_org_simgrid_msg_Task_listen(JNIEnv *, jclass, jstring);
261 /**
262  * Class                org_simgrid_msg_Task
263  * Method               listenFromHost
264  */
265 JNIEXPORT jint JNICALL
266 Java_org_simgrid_msg_Task_listenFromHost(JNIEnv *, jclass, jstring,
267                                               jobject);
268 /**
269  * Class                org_simgrid_msg_Task
270  * Method               listenFrom
271  */
272 JNIEXPORT jint JNICALL
273 Java_org_simgrid_msg_Task_listenFrom(JNIEnv *, jclass, jstring);
274
275
276
277 #endif                          /* !MSG_JTASK_H */