_SECURE_SCL=0 on Windows

loopless
2010-08-11
2013-04-25
  • loopless
    loopless
    2010-08-11

    Performance of the native STL on VS 2008 can be greatly improved by setting -D_SECURE_SCL=0 - is this something that affects stlxx  performance. Obviously I would need to build boost with -D_SECURE_SCL=0

     
  • I have added that to the documentation.
    In general, we appreciate suggestions particularly concerning the build process on Windows.  So feel free to post further suggestions or even patches, also on the respective documentation.

    Johannes

     
  • loopless
    loopless
    2010-08-12

    One suggestion on Windows  would be for the build process to generate multiple variations of stlxxlib for debug/release, 32/64 and to use either dynamic or static Boost libraries with ,say, a Boost like naming convention for each variation of the library.
    FYI, I am looking at stlxx to help with working with large finite element datasets. My complication is that I need to perform dense matrix*vector operations 

     
  • Well, do you have a concrete idea on how the build system would have to be changed to achieve this?  Could you maybe demonstrate this for one of the alternatives?

    Since more and more people ask for matrix operations, we plan to add support for those.  However, this may take some time.  If you step forward to implement something in this direction, we would be willing to include it into STXXL.

    Johannes

     
  • We don't have to be x-platform so we simply use multiple configurations in  Visual Studio , and do a build all. However, it seems CMake is a popular tool for x-platform build systems. Or perhaps bjam like Boost.  I however, have absolutely no experience  in CMake or bjam except as a user.
    On the matrix operations side we have a"in-memory"C++  dense vector/matrix package that has a nice design. The matrix and its data are separate objects, so one matrix or vector may be referencing/a view of  the same (reference counted) "data" object. The data object is ultimately contains an allocated  array of float or double. It would actually be trivial to replace this, by , say, a stlxx::vector. Unfortunately this naive approach would fall down as many of the core matrix operations call BLAS/LAPACK which require a raw pointer to the "data" as float * or double *. It would require changing these core operations to be 'block' operations rather than operating on all the data at once.

    It would actually be trivial to make this

     
  • It would actually be trivial to make this

    Well, then I await your final code by tomorrow ;-)

    Could you point me to some download for this package?

    Johannes

     
  • i am used cmake, for stxxl CMakeLists.txt looks:

    PROJECT (stxxl)
    ADD_LIBRARY(stxxl STATIC
    algo/async_schedule.cpp
    common/debug.cpp common/rand.cpp common/version.cpp common/seed.cpp common/exithandler.cpp common/verbose.cpp common/log.cpp
    io/ufs_file_base.cpp io/syscall_file.cpp io/wincall_file.cpp io/wfs_file_base.cpp io/iostats.cpp io/mmap_file.cpp io/simdisk_file.cpp io/boostfd_file.cpp io/mem_file.cpp io/fileperblock_file.cpp io/request.cpp io/request_waiters_impl_basic.cpp io/request_state_impl_basic.cpp io/request_impl_basic.cpp io/disk_queued_file.cpp io/request_queue_impl_qwqr.cpp io/request_queue_impl_1q.cpp io/request_queue_impl_worker.cpp io/wbtl_file.cpp
    mng/mng.cpp
    )
    ADD_DEFINITIONS(-DSTXXL_BOOST_CONFIG -DSTXXL_BOOST_THREADS -DSTXXL_BOOST_TIMESTAMP -DSTXXL_BOOST_FILESYSTEM -DSTXXL_BOOST_RANDOM -DBOOST_ALL_DYN_LINK)
    INCLUDE_DIRECTORIES(../ include)

    MACRO (MTEST prj file)
    PROJECT(stxxl_${prj})
    ADD_EXECUTABLE(stxxl_${prj} ${file})
    TARGET_LINK_LIBRARIES(stxxl_${prj} stxxl)
    IF(NOT WIN32)
    TARGET_LINK_LIBRARIES(stxxl_${prj} ${BOOST_THREAD} ${BOOST_FILESYSTEM} ${BOOST_IOSTREAMS})
    ENDIF(NOT WIN32)
    ENDMACRO (MTEST)

    #MTEST(gen_file algo/gen_file.cpp)
    #MTEST(sort_file algo/sort_file.cpp)
    #MTEST(test_map containers/test_map.cpp)
    #MTEST(test_vector containers/test_vector.cpp)

     
  • Note that in MSVC10 the situation has changed.

    Instead of _HAS_ITERATOR_DEBUGGING and _SECURE_SCL you can now use _ITERATOR_DEBUG_LEVEL.

    The defaults have also changed; see below.

    Source:
    http://permalink.gmane.org/gmane.comp.lib.boost.devel/210366

    The abbreviations used below have the following (hopefully obvious) meaning:
    HID = _HAS_ITERATOR_DEBUGGING
    SCL = _SECURE_SCL
    IDL = _ITERATOR_DEBUG_LEVEL

    "
    Release SCL=0 (now IDL=0, default in VC10)
    Release SCL=1 (now IDL=1, default in VC8/9)

    Debug HID=0 SCL=0 (now IDL=0)
    Debug HID=0 SCL=1 (now IDL=1)
    Debug HID=1 SCL=1 (now IDL=2, default in VC8/9/10)

    (The HID and SCL macros are still supported for backwards compatibility, but they are immediately mapped
    to IDL, which is what the rest of our headers now refer to.)
    "

     
  • Thanks for bringing this to our attention.  We will soon have an installation of MSVC10 ready for testing.

    Johannes

     
  • Hi,

    I'm currently digging into the STXXL library source to understand the project dependencies.
    I will try to investigate, how the block buffering scheme is applicable for non POD datatypes and for our application.
    So far I've reorganized the STXXL project for my needs -:) dividing library code from test-implementations.
    As a byproduct I've created MPC files (cross-platform project generator), which generates various types
    of target files for my compiler-suites (vc9, vc10):
    static 
    dynamic
    executable
    Other project types (make, eclipse cdt5, eclipse cdt6, vc6,…) are supported as well,
    but not tested for STXXL usage (I'm sure they will need some minor adaptations for the gnu toolchain).
    I'm willing to make them public as a contribution to the STXXL community.
    The original MPC source/documentation and supported project types can be found at http://downloads.ociweb.com/MPC.
    I've used the version from the ACE/TAO (Corba) project at http://www.cs.wustl.edu/~schmidt/ACE.html
    since the ACE-MPC source seems to be updated more frequently than their original counterpart
    (oci provides commercial support for ACE/TAO (Corba)).

    Regards.