diff options
author | jthorn <jthorn@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-03-21 15:42:01 +0000 |
---|---|---|
committer | jthorn <jthorn@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-03-21 15:42:01 +0000 |
commit | 76e64d710750d4bba808a4fb5ea36ab3d8a5d00d (patch) | |
tree | 94a3757c64fad5deef6441f5b89ff895abd7bf6e /src/schedule | |
parent | 7c26d9e6aaf82cfd405eabf9ab8915ead72a9ee5 (diff) |
This is a partial fix for bug Cactus/1908
scheduling error neither aborts Cactus run nor gives useful error message
so scheduling errors now abort the Cactus run.
In particular, this commit changes the error-handling strategy of
CCTKi_DoScheduleSortAllGroups()
ScheduleSortGroup()
from "print a message to stderr, then return error code"
to CCTK_VWarn(CCTK_WARN_ABORT, ...), i.e.
"print a message to stderr, then abort the Cactus run".
The CCTKi_DoScheduleSortAllGroups() message is the same one as before.
The ScheduleSortGroup() message is changed to include the group name.
(N.b. the other part of Cactus/1908, that the schedule-error
message is uninformative, is *not* fixed by this commit.)
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4016 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/schedule')
-rw-r--r-- | src/schedule/ScheduleCreater.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/schedule/ScheduleCreater.c b/src/schedule/ScheduleCreater.c index 958223f3..7aef2a5a 100644 --- a/src/schedule/ScheduleCreater.c +++ b/src/schedule/ScheduleCreater.c @@ -12,6 +12,7 @@ #include <stdlib.h> #include <string.h> +#include "cctk_WarnLevel.h" #include "cctk_Flesh.h" #include "cctki_Schedule.h" @@ -325,7 +326,13 @@ int CCTKi_DoScheduleGroup(const char *gname, @calls ScheduleSortGroups @calledby @history - + @hdate Mon Mar 21 16:33:07 CET 2005 + @hauthor Jonathan Thornburg <jthorn@aei.mpg.de> + @nddesc change error-handling strategy from + "print a message to stderr, then return error code" + to CCTK_VWarn(CCTK_WARN_ABORT, ...), i.e. + "print a message to stderr, then abort the Cactus run"; + this is a partial fix for bug Cactus/1908 @endhistory @returntype int @@ -351,10 +358,10 @@ int CCTKi_DoScheduleSortAllGroups(void) if(errcode) { - fprintf(stderr, + CCTK_VWarn(CCTK_WARN_ABORT, __LINE__, __FILE__, "Cactus", "Error while sorting group '%s' - %d remaining unsorted routines.\n", gdata->name, - -errcode); + -errcode); /*NOTREACHED*/ n_errors += -errcode; } @@ -690,7 +697,13 @@ static t_sched_modifier_type ScheduleTranslateModifierType(const char *modifier) CCTKi_ScheduleDestroyArray CCTKi_ScheduleDestroyIVec @calledby @history - + @hdate Mon Mar 21 16:33:07 CET 2005 + @hauthor Jonathan Thornburg <jthorn@aei.mpg.de> + @nddesc change error-handling strategy from + "print a message to stderr, then return error code" + to CCTK_VWarn(CCTK_WARN_ABORT, ...), i.e. + "print a message to stderr, then abort the Cactus run" + this is a partial fix for bug Cactus/1908 @endhistory @var group @vdesc The schedule group @@ -804,7 +817,9 @@ static int ScheduleSortGroup(t_sched_group *group) if(errcode) { - fprintf(stderr, "Schedule sort failed with error code %d\n", errcode); + CCTK_VWarn(CCTK_WARN_ABORT, __LINE__, __FILE__, "Cactus", + "Schedule sort of group %s failed with error code %d\n", + group->name, errcode); /*NOTREACHED*/ } #ifdef DEBUG_SCHEDULAR |