Changeset d409b8c for python/lib
- Timestamp:
- 05/02/19 12:12:31 (6 years ago)
- Branches:
- pympi
- Children:
- 45bb293
- Parents:
- 1d6ab66
- git-author:
- Thomas Uram <turam@…> (05/02/19 12:12:31)
- git-committer:
- Thomas Uram <turam@…> (05/02/19 12:12:31)
- Location:
- python/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/lib/gio.cxx
rdd56945 rd409b8c 43 43 #include <iostream> 44 44 45 void read_gio_float(c har* file_name, char* var_name, float* data, int field_count){46 read_gio<float>( file_name,var_name,data,field_count);45 void read_gio_float(const MPI_Comm &C, char* file_name, char* var_name, float* data, int field_count){ 46 read_gio<float>(C, file_name,var_name,data,field_count); 47 47 } 48 void read_gio_double(c har* file_name, char* var_name, double* data, int field_count){49 read_gio<double>( file_name,var_name,data,field_count);48 void read_gio_double(const MPI_Comm &C, char* file_name, char* var_name, double* data, int field_count){ 49 read_gio<double>(C, file_name,var_name,data,field_count); 50 50 } 51 void read_gio_uint16(c har* file_name, char* var_name, uint16_t* data, int field_count){52 read_gio<uint16_t>( file_name,var_name,data,field_count);51 void read_gio_uint16(const MPI_Comm &C, char* file_name, char* var_name, uint16_t* data, int field_count){ 52 read_gio<uint16_t>(C, file_name,var_name,data,field_count); 53 53 } 54 void read_gio_int32(c har* file_name, char* var_name, int* data, int field_count){55 read_gio<int>( file_name,var_name,data,field_count);54 void read_gio_int32(const MPI_Comm &C, char* file_name, char* var_name, int* data, int field_count){ 55 read_gio<int>(C, file_name,var_name,data,field_count); 56 56 } 57 void read_gio_int64(c har* file_name, char* var_name, int64_t* data, int field_count){58 read_gio<int64_t>( file_name,var_name,data,field_count);57 void read_gio_int64(const MPI_Comm &C, char* file_name, char* var_name, int64_t* data, int field_count){ 58 read_gio<int64_t>(C, file_name,var_name,data,field_count); 59 59 } 60 60 61 int64_t get_elem_num(c har* file_name){62 gio::GenericIO reader( file_name);61 int64_t get_elem_num(const MPI_Comm &C, char* file_name){ 62 gio::GenericIO reader(C, file_name); 63 63 reader.openAndReadHeader(gio::GenericIO::MismatchAllowed); 64 64 int num_ranks = reader.readNRanks(); … … 70 70 } 71 71 72 var_type get_variable_type(c har* file_name,char* var_name){73 gio::GenericIO reader( file_name);72 var_type get_variable_type(const MPI_Comm &C, char* file_name,char* var_name){ 73 gio::GenericIO reader(C, file_name); 74 74 std::vector<gio::GenericIO::VariableInfo> VI; 75 75 reader.openAndReadHeader(gio::GenericIO::MismatchAllowed); … … 98 98 } 99 99 100 int get_variable_field_count(c har* file_name,char* var_name){101 gio::GenericIO reader( file_name);100 int get_variable_field_count(const MPI_Comm &C, char* file_name,char* var_name){ 101 gio::GenericIO reader(C, file_name); 102 102 std::vector<gio::GenericIO::VariableInfo> VI; 103 103 reader.openAndReadHeader(gio::GenericIO::MismatchAllowed); … … 114 114 } 115 115 116 extern "C" void inspect_gio(char* file_name){ 117 int64_t size = get_elem_num(file_name); 118 gio::GenericIO reader(file_name); 116 #ifndef GENERICIO_NO_MPI 117 extern "C" void inspect_gio(const MPI_Comm &C, char* file_name){ 118 gio::GenericIO reader(C, file_name); 119 #else 120 extern "C" void inspect_gio(const MPI_Comm &C, char* file_name){ 121 gio::GenericIO reader(C, file_name); 122 #endif 123 int64_t size = get_elem_num(C,file_name); 119 124 std::vector<gio::GenericIO::VariableInfo> VI; 120 125 reader.openAndReadHeader(gio::GenericIO::MismatchAllowed); -
python/lib/gio.h
rdd56945 rd409b8c 46 46 47 47 template <class T> 48 #ifndef GENERICIO_NO_MPI 49 void read_gio(const MPI_Comm &C, char* file_name, std::string var_name, T*& data, int field_count){ 50 gio::GenericIO reader(C, file_name); 51 #else 48 52 void read_gio(char* file_name, std::string var_name, T*& data, int field_count){ 49 53 gio::GenericIO reader(file_name); 54 #endif 50 55 reader.openAndReadHeader(gio::GenericIO::MismatchAllowed); 51 56 int num_ranks = reader.readNRanks(); … … 71 76 extern "C" int64_t get_elem_num(char* file_name); 72 77 73 extern "C" void read_gio_float (c har* file_name, char* var_name, float* data, int field_count);74 extern "C" void read_gio_double(c har* file_name, char* var_name, double* data, int field_count);75 extern "C" void read_gio_uint16 (c har* file_name, char* var_name, uint16_t* data, int field_count);76 extern "C" void read_gio_int32 (c har* file_name, char* var_name, int* data, int field_count);77 extern "C" void read_gio_int64 (c har* file_name, char* var_name, int64_t* data, int field_count);78 extern "C" void read_gio_float (const MPI_Comm &C, char* file_name, char* var_name, float* data, int field_count); 79 extern "C" void read_gio_double(const MPI_Comm &C, char* file_name, char* var_name, double* data, int field_count); 80 extern "C" void read_gio_uint16 (const MPI_Comm &C, char* file_name, char* var_name, uint16_t* data, int field_count); 81 extern "C" void read_gio_int32 (const MPI_Comm &C, char* file_name, char* var_name, int* data, int field_count); 82 extern "C" void read_gio_int64 (const MPI_Comm &C, char* file_name, char* var_name, int64_t* data, int field_count); 78 83 enum var_type{ 79 84 float_type=0, … … 87 92 extern "C" var_type get_variable_type(char* file_name,char* var_name); 88 93 extern "C" int get_variable_field_count(char* file_name,char* var_name); 89 extern "C" void inspect_gio(c har* file_name);94 extern "C" void inspect_gio(const MPI_Comm &C, char* file_name);
Note: See TracChangeset
for help on using the changeset viewer.