1 // Copyright (C) 2017-2019 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"
39 using namespace INTERP_KERNEL;
40 using namespace MEDCoupling;
41 using namespace ICoCo;
44 %include "InterpolationOptions.hxx"
45 %include "ProcessorGroup.hxx"
46 %include "DECOptions.hxx"
47 %include "ParaMESH.hxx"
48 %include "ParaFIELD.hxx"
49 %include "MPIProcessorGroup.hxx"
50 %include "ComponentTopology.hxx"
52 %include "DisjointDEC.hxx"
53 %include "InterpKernelDEC.hxx"
54 %include "StructuredCoincidentDEC.hxx"
56 %include "ICoCoField.hxx"
57 %rename(ICoCoMEDField) ICoCo::MEDField;
58 %include "ICoCoMEDField.hxx"
60 %newobject MEDCoupling::ParaUMesh::getCellIdsLyingOnNodes;
70 virtual ~CommInterface();
71 int worldSize() const;
72 int commSize(MPI_Comm comm, int* size) const;
73 int commRank(MPI_Comm comm, int* rank) const;
74 int commGroup(MPI_Comm comm, MPI_Group* group) const;
75 int groupIncl(MPI_Group group, int size, int* ranks, MPI_Group* group_output) const;
76 int commCreate(MPI_Comm comm, MPI_Group group, MPI_Comm* comm_output) const;
77 int groupFree(MPI_Group* group) const;
78 int commFree(MPI_Comm* comm) const;
80 int send(void* buffer, int count, MPI_Datatype datatype, int target, int tag, MPI_Comm comm) const;
81 int recv(void* buffer, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status* status) const;
82 int sendRecv(void* sendbuf, int sendcount, MPI_Datatype sendtype,
83 int dest, int sendtag, void* recvbuf, int recvcount,
84 MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm,
87 int Isend(void* buffer, int count, MPI_Datatype datatype, int target,
88 int tag, MPI_Comm comm, MPI_Request *request) const;
89 int Irecv(void* buffer, int count, MPI_Datatype datatype, int source,
90 int tag, MPI_Comm comm, MPI_Request* request) const;
92 int wait(MPI_Request *request, MPI_Status *status) const;
93 int test(MPI_Request *request, int *flag, MPI_Status *status) const;
94 int requestFree(MPI_Request *request) const;
95 int waitany(int count, MPI_Request *array_of_requests, int *index, MPI_Status *status) const;
96 int testany(int count, MPI_Request *array_of_requests, int *index, int *flag, MPI_Status *status) const;
97 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); }
98 int testall(int count, MPI_Request *array_of_requests, int *flag, MPI_Status *array_of_status) const;
99 int waitsome(int incount, MPI_Request *array_of_requests,int *outcount, int *array_of_indices, MPI_Status *array_of_status) const;
100 int testsome(int incount, MPI_Request *array_of_requests, int *outcount,
101 int *array_of_indices, MPI_Status *array_of_status) const;
102 int probe(int source, int tag, MPI_Comm comm, MPI_Status *status) const;
103 int Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status) const;
104 int cancel(MPI_Request *request) const;
105 int testCancelled(MPI_Status *status, int *flag) const;
106 int barrier(MPI_Comm comm) const;
107 int errorString(int errorcode, char *string, int *resultlen) const;
108 int getCount(MPI_Status *status, MPI_Datatype datatype, int *count) const;
110 int broadcast(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) const;
111 int allGather(void* sendbuf, int sendcount, MPI_Datatype sendtype,
112 void* recvbuf, int recvcount, MPI_Datatype recvtype,
113 MPI_Comm comm) const;
114 int allToAll(void* sendbuf, int sendcount, MPI_Datatype sendtype,
115 void* recvbuf, int recvcount, MPI_Datatype recvtype,
116 MPI_Comm comm) const;
117 int allToAllV(void* sendbuf, int* sendcounts, int* senddispls,
118 MPI_Datatype sendtype, void* recvbuf, int* recvcounts,
119 int* recvdispls, MPI_Datatype recvtype,
120 MPI_Comm comm) const;
122 int reduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) const;
123 int allReduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) const;
129 ParaUMesh(MEDCouplingUMesh *mesh, DataArrayIdType *globalCellIds, DataArrayIdType *globalNodeIds);
132 DataArrayIdType *getCellIdsLyingOnNodes(const DataArrayIdType *globalNodeIds, bool fullyIn) const
134 MCAuto<DataArrayIdType> ret(self->getCellIdsLyingOnNodes(globalNodeIds,fullyIn));
141 /* This object can be used only if MED_ENABLE_FVM is defined*/
142 #ifdef MED_ENABLE_FVM
143 class NonCoincidentDEC : public DEC
146 NonCoincidentDEC(ProcessorGroup& source, ProcessorGroup& target);
150 %extend MEDCoupling::ParaMESH
152 PyObject *getGlobalNumberingCell2() const
154 const mcIdType *tmp=self->getGlobalNumberingCell();
155 mcIdType size=self->getCellMesh()->getNumberOfCells();
156 PyObject *ret=PyList_New(size);
157 for(mcIdType i=0;i<size;i++)
158 PyList_SetItem(ret,i,PyInt_FromLong(tmp[i]));
162 PyObject *getGlobalNumberingFace2() const
164 const mcIdType *tmp=self->getGlobalNumberingFace();
165 mcIdType size=self->getFaceMesh()->getNumberOfCells();
166 PyObject *ret=PyList_New(size);
167 for(mcIdType i=0;i<size;i++)
168 PyList_SetItem(ret,i,PyInt_FromLong(tmp[i]));
172 PyObject *getGlobalNumberingNode2() const
174 const mcIdType *tmp=self->getGlobalNumberingNode();
175 mcIdType size=self->getCellMesh()->getNumberOfNodes();
176 PyObject *ret=PyList_New(size);
177 for(mcIdType i=0;i<size;i++)
178 PyList_SetItem(ret,i,PyInt_FromLong(tmp[i]));