#ifndef __MEDPARTITIONER_UTILS_HXX__
#define __MEDPARTITIONER_UTILS_HXX__
+#include "MEDPARTITIONER.hxx"
+
#include "MEDCouplingUMesh.hxx"
#include <string>
namespace MEDPARTITIONER
{
- std::string Trim(const std::string& s,const std::string& drop);
- std::string IntToStr(const int i);
- std::string DoubleToStr(const double i);
- int StrToInt(const std::string& s);
- double StrToDouble(const std::string& s);
- bool TestArg(const char *arg, const char *argExpected, std::string& argValue);
- std::vector<int> CreateRandomSize(const int size);
- void RandomizeAdj(int* xadj, int* adjncy, std::vector<int>& ran, std::vector<int>& vx, std::vector<int>& va);
- void TestRandomize();
-
- std::string ReprVectorOfString(const std::vector<std::string>& vec);
- std::string ReprVectorOfString(const std::vector<std::string>& vec, const std::string separator);
- std::string ReprMapOfStringInt(const std::map<std::string,int>& mymap);
- std::string ReprMapOfStringVectorOfString(const std::map< std::string,std::vector<std::string> >& mymap);
- std::string ReprFieldDescriptions(const std::vector<std::string>& vec,const std::string separator);
+ MEDPARTITIONER_EXPORT std::string Trim(const std::string& s,const std::string& drop);
+ MEDPARTITIONER_EXPORT std::string IntToStr(const int i);
+ MEDPARTITIONER_EXPORT std::string DoubleToStr(const double i);
+ MEDPARTITIONER_EXPORT int StrToInt(const std::string& s);
+ MEDPARTITIONER_EXPORT double StrToDouble(const std::string& s);
+ MEDPARTITIONER_EXPORT bool TestArg(const char *arg, const char *argExpected, std::string& argValue);
+ MEDPARTITIONER_EXPORT std::vector<int> CreateRandomSize(const int size);
+ MEDPARTITIONER_EXPORT void RandomizeAdj(int* xadj, int* adjncy, std::vector<int>& ran, std::vector<int>& vx, std::vector<int>& va);
+ MEDPARTITIONER_EXPORT void TestRandomize();
+
+ MEDPARTITIONER_EXPORT std::string ReprVectorOfString(const std::vector<std::string>& vec);
+ MEDPARTITIONER_EXPORT std::string ReprVectorOfString(const std::vector<std::string>& vec, const std::string separator);
+ MEDPARTITIONER_EXPORT std::string ReprMapOfStringInt(const std::map<std::string,int>& mymap);
+ MEDPARTITIONER_EXPORT std::string ReprMapOfStringVectorOfString(const std::map< std::string,std::vector<std::string> >& mymap);
+ MEDPARTITIONER_EXPORT std::string ReprFieldDescriptions(const std::vector<std::string>& vec,const std::string separator);
- std::string SerializeFromString(const std::string& s);
- std::string SerializeFromVectorOfString(const std::vector<std::string>& vec);
- std::vector<std::string> DeserializeToVectorOfString(const std::string& str);
- std::string EraseTagSerialized(const std::string& fromStr, const std::string& tag);
+ MEDPARTITIONER_EXPORT std::string SerializeFromString(const std::string& s);
+ MEDPARTITIONER_EXPORT std::string SerializeFromVectorOfString(const std::vector<std::string>& vec);
+ MEDPARTITIONER_EXPORT std::vector<std::string> DeserializeToVectorOfString(const std::string& str);
+ MEDPARTITIONER_EXPORT std::string EraseTagSerialized(const std::string& fromStr, const std::string& tag);
- std::vector<std::string> VectorizeFromMapOfStringInt(const std::map<std::string,int>& mymap);
- std::map<std::string,int> DevectorizeToMapOfStringInt(const std::vector<std::string>& vec);
+ MEDPARTITIONER_EXPORT std::vector<std::string> VectorizeFromMapOfStringInt(const std::map<std::string,int>& mymap);
+ MEDPARTITIONER_EXPORT std::map<std::string,int> DevectorizeToMapOfStringInt(const std::vector<std::string>& vec);
- std::vector<std::string> VectorizeFromMapOfStringVectorOfString(const std::map< std::string,std::vector<std::string> >& mymap);
- std::map< std::string,std::vector<std::string> > DevectorizeToMapOfStringVectorOfString(const std::vector<std::string>& vec);
+ MEDPARTITIONER_EXPORT std::vector<std::string> VectorizeFromMapOfStringVectorOfString(const std::map< std::string,std::vector<std::string> >& mymap);
+ MEDPARTITIONER_EXPORT std::map< std::string,std::vector<std::string> > DevectorizeToMapOfStringVectorOfString(const std::vector<std::string>& vec);
- std::vector<std::string> SelectTagsInVectorOfString(const std::vector<std::string>& vec, const std::string tag);
- std::vector<std::string> DeleteDuplicatesInVectorOfString(const std::vector<std::string>& vec);
- std::map< std::string,std::vector<std::string> > DeleteDuplicatesInMapOfStringVectorOfString(const std::map< std::string,std::vector<std::string> >& mymap);
+ MEDPARTITIONER_EXPORT std::vector<std::string> SelectTagsInVectorOfString(const std::vector<std::string>& vec, const std::string tag);
+ MEDPARTITIONER_EXPORT std::vector<std::string> DeleteDuplicatesInVectorOfString(const std::vector<std::string>& vec);
+ MEDPARTITIONER_EXPORT std::map< std::string,std::vector<std::string> > DeleteDuplicatesInMapOfStringVectorOfString(const std::map< std::string,std::vector<std::string> >& mymap);
- std::string Cle1ToStr(const std::string& s, const int inew);
- void Cle1ToData(const std::string& cle, std::string& s, int& inew);
+ MEDPARTITIONER_EXPORT std::string Cle1ToStr(const std::string& s, const int inew);
+ MEDPARTITIONER_EXPORT void Cle1ToData(const std::string& cle, std::string& s, int& inew);
- std::string Cle2ToStr(const std::string& s,const int inew,const int iold);
- void Cle2ToData(const std::string& cle, std::string& s, int& inew, int& iold);
+ MEDPARTITIONER_EXPORT std::string Cle2ToStr(const std::string& s,const int inew,const int iold);
+ MEDPARTITIONER_EXPORT void Cle2ToData(const std::string& cle, std::string& s, int& inew, int& iold);
- std::string ExtractFromDescription(const std::string& description,const std::string& tag);
- void FieldDescriptionToData(const std::string& description,
+ MEDPARTITIONER_EXPORT std::string ExtractFromDescription(const std::string& description,const std::string& tag);
+ MEDPARTITIONER_EXPORT void FieldDescriptionToData(const std::string& description,
int& idomain, std::string& fileName, std::string& meshName, std::string& fieldName,
int& typeField, int& DT, int& IT);
- void FieldShortDescriptionToData(const std::string& description,
+ MEDPARTITIONER_EXPORT void FieldShortDescriptionToData(const std::string& description,
std::string& fieldName, int& typeField, int& entity, int& DT, int& IT);
ParaMEDMEM::DataArrayInt *CreateDataArrayIntFromVector(const std::vector<int>& v);
//void SendVectorOfString(const std::vector<std::string>& vec, const int target);
//std::vector<std::string> RecvVectorOfString(const int source);
//TODO void sendRecvVectorOfString(const std::vector<std::string>& vec, const int source, const int target);
- std::vector<std::string> SendAndReceiveVectorOfString(const std::vector<std::string>& vec, const int source, const int target);
- std::vector<std::string> AllgathervVectorOfString(const std::vector<std::string>& vec);
+ MEDPARTITIONER_EXPORT std::vector<std::string> SendAndReceiveVectorOfString(const std::vector<std::string>& vec, const int source, const int target);
+ MEDPARTITIONER_EXPORT std::vector<std::string> AllgathervVectorOfString(const std::vector<std::string>& vec);
void SendDoubleVec(const std::vector<double>& vec, const int target);
std::vector<double> *RecvDoubleVec(const int source);
void TestPersistantMpiRingOnCommSplit(int taille, int nb);
#endif
- class MyGlobals
+ class MEDPARTITIONER_EXPORT MyGlobals
{
public :
static int _Verbose; //0 to 1000 over 200 is debug