1 // Copyright (C) 2017-2020 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 %template() std::set<int>;
25 #include "CommInterface.hxx"
26 #include "ProcessorGroup.hxx"
27 #include "Topology.hxx"
28 #include "MPIProcessorGroup.hxx"
30 #include "InterpKernelDEC.hxx"
31 #include "NonCoincidentDEC.hxx"
32 #include "StructuredCoincidentDEC.hxx"
33 #include "ParaMESH.hxx"
34 #include "ParaFIELD.hxx"
35 #include "ICoCoMEDField.hxx"
36 #include "ComponentTopology.hxx"
37 #include "ParaUMesh.hxx"
38 #include "ParaSkyLineArray.hxx"
40 using namespace INTERP_KERNEL;
41 using namespace MEDCoupling;
42 using namespace ICoCo;
45 %include "InterpolationOptions.hxx"
46 %include "ProcessorGroup.hxx"
47 %include "DECOptions.hxx"
48 %include "ParaMESH.hxx"
49 %include "ParaFIELD.hxx"
50 %include "MPIProcessorGroup.hxx"
51 %include "ComponentTopology.hxx"
53 %include "DisjointDEC.hxx"
54 %include "InterpKernelDEC.hxx"
55 %include "StructuredCoincidentDEC.hxx"
57 %include "ICoCoField.hxx"
58 %rename(ICoCoMEDField) ICoCo::MEDField;
59 %include "ICoCoMEDField.hxx"
61 %newobject MEDCoupling::ParaUMesh::getCellIdsLyingOnNodes;
62 %newobject MEDCoupling::ParaSkyLineArray::equiRedistribute;
63 %newobject MEDCoupling::ParaSkyLineArray::getSkyLineArray;
64 %newobject MEDCoupling::ParaSkyLineArray::getGlobalIdsArray;
66 %feature("unref") ParaSkyLineArray "$this->decrRef();"
76 virtual ~CommInterface();
77 int worldSize() const;
78 int commSize(MPI_Comm comm, int* size) const;
79 int commRank(MPI_Comm comm, int* rank) const;
80 int commGroup(MPI_Comm comm, MPI_Group* group) const;
81 int groupIncl(MPI_Group group, int size, int* ranks, MPI_Group* group_output) const;
82 int commCreate(MPI_Comm comm, MPI_Group group, MPI_Comm* comm_output) const;
83 int groupFree(MPI_Group* group) const;
84 int commFree(MPI_Comm* comm) const;
86 int send(void* buffer, int count, MPI_Datatype datatype, int target, int tag, MPI_Comm comm) const;
87 int recv(void* buffer, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status* status) const;
88 int sendRecv(void* sendbuf, int sendcount, MPI_Datatype sendtype,
89 int dest, int sendtag, void* recvbuf, int recvcount,
90 MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm,
93 int Isend(void* buffer, int count, MPI_Datatype datatype, int target,
94 int tag, MPI_Comm comm, MPI_Request *request) const;
95 int Irecv(void* buffer, int count, MPI_Datatype datatype, int source,
96 int tag, MPI_Comm comm, MPI_Request* request) const;
98 int wait(MPI_Request *request, MPI_Status *status) const;
99 int test(MPI_Request *request, int *flag, MPI_Status *status) const;
100 int requestFree(MPI_Request *request) const;
101 int waitany(int count, MPI_Request *array_of_requests, int *index, MPI_Status *status) const;
102 int testany(int count, MPI_Request *array_of_requests, int *index, int *flag, MPI_Status *status) const;
103 int waitall(int count, MPI_Request *array_of_requests, MPI_Status *array_of_status) const { return MPI_Waitall(count, array_of_requests, array_of_status); }
104 int testall(int count, MPI_Request *array_of_requests, int *flag, MPI_Status *array_of_status) const;
105 int waitsome(int incount, MPI_Request *array_of_requests,int *outcount, int *array_of_indices, MPI_Status *array_of_status) const;
106 int testsome(int incount, MPI_Request *array_of_requests, int *outcount,
107 int *array_of_indices, MPI_Status *array_of_status) const;
108 int probe(int source, int tag, MPI_Comm comm, MPI_Status *status) const;
109 int Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status) const;
110 int cancel(MPI_Request *request) const;
111 int testCancelled(MPI_Status *status, int *flag) const;
112 int barrier(MPI_Comm comm) const;
113 int errorString(int errorcode, char *string, int *resultlen) const;
114 int getCount(MPI_Status *status, MPI_Datatype datatype, int *count) const;
116 int broadcast(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) const;
117 int allGather(void* sendbuf, int sendcount, MPI_Datatype sendtype,
118 void* recvbuf, int recvcount, MPI_Datatype recvtype,
119 MPI_Comm comm) const;
120 int allToAll(void* sendbuf, int sendcount, MPI_Datatype sendtype,
121 void* recvbuf, int recvcount, MPI_Datatype recvtype,
122 MPI_Comm comm) const;
123 int allToAllV(void* sendbuf, int* sendcounts, int* senddispls,
124 MPI_Datatype sendtype, void* recvbuf, int* recvcounts,
125 int* recvdispls, MPI_Datatype recvtype,
126 MPI_Comm comm) const;
128 int reduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) const;
129 int allReduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) const;
135 ParaUMesh(MEDCouplingUMesh *mesh, DataArrayIdType *globalCellIds, DataArrayIdType *globalNodeIds);
138 DataArrayIdType *getCellIdsLyingOnNodes(const DataArrayIdType *globalNodeIds, bool fullyIn) const
140 MCAuto<DataArrayIdType> ret(self->getCellIdsLyingOnNodes(globalNodeIds,fullyIn));
146 class ParaSkyLineArray : public RefCountObject
149 static ParaSkyLineArray *New(MEDCouplingSkyLineArray *ska, DataArrayIdType *globalIds);
152 ParaSkyLineArray(MEDCouplingSkyLineArray *ska, DataArrayIdType *globalIds)
154 return ParaSkyLineArray::New(ska,globalIds);
157 ParaSkyLineArray *equiRedistribute(mcIdType nbOfEntities) const
159 MCAuto<ParaSkyLineArray> ret(self->equiRedistribute(nbOfEntities));
163 MEDCouplingSkyLineArray *getSkyLineArray() const
165 MEDCouplingSkyLineArray *ret(self->getSkyLineArray());
171 DataArrayIdType *getGlobalIdsArray() const
173 DataArrayIdType *ret(self->getGlobalIdsArray());
182 /* This object can be used only if MED_ENABLE_FVM is defined*/
183 #ifdef MED_ENABLE_FVM
184 class NonCoincidentDEC : public DEC
187 NonCoincidentDEC(ProcessorGroup& source, ProcessorGroup& target);
191 %extend MEDCoupling::ParaMESH
193 PyObject *getGlobalNumberingCell2() const
195 const mcIdType *tmp=self->getGlobalNumberingCell();
196 mcIdType size=self->getCellMesh()->getNumberOfCells();
197 PyObject *ret=PyList_New(size);
198 for(mcIdType i=0;i<size;i++)
199 PyList_SetItem(ret,i,PyInt_FromLong(tmp[i]));
203 PyObject *getGlobalNumberingFace2() const
205 const mcIdType *tmp=self->getGlobalNumberingFace();
206 mcIdType size=self->getFaceMesh()->getNumberOfCells();
207 PyObject *ret=PyList_New(size);
208 for(mcIdType i=0;i<size;i++)
209 PyList_SetItem(ret,i,PyInt_FromLong(tmp[i]));
213 PyObject *getGlobalNumberingNode2() const
215 const mcIdType *tmp=self->getGlobalNumberingNode();
216 mcIdType size=self->getCellMesh()->getNumberOfNodes();
217 PyObject *ret=PyList_New(size);
218 for(mcIdType i=0;i<size;i++)
219 PyList_SetItem(ret,i,PyInt_FromLong(tmp[i]));