[Llvm-bgq-discuss] Node implementation of std::chrono::system_clock?

Antonin Portelli antonin.portelli at ed.ac.uk
Wed May 18 10:54:07 CDT 2016


Dear bgclang maintainers,

First let me thank you for making clang so easily available for BG/Q. I am struggling to run a code doing some timings using the C++11 function std::chrono::system_clock::now(). If I run the code on a BG/Q node it throws a std::system_error exception with an empty message. I just wanted to if by any chance you were aware of this issue?

I wrote the following minimal example to isolate the problem:

#include <chrono>
#include <iostream>
#include <numeric>
#include <vector>

using namespace std;

int main(void)
{
    auto start = chrono::system_clock::now();
    std::vector<int> v(100000, 42);
    auto sink = std::accumulate(v.begin(), v.end(), 0u);
    auto end = chrono::system_clock::now();
    std::chrono::duration<double> diff = end-start;
    cout << diff.count() << endl;
    
    return 0;
}

It runs well when compiled for the frontend but crashes throwing std::system_error when compiled & run on a node, the backtrace is the following:

0 :Node (25)
1 :    <traceback not fetched> (1)
1 :    0000000000000000 (24)
2 :        .__libc_start_main (24)
3 :            .generic_start_main (24)
4 :                .main (24)
5 :                    .std::__1::chrono::system_clock::now() (24)
6 :                        .std::__1::__throw_system_error(int, char const*) (24)
7 :                            .__cxa_throw (24)
8 :                                .std::terminate() (24)
9 :                                    .__cxxabiv1::__terminate(void (*)()) (24)
10:                                        .__gnu_cxx::__verbose_terminate_handler() (24)
11:                                            .abort (24)

Best regards,

Antonin Portelli
-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the llvm-bgq-discuss mailing list