issue with the evaluationDate

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

issue with the evaluationDate

Didrik Pinte-5
Hi,

I am working on some Cython wrappers on top of QuantLib. They do work
really nicely (and will be made available soon).

I am hitting a weird issue that some of you might have seen in the
past or could help debugging.

I am testing the code on five different machines :
- MacOSX - Python 2.7 32bit - gcc 4.2 / boost 1.46 / QuantLib 1.0.1
- Windows 64bit - Python 2.7 - mingw / boost 1.46 /QuantLib 1.0.1
- Debian SID - Python 2.7 - 64bit - gcc 4.6 / boost 1.46 / QuantLib 1.1
- Ubuntu 11.04 - Python 2.7 32bit - gcc 4.5.2 / boost 1.42 / QuantLib 1.0.1
- Ubuntu 11.04 - Python 2.7 64bit - gcc 4.5.2 / boost 1.42 / QuantLib 1.0.1

For all the machines, the code to set and get the evaluationDate works fine.

All the code depending on the evaluationDate works correctly only on
the MacOSX, Debian and Windows boxes. I am testing bond valuation,
options, etc.
The Ubuntu's do fail with the evaluationDate being always equal to
today (even if asking for Settings::instance().evaluationDate()
returns the evaluation date that we have set).

Could it be related to the boost version ? Does anyone have an idea on
the cause of the issue ? I have looked at the compilation flags using
for the SWIG wrapper and we're using the same. Reading the cpp code
generated by Cython does not give information. I have added a listener
(using registerWith) within the code and it shows the date is changed
properly (or at least that the event happens). On a FixedRateBond, if
I set the evaluation_date to 15 days ago, I get a settlementDate three
days after today.

Thanks in advance for any help/hints/suggestions.

-- Didrik

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: issue with the evaluationDate

Didrik Pinte-5
On Thu, Sep 15, 2011 at 9:18 PM, Didrik Pinte <[hidden email]> wrote:
> Could it be related to the boost version ? Does anyone have an idea on
> the cause of the issue ? I have looked at the compilation flags using
> for the SWIG wrapper and we're using the same. Reading the cpp code
> generated by Cython does not give information. I have added a listener
> (using registerWith) within the code and it shows the date is changed
> properly (or at least that the event happens). On a FixedRateBond, if
> I set the evaluation_date to 15 days ago, I get a settlementDate three
> days after today.

The problem seem to be close to this one :
http://old.nabble.com/Problem-setting-the-evaluation-date-on-AIX-for-64-bit-application-tt30740503.html

-- Didrik

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: issue with the evaluationDate

Bojan Nikolic
In reply to this post by Didrik Pinte-5

Hi Didrik,

A possibility which I've seen before:

I would suggest checking the linking stage to make sure that symbols
defined (through template instantiation) in multiple compilation units
correctly get amalgamated into one. The reason is that the
evaluationdate mechanism depends on a singleton pattern which is
implemented in a template (and therefore in a header file, see
ql/patterns/singleton.hpp).

Best,
Bojan


--
Bojan Nikolic          ||          http://www.bnikolic.co.uk

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: issue with the evaluationDate

Didrik Pinte-5
On Thu, Sep 15, 2011 at 10:03 PM, Bojan Nikolic <[hidden email]> wrote:

>
> Hi Didrik,
>
> A possibility which I've seen before:
>
> I would suggest checking the linking stage to make sure that symbols
> defined (through template instantiation) in multiple compilation units
> correctly get amalgamated into one. The reason is that the
> evaluationdate mechanism depends on a singleton pattern which is
> implemented in a template (and therefore in a header file, see
> ql/patterns/singleton.hpp).

Ok, I found the issue but not the real cause ;-)

Upgrading the Ubuntu's to boost 1.46 makes all the test passing smoothly.

-- Didrik

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev