[ET Trac] [Einstein Toolkit] #1378: provide equivalent of fprintf(stderr, "%s\n", msg) in Fortran

Einstein Toolkit trac-noreply at einsteintoolkit.org
Thu Jun 6 19:02:38 CDT 2013


#1378: provide equivalent of fprintf(stderr, "%s\n", msg) in Fortran
-------------------------+--------------------------------------------------
 Reporter:  rhaas        |       Owner:                     
     Type:  enhancement  |      Status:  new                
 Priority:  minor        |   Milestone:                     
Component:  Cactus       |     Version:  development version
 Keywords:               |  
-------------------------+--------------------------------------------------
 Currently to write out multi-line error messages in Fortran we use
 multiple calls to CCTK_WARN(1, warnline) followed possibly by a
 CCTK_ERROR(errline). Each of the level 1 warnings (given certain settings
 of the Cactus parameters) prints the source file location and other
 information to screen, thus cluttering the error output. A typical error
 message might look like this:
 {{{
 WARNING level 1 in thorn GRHydro processor 179 host nid03278
   (line 386 of GRHydro_Prim2Con.F90):
   -> EOS error in prim2con_hot:
 WARNING level 1 in thorn GRHydro processor 179 host nid03278
   (line 388 of GRHydro_Prim2Con.F90):
   ->    64897   22   37   31  -1.440000E+00  -8.496000E+01  -1.296000E+01
 8.595485E+01
 WARNING level 1 in thorn GRHydro processor 179 host nid03278
   (line 390 of GRHydro_Prim2Con.F90):
   ->    1.228064E-09  -8.644951E-03  -5.842300E-01   4.789413E-01
 WARNING level 1 in thorn GRHydro processor 179 host nid03278
   (line 392 of GRHydro_Prim2Con.F90):
   ->  code:      106
 WARNING level 1 in thorn GRHydro processor 179 host nid03278
   (line 394 of GRHydro_Prim2Con.F90):
   -> reflevel:     0
 WARNING level 1 in thorn GRHydro processor 179 host nid03278
   (line 386 of GRHydro_Prim2Con.F90):
   -> EOS error in prim2con_hot:
 WARNING level 1 in thorn GRHydro processor 179 host nid03278
   (line 388 of GRHydro_Prim2Con.F90):
   ->    64897   23   37   31   1.440000E+00  -8.496000E+01  -1.296000E+01
 8.595485E+01
 WARNING level 1 in thorn GRHydro processor 179 host nid03278
   (line 390 of GRHydro_Prim2Con.F90):
   ->    1.227982E-09  -8.644755E-03  -5.798389E-01   4.789407E-01
 WARNING level 1 in thorn GRHydro processor 179 host nid03278
   (line 392 of GRHydro_Prim2Con.F90):
   ->  code:      106
 WARNING level 1 in thorn GRHydro processor 179 host nid03278
   (line 394 of GRHydro_Prim2Con.F90):
   -> reflevel:     0
 WARNING level 1 in thorn GRHydro processor 179 host nid03278
   (line 166 of GRHydro_Eigenproblem.F90):
   -> EOS ERROR in eigenvalues_hot
 WARNING level 1 in thorn GRHydro processor 179 host nid03278
   (line 168 of GRHydro_Eigenproblem.F90):
   ->   keyerr:   668 keytemp:     0
 WARNING level 0 in thorn GRHydro processor 179 host nid03278
   (line 170 of GRHydro_Eigenproblem.F90):
   ->    1.228064E-09  -8.644951E-03  -5.842300E-01   4.789413E-01
 5.668696E-04
 cactus_sim:
 Cactus/arrangements/Carpet/Carpet/src/helpers.cc:314:
 int Carpet::Abort(const cGH*, int): Assertion `0' failed.
 Rank 179 with PID 13388 received signal 6
 }}}

 with errors from multiple MPI processes possibly intersecting each other.

 It would be useful to provide a subroutine equivalent to
 {{{
 subroutine CCTK_WARN_SHORT(msg)
   character*(*) :: msg
   write (stderr,'(a)') msg
 end subroutine
 }}}
 (name is up for discussion) that outputs only "msg" to stderr (and the
 warning listener registered in the flesh) without prepending the file
 information output.

 A similar routine might be offered for C (in WARN and VWarn flavors) both
 for symmetry reasons and to have the message pass the warning listeners,
 though in C one can usually get away with a single CCTK_VWarn and a very
 long format string.

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/1378>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list