SIONlib  1.7.4
Scalable I/O library for parallel access to task-local files
sion_cxx_base.cpp
1 
2 #include <iostream>
3 #include "sion_cxx_base.hpp"
4 
5 // Common functions
6 char* SION_Base::getSionFileName() const {
7  return _sion_file_name;
8 }
9 
10 void SION_Base::setMode(std::string mode) {
11  _mode = mode;
12 }
13 
14 std::string SION_Base::getMode() const {
15  return _mode;
16 }
17 
18 
19 void SION_Base::setNumberOfFiles(int num_files) {
20  _num_files = num_files;
21 }
22 
23 int SION_Base::getNumberOfFiles() const {
24  return _num_files;
25 }
26 
27 void SION_Base::setNumberOfTasks(int num_tasks) {
28  _num_tasks = num_tasks;
29 }
30 
31 int SION_Base::getNumberOfTasks() const {
32  return _num_tasks;
33 }
34 
35 void SION_Base::setRank(int rank) {
36  _rank = rank;
37 }
38 
39 int SION_Base::getRank() const {
40  return _rank;
41 }
42 
43 void SION_Base::setChunkSize(sion_int64 chunk_size) {
44  _chunk_size = chunk_size;
45 }
46 
47 sion_int64 SION_Base::getChunkSize() const {
48  return _chunk_size;
49 }
50 
51 void SION_Base::setChunkSizes(sion_int64 * chunk_sizes) {
52  _chunk_sizes = chunk_sizes;
53 }
54 
55 sion_int64 * SION_Base::getChunkSizes() const {
56  return _chunk_sizes;
57 }
58 
59 void SION_Base::setGlobalRanks(int * global_ranks) {
60  _global_ranks = global_ranks;
61 }
62 
63 int * SION_Base::getGlobalRanks() const {
64  return _global_ranks;
65 }
66 
67 void SION_Base::setFileSystemBlockSize(sion_int32 fs_blk_size) {
68  _fs_blk_size = fs_blk_size;
69 }
70 
71 sion_int32 SION_Base::getFileSystemBlockSize() const {
72  return _fs_blk_size;
73 }
74 
75 int SION_Base::getNumberOfSuccessfulReadElements() const {
76  return _number_of_elements_sucessfully_read;
77 }
78 
79 int SION_Base::getReturnCode() const {
80  return _return_code;
81 }
82 
83 int SION_Base::getSid() const {
84  return _sid;
85 }
86 
87 
88 /* get information (with sion datatypes) */
89 int SION_Base::getFileEndianness() const {
90  return sion_get_file_endianness(_sid);
91 }
92 
93 sion_int64 SION_Base::getBytesWritten() const {
94  return sion_get_bytes_written(_sid);
95 }
96 
97 sion_int64 SION_Base::getBytesRead() const {
98  return sion_get_bytes_read(_sid);
99 }
100 
101 sion_int64 SION_Base::getBytesAvailInBlock() const {
102  return sion_bytes_avail_in_block(_sid);
103 }
104 
105 sion_int64 SION_Base::getBytesAvailInChunk() const {
106  return sion_bytes_avail_in_chunk(_sid);
107 }
108 
109 sion_int64 SION_Base::getPosition() const {
110  return sion_get_position(_sid);
111 }
112 
113 
114 /* Seeking */
115 void SION_Base::seek() {
117 }
118 
119 // void SION_Base::seekFp() {
120 // _return_code = sion_seek_fp(_sid, _rank, SION_CURRENT_BLK,SION_CURRENT_POS,&_file_ptr);
121 
sion_int64 sion_bytes_avail_in_block(int sid)
Return the number of bytes available in the current chunk.
Definition: sion_common.c:879
sion_int64 sion_bytes_avail_in_chunk(int sid)
Function that returns the number of bytes available in the current chunk.
Definition: sion_common.c:894
sion_int64 sion_get_position(int sid)
Function that returns the current file position.
Definition: sion_common.c:930
int sion_get_file_endianness(int sid)
Returns edianness of data in file sid.
Definition: sion_common.c:253
#define SION_CURRENT_BLK
Definition: sion_const.h:66
int sion_seek(int sid, int rank, int currentblocknr, sion_int64 posinblk)
Function to set the file pointer to a new position.
Definition: sion_common.c:698
#define SION_CURRENT_RANK
Definition: sion_const.h:65
#define SION_CURRENT_POS
Definition: sion_const.h:69