Opened 5 years ago

Last modified 5 years ago

#1583 new enhancement

Carpet default poison value should not be NaN

Reported by: Ian Hinder Owned by: Erik Schnetter
Priority: optional Milestone:
Component: Carpet Version: development version
Keywords: Cc:


Carpet initialises Cactus variables to NaN as this is a quantity which is likely to be noticed. However, this makes it impossible to know when you see a NaN whether you have a programming error (accessing uninitialised memory) or a numerical problem (numerical solution has blown up).

I usually set the carpet poison value to something else; a value like 10230 is just as likely to be noticed as a NaN, and when you see exactly that value, you know that you are looking at uninitialised data, rather than a computation which went wrong.

Attachments (0)

Change History (4)

comment:1 Changed 5 years ago by Erik Schnetter

There are many different nan values. When you see a nan, you can check whether it has this value. Unfortunately, ASCII output does not output the nan bit pattern on most systems.

comment:2 Changed 5 years ago by Ian Hinder

I think we need a solution which works with ASCII output, as well as values displayed on standard output. If we must use NaN, maybe Cactus could interpret it and call it POISON every time it outputs it as ASCII (to file or standard output/error).

comment:3 Changed 5 years ago by Erik Schnetter

We could add the nan pattern to ASCII output, e.g. as "nan(0x12345678)".

comment:4 Changed 5 years ago by Roland Haas

Side note: it would be good if CarpetLib were to also poison new memory by default, the same way that Carpet poisons new timelevels by default.

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain Erik Schnetter.
Next status will be 'review'.
as The resolution will be set.
to The owner will be changed from Erik Schnetter to the specified user.
Next status will be 'confirmed'.
The owner will be changed from Erik Schnetter to anonymous.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.