Re: QL latests with OpenMP 2.0 and MSVS 2012 (and CMake)

Posted by Matt on
URL: http://quantlib.414.s1.nabble.com/QL-latests-with-OpenMP-2-0-and-MSVS-2012-and-CMake-tp15025p15031.html

On 2/26/2014 16:56, Luigi Ballabio wrote:
> I see. There should be no problem in patching the code to turn those
> into ints, except that I'm all set to release 1.4 tomorrow, I have a
> few busy weeks ahead and I'd rather be done with the release and not
> go through all the checks again after patching. So I'd release with
> the Size indices and leave it to you to patch it untli a bug-fix
> release sometime in the near future. Would that be a problem?

Hi!

As someone who has faced this issue before, perhaps I can add a quick
comment. This is a limitation of the current level of OpenMP support in
Visual Studio. The latest supported version is OpenMP 2.0, see:
https://msdn.microsoft.com/en-us/library/fw509c3b.aspx

This limitation has been relaxed in OpenMP 3.0 (not supported by MSVC);
see Appendix F, "Changes from Version 2.5 to Version 3.0":
"Random access iterators, and variables of unsigned integer type, may
now be used as loop iterators in loops associated with a loop construct
(see Section 2.5.1 on page 38)."
// Source: http://www.openmp.org/mp-documents/spec30.pdf

As of today there has been no updates on the OpenMP 3.0 support:
https://connect.microsoft.com/VisualStudio/feedback/details/545147/openmp-3-0-support

I would NOT recommend using `int` to address this issue -- this may
bring a whole new set of bugs (e.g., loss of data, possible regression
in performance due to size-conversions).

Consider using either `std::ptrdiff_t` or Boost's
`make_signed<std::size_t>::type`:
- http://en.cppreference.com/w/cpp/types/ptrdiff_t
-
http://www.boost.org/doc/libs/release/libs/type_traits/doc/html/boost_typetraits/reference/make_signed.html

If potential performance regression is not an issue and the goal is to
avoid data loss at all costs, then even `boost::intmax_t` may be worth
considering: http://www.boost.org/libs/integer

Best,

Matt



------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users