Changeset 271
- Timestamp:
- 09/14/11 10:26:16 (13 years ago)
- Location:
- XMLIO_V2/dev/dev_rv/src/xmlio
- Files:
-
- 1 deleted
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template_impl.hpp
r201 r271 60 60 { 61 61 if (SuperClass::isEmpty()) 62 { 62 63 ERROR("T CAttributeTemplate<T>::getValue(void) const", 63 64 << "[ id = " << this->getId() << "]" 64 65 << " L'attribut est requis mais n'est pas défini !"); 66 } 65 67 return (SuperClass::getValue<T>()); 66 68 } -
XMLIO_V2/dev/dev_rv/src/xmlio/buffer_impl.hpp
r198 r271 8 8 /// ////////////////// Définitions (inline) /////////////////// /// 9 9 10 #define DATA_HEADER_SIZE sizeof(CBuffer DataType) + 2 * sizeof(StdSize) + sizeof(bool)10 #define DATA_HEADER_SIZE sizeof(CBuffer::CBufferDataType) + 2 * sizeof(StdSize) + sizeof(bool) 11 11 12 12 template <class T> -
XMLIO_V2/dev/dev_rv/src/xmlio/config/context_attribute.conf
r213 r271 2 2 DECLARE_ATTRIBUTE(StdString, start_date) 3 3 4 DECLARE_ATTRIBUTE(StdString, output_dir) 4 DECLARE_ATTRIBUTE(StdString, output_dir) 5 -
XMLIO_V2/dev/dev_rv/src/xmlio/config/var_attribute.conf
r152 r271 1 1 DECLARE_ATTRIBUTE(StdString, type) -
XMLIO_V2/dev/dev_rv/src/xmlio/data_treatment.hpp
r267 r271 125 125 std::vector<boost::shared_ptr<CField> >::const_iterator 126 126 it = refField.begin(), end = refField.end(); 127 // std::cout << "nb :" << refField.size() << std::endl;128 127 for (; it != end; it++) 129 128 { 130 129 boost::shared_ptr<CField> field = *it; 131 130 boost::shared_ptr<CFile> file = field->getRelFile(); 132 // std::cout << ">> " << fieldId << ", " << file->getId() << std::endl;133 131 if (field->updateData(currDate, timestep, data)) 134 132 { -
XMLIO_V2/dev/dev_rv/src/xmlio/fortran/icdata.cpp
r270 r271 26 26 // -------------------- Traitement des données ------------------------------ 27 27 28 void xios_dtreatment_start(XContextPtr * context_hdl, XFileType filetype, int comm_client_server, int comm_server) 29 { 30 28 void xios_dtreatment_start(XContextPtr context_hdl, XFileType filetype, int comm_client_server, int comm_server) 29 { 30 using namespace xmlioserver::tree; 31 using namespace xmlioserver; 32 try 33 { 34 boost::shared_ptr<CContext> context = 35 CObjectFactory::GetObject<CContext>(context_hdl); 36 StdOStringStream oss; 37 oss << StdString("def_client_next.") 38 << CMPIManager::GetCommRank(CMPIManager::GetCommWorld()); 39 CTreeManager::PrintTreeToFile(oss.str()); 40 oss.str(""); 41 42 boost::shared_ptr<CDataTreatment> dt(new CDataTreatment (context)); 43 context->setDataTreatment(dt); 44 45 oss << StdString("def_client_end.") 46 << CMPIManager::GetCommRank(CMPIManager::GetCommWorld()); 47 CTreeManager::PrintTreeToFile(oss.str()); 48 49 if ((comm_client_server != -1)) 50 { 51 MPI_Request request = 0; 52 StdOStringStream ostrs; 53 if (CMPIManager::GetCommRank(comm_client_server) == 1) 54 { 55 CTreeManager::ToBinary(ostrs); 56 CLinearBuffer lbuffer(ostrs.str().size()+13); 57 lbuffer.appendString(ostrs.str()); 58 CMPIManager::SendLinearBuffer(comm_client_server, 0, lbuffer, request); 59 CMPIManager::Wait(request); // Pas encore en mode RPC 60 } 61 else 62 { 63 CTreeManager::DomainsToBinary(ostrs); 64 CLinearBuffer lbuffer(ostrs.str().size()+13); 65 lbuffer.appendString(ostrs.str()); 66 CMPIManager::SendLinearBuffer(comm_client_server, 0, lbuffer, request); 67 CMPIManager::Wait(request); // Pas encore en mode RPC 68 } 69 } 70 else 71 { 72 dt->createDataOutput<CNc4DataOutput>(); 73 } 74 } 75 catch (CException & exc) 76 { 77 std::cerr << exc.getMessage() << std::endl; 78 exit (EXIT_FAILURE); 79 } 31 80 } 32 81 33 82 void xios_dtreatment_end(void) 34 83 { 35 84 try 85 { 86 CMPIManager::Finalize(); 87 } 88 catch (CException & exc) 89 { 90 std::cerr << exc.getMessage() << std::endl; 91 exit (EXIT_FAILURE); 92 } 93 } 94 95 // ---------------------- Initialisation du serveur ------------------------- 96 97 void xios_init_ioserver(MPIComm * comm_client) 98 { 99 try 100 { 101 MPIComm comm_client_server, comm_server; 102 CMPIManager::Initialise(NULL, NULL); 103 CMPIManager::DispatchClient(false, *comm_client, comm_client_server, comm_server); 104 } 105 catch (CException & exc) 106 { 107 std::cerr << exc.getMessage() << std::endl; 108 exit (EXIT_FAILURE); 109 } 36 110 } 37 111 … … 40 114 void xios_write_data_k81(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize) 41 115 { 42 std::string fieldid_str; 43 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 44 45 boost::const_multi_array_ref<double, 1> array_(data_k8, 46 boost::extents [data_Xsize], 47 boost::fortran_storage_order()); 116 std::string fieldid_str; 117 boost::shared_ptr<CContext> context = 118 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 119 boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment(); 120 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 121 122 // boost::const_multi_array_ref<double, 1> array_(data_k8, 123 // boost::extents [data_Xsize], 124 // boost::fortran_storage_order()); 125 ARRAY(double, 1) data(new CArray<double, 1>(boost::extents [data_Xsize])); 126 std::copy(data_k8, &(data_k8[data->num_elements()]), data->data()); 127 dtreat->write_data(fieldid_str, data); 48 128 } 49 129 50 130 void xios_write_data_k82(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize, int data_Ysize) 51 131 { 52 std::string fieldid_str; 132 std::string fieldid_str; 133 boost::shared_ptr<CContext> context = 134 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 135 boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment(); 53 136 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 54 137 55 boost::const_multi_array_ref<double, 2> array_(data_k8, 56 boost::extents [data_Xsize][data_Ysize], 57 boost::fortran_storage_order()); 138 // boost::const_multi_array_ref<double, 2> array_(data_k8, 139 // boost::extents [data_Xsize][data_Ysize], 140 // boost::fortran_storage_order()); 141 ARRAY(double, 2) data(new CArray<double, 2>(boost::extents [data_Xsize][data_Ysize])); 142 std::copy(data_k8, &(data_k8[data->num_elements()]), data->data()); 143 dtreat->write_data(fieldid_str, data); 58 144 } 59 145 60 146 void xios_write_data_k83(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize, int data_Ysize, int data_Zsize) 61 147 { 62 std::string fieldid_str; 63 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 64 65 boost::const_multi_array_ref<double, 3> array_(data_k8, 66 boost::extents [data_Xsize][data_Ysize][data_Zsize], 67 boost::fortran_storage_order()); 148 std::string fieldid_str; 149 boost::shared_ptr<CContext> context = 150 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 151 boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment(); 152 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 153 154 // boost::const_multi_array_ref<double, 3> array_(data_k8, 155 // boost::extents [data_Xsize][data_Ysize][data_Zsize], 156 // boost::fortran_storage_order()); 157 ARRAY(double, 3) data(new CArray<double, 3>(boost::extents [data_Xsize][data_Ysize][data_Zsize])); 158 std::copy(data_k8, &(data_k8[data->num_elements()]), data->data()); 159 dtreat->write_data(fieldid_str, data); 68 160 } 69 161 70 162 void xios_write_data_k41(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize) 71 163 { 72 std::string fieldid_str; 73 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 74 75 boost::const_multi_array_ref<float, 1> array_(data_k4, 76 boost::extents [data_Xsize], 77 boost::fortran_storage_order()); 164 std::string fieldid_str; 165 boost::shared_ptr<CContext> context = 166 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 167 boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment(); 168 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 169 170 // boost::const_multi_array_ref<float, 1> array_(data_k4, 171 // boost::extents [data_Xsize], 172 // boost::fortran_storage_order()); 173 ARRAY(float, 1) data(new CArray<float, 1>(boost::extents [data_Xsize])); 174 std::copy(data_k4, &(data_k4[data->num_elements()]), data->data()); 175 dtreat->write_data(fieldid_str, data); 78 176 } 79 177 80 178 void xios_write_data_k42(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize, int data_Ysize) 81 179 { 82 std::string fieldid_str; 83 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 84 85 boost::const_multi_array_ref<float, 2> array_(data_k4, 86 boost::extents [data_Xsize][data_Ysize], 87 boost::fortran_storage_order()); 180 std::string fieldid_str; 181 boost::shared_ptr<CContext> context = 182 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 183 boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment(); 184 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 185 186 // boost::const_multi_array_ref<float, 2> array_(data_k4, 187 // boost::extents [data_Xsize][data_Ysize], 188 // boost::fortran_storage_order()); 189 ARRAY(float, 2) data(new CArray<float, 2>(boost::extents [data_Xsize][data_Ysize])); 190 std::copy(data_k4, &(data_k4[data->num_elements()]), data->data()); 191 dtreat->write_data(fieldid_str, data); 88 192 } 89 193 90 194 void xios_write_data_k43(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize, int data_Ysize, int data_Zsize) 91 195 { 92 std::string fieldid_str; 93 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 94 95 boost::const_multi_array_ref<float, 3> array_(data_k4, 96 boost::extents [data_Xsize][data_Ysize][data_Zsize], 97 boost::fortran_storage_order()); 196 std::string fieldid_str; 197 boost::shared_ptr<CContext> context = 198 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 199 boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment(); 200 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 201 202 // boost::const_multi_array_ref<float, 3> array_(data_k4, 203 // boost::extents [data_Xsize][data_Ysize][data_Zsize], 204 // boost::fortran_storage_order()); 205 ARRAY(float, 3) data(new CArray<float, 3>(boost::extents [data_Xsize][data_Ysize][data_Zsize])); 206 std::copy(data_k4, &(data_k4[data->num_elements()]), data->data()); 207 dtreat->write_data(fieldid_str, data); 98 208 } 99 209 -
XMLIO_V2/dev/dev_rv/src/xmlio/fortran/icfield.cpp
r270 r271 28 28 { 29 29 std::string name_str; 30 if (!cstr2string(name, name_size, name_str)) return; 30 if (!cstr2string(name, name_size, name_str)) return; 31 32 field_hdl->name.setValue(name_str); 31 33 } 32 34 … … 34 36 { 35 37 std::string standard_name_str; 36 if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return; 38 if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return; 39 40 field_hdl->standard_name.setValue(standard_name_str); 37 41 } 38 42 … … 40 44 { 41 45 std::string long_name_str; 42 if (!cstr2string(long_name, long_name_size, long_name_str)) return; 46 if (!cstr2string(long_name, long_name_size, long_name_str)) return; 47 48 field_hdl->long_name.setValue(long_name_str); 43 49 } 44 50 … … 46 52 { 47 53 std::string unit_str; 48 if (!cstr2string(unit, unit_size, unit_str)) return; 54 if (!cstr2string(unit, unit_size, unit_str)) return; 55 56 field_hdl->unit.setValue(unit_str); 49 57 } 50 58 … … 52 60 { 53 61 std::string operation_str; 54 if (!cstr2string(operation, operation_size, operation_str)) return; 62 if (!cstr2string(operation, operation_size, operation_str)) return; 63 64 field_hdl->operation.setValue(operation_str); 55 65 } 56 66 … … 58 68 { 59 69 std::string freq_op_str; 60 if (!cstr2string(freq_op, freq_op_size, freq_op_str)) return; 70 if (!cstr2string(freq_op, freq_op_size, freq_op_str)) return; 71 72 field_hdl->freq_op.setValue(freq_op_str); 61 73 } 62 74 63 75 void xios_set_field_level(XFieldPtr field_hdl, int level) 64 76 { 65 77 field_hdl->level.setValue(level); 66 78 } 67 79 68 80 void xios_set_field_prec(XFieldPtr field_hdl, int prec) 69 81 { 70 82 field_hdl->prec.setValue(prec); 71 83 } 72 84 73 85 void xios_set_field_enabled(XFieldPtr field_hdl, bool enabled) 74 86 { 75 87 field_hdl->enabled.setValue(enabled); 76 88 } 77 89 … … 79 91 { 80 92 std::string domain_ref_str; 81 if (!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return; 93 if (!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return; 94 95 field_hdl->domain_ref.setValue(domain_ref_str); 82 96 } 83 97 … … 85 99 { 86 100 std::string axis_ref_str; 87 if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return; 101 if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return; 102 103 field_hdl->axis_ref.setValue(axis_ref_str); 88 104 } 89 105 … … 91 107 { 92 108 std::string grid_ref_str; 93 if (!cstr2string(grid_ref, grid_ref_size, grid_ref_str)) return; 109 if (!cstr2string(grid_ref, grid_ref_size, grid_ref_str)) return; 110 111 field_hdl->grid_ref.setValue(grid_ref_str); 94 112 } 95 113 … … 97 115 { 98 116 std::string field_ref_str; 99 if (!cstr2string(field_ref, field_ref_size, field_ref_str)) return; 117 if (!cstr2string(field_ref, field_ref_size, field_ref_str)) return; 118 119 field_hdl->field_ref.setValue(field_ref_str); 100 120 } 101 121 102 122 void xios_set_field_default_value(XFieldPtr field_hdl, double default_value) 103 123 { 104 124 field_hdl->default_value.setValue(default_value); 105 125 } 106 126 … … 110 130 { 111 131 std::string name_str; 112 if (!cstr2string(name, name_size, name_str)) return; 132 if (!cstr2string(name, name_size, name_str)) return; 133 134 fieldgroup_hdl->name.setValue(name_str); 113 135 } 114 136 … … 117 139 std::string standard_name_str; 118 140 if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return; 141 142 fieldgroup_hdl->standard_name.setValue(standard_name_str); 119 143 } 120 144 … … 123 147 std::string long_name_str; 124 148 if (!cstr2string(long_name, long_name_size, long_name_str)) return; 149 150 fieldgroup_hdl->long_name.setValue(long_name_str); 125 151 } 126 152 … … 129 155 std::string unit_str; 130 156 if (!cstr2string(unit, unit_size, unit_str)) return; 157 158 fieldgroup_hdl->unit.setValue(unit_str); 131 159 } 132 160 … … 134 162 { 135 163 std::string operation_str; 136 if (!cstr2string(operation, operation_size, operation_str)) return; 164 if (!cstr2string(operation, operation_size, operation_str)) return; 165 166 fieldgroup_hdl->operation.setValue(operation_str); 137 167 } 138 168 … … 141 171 std::string freq_op_str; 142 172 if (!cstr2string(freq_op, freq_op_size, freq_op_str)) return; 173 174 fieldgroup_hdl->freq_op.setValue(freq_op_str); 143 175 } 144 176 145 177 void xios_set_fieldgroup_level(XFieldGroupPtr fieldgroup_hdl, int level) 146 178 { 147 179 fieldgroup_hdl->level.setValue(level); 148 180 } 149 181 150 182 void xios_set_fieldgroup_prec(XFieldGroupPtr fieldgroup_hdl, int prec) 151 183 { 152 184 fieldgroup_hdl->prec.setValue(prec); 153 185 } 154 186 155 187 void xios_set_fieldgroup_enabled(XFieldGroupPtr fieldgroup_hdl, bool enabled) 156 188 { 157 189 fieldgroup_hdl->enabled.setValue(enabled); 158 190 } 159 191 … … 161 193 { 162 194 std::string domain_ref_str; 163 if (!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return; 195 if (!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return; 196 197 fieldgroup_hdl->domain_ref.setValue(domain_ref_str); 164 198 } 165 199 … … 167 201 { 168 202 std::string axis_ref_str; 169 if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return; 203 if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return; 204 205 fieldgroup_hdl->axis_ref.setValue(axis_ref_str); 170 206 } 171 207 … … 174 210 std::string grid_ref_str; 175 211 if (!cstr2string(grid_ref, grid_ref_size, grid_ref_str)) return; 212 213 fieldgroup_hdl->grid_ref.setValue(grid_ref_str); 176 214 } 177 215 … … 179 217 { 180 218 std::string field_ref_str; 181 if (!cstr2string(field_ref, field_ref_size, field_ref_str)) return; 219 if (!cstr2string(field_ref, field_ref_size, field_ref_str)) return; 220 221 fieldgroup_hdl->field_ref.setValue(field_ref_str); 182 222 } 183 223 184 224 void xios_set_fieldgroup_default_value(XFieldGroupPtr fieldgroup_hdl, double default_value) 185 225 { 186 226 fieldgroup_hdl->default_value.setValue(default_value); 187 227 } 188 228 … … 193 233 std::string id; 194 234 if (!cstr2string(_id, _id_len, id)) return; 235 236 *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CField>(id).get(); 195 237 } 196 238 … … 199 241 std::string id; 200 242 if (!cstr2string(_id, _id_len, id)) return; 243 244 *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CFieldGroup>(id).get(); 201 245 } 202 246 -
XMLIO_V2/dev/dev_rv/src/xmlio/fortran/icfile.cpp
r270 r271 28 28 { 29 29 std::string name_str; 30 if (!cstr2string(name, name_size, name_str)) return; 30 if (!cstr2string(name, name_size, name_str)) return; 31 32 file_hdl->name.setValue(name_str); 31 33 } 32 34 … … 34 36 { 35 37 std::string description_str; 36 if (!cstr2string(description, description_size, description_str)) return; 38 if (!cstr2string(description, description_size, description_str)) return; 39 40 file_hdl->description.setValue(description_str); 37 41 } 38 42 … … 40 44 { 41 45 std::string output_freq_str; 42 if (!cstr2string(output_freq, output_freq_size, output_freq_str)) return; 46 if (!cstr2string(output_freq, output_freq_size, output_freq_str)) return; 47 48 file_hdl->output_freq.setValue(output_freq_str); 43 49 } 44 50 45 51 void xios_set_file_output_level(XFilePtr file_hdl, int output_level) 46 52 { 47 53 file_hdl->output_level.setValue(output_level); 48 54 } 49 55 50 56 void xios_set_file_enabled(XFilePtr file_hdl, bool enabled) 51 57 { 52 58 file_hdl->enabled.setValue(enabled); 53 59 } 54 60 … … 58 64 { 59 65 std::string name_str; 60 if (!cstr2string(name, name_size, name_str)) return; 66 if (!cstr2string(name, name_size, name_str)) return; 67 if (!cstr2string(name, name_size, name_str)) return; 68 69 filegroup_hdl->name.setValue(name_str); 61 70 } 62 71 … … 64 73 { 65 74 std::string description_str; 66 if (!cstr2string(description, description_size, description_str)) return; 75 if (!cstr2string(description, description_size, description_str)) return; 76 77 filegroup_hdl->description.setValue(description_str); 67 78 } 68 79 … … 70 81 { 71 82 std::string output_freq_str; 72 if (!cstr2string(output_freq, output_freq_size, output_freq_str)) return; 83 if (!cstr2string(output_freq, output_freq_size, output_freq_str)) return; 84 85 filegroup_hdl->output_freq.setValue(output_freq_str); 73 86 } 74 87 75 88 void xios_set_filegroup_output_level(XFileGroupPtr filegroup_hdl, int output_level) 76 89 { 77 90 filegroup_hdl->output_level.setValue(output_level); 78 91 } 79 92 80 93 void xios_set_filegroup_enabled(XFileGroupPtr filegroup_hdl, bool enabled) 81 94 { 82 95 filegroup_hdl->enabled.setValue(enabled); 83 96 } 84 97 … … 89 102 std::string id; 90 103 if (!cstr2string(_id, _id_len, id)) return; 104 105 *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CFile>(id).get(); 91 106 } 92 107 … … 95 110 std::string id; 96 111 if (!cstr2string(_id, _id_len, id)) return; 112 113 *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CFileGroup>(id).get(); 97 114 } 98 115 -
XMLIO_V2/dev/dev_rv/src/xmlio/fortran/icgrid.cpp
r270 r271 28 28 { 29 29 std::string name_str; 30 if (!cstr2string(name, name_size, name_str)) return; 30 if (!cstr2string(name, name_size, name_str)) return; 31 32 grid_hdl->name.setValue(name_str); 31 33 } 32 34 … … 35 37 std::string description_str; 36 38 if (!cstr2string(description, description_size, description_str)) return; 39 40 grid_hdl->description.setValue(description_str); 37 41 } 38 42 … … 40 44 { 41 45 std::string domain_ref_str; 42 if (!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return; 46 if (!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return; 47 48 grid_hdl->domain_ref.setValue(domain_ref_str); 43 49 } 44 50 … … 46 52 { 47 53 std::string axis_ref_str; 48 if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return; 54 if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return; 55 56 grid_hdl->axis_ref.setValue(axis_ref_str); 49 57 } 50 58 … … 54 62 { 55 63 std::string name_str; 56 if (!cstr2string(name, name_size, name_str)) return; 64 if (!cstr2string(name, name_size, name_str)) return; 65 66 gridgroup_hdl->name.setValue(name_str); 57 67 } 58 68 … … 61 71 std::string description_str; 62 72 if (!cstr2string(description, description_size, description_str)) return; 73 74 gridgroup_hdl->description.setValue(description_str); 63 75 } 64 76 … … 66 78 { 67 79 std::string domain_ref_str; 68 if (!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return; 80 if (!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return; 81 82 gridgroup_hdl->domain_ref.setValue(domain_ref_str); 69 83 } 70 84 … … 72 86 { 73 87 std::string axis_ref_str; 74 if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return; 88 if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return; 89 90 gridgroup_hdl->axis_ref.setValue(axis_ref_str); 75 91 } 76 92 … … 81 97 std::string id; 82 98 if (!cstr2string(_id, _id_len, id)) return; 99 100 *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CGrid>(id).get(); 83 101 } 84 102 … … 87 105 std::string id; 88 106 if (!cstr2string(_id, _id_len, id)) return; 107 108 *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CGridGroup>(id).get(); 89 109 } 90 91 110 92 111 } // extern "C" -
XMLIO_V2/dev/dev_rv/src/xmlio/fortran/icxml_tree.cpp
r270 r271 39 39 // ----------------------- Ajout d'enfant à un parent ----------------------- 40 40 41 void xios_xml_tree_add_field(XFieldGroupPtr parent_, XFieldPtr * child_, const char * child_id, int child_id_size) 42 { 43 std::string child_id_str; 44 if (!cstr2string(child_id, child_id_size, child_id_str)) return; 45 } 46 47 void xios_xml_tree_add_grid(XGridGroupPtr parent_, XGridPtr * child_, const char * child_id, int child_id_size) 48 { 49 std::string child_id_str; 50 if (!cstr2string(child_id, child_id_size, child_id_str)) return; 51 } 52 53 void xios_xml_tree_add_file(XFileGroupPtr parent_, XFilePtr * child_, const char * child_id, int child_id_size) 54 { 55 std::string child_id_str; 56 if (!cstr2string(child_id, child_id_size, child_id_str)) return; 57 } 58 59 void xios_xml_tree_add_axis(XAxisGroupPtr parent_, XAxisPtr * child_, const char * child_id, int child_id_size) 60 { 61 std::string child_id_str; 62 if (!cstr2string(child_id, child_id_size, child_id_str)) return; 63 } 64 65 void xios_xml_tree_add_domain(XDomainGroupPtr parent_, XDomainPtr * child_, const char * child_id, int child_id_size) 66 { 67 std::string child_id_str; 68 if (!cstr2string(child_id, child_id_size, child_id_str)) return; 69 } 70 71 72 void xios_xml_tree_add_fieldtofile(XFilePtr parent_, XFieldPtr * child_, const char * child_id, int child_id_size) 73 { 74 std::string child_id_str; 75 if (!cstr2string(child_id, child_id_size, child_id_str)) return; 76 } 77 78 void xios_xml_tree_add_fieldgrouptofile(XFilePtr parent_, XFieldGroupPtr * child_, const char * child_id, int child_id_size) 79 { 80 std::string child_id_str; 81 if (!cstr2string(child_id, child_id_size, child_id_str)) return; 41 void xios_xml_tree_add_field 42 (XFieldGroupPtr parent_, XFieldPtr * child_, const char * child_id, int child_id_size) 43 { 44 std::string child_id_str; 45 boost::shared_ptr<xmlioserver::tree::CFieldGroup> fieldgroup = 46 xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CFieldGroup>(parent_); 47 48 if (cstr2string(child_id, child_id_size, child_id_str)) 49 *child_ = xmlioserver::CGroupFactory::CreateChild(fieldgroup, child_id_str).get(); 50 else 51 *child_ = xmlioserver::CGroupFactory::CreateChild(fieldgroup).get(); 52 } 53 54 void xios_xml_tree_add_grid 55 (XGridGroupPtr parent_, XGridPtr * child_, const char * child_id, int child_id_size) 56 { 57 std::string child_id_str; 58 boost::shared_ptr<xmlioserver::tree::CGridGroup> gridgroup = 59 xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CGridGroup>(parent_); 60 61 if (cstr2string(child_id, child_id_size, child_id_str)) 62 *child_ = xmlioserver::CGroupFactory::CreateChild(gridgroup, child_id_str).get(); 63 else 64 *child_ = xmlioserver::CGroupFactory::CreateChild(gridgroup).get(); 65 } 66 67 void xios_xml_tree_add_file 68 (XFileGroupPtr parent_, XFilePtr * child_, const char * child_id, int child_id_size) 69 { 70 std::string child_id_str; 71 boost::shared_ptr<xmlioserver::tree::CFileGroup> filegroup = 72 xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CFileGroup>(parent_); 73 74 if (cstr2string(child_id, child_id_size, child_id_str)) 75 *child_ = xmlioserver::CGroupFactory::CreateChild(filegroup, child_id_str).get(); 76 else 77 *child_ = xmlioserver::CGroupFactory::CreateChild(filegroup).get(); 78 } 79 80 void xios_xml_tree_add_axis 81 (XAxisGroupPtr parent_, XAxisPtr * child_, const char * child_id, int child_id_size) 82 { 83 std::string child_id_str; 84 boost::shared_ptr<xmlioserver::tree::CAxisGroup> axisgroup = 85 xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CAxisGroup>(parent_); 86 87 if (cstr2string(child_id, child_id_size, child_id_str)) 88 *child_ = xmlioserver::CGroupFactory::CreateChild(axisgroup, child_id_str).get(); 89 else 90 *child_ = xmlioserver::CGroupFactory::CreateChild(axisgroup).get(); 91 } 92 93 void xios_xml_tree_add_domain 94 (XDomainGroupPtr parent_, XDomainPtr * child_, const char * child_id, int child_id_size) 95 { 96 std::string child_id_str; 97 boost::shared_ptr<xmlioserver::tree::CDomainGroup> domaingroup = 98 xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CDomainGroup>(parent_); 99 100 if (cstr2string(child_id, child_id_size, child_id_str)) 101 *child_ = xmlioserver::CGroupFactory::CreateChild(domaingroup, child_id_str).get(); 102 else 103 *child_ = xmlioserver::CGroupFactory::CreateChild(domaingroup).get(); 104 } 105 106 void xios_xml_tree_add_fieldtofile 107 (XFilePtr parent_, XFieldPtr * child_, const char * child_id, int child_id_size) 108 { 109 std::string child_id_str; 110 boost::shared_ptr<xmlioserver::tree::CFile> file = 111 xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CFile>(parent_); 112 113 if (file->getVirtualFieldGroup().get() == 0 ) 114 file->setVirtualFieldGroup(file->getId()); 115 116 if (cstr2string(child_id, child_id_size, child_id_str)) 117 *child_ = xmlioserver::CGroupFactory::CreateChild(file->getVirtualFieldGroup(), child_id_str).get(); 118 else 119 *child_ = xmlioserver::CGroupFactory::CreateChild(file->getVirtualFieldGroup()).get(); 120 } 121 122 // ----------------------- Ajout de groupe à un parent ---------------------- 123 124 void xios_xml_tree_add_fieldgroup 125 (XFieldGroupPtr parent_, XFieldGroupPtr * child_, const char * child_id, int child_id_size) 126 { 127 std::string child_id_str; 128 boost::shared_ptr<xmlioserver::tree::CFieldGroup> fieldgroup = 129 xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CFieldGroup>(parent_); 130 131 if (cstr2string(child_id, child_id_size, child_id_str)) 132 *child_ = xmlioserver::CGroupFactory::CreateGroup(fieldgroup, child_id_str).get(); 133 else 134 *child_ = xmlioserver::CGroupFactory::CreateGroup(fieldgroup).get(); 135 } 136 137 void xios_xml_tree_add_gridgroup 138 (XGridGroupPtr parent_, XGridGroupPtr * child_, const char * child_id, int child_id_size) 139 { 140 std::string child_id_str; 141 boost::shared_ptr<xmlioserver::tree::CGridGroup> gridgroup = 142 xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CGridGroup>(parent_); 143 144 if (cstr2string(child_id, child_id_size, child_id_str)) 145 *child_ = xmlioserver::CGroupFactory::CreateGroup(gridgroup, child_id_str).get(); 146 else 147 *child_ = xmlioserver::CGroupFactory::CreateGroup(gridgroup).get(); 148 } 149 150 void xios_xml_tree_add_filegroup 151 (XFileGroupPtr parent_, XFileGroupPtr * child_, const char * child_id, int child_id_size) 152 { 153 std::string child_id_str; 154 boost::shared_ptr<xmlioserver::tree::CFileGroup> filegroup = 155 xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CFileGroup>(parent_); 156 157 if (cstr2string(child_id, child_id_size, child_id_str)) 158 *child_ = xmlioserver::CGroupFactory::CreateGroup(filegroup, child_id_str).get(); 159 else 160 *child_ = xmlioserver::CGroupFactory::CreateGroup(filegroup).get(); 161 } 162 163 void xios_xml_tree_add_axisgroup 164 (XAxisGroupPtr parent_, XAxisGroupPtr * child_, const char * child_id, int child_id_size) 165 { 166 std::string child_id_str; 167 boost::shared_ptr<xmlioserver::tree::CAxisGroup> axisgroup = 168 xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CAxisGroup>(parent_); 169 170 if (cstr2string(child_id, child_id_size, child_id_str)) 171 *child_ = xmlioserver::CGroupFactory::CreateGroup(axisgroup, child_id_str).get(); 172 else 173 *child_ = xmlioserver::CGroupFactory::CreateGroup(axisgroup).get(); 174 } 175 176 void xios_xml_tree_add_domaingroup 177 (XDomainGroupPtr parent_, XDomainGroupPtr * child_, const char * child_id, int child_id_size) 178 { 179 std::string child_id_str; 180 boost::shared_ptr<xmlioserver::tree::CDomainGroup> domaingroup = 181 xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CDomainGroup>(parent_); 182 183 if (cstr2string(child_id, child_id_size, child_id_str)) 184 *child_ = xmlioserver::CGroupFactory::CreateGroup(domaingroup, child_id_str).get(); 185 else 186 *child_ = xmlioserver::CGroupFactory::CreateGroup(domaingroup).get(); 187 } 188 189 void xios_xml_tree_add_fieldgrouptofile 190 (XFilePtr parent_, XFieldGroupPtr * child_, const char * child_id, int child_id_size) 191 { 192 std::string child_id_str; 193 boost::shared_ptr<xmlioserver::tree::CFile> file = 194 xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CFile>(parent_); 195 196 if (file->getVirtualFieldGroup().get() == 0 ) 197 file->setVirtualFieldGroup(file->getId()); 198 199 if (cstr2string(child_id, child_id_size, child_id_str)) 200 *child_ = xmlioserver::CGroupFactory::CreateGroup(file->getVirtualFieldGroup(), child_id_str).get(); 201 else 202 *child_ = xmlioserver::CGroupFactory::CreateGroup(file->getVirtualFieldGroup()).get(); 82 203 } 83 204 … … 87 208 void xios_xml_tree_show (const char * filename, int filename_size) 88 209 { 210 std::string filename_str; 211 try 212 { 213 if (cstr2string(filename, filename_size, filename_str)) 214 xmlioserver::CTreeManager::PrintTreeToFile(filename_str); 215 else 216 xmlioserver::CTreeManager::PrintTreeToStream(std::clog); 217 } 218 catch (xmlioserver::CException & exc) 219 { 220 std::cerr << exc.getMessage() << std::endl; 221 exit (EXIT_FAILURE); 222 } 223 } 224 225 226 // ----------------------- Parsing de document xml -------------------------- 227 228 void xios_xml_parse_file (const char * filename , int filename_size) 229 { 89 230 std::string filename_str; 90 if (!cstr2string(filename, filename_size, filename_str)) return; 91 } 92 93 94 // ----------------------- Parsing de document xml -------------------------- 95 96 void xios_xml_parse_file (const char * filename , int filename_size) 97 { 98 std::string filename_str; 99 if (!cstr2string(filename, filename_size, filename_str)) return; 231 if (!cstr2string(filename, filename_size, filename_str)) return; 232 233 try 234 { 235 xmlioserver::CTreeManager::ParseFile(filename_str); 236 } 237 catch (xmlioserver::CException & exc) 238 { 239 std::cerr << exc.getMessage() << std::endl; 240 exit (EXIT_FAILURE); 241 } 100 242 } 101 243 … … 103 245 { 104 246 std::string xmlcontent_str; 105 if (!cstr2string(xmlcontent, xmlcontent_size, xmlcontent_str)) return; 247 if (!cstr2string(xmlcontent, xmlcontent_size, xmlcontent_str)) return; 248 249 try 250 { 251 xmlioserver::CTreeManager::ParseString(xmlcontent_str); 252 } 253 catch (xmlioserver::CException & exc) 254 { 255 std::cerr << exc.getMessage() << std::endl; 256 exit (EXIT_FAILURE); 257 } 106 258 } 107 259 -
XMLIO_V2/dev/dev_rv/src/xmlio/fortran/idata.f90
r270 r271 4 4 5 5 INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 6 6 7 SUBROUTINE xios_init_ioserver(comm_client) BIND(C) 8 USE ISO_C_BINDING 9 INTEGER (kind = C_INT) :: comm_client 10 END SUBROUTINE xios_init_ioserver 11 7 12 SUBROUTINE xios_dtreatment_start(context_hdl, filetype, comm_client_server, comm_server) BIND(C) 8 13 USE ISO_C_BINDING … … 66 71 67 72 CONTAINS ! Fonctions disponibles pour les utilisateurs. 73 74 SUBROUTINE init_ioserver(comm_client) 75 INTEGER, INTENT(INOUT) :: comm_client 76 CALL xios_init_ioserver(comm_client) 77 END SUBROUTINE init_ioserver 68 78 69 79 SUBROUTINE dtreatment_start(context_hdl, filetype, comm_client_server, comm_server) -
XMLIO_V2/dev/dev_rv/src/xmlio/fortran/ixml_tree.f90
r270 r271 55 55 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id 56 56 INTEGER (kind = C_INT) , VALUE :: child_id_size 57 END SUBROUTINE xios_xml_tree_add_fieldtofile 57 END SUBROUTINE xios_xml_tree_add_fieldtofile 58 59 SUBROUTINE xios_xml_tree_add_fieldgroup(parent_, child_, child_id, child_id_size) BIND(C) 60 USE ISO_C_BINDING 61 INTEGER (kind = C_INTPTR_T), VALUE :: parent_ 62 INTEGER (kind = C_INTPTR_T) :: child_ 63 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id 64 INTEGER (kind = C_INT) , VALUE :: child_id_size 65 END SUBROUTINE xios_xml_tree_add_fieldgroup 66 67 SUBROUTINE xios_xml_tree_add_gridgroup(parent_, child_, child_id, child_id_size) BIND(C) 68 USE ISO_C_BINDING 69 INTEGER (kind = C_INTPTR_T), VALUE :: parent_ 70 INTEGER (kind = C_INTPTR_T) :: child_ 71 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id 72 INTEGER (kind = C_INT) , VALUE :: child_id_size 73 END SUBROUTINE xios_xml_tree_add_gridgroup 74 75 SUBROUTINE xios_xml_tree_add_filegroup(parent_, child_, child_id, child_id_size) BIND(C) 76 USE ISO_C_BINDING 77 INTEGER (kind = C_INTPTR_T), VALUE :: parent_ 78 INTEGER (kind = C_INTPTR_T) :: child_ 79 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id 80 INTEGER (kind = C_INT) , VALUE :: child_id_size 81 END SUBROUTINE xios_xml_tree_add_filegroup 82 83 SUBROUTINE xios_xml_tree_add_axisgroup(parent_, child_, child_id, child_id_size) BIND(C) 84 USE ISO_C_BINDING 85 INTEGER (kind = C_INTPTR_T), VALUE :: parent_ 86 INTEGER (kind = C_INTPTR_T) :: child_ 87 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id 88 INTEGER (kind = C_INT) , VALUE :: child_id_size 89 END SUBROUTINE xios_xml_tree_add_axisgroup 90 91 SUBROUTINE xios_xml_tree_add_domaingroup(parent_, child_, child_id, child_id_size) BIND(C) 92 USE ISO_C_BINDING 93 INTEGER (kind = C_INTPTR_T), VALUE :: parent_ 94 INTEGER (kind = C_INTPTR_T) :: child_ 95 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id 96 INTEGER (kind = C_INT) , VALUE :: child_id_size 97 END SUBROUTINE xios_xml_tree_add_domaingroup 58 98 59 99 SUBROUTINE xios_xml_tree_add_fieldgrouptofile(parent_, child_, child_id, child_id_size) BIND(C) … … 87 127 !---------------------------------------------------------------------------- 88 128 INTERFACE xml_tree_add 89 MODULE PROCEDURE xml_tree_add_axis, xml_tree_add_file, xml_tree_add_grid, & 90 xml_tree_add_field, xml_tree_add_domain, & 129 MODULE PROCEDURE xml_tree_add_axis, xml_tree_add_axisgroup, & 130 xml_tree_add_file, xml_tree_add_filegroup, & 131 xml_tree_add_grid, xml_tree_add_gridgroup, & 132 xml_tree_add_field, xml_tree_add_fieldgroup, & 133 xml_tree_add_domain, xml_tree_add_domaingroup, & 91 134 xml_tree_add_fieldgrouptofile, xml_tree_add_fieldtofile 92 135 END INTERFACE … … 160 203 END IF 161 204 END SUBROUTINE xml_tree_add_fieldtofile 205 206 SUBROUTINE xml_tree_add_axisgroup(parent_hdl, child_hdl, child_id) 207 TYPE(XAxisGroupHandle) , INTENT(IN) :: parent_hdl 208 TYPE(XAxisGroupHandle) , INTENT(OUT):: child_hdl 209 CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id 210 IF (PRESENT(child_id)) THEN 211 CALL xios_xml_tree_add_axisgroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) 212 ELSE 213 CALL xios_xml_tree_add_axisgroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) 214 END IF 215 END SUBROUTINE xml_tree_add_axisgroup 216 217 SUBROUTINE xml_tree_add_filegroup(parent_hdl, child_hdl, child_id) 218 TYPE(XFileGroupHandle) , INTENT(IN) :: parent_hdl 219 TYPE(XFileGroupHandle) , INTENT(OUT):: child_hdl 220 CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id 221 IF (PRESENT(child_id)) THEN 222 CALL xios_xml_tree_add_filegroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) 223 ELSE 224 CALL xios_xml_tree_add_filegroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) 225 END IF 226 END SUBROUTINE xml_tree_add_filegroup 227 228 SUBROUTINE xml_tree_add_gridgroup(parent_hdl, child_hdl, child_id) 229 TYPE(XGridGroupHandle) , INTENT(IN) :: parent_hdl 230 TYPE(XGridGroupHandle) , INTENT(OUT):: child_hdl 231 CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id 232 IF (PRESENT(child_id)) THEN 233 CALL xios_xml_tree_add_gridgroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) 234 ELSE 235 CALL xios_xml_tree_add_gridgroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) 236 END IF 237 END SUBROUTINE xml_tree_add_gridgroup 238 239 SUBROUTINE xml_tree_add_fieldgroup(parent_hdl, child_hdl, child_id) 240 TYPE(XFieldGroupHandle) , INTENT(IN) :: parent_hdl 241 TYPE(XFieldGroupHandle) , INTENT(OUT):: child_hdl 242 CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id 243 IF (PRESENT(child_id)) THEN 244 CALL xios_xml_tree_add_fieldgroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) 245 ELSE 246 CALL xios_xml_tree_add_fieldgroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) 247 END IF 248 END SUBROUTINE xml_tree_add_fieldgroup 249 250 SUBROUTINE xml_tree_add_domaingroup(parent_hdl, child_hdl, child_id) 251 TYPE(XDomainGroupHandle) , INTENT(IN) :: parent_hdl 252 TYPE(XDomainGroupHandle) , INTENT(OUT):: child_hdl 253 CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id 254 IF (PRESENT(child_id)) THEN 255 CALL xios_xml_tree_add_domaingroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) 256 ELSE 257 CALL xios_xml_tree_add_domaingroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) 258 END IF 259 END SUBROUTINE xml_tree_add_domaingroup 162 260 163 261 SUBROUTINE xml_tree_add_fieldgrouptofile(parent_hdl, child_hdl, child_id) -
XMLIO_V2/dev/dev_rv/src/xmlio/main_server.cpp
r269 r271 15 15 { 16 16 MPIComm comm_client, comm_client_server, comm_server; 17 //comm::CMPIManager::Initialise(&argc, &argv); // < seulement en mode connecté17 comm::CMPIManager::Initialise(&argc, &argv); // < seulement en mode connecté 18 18 19 //CTreeManager::ParseFile ("test/iodef_simple_test.xml");20 //CTreeManager::PrintTreeToFile("wk/def/test.xml");19 CTreeManager::ParseFile ("test/iodef_simple_test.xml"); 20 CTreeManager::PrintTreeToFile("wk/def/test.xml"); 21 21 22 //comm::CMPIManager::Finalize(); // < seulement en mode connecté22 comm::CMPIManager::Finalize(); // < seulement en mode connecté 23 23 24 CXIOSManager::Initialise (CXIOSManager::CLIENT_SERVER, &argc, &argv); 25 26 27 CMPIManager::DispatchClient(true, comm_client, comm_client_server, comm_server); 28 CXIOSManager::RunServer("Nemo", comm_client_server, comm_server); 29 //CXIOSManager::RunClientServer (comm::CMPIManager::GetCommWorld ()); 30 CXIOSManager::Finalize (); 24 //CXIOSManager::Initialise (CXIOSManager::CLIENT_SERVER, &argc, &argv); 25 //CMPIManager::DispatchClient(true, comm_client, comm_client_server, comm_server); 26 //CXIOSManager::RunServer("Nemo", comm_client_server, comm_server); 27 //CXIOSManager::Finalize (); 31 28 } 32 29 catch (CException & exc) -
XMLIO_V2/dev/dev_rv/src/xmlio/manager/mpi_manager.cpp
r267 r271 251 251 _outdata.resize(recvcount); 252 252 if (MPI_Allgather ( const_cast<int*>(&(_indata[0])), sendcount, MPI_INTEGER, 253 &(_outdata[0]) , recvcount, MPI_INTEGER, _comm) != MPI_SUCCESS)253 &(_outdata[0]) , sendcount, MPI_INTEGER, _comm) != MPI_SUCCESS) 254 254 ERROR("CMPIManager::AllGather (indata, outdata, comm)", << " MPI Error !"); 255 255 } -
XMLIO_V2/dev/dev_rv/src/xmlio/manager/tree_manager.cpp
r265 r271 121 121 CContext::GetContextGroup(); 122 122 123 is.read (reinterpret_cast<char*>(&renum), sizeof( StdSize));124 is.read (reinterpret_cast<char*>(&ctxtnb), sizeof( ENodeType));123 is.read (reinterpret_cast<char*>(&renum), sizeof(ENodeType)); 124 is.read (reinterpret_cast<char*>(&ctxtnb), sizeof(StdSize)); 125 125 126 126 if (renum != CContextGroup::GetType()) 127 127 ERROR("CTreeManager::FromBinary(StdIStream & is)", 128 128 << "[ renum = " << renum << "] Bad type !"); 129 130 131 // std::cout << "Nombre de contexte :" << ctxtnb << std::endl; 129 132 130 133 for (StdSize i = 0; i < ctxtnb; i++) … … 144 147 StdString id(size, ' '); 145 148 is.read (const_cast<char *>(id.data()), size * sizeof(char)); 149 150 // std::cout << "context ::::" << id << std::endl; 146 151 147 152 CTreeManager::SetCurrentContextId(id); -
XMLIO_V2/dev/dev_rv/src/xmlio/manager/xios_manager.cpp
r269 r271 67 67 StdString main_data_tree = clientBuffer[0]->getString(0); 68 68 tree::CTreeManager::FromBinary(main_data_tree); 69 std::cout << "main_data_tree" << main_data_tree.size() << std::endl; 69 70 70 71 // Obtention des sous-domaines clients. … … 74 75 tree::CTreeManager::DomainsFromBinary(main_data_tree); 75 76 } 77 78 StdOStringStream osss; 79 osss << StdString("./def_server_next.") 80 << CMPIManager::GetCommRank(CMPIManager::GetCommWorld()); 81 CTreeManager::PrintTreeToFile(osss.str()); 76 82 77 83 { // Traitement de tous les contextes … … 82 88 it = def_vector.begin(), end = def_vector.end(); 83 89 84 for (; it != end; it++)90 //for (; it != end; it++ ) 85 91 { 86 92 boost::shared_ptr<CContext> context = *it; 93 CTreeManager::SetCurrentContextId(context->getId()); 87 94 boost::shared_ptr<data::CDataTreatment> dt(new data::CDataTreatment (context)); 88 95 context->setDataTreatment(dt); … … 93 100 94 101 StdOStringStream oss; 95 oss << StdString(" def_server_end.")102 oss << StdString("./def_server_end.") 96 103 << CMPIManager::GetCommRank(CMPIManager::GetCommWorld()); 97 104 CTreeManager::PrintTreeToFile(oss.str()); … … 233 240 //--------------------------------------------------------------- 234 241 235 void CXIOSManager::RunClient(comm::MPIComm comm_client) 236 { 237 CXIOSManager::Status = LOC_CLIENT_SERVER; 238 (CXIOSManager::Clients.begin()->second.entry)(comm_client, comm_client, comm_client); 242 void CXIOSManager::RunClient(bool launch, comm::MPIComm comm_client) 243 { 244 if (launch) 245 { 246 CXIOSManager::Status = LOC_CLIENT_SERVER; 247 (CXIOSManager::Clients.begin()->second.entry) 248 (comm_client, comm_client, comm_client); 249 } 250 else 251 { 252 CXIOSManager::Status = LOC_CLIENT; 253 } 239 254 } 240 255 -
XMLIO_V2/dev/dev_rv/src/xmlio/manager/xios_manager.hpp
r187 r271 43 43 static void RunServer(StdString clientName, 44 44 comm::MPIComm comm_client_server, comm::MPIComm comm_server); 45 static void RunClient( comm::MPIComm comm_client =46 comm::CMPIManager::GetCommWorld());45 static void RunClient(bool launch = false, comm::MPIComm comm_client = 46 comm::CMPIManager::GetCommWorld()); 47 47 static void RunClientServer(comm::MPIComm comm_client_server = 48 48 comm::CMPIManager::GetCommWorld()); -
XMLIO_V2/dev/dev_rv/src/xmlio/node/context.cpp
r267 r271 201 201 << "[ renum = " << renum << "] Bad type !"); \ 202 202 if (val) CObjectFactory::CreateObject<C##Name_##Definition> \ 203 (C##Name_##Definition::GetDefName()) -> fromBinary(is);\203 (C##Name_##Definition::GetDefName()) -> fromBinary(is); \ 204 204 } 205 205 #define DECLARE_NODE_PAR(Name_, name_) -
XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.cpp
r265 r271 6 6 7 7 #include "mpi_manager.hpp" 8 9 #include "tree_manager.hpp" 8 10 9 11 #include <algorithm> … … 18 20 , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[0][0])), relFiles() 19 21 , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub() 22 , ibegin_zoom_sub(), jbegin_zoom_sub() 20 23 , lonvalue_sub(), latvalue_sub() 21 24 { /* Ne rien faire de plus */ } … … 25 28 , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[0][0])), relFiles() 26 29 , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub() 30 , ibegin_zoom_sub(), jbegin_zoom_sub() 27 31 , lonvalue_sub(), latvalue_sub() 28 32 { /* Ne rien faire de plus */ } … … 81 85 SuperClass::fromBinary(is); 82 86 83 this->ibegin_sub.push_back(this->ibegin.getValue()); 84 this->jbegin_sub.push_back(this->jbegin.getValue()); 85 this->iend_sub.push_back(this->iend.getValue()); 86 this->jend_sub.push_back(this->jend.getValue()); 87 88 this->latvalue_sub.push_back(this->latvalue.getValue()); 89 this->lonvalue_sub.push_back(this->lonvalue.getValue()); 87 if ( !this->ibegin.isEmpty() && 88 !this->jbegin.isEmpty() && 89 !this->iend.isEmpty() && 90 !this->jend.isEmpty() && 91 !this->latvalue.isEmpty() && 92 !this->lonvalue.isEmpty()) 93 { 94 95 this->ibegin_sub.push_back(this->ibegin.getValue()); 96 this->jbegin_sub.push_back(this->jbegin.getValue()); 97 this->iend_sub.push_back(this->iend.getValue()); 98 this->jend_sub.push_back(this->jend.getValue()); 99 100 this->ibegin_zoom_sub.push_back(this->zoom_ibegin_loc.getValue()); 101 this->jbegin_zoom_sub.push_back(this->zoom_jbegin_loc.getValue()); 102 103 this->latvalue_sub.push_back(this->latvalue.getValue()); 104 this->lonvalue_sub.push_back(this->lonvalue.getValue()); 105 } 90 106 91 107 #define CLEAR_ATT(name_)\ … … 107 123 #undef CLEAR_ATT 108 124 109 this->ibegin.setValue(*std::min_element(this->ibegin_sub.begin(),this->ibegin_sub.end())); 110 this->jbegin.setValue(*std::min_element(this->jbegin_sub.begin(),this->jbegin_sub.end())); 111 this->iend.setValue(*std::max_element(this->iend_sub.begin(),this->iend_sub.end())); 112 this->jend.setValue(*std::max_element(this->jend_sub.begin(),this->jend_sub.end())); 125 if ( !this->ibegin.isEmpty() && 126 !this->jbegin.isEmpty() && 127 !this->iend.isEmpty() && 128 !this->jend.isEmpty() && 129 !this->latvalue.isEmpty() && 130 !this->lonvalue.isEmpty()) 131 { 132 133 this->ibegin.setValue(*std::min_element(this->ibegin_sub.begin(),this->ibegin_sub.end())); 134 this->jbegin.setValue(*std::min_element(this->jbegin_sub.begin(),this->jbegin_sub.end())); 135 this->iend.setValue(*std::max_element(this->iend_sub.begin(),this->iend_sub.end())); 136 this->jend.setValue(*std::max_element(this->jend_sub.begin(),this->jend_sub.end())); 137 } 113 138 } 114 139 … … 124 149 { 125 150 if ((ni_glo.isEmpty() || ni_glo.getValue() <= 0 ) || 126 (ni_glo.isEmpty() || nj_glo.getValue() <= 0 )) 151 (nj_glo.isEmpty() || nj_glo.getValue() <= 0 )) 152 { 153 abort(); 127 154 ERROR("CDomain::checkAttributes(void)", 128 155 << "[ Id = " << this->getId() << " ] " 129 156 << "Le domaine global est mal défini," 130 << " vérifiez les valeurs de \'ni_glo\' et \'nj_glo\' !") ; 157 << " vérifiez les valeurs de \'ni_glo\' et \'nj_glo\' !") 158 } 131 159 } 132 160 … … 675 703 //---------------------------------------------------------------- 676 704 705 const std::vector<int> & CDomain::getIBeginZoomSub(void) const 706 { 707 return (this->ibegin_zoom_sub); 708 } 709 710 //---------------------------------------------------------------- 711 677 712 const std::vector<int> & CDomain::getIEndSub(void) const 678 713 { … … 686 721 return (this->jbegin_sub); 687 722 } 723 724 //---------------------------------------------------------------- 725 726 const std::vector<int> & CDomain::getJBeginZoomSub(void) const 727 { 728 return (this->jbegin_zoom_sub); 729 } 730 688 731 689 732 //---------------------------------------------------------------- -
XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.hpp
r265 r271 77 77 const std::vector<int> & getJBeginSub(void) const; 78 78 const std::vector<int> & getJEndSub(void) const; 79 80 const std::vector<int> & getIBeginZoomSub(void) const; 81 const std::vector<int> & getJBeginZoomSub(void) const; 79 82 80 83 const std::vector<ARRAY(double, 1)> & getLonValueSub(void) const; … … 110 113 111 114 std::vector<int> ibegin_sub, iend_sub, jbegin_sub, jend_sub; 115 std::vector<int> ibegin_zoom_sub, jbegin_zoom_sub; 112 116 std::vector<ARRAY(double, 1)> lonvalue_sub, latvalue_sub; 113 117 -
XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.cpp
r265 r271 437 437 const std::vector<int> & ibegin = this->domain->getIBeginSub(); 438 438 const std::vector<int> & jbegin = this->domain->getJBeginSub(); 439 const std::vector<int> & ibegin_zoom = this->domain->getIBeginZoomSub(); 440 const std::vector<int> & jbegin_zoom = this->domain->getJBeginZoomSub(); 439 441 440 442 const int ibegin_srv = this->domain->ibegin.getValue(); … … 465 467 const int jbegin_cl = jbegin[i]; 466 468 469 int ibegin_zoom_cl = ibegin[i]; //ibegin_zoom[i]; 470 int jbegin_zoom_cl = jbegin[i]; //jbegin_zoom[i]; 471 472 if (ibegin_zoom.size() != 0) 473 { 474 ibegin_zoom_cl = ibegin_zoom[i]; 475 jbegin_zoom_cl = jbegin_zoom[i]; 476 } 477 467 478 for (StdSize n = dn, m = 0; n < (dn + storeIndex_cl->size()); n++, m++) 468 479 { 469 480 (*storeIndex_srv)[n] = (*storeIndex_cl)[m]; // Faux mais inutile dans le cas serveur. 470 481 (*out_i_index_srv)[n] = (*out_i_index_cl)[m] 471 + (ibegin_cl - 1) - (ibegin_srv - 1) - (ibegin_zoom_srv - 1);482 /*+ (ibegin_cl - 1)*/ - (ibegin_srv - 1) + (ibegin_zoom_cl - 1) - (ibegin_zoom_srv - 1); 472 483 (*out_j_index_srv)[n] = (*out_j_index_cl)[m] 473 + (jbegin_cl - 1) - (jbegin_srv- 1) - (jbegin_zoom_srv - 1);484 /*+ (jbegin_cl - 1)*/ - (jbegin_srv - 1) + (jbegin_zoom_cl - 1) - (jbegin_zoom_srv - 1); 474 485 (*out_l_index_srv)[n] = (*out_l_index_cl)[m]; 475 486 } … … 493 504 { 494 505 ERROR("CGrid::computeIndexServer(void)", 495 <<"Erreur d'indexation de la grille au niveau du serveur") ; 506 << "[ grille = " << this->getId() 507 << ", ibegin_t = " << ibegin_t 508 << ", jbegin_t = " << jbegin_t 509 << ", iend_t = " << iend_t 510 << ", jend_t = " << jend_t 511 << ", zoom_ni_srv = " << zoom_ni_srv 512 << ", zoom_nj_srv = " << zoom_nj_srv 513 <<" ] Erreur d'indexation de la grille au niveau du serveur") ; 496 514 } 497 515 }
Note: See TracChangeset
for help on using the changeset viewer.