summaryrefslogtreecommitdiff
path: root/doc/FAQ
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-10-08 20:15:04 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-10-08 20:15:04 +0000
commit7bf96ccc586b94b647c36ae65ee317a4dfe6bdc9 (patch)
treed502e48bbfb08e356ebef998a1e630e5f968886e /doc/FAQ
parentbaa9c7e4ca5f49c8ce0a853ce17d57e57cf70d78 (diff)
E8 Is there anyway to only compile certain lines of source code if a
particular thorn is in the compiled ThornList? Yes, but this is not a good idea for a number of reasons - it adds hidden dependencies between thorns, and can easily lead to unexpected and hard to track down behaviour when a thorn is compiled but not active - it breaks all kinds of modularity infrastructure in Cactus - the include file you need to use will cause your source code to be recompiled when other thorns change But if you insist, and accept the consequences, this is how you do it, Include the header file cctk_DefineThorn.h In your code use #ifdef ARRANGEMENTNAME_THORNNAME <your source code> #endif If appropriate, to give yourself some protection, use the function CCTK_IsThornActive to only execute the source code if the thorn was actually activated (and not just compiled in). Add a comment to your README/Documentation.tex to remind yourself, and others of what you have done. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3012 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'doc/FAQ')
-rw-r--r--doc/FAQ39
1 files changed, 37 insertions, 2 deletions
diff --git a/doc/FAQ b/doc/FAQ
index dc9f4238..3bbe7773 100644
--- a/doc/FAQ
+++ b/doc/FAQ
@@ -1,7 +1,7 @@
Cactus Code Frequently Asked Questions
-$Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/doc/FAQ,v 1.49 2002-09-26 06:38:30 allen Exp $
+$Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/doc/FAQ,v 1.50 2002-10-08 20:15:04 allen Exp $
Also available at http://www.cactuscode.org/Documentation/FAQ
@@ -196,6 +196,9 @@ E7 If I have two grid array groups with identical sizes (and ghost zones,
will be the same? It is true empirically. What if the grid arrays have
different variable types or numbers of time levels?
+E8 Is there anyway to only compile certain lines of source code if a
+ particular thorn is in the compiled ThornList?
+
------------------------------------------------------------------------------
General
@@ -1005,6 +1008,38 @@ E7 If I have two grid array groups with identical sizes (and ghost zones,
Yes to all.
+E8 Is there anyway to only compile certain lines of source code if a
+ particular thorn is in the compiled ThornList?
+
+ Yes, but this is not a good idea for a number of reasons
+
+ - it adds hidden dependencies between thorns, and can easily lead to
+ unexpected and hard to track down behaviour when a thorn is compiled
+ but not active
+
+ - it breaks all kinds of modularity infrastructure in Cactus
+
+ - the include file you need to use will cause your source code to be
+ recompiled when other thorns change
+
+ But if you insist, and accept the consequences, this is how you do it,
+
+ Include the header file cctk_DefineThorn.h
+
+ In your code use
+
+ #ifdef ARRANGEMENTNAME_THORNNAME
+ <your source code>
+ #endif
+
+ If appropriate, to give yourself some protection, use the function
+ CCTK_IsThornActive to only execute the source code if the thorn was
+ actually activated (and not just compiled in).
+
+ Add a comment to your README/Documentation.tex to remind yourself, and
+ others of what you have done.
+
+
------------------------------------------------------------------------------
General
@@ -1127,4 +1162,4 @@ G1 How can I build the ThornGuide documentation for single thorns or
gmake ThornGuide THORNS="CactusBase/Boundary"
- gmake ThornGuide ARRANGEMENTS="CactusBase" \ No newline at end of file
+ gmake ThornGuide ARRANGEMENTS="CactusBase"