summaryrefslogtreecommitdiff
path: root/src/include
Commit message (Collapse)AuthorAge
* Protect declarations with external "C"eschnett2012-05-07
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4813 17b73243-c579-4c4c-a9d2-2d5706c11dac
* add function to query name of currently scheduled functionrhaas2012-04-23
| | | | | | | | | | this adds a function CCTK_ScheduleQueryCurrentFunction which returns the cFunctionData of the function currently executing via CCTK_CallScheduledFunction git-svn-id: http://svn.cactuscode.org/flesh/trunk@4805 17b73243-c579-4c4c-a9d2-2d5706c11dac
* expand expression language, add error checking, and more documentationrhaas2012-04-19
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4804 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Allow arithmetic expression in ParameterSetrhaas2012-04-11
| | | | | | | | | | | | | | | | | | Expression are of the form: foo::bar = 2*sin(foo:baz) ie. arithmetic and access to already set parameters. The new behaviour is triggered if the parameter string (for real, boolean and int parameters) does not parser properly as a double/int/bool. This last test is mostly an optimization. The largest change is actually in the expression parser which has been extended to handle eg. exponential notation and negations. It now uses a state machine to parse its input. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4797 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Merge branch 'NewSchedule' into trunkhinder2012-01-31
| | | | | | | | | | | This provides support for specifying READS and WRITES clauses for each function scheduled in schedule.ccl. These list the variables which the scheduled function reads from or writes to. This supports future dependency-based scheduling. See https://docs.einsteintoolkit.org/et-docs/Adding_requirements_to_the_Cactus_scheduler for more information. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4788 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Improve comment explaining cGH->dataeschnett2011-12-12
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4777 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Declare cctkGH as const*eschnett2011-12-01
| | | | | | | | Declare cctkGH as const*, and CCTK_ARGUMENTS as const. This prevents accidental modifications and allows more optimisations. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4772 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Make table printing functions publicly accessibleeschnett2011-11-09
| | | | | | | | | | | | The table data types (util_Table.h) have internal routines that print the table contents to screen. This can be helpful for debugging. This patch makes these functions publicly available. Add a routine Util_TablePrintPretty that converts a table to a nice, human-readable string. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4769 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Improve performance of Fortran index calculationseschnett2011-10-27
| | | | | | | | | | | | | | | | | | | | | | | | | | In Fortran, Cactus currently declares grid functions e.g. as (this is the expansion of DECLARE_CCTK_ARGUMENTS) REAL*8 gxx (X0metric,X1metric,X2metric) where X0metric etc. are integers passed into the routine. Each grid function group has its own, independent size. This has two disadvantages: - The compiler does not know that all grid functions have the same size (namely cctk_lsh), and thus has to perform array index calculations separately for each group - The argument list is longer than neded The enclosed patch declares grid functions via cctk_lsh. Grid arrays are still declared independently. This reduces the code size of e.g. GRHydro/GRHydro_Tmunu.F90 from 6836 to 6241 bytes on my system. I have not attempted to measure a performance difference. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4763 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Correct definitions of CCTK_LSSH and CCTK_LSSH_IDX in Fortraneschnett2011-08-28
| | | | | | | | Correct definitions of CCTK_LSSH and CCTK_LSSH_IDX in Fortran. Add comments. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4722 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Check indices in CCTK_GFINDEX3D and friends when CCTK_DEBUG is definedeschnett2011-08-19
| | | | | | | | Check grid point indices in CCTK_GFINDEX3D and friends when CCTK_DEBUG is defined. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4719 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Check HAVE_CCTK_C_INLINE to see if inlining is supportedeschnett2011-08-14
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4716 17b73243-c579-4c4c-a9d2-2d5706c11dac
* This patch makes the CST stage create prototypes for all scheduledeschnett2011-03-30
| | | | | | | | | | | functions into a new file cctk_ScheduleFunctions.h, which is included into cctk.h. This is done only for C (and C++) since Fortran prototypes cannot be declared at file scope. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4696 17b73243-c579-4c4c-a9d2-2d5706c11dac
* include cctk_Termination.h from cctk.hknarf2011-02-07
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4683 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Improve optional requirement of capabilitieseschnett2010-12-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Thorns can specify that they can make use of a particular capability (for example HDF5), but that it is not absolutely required. It is currently not possible to detect a capability in the source code or make system of a thorn because there is no preprocessor macro and no make variable defined to indicate that the capability is available. Additionally, the preprocessor definitions which are explicitly provided by a capability are written to an include file which is malformed and hence these definitions cannot be read. This commit: * Introduces makefile and preprocessor variables HAVE_CAPABILITY_<cap> for each provided capability * Removes the incorrect definition line causing the include file to be malformed * Renames cctki_Capabilities.h to cctk_Capabilities.h and causes cctk_Capabilities.h to be included from cctk.h by all thorns * Excludes cctk_Capabilities.h from dependency checking (dependencies of the files included from this one will be sufficient) [Patch from Ian Hinder] git-svn-id: http://svn.cactuscode.org/flesh/trunk@4659 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add CCTK_VECTGFINDEX3D and friendseschnett2010-11-24
| | | | | | | | | | Add functions CCTK_VectGF1D, CCTK_VectGF2D etc. and the corresponding macros CCTK_VECTGFINDEX1D etc. that allow indexing into vector grid variables. Vector grid variables require an additional index, namely the vector index; these functions simplify using them. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4654 17b73243-c579-4c4c-a9d2-2d5706c11dac
* support __unused__ where known. This let's e.g. gcc know that especially the ↵knarf2010-11-23
| | | | | | Cactus variables might be unused and should not be reported as such. This closes ET ticket #1 git-svn-id: http://svn.cactuscode.org/flesh/trunk@4651 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add new schedule modes meta_early, meta_late, global_early, andschnetter2009-12-05
| | | | | | | | | global_late. These modes can then be used in Carpet, where they will simplify traversing the schedule tree when local, level, and global mode routines are mixed. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4589 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Rename routine CCTK_IOMethod to CCTK_IOMethodName, since it returnsschnetter2009-12-05
| | | | | | | | | | the name of the I/O method, not an IOMethod structure. Add a new routine CCTK_IOMethod which returns a pointer to the IOMethod structure describing the I/O method. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4588 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Provide LoopControl macros.schnetter2009-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These generalise the LoopControl thorn of Carpet, and introduce a generic looping mechanism to Cactus. They provides a simple, straightforward implementation (without the optimisations found in Carpet's LoopControl thorn), and other thorns can provide various optimisations, e.g. loop tiling or OpenMP parallelisation. The macros are defined in a new file cctk_Loop.h, automatically included from cctk.h. There are macros for 1D, 2D, 3D, and 4D loops, corresponding to Cactus' CCTK_GFINDEX* macros. Each macro comes in four variants: CCTK_LOOP3: a generic 3D loop CCTK_LOOP3_ALL: loop over all grid points of a grid function CCTK_LOOP3_INTERIOR: loop over the interior points, excluding ghost, symmetry, and boundary points CCTK_LOOP3_BOUNDARY: loop over all (outer) boundary points The header file contains a straightforward implementation via macros that expand to corresponding "for" statements. There are also macros for Fortran, but these are much less elegant since Fortran does not support block-scope local variables. In addition, Fortran requires declaring certain variables as private when OpenMP is used, which adds another complication. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4581 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Remove superfluous argument "first" from if_check prototype; "first"schnetter2008-08-29
| | | | | | | only makes sense for while_check. Update all callers and callees. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4502 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Correct inconsistency in prototype for argument check_if in functionschnetter2008-05-26
| | | | | | | CCTKi_DoScheduleTraverse. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4490 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add IF clauses to schedule itemsschnetter2008-04-09
| | | | | | | | | | | | | | | Schedule items in Cactus can already have WHILE clauses, which means that they are executed while a certain condition are true. This patch adds IF clauses, which means that they are executed only if a certain condition is true. The syntax is equivalent to WHILE clauses. These if clauses is different from the existing C-syntax if statements, which are only evaluated at startup and determine how the schedule is constructed. These if clauses are evaluated every time the schedule is traversed, and can skip certain schedule items. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4478 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add a new function CCTK_MaxGFDim to the flesh which returns theschnetter2008-04-07
| | | | | | | | | | | | | | | | | (maximum) dimension of all grid functions. Cactus can currently not handle the case where one uses grid arrays of dimension D while grid functions have a dimension less than D. During initialisation, Cactus sets cctk_dim to the largest dimension of all grid variables in all active thorns. This is arguably wrong; cctk_dim should be set to the (maximum) dimension of the grid functions. This patch adds a new function CCTK_MaxGFDim to the flesh which returns the (maximum) dimension of all grid functions. This function is used to set cctk_dim. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4476 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Correct #ifdef _cplusplus to #ifdef __cplusplus to find out whetherschnetter2007-11-16
| | | | | | | the header file is compiled by a C++ compiler. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4438 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Implement a new flesh function CCTK_SchedulePrintTimesToFile.schnetter2007-08-25
| | | | | | | | | The existing internal schedule printing functions now take an additional FILE* argument, and the existing CCTK_SchedulePrintTimes prints explicitly to stdout. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4428 17b73243-c579-4c4c-a9d2-2d5706c11dac
* This patch makes complex arithmetic in C and C++ more efficient, andschnetter2007-04-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | makes it much more convenient for C++, expecially when templates are used. The flesh functions for complex arithmetic are defined (not only declared) by including Complex.c from the header file cctk_Complex.h. They are declared "static inline", so the the compiler can inline them, but does not have to create an out-of-line copy for every source file. Complex.c is also compiled stand-alone without the "static inline" prefix, so that out-of-line copies exist as well. Add some new complex arithmetic functions, e.g. ComplexNeg to change the sign. Make some complex arithmetic functions more efficient by using algorithms from glibc. These algorithms are LGPL. They should be faster and/or more accurate than the existing implementations. For C++, define the usual arithmetic operators (+-*/ etc.) as inline functions calling the corresponding complex arithmetic functions. This makes it possible to use complex numbers in the same way as real numbers, which makes it possible to instantiate templates for both CCTK_REAL and CCTK_COMPLEX. This leads to much code reduction in Carpet. The patch also appends a type postfix to the names of math functions called in the inlined routines: 'f' for HAVE_CCTK_REAL4, nothing for HAVE_CCTK_REAL8, and 'l' for HAVE_CCTK_REAL16. This avoids compiler warnings about conversions from "double" to "float" which may lose significant bits. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4418 17b73243-c579-4c4c-a9d2-2d5706c11dac
* remove external include guard "#ifndef _CCTK_TYPES_H" aroundjthorn2006-12-21
| | | | | | | | | | | | | | | #include "cctk_Types.h" since this is (a) wrong [the actual symbol is _CCTK_TYPES_H_ (with a trailing underscore)], (b) unnecessary [cctk_Types.h already has an internal include guard, and modern compilers have special-case optimizations for internal include guards so they're just as fast at compile-time as external ones], and (c) inconsistent with the 3 other files in this same directory (cctk_Groups.h, cctk_Misc.h, and util_Table.h) which #include "cctk_Types.h", none of which use an external include guard git-svn-id: http://svn.cactuscode.org/flesh/trunk@4397 17b73243-c579-4c4c-a9d2-2d5706c11dac
* oops, the previous commit lost a file, due to a permissions problemswhite2006-10-26
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4382 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Added two new flesh API functions CCTK_ParameterSetNotifyRegister() andtradke2006-09-28
| | | | | | | | | | | | | CCTK_ParameterSetNotifyUnregister() to register/unregister user callback functions for parameter set nofications. See discussion thread http://www.cactuscode.org/old/pipermail/developers/2006-September/005090.html for details. This closes patch Cactus-2057 "add new flesh functions to register/unregister notify callbacks for parameter set operations". git-svn-id: http://svn.cactuscode.org/flesh/trunk@4375 17b73243-c579-4c4c-a9d2-2d5706c11dac
* add another error code for the interpolators:jthorn2006-08-31
| | | | | | | | | | previously specifying a grid spacing of zero caused the interpolator to return a generic "we encountered a NaN/infinity/non-finite" error code now there's a new error code specifically for this case git-svn-id: http://svn.cactuscode.org/flesh/trunk@4368 17b73243-c579-4c4c-a9d2-2d5706c11dac
* += new interpolator error codejthorn2006-08-13
| | | | | | | | CCTK_ERROR_INTERP_COORD_NAN (needed for a bugfix in some other interpolator code) git-svn-id: http://svn.cactuscode.org/flesh/trunk@4362 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add new flesh API functions CCTK_CompileDateTime() and Util_CurrentDateTime()tradke2006-07-28
| | | | | | | | | | | | | to return a date/time stamp following the ISO 8601 standard format if possible (see http://www.cactuscode.org/old/pipermail/developers/2006-July/004971.html). Add the timezone information in the time stamp returned by Util_CurrentTime(). You also need to update lib/make/make.configuration now in order to compile src/datestamp.c. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4358 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Declare and make use of new overloadable CCTK_SyncGroupsByDirI() whichtradke2006-07-06
| | | | | | | | | | | synchronises multiple groups in a single call. This function deprecates the old overloadable function CCTK_SyncGroup(). This patch concludes the discussion thread starting on http://www.cactuscode.org/old/pipermail/developers/2006-June/004933.html. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4348 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Added new command line option '--logdir <dir>' which sets the output directorytradke2006-06-29
| | | | | | | | | | for logfiles created by the \texttt{-r} option. If the directory doesn't exist yet, it will be created by Cactus. This applies patch http://www.cactuscode.org/old/pipermail/developers/2006-June/004901.html. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4337 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add a new command line option to select the buffering mode of stdout.schnetter2006-06-23
| | | | | | | | | | | | | The option is "-b <mode>", or "-buffering=<mode>", where mode can be "no", "line", or "full". This option uses the ANSI C function call setvbuf() to select the corresponding buffering mode. The buffering mode can be selected only once in a portable programme, and it has to be selected before the first output occurs. This means that it has to be implemented in the flesh. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4329 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Application of Frank Löffler's patch of 28.02.06swhite2006-06-15
| | | | | | | | | | | | | reduces FARGUMENTS line length in cctk.h http://www.cactuscode.org/old/pipermail/patches/2006-February/000138.html "Spaces in _CCTK_FARGUMENTS removed to use as less space as possible. This leaves thorn writers more space for their own variables. Space can be a problem because of Fortran standard and/or compiler limitations." git-svn-id: http://svn.cactuscode.org/flesh/trunk@4322 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Applies Erik's patch from 06.03.06swhite2006-05-11
| | | | | | | Define HAVE_CCTK_BYTE etc. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4294 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Applying Erik's patch from 6.10.05swhite2006-05-11
| | | | | | | New command line option to stop after printing the schedule git-svn-id: http://svn.cactuscode.org/flesh/trunk@4293 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Correct 3D stagger codesschnetter2006-04-20
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4284 17b73243-c579-4c4c-a9d2-2d5706c11dac
* According to the standard, the ptrdiff_t type is declared in <stddef.h> (andtradke2006-02-09
| | | | | | | not in <stdlib.h> as used in my previous commit). git-svn-id: http://svn.cactuscode.org/flesh/trunk@4251 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Define the variable cctki_dummy_int (which is used internally in thetradke2006-02-08
| | | | | | | | | | DECLARE_CCTK_ARGUMENTS macro to do pointer arithmetics) of type 'ptrdiff_t' rather than 'int'. This prevents compiler warnings on 64-bit systems where pointer offsets are assumed as long ints. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4250 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fix macro for getting size of staggered array.goodale2005-12-15
| | | | | | | Patch from David Rideout. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4215 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Patch from Erik Schnetter to track the capacity of the list andgoodale2005-12-13
| | | | | | | produce an error if it is exceeded. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4210 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Define macros CCTK_{INT,REAL,COMPLEX}_PRECISION to values of 1, 2, 4, 8, 16,goodale2005-12-13
| | | | | | | | | | | or 32, depending on the definition of the default data types CCTK_{INT,REAL,COMPLEX}. These new macros make type generic code more convenient to write. Patch from Erik Schnetter. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4209 17b73243-c579-4c4c-a9d2-2d5706c11dac
* migration from misnomer pointwise-reduction to reduce arrays globallyyye002005-11-14
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4195 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Pointwise reduction flesh supportyye002005-11-08
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4194 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Untabifying.goodale2005-10-03
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4163 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Untabifying.goodale2005-10-03
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4158 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Patch from Jian Tao to add some callback functionality to thegoodale2005-10-03
| | | | | | | | | | warning system. This allows thorns to register functions which will be called when CCTK_Warn or CCTK_Info are called, with the contents of the warning/info message, thus allowing thorns to do things like logging warnings to file or displaying on webpages. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4157 17b73243-c579-4c4c-a9d2-2d5706c11dac