Changeset 1153 for XIOS/dev/branch_yushan_merged/extern
- Timestamp:
- 06/02/17 17:53:25 (7 years ago)
- Location:
- XIOS/dev/branch_yushan_merged/extern
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan_merged/extern/remap/src/intersect.cpp
r1149 r1153 57 57 { 58 58 // share a full edge ? be carefull at the orientation 59 /*60 if(squaredist(a.vertex[i], b.vertex[j]) > 1e-10*1e-10 ||61 squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10 )62 {63 printf("A : squaredist(a.vertex[%d], b.vertex[%d]) = %.10e %d\n",64 i, j, squaredist(a.vertex[i], b.vertex[j]),65 squaredist(a.vertex[i], b.vertex[j]) > 1e-10*1e-10 ? true : false);66 printf("B : squaredist(a.vertex[%d], b.vertex[%d]) = %.10e %d\n",67 (i+1)%a.n, (j+1)%b.n, squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]),68 squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10 ? true : false);59 60 //if(squaredist(a.vertex[i], b.vertex[j]) > 1e-10*1e-10 || 61 // squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10 ) 62 //{ 63 //printf("A : squaredist(a.vertex[%d], b.vertex[%d]) = %.10e %d\n", 64 // i, j, squaredist(a.vertex[i], b.vertex[j]), 65 // squaredist(a.vertex[i], b.vertex[j]) > 1e-10*1e-10 ? true : false); 66 //printf("B : squaredist(a.vertex[%d], b.vertex[%d]) = %.10e %d\n", 67 // (i+1)%a.n, (j+1)%b.n, squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]), 68 // squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10 ? true : false); 69 69 70 70 assert(squaredist(a.vertex[ i ], b.vertex[ j ]) > 1e-10*1e-10 || 71 71 squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10); 72 exit(0); 73 }*/ 72 73 //} 74 74 75 if ( squaredist(a.vertex[ i ], b.vertex[ j ]) < 1e-10*1e-10 && 75 76 squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+b.n-1)%b.n]) < 1e-10*1e-10) -
XIOS/dev/branch_yushan_merged/extern/remap/src/mapper.cpp
r1149 r1153 303 303 MPI_Issend(sendValue[rank], nbRecvElement[rank], MPI_DOUBLE, rank, 0, communicator, &sendRequest[nbSendRequest]); 304 304 nbSendRequest++; 305 MPI_Issend(sendArea[rank], nbRecvElement[rank], MPI_DOUBLE, rank, 0, communicator, &sendRequest[nbSendRequest]);305 MPI_Issend(sendArea[rank], nbRecvElement[rank], MPI_DOUBLE, rank, 1, communicator, &sendRequest[nbSendRequest]); 306 306 nbSendRequest++; 307 307 if (order == 2) 308 308 { 309 309 MPI_Issend(sendGrad[rank], 3*nbRecvElement[rank]*(NMAX+1), 310 MPI_DOUBLE, rank, 0, communicator, &sendRequest[nbSendRequest]);310 MPI_DOUBLE, rank, 2, communicator, &sendRequest[nbSendRequest]); 311 311 nbSendRequest++; 312 MPI_Issend(sendNeighIds[rank], 4*nbRecvElement[rank]*(NMAX+1), MPI_INT, rank, 0, communicator, &sendRequest[nbSendRequest]);312 MPI_Issend(sendNeighIds[rank], 4*nbRecvElement[rank]*(NMAX+1), MPI_INT, rank, 3, communicator, &sendRequest[nbSendRequest]); 313 313 //ym --> attention taille GloId 314 314 nbSendRequest++; … … 316 316 else 317 317 { 318 MPI_Issend(sendNeighIds[rank], 4*nbRecvElement[rank], MPI_INT, rank, 0, communicator, &sendRequest[nbSendRequest]);318 MPI_Issend(sendNeighIds[rank], 4*nbRecvElement[rank], MPI_INT, rank, 4, communicator, &sendRequest[nbSendRequest]); 319 319 //ym --> attention taille GloId 320 320 nbSendRequest++; … … 325 325 MPI_Irecv(recvValue[rank], nbSendElement[rank], MPI_DOUBLE, rank, 0, communicator, &recvRequest[nbRecvRequest]); 326 326 nbRecvRequest++; 327 MPI_Irecv(recvArea[rank], nbSendElement[rank], MPI_DOUBLE, rank, 0, communicator, &recvRequest[nbRecvRequest]);327 MPI_Irecv(recvArea[rank], nbSendElement[rank], MPI_DOUBLE, rank, 1, communicator, &recvRequest[nbRecvRequest]); 328 328 nbRecvRequest++; 329 329 if (order == 2) 330 330 { 331 331 MPI_Irecv(recvGrad[rank], 3*nbSendElement[rank]*(NMAX+1), 332 MPI_DOUBLE, rank, 0, communicator, &recvRequest[nbRecvRequest]);332 MPI_DOUBLE, rank, 2, communicator, &recvRequest[nbRecvRequest]); 333 333 nbRecvRequest++; 334 MPI_Irecv(recvNeighIds[rank], 4*nbSendElement[rank]*(NMAX+1), MPI_INT, rank, 0, communicator, &recvRequest[nbRecvRequest]);334 MPI_Irecv(recvNeighIds[rank], 4*nbSendElement[rank]*(NMAX+1), MPI_INT, rank, 3, communicator, &recvRequest[nbRecvRequest]); 335 335 //ym --> attention taille GloId 336 336 nbRecvRequest++; … … 338 338 else 339 339 { 340 MPI_Irecv(recvNeighIds[rank], 4*nbSendElement[rank], MPI_INT, rank, 0, communicator, &recvRequest[nbRecvRequest]);340 MPI_Irecv(recvNeighIds[rank], 4*nbSendElement[rank], MPI_INT, rank, 4, communicator, &recvRequest[nbRecvRequest]); 341 341 //ym --> attention taille GloId 342 342 nbRecvRequest++; -
XIOS/dev/branch_yushan_merged/extern/remap/src/node.hpp
r923 r1153 15 15 struct Circle 16 16 { 17 18 17 Coord centre; 18 double radius; 19 19 }; 20 20 … … 116 116 struct Node 117 117 { 118 119 120 121 122 123 124 125 126 127 128 129 118 int level; /* FIXME leafs are 0 and root is max level? */ 119 int leafCount; /* number of leafs that are descendants of this node (the elements in it's cycle) */ 120 Coord centre; 121 double radius; 122 NodePtr parent, ref; 123 std::vector<NodePtr> child; 124 std::list<NodePtr> intersectors; 125 bool reinserted; 126 int updateCount; // double var; 127 CBasicTree* tree; 128 void *data; 129 int route; 130 130 bool toDelete ; 131 131 132 133 134 132 Node() : level(0), leafCount(1), centre(ORIGIN), radius(0), reinserted(false), updateCount(0), toDelete(false) {} 133 Node(const Coord& centre, double radius, void *data) 134 : level(0), leafCount(1), centre(centre), radius(radius), reinserted(false), updateCount(0), data(data), toDelete(false) {} 135 135 136 136 //#ifdef DEBUG … … 178 178 //#endif 179 179 180 181 182 183 180 void move(const NodePtr node); 181 void remove(const NodePtr node); 182 void inflate(const NodePtr node); 183 void update(); 184 184 void output(std::ostream& flux, int level, int color) ; 185 186 187 188 189 190 191 192 193 185 NodePtr closest(std::vector<NodePtr>& list, int n = CLOSEST); 186 NodePtr farthest(std::vector<NodePtr>& list); 187 void findClosest(int level, NodePtr src, double& minDist, NodePtr &closest); 188 189 void search(NodePtr node); 190 bool centreInside(Node &node); 191 bool intersects(NodePtr node); 192 bool isInside(Node &node); 193 int incluCheck(); 194 194 void checkParent(void) ; 195 196 197 198 199 200 201 195 void printChildren(); 196 void assignRoute(std::vector<int>::iterator& rank, int level); 197 void assignCircleAndPropagateUp(Coord *centres, double *radia, int level); 198 void printLevel(int level); 199 void routeNode(NodePtr node, int level); 200 void routingIntersecting(std::vector<Node>* routingList, NodePtr node); 201 void routeIntersection(std::vector<int>& routes, NodePtr node); 202 202 void getNodeLevel(int level,std::list<NodePtr>& NodeList) ; 203 203 bool removeDeletedNodes(int assignLevel) ; -
XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_wait.cpp
r1149 r1153 58 58 if(request->type == 3) 59 59 { 60 ::MPI_Request mpi_request = static_cast< ::MPI_Request >(request->mpi_request);60 ::MPI_Request *mpi_request = static_cast< ::MPI_Request* >(&(request->mpi_request)); 61 61 ::MPI_Status mpi_status; 62 ::MPI_Wait(&mpi_request, &mpi_status); 62 ::MPI_Errhandler_set(MPI_COMM_WORLD_STD, MPI_ERRORS_RETURN); 63 int error_code = ::MPI_Wait(mpi_request, &mpi_status); 64 if (error_code != MPI_SUCCESS) { 65 66 char error_string[BUFSIZ]; 67 int length_of_error_string, error_class; 68 69 ::MPI_Error_class(error_code, &error_class); 70 ::MPI_Error_string(error_class, error_string, &length_of_error_string); 71 printf("%s\n", error_string); 72 } 73 63 74 64 75 status->mpi_status = new ::MPI_Status(mpi_status); … … 81 92 int MPI_Waitall(int count, MPI_Request *array_of_requests, MPI_Status *array_of_statuses) 82 93 { 83 int dest_rank; 84 MPI_Comm_rank(MPI_COMM_WORLD, &dest_rank); 94 //int dest_rank; 95 //MPI_Comm_rank(MPI_COMM_WORLD, &dest_rank); 96 //printf("proc %d enters waitall\n", dest_rank); 85 97 86 98 int finished = 0; … … 100 112 if(array_of_requests[i].type != 2) // isend or imrecv 101 113 { 102 //MPI_Wait(&array_of_requests[i], &array_of_statuses[i]);103 int tested=false;104 while(!tested) MPI_Test(&array_of_requests[i], &tested, &array_of_statuses[i]);114 MPI_Wait(&array_of_requests[i], &array_of_statuses[i]); 115 //int tested=false; 116 //while(!tested) MPI_Test(&array_of_requests[i], &tested, &array_of_statuses[i]); 105 117 finished++; 106 118 finished_index[i] = true; … … 127 139 } 128 140 } 141 //printf("proc %d exits waitall\n", dest_rank); 129 142 return MPI_SUCCESS; 130 143 } /* end of mpi_waitall*/
Note: See TracChangeset
for help on using the changeset viewer.