[cig-commits] commit: Merge in Underworld 1.4.1

Mercurial hg at geodynamics.org
Tue Mar 23 10:35:13 PDT 2010


changeset:   790:08d7abdd7da3
tag:         tip
parent:      776:6aad89cf361e
parent:      789:fe0b6b325b9a
user:        Walter Landry <wlandry at caltech.edu>
date:        Tue Mar 23 08:15:40 2010 -0700
files:       Base/Context/src/AbstractContext.c Base/Extensibility/src/ToolboxesManager.c doc/doxyimage/AuScopeSnMviclogo.png script/convert.py
description:
Merge in Underworld 1.4.1


diff -r 6aad89cf361e -r 08d7abdd7da3 .hgtags
--- a/.hgtags	Wed Feb 24 16:52:19 2010 -0800
+++ b/.hgtags	Tue Mar 23 08:15:40 2010 -0700
@@ -1,1 +1,7 @@ 5599e47d876d7d6410a4c0738f3e32664314ef44
 5599e47d876d7d6410a4c0738f3e32664314ef44 v1.2.0
+dea917cab00339d3eca1a56ef605d41b38d9364f 1.4.0
+afd74f5f857a83feaed5dd5b4ae403b47e569313 1.4.1
+afd74f5f857a83feaed5dd5b4ae403b47e569313 1.4.1
+0000000000000000000000000000000000000000 1.4.1
+0000000000000000000000000000000000000000 1.4.1
+b4b09b40046597ac4bf2365f0b3af61e5f981e5b 1.4.1
diff -r 6aad89cf361e -r 08d7abdd7da3 Base/Container/tests/HashTableSuite.c
--- a/Base/Container/tests/HashTableSuite.c	Wed Feb 24 16:52:19 2010 -0800
+++ b/Base/Container/tests/HashTableSuite.c	Tue Mar 23 08:15:40 2010 -0700
@@ -223,7 +223,7 @@ void HashTableSuite_TestInsertPointers( 
    /* This is a basic check that the number of collisions was within reason. Perhaps a stricter
     *  mathematical calc should really be performed here */
    /* Hash table has 255 places, only inserted 100 entries, therefore not many collisions expected */
-   pcu_check_true( sum <= (data->ptrTable->count * 0.3) );
+   pcu_check_true( sum <= (int)(data->ptrTable->count * 0.4) );
    
    /* Now parse the tree, and check the actual entries - note they won't necessarily be in same 'order'
     * while being parsed */
diff -r 6aad89cf361e -r 08d7abdd7da3 Base/Context/src/AbstractContext.c
--- a/Base/Context/src/AbstractContext.c	Wed Feb 24 16:52:19 2010 -0800
+++ b/Base/Context/src/AbstractContext.c	Tue Mar 23 08:15:40 2010 -0700
@@ -230,6 +230,9 @@ void _AbstractContext_Delete( void* abst
 	AbstractContext* self = (AbstractContext*)abstractContext;
 
 	Stg_Class_Delete( self->variable_Register );
+
+   /* unload all dynamic plugins */
+	PluginsManager_UnloadAll( self->plugins );
 	
 	/* Stg_Class_Delete parent */
 	_Stg_Component_Delete( self );
diff -r 6aad89cf361e -r 08d7abdd7da3 Base/Extensibility/src/PluginsManager.c
--- a/Base/Extensibility/src/PluginsManager.c	Wed Feb 24 16:52:19 2010 -0800
+++ b/Base/Extensibility/src/PluginsManager.c	Tue Mar 23 08:15:40 2010 -0700
@@ -121,11 +121,23 @@ Bool _PluginsManager_LoadPlugin( void* p
 	return True;
 }
 
+Bool PluginsManager_UnloadAll( void* pluginsManager ) {
+	PluginsManager* self = (PluginsManager*)pluginsManager;
+   Module* module = NULL;
+
+   while( self->modules->count ) {
+      module = (Module*)Stg_ObjectList_At( self->modules, self->modules->count - 1 ); /* reverse order deletion */
+      _PluginsManager_UnloadPlugin( self, module );
+   }
+
+   return True;
+}
 Bool _PluginsManager_UnloadPlugin( void* pluginsManager, Module* plugin ) {
 	PluginsManager* self = (PluginsManager*)pluginsManager;
 
-	ModulesManager_Unload( self );
-	
+   Module_UnLoad( plugin );
+   self->modules->count--;
+
 	return True;
 }
 
diff -r 6aad89cf361e -r 08d7abdd7da3 Base/Extensibility/src/PluginsManager.h
--- a/Base/Extensibility/src/PluginsManager.h	Wed Feb 24 16:52:19 2010 -0800
+++ b/Base/Extensibility/src/PluginsManager.h	Tue Mar 23 08:15:40 2010 -0700
@@ -95,6 +95,9 @@
 	/** Exactly what to do to unload the plugin */
 	Bool _PluginsManager_UnloadPlugin( void* pluginsManager, Module* plugin );
 
+   /** unload all plugins, this includes dlclosing when dynamic libs are used */
+   Bool PluginsManager_UnloadAll( void* pluginsManager );
+
 	/** Remove all plugins from register */
    void PluginsManager_RemoveAllFromComponentRegister( void* pluginsManager );
 	
diff -r 6aad89cf361e -r 08d7abdd7da3 Base/Extensibility/src/ToolboxesManager.c
--- a/Base/Extensibility/src/ToolboxesManager.c	Wed Feb 24 16:52:19 2010 -0800
+++ b/Base/Extensibility/src/ToolboxesManager.c	Tue Mar 23 08:15:40 2010 -0700
@@ -85,30 +85,19 @@ void _ToolboxesManager_Init( void* toolb
 void _ToolboxesManager_Init( void* toolboxesManager, int* argc, char*** argv ) {
 	ToolboxesManager*         self = (ToolboxesManager*)toolboxesManager;
 	
+   self->initTB = Stg_ObjectList_New();
 	self->argc = argc;
 	self->argv = argv;
-	self->_initialisedSize = 8;
-	self->initialised = Memory_Alloc_Array( char*, self->_initialisedSize, ToolboxesManager_Type );
-	self->_initialisedCount = 0;
 }
 
 
 void _ToolboxesManager_Delete( void* toolboxesManager ) {
-	ToolboxesManager*         self = (ToolboxesManager*)toolboxesManager;
-  unsigned count;
+   ToolboxesManager*         self = (ToolboxesManager*)toolboxesManager;
+   int ii, originalListSize;
 
-  /* free all strings, defining loaded Toolboxes */
-  for( count = 0 ; count < self->_initialisedCount ; count++ ) {
-    Memory_Free( self->initialised[count] );
-  }
-	Memory_Free( self->initialised );
-	self->_initialisedSize = 0;
-	self->_initialisedCount = 0;
-	self->initialised = 0;
-	
 	Stg_ObjectList_DeleteAllObjects( self->codelets );
 	Stg_Class_Delete( self->codelets );
-	ModulesManager_Unload( self ); 
+	ModulesManager_Unload( self );  /* this will unload all toolboxes implicitly */
 	Stg_Class_Delete( self->modules );
 	
 	/* Delete parent */
@@ -121,13 +110,13 @@ void _ToolboxesManager_Print( void* tool
 	/* General info */
 	Journal_Printf( (void*) stream, "Toolboxes (ptr): %p\n", self );
 	
-	if( self->_initialisedCount > 0 ) {
+	if( Stg_ObjectList_Count(self->initTB) > 0 ) {
 		Index i;
 		
 		Journal_Printf( stream, "Initialised Modules:\n" );
 		Stream_Indent( stream );
-		for( i = 0; i < self->_initialisedCount; ++i ) {
-			Journal_Printf( stream, "%s\n", self->initialised[i] );
+		for( i = 0; i < Stg_ObjectList_Count(self->initTB) ; ++i ) {
+			Journal_Printf( stream, "%s\n", self->initTB->data[i]->name );
 		}
 		Stream_UnIndent( stream );
 	}
@@ -150,16 +139,26 @@ Bool _ToolboxesManager_LoadToolbox( void
 Bool _ToolboxesManager_LoadToolbox( void* toolboxesManager, Module* toolbox ) {
 	ToolboxesManager* self = (ToolboxesManager*)toolboxesManager;
 	
-	((Toolbox*)toolbox)->Initialise( self, self->argc, self->argv );
-	((Toolbox*)toolbox)->Register( self );
-    
+   /* if not Loaded call the Initialise() and Register() */
+   if( !Stg_ObjectList_Get( self->initTB, toolbox->name ) ) {
+
+      ((Toolbox*)toolbox)->Initialise( self, self->argc, self->argv );
+      ((Toolbox*)toolbox)->Register( self );
+
+      Stg_ObjectList_Append( self->initTB, toolbox );
+   }
 	return True;
 }
 
 Bool _ToolboxesManager_UnloadToolbox( void* toolboxesManager, Module* toolbox ) {
 	ToolboxesManager* self = (ToolboxesManager*)toolboxesManager;
 	
-	((Toolbox*)toolbox)->Finalise( self );
+   if( Stg_ObjectList_Get( self->initTB, toolbox->name ) ) {
+      ((Toolbox*)toolbox)->Finalise( self );
+
+      /* remove the toolbox from the initTB list, but don't actually Delete it's memory */
+      Stg_ObjectList_Remove( self->initTB, toolbox->name, KEEP );
+   }
     
 	return True;
 }
@@ -173,36 +172,14 @@ Name _ToolboxesManager_GetModuleName( vo
 	return Dictionary_Entry_Value_AsString( Dictionary_Entry_Value_GetElement( moduleVal, entry_I ) );
 }
 
-Index ToolboxesManager_SetInitialised( void* initRegister, char* label ) {
+Bool ToolboxesManager_IsInitialised( void* initRegister, char* label ) {
 	ToolboxesManager* self = (ToolboxesManager*)initRegister;
-	
-	if( self->_initialisedCount == self->_initialisedSize ) {
-		Index oldSize = self->_initialisedSize;
-		char** tmp;
-		
-		self->_initialisedSize += 8;
-		tmp = Memory_Alloc_Array( char*, self->_initialisedSize, ToolboxesManager_Type );
-		memcpy( tmp, self->initialised, sizeof( char* ) * oldSize );
-		Memory_Free( self->initialised );
-		self->initialised = tmp;
-	}
-	
-	self->initialised[self->_initialisedCount] = StG_Strdup( label );
-	self->_initialisedCount += 1;
-	return self->_initialisedCount - 1;
+
+   if( Stg_ObjectList_Get( self->initTB, label ) )
+      return True;
+   else
+      return False;
 }
 
-Bool ToolboxesManager_IsInitialised( void* initRegister, char* label ) {
-	ToolboxesManager* self = (ToolboxesManager*)initRegister;
-	Index i;
-	
-	for( i = 0; i < self->_initialisedCount; i++ ) {
-		if( strcmp( label, self->initialised[i] ) == 0 ) {
-			return True;
-		}
-	}
-	return False;
-}
 
 
-
diff -r 6aad89cf361e -r 08d7abdd7da3 Base/Extensibility/src/ToolboxesManager.h
--- a/Base/Extensibility/src/ToolboxesManager.h	Wed Feb 24 16:52:19 2010 -0800
+++ b/Base/Extensibility/src/ToolboxesManager.h	Tue Mar 23 08:15:40 2010 -0700
@@ -45,20 +45,18 @@
 	/* Textual name of this class */
 	extern const Type ToolboxesManager_Type;
 
-	
 	/* Toolboxes info */
-	#define __ToolboxesManager \
-		/* General info */ \
-		__ModulesManager \
-		\
-		/* Virtual info */ \
-		\
-		/* Toolboxes info */ \
-		int*       argc; \
-		char***    argv; \
-		char**     initialised; \
-		Index      _initialisedSize; \
-		Index      _initialisedCount;
+   #define __ToolboxesManager \
+      /* General info */ \
+      __ModulesManager \
+      \
+      /* Virtual info */ \
+      \
+      /* Toolboxes info */ \
+      Stg_ObjectList *initTB; /* list of initialised toolboxes */ \
+      int*       argc; \
+      char***    argv;
+		
 		
 	struct ToolboxesManager { __ToolboxesManager };
 	
@@ -110,10 +108,6 @@
 
 	#define ToolboxesManager_Submit ModulesManager_Submit
 
-	/** Let StGermain know that the "Init" function of a module has been called. This exists to handle the case where a module
-	   is linked into a binary and the user attempts to module load the module too. */
-	Index ToolboxesManager_SetInitialised( void* toolboxesManager, char* label );
-	
 	/** This exists to handle the case where a module is linked into a binary and the user attempts to module load the module too. 
 	   Its expected at modules will check to see if they have been inited already before doing initialisation work in the init 
 	   function. */
diff -r 6aad89cf361e -r 08d7abdd7da3 Base/Foundation/tests/TimeMonitorSuite.c
--- a/Base/Foundation/tests/TimeMonitorSuite.c	Wed Feb 24 16:52:19 2010 -0800
+++ b/Base/Foundation/tests/TimeMonitorSuite.c	Tue Mar 23 08:15:40 2010 -0700
@@ -61,7 +61,8 @@ void TimeMonitorSuite_TestTimingPeriod( 
    sleep( 2 );
    Stg_TimeMonitor_End( tm, &tmData );
 
-   pcu_check_true( ( 2.95 < tmData.totalSinceInit ) && ( tmData.totalSinceInit < 3.05 ) );
+	printf( "Total Since Init: %f\n", tmData.totalSinceInit );
+   pcu_check_true( ( (double)2.95 < tmData.totalSinceInit ) && ( tmData.totalSinceInit < (double)5.05 ) );
    pcu_check_true( ( 1.95 < tmData.dt ) && ( tmData.dt < 2.05 ) );
    pcu_check_true( ( 1.95 < tmData.aveProcDt ) && ( tmData.aveProcDt < 2.05 ) );
    percentOfTotalCalc = tmData.aveProcDt / tmData.totalSinceInit * 100;
diff -r 6aad89cf361e -r 08d7abdd7da3 doc/doxyimage/AuScopeSnMviclogo.jpg
Binary file doc/doxyimage/AuScopeSnMviclogo.jpg has changed
diff -r 6aad89cf361e -r 08d7abdd7da3 doc/doxyimage/AuScopeSnMviclogo.png
Binary file doc/doxyimage/AuScopeSnMviclogo.png has changed
diff -r 6aad89cf361e -r 08d7abdd7da3 doc/doxyimage/vpac_logo_header.jpg
Binary file doc/doxyimage/vpac_logo_header.jpg has changed
diff -r 6aad89cf361e -r 08d7abdd7da3 doc/footer.html
--- a/doc/footer.html	Wed Feb 24 16:52:19 2010 -0800
+++ b/doc/footer.html	Tue Mar 23 08:15:40 2010 -0700
@@ -3,7 +3,7 @@
 <tr>
 <td><img src="$relpath$monashlogo.jpg" alt="monashlogo" align="lef" border="0" height="60px"></td>
 <td><img src="$relpath$vpac_logo_header.jpg" alt="vpaclogo"align="right" border="0" height="60px"></td> 
-<td><img src="$relpath$AuScopeSnMviclogo.png" alt="auscopelogo" align="right" border="0" height="60px">
+<td><img src="$relpath$AuScopeSnMviclogo.jpg" alt="auscopelogo" align="right" border="0" height="60px">
 </td></tr></table>
 <hr size="1">
 
diff -r 6aad89cf361e -r 08d7abdd7da3 script/convert.py
--- a/script/convert.py	Wed Feb 24 16:52:19 2010 -0800
+++ b/script/convert.py	Tue Mar 23 08:15:40 2010 -0700
@@ -1,6 +1,7 @@
 
 import stgDtd
 import stgMetaXsd
+import string
 
 def dtd2MetaXsd( xml_text ):
 	# Parse DTD
@@ -44,7 +45,7 @@ def dtdDict2metaXsdDict( stgDtdDict ):
 	meta["info"]["rights"] = stgDtdDict["License"]
 	meta["info"]["source"] = stgDtdDict["Location"]
 	meta["info"]["subject"] = stgDtdDict["Project"]
-	meta["info"]["description"] = stgDtdDict["Description"]
+	meta["info"]["description"] = stgDtdDict["Description"].replace('\\','\\\\')
 
 	# Code...
 	meta["code"] = {}
@@ -69,7 +70,7 @@ def dtdDict2metaXsdDict( stgDtdDict ):
 		pass
 	try:
 		if stgDtdDict["Equation"] != '...':
-			meta["implements"]["equation"] = stgDtdDict["Equation"]
+			meta["implements"]["equation"] = stgDtdDict["Equation"].replace('\\','\\\\')
 	except KeyError:
 		pass
 
@@ -107,7 +108,7 @@ def dtdDict2metaXsdDict( stgDtdDict ):
 			except KeyError:
 				pass
 			try:
-				p["documentation"] = param["Description"]
+				p["documentation"] = param["Description"].replace('\\','\\\\')
 			except KeyError:
 				pass
 			meta["parameters"].append( p )
@@ -130,7 +131,7 @@ def dtdDict2metaXsdDict( stgDtdDict ):
 			except KeyError:
 				a["nillable"] = "false"
 			try:
-				a["documentation"] = assoc["Description"]
+				a["documentation"] = assoc["Description"].replace('\\','\\\\')
 			except KeyError:
 				pass
 			meta["associations"].append( a )
diff -r 6aad89cf361e -r 08d7abdd7da3 script/createDocs.py
--- a/script/createDocs.py	Wed Feb 24 16:52:19 2010 -0800
+++ b/script/createDocs.py	Tue Mar 23 08:15:40 2010 -0700
@@ -13,7 +13,7 @@ def findProjectDirectories(mainDirectory
     projectNames = os.listdir(directory)
     # remove items from list that are not projects:
     # known examples: config, DOC, Doc, doc
-    directoryValues = ['config', 'DOC', 'doc', 'Doc', '.hg', 'DOXYGEN', 'build', 'script', '.sconf_temp', 'scons']
+    directoryValues = ['config', 'DOC', 'doc', 'Doc', '.hg', 'DOXYGEN', 'build', 'script', '.sconf_temp', 'scons', 'sconf_temp']
     for value in directoryValues:
         if (projectNames.count(value) > 0) :
             projectNames.remove(value)
@@ -110,7 +110,7 @@ def createListDictionary(arg1, arg2, arg
     dictionary['htmlFooter'] =  "footer.html"
     dictionary['htmlStylesheet'] =  "customdoxygen.css"
     dictionary['htmlImagesPath'] = "doxyimage/"
-    dictionary['projectNumber'] = 'Bleeding Edge'
+    dictionary['projectNumber'] = '1.4'
     dictionary['configNew'] =  "Doxyfile.new"
     dictionary['htmlDir'] = "html/"
     return dictionary



More information about the CIG-COMMITS mailing list