This source file includes following definitions.
- open
- close
- close
- delete
- delete
- delete
- setSize
- setSize
- preallocate
- preallocate
- getSize
- getSize
- getGroup
- getGroup
- getAMode
- getAMode
- setInfo
- setInfo
- getInfo
- getInfo
- setView
- setView
- setView
- getView
- readAt
- readAt
- readAtAll
- readAtAll
- writeAt
- writeAt
- writeAtAll
- writeAtAll
- iReadAt
- iReadAt
- iReadAtAll
- iReadAtAll
- iWriteAt
- iWriteAt
- iWriteAtAll
- iWriteAtAll
- read
- read
- readAll
- readAll
- write
- write
- writeAll
- writeAll
- iRead
- iRead
- iReadAll
- iReadAll
- iWrite
- iWrite
- iWriteAll
- iWriteAll
- seek
- seek
- getPosition
- getPosition
- getByteOffset
- getByteOffset
- readShared
- readShared
- writeShared
- writeShared
- iReadShared
- iReadShared
- iWriteShared
- iWriteShared
- readOrdered
- readOrdered
- writeOrdered
- writeOrdered
- seekShared
- seekShared
- getPositionShared
- getPositionShared
- readAtAllBegin
- readAtAllBegin
- readAtAllEnd
- readAtAllEnd
- writeAtAllBegin
- writeAtAllBegin
- writeAtAllEnd
- writeAtAllEnd
- readAllBegin
- readAllBegin
- readAllEnd
- readAllEnd
- writeAllBegin
- writeAllBegin
- writeAllEnd
- writeAllEnd
- readOrderedBegin
- readOrderedBegin
- readOrderedEnd
- readOrderedEnd
- writeOrderedBegin
- writeOrderedBegin
- writeOrderedEnd
- writeOrderedEnd
- getBeginStatus
- getTypeExtent
- getTypeExtent
- setAtomicity
- setAtomicity
- getAtomicity
- getAtomicity
- sync
- sync
- setErrhandler
- setErrhandler
- getErrhandler
- getErrhandler
- callErrhandler
- callErrhandler
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 package mpi;
31
32 import java.nio.*;
33 import static mpi.MPI.isHeapBuffer;
34 import static mpi.MPI.isDirectBuffer;
35 import static mpi.MPI.assertDirectBuffer;
36
37
38
39
40 public final class File
41 {
42 private long handle;
43 private FileView view = new FileView(0, MPI.BYTE, MPI.BYTE, "native");
44 private Status beginStatus;
45
46
47
48
49
50
51
52
53 public File(Comm comm, String filename, int amode) throws MPIException
54 {
55 MPI.check();
56 handle = open(comm.handle, filename, amode, Info.NULL);
57 }
58
59
60
61
62
63
64
65
66
67 public File(Comm comm, String filename, int amode, Info info)
68 throws MPIException
69 {
70 MPI.check();
71 handle = open(comm.handle, filename, amode, info.handle);
72 }
73
74 private native long open(long comm, String filename, int amode, long info)
75 throws MPIException;
76
77
78
79
80
81 public void close() throws MPIException
82 {
83 MPI.check();
84 handle = close(handle);
85 }
86
87 private native long close(long fh) throws MPIException;
88
89
90
91
92
93
94 public static void delete(String filename) throws MPIException
95 {
96 MPI.check();
97 delete(filename, Info.NULL);
98 }
99
100
101
102
103
104
105
106 public static void delete(String filename, Info info) throws MPIException
107 {
108 MPI.check();
109 delete(filename, info.handle);
110 }
111
112 private static native void delete(String filename, long info)
113 throws MPIException;
114
115
116
117
118
119
120 public void setSize(long size) throws MPIException
121 {
122 MPI.check();
123 setSize(handle, size);
124 }
125
126 private native void setSize(long fh, long size) throws MPIException;
127
128
129
130
131
132
133 public void preallocate(long size) throws MPIException
134 {
135 MPI.check();
136 preallocate(handle, size);
137 }
138
139 private native void preallocate(long fh, long size) throws MPIException;
140
141
142
143
144
145
146 public long getSize() throws MPIException
147 {
148 MPI.check();
149 return getSize(handle);
150 }
151
152 private native long getSize(long fh) throws MPIException;
153
154
155
156
157
158
159 public Group getGroup() throws MPIException
160 {
161 MPI.check();
162 return new Group(getGroup(handle));
163 }
164
165 private native long getGroup(long fh) throws MPIException;
166
167
168
169
170
171
172 public int getAMode() throws MPIException
173 {
174 MPI.check();
175 return getAMode(handle);
176 }
177
178 private native int getAMode(long fh) throws MPIException;
179
180
181
182
183
184
185 public void setInfo(Info info) throws MPIException
186 {
187 MPI.check();
188 setInfo(handle, info.handle);
189 }
190
191 private native void setInfo(long fh, long info) throws MPIException;
192
193
194
195
196
197
198 public Info getInfo() throws MPIException
199 {
200 MPI.check();
201 return new Info(getInfo(handle));
202 }
203
204 private native long getInfo(long fh) throws MPIException;
205
206
207
208
209
210
211
212
213
214 public void setView(long disp, Datatype etype,
215 Datatype filetype, String datarep)
216 throws MPIException
217 {
218 MPI.check();
219 setView(handle, disp, etype.handle, filetype.handle, datarep, Info.NULL);
220 view = new FileView(disp, etype, filetype, datarep);
221 }
222
223
224
225
226
227
228
229
230
231
232 public void setView(long disp, Datatype etype,
233 Datatype filetype, String datarep, Info info)
234 throws MPIException
235 {
236 MPI.check();
237 setView(handle, disp, etype.handle, filetype.handle, datarep, info.handle);
238 view = new FileView(disp, etype, filetype, datarep);
239 }
240
241 private native void setView(
242 long fh, long disp, long etype,
243 long filetype, String datarep, long info) throws MPIException;
244
245
246
247
248
249 public FileView getView()
250 {
251 return view;
252 }
253
254
255
256
257
258
259
260
261
262
263 public Status readAt(long offset, Object buf, int count, Datatype type)
264 throws MPIException
265 {
266 MPI.check();
267 int off = 0;
268 boolean db = false;
269 Status status = new Status();
270
271 if(buf instanceof Buffer && !(db = ((Buffer)buf).isDirect()))
272 {
273 off = type.getOffset(buf);
274 buf = ((Buffer)buf).array();
275 }
276
277 readAt(handle, offset, buf, db, off, count,
278 type.handle, type.baseType, status.data);
279
280 return status;
281 }
282
283 private native void readAt(
284 long fh, long fileOffset, Object buf, boolean db, int offset,
285 int count, long type, int baseType, long[] stat) throws MPIException;
286
287
288
289
290
291
292
293
294
295
296 public Status readAtAll(long offset, Object buf, int count, Datatype type)
297 throws MPIException
298 {
299 MPI.check();
300 int off = 0;
301 boolean db = false;
302 Status status = new Status();
303
304 if(buf instanceof Buffer && !(db = ((Buffer)buf).isDirect()))
305 {
306 off = type.getOffset(buf);
307 buf = ((Buffer)buf).array();
308 }
309
310 readAtAll(handle, offset, buf, db, off, count,
311 type.handle, type.baseType, status.data);
312
313 return status;
314 }
315
316 private native void readAtAll(
317 long fh, long fileOffset, Object buf, boolean db, int offset,
318 int count, long type, int baseType, long[] stat) throws MPIException;
319
320
321
322
323
324
325
326
327
328
329 public Status writeAt(long offset, Object buf, int count, Datatype type)
330 throws MPIException
331 {
332 MPI.check();
333 int off = 0;
334 boolean db = false;
335 Status status = new Status();
336
337 if(buf instanceof Buffer && !(db = ((Buffer)buf).isDirect()))
338 {
339 off = type.getOffset(buf);
340 buf = ((Buffer)buf).array();
341 }
342
343 writeAt(handle, offset, buf, db, off, count,
344 type.handle, type.baseType, status.data);
345
346 return status;
347 }
348
349 private native void writeAt(
350 long fh, long fileOffset, Object buf, boolean db, int offset,
351 int count, long type, int baseType, long[] stat) throws MPIException;
352
353
354
355
356
357
358
359
360
361
362 public Status writeAtAll(long offset, Object buf, int count, Datatype type)
363 throws MPIException
364 {
365 MPI.check();
366 int off = 0;
367 boolean db = false;
368 Status status = new Status();
369
370 if(buf instanceof Buffer && !(db = ((Buffer)buf).isDirect()))
371 {
372 off = type.getOffset(buf);
373 buf = ((Buffer)buf).array();
374 }
375
376 writeAtAll(handle, offset, buf, db, off, count,
377 type.handle, type.baseType, status.data);
378
379 return status;
380 }
381
382 private native void writeAtAll(
383 long fh, long fileOffset, Object buf, boolean db, int offset,
384 int count, long type, int baseType, long[] stat) throws MPIException;
385
386
387
388
389
390
391
392
393
394
395 public Request iReadAt(long offset, Buffer buf, int count, Datatype type)
396 throws MPIException
397 {
398 MPI.check();
399 assertDirectBuffer(buf);
400 Request req = new Request(iReadAt(handle, offset, buf, count, type.handle));
401 req.addRecvBufRef(buf);
402 return req;
403 }
404
405 private native long iReadAt(
406 long fh, long offset, Buffer buf, int count, long type)
407 throws MPIException;
408
409
410
411
412
413
414
415
416
417
418 public Request iReadAtAll(long offset, Buffer buf, int count, Datatype type)
419 throws MPIException
420 {
421 MPI.check();
422 assertDirectBuffer(buf);
423 Request req = new Request(iReadAtAll(handle, offset, buf, count, type.handle));
424 req.addRecvBufRef(buf);
425 return req;
426 }
427
428 private native long iReadAtAll(
429 long fh, long offset, Buffer buf, int count, long type)
430 throws MPIException;
431
432
433
434
435
436
437
438
439
440
441 public Request iWriteAt(long offset, Buffer buf, int count, Datatype type)
442 throws MPIException
443 {
444 MPI.check();
445 assertDirectBuffer(buf);
446 Request req = new Request(iWriteAt(handle, offset, buf, count, type.handle));
447 req.addSendBufRef(buf);
448 return req;
449 }
450
451 private native long iWriteAt(
452 long fh, long offset, Buffer buf, int count, long type)
453 throws MPIException;
454
455
456
457
458
459
460
461
462
463
464 public Request iWriteAtAll(long offset, Buffer buf, int count, Datatype type)
465 throws MPIException
466 {
467 MPI.check();
468 assertDirectBuffer(buf);
469 Request req = new Request(iWriteAtAll(handle, offset, buf, count, type.handle));
470 req.addSendBufRef(buf);
471 return req;
472 }
473
474 private native long iWriteAtAll(
475 long fh, long offset, Buffer buf, int count, long type)
476 throws MPIException;
477
478
479
480
481
482
483
484
485
486 public Status read(Object buf, int count, Datatype type) throws MPIException
487 {
488 MPI.check();
489 int off = 0;
490 boolean db = false;
491 Status status = new Status();
492
493 if(buf instanceof Buffer && !(db = ((Buffer)buf).isDirect()))
494 {
495 off = type.getOffset(buf);
496 buf = ((Buffer)buf).array();
497 }
498
499 read(handle, buf, db, off, count, type.handle, type.baseType, status.data);
500 return status;
501 }
502
503 private native void read(
504 long fh, Object buf, boolean db, int offset,
505 int count, long type, int baseType, long[] stat) throws MPIException;
506
507
508
509
510
511
512
513
514
515 public Status readAll(Object buf, int count, Datatype type) throws MPIException
516 {
517 MPI.check();
518 int off = 0;
519 boolean db = false;
520 Status status = new Status();
521
522 if(buf instanceof Buffer && !(db = ((Buffer)buf).isDirect()))
523 {
524 off = type.getOffset(buf);
525 buf = ((Buffer)buf).array();
526 }
527
528 readAll(handle, buf,db,off, count, type.handle, type.baseType, status.data);
529 return status;
530 }
531
532 private native void readAll(
533 long fh, Object buf, boolean db, int offset,
534 int count, long type, int baseType, long[] stat) throws MPIException;
535
536
537
538
539
540
541
542
543
544 public Status write(Object buf, int count, Datatype type) throws MPIException
545 {
546 MPI.check();
547 int off = 0;
548 boolean db = false;
549 Status status = new Status();
550
551 if(buf instanceof Buffer && !(db = ((Buffer)buf).isDirect()))
552 {
553 off = type.getOffset(buf);
554 buf = ((Buffer)buf).array();
555 }
556
557 write(handle, buf, db, off, count, type.handle, type.baseType, status.data);
558 return status;
559 }
560
561 private native void write(
562 long fh, Object buf, boolean db, int offset,
563 int count, long type, int baseType, long[] stat) throws MPIException;
564
565
566
567
568
569
570
571
572
573 public Status writeAll(Object buf, int count, Datatype type) throws MPIException
574 {
575 MPI.check();
576 int off = 0;
577 boolean db = false;
578 Status status = new Status();
579
580 if(buf instanceof Buffer && !(db = ((Buffer)buf).isDirect()))
581 {
582 off = type.getOffset(buf);
583 buf = ((Buffer)buf).array();
584 }
585
586 writeAll(handle, buf,db,off, count, type.handle,type.baseType, status.data);
587 return status;
588 }
589
590 private native void writeAll(
591 long fh, Object buf, boolean db, int offset,
592 int count, long type, int baseType, long[] stat) throws MPIException;
593
594
595
596
597
598
599
600
601
602 public Request iRead(Buffer buf, int count, Datatype type) throws MPIException
603 {
604 MPI.check();
605 assertDirectBuffer(buf);
606 Request req = new Request(iRead(handle, buf, count, type.handle));
607 req.addRecvBufRef(buf);
608 return req;
609 }
610
611 private native long iRead(long fh, Buffer buf, int count, long type)
612 throws MPIException;
613
614
615
616
617
618
619
620
621
622 public Request iReadAll(Buffer buf, int count, Datatype type) throws MPIException
623 {
624 MPI.check();
625 assertDirectBuffer(buf);
626 Request req = new Request(iReadAll(handle, buf, count, type.handle));
627 req.addRecvBufRef(buf);
628 return req;
629 }
630
631 private native long iReadAll(long fh, Buffer buf, int count, long type)
632 throws MPIException;
633
634
635
636
637
638
639
640
641
642 public Request iWrite(Buffer buf, int count, Datatype type) throws MPIException
643 {
644 MPI.check();
645 assertDirectBuffer(buf);
646 Request req = new Request(iWrite(handle, buf, count, type.handle));
647 req.addRecvBufRef(buf);
648 return req;
649 }
650
651 private native long iWrite(long fh, Buffer buf, int count, long type)
652 throws MPIException;
653
654
655
656
657
658
659
660
661
662 public Request iWriteAll(Buffer buf, int count, Datatype type) throws MPIException
663 {
664 MPI.check();
665 assertDirectBuffer(buf);
666 Request req = new Request(iWriteAll(handle, buf, count, type.handle));
667 req.addRecvBufRef(buf);
668 return req;
669 }
670
671 private native long iWriteAll(long fh, Buffer buf, int count, long type)
672 throws MPIException;
673
674
675
676
677
678
679
680 public void seek(long offset, int whence) throws MPIException
681 {
682 MPI.check();
683 seek(handle, offset, whence);
684 }
685
686 private native void seek(long fh, long offset, int whence) throws MPIException;
687
688
689
690
691
692
693 public long getPosition() throws MPIException
694 {
695 MPI.check();
696 return getPosition(handle);
697 }
698
699 private native long getPosition(long fh) throws MPIException;
700
701
702
703
704
705
706
707 public long getByteOffset(long offset) throws MPIException
708 {
709 MPI.check();
710 return getByteOffset(handle, offset);
711 }
712
713 private native long getByteOffset(long fh, long offset) throws MPIException;
714
715
716
717
718
719
720
721
722
723 public Status readShared(Object buf, int count, Datatype type)
724 throws MPIException
725 {
726 MPI.check();
727 int off = 0;
728 boolean db = false;
729 Status status = new Status();
730
731 if(buf instanceof Buffer && !(db = ((Buffer)buf).isDirect()))
732 {
733 off = type.getOffset(buf);
734 buf = ((Buffer)buf).array();
735 }
736
737 readShared(handle, buf, db, off, count,
738 type.handle, type.baseType, status.data);
739
740 return status;
741 }
742
743 private native void readShared(
744 long fh, Object buf, boolean db, int offset, int count,
745 long type, int baseType, long[] stat) throws MPIException;
746
747
748
749
750
751
752
753
754
755 public Status writeShared(Object buf, int count, Datatype type)
756 throws MPIException
757 {
758 MPI.check();
759 int off = 0;
760 boolean db = false;
761 Status status = new Status();
762
763 if(buf instanceof Buffer && !(db = ((Buffer)buf).isDirect()))
764 {
765 off = type.getOffset(buf);
766 buf = ((Buffer)buf).array();
767 }
768
769 writeShared(handle, buf, db, off, count,
770 type.handle, type.baseType, status.data);
771
772 return status;
773 }
774
775 private native void writeShared(
776 long fh, Object buf, boolean db, int offset, int count,
777 long type, int baseType, long[] stat) throws MPIException;
778
779
780
781
782
783
784
785
786
787 public Request iReadShared(Buffer buf, int count, Datatype type)
788 throws MPIException
789 {
790 MPI.check();
791 assertDirectBuffer(buf);
792 Request req = new Request(iReadShared(handle, buf, count, type.handle));
793 req.addRecvBufRef(buf);
794 return req;
795 }
796
797 private native long iReadShared(long fh, Buffer buf, int count, long type)
798 throws MPIException;
799
800
801
802
803
804
805
806
807
808 public Request iWriteShared(Buffer buf, int count, Datatype type)
809 throws MPIException
810 {
811 MPI.check();
812 assertDirectBuffer(buf);
813 Request req = new Request(iWriteShared(handle, buf, count, type.handle));
814 req.addSendBufRef(buf);
815 return req;
816 }
817
818 private native long iWriteShared(long fh, Buffer buf, int count, long type)
819 throws MPIException;
820
821
822
823
824
825
826
827
828
829 public Status readOrdered(Object buf, int count, Datatype type)
830 throws MPIException
831 {
832 MPI.check();
833 int off = 0;
834 boolean db = false;
835 Status status = new Status();
836
837 if(buf instanceof Buffer && !(db = ((Buffer)buf).isDirect()))
838 {
839 off = type.getOffset(buf);
840 buf = ((Buffer)buf).array();
841 }
842
843 readOrdered(handle, buf, db, off, count,
844 type.handle, type.baseType, status.data);
845
846 return status;
847 }
848
849 private native void readOrdered(
850 long fh, Object buf, boolean db, int offset, int count,
851 long type, int baseType, long[] stat) throws MPIException;
852
853
854
855
856
857
858
859
860
861 public Status writeOrdered(Object buf, int count, Datatype type)
862 throws MPIException
863 {
864 MPI.check();
865 int off = 0;
866 boolean db = false;
867 Status status = new Status();
868
869 if(buf instanceof Buffer && !(db = ((Buffer)buf).isDirect()))
870 {
871 off = type.getOffset(buf);
872 buf = ((Buffer)buf).array();
873 }
874
875 writeOrdered(handle, buf, db, off, count,
876 type.handle, type.baseType, status.data);
877
878 return status;
879 }
880
881 private native void writeOrdered(
882 long fh, Object buf, boolean db, int offset, int count,
883 long type, int baseType, long[] stat) throws MPIException;
884
885
886
887
888
889
890
891 public void seekShared(long offset, int whence) throws MPIException
892 {
893 MPI.check();
894 seekShared(handle, offset, whence);
895 }
896
897 private native void seekShared(long fh, long offset, int whence)
898 throws MPIException;
899
900
901
902
903
904
905 public long getPositionShared() throws MPIException
906 {
907 MPI.check();
908 return getPositionShared(handle);
909 }
910
911 private native long getPositionShared(long fh) throws MPIException;
912
913
914
915
916
917
918
919
920
921 public void readAtAllBegin(long offset, Object buf, int count, Datatype type)
922 throws MPIException
923 {
924 MPI.check();
925
926 if(isDirectBuffer(buf))
927 {
928 readAtAllBegin(handle, offset, buf, count, type.handle);
929 }
930 else
931 {
932 int off = 0;
933 Status status = new Status();
934
935 if(isHeapBuffer(buf))
936 {
937 off = type.getOffset(buf);
938 buf = ((Buffer)buf).array();
939 }
940
941 readAtAll(handle, offset, buf, false, off, count,
942 type.handle, type.baseType, status.data);
943
944 beginStatus = status;
945 }
946 }
947
948 private native void readAtAllBegin(
949 long fh, long offset, Object buf, int count, long type)
950 throws MPIException;
951
952
953
954
955
956
957
958 public Status readAtAllEnd(Object buf) throws MPIException
959 {
960 MPI.check();
961
962 if(isDirectBuffer(buf))
963 {
964 Status status = new Status();
965 readAtAllEnd(handle, buf, status.data);
966 return status;
967 }
968 else
969 {
970 return getBeginStatus();
971 }
972 }
973
974 private native void readAtAllEnd(long fh, Object buf, long[] stat)
975 throws MPIException;
976
977
978
979
980
981
982
983
984
985 public void writeAtAllBegin(long offset, Object buf, int count, Datatype type)
986 throws MPIException
987 {
988 MPI.check();
989
990 if(isDirectBuffer(buf))
991 {
992 writeAtAllBegin(handle, offset, buf, count, type.handle);
993 }
994 else
995 {
996 int off = 0;
997 Status status = new Status();
998
999 if(isHeapBuffer(buf))
1000 {
1001 off = type.getOffset(buf);
1002 buf = ((Buffer)buf).array();
1003 }
1004
1005 writeAtAll(handle, offset, buf, false, off, count,
1006 type.handle, type.baseType, status.data);
1007
1008 beginStatus = status;
1009 }
1010 }
1011
1012 private native void writeAtAllBegin(
1013 long fh, long fileOffset, Object buf, int count, long type)
1014 throws MPIException;
1015
1016
1017
1018
1019
1020
1021
1022 public Status writeAtAllEnd(Object buf) throws MPIException
1023 {
1024 MPI.check();
1025
1026 if(isDirectBuffer(buf))
1027 {
1028 Status status = new Status();
1029 writeAtAllEnd(handle, buf, status.data);
1030 return status;
1031 }
1032 else
1033 {
1034 return getBeginStatus();
1035 }
1036 }
1037
1038 private native void writeAtAllEnd(long fh, Object buf, long[] stat)
1039 throws MPIException;
1040
1041
1042
1043
1044
1045
1046
1047
1048 public void readAllBegin(Object buf, int count, Datatype type)
1049 throws MPIException
1050 {
1051 MPI.check();
1052
1053 if(isDirectBuffer(buf))
1054 {
1055 readAllBegin(handle, buf, count, type.handle);
1056 }
1057 else
1058 {
1059 int off = 0;
1060 Status status = new Status();
1061
1062 if(isHeapBuffer(buf))
1063 {
1064 off = type.getOffset(buf);
1065 buf = ((Buffer)buf).array();
1066 }
1067
1068 readAll(handle, buf, false, off, count,
1069 type.handle, type.baseType, status.data);
1070
1071 beginStatus = status;
1072 }
1073 }
1074
1075 private native void readAllBegin(long fh, Object buf, int count, long type)
1076 throws MPIException;
1077
1078
1079
1080
1081
1082
1083
1084 public Status readAllEnd(Object buf) throws MPIException
1085 {
1086 MPI.check();
1087
1088 if(isDirectBuffer(buf))
1089 {
1090 Status status = new Status();
1091 readAllEnd(handle, buf, status.data);
1092 return status;
1093 }
1094 else
1095 {
1096 return getBeginStatus();
1097 }
1098 }
1099
1100 private native void readAllEnd(long fh, Object buf, long[] stat)
1101 throws MPIException;
1102
1103
1104
1105
1106
1107
1108
1109
1110 public void writeAllBegin(Object buf, int count, Datatype type)
1111 throws MPIException
1112 {
1113 MPI.check();
1114
1115 if(isDirectBuffer(buf))
1116 {
1117 writeAllBegin(handle, buf, count, type.handle);
1118 }
1119 else
1120 {
1121 int off = 0;
1122 Status status = new Status();
1123
1124 if(isHeapBuffer(buf))
1125 {
1126 off = type.getOffset(buf);
1127 buf = ((Buffer)buf).array();
1128 }
1129
1130 writeAll(handle, buf, false, off, count,
1131 type.handle, type.baseType, status.data);
1132
1133 beginStatus = status;
1134 }
1135 }
1136
1137 private native void writeAllBegin(long fh, Object buf, int count, long type)
1138 throws MPIException;
1139
1140
1141
1142
1143
1144
1145
1146 public Status writeAllEnd(Object buf) throws MPIException
1147 {
1148 MPI.check();
1149
1150 if(isDirectBuffer(buf))
1151 {
1152 Status status = new Status();
1153 writeAllEnd(handle, buf, status.data);
1154 return status;
1155 }
1156 else
1157 {
1158 return getBeginStatus();
1159 }
1160 }
1161
1162 private native void writeAllEnd(long fh, Object buf, long[] stat)
1163 throws MPIException;
1164
1165
1166
1167
1168
1169
1170
1171
1172 public void readOrderedBegin(Object buf, int count, Datatype type)
1173 throws MPIException
1174 {
1175 MPI.check();
1176
1177 if(isDirectBuffer(buf))
1178 {
1179 readOrderedBegin(handle, buf, count, type.handle);
1180 }
1181 else
1182 {
1183 int off = 0;
1184 Status status = new Status();
1185
1186 if(isHeapBuffer(buf))
1187 {
1188 off = type.getOffset(buf);
1189 buf = ((Buffer)buf).array();
1190 }
1191
1192 readOrdered(handle, buf, false, off, count,
1193 type.handle, type.baseType, status.data);
1194
1195 beginStatus = status;
1196 }
1197 }
1198
1199 private native void readOrderedBegin(long fh, Object buf, int count, long type)
1200 throws MPIException;
1201
1202
1203
1204
1205
1206
1207
1208 public Status readOrderedEnd(Object buf) throws MPIException
1209 {
1210 MPI.check();
1211
1212 if(isDirectBuffer(buf))
1213 {
1214 Status status = new Status();
1215 readOrderedEnd(handle, buf, status.data);
1216 return status;
1217 }
1218 else
1219 {
1220 return getBeginStatus();
1221 }
1222 }
1223
1224 private native void readOrderedEnd(long fh, Object buf, long[] stat)
1225 throws MPIException;
1226
1227
1228
1229
1230
1231
1232
1233
1234 public void writeOrderedBegin(Object buf, int count, Datatype type)
1235 throws MPIException
1236 {
1237 MPI.check();
1238
1239 if(isDirectBuffer(buf))
1240 {
1241 writeOrderedBegin(handle, buf, count, type.handle);
1242 }
1243 else
1244 {
1245 int off = 0;
1246 Status status = new Status();
1247
1248 if(isHeapBuffer(buf))
1249 {
1250 off = type.getOffset(buf);
1251 buf = ((Buffer)buf).array();
1252 }
1253
1254 writeOrdered(handle, buf, false, off, count,
1255 type.handle, type.baseType, status.data);
1256
1257 beginStatus = status;
1258 }
1259 }
1260
1261 private native void writeOrderedBegin(long fh, Object buf, int count, long type)
1262 throws MPIException;
1263
1264
1265
1266
1267
1268
1269
1270 public Status writeOrderedEnd(Object buf) throws MPIException
1271 {
1272 MPI.check();
1273
1274 if(isDirectBuffer(buf))
1275 {
1276 Status status = new Status();
1277 writeOrderedEnd(handle, buf, status.data);
1278 return status;
1279 }
1280 else
1281 {
1282 return getBeginStatus();
1283 }
1284 }
1285
1286 private native void writeOrderedEnd(long fh, Object buf, long[] stat)
1287 throws MPIException;
1288
1289 private Status getBeginStatus()
1290 {
1291 Status s = beginStatus;
1292 beginStatus = null;
1293 return s;
1294 }
1295
1296
1297
1298
1299
1300
1301
1302 public int getTypeExtent(Datatype type) throws MPIException
1303 {
1304 MPI.check();
1305 return getTypeExtent(handle, type.handle) / type.baseSize;
1306 }
1307
1308 private native int getTypeExtent(long fh, long type) throws MPIException;
1309
1310
1311
1312
1313
1314
1315 public void setAtomicity(boolean atomicity) throws MPIException
1316 {
1317 MPI.check();
1318 setAtomicity(handle, atomicity);
1319 }
1320
1321 private native void setAtomicity(long fh, boolean atomicity)
1322 throws MPIException;
1323
1324
1325
1326
1327
1328
1329 public boolean getAtomicity() throws MPIException
1330 {
1331 MPI.check();
1332 return getAtomicity(handle);
1333 }
1334
1335 private native boolean getAtomicity(long fh) throws MPIException;
1336
1337
1338
1339
1340
1341 public void sync() throws MPIException
1342 {
1343 MPI.check();
1344 sync(handle);
1345 }
1346
1347 private native void sync(long handle) throws MPIException;
1348
1349
1350
1351
1352
1353
1354 public void setErrhandler(Errhandler errhandler) throws MPIException
1355 {
1356 MPI.check();
1357 setErrhandler(handle, errhandler.handle);
1358 }
1359
1360 private native void setErrhandler(long fh, long errhandler)
1361 throws MPIException;
1362
1363
1364
1365
1366
1367
1368 public Errhandler getErrhandler() throws MPIException
1369 {
1370 MPI.check();
1371 return new Errhandler(getErrhandler(handle));
1372 }
1373
1374 private native long getErrhandler(long fh);
1375
1376
1377
1378
1379
1380
1381 public void callErrhandler(int errorCode) throws MPIException
1382 {
1383 callErrhandler(handle, errorCode);
1384 }
1385
1386 private native void callErrhandler(long handle, int errorCode)
1387 throws MPIException;
1388
1389 }