Merge remote-tracking branch 'remotes/origin/bgschaid/minorAdditions' into nextRelease
Conflicts: src/OpenFOAM/matrices/blockLduMatrix/BlockLduMatrix/BlockLduMatrixATmul.C
This commit is contained in:
commit
4c3ca4097c
33 changed files with 1447 additions and 71 deletions
10
.hgignore
10
.hgignore
|
@ -88,3 +88,13 @@ testHarness/OpenFOAM/1.6-ext/runDir/CTestTestfile.cmake
|
|||
testHarness/OpenFOAM/1.6-ext/runDir/DartConfiguration.tcl
|
||||
testHarness/OpenFOAM/1.6-ext/runDir/Makefile
|
||||
testHarness/OpenFOAM/1.6-ext/runDir/cmake_install.cmake
|
||||
|
||||
# The following files are blacklisted because of a DMCA complaint by ANSYS.
|
||||
src/lduSolvers/tools/PriorityArray.C
|
||||
src/lduSolvers/tools/PriorityArray.H
|
||||
src/lduSolvers/amg/amgPolicy/samgPolicy.C
|
||||
src/lduSolvers/amg/amgPolicy/samgPolicy.H
|
||||
src/lduSolvers/amg/amgPolicy/aamgPolicy.C
|
||||
src/lduSolvers/amg/amgPolicy/aamgPolicy.H
|
||||
|
||||
# end-of-file
|
||||
|
|
22
ThirdParty/AllMake.stage5
vendored
22
ThirdParty/AllMake.stage5
vendored
|
@ -59,13 +59,16 @@ echo
|
|||
# In fact, we are basically tracking the head branch from the Mercurial repository
|
||||
# which is also replicated under the Breeder_1.7 section of the Subversion repository
|
||||
#
|
||||
|
||||
SWAK_RELEASE_VERSION=0.2.4
|
||||
|
||||
if [ -z "$SWAK4FOAM_SYSTEM" ]
|
||||
then
|
||||
# Do we need to download the source code?
|
||||
# We choose to put the source code under ./rpmBuild/BUILD prior to compiling.
|
||||
# We will not generate a rpm package, but all ThirdParty source code will be
|
||||
# centralized under the same scratch area
|
||||
if [ ! -e ./rpmBuild/BUILD/swak4Foam-0.2.0 ];
|
||||
if [ ! -e ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION ];
|
||||
then
|
||||
echo "Checking for a Mercurial client: hg"
|
||||
command -v hg >/dev/null
|
||||
|
@ -74,9 +77,9 @@ then
|
|||
echo "Using Mercurial/hg to download the source code for swak4Foam"
|
||||
(
|
||||
cd ./rpmBuild/BUILD;
|
||||
hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam swak4Foam-0.2.0;
|
||||
cd swak4Foam-0.2.0;
|
||||
hg checkout version_0.2.0
|
||||
hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam swak4Foam-$SWAK_RELEASE_VERSION;
|
||||
cd swak4Foam-$SWAK_RELEASE_VERSION;
|
||||
hg checkout version_$SWAK_RELEASE_VERSION
|
||||
)
|
||||
else
|
||||
echo "Warning: Mercurial/hg is not installed. Switching to an alternate Subversion repository"
|
||||
|
@ -84,7 +87,7 @@ then
|
|||
if [ $? -eq 0 ];
|
||||
then
|
||||
echo "Using Subversion/svn to download the source code for swak4Foam"
|
||||
(cd ./rpmBuild/BUILD; svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_1.7/libraries/swak4Foam swak4Foam-0.2.0)
|
||||
(cd ./rpmBuild/BUILD; svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_1.7/libraries/swak4Foam swak4Foam-$SWAK_RELEASE_VERSION)
|
||||
else
|
||||
echo "Error: Please install either a Mercurial or Subversion client in order to download the source code for swak4Foam"
|
||||
exit -1
|
||||
|
@ -93,13 +96,14 @@ then
|
|||
# We move the compilation results directly to $FOAM_SITE_APPBIN and $FOAM_SITE_LIBBIN
|
||||
# If you prefer to keep the libraries and tools under $FOAM_USER_LIBBIN and $FOAM_USER_APPBIN, simply
|
||||
# comment out the next two lines
|
||||
(cd ./rpmBuild/BUILD/swak4Foam-0.2.0; find . -name files | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
|
||||
(cd ./rpmBuild/BUILD/swak4Foam-0.2.0; find . -name options | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
|
||||
(cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; find . -name files | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
|
||||
(cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; find . -name options | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
|
||||
(cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; sed -i.old "s|// #define FOAM_SYMMTENSOR_WORKAROUND|#define FOAM_SYMMTENSOR_WORKAROUND|g" Libraries/swak4FoamParsers/include/swak.H )
|
||||
|
||||
# We recompile everything
|
||||
(cd ./rpmBuild/BUILD/swak4Foam-0.2.0; ./Allwclean; ./Allwmake)
|
||||
(cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; ./Allwclean; ./Allwmake)
|
||||
else
|
||||
echo "The source code for swak4Foam is already present under ./rpmBuild/BUILD/swak4Foam-0.2.0"
|
||||
echo "The source code for swak4Foam is already present under ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION"
|
||||
echo "Please remove this directory if you want to refresh your installation of swak4Foam"
|
||||
fi
|
||||
echo ""
|
||||
|
|
|
@ -7,12 +7,13 @@ diff -ruN libccmio-2.6.1_orig/config/config.gnu.to.star libccmio-2.6.1/config/co
|
|||
|
||||
# $Id: config.gnu.to.star,v 1.4 2006/06/05 21:12:16 geoffp Exp $
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
@@ -34,6 +34,9 @@
|
||||
x86_64-unknown-linux-gnu-null) echo linux64_2.4-x86-glibc_2.2.5 ;;
|
||||
ppc64-unknown-linux-gnu-null) echo linux64_2.6-pwr4-glibc_2.3.3 ;;
|
||||
i386-apple-darwin8-null) echo i386-apple-darwin8 ;;
|
||||
+ i386-apple-darwin10-null) echo i386-apple-darwin10 ;;
|
||||
+ i386-apple-darwin11-null) echo i386-apple-darwin11 ;;
|
||||
+ i386-apple-darwin12-null) echo i386-apple-darwin12 ;;
|
||||
*) echo unknown ;;
|
||||
esac
|
||||
|
||||
|
@ -41,14 +42,14 @@ diff -ruN libccmio-2.6.1_orig/config/config.system libccmio-2.6.1/config/config.
|
|||
+ i386-apple-darwin10.5.0 | i386-apple-darwin10.7.0 | i386-apple-darwin10.8.0)
|
||||
+ echo i386-apple-darwin10 ;;
|
||||
+
|
||||
+ i386-apple-darwin11.2.0 )
|
||||
+ i386-apple-darwin10.* )
|
||||
+ echo i386-apple-darwin10 ;;
|
||||
+
|
||||
+ i386-apple-darwin11.* )
|
||||
+ echo i386-apple-darwin11 ;;
|
||||
+
|
||||
+ i386-apple-darwin11.3.0 )
|
||||
+ echo i386-apple-darwin11 ;;
|
||||
+
|
||||
+ i386-apple-darwin11.4.2 )
|
||||
+ echo i386-apple-darwin11 ;;
|
||||
+ i386-apple-darwin12.* )
|
||||
+ echo i386-apple-darwin12 ;;
|
||||
+
|
||||
*)
|
||||
echo unknown
|
||||
|
|
17
ThirdParty/rpmBuild/SPECS/libccmio-2.6.1.spec
vendored
17
ThirdParty/rpmBuild/SPECS/libccmio-2.6.1.spec
vendored
|
@ -46,8 +46,8 @@
|
|||
|
||||
# Will install the package directly $WM_THIRD_PARTY_DIR
|
||||
# Some comments about package relocation:
|
||||
# By using this prefix for the Prefix: parameter in this file, you will make this
|
||||
# package relocatable.
|
||||
# By using this prefix for the Prefix: parameter in this file, you will make this
|
||||
# package relocatable.
|
||||
#
|
||||
# This is fine, as long as your software is itself relocatable.
|
||||
#
|
||||
|
@ -56,7 +56,7 @@
|
|||
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
|
||||
#
|
||||
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
|
||||
# not be able to reutilize this RPM, even though it is relocatable. You will need to
|
||||
# not be able to reutilize this RPM, even though it is relocatable. You will need to
|
||||
# regenerate the RPM.
|
||||
#
|
||||
%define _prefix %{_WM_THIRD_PARTY_DIR}
|
||||
|
@ -90,16 +90,19 @@ Patch0: libccmio-2.6.1.patch_0
|
|||
|
||||
%build
|
||||
[ -n "$WM_CC" ] && export CC="$WM_CC"
|
||||
[ -n "$WM_FC" ] && export FC="$WM_FC"
|
||||
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
|
||||
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
|
||||
[ -n "$WM_FCFLAGS" ] && export FCFLAGS="$WM_FCFLAGS"
|
||||
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
|
||||
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
|
||||
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
|
||||
|
||||
%ifos darwin
|
||||
# Missing configuration files for Mac OS X
|
||||
# Missing configuration files for Mac OS X
|
||||
[ ! -d config/i386-apple-darwin10 ] && cp -r config/i386-apple-darwin8 config/i386-apple-darwin10
|
||||
[ ! -d config/i386-apple-darwin11 ] && cp -r config/i386-apple-darwin8 config/i386-apple-darwin11
|
||||
[ ! -d config/i386-apple-darwin12 ] && cp -r config/i386-apple-darwin8 config/i386-apple-darwin12
|
||||
%endif
|
||||
# Warning:
|
||||
# 1: The name of the ADF library will be renamed to libadf_ccmio since this
|
||||
|
@ -109,7 +112,7 @@ Patch0: libccmio-2.6.1.patch_0
|
|||
#
|
||||
# This way, the libraries libadf_ccmio and libcgns_ccmio will not get in
|
||||
# conflict with any other packages that might depend on a newer version
|
||||
# of libadf or libcgns
|
||||
# of libadf or libcgns
|
||||
#
|
||||
unset RELEASE
|
||||
unset DEBUG
|
||||
|
@ -184,7 +187,3 @@ rm -rf %{buildroot}
|
|||
%Files
|
||||
%defattr(-,root,root)
|
||||
%{_installPrefix}/*
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
|
||||
# Will install the package directly $WM_THIRD_PARTY_DIR
|
||||
# Some comments about package relocation:
|
||||
# By using this prefix for the Prefix: parameter in this file, you will make this
|
||||
# package relocatable.
|
||||
# By using this prefix for the Prefix: parameter in this file, you will make this
|
||||
# package relocatable.
|
||||
#
|
||||
# This is fine, as long as your software is itself relocatable.
|
||||
#
|
||||
|
@ -59,7 +59,7 @@
|
|||
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
|
||||
#
|
||||
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
|
||||
# not be able to reutilize this RPM, even though it is relocatable. You will need to
|
||||
# not be able to reutilize this RPM, even though it is relocatable. You will need to
|
||||
# regenerate the RPM.
|
||||
#
|
||||
%define _prefix %{_WM_THIRD_PARTY_DIR}
|
||||
|
@ -95,8 +95,10 @@ Patch0: mesquite-2.1.2_patch0
|
|||
%build
|
||||
# export WM settings in a form that GNU configure recognizes
|
||||
[ -n "$WM_CC" ] && export CC="$WM_CC"
|
||||
[ -n "$WM_FC" ] && export FC="$WM_FC"
|
||||
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
|
||||
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
|
||||
[ -n "$WM_FCFLAGS" ] && export FCFLAGS="$WM_FCFLAGS"
|
||||
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
|
||||
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
|
||||
|
||||
|
@ -177,4 +179,3 @@ rm -rf %{buildroot}
|
|||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_installPrefix}
|
||||
|
||||
|
|
95
bin/listProfileInformation.py
Executable file
95
bin/listProfileInformation.py
Executable file
|
@ -0,0 +1,95 @@
|
|||
#! /usr/bin/env python
|
||||
|
||||
# Lists the profiling information in time directories (uniform/profilingInfo)
|
||||
# in a human readable form
|
||||
|
||||
from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
|
||||
import sys
|
||||
|
||||
pf=ParsedParameterFile(sys.argv[1],
|
||||
treatBinaryAsASCII=True)
|
||||
|
||||
data={}
|
||||
children={}
|
||||
root=None
|
||||
|
||||
for p in pf["profilingInfo"]:
|
||||
if p["id"] in data:
|
||||
print "Duplicate definition of",p["id"]
|
||||
sys.exit(-1)
|
||||
if p["description"][0]=='"':
|
||||
p["description"]=p["description"][1:]
|
||||
if p["description"][-1]=='"':
|
||||
p["description"]=p["description"][:-1]
|
||||
|
||||
data[p["id"]]=p
|
||||
if "parentId" in p:
|
||||
if p["parentId"] in children:
|
||||
children[p["parentId"]].append(p["id"])
|
||||
else:
|
||||
children[p["parentId"]]=[p["id"]]
|
||||
else:
|
||||
if root!=None:
|
||||
print "Two root elements"
|
||||
sys-exit(-1)
|
||||
else:
|
||||
root=p["id"]
|
||||
|
||||
def depth(i):
|
||||
if i in children:
|
||||
return max([depth(j) for j in children[i]])+1
|
||||
else:
|
||||
return 0
|
||||
|
||||
#make sure that children are printed in the correct order
|
||||
for i in children:
|
||||
children[i].sort()
|
||||
|
||||
maxdepth=depth(root)
|
||||
|
||||
depths={}
|
||||
|
||||
def nameLen(i,d=0):
|
||||
depths[i]=d
|
||||
maxi=len(data[i]["description"])
|
||||
if i in children:
|
||||
maxi=max(maxi,max([nameLen(j,d+1) for j in children[i]]))
|
||||
return maxi+3
|
||||
|
||||
maxLen=nameLen(root)
|
||||
|
||||
format=" %5.1f%% (%5.1f%%) - %5.1f%% | %8d %9.4gs %9.4gs"
|
||||
totalTime=data[root]["totalTime"]
|
||||
|
||||
header=" "*(maxLen)+" | parent (total ) - self | calls total self "
|
||||
print header
|
||||
print "-"*len(header)
|
||||
|
||||
def printItem(i):
|
||||
result=""
|
||||
if depths[i]>1:
|
||||
result+=" "*(depths[i]-1)
|
||||
if depths[i]>0:
|
||||
result+="|- "
|
||||
result+=data[i]["description"]
|
||||
result+=" "*(maxLen-len(result)+1)+"| "
|
||||
|
||||
parentTime=data[i]["totalTime"]
|
||||
if "parentId" in data[i]:
|
||||
parentTime=data[data[i]["parentId"]]["totalTime"]
|
||||
|
||||
tt=data[i]["totalTime"]
|
||||
ct=data[i]["childTime"]
|
||||
|
||||
result+=format % (100*tt/parentTime,
|
||||
100*(tt-ct)/totalTime,
|
||||
100*(tt-ct)/tt,
|
||||
data[i]["calls"],
|
||||
tt,
|
||||
tt-ct)
|
||||
print result
|
||||
if i in children:
|
||||
for c in children[i]:
|
||||
printItem(c)
|
||||
|
||||
printItem(root)
|
130
etc/bashrc
130
etc/bashrc
|
@ -32,16 +32,50 @@
|
|||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
unset WM_PROJECT_VERSION_ADDITION
|
||||
prefSettingFile=$0.preset
|
||||
if [ -f $prefSettingFile ]
|
||||
then
|
||||
# echo "Found presettings $prefSettingFile"
|
||||
. $prefSettingFile
|
||||
fi
|
||||
|
||||
unset prefSettingFile
|
||||
|
||||
export WM_PROJECT=OpenFOAM
|
||||
export WM_PROJECT_VERSION=1.6-ext
|
||||
|
||||
if [ -z "$WM_PROJECT_VERSION_ADDITION" ]
|
||||
then
|
||||
fullScriptPath=`pwd`"/$0"
|
||||
if [ ! -e $fullScriptPath ]
|
||||
then
|
||||
fullScriptPath=$0
|
||||
fi
|
||||
canonicalFullScriptPath="$(readlink 2>&1 -f $fullScriptPath)"
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
# System with simpler readlink (BSD, Darwin) try replacement
|
||||
canonicalFullScriptPath="$(greadlink 2>&1 -f $fullScriptPath)"
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
# we give up
|
||||
canonicalFullScriptPath=""
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$canonicalFullScriptPath" ]
|
||||
then
|
||||
dirName="$(basename $(dirname $(dirname $canonicalFullScriptPath)))"
|
||||
rest="$(echo $dirName | sed -e "s/OpenFOAM-$WM_PROJECT_VERSION//")"
|
||||
if [ -n $rest ]
|
||||
then
|
||||
export WM_PROJECT_VERSION_ADDITION="$(echo $rest | sed -e "s/-//")"
|
||||
fi
|
||||
unset dirName rest
|
||||
fi
|
||||
unset fullScriptPath canonicalFullScriptPath
|
||||
fi
|
||||
|
||||
if [ -n "$WM_PROJECT_VERSION_ADDITION" ]
|
||||
then
|
||||
export WM_PROJECT_VERSION=$WM_PROJECT_VERSION-$WM_PROJECT_VERSION_ADDITION
|
||||
|
@ -265,26 +299,82 @@ Darwin)
|
|||
# We need to get rid of the revision number from this string. eg turn "10.7.5" into "10.7"
|
||||
export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion | sed -e "s/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)/\1.\2/g"`
|
||||
|
||||
if [ "$compilerInstall" == "System" ]
|
||||
which -s port >/dev/null
|
||||
if [ $? -eq "0" -a -d '/opt/local/etc/macports' ]
|
||||
then
|
||||
# Use Mac-Ports-Compiler instead of Apple-gcc-4.2
|
||||
case $WM_COMPILER in
|
||||
Gcc43)
|
||||
export WM_CC='gcc-mp-4.3'
|
||||
export WM_CXX='g++-mp-4.3'
|
||||
;;
|
||||
Gcc44)
|
||||
export WM_CC='gcc-mp-4.4'
|
||||
export WM_CXX='g++-mp-4.4'
|
||||
;;
|
||||
Gcc45)
|
||||
export WM_CC='gcc-mp-4.5'
|
||||
export WM_CXX='g++-mp-4.5'
|
||||
;;
|
||||
*)
|
||||
export WM_COMPILER=
|
||||
;;
|
||||
esac
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
echo "Using Macports binaries"
|
||||
fi
|
||||
|
||||
export WM_USE_MACPORT=1
|
||||
|
||||
if [ -e '/opt/local/bin/openmpicc' ]
|
||||
then
|
||||
export WM_MPLIB=MACPORTOPENMPI
|
||||
else
|
||||
if [ -z "$WM_CHOSEN_MAC_MPI" ]
|
||||
then
|
||||
echo "WM_CHOSEN_MAC_MPI unset. Using OPENMPI"
|
||||
export WM_MPLIB=OPENMPI
|
||||
else
|
||||
export WM_MPLIB=$WM_CHOSEN_MAC_MPI
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$compilerInstall" == "System" ]
|
||||
then
|
||||
# Use Mac-Ports-Compiler instead of Apple-gcc-4.2
|
||||
case $WM_COMPILER in
|
||||
Gcc42)
|
||||
export WM_MACPORT_VERSION=4.2
|
||||
;;
|
||||
Gcc43)
|
||||
export WM_MACPORT_VERSION=4.3
|
||||
;;
|
||||
Gcc44)
|
||||
export WM_MACPORT_VERSION=4.4
|
||||
;;
|
||||
Gcc45)
|
||||
export WM_MACPORT_VERSION=4.5
|
||||
;;
|
||||
Gcc46)
|
||||
export WM_MACPORT_VERSION=4.6
|
||||
;;
|
||||
Gcc47)
|
||||
export WM_MACPORT_VERSION=4.7
|
||||
;;
|
||||
Gcc48)
|
||||
export WM_MACPORT_VERSION=4.8
|
||||
;;
|
||||
Gcc)
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported MacPorts-Compiler $WM_COMPILER"
|
||||
;;
|
||||
esac
|
||||
if [ "$WM_COMPILER" != "Gcc" ]
|
||||
then
|
||||
export WM_CC="gcc-mp-$WM_MACPORT_VERSION"
|
||||
export WM_CXX="g++-mp-$WM_MACPORT_VERSION"
|
||||
export WM_FC="gfortran-mp-$WM_MACPORT_VERSION"
|
||||
|
||||
ruleDirBase=$WM_PROJECT_DIR/wmake/rules/$WM_ARCH
|
||||
ruleDir=$ruleDirBase$WM_COMPILER
|
||||
if [ ! -e $ruleDir ]
|
||||
then
|
||||
echo "Rule directory $ruleDir not existing. Linking to $ruleDirBase"
|
||||
ln -s $ruleDirBase $ruleDir
|
||||
fi
|
||||
unset ruleDir ruleDirBase
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -z "$WM_CC" ]
|
||||
then
|
||||
# nobody set the compiler
|
||||
export WM_CC="gcc"
|
||||
export WM_CXX="g++"
|
||||
fi
|
||||
;;
|
||||
|
||||
|
|
43
etc/cshrc
43
etc/cshrc
|
@ -31,9 +31,51 @@
|
|||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# make sure that this variable is set un purpose
|
||||
unset WM_PROJECT_VERSION_ADDITION
|
||||
unsetenv WM_PROJECT_VERSION_ADDITION
|
||||
|
||||
set called=($_)
|
||||
set prefSettingFile=$called[2].preset
|
||||
|
||||
if ( -r $prefSettingFile ) then
|
||||
# echo "Found presettings $prefSettingFile"
|
||||
source $prefSettingFile
|
||||
endif
|
||||
|
||||
setenv WM_PROJECT OpenFOAM
|
||||
setenv WM_PROJECT_VERSION 1.6-ext
|
||||
|
||||
if( ! $?WM_PROJECT_VERSION_ADDITION ) then
|
||||
set fullScriptPath = `pwd`"/$called[2]"
|
||||
set canonicalFullScriptPath = `readlink -f $fullScriptPath |& cat`
|
||||
if( $? != 0 ) then
|
||||
# System with simpler readlink (BSD, Darwin) try replacement
|
||||
set canonicalFullScriptPath=`greadlink -f $fullScriptPath |& cat`
|
||||
if ( $? != 0 ) then
|
||||
# we give up
|
||||
set canonicalFullScriptPath=""
|
||||
endif
|
||||
endif
|
||||
|
||||
if ( "$canonicalFullScriptPath" != "" ) then
|
||||
set pathHere=`dirname $canonicalFullScriptPath`
|
||||
set pathHere=`dirname $pathHere`
|
||||
set dirName=`basename $pathHere`
|
||||
set rest=`echo $dirName | sed -e "s/OpenFOAM-$WM_PROJECT_VERSION//"`
|
||||
if ( "$rest" != "" ) then
|
||||
setenv WM_PROJECT_VERSION_ADDITION `echo $rest | sed -e "s/-//"`
|
||||
endif
|
||||
unset dirName pathHere rest
|
||||
endif
|
||||
unset fullScriptPath canonicalFullScriptPath
|
||||
endif
|
||||
unset prefSettingFile called
|
||||
|
||||
if ( $?WM_PROJECT_VERSION_ADDITION ) then
|
||||
setenv WM_PROJECT_VERSION $WM_PROJECT_VERSION-$WM_PROJECT_VERSION_ADDITION
|
||||
endif
|
||||
|
||||
# helps to easily write #ifdefs to detect a dev-version
|
||||
setenv FOAM_DEV 1
|
||||
|
||||
|
@ -357,4 +399,3 @@ unset cleanEnv cleanProg colonPath foamInstall foamOldDirs
|
|||
unalias _foamSource
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -182,17 +182,19 @@ fi
|
|||
unset compilerBin compilerLib compilerInstall
|
||||
|
||||
|
||||
case "$WM_COMPILER" in
|
||||
Gcc*)
|
||||
export WM_CC='gcc'
|
||||
export WM_CXX='g++'
|
||||
;;
|
||||
Icc)
|
||||
export WM_CC='icc'
|
||||
export WM_CXX='icpc'
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$WM_CC" ]
|
||||
then
|
||||
case "$WM_COMPILER" in
|
||||
Gcc*)
|
||||
export WM_CC='gcc'
|
||||
export WM_CXX='g++'
|
||||
;;
|
||||
Icc)
|
||||
export WM_CC='icc'
|
||||
export WM_CXX='icpc'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Communications library
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -233,6 +235,20 @@ OPENMPI)
|
|||
unset mpi_version
|
||||
;;
|
||||
|
||||
MACPORTOPENMPI)
|
||||
unset OPAL_PREFIX
|
||||
|
||||
export FOAM_MPI=openmpi-macport
|
||||
libDir=`openmpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
|
||||
|
||||
# Bit of a hack: strip off 'lib' and hope this is the path to openmpi
|
||||
# include files and libraries.
|
||||
export MPI_ARCH_PATH="${libDir%/*}"
|
||||
|
||||
_foamAddLib $libDir
|
||||
unset libDir
|
||||
;;
|
||||
|
||||
SYSTEMOPENMPI)
|
||||
mpi_version=openmpi-system
|
||||
|
||||
|
|
|
@ -3,6 +3,11 @@ global/dimensionedConstants/dimensionedConstants.C
|
|||
global/argList/argList.C
|
||||
global/clock/clock.C
|
||||
|
||||
global/Profiling/ProfilingInfo.C
|
||||
global/Profiling/ProfilingPool.C
|
||||
global/Profiling/ProfilingStack.C
|
||||
global/Profiling/ProfilingTrigger.C
|
||||
|
||||
bools = primitives/bools
|
||||
$(bools)/bool/bool.C
|
||||
$(bools)/bool/boolIO.C
|
||||
|
|
|
@ -27,6 +27,9 @@ License
|
|||
#include "Time.H"
|
||||
#include "PstreamReduceOps.H"
|
||||
|
||||
#include "ProfilingPool.H"
|
||||
#include "Profiling.H"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
|
||||
|
@ -238,6 +241,17 @@ Foam::Time::Time
|
|||
functionObjects_(*this, enableFunctionObjects)
|
||||
{
|
||||
setControls();
|
||||
|
||||
ProfilingPool::initProfiling(
|
||||
IOobject(
|
||||
"profilingInfo",
|
||||
timeName(),
|
||||
"uniform",
|
||||
*this,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
@ -295,6 +309,17 @@ Foam::Time::Time
|
|||
functionObjects_(*this, enableFunctionObjects)
|
||||
{
|
||||
setControls();
|
||||
|
||||
ProfilingPool::initProfiling(
|
||||
IOobject(
|
||||
"profilingInfo",
|
||||
timeName(),
|
||||
"uniform",
|
||||
*this,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
@ -348,7 +373,18 @@ Foam::Time::Time
|
|||
|
||||
readLibs_(controlDict_, "libs"),
|
||||
functionObjects_(*this, enableFunctionObjects)
|
||||
{}
|
||||
{
|
||||
ProfilingPool::initProfiling(
|
||||
IOobject(
|
||||
"profilingInfo",
|
||||
timeName(),
|
||||
"uniform",
|
||||
*this,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
@ -500,6 +536,8 @@ bool Foam::Time::run() const
|
|||
// ie, when exiting the control loop
|
||||
if (!running && timeIndex_ != startTimeIndex_)
|
||||
{
|
||||
addProfile2(fo,"functionObjects_.end()");
|
||||
|
||||
// Note, end() also calls an indirect start() as required
|
||||
functionObjects_.end();
|
||||
}
|
||||
|
@ -672,10 +710,14 @@ Foam::Time& Foam::Time::operator++()
|
|||
{
|
||||
if (timeIndex_ == startTimeIndex_)
|
||||
{
|
||||
addProfile2(fo,"functionObjects_.start()");
|
||||
|
||||
functionObjects_.start();
|
||||
}
|
||||
else
|
||||
{
|
||||
addProfile2(fo,"functionObjects_.execute()");
|
||||
|
||||
functionObjects_.execute();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@ License
|
|||
#include "Time.H"
|
||||
#include "PstreamReduceOps.H"
|
||||
|
||||
#include "Profiling.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::Time::readDict()
|
||||
|
@ -279,8 +281,12 @@ bool Foam::Time::writeObject
|
|||
IOstream::compressionType cmp
|
||||
) const
|
||||
{
|
||||
addProfile2(getCalled,"Foam::Time::writeObject");
|
||||
|
||||
if (outputTime())
|
||||
{
|
||||
addProfile2(actualOutput,"Foam::Time::writeObject - outputTime");
|
||||
|
||||
IOdictionary timeDict
|
||||
(
|
||||
IOobject
|
||||
|
|
|
@ -27,6 +27,8 @@ License
|
|||
#include "functionObjectList.H"
|
||||
#include "Time.H"
|
||||
|
||||
#include "Profiling.H"
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObject*
|
||||
|
@ -149,6 +151,8 @@ bool Foam::functionObjectList::execute()
|
|||
iter
|
||||
)
|
||||
{
|
||||
addProfile2(fo,"FO::"+(*iter).name()+"::execute");
|
||||
|
||||
ok = iter().execute() && ok;
|
||||
}
|
||||
}
|
||||
|
@ -175,6 +179,8 @@ bool Foam::functionObjectList::end()
|
|||
iter
|
||||
)
|
||||
{
|
||||
addProfile2(fo,"FO::"+(*iter).name()+"::end");
|
||||
|
||||
ok = iter().end() && ok;
|
||||
}
|
||||
}
|
||||
|
@ -188,6 +194,8 @@ bool Foam::functionObjectList::read()
|
|||
bool ok = true;
|
||||
updated_ = execution_;
|
||||
|
||||
addProfile2(fo,"functionObjectList::read");
|
||||
|
||||
// avoid reading/initializing if execution is off
|
||||
if (!execution_)
|
||||
{
|
||||
|
@ -231,6 +239,8 @@ bool Foam::functionObjectList::read()
|
|||
// an existing functionObject, and dictionary changed
|
||||
if (newDigs[nFunc] != digests_[oldIndex])
|
||||
{
|
||||
addProfile2(fo,"FO::"+objPtr->name()+"::read");
|
||||
|
||||
ok = objPtr->read(dict) && ok;
|
||||
}
|
||||
}
|
||||
|
@ -238,6 +248,9 @@ bool Foam::functionObjectList::read()
|
|||
{
|
||||
// new functionObject
|
||||
objPtr = functionObject::New(key, time_, dict).ptr();
|
||||
|
||||
addProfile2(fo,"FO::"+objPtr->name()+"::start");
|
||||
|
||||
ok = objPtr->start() && ok;
|
||||
}
|
||||
|
||||
|
|
56
src/OpenFOAM/global/Profiling/Profiling.H
Normal file
56
src/OpenFOAM/global/Profiling/Profiling.H
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is based on OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM 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 General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
|
||||
Description
|
||||
Add everything necessary for Profiling plus a macro
|
||||
|
||||
Originally proposed in
|
||||
http://www.cfd-online.com/Forums/openfoam-bugs/64081-feature-proposal-application-level-profiling.html
|
||||
|
||||
SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Profiling_H
|
||||
#define Profiling_H
|
||||
|
||||
#include "ProfilingTrigger.H"
|
||||
|
||||
// to be used at the beginning of a section to be profiled
|
||||
// profiling ends automatically at the end of a block
|
||||
#define addProfile(name) Foam::ProfilingTrigger profileTriggerFor##name (#name)
|
||||
|
||||
// Use this if a description with spaces, colons etc should be added
|
||||
#define addProfile2(name,descr) Foam::ProfilingTrigger profileTriggerFor##name (descr)
|
||||
|
||||
// this is only needed if profiling should end before the end of a block
|
||||
#define endProfile(name) profileTriggerFor##name.stop()
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
122
src/OpenFOAM/global/Profiling/ProfilingInfo.C
Normal file
122
src/OpenFOAM/global/Profiling/ProfilingInfo.C
Normal file
|
@ -0,0 +1,122 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is based on OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM 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 General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ProfilingInfo.H"
|
||||
|
||||
#include "dictionary.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::ProfilingInfo::nextId_(0);
|
||||
|
||||
Foam::label Foam::ProfilingInfo::getID()
|
||||
{
|
||||
nextId_++;
|
||||
return nextId_;
|
||||
}
|
||||
|
||||
void Foam::ProfilingInfo::raiseID(label maxVal)
|
||||
{
|
||||
if(maxVal>nextId_) {
|
||||
nextId_=maxVal;
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::ProfilingInfo::ProfilingInfo()
|
||||
:
|
||||
calls_(0),
|
||||
totalTime_(0.),
|
||||
childTime_(0.),
|
||||
id_(getID()),
|
||||
parent_(*this),
|
||||
description_("application::main"),
|
||||
onStack_(false)
|
||||
{}
|
||||
|
||||
|
||||
Foam::ProfilingInfo::ProfilingInfo(ProfilingInfo &parent,const string &descr)
|
||||
:
|
||||
calls_(0),
|
||||
totalTime_(0.),
|
||||
childTime_(0.),
|
||||
id_(getID()),
|
||||
parent_(parent),
|
||||
description_(descr),
|
||||
onStack_(false)
|
||||
{}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::ProfilingInfo::~ProfilingInfo()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::ProfilingInfo::update(scalar elapsedTimee)
|
||||
{
|
||||
calls_++;
|
||||
totalTime_+=elapsedTimee;
|
||||
if(id()!=parent().id()) {
|
||||
parent_.childTime_+=elapsedTimee;
|
||||
}
|
||||
}
|
||||
|
||||
void Foam::ProfilingInfo::writeWithOffset(Ostream &os,bool offset,scalar time,scalar childTimes) const
|
||||
{
|
||||
dictionary tmp;
|
||||
|
||||
tmp.add("id",id());
|
||||
if(id()!=parent().id()) {
|
||||
tmp.add("parentId",parent().id());
|
||||
}
|
||||
tmp.add("description",description());
|
||||
tmp.add("calls",calls()+(offset ? 1 : 0));
|
||||
tmp.add("totalTime",totalTime()+time);
|
||||
tmp.add("childTime",childTime()+childTimes);
|
||||
tmp.add("onStack",onStack());
|
||||
|
||||
os << tmp;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const ProfilingInfo& info)
|
||||
{
|
||||
info.writeWithOffset(os);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
178
src/OpenFOAM/global/Profiling/ProfilingInfo.H
Normal file
178
src/OpenFOAM/global/Profiling/ProfilingInfo.H
Normal file
|
@ -0,0 +1,178 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is based on OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM 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 General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::ProfilingInfo
|
||||
|
||||
Description
|
||||
Information needed for profiling
|
||||
|
||||
SourceFiles
|
||||
ProfilingInfo.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ProfilingInfo_H
|
||||
#define ProfilingInfo_H
|
||||
|
||||
#include "label.H"
|
||||
#include "scalar.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
// class Istream;
|
||||
class Ostream;
|
||||
class ProfilingStack;
|
||||
class ProfilingPool;
|
||||
class ProfilingInfo;
|
||||
|
||||
Ostream& operator<<(Ostream&, const ProfilingInfo&);
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ProfilingInfo Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ProfilingInfo
|
||||
{
|
||||
// Private data
|
||||
|
||||
// nr of times this was called
|
||||
label calls_;
|
||||
|
||||
// total time spent
|
||||
scalar totalTime_;
|
||||
|
||||
// time spent in children
|
||||
scalar childTime_;
|
||||
|
||||
// unique id to identify it
|
||||
label id_;
|
||||
|
||||
// pointer to the parent object (if there is any)
|
||||
ProfilingInfo &parent_;
|
||||
|
||||
// what this does
|
||||
string description_;
|
||||
|
||||
// is this currently on the stack?
|
||||
bool onStack_;
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
ProfilingInfo(const ProfilingInfo&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const ProfilingInfo&);
|
||||
|
||||
// Static data members
|
||||
|
||||
//- Counter that is used to generate the ids
|
||||
static label nextId_;
|
||||
|
||||
//- get a new ID and update the counter
|
||||
static label getID();
|
||||
|
||||
//- raise the next possible ID (to avoid ID-clashes during reading)
|
||||
void raiseID(label maxVal);
|
||||
|
||||
protected:
|
||||
|
||||
void addedToStack()
|
||||
{ onStack_=true; }
|
||||
|
||||
void removedFromStack()
|
||||
{ onStack_=false; }
|
||||
|
||||
//- Construct null - only the master-element
|
||||
ProfilingInfo();
|
||||
|
||||
void writeWithOffset(Ostream &os,bool offset=false,scalar time=0,scalar childTime=0) const;
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
ProfilingInfo(ProfilingInfo &parent,const string &descr);
|
||||
|
||||
// //- Construct from Istream
|
||||
// ProfilingInfo(Istream&);
|
||||
|
||||
// Destructor
|
||||
|
||||
~ProfilingInfo();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
label id() const
|
||||
{ return id_; }
|
||||
|
||||
label calls() const
|
||||
{ return calls_; }
|
||||
|
||||
scalar totalTime() const
|
||||
{ return totalTime_; }
|
||||
|
||||
scalar childTime() const
|
||||
{ return childTime_; }
|
||||
|
||||
bool onStack() const
|
||||
{ return onStack_; }
|
||||
|
||||
const string &description() const
|
||||
{ return description_; }
|
||||
|
||||
const ProfilingInfo &parent() const
|
||||
{ return parent_; }
|
||||
|
||||
//- Update it with a new timing information
|
||||
void update(scalar elapsedTime);
|
||||
|
||||
friend class ProfilingStack;
|
||||
friend class ProfilingPool;
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
// friend Istream& operator>>(Istream&, ProfilingInfo&);
|
||||
friend Ostream& operator<<(Ostream&, const ProfilingInfo&);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
152
src/OpenFOAM/global/Profiling/ProfilingPool.C
Normal file
152
src/OpenFOAM/global/Profiling/ProfilingPool.C
Normal file
|
@ -0,0 +1,152 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is based on OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM 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 General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ProfilingPool.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
Foam::ProfilingPool* Foam::ProfilingPool::thePool_(NULL);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::ProfilingPool::ProfilingPool(const IOobject &ob)
|
||||
:
|
||||
regIOobject(ob),
|
||||
globalTime_()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::ProfilingPool::~ProfilingPool()
|
||||
{
|
||||
for(mapIterator it=map().begin();it!=map().end();++it) {
|
||||
delete it->second;
|
||||
}
|
||||
map().erase(allInfo_.begin(),allInfo_.end());
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::ProfilingPool::initProfiling(const IOobject &ob)
|
||||
{
|
||||
if(thePool_!=NULL) {
|
||||
WarningIn("Foam::ProfilingPool::initProfiling(const IOobject &)")
|
||||
<< "Singleton already initialized\n" << endl;
|
||||
} else {
|
||||
thePool_=new ProfilingPool(ob);
|
||||
ProfilingInfo *master=new ProfilingInfo();
|
||||
thePool_->map().insert(make_pair(master->description(),master));
|
||||
thePool_->stack().push(*master);
|
||||
ProfilingPool::rememberTimer(*master,thePool_->globalTime_);
|
||||
}
|
||||
}
|
||||
|
||||
Foam::ProfilingInfo &Foam::ProfilingPool::getInfo(const string &name)
|
||||
{
|
||||
if(thePool_==NULL) {
|
||||
FatalErrorIn("Foam::ProfilingPool::addInfo(const string &name)")
|
||||
<< "Sinleton not initialized\n" << endl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
ProfilingStack &stack=thePool_->stack();
|
||||
mapType &map=thePool_->map();
|
||||
|
||||
ProfilingInfo *found=NULL;
|
||||
|
||||
for(mapIterator it=map.lower_bound(name);it!=map.upper_bound(name);++it) {
|
||||
if(it->second->parent().id()==stack.top().id()) {
|
||||
found=it->second;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(found==NULL) {
|
||||
found=new ProfilingInfo(stack.top(),name);
|
||||
|
||||
map.insert(make_pair(name,found));
|
||||
}
|
||||
|
||||
stack.push(*found);
|
||||
return *found;
|
||||
}
|
||||
|
||||
void Foam::ProfilingPool::rememberTimer(const ProfilingInfo &info,clockTime &timer)
|
||||
{
|
||||
if(thePool_==NULL) {
|
||||
FatalErrorIn("Foam::ProfilingPool::rememberTimer(const ProfilingInfo &info,clockTime &timer)")
|
||||
<< "Singleton not initialized\n" << endl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
thePool_->stack().addTimer(info,timer);
|
||||
}
|
||||
|
||||
void Foam::ProfilingPool::remove(const ProfilingInfo &info)
|
||||
{
|
||||
if(thePool_==NULL) {
|
||||
FatalErrorIn("Foam::ProfilingPool::addInfo(const string &name)")
|
||||
<< "Singleton not initialized\n" << endl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
ProfilingStack &stack=thePool_->stack();
|
||||
|
||||
if(info.id()!=stack.top().id()) {
|
||||
FatalErrorIn("Foam::ProfilingPool::update(const string &name)")
|
||||
<< "The id " << info.id() << " of the updated info " << info.description()
|
||||
<< " is no the same as the one on top of the stack: "
|
||||
<< stack.top().id() << " (" << stack.top().description() << ")\n" << endl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
stack.pop();
|
||||
}
|
||||
|
||||
bool Foam::ProfilingPool::writeData(Ostream &os) const
|
||||
{
|
||||
os << "profilingInfo" << nl << indent << token::BEGIN_LIST << incrIndent << nl;
|
||||
|
||||
stack().writeStackContents(os);
|
||||
|
||||
for(mapConstIterator it=map().begin();it!=map().end();++it) {
|
||||
if(!it->second->onStack()) {
|
||||
os << *(it->second);
|
||||
}
|
||||
}
|
||||
|
||||
os << decrIndent << indent << token::END_LIST << token::END_STATEMENT << endl;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
136
src/OpenFOAM/global/Profiling/ProfilingPool.H
Normal file
136
src/OpenFOAM/global/Profiling/ProfilingPool.H
Normal file
|
@ -0,0 +1,136 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is based on OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM 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 General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::ProfilingPool
|
||||
|
||||
Description
|
||||
Collects all the data for Profiling
|
||||
|
||||
SourceFiles
|
||||
ProfilingPool.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ProfilingPool_H
|
||||
#define ProfilingPool_H
|
||||
|
||||
#include "regIOobject.H"
|
||||
#include "clockTime.H"
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "ProfilingInfo.H"
|
||||
#include "ProfilingStack.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
// class Istream;
|
||||
class Ostream;
|
||||
|
||||
// // Forward declaration of friend functions and operators
|
||||
// Istream& operator>>(Istream&, ProfilingPool&);
|
||||
// Ostream& operator<<(Ostream&, const ProfilingPool&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ProfilingPool Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ProfilingPool
|
||||
:
|
||||
public regIOobject
|
||||
{
|
||||
// Private data
|
||||
|
||||
typedef std::multimap<Foam::string,Foam::ProfilingInfo*> mapType;
|
||||
typedef std::pair<Foam::string,Foam::ProfilingInfo*> mapValues;
|
||||
typedef mapType::iterator mapIterator;
|
||||
typedef mapType::const_iterator mapConstIterator;
|
||||
|
||||
mapType allInfo_;
|
||||
|
||||
ProfilingStack theStack_;
|
||||
|
||||
clockTime globalTime_;
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
ProfilingPool(const ProfilingPool&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const ProfilingPool&);
|
||||
|
||||
// Static data members
|
||||
|
||||
//- the only possible Pool-Object
|
||||
static ProfilingPool *thePool_;
|
||||
|
||||
//- Construct null
|
||||
ProfilingPool(const IOobject &);
|
||||
|
||||
// Destructor
|
||||
|
||||
~ProfilingPool();
|
||||
|
||||
mapType &map()
|
||||
{ return allInfo_; }
|
||||
|
||||
const mapType &map() const
|
||||
{ return allInfo_; }
|
||||
|
||||
ProfilingStack &stack()
|
||||
{ return theStack_; }
|
||||
|
||||
const ProfilingStack &stack() const
|
||||
{ return theStack_; }
|
||||
|
||||
public:
|
||||
|
||||
static void initProfiling(const IOobject &);
|
||||
|
||||
static ProfilingInfo &getInfo(const string &name);
|
||||
|
||||
static void remove(const ProfilingInfo &info);
|
||||
|
||||
static void rememberTimer(const ProfilingInfo &info,clockTime &timer);
|
||||
|
||||
virtual bool writeData(Ostream &) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
105
src/OpenFOAM/global/Profiling/ProfilingStack.C
Normal file
105
src/OpenFOAM/global/Profiling/ProfilingStack.C
Normal file
|
@ -0,0 +1,105 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is based on OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM 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 General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ProfilingStack.H"
|
||||
#include "ProfilingInfo.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::ProfilingStack::ProfilingStack()
|
||||
:
|
||||
LIFOStack<ProfilingInfo*>()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::ProfilingStack::~ProfilingStack()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::ProfilingInfo &Foam::ProfilingStack::top() const
|
||||
{
|
||||
return *LIFOStack<ProfilingInfo*>::top();
|
||||
}
|
||||
|
||||
Foam::ProfilingInfo &Foam::ProfilingStack::bottom() const
|
||||
{
|
||||
return *LIFOStack<ProfilingInfo*>::bottom();
|
||||
}
|
||||
|
||||
bool Foam::ProfilingStack::empty() const
|
||||
{
|
||||
return LIFOStack<ProfilingInfo*>::empty();
|
||||
}
|
||||
|
||||
void Foam::ProfilingStack::push(ProfilingInfo &a)
|
||||
{
|
||||
LIFOStack<ProfilingInfo*>::push(&a);
|
||||
top().addedToStack();
|
||||
}
|
||||
|
||||
Foam::ProfilingInfo &Foam::ProfilingStack::pop()
|
||||
{
|
||||
top().removedFromStack();
|
||||
return *LIFOStack<ProfilingInfo*>::pop();
|
||||
}
|
||||
|
||||
void Foam::ProfilingStack::writeStackContents(Ostream &os) const
|
||||
{
|
||||
if(empty()) {
|
||||
return;
|
||||
}
|
||||
const_iterator it=begin();
|
||||
scalar oldElapsed=0;
|
||||
do {
|
||||
const ProfilingInfo &info=*(*it);
|
||||
scalar elapsed=timers_[info.id()]->elapsedTime();
|
||||
|
||||
info.writeWithOffset(os,true,elapsed,oldElapsed);
|
||||
|
||||
oldElapsed=elapsed;
|
||||
++it;
|
||||
} while(it!=end());
|
||||
}
|
||||
|
||||
void Foam::ProfilingStack::addTimer(const ProfilingInfo &info,clockTime &timer)
|
||||
{
|
||||
timers_.insert(info.id(),&timer);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
110
src/OpenFOAM/global/Profiling/ProfilingStack.H
Normal file
110
src/OpenFOAM/global/Profiling/ProfilingStack.H
Normal file
|
@ -0,0 +1,110 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is based on OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM 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 General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::ProfilingStack
|
||||
|
||||
Description
|
||||
Stack of the ProfilingInfo-items that are currently used
|
||||
|
||||
SourceFiles
|
||||
ProfilingStack.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ProfilingStack_H
|
||||
#define ProfilingStack_H
|
||||
|
||||
#include "LIFOStack.H"
|
||||
#include "clockTime.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class ProfilingInfo;
|
||||
class ProfilingPool;
|
||||
class Ostream;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ProfilingStack Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ProfilingStack
|
||||
:
|
||||
private LIFOStack<ProfilingInfo *>
|
||||
{
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
ProfilingStack(const ProfilingStack&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const ProfilingStack&);
|
||||
|
||||
//- remember the timers for the correct stack-output
|
||||
HashTable<clockTime *,label> timers_;
|
||||
protected:
|
||||
void writeStackContents(Ostream &) const;
|
||||
|
||||
void addTimer(const ProfilingInfo &info,clockTime &timer);
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
ProfilingStack();
|
||||
|
||||
// Destructor
|
||||
|
||||
~ProfilingStack();
|
||||
|
||||
|
||||
// Members that encapsulate the original stack-class
|
||||
ProfilingInfo &top() const;
|
||||
|
||||
ProfilingInfo &bottom() const;
|
||||
|
||||
bool empty() const;
|
||||
|
||||
void push(ProfilingInfo &);
|
||||
|
||||
ProfilingInfo &pop();
|
||||
|
||||
friend class ProfilingPool;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
68
src/OpenFOAM/global/Profiling/ProfilingTrigger.C
Normal file
68
src/OpenFOAM/global/Profiling/ProfilingTrigger.C
Normal file
|
@ -0,0 +1,68 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is based on OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM 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 General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ProfilingTrigger.H"
|
||||
|
||||
#include "ProfilingPool.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::ProfilingTrigger::ProfilingTrigger(const string &name)
|
||||
:
|
||||
clock_(),
|
||||
info_(ProfilingPool::getInfo(name)),
|
||||
running_(true)
|
||||
{
|
||||
ProfilingPool::rememberTimer(info(),clock());
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::ProfilingTrigger::~ProfilingTrigger()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::ProfilingTrigger::stop()
|
||||
{
|
||||
if(running_) {
|
||||
scalar elapsed=clock_.elapsedTime();
|
||||
info_.update(elapsed);
|
||||
ProfilingPool::remove(info_);
|
||||
running_=false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ************************************************************************* //
|
102
src/OpenFOAM/global/Profiling/ProfilingTrigger.H
Normal file
102
src/OpenFOAM/global/Profiling/ProfilingTrigger.H
Normal file
|
@ -0,0 +1,102 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is based on OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM 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 General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::ProfilingTrigger
|
||||
|
||||
Description
|
||||
The object that does the actual measuring
|
||||
|
||||
SourceFiles
|
||||
ProfilingTrigger.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ProfilingTrigger_H
|
||||
#define ProfilingTrigger_H
|
||||
|
||||
#include "clockTime.H"
|
||||
#include "string.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class ProfilingInfo;
|
||||
class ProfilingPool;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ProfilingTrigger Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ProfilingTrigger
|
||||
{
|
||||
// Private data
|
||||
|
||||
clockTime clock_;
|
||||
|
||||
ProfilingInfo &info_;
|
||||
|
||||
bool running_;
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
ProfilingTrigger(const ProfilingTrigger&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const ProfilingTrigger&);
|
||||
|
||||
protected:
|
||||
|
||||
clockTime &clock()
|
||||
{ return clock_; }
|
||||
|
||||
const ProfilingInfo &info() const
|
||||
{ return info_; }
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
ProfilingTrigger(const string &name);
|
||||
|
||||
~ProfilingTrigger();
|
||||
|
||||
void stop();
|
||||
|
||||
friend class ProfilingPool;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
|
@ -70,9 +70,6 @@ void Foam::BlockLduMatrix<Type>::AmulCore
|
|||
// Diagonal multiplication, no indirection
|
||||
multiply(Ax, Diag, x);
|
||||
|
||||
// Create multiplication function object
|
||||
typename BlockCoeff<Type>::multiply mult;
|
||||
|
||||
// Lower multiplication
|
||||
|
||||
if (symmetric())
|
||||
|
@ -212,9 +209,6 @@ void Foam::BlockLduMatrix<Type>::TmulCore
|
|||
// Diagonal multiplication, no indirection
|
||||
multiply(Tx, Diag, x);
|
||||
|
||||
// Create multiplication function object
|
||||
typename BlockCoeff<Type>::multiply mult;
|
||||
|
||||
// Upper multiplication
|
||||
|
||||
if (Upper.activeType() == blockCoeffBase::SCALAR)
|
||||
|
|
|
@ -61,6 +61,8 @@ SourceFiles
|
|||
#include "autoPtr.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
#include "ProfilingTrigger.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
|
@ -274,6 +276,8 @@ public:
|
|||
const lduInterfaceFieldPtrsList& interfaces_;
|
||||
|
||||
|
||||
ProfilingTrigger profile_;
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Return dictionary
|
||||
|
|
|
@ -261,7 +261,8 @@ Foam::lduMatrix::solver::solver
|
|||
matrix_(matrix),
|
||||
coupleBouCoeffs_(coupleBouCoeffs),
|
||||
coupleIntCoeffs_(coupleIntCoeffs),
|
||||
interfaces_(interfaces)
|
||||
interfaces_(interfaces),
|
||||
profile_("lduMatrix::solver_"+fieldName)
|
||||
{
|
||||
readControls();
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ License
|
|||
|
||||
#include "smoothSolver.H"
|
||||
|
||||
#include "Profiling.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
|
@ -88,6 +90,8 @@ Foam::lduSolverPerformance Foam::smoothSolver::solve
|
|||
// If the nSweeps_ is negative do a fixed number of sweeps
|
||||
if (nSweeps_ < 0)
|
||||
{
|
||||
ProfilingTrigger smoothProfile("lduMatrix::smoother_"+fieldName());
|
||||
|
||||
autoPtr<lduMatrix::smoother> smootherPtr = lduMatrix::smoother::New
|
||||
(
|
||||
matrix_,
|
||||
|
@ -135,6 +139,8 @@ Foam::lduSolverPerformance Foam::smoothSolver::solve
|
|||
// Check convergence, solve if not converged
|
||||
if (!stop(solverPerf))
|
||||
{
|
||||
ProfilingTrigger smoothProfile("lduMatrix::smoother_"+fieldName());
|
||||
|
||||
autoPtr<lduMatrix::smoother> smootherPtr =
|
||||
lduMatrix::smoother::New
|
||||
(
|
||||
|
|
|
@ -24,6 +24,8 @@ License
|
|||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "Profiling.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
|
@ -56,6 +58,8 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve
|
|||
const dictionary& solverControls
|
||||
)
|
||||
{
|
||||
ProfilingTrigger profSolve("fvMatrix::solve_"+psi_.name());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "fvMatrix<Type>::solve(const dictionary&) : "
|
||||
|
|
|
@ -27,6 +27,8 @@ License
|
|||
#include "fvScalarMatrix.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
|
||||
#include "Profiling.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
|
@ -141,6 +143,8 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Foam::scalar>::solve
|
|||
const dictionary& solverControls
|
||||
)
|
||||
{
|
||||
ProfilingTrigger profSolve("fvMatrix::solve_"+psi_.name());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "fvMatrix<scalar>::solve(const dictionary& solverControls) : "
|
||||
|
|
|
@ -37,6 +37,8 @@ License
|
|||
|
||||
#include "fvCFD.H"
|
||||
|
||||
#include "ProfilingTrigger.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::MULES::explicitSolve
|
||||
|
@ -48,6 +50,7 @@ void Foam::MULES::explicitSolve
|
|||
const scalar psiMin
|
||||
)
|
||||
{
|
||||
ProfilingTrigger trigger("MULES::explicitSolve");
|
||||
explicitSolve
|
||||
(
|
||||
geometricOneField(),
|
||||
|
@ -69,6 +72,7 @@ void Foam::MULES::implicitSolve
|
|||
const scalar psiMin
|
||||
)
|
||||
{
|
||||
ProfilingTrigger trigger("MULES::implicitSolve");
|
||||
implicitSolve
|
||||
(
|
||||
geometricOneField(),
|
||||
|
|
|
@ -32,6 +32,8 @@ License
|
|||
#include "Time.H"
|
||||
#include "OFstream.H"
|
||||
|
||||
#include "Profiling.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
|
@ -125,6 +127,8 @@ template<class ParticleType>
|
|||
template<class TrackingData>
|
||||
void Foam::Cloud<ParticleType>::move(TrackingData& td)
|
||||
{
|
||||
addProfile2(moveProfile,"Cloud<ParticleType>::move_"+this->name());
|
||||
|
||||
const globalMeshData& pData = polyMesh_.globalData();
|
||||
const labelList& processorPatches = pData.processorPatches();
|
||||
const labelList& processorPatchIndices = pData.processorPatchIndices();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
cWARN = -Wall
|
||||
|
||||
cc = gcc $(WM_CXXFLAGS)
|
||||
cc = $(WM_CC) $(WM_CXXFLAGS)
|
||||
|
||||
include $(RULES)/c$(WM_COMPILE_OPTION)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
|
||||
|
||||
CC = g++ $(WM_CXXFLAGS)
|
||||
CC = $(WM_CXX) $(WM_CXXFLAGS)
|
||||
|
||||
include $(RULES)/c++$(WM_COMPILE_OPTION)
|
||||
|
||||
|
|
3
wmake/rules/darwinIntel64/mplibMACPORTOPENMPI
Normal file
3
wmake/rules/darwinIntel64/mplibMACPORTOPENMPI
Normal file
|
@ -0,0 +1,3 @@
|
|||
PFLAGS = -DOMPI_SKIP_MPICXX
|
||||
PINC = -I$(MPI_ARCH_PATH)/include/openmpi
|
||||
PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi
|
Reference in a new issue