From: asv Date: Fri, 17 Feb 2006 07:34:30 +0000 (+0000) Subject: Merge with head and (in salome_adm) with OCC_development..a2 branch. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=867efd7a83d8aa275ab62f8a5c867440fdd38165;p=modules%2Fkernel.git Merge with head and (in salome_adm) with OCC_development..a2 branch. --- diff --git a/INSTALL b/INSTALL index 5feb42fc3..d4f202f61 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,6 @@ -This is the version 3.1.0 of KERNEL +This is the version 3.2.0a1 of KERNEL Previous versions : + - 3.1.0 - 3.0.0 - 2.2.4 - 2.2.3 diff --git a/bin/VERSION b/bin/VERSION index 140772c27..45dcc2b0e 100755 --- a/bin/VERSION +++ b/bin/VERSION @@ -1 +1 @@ -THIS IS SALOME - KERNEL VERSION: 3.1.0 +THIS IS SALOME - KERNEL VERSION: 3.2.0a1 diff --git a/bin/createAppli.sh b/bin/createAppli.sh index c6c4de072..1ff6ed6de 100755 --- a/bin/createAppli.sh +++ b/bin/createAppli.sh @@ -3,5 +3,15 @@ comName=`which $0` rep=`dirname $comName` -cp -r $rep/appliskel $1 -chmod +x $1/*.sh $1/run* $1/envd +if [ $# -ne 1 ] + echo "--- usage:" + echo $0 AppliName + echo "--- In which AppliName is a directory to create with SALOME application scripts" +elif [ -d $1] + echo $1 "directory already exists, nothing done" +else + mkdir -p $1 + cp -r $rep/appliskel/* $1 + cp $rep/appliskel/.bashrc $1 + chmod +x $1/*.sh $1/run* $1/envd +fi \ No newline at end of file diff --git a/doc/salome/tui/KERNEL/doxyfile b/doc/salome/tui/KERNEL/doxyfile index 1758a66e5..95584c08b 100755 --- a/doc/salome/tui/KERNEL/doxyfile +++ b/doc/salome/tui/KERNEL/doxyfile @@ -3,7 +3,7 @@ #--------------------------------------------------------------------------- # General configuration options #--------------------------------------------------------------------------- -PROJECT_NAME = "SALOME v.3.1.0" +PROJECT_NAME = "SALOME v.3.2.0a1" PROJECT_NUMBER = id#1.1 OUTPUT_DIRECTORY = ../ OUTPUT_LANGUAGE = English diff --git a/doc/salome/tui/KERNEL/sources/static/tree.js b/doc/salome/tui/KERNEL/sources/static/tree.js index 0ddcfec0f..e5e050f9b 100755 --- a/doc/salome/tui/KERNEL/sources/static/tree.js +++ b/doc/salome/tui/KERNEL/sources/static/tree.js @@ -1,4 +1,4 @@ -foldersTree = gFld("SALOME v.3.1.0 ", "", "") +foldersTree = gFld("SALOME v.3.2.0a1 ", "", "") insDoc(foldersTree, gLnk("Main Page", "", "main.html")) aux1 = insFld(foldersTree, gFld("TUI Reference Guide", "")) diff --git a/resources/CatalogResources.xml b/resources/CatalogResources.xml index 2a074cda7..96b0c448b 100644 --- a/resources/CatalogResources.xml +++ b/resources/CatalogResources.xml @@ -3,44 +3,44 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + diff --git a/resources/KERNELCatalog.xml b/resources/KERNELCatalog.xml index 836c6cadb..380055e64 100644 --- a/resources/KERNELCatalog.xml +++ b/resources/KERNELCatalog.xml @@ -16,7 +16,7 @@ Salome Other NRI - 3.1.0 + 3.2.0a1 GUI Neutral Context 1 @@ -27,7 +27,7 @@ SalomeTestComponent Other NRI - 3.1.0 + 3.2.0a1 GUI Neutral Context 1 'linux' ~ OS @@ -37,7 +37,7 @@ SALOME_TestComponentPy Other NRI - 3.1.0 + 3.2.0a1 GUI Neutral Context 1 'linux' ~ OS diff --git a/salome_adm/unix/config_files/check_boost.m4 b/salome_adm/unix/config_files/check_boost.m4 index c77edba5d..c31e57b2b 100644 --- a/salome_adm/unix/config_files/check_boost.m4 +++ b/salome_adm/unix/config_files/check_boost.m4 @@ -32,6 +32,9 @@ BOOST_CPPFLAGS="" AC_SUBST(BOOST_LIBS) BOOST_LIBS="" +AC_SUBST(BOOST_LIBTHREAD) +BOOST_LIBTHREAD="" + boost_ok=no if test -z ${BOOSTDIR}; then @@ -58,7 +61,24 @@ else AC_CHECKING(for libboost_thread-mt.so library file) AC_CHECK_FILE(${BOOSTDIR}/lib/libboost_thread-mt.so,boost_ok=yes,boost_ok=no) if test "x${boost_ok}" = "xyes" ; then - BOOST_LIBS="-L${BOOSTDIR}/lib" + BOOST_LIBTHREAD="libboost_thread-mt.so" + AC_MSG_RESULT(\$BOOST_LIBTHREAD = ${BOOST_LIBTHREAD}) + BOOST_LIBTHREAD="-mt" + else + AC_CHECKING(for libboost_thread.so library file) + AC_CHECK_FILE(${BOOSTDIR}/lib/libboost_thread.so,boost_ok=yes,boost_ok=no) + if test "x${boost_ok}" = "xyes" ; then + BOOST_LIBTHREAD="libboost_thread.so" + AC_MSG_RESULT(\$BOOST_LIBTHREAD = ${BOOST_LIBTHREAD}) + BOOST_LIBTHREAD="" + fi + fi + if test "x${boost_ok}" = "xyes" ; then + if test "x${BOOSTDIR}" = "x/usr" ; then + BOOST_LIBS="" + else + BOOST_LIBS="-L${BOOSTDIR}/lib" + fi AC_MSG_RESULT(\$BOOST_LIBS = ${BOOST_LIBS}) fi fi diff --git a/salome_adm/unix/config_files/check_lam.m4 b/salome_adm/unix/config_files/check_lam.m4 index d15fdde31..4a9941e2c 100644 --- a/salome_adm/unix/config_files/check_lam.m4 +++ b/salome_adm/unix/config_files/check_lam.m4 @@ -88,8 +88,25 @@ if test "$WITHLAM" = yes; then AC_CHECK_LIB(mpi,MPI_Init,WITHLAM="yes",WITHLAM="no") if test "$WITHLAM" = "yes";then MPI_LIBS="-lmpi $MPI_LIBS" + LIBS="-lmpi $LIBS" fi + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + LIBS="-llammpi++ $LIBS" + AC_MSG_CHECKING(for MPI_Init in -llammpi++) + AC_TRY_LINK([ + #include + ], [MPI::Init();], + WITHLAM="yes",WITHLAM="no") + if test "$WITHLAM" = "yes";then + AC_MSG_RESULT(yes) + MPI_LIBS="-llammpi++ $MPI_LIBS" + else + AC_MSG_RESULT(no) + fi + AC_LANG_RESTORE + AC_CHECK_LIB(mpi,MPI_Publish_name,WITHMPI2="yes",WITHMPI2="no") fi diff --git a/salome_adm/unix/config_files/check_pthreads.m4 b/salome_adm/unix/config_files/check_pthreads.m4 index 80aef2aad..d5033889e 100644 --- a/salome_adm/unix/config_files/check_pthreads.m4 +++ b/salome_adm/unix/config_files/check_pthreads.m4 @@ -38,6 +38,8 @@ if test $flag = no; then AC_CHECK_LIB(posix4,nanosleep, LIBS_PTHREADS="-lposix4",LIBS_PTHREADS="") AC_CHECK_LIB(pthread,pthread_mutex_lock, LIBS_PTHREADS="-lpthread $LIBS_PTHREADS",LIBS_PTHREADS="") +else + LDFLAGS="-pthread $LDFLAGS" fi if test $flag = no && x$LIBS_PTHREADS = x; then diff --git a/salome_adm/unix/make_commence.in b/salome_adm/unix/make_commence.in index 31535c4a6..d1b961624 100644 --- a/salome_adm/unix/make_commence.in +++ b/salome_adm/unix/make_commence.in @@ -43,6 +43,7 @@ CXX_DEPEND_FLAG = @CXX_DEPEND_FLAG@ BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ BOOST_LIBS = @BOOST_LIBS@ +BOOST_LIBTHREAD = @BOOST_LIBTHREAD@ # OpenPBS diff --git a/src/Communication/ReceiverFactory.cxx b/src/Communication/ReceiverFactory.cxx index f404a7ec3..94743bfae 100644 --- a/src/Communication/ReceiverFactory.cxx +++ b/src/Communication/ReceiverFactory.cxx @@ -115,7 +115,7 @@ double *ReceiverFactory::getValueOneShot(SALOME::SenderDouble_ptr sender,long &s else if(!CORBA::is_nil(mpi_ptr)) { CORBA::release(sender); - MPIReceiver rec(mpi_ptr); + MPIReceiver rec(mpi_ptr); return rec.getValue(size); } #endif @@ -165,7 +165,7 @@ int *ReceiverFactory::getValueOneShot(SALOME::SenderInt_ptr sender,long &size)th else if(!CORBA::is_nil(mpi_ptr)) { CORBA::release(sender); - MPIReceiver rec(mpi_ptr); + MPIReceiver rec(mpi_ptr); return rec.getValue(size); } #endif diff --git a/src/Communication/Receivers.cxx b/src/Communication/Receivers.cxx index f97b4a1a4..f2ce1fa89 100644 --- a/src/Communication/Receivers.cxx +++ b/src/Communication/Receivers.cxx @@ -154,17 +154,17 @@ T *CorbaWCWithCopyReceiver::get #ifdef HAVE_MPI2 -template -MPIReceiver::MPIReceiver(CorbaSender mySender):_mySender(mySender){ +template +MPIReceiver::MPIReceiver(CorbaSender mySender):_mySender(mySender){ } -template -MPIReceiver::~MPIReceiver(){ +template +MPIReceiver::~MPIReceiver(){ _mySender->release(); } -template -T *MPIReceiver::getDistValue(long &size){ +template +T *MPIReceiver::getDistValue(long &size){ int i=0; int myproc; int sproc; @@ -211,15 +211,15 @@ T *MPIReceiver::getDistValue(long &size){ } MPI_Recv( &_n, 1, MPI_LONG, sproc,p->tag1,com,&status); _v = new T[_n]; - MPI_Recv( _v, _n, T2, sproc,p->tag2,com,&status); + MPI_Recv( _v, _n, MPITRAITS::MpiType, sproc,p->tag2,com,&status); _mySender->close(p); MPI_Comm_disconnect( &com ); size=_n; return _v; } -template -T *MPIReceiver::getValue(long &size) +template +T *MPIReceiver::getValue(long &size) { return Receiver::getValue(size,_mySender); } diff --git a/src/Communication/Receivers.hxx b/src/Communication/Receivers.hxx index 203bf64dc..2dd44a854 100644 --- a/src/Communication/Receivers.hxx +++ b/src/Communication/Receivers.hxx @@ -94,7 +94,19 @@ private: /*! Receiver for MPI transfert. */ -template +template +struct MPITRAITS +{ + static MPI_Datatype MpiType; +}; + +template<> +MPI_Datatype MPITRAITS::MpiType=MPI_DOUBLE; + +template<> +MPI_Datatype MPITRAITS::MpiType=MPI_INT; + +template class MPIReceiver : public Receiver { private: diff --git a/src/Communication/SALOME_Comm_i.cxx b/src/Communication/SALOME_Comm_i.cxx index f886b5387..632ce7a73 100644 --- a/src/Communication/SALOME_Comm_i.cxx +++ b/src/Communication/SALOME_Comm_i.cxx @@ -272,7 +272,7 @@ SALOME::MPISender::param* SALOME_MPISender_i::getParam() void SALOME_MPISender_i::send() { _type=getTypeOfDataTransmitted(); - _argsForThr=new (void *)[8]; + _argsForThr=new void *[8]; _argsForThr[0]=_portName; _argsForThr[1]=&_lgrTabToSend; _argsForThr[2]=(void *)_tabToSend; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index b38df3443..452a50a79 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -1266,14 +1266,18 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath, Handle(SALOMEDSImpl_SComponent) sco = itcomponent.Value(); aCompType = sco->ComponentDataType(); //GEOM and MED are independent components - if(aCompType == "GEOM" || aCompType == "MED") aSeq.Prepend(TCollection_ExtendedString(aCompType)); - else aSeq.Append(TCollection_ExtendedString(aCompType)); + if (aCompType == "GEOM" || aCompType == "MED") + aSeq.Prepend(TCollection_ExtendedString(aCompType)); + else + aSeq.Append(TCollection_ExtendedString(aCompType)); } #ifdef WIN32 - TCollection_AsciiString aFileName=thePath+TCollection_AsciiString("\\")+theBaseName+TCollection_AsciiString(".py"); + TCollection_AsciiString aFileName = + thePath + TCollection_AsciiString("\\") + theBaseName + TCollection_AsciiString(".py"); #else - TCollection_AsciiString aFileName=thePath+TCollection_AsciiString("/")+theBaseName+TCollection_AsciiString(".py"); + TCollection_AsciiString aFileName = + thePath + TCollection_AsciiString("/") + theBaseName + TCollection_AsciiString(".py"); #endif //Create a file that will contain a main Study script @@ -1293,7 +1297,8 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath, TCollection_AsciiString aBatchModeScript = "salome"; - //Output to the main Study script required Python modules import, set sys.path and add a creation of the study. + //Output to the main Study script required Python modules import, + //set sys.path and add a creation of the study. fp << GetDumpStudyComment().ToCString() << endl << endl; fp << "import sys" << endl; fp << "import " << aBatchModeScript << "\n" << endl; @@ -1374,9 +1379,9 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath, fp2.open(aFileName.ToCString(), ios::out); #ifdef WIN32 - isOpened = fp.is_open(); + isOpened = fp2.is_open(); #else - isOpened = fp.rdbuf()->is_open(); + isOpened = fp2.rdbuf()->is_open(); #endif if(!isOpened) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx index b6e861c10..ebf67aeca 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx @@ -1214,7 +1214,8 @@ static void ReadAttributes(const Handle(SALOMEDSImpl_Study)& theStudy, if (!strcmp(hdf_dataset->GetName(),"COMPONENTDATATYPE")) { anAttr = theStudy->NewBuilder()->FindOrCreateAttribute(aSO, "AttributeComment"); - } else if (!strcmp(hdf_dataset->GetName(),"AttributeReference")) { + } else if (!strcmp(hdf_dataset->GetName(),"AttributeReference") || + !strcmp(hdf_dataset->GetName(),"Reference")) { // Old format maintainance theStudy->NewBuilder()->Addreference(aSO, theStudy->CreateObjectID(current_string)); delete(current_string); hdf_dataset->CloseOnDisk(); diff --git a/src/TOOLSDS/SALOMEDS_Tool.cxx b/src/TOOLSDS/SALOMEDS_Tool.cxx index fa13a1eb4..90263d1de 100644 --- a/src/TOOLSDS/SALOMEDS_Tool.cxx +++ b/src/TOOLSDS/SALOMEDS_Tool.cxx @@ -150,112 +150,133 @@ void SALOMEDS_Tool::RemoveTemporaryFiles(const std::string& theDirectory, // function : PutFilesToStream // purpose : converts the files from a list 'theFiles' to the stream //============================================================================ -SALOMEDS::TMPFile* -SALOMEDS_Tool::PutFilesToStream(const std::string& theFromDirectory, - const SALOMEDS::ListOfFileNames& theFiles, - const int theNamesOnly) +namespace { - int i, aLength = theFiles.length(); - if(aLength == 0) -// return NULL; - return (new SALOMEDS::TMPFile); - - //Get a temporary directory for saved a file - TCollection_AsciiString aTmpDir(const_cast(theFromDirectory.c_str())); - - long aBufferSize = 0; - long aCurrentPos; - - int aNbFiles = 0; - int* aFileNameSize= new int[aLength]; - long* aFileSize= new long[aLength]; - - //Determine the required size of the buffer - - for(i=0; i(theFromDirectory.c_str())); + + long aBufferSize = 0; + long aCurrentPos; + + int aNbFiles = 0; + int* aFileNameSize= new int[aLength]; + long* aFileSize= new long[aLength]; - if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero - TCollection_AsciiString aFullPath = aTmpDir + CORBA::string_dup(theFiles[i]); - OSD_Path anOSDPath(aFullPath); - OSD_File anOSDFile(anOSDPath); - if(!anOSDFile.Exists()) continue; + //Determine the required size of the buffer + + for(i=0; i(theFiles[i].in()); + OSD_Path anOSDPath(aFullPath); + OSD_File anOSDFile(anOSDPath); + if(!anOSDFile.Exists()) continue; #ifdef WNT - ifstream aFile(aFullPath.ToCString(), ios::binary); + ifstream aFile(aFullPath.ToCString(), ios::binary); #else - ifstream aFile(aFullPath.ToCString()); + ifstream aFile(aFullPath.ToCString()); #endif - aFile.seekg(0, ios::end); - aFileSize[i] = aFile.tellg(); - aBufferSize += aFileSize[i]; //Add a space to store the file - } - aFileNameSize[i] = strlen(theFiles[i])+1; - aBufferSize += aFileNameSize[i]; //Add a space to store the file name - aBufferSize += (theNamesOnly)?4:12; //Add 4 bytes: a length of the file name, - // 8 bytes: length of the file itself - aNbFiles++; - } - - aBufferSize += 4; //4 bytes for a number of the files that will be written to the stream; - unsigned char* aBuffer = new unsigned char[aBufferSize]; - if(aBuffer == NULL) -// return NULL; - return (new SALOMEDS::TMPFile); - - //Initialize 4 bytes of the buffer by 0 - memset(aBuffer, 0, 4); - //Copy the number of files that will be written to the stream - memcpy(aBuffer, &aNbFiles, ((sizeof(int) > 4) ? 4 : sizeof(int))); - - - aCurrentPos = 4; - - for(i=0; i 4) ? 4 : sizeof(int))); + + + aCurrentPos = 4; + + for(i=0; i(theFiles[i].in()); + OSD_Path anOSDPath(aFullPath); + OSD_File anOSDFile(anOSDPath); + if(!anOSDFile.Exists()) continue; #ifdef WNT - aFile = new ifstream(aFullPath.ToCString(), ios::binary); + aFile = new ifstream(aFullPath.ToCString(), ios::binary); #else - aFile = new ifstream(aFullPath.ToCString()); + aFile = new ifstream(aFullPath.ToCString()); #endif - } - //Initialize 4 bytes of the buffer by 0 - memset((aBuffer + aCurrentPos), 0, 4); - //Copy the length of the file name to the buffer - memcpy((aBuffer + aCurrentPos), (aFileNameSize + i), ((sizeof(int) > 4) ? 4 : sizeof(int))); - aCurrentPos += 4; - - //Copy the file name to the buffer - memcpy((aBuffer + aCurrentPos), theFiles[i], aFileNameSize[i]); - aCurrentPos += aFileNameSize[i]; - - if (!theNamesOnly) { // mpv 15.01.2003: we don't copy file content to the buffer if !theNamesOnly - //Initialize 8 bytes of the buffer by 0 - memset((aBuffer + aCurrentPos), 0, 8); - //Copy the length of the file to the buffer - memcpy((aBuffer + aCurrentPos), (aFileSize + i), ((sizeof(long) > 8) ? 8 : sizeof(long))); - aCurrentPos += 8; + } + //Initialize 4 bytes of the buffer by 0 + memset((aBuffer + aCurrentPos), 0, 4); + //Copy the length of the file name to the buffer + memcpy((aBuffer + aCurrentPos), (aFileNameSize + i), ((sizeof(int) > 4) ? 4 : sizeof(int))); + aCurrentPos += 4; - aFile->seekg(0, ios::beg); - aFile->read((char *)(aBuffer + aCurrentPos), aFileSize[i]); - aFile->close(); - delete(aFile); - aCurrentPos += aFileSize[i]; + //Copy the file name to the buffer + memcpy((aBuffer + aCurrentPos), theFileNames[i], aFileNameSize[i]); + aCurrentPos += aFileNameSize[i]; + + if (!theNamesOnly) { // mpv 15.01.2003: we don't copy file content to the buffer if !theNamesOnly + //Initialize 8 bytes of the buffer by 0 + memset((aBuffer + aCurrentPos), 0, 8); + //Copy the length of the file to the buffer + memcpy((aBuffer + aCurrentPos), (aFileSize + i), ((sizeof(long) > 8) ? 8 : sizeof(long))); + aCurrentPos += 8; + + aFile->seekg(0, ios::beg); + aFile->read((char *)(aBuffer + aCurrentPos), aFileSize[i]); + aFile->close(); + delete(aFile); + aCurrentPos += aFileSize[i]; + } } + + delete[] aFileNameSize; + delete[] aFileSize; + + + CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer; + + return (new SALOMEDS::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1)); } - - delete[] aFileNameSize; - delete[] aFileSize; - - CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer; - - return (new SALOMEDS::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1)); +} + + +SALOMEDS::TMPFile* +SALOMEDS_Tool::PutFilesToStream(const std::string& theFromDirectory, + const SALOMEDS::ListOfFileNames& theFiles, + const int theNamesOnly) +{ + SALOMEDS::ListOfFileNames aFileNames(theFiles); + return ::PutFilesToStream(theFromDirectory,theFiles,aFileNames,theNamesOnly); +} + + +SALOMEDS::TMPFile* +SALOMEDS_Tool::PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles, + const SALOMEDS::ListOfFileNames& theFileNames) +{ + return ::PutFilesToStream("",theFiles,theFileNames,0); } //============================================================================ diff --git a/src/TOOLSDS/SALOMEDS_Tool.hxx b/src/TOOLSDS/SALOMEDS_Tool.hxx index c36de54e7..7c7f33a0f 100644 --- a/src/TOOLSDS/SALOMEDS_Tool.hxx +++ b/src/TOOLSDS/SALOMEDS_Tool.hxx @@ -64,6 +64,10 @@ public: const SALOMEDS::ListOfFileNames& theFiles, const int theNamesOnly = 0); + // Converts files listed in which will be named as pointed in the into a byte sequence TMPFile + static SALOMEDS::TMPFile* PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles, + const SALOMEDS::ListOfFileNames& theFileNames); + // Converts a byte sequence to files and places them in static SALOMEDS::ListOfFileNames_var PutStreamToFiles(const SALOMEDS::TMPFile& theStream, const std::string& theToDirectory,