Is there a way to, e.g. call CarpetIOHDF5, from the middle of a subroutine -- apart from "scheduling" the output? I'm debugging a new thorn, and I want to be able to view the changes to data as they proceed through the various operations. (And it'd be nice to not have to break up my routine into a series of sub-thorns just to debug..)
Thanks! Scott
On Tue, May 01, 2012 at 08:16:03AM -0700, Scott Hawley wrote:
Is there a way to, e.g. call CarpetIOHDF5, from the middle of a subroutine -- apart from "scheduling" the output?
That should be possible using CCTK_OutputVarAsByMethod, see below.
Frank
int istat = CCTK_OutputVarAs (const cGH *cctkGH, const char *variable, const char *alias);
Parameters
istat return status cctkGH pointer to CCTK grid hierarchy variable full name of variable to output, with an optional options stri alias alias name to base the output filename on
Discussion The output should take place if at all possible. If the appropriate file exists the data is appended, otherwise a new file is created. Uses alias as the name of the variable for the purpose of constructing a filename.
Errors positive the number of IO methods which did output of variable 0 for success negative if no IO methods were registered
On 1 May 2012, at 17:25, Frank Loeffler wrote:
On Tue, May 01, 2012 at 08:16:03AM -0700, Scott Hawley wrote:
Is there a way to, e.g. call CarpetIOHDF5, from the middle of a subroutine -- apart from "scheduling" the output?
That should be possible using CCTK_OutputVarAsByMethod, see below.
See https://bitbucket.org/ianhinder/substepoutput/src/68caba7fa824/src/substepou... for an example.
Awesome! Thanks! That works!
On 5/1/12 10:43 AM, "Ian Hinder" ian.hinder@aei.mpg.de wrote:
On 1 May 2012, at 17:25, Frank Loeffler wrote:
On Tue, May 01, 2012 at 08:16:03AM -0700, Scott Hawley wrote:
Is there a way to, e.g. call CarpetIOHDF5, from the middle of a subroutine -- apart from "scheduling" the output?
That should be possible using CCTK_OutputVarAsByMethod, see below.
See https://bitbucket.org/ianhinder/substepoutput/src/68caba7fa824/src/substep output.cc for an example.
-- Ian Hinder http://numrel.aei.mpg.de/people/hinder
Hey guys, Frank recommended CCTK_OutputVarAsByMethod, but gave code for CCTK_OutputVarAsBy. When I use the latter, the code segmentation faults.
Ian, I couldn't find where you set the variable output_method in your example. Where does that definition go?
CCTK_OutputVarAsByMethod(cctkGH, fullvarname, output_method, alias_name);
Thanks, Scott
On 5/1/12 10:25 AM, "Frank Loeffler" knarf@cct.lsu.edu wrote:
On Tue, May 01, 2012 at 08:16:03AM -0700, Scott Hawley wrote:
Is there a way to, e.g. call CarpetIOHDF5, from the middle of a subroutine -- apart from "scheduling" the output?
That should be possible using CCTK_OutputVarAsByMethod, see below.
Frank
int istat = CCTK_OutputVarAs (const cGH *cctkGH, const char *variable, const char *alias);
Parameters
istat return status cctkGH pointer to CCTK grid hierarchy variable full name of variable to output, with an optional options stri alias alias name to base the output filename on
Discussion The output should take place if at all possible. If the appropriate file exists the data is appended, otherwise a new file is created. Uses alias as the name of the variable for the purpose of constructing a filename.
Errors positive the number of IO methods which did output of variable 0 for success negative if no IO methods were registered
On 9 May 2012, at 01:41, Scott Hawley wrote:
Hey guys, Frank recommended CCTK_OutputVarAsByMethod, but gave code for CCTK_OutputVarAsBy. When I use the latter, the code segmentation faults.
Ian, I couldn't find where you set the variable output_method in your example. Where does that definition go?
CCTK_OutputVarAsByMethod(cctkGH, fullvarname, output_method, alias_name);
It's in the param.ccl file. https://bitbucket.org/ianhinder/substepoutput/src/68caba7fa824/param.ccl
The output methods are those registered by the output thorns. You could check the output thorn sources to find the output method names they register. It might even be listed on standard output, I'm not sure.
users@lists.einsteintoolkit.org