Changeset 1146
- Timestamp:
- 05/24/17 16:59:40 (7 years ago)
- Location:
- XIOS/dev/branch_yushan_merged
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan_merged/extern/remap/src/clipper.cpp
r919 r1146 1047 1047 1048 1048 //create a new edge array ... 1049 TEdge *edges = new TEdge [highI+1];1049 TEdge *edges = new TEdge[highI+1]; 1050 1050 1051 1051 bool IsFlat = true; … … 4274 4274 { 4275 4275 //The equation of a line in general form (Ax + By + C = 0) 4276 //given 2 points (x ¹,y¹) & (x²,y²) is ...4277 //(y ¹ - y²)x + (x² - x¹)y + (y² - y¹)x¹ - (x² - x¹)y¹= 04278 //A = (y ¹ - y²); B = (x² - x¹); C = (y² - y¹)x¹ - (x² - x¹)y¹4279 //perpendicular distance of point (x ³,y³) = (Ax³ + By³ + C)/Sqrt(A² + B²)4276 //given 2 points (x,y) & (x,y) is ... 4277 //(y - y)x + (x - x)y + (y - y)x - (x - x)y = 0 4278 //A = (y - y); B = (x - x); C = (y - y)x - (x - x)y 4279 //perpendicular distance of point (x,y) = (Ax + By + C)/Sqrt(A + B) 4280 4280 //see http://en.wikipedia.org/wiki/Perpendicular_distance 4281 4281 double A = double(ln1.Y - ln2.Y); -
XIOS/dev/branch_yushan_merged/extern/remap/src/mapper.cpp
r1141 r1146 548 548 } 549 549 550 MPI_Waitall(nbSendRequest, sendRequest, status); 550 551 MPI_Waitall(nbRecvRequest, recvRequest, status); 551 MPI_Waitall(nbSendRequest, sendRequest, status);552 552 553 553 for (int rank = 0; rank < mpiSize; rank++) … … 620 620 } 621 621 622 MPI_Waitall(nbSendRequest, sendRequest, status); 622 623 MPI_Waitall(nbRecvRequest, recvRequest, status); 623 MPI_Waitall(nbSendRequest, sendRequest, status); 624 624 625 625 int nbNeighbourNodes = 0; 626 626 for (int rank = 0; rank < mpiSize; rank++) … … 803 803 } 804 804 } 805 805 806 MPI_Waitall(nbSendRequest, sendRequest, status); 806 807 MPI_Waitall(nbRecvRequest, recvRequest, status); 807 MPI_Waitall(nbSendRequest, sendRequest, status);808 808 809 char **sendBuffer2 = new char*[mpiSize]; 809 810 char **recvBuffer2 = new char*[mpiSize]; … … 886 887 } 887 888 } 888 889 890 MPI_Waitall(nbSendRequest, sendRequest, status); 889 891 MPI_Waitall(nbRecvRequest, recvRequest, status); 890 MPI_Waitall(nbSendRequest, sendRequest, status);892 891 893 892 894 delete [] sendRequest; -
XIOS/dev/branch_yushan_merged/extern/remap/src/timerRemap.cpp
r694 r1146 9 9 using namespace std; 10 10 11 map<string,CTimer*> CTimer::allTimer;11 map<string,CTimer*> *CTimer::allTimer = 0; 12 12 13 13 CTimer::CTimer(const string& name_) : name(name_) … … 55 55 CTimer& CTimer::get(const string name) 56 56 { 57 if(allTimer == 0) allTimer = new map<string,CTimer*>; 57 58 map<string,CTimer*>::iterator it; 58 it= allTimer.find(name);59 if (it== allTimer.end()) it=allTimer.insert(pair<string,CTimer*>(name,new CTimer(name))).first;59 it=(*allTimer).find(name); 60 if (it==(*allTimer).end()) it=(*allTimer).insert(pair<string,CTimer*>(name,new CTimer(name))).first; 60 61 return *(it->second); 61 62 } -
XIOS/dev/branch_yushan_merged/extern/remap/src/timerRemap.hpp
r694 r1146 26 26 double getCumulatedTime(void); 27 27 void print(void); 28 static map<string,CTimer*> allTimer; 28 //static map<string,CTimer*> allTimer; 29 static map<string,CTimer*> *allTimer; 30 #pragma omp threadprivate(allTimer) 31 29 32 static double getTime(void); 30 33 static CTimer& get(string name); -
XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_alltoall.cpp
r1134 r1146 10 10 int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) 11 11 { 12 assert(static_cast< ::MPI_Datatype>(sendtype) == static_cast< ::MPI_Datatype>(recvtype)); 12 13 ::MPI_Aint typesize, llb; 13 14 ::MPI_Type_get_extent(static_cast< ::MPI_Datatype>(sendtype), &llb, &typesize); 15 16 int ep_size; 17 MPI_Comm_size(comm, &ep_size); 14 18 15 for(int i=0; i< comm.ep_comm_ptr->size_rank_info[0].second; i++)19 for(int i=0; i<ep_size; i++) 16 20 { 17 MPI_Gather( (char*)sendbuf+i*sendcount*typesize, sendcount, sendtype, recvbuf, recvcount, recvtype, i, comm);21 MPI_Gather(sendbuf+i*sendcount*typesize, sendcount, sendtype, recvbuf, recvcount, recvtype, i, comm); 18 22 } 19 23 -
XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_wait.cpp
r1138 r1146 86 86 87 87 int finished = 0; 88 boolfinished_index[count];88 int finished_index[count]; 89 89 90 90 for(int i=0; i<count; i++) … … 97 97 for(int i=0; i<count; i++) 98 98 { 99 //MPI_Test(&array_of_requests[i], &finished_index[i], &array_of_statuses[i]); 99 100 if(finished_index[i] == false) // this request has not been tested. 100 101 { … … 102 103 { 103 104 MPI_Wait(&array_of_requests[i], &array_of_statuses[i]); 104 if(array_of_requests[i].type == 3)105 {106 //int check_count;107 //MPI_Get_count(&array_of_statuses[i], array_of_requests[i].ep_datatype, &check_count);108 //check_sum_recv(array_of_requests[i].buf, count, array_of_requests[i].ep_datatype, array_of_requests[i].ep_src, array_of_requests[i].ep_tag, array_of_requests[i].comm, 2);109 }110 105 finished++; 111 106 finished_index[i] = true; -
XIOS/dev/branch_yushan_merged/src/io/netCdfInterface.cpp
r1138 r1146 103 103 int CNetCdfInterface::openPar(const StdString& fileName, int oMode, MPI_Comm comm, MPI_Info info, int& ncId) 104 104 { 105 int status = xios::nc_open_par(fileName.c_str(), oMode, comm, info, &ncId); 105 int status; 106 #pragma omp critical (_netcdf) 107 status = xios::nc_open_par(fileName.c_str(), oMode, comm, info, &ncId); 106 108 if (NC_NOERR != status) 107 109 { … … 347 349 int CNetCdfInterface::inqDimLen(int ncid, int dimId, StdSize& dimLen) 348 350 { 349 int status = nc_inq_dimlen(ncid, dimId, &dimLen); 351 int status; 352 #pragma omp critical (_netcdf) 353 status = nc_inq_dimlen(ncid, dimId, &dimLen); 350 354 if (NC_NOERR != status) 351 355 { -
XIOS/dev/branch_yushan_merged/src/io/netCdfInterface_impl.hpp
r1138 r1146 86 86 int CNetCdfInterface::getVaraType(int ncid, int varId, const StdSize* start, const StdSize* count, T* data) 87 87 { 88 int status = ncGetVaraType(ncid, varId, start, count, data); 88 int status; 89 #pragma omp critical (_netcdf) 90 status = ncGetVaraType(ncid, varId, start, count, data); 89 91 if (NC_NOERR != status) 90 92 { -
XIOS/dev/branch_yushan_merged/src/node/context.cpp
r1134 r1146 21 21 shared_ptr<CContextGroup> * CContext::root_ptr = 0; 22 22 23 /// ////////////////////// D éfinitions ////////////////////// ///23 /// ////////////////////// Dfinitions ////////////////////// /// 24 24 25 25 CContext::CContext(void) … … 184 184 if (!this->hasChild()) 185 185 { 186 //oss << "<!-- No definition -->" << std::endl; // fait planter l'incr émentation186 //oss << "<!-- No definition -->" << std::endl; // fait planter l'incrmentation 187 187 } 188 188 else … … 554 554 void CContext::solveAllInheritance(bool apply) 555 555 { 556 // R ésolution des héritages descendants (cà d des héritages de groupes)556 // Rsolution des hritages descendants (cd des hritages de groupes) 557 557 // pour chacun des contextes. 558 558 solveDescInheritance(apply); 559 559 560 // R ésolution des héritages par référence au niveau des fichiers.560 // Rsolution des hritages par rfrence au niveau des fichiers. 561 561 const vector<CFile*> allFiles=CFile::getAll(); 562 562 const vector<CGrid*> allGrids= CGrid::getAll(); … … 582 582 583 583 for (unsigned int i = 0; i < allFiles.size(); i++) 584 if (!allFiles[i]->enabled.isEmpty()) // Si l'attribut 'enabled' est d éfini.584 if (!allFiles[i]->enabled.isEmpty()) // Si l'attribut 'enabled' est dfini. 585 585 { 586 if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fix é Ãvrai.586 if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fix vrai. 587 587 { 588 588 if ((initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep())) … … 609 609 610 610 if (enabledFiles.size() == 0) 611 DEBUG(<<"Aucun fichier ne va être sorti dans le contexte nommé\""611 DEBUG(<<"Aucun fichier ne va tre sorti dans le contexte nomm \"" 612 612 << getId() << "\" !"); 613 613 } … … 849 849 prepareTimeseries(); 850 850 851 //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers Ãsortir.851 //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers sortir. 852 852 this->findEnabledFiles(); 853 853 this->findEnabledReadModeFiles(); -
XIOS/dev/branch_yushan_merged/src/node/file.cpp
r1138 r1146 612 612 if (time_counter_name.isEmpty()) time_counter_name = "time_counter"; 613 613 614 //#pragma omp critical (_checkFile) 614 615 checkFile(); 615 616 -
XIOS/dev/branch_yushan_merged/src/server.cpp
r1141 r1146 340 340 MPI_Isend(buff,count,MPI_CHAR,i,2,intraComm,&requests[i-1]) ; 341 341 } 342 342 343 MPI_Waitall(size-1,requests,status) ; 343 344 registerContext(buff,count,it->second.leaderRank) ; -
XIOS/dev/branch_yushan_merged/src/test/test_remap_omp.f90
r1141 r1146 52 52 if(rank < size-2) then 53 53 54 !$omp parallel default( private)54 !$omp parallel default(firstprivate) 55 55 56 56 !!! XIOS Initialization (get the local communicator) … … 60 60 CALL MPI_COMM_SIZE(comm,size,ierr) 61 61 62 63 !$omp critical (open_file) 62 64 ierr=NF90_OPEN(src_file, NF90_NOWRITE, ncid) 65 !$omp end critical (open_file) 66 63 67 ierr=NF90_INQ_VARID(ncid,"bounds_lon",varid) 64 68 ierr=NF90_INQUIRE_VARIABLE(ncid, varid,dimids=dimids) … … 134 138 ENDDO 135 139 140 !$omp critical (open_file) 136 141 ierr=NF90_OPEN(dst_file, NF90_NOWRITE, ncid) 142 !$omp end critical (open_file) 143 144 137 145 ierr=NF90_INQ_VARID(ncid,"bounds_lon",varid) 138 146 ierr=NF90_INQUIRE_VARIABLE(ncid, varid,dimids=dimids) … … 168 176 CALL xios_get_handle("test",ctx_hdl) 169 177 CALL xios_set_current_context(ctx_hdl) 170 178 171 179 CALL xios_set_domain_attr("src_domain", ni_glo=src_ni_glo, ibegin=src_ibegin, ni=src_ni, type="unstructured") 172 180 CALL xios_set_domain_attr("src_domain", lonvalue_1D=src_lon, latvalue_1D=src_lat, & … … 189 197 bounds_lon_1D=src_boundslon, bounds_lat_1D=src_boundslat, nvertex=src_nvertex) 190 198 191 192 199 dtime%second = 3600 193 200 … … 195 202 196 203 CALL xios_close_context_definition() 197 CALL xios_get_domain_attr("src_domain_regular_read", ni=src_tmp_ni, nj=src_tmp_nj) 198 ALLOCATE(tmp_field_0(src_tmp_ni*src_tmp_nj)) 199 200 CALL xios_get_axis_attr("src_axis_curvilinear_read", n=src_tmp_n) 201 CALL xios_get_domain_attr("src_domain_curvilinear_read", ni=src_tmp_ni, nj=src_tmp_nj) 202 ALLOCATE(tmp_field_1(src_tmp_ni*src_tmp_nj*src_tmp_n)) 203 204 CALL xios_get_domain_attr("src_domain_unstructured_read", ni=src_tmp_ni, nj=src_tmp_nj) 205 ALLOCATE(tmp_field_2(src_tmp_ni*src_tmp_nj)) 206 207 CALL xios_recv_field("src_field_regular", tmp_field_0) 208 CALL xios_recv_field("src_field_curvilinear", tmp_field_1) 209 CALL xios_recv_field("src_field_unstructured", tmp_field_2) 210 211 DO ts=1,10 212 CALL xios_update_calendar(ts) 213 CALL xios_send_field("src_field_2D",src_field_2D) 214 215 DO i=1,src_ni 216 src_field_2D_clone(i) = src_field_2D(i) 217 IF ((23.5 * ts < src_lat(i)) .AND. (src_lat(i) < 65.5 *ts) .AND. (0 < src_lon(i)) .AND. (src_lon(i) < 30*ts)) THEN 218 src_field_2D_clone(i) = missing_value 219 ENDIF 220 ENDDO 221 222 CALL xios_send_field("src_field_2D_clone",src_field_2D_clone) 223 CALL xios_send_field("src_field_3D",src_field_3D) 224 CALL xios_send_field("src_field_3D_clone",src_field_3D) 225 CALL xios_send_field("src_field_4D",src_field_4D) 226 CALL xios_send_field("src_field_3D_pression",src_field_pression) 227 CALL xios_send_field("tmp_field_0",tmp_field_0) 228 CALL xios_send_field("tmp_field_1",tmp_field_1) 229 CALL xios_send_field("tmp_field_2",tmp_field_2) 230 CALL wait_us(5000) ; 231 ENDDO 232 204 233 205 CALL xios_context_finalize() 234 235 DEALLOCATE(src_lon, src_lat, src_boundslon,src_boundslat, src_field_2D) 236 DEALLOCATE(dst_lon, dst_lat, dst_boundslon,dst_boundslat) 237 DEALLOCATE(tmp_field_0, tmp_field_1, tmp_field_2) 238 239 240 206 241 207 CALL xios_finalize() 242 208
Note: See TracChangeset
for help on using the changeset viewer.