Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
TACC: Starting up job 2877659
TACC: Setting up parallel environment for MVAPICH2+mpispawn.
TACC: Starting parallel tasks...
/agas{locality#0/total}/count/decrement_credit,1,8.145300,[s],17
/agas{locality#1/total}/count/decrement_credit,1,8.009955,[s],5
/agas{locality#2/total}/count/decrement_credit,1,8.008736,[s],5
/agas{locality#3/total}/count/decrement_credit,1,7.989132,[s],7
/agas{locality#4/total}/count/decrement_credit,1,8.008141,[s],5
/agas{locality#5/total}/count/decrement_credit,1,8.000879,[s],7
/agas{locality#6/total}/count/decrement_credit,1,8.005112,[s],5
double run_parallel_algorithm(std::size_t n)
{
std::vector<double> d = make_vector(n);
hpx::util::high_resolution_timer t;
std::size_t cores = hpx::get_os_thread_count();
std::size_t chunk_size = (d.size() + cores - 1) / cores;
std::size_t count = n + chunk_size - 1;
std::vector<hpx::future<void>> chunks;
#include <iostream>
#include <boost/proto/proto.hpp>
#include <boost/fusion/include/pair.hpp>
#include <boost/fusion/include/as_map.hpp>
#include <boost/fusion/include/as_vector.hpp>
#include <boost/fusion/include/push_back.hpp>
using namespace std;
using namespace boost::proto;
@sithhell
sithhell / 99bob.cpp
Created August 22, 2011 19:22 — forked from randomphrase/99bob.cpp
99 Bottles Of Beer, using Boost MPL
#include <boost/mpl/assert.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/back_inserter.hpp>
#include <boost/mpl/copy.hpp>
#include <boost/mpl/divides.hpp>
#include <boost/mpl/empty_sequence.hpp>
#include <boost/mpl/equal.hpp>
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/fold.hpp>
#include <boost/mpl/for_each.hpp>
@sithhell
sithhell / fusion_avoid_full_specialization.patch
Created September 12, 2011 13:30
A patch to show the impact of full template specialisations of boost.fusion (patch is against rev. 74355)
Index: boost/fusion/container/vector/detail/equal_to_impl.hpp
===================================================================
--- boost/fusion/container/vector/detail/equal_to_impl.hpp (revision 74355)
+++ boost/fusion/container/vector/detail/equal_to_impl.hpp (working copy)
@@ -17,11 +17,8 @@
namespace extension
{
- template <typename Tag>
- struct equal_to_impl;
@sithhell
sithhell / phoenix_lambda.cpp
Created March 28, 2012 09:01
Suggested phoenix solution -- getting rid of binding functions alltogether
#include <boost/assign/std/vector.hpp>
#include <boost/phoenix.hpp>
#include <iostream>
#include <vector>
#include <algorithm>
template <typename F>
void g(F const & f)
@sithhell
sithhell / bind_protect_demo.cpp
Created March 28, 2012 08:59
Complete Bind solution with protect
#include <boost/assign/std/vector.hpp>
#include <boost/bind.hpp>
#include <boost/bind/protect.hpp>
#include <boost/function.hpp>
#include <iostream>
#include <vector>
#include <algorithm>
void g(boost::function<void(int)> const &f, int i) {
@sithhell
sithhell / bind_protect_demo_functor.cpp
Created March 28, 2012 09:00
Complete Bind solution with protect and a functor
#include <boost/assign/std/vector.hpp>
#include <boost/bind.hpp>
#include <boost/bind/protect.hpp>
#include <boost/function.hpp>
#include <iostream>
#include <vector>
#include <algorithm>
template <typename F>
@sithhell
sithhell / gist:2627795
Created May 7, 2012 13:34
minimal Fusion splat implementation
#include <boost/fusion/include/size.hpp>
#include <boost/fusion/include/at_c.hpp>
#include <boost/move/move.hpp>
namespace tmp
{
template <typename Seq, int Size = boost::fusion::result_of::size<Seq>::value>
struct make_splat_impl;
@sithhell
sithhell / gist:3757779
Created September 20, 2012 19:16
Stacktrace for failed assertion regarding HPX issue https://github.com/STEllAR-GROUP/hpx/issues/539
[stack-trace]: 21 frames:
0x7fd3a43eda76 : boost::backtrace::backtrace(unsigned long) + 0x80 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7fd3a43edbda : boost::trace() + 0x1e in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7fd3a43e98ff : hpx::detail::backtrace() + 0x18 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7fd3a43ee213 : boost::exception_ptr hpx::detail::get_exception<hpx::exception>(hpx::exception const&, std::string const&, std::string const&, long) + 0x46 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7fd3a43ee703 : void hpx::detail::throw_exception<hpx::exception>(hpx::exception const&, std::string const&, std::string const&, long) + 0x38 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7fd3a43e9b74 : hpx::detail::assertion_failed_msg(char const*, char const*, char const*, char const*, long) + 0x238 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7fd3a43e993c : hpx::detail::assertion_failed_msg(char const*, char const*, char