Changeset 347 for XIOS/trunk/src/interface/c/icdata.cpp
- Timestamp:
- 05/21/12 17:57:22 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/interface/c/icdata.cpp
r346 r347 22 22 #include "field_impl.hpp" 23 23 #include <mpi.h> 24 #include "timer.hpp" 24 25 25 26 extern "C" … … 36 37 void cxios_init_server(void) 37 38 { 39 CTimer::get("XIOS").resume() ; 38 40 CXios::initServerSide(); 41 CTimer::get("XIOS").suspend() ; 39 42 } 40 43 … … 46 49 47 50 if (!cstr2string(client_id, len_client_id, str)) return; 48 51 52 CTimer::get("XIOS").resume() ; 53 CTimer::get("XIOS init").resume() ; 49 54 int initialized ; 50 55 MPI_Initialized(&initialized) ; … … 53 58 CXios::initClientSide(str,local_comm,return_comm); 54 59 *f_return_comm=MPI_Comm_c2f(return_comm) ; 60 CTimer::get("XIOS init").suspend() ; 61 CTimer::get("XIOS").suspend() ; 55 62 } 56 63 … … 61 68 62 69 if (!cstr2string(context_id, len_context_id, str)) return; 70 CTimer::get("XIOS").resume() ; 71 CTimer::get("XIOS init context").resume() ; 63 72 comm=MPI_Comm_f2c(*f_comm) ; 64 73 CClient::registerContext(str,comm) ; 74 CTimer::get("XIOS init context").suspend() ; 75 CTimer::get("XIOS").suspend() ; 65 76 } 66 77 67 78 void cxios_context_close_definition() 68 79 { 69 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 80 CTimer::get("XIOS").resume() ; 81 CTimer::get("XIOS close definition").resume() ; 82 CContext* context = CContext::getCurrent() ; 70 83 context->closeDefinition() ; 84 CTimer::get("XIOS close definition").suspend() ; 85 CTimer::get("XIOS").suspend() ; 71 86 } 72 87 73 88 void cxios_context_finalize() 74 89 { 75 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 90 CTimer::get("XIOS").resume() ; 91 CTimer::get("XIOS context finalize").resume() ; 92 CContext* context = CContext::getCurrent() ; 76 93 context->finalize() ; 94 CTimer::get("XIOS context finalize").suspend() ; 95 CTimer::get("XIOS").suspend() ; 77 96 } 78 97 79 98 void cxios_finalize() 80 99 { 100 CTimer::get("XIOS").resume() ; 101 CTimer::get("XIOS finalize").resume() ; 81 102 CXios::clientFinalize() ; 103 CTimer::get("XIOS finalize").suspend() ; 104 CTimer::get("XIOS").suspend() ; 82 105 } 83 106 … … 89 112 { 90 113 std::string fieldid_str; 91 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 92 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 93 114 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 115 116 CTimer::get("XIOS").resume() ; 117 CTimer::get("XIOS send field").resume() ; 118 CContext* context = CContext::getCurrent() ; 94 119 // boost::const_multi_array_ref<double, 1> array_(data_k8, 95 120 // boost::extents [data_Xsize], … … 100 125 // dtreat->write_data(fieldid_str, data); 101 126 CField::get(fieldid_str)->setData(data) ; 127 CTimer::get("XIOS send field").suspend() ; 128 CTimer::get("XIOS").suspend() ; 102 129 } 103 130 … … 105 132 { 106 133 std::string fieldid_str; 107 boost::shared_ptr<CContext> context = CContext::getCurrent() ;108 134 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 135 136 CTimer::get("XIOS").resume() ; 137 CTimer::get("XIOS send field").resume() ; 138 CContext* context = CContext::getCurrent() ; 109 139 110 140 // boost::const_multi_array_ref<double, 2> array_(data_k8, … … 115 145 // dtreat->write_data(fieldid_str, data); 116 146 CField::get(fieldid_str)->setData(data) ; 147 CTimer::get("XIOS send field").suspend() ; 148 CTimer::get("XIOS").suspend() ; 117 149 } 118 150 … … 120 152 { 121 153 std::string fieldid_str; 122 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 123 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 124 154 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 155 156 CTimer::get("XIOS").resume() ; 157 CTimer::get("XIOS send field").resume() ; 158 CContext* context = CContext::getCurrent() ; 125 159 // boost::const_multi_array_ref<double, 3> array_(data_k8, 126 160 // boost::extents [data_Xsize][data_Ysize][data_Zsize], … … 130 164 // dtreat->write_data(fieldid_str, data); 131 165 CField::get(fieldid_str)->setData(data) ; 132 166 CTimer::get("XIOS send field").suspend() ; 167 CTimer::get("XIOS").suspend() ; 133 168 } 134 169 … … 136 171 { 137 172 std::string fieldid_str; 138 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 139 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 140 173 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 174 175 CTimer::get("XIOS").resume() ; 176 CTimer::get("XIOS send field").resume() ; 177 CContext* context = CContext::getCurrent() ; 141 178 // boost::const_multi_array_ref<float, 1> array_(data_k4, 142 179 // boost::extents [data_Xsize], … … 149 186 for(int i=0;i<data->num_elements();i++) ptr_data[i]=data_k4[i]; 150 187 CField::get(fieldid_str)->setData(data) ; 188 CTimer::get("XIOS send field").suspend() ; 189 CTimer::get("XIOS").suspend() ; 151 190 } 152 191 … … 154 193 { 155 194 std::string fieldid_str; 156 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 157 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 158 195 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 196 197 CTimer::get("XIOS").resume() ; 198 CTimer::get("XIOS send field").resume() ; 199 CContext* context = CContext::getCurrent() ; 159 200 // boost::const_multi_array_ref<float, 2> array_(data_k4, 160 201 // boost::extents [data_Xsize][data_Ysize], … … 167 208 for(int i=0;i<data->num_elements();i++) ptr_data[i]=data_k4[i]; 168 209 CField::get(fieldid_str)->setData(data) ; 210 CTimer::get("XIOS send field").suspend() ; 211 CTimer::get("XIOS").suspend() ; 169 212 } 170 213 … … 172 215 { 173 216 std::string fieldid_str; 174 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 175 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 176 217 218 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 219 220 CTimer::get("XIOS").resume() ; 221 CTimer::get("XIOS send field").resume() ; 222 CContext* context = CContext::getCurrent() ; 223 177 224 // boost::const_multi_array_ref<float, 3> array_(data_k4, 178 225 // boost::extents [data_Xsize][data_Ysize][data_Zsize], … … 185 232 for(int i=0;i<data->num_elements();i++) ptr_data[i]=data_k4[i]; 186 233 CField::get(fieldid_str)->setData(data) ; 234 CTimer::get("XIOS send field").suspend() ; 235 CTimer::get("XIOS").suspend() ; 236 187 237 } 188 238
Note: See TracChangeset
for help on using the changeset viewer.