[cig-commits] commit: Long awaited plugin/toolbox formalisation

Mercurial hg at geodynamics.org
Mon Nov 24 11:30:31 PST 2008


changeset:   36:6247718ede20
user:        SteveQuenette
date:        Thu Aug 02 08:41:48 2007 +0000
files:       MaterialPoints/tests/testPeriodicBCs.c libPICellerator/Makefile.def libPICellerator/Toolbox/Toolbox.c libPICellerator/Toolbox/Toolbox.h libPICellerator/Toolbox/Toolbox.meta libPICellerator/Toolbox/makefile libPICellerator/src/Init.c plugins/Application/Application.c plugins/Application/Application.h plugins/Application/makefile plugins/makefile
description:
Long awaited plugin/toolbox formalisation
* plugins and toolboxes have their own containers
* the toolbox manager is a singleton created and deleted with the extensibility layer
* old toolbox code cleaned and fixed up (doesn't crash on exit)
* --import[]=BLAH to load toolbox BLAH
* plugin and toolbox dependency code verified
* note: very ugly context growth/swapping still occurs!

Nomenclature:
* Module: a dll that is loaded into the system. At present a module is either a plugin or toolbox  (abstract class with all the grunt work in it). Formerly PluginLoader.
* Toolbox: e.g. StgFEM, PICellerator, Underworld...  libraries of features loaded into the system. Their main purpose is to register components to the component factory, etc, such that the main building blocks exist to build models.  The Init and Finalise function is called for the respective library.
* Plugin: addons to models.  They are instantiated late.
* ModulesManager/PluginsManager/ToolboxesManager: the abstract, plugins and toolboxes container/manager.

Still to do:
* module name mangling (such that we can say --import[]=StgFEM instead of --import[]=StgFEM_Toolbox where both refer to StgFEM_Toolboxmodule.so, but have the plugin mangling still be fine)
* better use of dlerror for why modules fail to load... almost always because it could not be found OR a symbol is missing in the module (or using a plugin that needs a toolbox that isn't loaded)
* make Underworld.exe us the toolbox system
* make ExperimentalUnderworld and gLucifer not use the old plugin way of loading them (in gLucifer's case the toolbox doesn't yet exist)
* remove StgFEM and PICellerator (and fix up xmls so these work with the StGermain executable without needing commandline arguments)


diff -r c01e4fc98db4 -r 6247718ede20 MaterialPoints/tests/testPeriodicBCs.c
--- a/MaterialPoints/tests/testPeriodicBCs.c	Tue Jul 17 12:39:46 2007 +0000
+++ b/MaterialPoints/tests/testPeriodicBCs.c	Thu Aug 02 08:41:48 2007 +0000
@@ -38,7 +38,7 @@
 **  License along with this library; if not, write to the Free Software
 **  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 **
-** $Id: testPeriodicBCs.c 478 2007-06-28 02:40:38Z PatrickSunter $
+** $Id: testPeriodicBCs.c 503 2007-08-02 08:41:48Z SteveQuenette $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -140,7 +140,7 @@ int main( int argc, char* argv[] ) {
 	Memory_Free(directory);
 						
 	/* Add the plugin path to the global plugin list */
-	PluginsManager_AddDirectory( "PICellerator", LIB_DIR );
+	ModulesManager_AddDirectory( "PICellerator", LIB_DIR );
 
 	stream = Journal_Register (Info_Type, "myStream");
 
diff -r c01e4fc98db4 -r 6247718ede20 libPICellerator/Makefile.def
--- a/libPICellerator/Makefile.def	Tue Jul 17 12:39:46 2007 +0000
+++ b/libPICellerator/Makefile.def	Thu Aug 02 08:41:48 2007 +0000
@@ -7,4 +7,4 @@
 ##
 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-def_sub = src tests
+def_sub = src tests Toolbox
diff -r c01e4fc98db4 -r 6247718ede20 libPICellerator/Toolbox/Toolbox.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/Toolbox/Toolbox.c	Thu Aug 02 08:41:48 2007 +0000
@@ -0,0 +1,120 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**	Computational Infrastructure for Geodynamics - http://www.geodynamics.org
+**
+** Contributors:
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Kent Humphries, Software Engineer, VPAC. (kenth at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: StandardConditionFunctions.c 532 2006-04-04 00:21:59Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/PICellerator.h>
+#include "Toolbox.h"
+
+const Type PICellerator_Toolbox_Type = "PICellerator_Toolbox";
+
+void _PICellerator_Toolbox_Construct( void* component, Stg_ComponentFactory* cf, void* ptrToContext ) {
+	PICelleratorContext*		context;
+	AbstractContext**		ptrToSelf;
+	AbstractContext*		curContext;
+ 
+	/* Get the existing context, as defined by StGermain, or an alternative toolbox. */
+	ptrToSelf = (AbstractContext**)ptrToContext;
+	curContext = (AbstractContext*)Stg_ComponentFactory_ConstructByName( cf, "context", AbstractContext, True, ptrToSelf ); 
+
+
+	/* Only need to initialise a new context, and copy all relevant registers over IF this is the first toolbox */
+        /* to be constructed. */
+        /* The first toolbox to be constructed is Guaranteed to have the 'largest' context. */
+        /*                       (ie is an inherited child of ALL other toolbox about to be loaded) */
+        if( curContext->type == AbstractContext_Type ) {
+		/* Create a new, empty FiniteElementContext. */
+		context = PICelleratorContext_New( curContext->name, 0, 0, curContext->communicator, curContext->dictionary );
+		Memory_CountInc( context );
+
+                context->dictionary = curContext->dictionary;
+                /* Need to get the old CF from curContext, and use that in my new context. */
+                /* Now I CANNOT delete this curContext or I'll lose the CF. :( */
+                context->CF = curContext->CF;
+
+                /* Need to get the LCRegister componentList, and replace the existing (abstract) context */
+                /* with the newly created (PICellerator) context!!! */
+                Stg_ObjectList_Replace( 
+			context->CF->LCRegister->componentList,
+			((Stg_Component*) curContext)->name,
+			KEEP,
+			(Stg_Component*) context);
+
+                /* Recreate the registerRegister link in CF. */
+                context->CF->registerRegister = context->register_Register;
+        } /* close of if( prevContext->type == AbstractContext_Type) */
+	else { /* curContext was NOT an abstract context -> that is does NOT need to be replaced */
+		context = (PICelleratorContext*)curContext;
+	}
+	
+	*ptrToSelf = (AbstractContext*)context;
+}
+
+void* _PICellerator_Toolbox_DefaultNew( Name name ) {
+	return Codelet_New(
+			PICellerator_Toolbox_Type,
+			_PICellerator_Toolbox_DefaultNew,
+			_PICellerator_Toolbox_Construct,
+			_Codelet_Build,
+			_Codelet_Initialise,
+			_Codelet_Execute,
+			_Codelet_Destroy,
+			name );
+}
+
+void PICellerator_Toolbox_Initialise( PluginsManager* pluginsManager, int* argc, char*** argv ) {
+	Journal_Printf( Journal_Register( Info_Type, PICellerator_Toolbox_Type ), "Initialising: PICellerator Toolbox.\n" );
+
+	PICellerator_Init( argc, argv );
+}
+
+void PICellerator_Toolbox_Finalise( PluginsManager* pluginsManager ) {
+	PICellerator_Finalise();
+	
+	Journal_Printf( Journal_Register( Info_Type, PICellerator_Toolbox_Type ), "Finalised: PICellerator Toolbox.\n" );
+}
+
+Index PICellerator_Toolbox_Register( PluginsManager* pluginsManager ) {
+	return PluginsManager_Submit( pluginsManager, PICellerator_Toolbox_Type, "0", _PICellerator_Toolbox_DefaultNew );
+}
+
diff -r c01e4fc98db4 -r 6247718ede20 libPICellerator/Toolbox/Toolbox.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/Toolbox/Toolbox.h	Thu Aug 02 08:41:48 2007 +0000
@@ -0,0 +1,66 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**	Computational Infrastructure for Geodynamics - http://www.geodynamics.org
+**
+** Contributors:
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+** Role:
+**	Defines any header info, such as new structures, needed by this plugin
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Toolbox_h__
+#define __PICellerator_Toolbox_h__
+
+extern const Type PICellerator_Toolbox_Type;
+
+typedef struct {
+	__Codelet
+} PICellerator_Toolbox;
+
+void PICellerator_Toolbox_Initialise();
+
+Index PICellerator_Toolbox_Register( PluginsManager* pluginsManager );
+
+void PICellerator_Toolbox_Finalise();
+
+#endif	
diff -r c01e4fc98db4 -r 6247718ede20 libPICellerator/Toolbox/Toolbox.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/Toolbox/Toolbox.meta	Thu Aug 02 08:41:48 2007 +0000
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">PICellerator_Toolbox</param>
+
+<list name="dependenices">
+	<struct>
+		<param name="plugin">StgFEM_Toolbox</param>
+		<param name="version">0</param>
+	</struct>
+</list>
+
+</StGermainData>
diff -r c01e4fc98db4 -r 6247718ede20 libPICellerator/Toolbox/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/Toolbox/makefile	Thu Aug 02 08:41:48 2007 +0000
@@ -0,0 +1,59 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+##	Melbourne, 3053, Australia.
+##
+## Primary Contributing Organisations:
+##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##	Computational Infrastructure for Geodynamics - http://www.geodynamics.org
+##
+## Contributors:
+##	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: makefile 535 2006-04-11 13:07:34Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+SHELL := $(shell which bash)
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+
+include ${PROJ_ROOT}/Makefile.system
+
+modName := $(shell basename `pwd` )
+modName := $(shell echo ${modName} | cut -c 1 | tr '[:lower:]' '[:upper:]' )$(shell echo ${modName} | cut -c 2- ) 
+
+mod = ${PROJECT}_${modName}
+includes = ${PROJECT}/${modName}
+
+SRCS = $(wildcard *.c)
+HDRS = $(wildcard *.h)
+
+packages = STGFEM STGERMAIN PETSC MPI XML
+EXTERNAL_LIBS = -lPICellerator
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r c01e4fc98db4 -r 6247718ede20 libPICellerator/src/Init.c
--- a/libPICellerator/src/Init.c	Tue Jul 17 12:39:46 2007 +0000
+++ b/libPICellerator/src/Init.c	Thu Aug 02 08:41:48 2007 +0000
@@ -38,7 +38,7 @@
 **  License along with this library; if not, write to the Free Software
 **  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 **
-** $Id: Init.c 427 2007-02-23 02:37:11Z KathleenHumble $
+** $Id: Init.c 503 2007-08-02 08:41:48Z SteveQuenette $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -78,7 +78,7 @@ Bool PICellerator_Init( int* argc, char*
 	Memory_Free(directory);
 	
 	/* Add the plugin path to the global plugin list */
-	PluginsManager_AddDirectory( "PICellerator", LIB_DIR );
+	ModulesManager_AddDirectory( "PICellerator", LIB_DIR );
 
 	return True;
 }
diff -r c01e4fc98db4 -r 6247718ede20 plugins/Application/Application.c
--- a/plugins/Application/Application.c	Tue Jul 17 12:39:46 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**	Melbourne, 3053, Australia.
-**
-** Primary Contributing Organisations:
-**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**	Monash Cluster Computing - http://www.mcc.monash.edu.au
-**	Computational Infrastructure for Geodynamics - http://www.geodynamics.org
-**
-** Contributors:
-**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**	Kent Humphries, Software Engineer, VPAC. (kenth at vpac.org)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** $Id: StandardConditionFunctions.c 532 2006-04-04 00:21:59Z PatrickSunter $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-#ifdef HAVE_PYTHON
-#include <Python.h>
-#endif
-
-#include <mpi.h>
-/* EP_APPLICATIONS_FINALISE defined in StGermain.h */
-#include <StGermain/StGermain.h>
-/* Must include StgFEM library, but WON'T call Stg_FEM_Init in this plugin. */
-#include <StgFEM/StgFEM.h>
-#include <PICellerator/PICellerator.h>
-#include "Application.h"
-
-#include <stdio.h>
-/* for strcmp */
-#include <string.h>
-
-/* All StGermain Application Plugins should use this finalise. */
-/* char EP_APPLICATIONS_FINALISE[] = "StGermain_EP_ApplicationsFinalise"; */
-const Type PICellerator_Application_Type = "PICellerator_Application";
-
-void _PICellerator_Application_Construct( void* component, Stg_ComponentFactory* cf, void* data ) 
- {
-	AbstractContext* currAbstractContext;
-	PICelleratorContext* context = NULL;
-	int tmp = 0;
-
-        AbstractContext* prevContext;
-        EntryPoint* applicationsFinalise_EP;
-
-/* 	Get the existing abstract context, as defined by StGermain. */
-/* 	Get it up here, so the communicator can be used for messages. */
-	prevContext = (AbstractContext*)Stg_ComponentFactory_ConstructByName( cf, "context", AbstractContext, True, data ); 
-
-	/* Ensures copyright info always come first in output */
-	MPI_Barrier( prevContext->communicator ); 
-
-        /* PICellerator's init message */
-        tmp = Stream_GetPrintingRank( Journal_Register( InfoStream_Type, "Context" ) );
-        Stream_SetPrintingRank( Journal_Register( InfoStream_Type, "Context" ), 0 );
-        Journal_Printf( /* DO NOT CHANGE OR REMOVE */
-                Journal_Register( InfoStream_Type, "Context" ),
-                "PICellerator revision %s. "
-		"Copyright (C) 2005 VPAC & Monash Cluster Computing.\n", 
-		    VERSION );
-        Stream_Flush( Journal_Register( InfoStream_Type, "Context" ) );
-        Stream_SetPrintingRank( Journal_Register( InfoStream_Type, "Context" ), tmp );
-
-	/* Ensures copyright info always come first in output */
-        MPI_Barrier( prevContext->communicator ); 
-
-/* 	Only need to initialise a new context, and copy all relevant registers over IF this is the first application */
-/* 	plugin to be constructed. */
-/* 	The first application plugin to be constructed is Guaranteed to have the 'largest' context. */
-/* 				(ie is an inherited child of ALL other application plugins about to be loaded) */
-	if( prevContext->type == AbstractContext_Type )
-	{
-/* 		Set the existing abstract context. */
-		currAbstractContext = prevContext;
-/* 		Create a new, empty PICelleratorContext. */
-		context = PICelleratorContext_New( "context", 0, 0, currAbstractContext->communicator, cf->rootDict );
-	
-		context->dictionary = cf->rootDict;
-	
-/* 		Initialise Abstract parts of PICelleratorContext */
-		_AbstractContext_Init((AbstractContext*)context, 0, 0, MPI_COMM_WORLD );
-/* 		Initialise Discretisation parts of PICelleratorContext */
-		_DiscretisationContext_Init((DiscretisationContext*)context );
-/* 		Initialise FiniteElement parts of PICelleratorContext */
-		_FiniteElementContext_Init( (FiniteElementContext*)context );
-/* 		Initialise PIcellerator parts of PICelleratorContext */
-		_PICelleratorContext_Init( context );
-	
-/* 	       	Need to get the old CF from currAbstractContext, and use that in my new context. */
-/* 	        Now I CANNOT delete this currAbstractContext or I'll lose the CF. :( */
-	        context->CF = currAbstractContext->CF;
-
-/* 	        Need to get the LCRegister componentList, and replace the existing (abstract) context  */
-/* 		with the newly created (PICellerator) context!!! */
-	        Stg_ObjectList_Replace( context->CF->LCRegister->componentList,
-                                	((Stg_Component*) currAbstractContext)->name, 
-					KEEP, 
-					(Stg_Component*) context);
-	
-/* 		Recreate the registerRegister link in CF. */
-		context->CF->registerRegister = context->register_Register;
-
-/* 		Create the EntryPoint for all application plugins' finalise functions to hook into. */
-	        applicationsFinalise_EP = EntryPoint_New( EP_APPLICATIONS_FINALISE, EntryPoint_VoidPtr_CastType );
-	        EntryPoint_Register_Add(context->entryPoint_Register, (void*)applicationsFinalise_EP);
-
-	} /* close of if(context->type == AbstractContext_Type) */
-	else /* prevContext was NOT an abstract context -> that is does NOT need to be replaced */
-		context = (PICelleratorContext*) prevContext;
-
-
-        EntryPoint_Append( Context_GetEntryPoint( context, EP_APPLICATIONS_FINALISE ),
-                           "PICellerator App Finalise",
-                           PICellerator_Application_Finalise,
-                           "PICellerator_App_Construct" );
-}
-
-void PICellerator_Application_Finalise() 
-{
-	Stream* finaliseStream = 
-			Journal_Register(Info_Type, "PICellerator_Application");
-	Journal_Printf( finaliseStream, 
-		      "Finalised: Particle-In-Cellerator (FEM/PIC Framework).\n");
-
-	PICellerator_Finalise();
-}
-
-void* _PICellerator_Application_DefaultNew( Name name ) {
-	return Codelet_New(
-			PICellerator_Application_Type,
-			_PICellerator_Application_DefaultNew,
-			_PICellerator_Application_Construct,
-			_Codelet_Build,
-			_Codelet_Initialise,
-			_Codelet_Execute,
-			_Codelet_Destroy,
-			name );
-}
-
-Index PICellerator_Application_Register( PluginsManager* pluginsManager ) 
-{
-/* 	Initialise the PICellerator context. */
-        PICellerator_Init( NULL, NULL);
-	#ifdef HAVE_PYTHON
-	Py_Initialize();
-	#endif
-
-	return PluginsManager_Submit( pluginsManager, PICellerator_Application_Type, "0", _PICellerator_Application_DefaultNew );
-}
-
diff -r c01e4fc98db4 -r 6247718ede20 plugins/Application/Application.h
--- a/plugins/Application/Application.h	Tue Jul 17 12:39:46 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**	Melbourne, 3053, Australia.
-**
-** Primary Contributing Organisations:
-**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**	Monash Cluster Computing - http://www.mcc.monash.edu.au
-**	Computational Infrastructure for Geodynamics - http://www.geodynamics.org
-**
-** Contributors:
-**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-*/
-/** \file
-** Role:
-**	Defines any header info, such as new structures, needed by this plugin
-**
-** Assumptions:
-**
-** Comments:
-**
-** $Id $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#ifndef __PICellerator_Application_h__
-#define __PICellerator_Application_h__
-
-extern const Type PICellerator_Application_Type;
-
-typedef struct {
-	__Codelet
-} PICellerator_Application;
-
-Index PICellerator_Application_Register( PluginsManager* pluginsManager );
-
-void PICellerator_Application_Finalise();
-
-#endif	
diff -r c01e4fc98db4 -r 6247718ede20 plugins/Application/makefile
--- a/plugins/Application/makefile	Tue Jul 17 12:39:46 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-##
-## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-##	Melbourne, 3053, Australia.
-##
-## Primary Contributing Organisations:
-##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
-##	Monash Cluster Computing - http://www.mcc.monash.edu.au
-##	Computational Infrastructure for Geodynamics - http://www.geodynamics.org
-##
-## Contributors:
-##	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-##
-##  This library is free software; you can redistribute it and/or
-##  modify it under the terms of the GNU Lesser General Public
-##  License as published by the Free Software Foundation; either
-##  version 2.1 of the License, or (at your option) any later version.
-##
-##  This library is distributed in the hope that it will be useful,
-##  but WITHOUT ANY WARRANTY; without even the implied warranty of
-##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-##  Lesser General Public License for more details.
-##
-##  You should have received a copy of the GNU Lesser General Public
-##  License along with this library; if not, write to the Free Software
-##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-##
-## $Id: makefile 535 2006-04-11 13:07:34Z PatrickSunter $
-##
-##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-SHELL := $(shell which bash)
-PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
-
-include ${PROJ_ROOT}/Makefile.system
-
-modName := $(shell basename `pwd` )
-modName := $(shell echo ${modName} | cut -c 1 | tr '[:lower:]' '[:upper:]' )$(shell echo ${modName} | cut -c 2- ) 
-
-mod = ${PROJECT}_${modName}
-includes = ${PROJECT}/${modName}
-
-SRCS = $(wildcard *.c)
-HDRS = $(wildcard *.h)
-
-EXTERNAL_LIBS = -lPICellerator ${EXPORT_DYNAMIC_LFLAGS}
-
-EXTERNAL_INCLUDES = -DMODULE_EXT=\"${MODULE_EXT}\"
-
-packages = STGFEM STGERMAIN PETSC MPI XML MATH DL HYPRE
-
-ifdef HAVE_PYTHON
-        packages += PYTHON
-endif
-
-include ${PROJ_ROOT}/Makefile.vmake
diff -r c01e4fc98db4 -r 6247718ede20 plugins/makefile
--- a/plugins/makefile	Tue Jul 17 12:39:46 2007 +0000
+++ b/plugins/makefile	Thu Aug 02 08:41:48 2007 +0000
@@ -2,27 +2,24 @@
 ##
 ## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
 ##	Melbourne, 3053, Australia.
-## Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
-##	Victoria, 3800, Australia
 ##
 ## Primary Contributing Organisations:
 ##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
 ##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
 ##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##	Computational Infrastructure for Geodynamics - http://www.geodynamics.org
 ##
 ## Contributors:
+##	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
 ##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-##	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
-##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
 ##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
 ##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
 ##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
 ##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
 ##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-##	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
-##	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
 ##
 ##  This library is free software; you can redistribute it and/or
 ##  modify it under the terms of the GNU Lesser General Public
@@ -38,16 +35,17 @@
 ##  License along with this library; if not, write to the Free Software
 ##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 ##
-## $Id: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+## $Id: makefile 503 2007-08-02 08:41:48Z SteveQuenette $
 ##
 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-#Finds the Absolute path to the Project Root directory
-SHELL := /bin/bash
-PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+# obtain defaults for required variables according to system and project location, and then run the build.
+SHELL := $(shell which bash)
+PROJ_ROOT:= $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
 include ${PROJ_ROOT}/Makefile.system
 
-# Subdirectories
-subdirs := $(shell find * -type d -follow -prune ! -name .svn )
+subdirs = \
+	Output \
+	CalculateParticleDisplacement
 
 include ${PROJ_ROOT}/Makefile.vmake



More information about the CIG-COMMITS mailing list