API Reference
moderngpu includes functions that operate on iterators and functions that operate on user-provided lambdas. Often these are just two sides of the same coin--you can adapt an iterator to a lambda-accepting function by dereferencing the iterator, and you can adapt a lambda to an iterator-accepting function by using the library's make_load_iterator
and make_store_iterator
functions to wrap the lambda.
Many of the lambda-accepting functions are called transforms. They vary in sophistication, but each of them is useful in solving real-world problems. The transforms are very expressive, and several of moderngpu's library routines are just calls to one or more transforms specialized over simple lambdas. With this set of tools it's possible to build an entire GPU-accelerated application without writing any of your own kernels.
Low-level transforms
transform
transform.hxx
template<
size_t nt = 128, // num threads per CTA. blockDim.x.
typename func_t // implements void operator()(int index).
>
void transform(func_t f, size_t count, context_t& context);
transform
simply wraps the CUDA launch chevrons <<< >>>
and calls a function on each of the count
threads, to which it passes the global index of the thread, threadIdx.x + blockIdx.x * blockDim.x
.
cta_launch
transform.hxx
template<
typename launch_box, // structure providing nt.
typename func_t // implements void operator()(int tid, int cta).
>
void cta_launch(func_t f, int num_ctas, context_t& context);
// Specialize over nt directly.
template<int nt, typename func_t>
void cta_launch(func_t f, int num_ctas, context_t& context);
// Dynamically loop over the number of CTAs in num_ctas.
template<typename launch_box, typename func_t>
void cta_launch(func_t f, const int* num_ctas, context_t& context);s
cta_launch
is the next level of transform. Rather than launching individual threads, it creates cooperative thread arrays (CTAs, also known, less descriptively, as thread blocks). This transformer takes as a template argument the size of the CTA in threads. This compile-time constant nt
can be used for sizing shared memory and defining structural aspects in the code, such as the number of iterations in an unrolled loop. The caller specifies the number of CTAs to launch, and the provided lambda is invoked on each thread in each of those CTAs.
cta_transform
transform.hxx
template<
typename launch_box, // structure providing (nt, vt).
typename func_t // implements void operator()(int tid, int cta).
>
void cta_transform(func_t f, int count, context_t& context);
template<int nt, int vt = 1, typename func_t>
void cta_transform(func_t f, int count, context_t& context);
cta_transform
is the workhorse transformer of moderngpu 2.0. It's used internally to implement most of the library's high-level transforms. The caller specifies a count
of work-items and the transformer creates enough CTAs to cover them. Each CTA processes nt * vt
work-items. nt
is the number of threads per CTA. vt
is the grain size of the kernel, or the number of work-items processed per thread. These constants are typically loaded from a launch box which specifies launch parameters on a per-architecture basis.
The provided kernel function f
is called once per thread in each of the launched CTAs. Handling fractional tiles is the user's responsibility.
High-level transforms
transform_reduce
kernel_reduce.hxx
template<
typename launch_arg_t = empty_t, // optional launch_box overrides default.
typename func_t, // implements type_t operator()(int index).
typename output_it, // iterator to output. one output element.
typename op_t // reduction operator implements
// type_t operator()(type_t left, type_t right).
>
void transform_reduce(func_t f, int count, output_it reduction, op_t op,
context_t& context);
transform_reduce
invokes the caller-supplied lambda and adds together all the results. This is the same parallel reduction algorithm included in every CUDA computing library, but is presented here with more convenient lambda-centric packaging.
transform_scan
kernel_scan.hxx
template<
scan_type_t scan_type = scan_type_exc, // inclusive or exclusive scan.
typename launch_arg_t = empty_t,
typename func_t, // implements type_t operator()(int index).
typename op_t, // reduction operator implements
// type_t operator()(type_t a, type_t b).
void transform_scan(func_t f, int count, output_it output, op_t op,
reduction_it reduction, context_t& context);
transform_scan
invokes the provided lambda and computes a prefix sum over all elements. The reduction is also returned. In fact, by utilizing the lambda iterator feature in moderngpu 2.0, you can get the reduction or even the output of the scan itself passed to additional __device__
-tagged lambdas that you provide. The distinction between iterators (a generalization of pointers) and functions is mostly about syntax rather than functionality.
transform_segreduce
kernel_segreduce.hxx
template<
typename launch_arg_t = empty_t, // provides constants (nt, vt, vt0).
typename func_t, // implements type_t operator()(int index).
typename segments_it, // segments-descriptor array.
// specificies starting offset of each segment.
typename output_it, // output iterator. one output per segment.
typename op_t, // reduction operator implements
// type_t operator()(type_t a, type_t b)
typename type_t
>
void transform_segreduce(func_t f, int count, segments_it segments,
int num_segments, output_it output, op_t op, type_t init,
context_t& context);
transform_segreduce
reduces irregularly-sized sequences of values, called segments, using a reduction operator (such as mgpu::plus_t<>
). An initialization value is provided for the reduction of empty segments. Segments are described by an integer array where each element indicates the beginning of that segment within a single flattened view of the operation. The first segment starts at 0 (so segments[0] = 0), and each subsequent segments-descriptor element is advanced by the size of the previous segment. That is, the segments descriptor is the exclusive prefix sum of the segment sizes. This is a common convention, and is known in graph and sparse matrix literature as the compressed sparse row format.
Functions that use load-balancing search internally, such as transform_segreduce
, specialize over a vt0
parameter in the launch parameters. If not specified, the launch box mechanism defaults vt0
to vt
. vt0
is a caching term which specifies the number of unconditional loads to execute per thread. Segment geometries with more values per segment will benefit from increasing vt0
, while geometries with smaller segments may benefit from decreasing vt0
. A rule of thumb is to set vt0 to
vt0 = floor(vt * count / (count + num_segments))
if this ratio can be reasonably estimated in advance.
transform_lbs
kernel_load_balance.hxx
template<
typename launch_arg_t = empty_t, // provides (nt, vt, vt0)
typename func_t, // load-balancing search callback implements
// void operator()(int index, // work-item
// int seg, // segment ID
// int rank, // rank within seg
// tuple<...> cached_values).
typename segments_it, // segments-descriptor array.
typename tpl_t // tuple<> of iterators for caching loads.
>
void transform_lbs(func_t f, int count, segments_it segments,
int num_segments, tpl_t caching_iterators, context_t& context);
// version of transform_lbs without caching iterators
template<
typename launch_arg_t = empty_t,
typename func_t, // load-balancing search callback implements
// void operator()(int index, int seg, int rank).
typename segments_it
>
void transform_lbs(func_t f, int count, segments_it segments,
int num_segments, context_t& context);
transform_lbs
is the new front-end to the load-balancing search pattern introduced in moderngpu 1.0. The caller describes a collection of irregularly-sized segments with an array that indexes into the start of each segment. (This is identical to the prefix sum of the segment sizes.) Load-balancing search restores shape to this flattened array by calling your lambda once for each element in each segment and passing the segment identifier and the rank of the element within that segment. Unlike ad hoc scheduling methods which assign a thread, or a warp, or a thread-block to a segment, load-balancing search is robust with respect to the shape of the problem; you can bet on consistently good performance for all conditions. This is a truly powerful mechanism and a surprising number of useful functions can be defined with one-line lambdas using transform_lbs
. Consider it the data science mapper of CUDA programs.
lbs_segreduce
kernel_segreduce.hxx
template<
typename launch_arg_t = empty_t, // provides (nt, vt, vt0)
typename func_t, // load-balancing search callback implements
// type_t operator()(int index, // work-item
// int seg, // segment ID
// int rank, // rank within seg
// tuple<...> cached_values).
typename segments_it, // segments-descriptor array.
typename tpl_t, // tuple<> of iterators for caching loads.
typename output_it, // output iterator. one output per segment.
typename op_t, // reduction operator implements
// type_t operator()(type_t a, type_t b).
typename type_t
>
void lbs_segreduce(func_t f, int count, segments_it segments,
int num_segments, tpl_t caching_iterators, output_it output, op_t op,
type_t init, context_t& context);
// version of lbs_segreduce without caching iterators.
template<
typename launch_arg_t = empty_t,
typename func_t, // load-balancing search callback implements
// type_t operator()(int index, int seg, int rank).
typename segments_it,
typename output_it,
typename op_t,
typename type_t
>
void lbs_segreduce(func_t f, int count, segments_it segments,
int num_segments, output_it output, op_t op, type_t init,
context_t& context);
lbs_segreduce
combines transform_lbs
with segmented reduction. The caller's lambda is invoked with the segment ID and rank for each element, but the return values are folded into a single element per segment. lbs_segreduce
is like a simultaneous mapper and reducer: each segment is expanded into an irregular number of work-items; a user-provided function is called on each work-item; then the results are reduced according to the segment geometry. This is the most sophisticated mechanism in moderngpu 2.0, and makes data science operations very easy to program.
transform_compact
kernel_compact.hxx
template<typename launch_arg_t = empty_t>
stream_compact_t<launch_arg_t>
transform_compact(int count, context_t& context);
template<typename launch_arg_t>
struct stream_compact_t {
...
public:
// upsweep of stream compaction.
// func_t implements bool operator(int index);
// The return value is flag for indicating that we want to *keep* the data
// in the compacted stream.
template<typename func_t>
int upsweep(func_t f);
// downsweep of stream compaction.
// func_t implements void operator(int dest_index, int source_index).
// The user can stream from data[source_index] to compacted[dest_index].
template<typename func_t>
void downsweep(func_t f);
};
transform_compact
is a two-pass pattern for space-efficient stream compaction. The user constructs a stream_compact_t
object by calling transform_compact
. On the upsweep, the user provides a lambda function which returns true
to retain the specified index
in the streamed output. On the downsweep, the user implements a void
-returning lambda which takes the index to stream to and the index to stream from. The user may implement any element-wise copy or transformation in the body of this lambda.
test_compact.cu
// Construct the compaction state with transform_compact.
auto compact = transform_compact(count, context);
// The upsweep determines which items to compact.
int stream_count = compact.upsweep([]MGPU_DEVICE(int index) {
// Return true if we want to keep this element.
// Only stream if the number of bits in index is a multiple of 5.
bool keep = 0 == (popc(index) % 5);
return keep;
});
// Compact the results into this buffer.
mem_t<int> special_numbers(stream_count, context);
int* special_numbers_data = special_numbers.data();
compact.downsweep([=]MGPU_DEVICE(int dest_index, int source_index) {
special_numbers_data[dest_index] = source_index;
});
test_compact.cu
demonstrates a simple usage of moderngpu's stream compaction. In this sample, all indices with a multiple of 5 bits set in the index's binary representation are compacted. The first statement uses transform_compact
to construct a stream_compact_t
object; this contains temporary state to communicate compaction information between CTAs.
The upsweep
call is a lambda that returns true
to keep the index and false
to discard it. In this example, the lambda does not capture any variables from the enclosing scope, but it may. The return value is the total number of values to compact. The client uses this to allocate exactly enough memory to hold the streamed outputs.
In the downsweep
call the lambda is provided both the index to stream to and the index to stream from. In this example, the lambda simply stores the source index into the compacted array, but any operation is admitted.
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename Predicate >
OutputIterator thrust::copy_if (InputIterator1 first, InputIterator1 last, InputIterator2 stencil, OutputIterator result, Predicate pred);
template<typename InputIterator , typename OutputIterator , typename T >
OutputIterator thrust::remove_copy (InputIterator first, InputIterator last, OutputIterator result, const T &value)
template<typename InputIterator , typename OutputIterator , typename Predicate >
OutputIterator thrust::remove_copy_if (InputIterator first, InputIterator last, OutputIterator result, Predicate pred);
template<typename InputIterator , typename OutputIterator >
OutputIterator thrust::unique_copy (InputIterator first, InputIterator last, OutputIterator result);
...
This explicit two-pass process is better than the stream compaction functionality available in thrust. In those functions the size of the compacted output is returned to the caller only after the stream compaction has completed. (It is implied by the position of the return iterator minus result
). The user may need to over-allocate storage for the results, conservatively allocating enough space to copy the entire input array into the output.
thrust also defines dozens of related stream compactions such as copy_if
, remove_copy_if
, unique_copy
, unique_by_key_copy
, etc. These cases are all handled by transform_compact
's upsweep
lambda. copy_if
has behavior like our test case, testing a single value and returning true
to keep it.
unique_copy
keeps only the first element in a group of duplicate elements. A lambda can implement this behavior by simply returning !index || data[index] != data[index - 1]
. That is, an element is streamed if and only if it has a different value from the preceding element.
moderngpu provides more coverage of functionality with many fewer functions than other libraries by recognizing different categories of operations and allowing the user to specialize behavior.
lbs_workcreate
kernel_workcreate.hxx
namespace expt {
// Use lbs_workcreate to construct an expt::workcreate_t instance. Then call
// upsweep and downsweep, providing an appropriate lambda function.
template<typename launch_arg_t = empty_t, typename segments_it>
workcreate_t<launch_arg_t, segments_it>
lbs_workcreate(int count, segments_it segments, int num_segments,
context_t& context) {
return workcreate_t<launch_arg_t, segments_it> {
count, segments, num_segments, context
};
}
template<typename launch_arg_t, typename segments_it>
struct workcreate_t {
...
public:
struct count_t {
int count;
int num_segments;
};
// f(int index, int seg, int rank, tuple<...> desc) returns the number
// of work-items to create.
template<typename func_t, typename tpl_t>
count_t upsweep(func_t f, tpl_t caching_iterators);
// upsweep without caching iterators.
template<typename func_t>
count_t upsweep(func_t f);
// f(int dest_seg, int index, int source_seg, int rank, tuple<...> desc)
// returns the number of work-items to create.
template<typename func_t, typename tpl_t>
mem_t<int> downsweep(func_t f, tpl_t caching_iterators);
template<typename func_t>
mem_t<int> downsweep(func_t f);
};
} // namespace expt
lbs_workcreate
returns the state for a two-pass load-balancing search work-creation process. This function is included in the mgpu::expt
namespace to reflect its experimental status.
lbs_workcreate
is called similarly to transform_lbs
. The work-item count and segments-descriptor array are passed as arguments, and have the same meaning as in transform_lbs
. However these individual work-items now have the capability of dynamic work creation. This function returns a workcreate_t
object, on which upstream
and downstream
calls are made by the client. upsweep
returns a count_t
structure with the number of total work-items and segments generated.
upsweep
is called for every work-item in the work load and returns the number of work-items to create. If the return count is greater than 0, one new segment of work will is emitted. That segment will have count number of ranks associated with it. This call can be non-deterministic. The improved breadth-first search demo uses the CUDA intrinsicatomicCAS
to non-deterministically generate work for newly-visited vertices.downsweep
once again returns the number of work-items to create (it must match what it returned inupsweep
), howeverdownsweep
is only invoked on work-items that attempted to generate new work inupstream
. During this second pass the callback lambdaf
is also provided with the index of the newly-created segment of work. The caller should stream to this index information for processing the work in this segment. The function returns the segments-descriptor array of the dynamically-created work.
Because the implementation has no knowledge of the number of work-items opting for dynamic work creation it cannot size the segments-descriptor array; nor does it choose to store the work-creation requests for each work-item. It therefore makes two passes. The first pass requests the number of work-items created. This is scanned on a per-CTA basis, and passed to the second pass, which again requests the number of work-items created, adds that to the running total of work-items, and stores to the new segments-descriptor array.
This pattern is constructed by fusing together the operations of load-balancing search, stream compaction, and scan to enable the user to dispatch work-items and dynamically create new ones.
Array functions
reduce
kernel_reduce.hxx
template<typename launch_arg_t = empty_t, typename input_it,
typename output_it, typename op_t>
void reduce(input_it input, int count, output_it reduction, op_t op,
context_t& context);
scan
kernel_scan.hxx
template<scan_type_t scan_type = scan_type_exc,
typename launch_arg_t = empty_t, typename input_it,
typename output_it, typename op_t, typename reduction_it>
void scan_event(input_it input, int count, output_it output, op_t op,
reduction_it reduction, context_t& context, cudaEvent_t event);
template<scan_type_t scan_type = scan_type_exc,
typename launch_arg_t = empty_t, typename input_it,
typename output_it, typename op_t, typename reduction_it>
void scan(input_it input, int count, output_it output, op_t op,
reduction_it reduction, context_t& context);
template<scan_type_t scan_type = scan_type_exc,
typename launch_arg_t = empty_t,
typename input_it, typename output_it>
void scan(input_it input, int count, output_it output, context_t& context);
template<scan_type_t scan_type = scan_type_exc,
typename launch_arg_t = empty_t, typename func_t, typename output_it,
typename op_t, typename reduction_it>
void transform_scan_event(func_t f, int count, output_it output, op_t op,
reduction_it reduction, context_t& context, cudaEvent_t event);
template<
scan_type_t scan_type = scan_type_exc, // scan_type_exc or scan_type_inc.
typename launch_arg_t = empty_t,
typename func_t, // implements type_t operator()(int index).
typename output_it,
typename op_t, // implements type_t operator()(type_t a, type_t b).
typename reduction_it // iterator for storing the scalar reduction
// pass discard_iterator_t<type_t>() to ignore
// the reduction.
>
void transform_scan(func_t f, int count, output_it output, op_t op,
reduction_it reduction, context_t& context);
The prefix sum implementation scan
has several overloads for convenience. The scan is implemented as three kernels: an upsweep that reduces values mapped into tiles; a spine which scans the partial reductions and stores the total reduction of the array; and a downsweep which distributes the scanned partials and completes the scan.
Because of this structure, the reduction is computed about a third of the way through the reduction. (One load for the upsweep; one load and one store for the downsweep.) The caller may need the reduction as soon as possible to allocate memory and schedule more work. Rather than suffer the latency of waiting for scan
to return and copying the reduction from device to host memory, the user can allocate space in page-locked host memory and call scan_event
or transform_scan_event
to store the reduction directly into this host memory. The caller provides an event which is recorded when the reduction is computed. When scan_event
returns the caller can synchronize on the event and read the reduction directly out of page-locked memory. This relieves the code from waiting for the downsweep kernel to complete before getting the reduction.
merge
kernel_merge.hxx
// Key-value merge.
template<
typename launch_arg_t = empty_t,
typename a_keys_it, typename a_vals_it, // A source keys and values
typename b_keys_it, typename b_vals_it, // B source keys and values
typename c_keys_it, typename c_vals_it, // C dest keys and values
typename comp_t // implements bool operator()(type_t a, type_t b)
// computes a < b.
>
void merge(a_keys_it a_keys, a_vals_it a_vals, int a_count,
b_keys_it b_keys, b_vals_it b_vals, int b_count,
c_keys_it c_keys, c_vals_it c_vals, comp_t comp, context_t& context);
// Key-only merge.
template<typename launch_t = empty_t,
typename a_keys_it, typename b_keys_it, typename c_keys_it,
typename comp_t>
void merge(a_keys_it a_keys, int a_count, b_keys_it b_keys, int b_count,
c_keys_it c_keys, comp_t comp, context_t& context);
sorted_search
kernel_sortedsearch.hxx
template<
bounds_t bounds, // bounds_lower or bounds_upper
typename launch_arg_t = empty_t,
typename needles_it, // search to find the insertion index of each
typename haystack_it, // sorted needle into the sorted haystack.
typename indices_it, // output integer indices.
// sized to the number of needles.
typename comp_it // implements bool operator()(type_t a, type_t b)
// computes a < b.
>
void sorted_search(needles_it needles, int num_needles, haystack_it haystack,
int num_haystack, indices_it indices, comp_it comp, context_t& context);
sorted_search
is a vectorized searching algorithm. It's equivalent to calling std::lower_bound
or std::upper_bound
into the haystack array for each key in the needles array. We could easily implement a parallel binary search on the GPU, and it would have cost O(A log B).
But we can do better if the keys in the needles array are themselves sorted. Rather than process each needle individually using a binary search, the threads cooperatively compute the entire output array indices
as a single merge-like operation.  If *haystack < *needles
, we advance the haystack
pointer. Otherwise we store the index of haystack
to the indices
results array at the needles
index and advance the needles
index.
The cost of sorted_search
is O(A + B) and the routine is easily load-balanced over all available processing units. This function is helpful when implementing key-matching operations like relational join.
bulk_insert
kernel_bulkinsert.hxx
// Insert the values at a_keys before the values at b_keys identified by
// insert.
template<typename launch_t = empty_t, typename a_it, typename insert_it,
typename b_it, typename c_it>
void bulk_insert(a_it a, insert_it a_insert, int insert_size, b_it b,
int source_size, c_it c, context_t& context);
bulk_remove
kernel_bulkremove.hxx
template<typename launch_arg_t = empty_t,
typename input_it, typename indices_it, typename output_it>
void bulk_remove(input_it input, int count, indices_it indices,
int num_indices, output_it output, context_t& context);
mergesort
kernel_mergesort.hxx
// Key-value sort.
template<
typename launch_arg_t = empty_t,
typename key_t, // key type.
typename val_t, // value type.
typename comp_t // implements bool operator()(type_t a, type_t b)
// computes a < b.
>
void mergesort(key_t* keys_input, val_t* vals_input, int count,
comp_t comp, context_t& context);
// Key-only sort.
template<typename launch_arg_t = empty_t, typename key_t, typename comp_t>
void mergesort(key_t* keys_input, int count, comp_t comp,
context_t& context);
Sort keys or key-value pairs. Unlike most other functions in moderngpu, this takes no iterators and transforms arrays in place.
segmented_sort
kernel_segsort.hxx
// Key-value segmented sort.
template<typename launch_arg_t = empty_t, typename key_t, typename val_t,
typename seg_it, typename comp_t>
void segmented_sort(key_t* keys_input, val_t* vals_input, int count,
seg_it segments, int num_segments, comp_t comp, context_t& context);
// Key-value segmented sort. Automatically generate indices to sort as values.
template<typename launch_arg_t = empty_t, typename key_t, typename seg_it,
typename comp_t>
void segmented_sort_indices(key_t* keys, int* indices, int count,
seg_it segments, int num_segments, comp_t comp, context_t& context);
// Key-only segmented sort.
template<typename launch_arg_t = empty_t, typename key_t, typename seg_it,
typename comp_t>
void segmented_sort(key_t* keys_input, int count, seg_it segments,
int num_segments, comp_t comp, context_t& context);
Sort keys or key-value pairs in place. This function sorts elements within segments and denoted by the segments-descriptor array. segmented_sort_indices
ignores the initial contents of indices
and on return stores there the gather indices of the keys.
inner_join
kernel_join.hxx
template<typename launch_arg_t = empty_t,
typename a_it, typename b_it, typename comp_t>
mem_t<int2> inner_join(a_it a, int a_count, b_it b, int b_count,
comp_t comp, context_t& context);
load_balance_search
interval_move
kernel_intervalmove.hxx
template<typename launch_arg_t = empty_t, typename input_it,
typename segments_it, typename output_it>
void interval_expand(input_it input, int count, segments_it segments,
int num_segments, output_it output, context_t& context);
template<typename launch_arg_t = empty_t, typename input_it,
typename segments_it, typename gather_it, typename output_it>
void interval_gather(input_it input, int count, segments_it segments,
int num_segments, gather_it gather, output_it output, context_t& context);
template<typename launch_arg_t = empty_t, typename input_it,
typename segments_it, typename scatter_it, typename output_it>
void interval_scatter(input_it input, int count, segments_it segments,
int num_segments, scatter_it scatter, output_it output, context_t& context);
template<typename launch_arg_t = empty_t,
typename input_it, typename segments_it, typename scatter_it,
typename gather_it, typename output_it>
void interval_move(input_it input, int count, segments_it segments,
int num_segments, scatter_it scatter, gather_it gather, output_it output,
context_t& context);
inner_join
kernel_join.hxx
template<typename launch_arg_t = empty_t,
typename a_it, typename b_it, typename comp_t>
mem_t<int2> inner_join(a_it a, int a_count, b_it b, int b_count,
comp_t comp, context_t& context);
segreduce
kernel_segreduce.hxx
template<typename launch_arg_t = empty_t, typename input_it,
typename segments_it, typename output_it, typename op_t, typename type_t>
void segreduce(input_it input, int count, segments_it segments,
int num_segments, output_it output, op_t op, type_t init,
context_t& context);
template<typename launch_arg_t = empty_t, typename matrix_it,
typename columns_it, typename vector_it, typename segments_it,
typename output_it>
void spmv(matrix_it matrix, columns_it columns, vector_it vector,
int count, segments_it segments, int num_segments, output_it output,
context_t& context);


Blake Lively Shares Hilarious Hospital Video From 2017 Following Her ‘The Rhythm Section’ Injury
by Aynslee DarmonThanks to Ryan Reynolds, the aftermath of Blake Lively’s “The Rhythm Section” on-set injury was caught on tape.
The “Gossip Girl” alum shared a hilarious video – taken by her loving husband – from her hospital bed, after hurting her arm on set of the upcoming film.
“Literally four weeks after I said, ‘I’d give my right hand to be in this movie!’ (Good thing no one told me to ‘break a leg’).” she captioned the video. “My husband somehow knew ‘Wild Thing’ would be my version of smelling salts. I’ve never felt so seen. Or high. Also… I have zero recollection of this.”
Lively also credited Reynolds as director and DJ on the short clip.
The upcoming drama will be released in 2020, but the majority of the film, except for the short break while Lively healed, was filmed in 2017.
Lively recently wiped her Instagram clean to get ready to promote “The Rhythm Section”, leaving just a clip of its trailer.
“The Rhythm Section” hits big screens in January.


These are snippets / notes from the book that I made / used to learn the techniques from John Resig and Bear Bibeault's Secrets of the JavaScript Ninja.
For fun and profit. Mainly because I was out of stuff to do...
I have a python script that builds a JSON object which maps those files that exist in the /chapters directory. I then use the jQuery.load()
function to insert into the DOM and run the JS.


{% extends "about/about_base.html" %} {% load markdown_filter %} {% block page_title %}About{% endblock page_title %} {# fmt:off #} {% block page_heading %}
Democracy Club strengthens democracy and civic culture in the UK.
Our vision is of a country with the digital foundations to support everyone's participation in democratic life. Established in 2010 to collect information on the candidates running in that year's general election, Democracy Club was registered as a Community Interest Company in 2015. Since then we have covered every major UK election, and now run the national online polling station finder and candidate database. A data supplier to the [Electoral Commission](https://www.electoralcommission.org.uk/) since 2017, we have also worked with local and national government across all four UK nations. In our short history we have transformed the accessibility of UK elections. We've opened up the online civic space, providing [non-partisan platforms](https://democracyclub.org.uk/blog/2023/02/17/democracy-club-and-political-impartiality/) which enable citizens to scrutinise, evaluate, and engage directly with their politicians and candidates. We've delivered personalised election information to well over ten million people since 2018. In a world which is increasingly concerned about the effect of the internet on democracy, we're using digital and data to inform and empower. [Read our current organisational strategy](https://democracyclub.org.uk/blog/2022/01/05/2022-and-beyond-an-updated-strategy/). Working alongside other organisations is at the core of what we do. Our tools are used widely across UK civil society, from student unions and civic education organisations, through to technology and social and traditional media companies. During 2019 we sent 218m notifications in partnership with Facebook, Instagram, Twitter, and SnapChat to remind people to vote. We've also enabled groups supporting the most marginalised to get their members engaged and voting, such as migrants, Roma and Travellers, and people with learning disabilities and autism. Furthermore, by making data on elections more freely available we've enabled high-quality research and journalism - for example, The Times and the Fawcett Society have recently used our data to shine a light on the 'glacial' progress of gender and age diversity among election candidates. **Democracy Club is widely regarded as a core infrastructure project within the UK democracy sector.** ## How we work Democracy Club consists of a small core team of full-time software developers, data specialists, geospatial engineers and election experts. The team is supported by an online network of hundreds of volunteers who assist with compiling and maintaining our databases. Much of our work focuses on collecting data from the UK's approximately 400 local authorities, either via communicating with them directly or taking information from their websites using our unique infrastructure of web 'scrapers'. Working with our amazing volunteers, we aggregate this data and publish it for use by anyone. We are committed to open data. We believe that making the data that we collect available to everyone is the best way of empowering the most people to vote. We believe that we make our greatest impact when we work in partnership with other organisations. In the past we've collaborated with other civic organisations, charities, and media to reach millions more people with information and research. **[Meet the team](/about/team/)** ## Community and volunteers Democracy Club's election candidate database is compiled and maintained by volunteers. Our volunteers are non-partisan, either interested in democracy, open source technology, or both.  We also host an online community of 1,000 members and a mailing list with tens of thousands of subscribers. The focus of this work occurs every year in March and April, when candidate lists are published for the May local elections. We rely on our volunteers to collect these (mainly PDF) documents and enter the information into our database, with a little help from our automation software. In 2022, which was a relatively quiet election, 1,500 volunteers made 64,000 edits to our database, collecting details on over 21,000 individual candidates. Want to take part? To get involved, [head over to our database](https://candidates.democracyclub.org.uk/volunteer/) to create an account. We also recommend joining our mailing list (see form at footer) to keep updated. ## What people say about us Our data has reached millions of people since 2015. Here's what some of them say: > “Amazing accessible website that encourages people to vote by its sheer simplicity.” > “This was a very quick and precise answer to my question. Well Done!” > “Exactly what I was looking for. I appreciate the work of democracyclub and its supporters in providing this resource.” ## People who work in democracy trust us > “We've been impressed by Democracy Club's attention to detail and ability to make things work. We have complete trust in the data they provide and are highly supportive of their efforts to help voters get more information about elections.” — Stuart Harrison, Senior Communication Officer, The Electoral Commission > “This is great - you offer a fantastic service, it is a real help to us and our electors. We really appreciate it.” — Seth Alker, Head of Electoral Services, London Borough of Croydon > “Democracy Club provide reliable, vital and timely election-related data that is a great boon for democracy in the UK.” — Patrick Dunleavy, Professor of Political Science and Public Policy, London School of Economics > “I was pleased to hear that Democracy Club, working with the Electoral Commission, will be strengthening their work to provide direct polling station and candidate information to the public online, where we know they expect to find it. Over time, I believe that making this information available centrally will become an invaluable service for citizens.” — [Chris Skidmore, The Minister for the Constitution](https://www.gov.uk/government/speeches/skidmore-an-effective-democracy-that-works-for-everyone) > “a heroic crowd-sourcing effort.” — [The Guardian](https://www.theguardian.com/politics/2021/apr/27/independents-day-the-rise-of-hyperlocal-political-parties) > “Nifty.” — [Oadby and Wigston Council](https://twitter.com/Oadby_Wigston/status/1388901733011755025) {% endfilter %} {% endblock main_content %}


Having a flexible work arrangement comes with a world of benefits. In many cases, it means setting your own schedule and hours, and in others, it means getting to do your job from the comfort and convenience of home. FlexJobs recently asked workers why they seek out flexible arrangements, and here are the main reasons they came back with.
1. Work-life balance
It's pretty easy to see why flexible work arrangements lend to a better work-life balance. These days, a large number of employees are teetering on the edge of burnout, and it's largely because they feel chained to their desks with no time left over to tend to their personal obligations or just plain be people. Having a flexible schedule makes it easier to be available for everything from school pickup to home repairs to medical appointments without falling behind on the job. And it also helps workers avoid getting overwhelmed.
2. Family
Flexibility is key when you have a family. A flexible job can help ensure that you're able to be there for your children, support your aging parents, or spend quality time with your partner. And in some cases, it can save you serious money on child care.
3. Time savings
A flexible job can save you time by allowing you to work in a more efficient manner. For example, if you're able to come into the office early on, when it's empty, you'll get a number of hours at your desk without the distractions you'd face otherwise. That, in turn, could help you get your work done faster. Furthermore, if you're able to work from home, you're likely to be more productive. A good 65% of folks who do their jobs from home say that their output has increased under that arrangement.
4. Commuting stress
Many employees loathe commuting, especially when it means rotting away in traffic, dealing with endless public transit delays, or spending hundreds of dollars just to get to work. Flexible arrangements often allow workers to avoid commute-related stress, whether by letting them come in at off-peak times to avoid rush hour, or by letting them do their jobs from home to avoid commuting completely.
You deserve to reap the benefits
Clearly, there are plenty of good reasons to seek out a flexible job, so if your employer refuses to budge on things like scheduling or working from home, it may be time to update your resume and start seeing what's out there. An estimated 44% of workers say a job with flexibility would have a huge improvement on their overall quality of life, while 78% say that a more flexible job would help them lead a healthier lifestyle. And 86% of people think more job-related flexibility would make them less stressed on a whole. All of these are compelling arguments to seek out an arrangement that better suits your lifestyle, so don't settle for a job that's too rigid when there are plenty of companies out there willing to grant employees the leeway they need and deserve.


Andy's Angles: New first-teamers, two good goals, standing firm and plenty of potential - Town's youngsters through in FA Youth Cup
by Andy WarrenIpswich Town beat Exeter City 2-1 to reach the third round of the FA Youth Cup this afternoon. ANDY WARREN gives his observations.
Ipswich Town's Under 18s are safely through to round three of the FA Youth Cup following their 2-1 victory over Exeter City this afternoon.
The hosts were always in control at Portman Road, with Connor O'Reilly and Colin Oppong finding the net in the opening period to put the tie beyond their visitors.
They were given a scare when visiting captain Louis Morison superbly headed home for Exeter, reducing the deficit, but the young Blues were ultimately able to see the job through and secure their place in the third round.
The first goal had seemed to have been coming since kick-off, with the young Blues on the front foot and having the ball in the net early before Zak Brown's effort was ruled out for a foul. But the hosts were ahead after just five minutes.
It came through right-back O'Reilly, who got forward well once again to find the top corner with a good effort.
Ipswich dominated the game from there, stretching the Exeter defence time and again without creating too many clear-cut chances. When one did arrive, forward Tyreece Simpson could only drag shot across goal after controlling the ball well.
Town were having joy down the flanks, with their second goal coming from a good move on the left before Oppong turned and smashed the ball into the back of the net past Jack Arthur in the Exeter goal.
They continued to put together attacking moves before the interval, after which Simpson fired a rocket of a shot which bounced back off the post.
Ipswich were well on top but did have to soak up a little pressure, with goalkeeper Jake Alley spreading himself superbly to keep out Ben Chrisene, before Simpson had another shot saved by Arthur.
Morison's goal was celebrated wildly by the travelling Exeter contingent and Ipswich needed Alley to be alert again to claw substitute Ellis Johnson's effort out with 10 minutes to go.
But Ipswich held firm and were able to secure their place in round three.
The new debutant
Liam Gibbs was given his senior debut on Tuesday evening at Colchester, catapulting the youngster into the top 10 of Ipswich's Town's youngest debutants at just 16 years and 331 days.
He was given a start in the No.10 role in this game, playing behind Oppong and eventually Simpson, where he kept the ball and moved it on well.
His creative work didn't always come off but he kept on playing, while also having a couple of dangerous dribbles.
There was no role in this game for Tawanda Chirewa, who became Ipswich's second youngest player ever on Tuesday night, with the midfielder yet to make his debut at Under 18 level.
Don't forget about me
Simpson may well have been involved in the Blues' EFL Trophy game at Colchester on Tuesday night, were it not for a troublesome pelvic injury.
That meant he missed out on a second senior appearance, having performed well as a substitute against Tottenham's Under 21s earlier this season.
The teenager, who has a rugby background and has previously been looked at by Manchester City, played wide left in this game and was busy throughout, using his pace and power to test Exeter right-back Jack Veale.
His thunderous 25-yard effort came flying back off the post just a few minutes into the second half before he had a low shot saved after switching to a central role as he contributed throughout.
So who could be next?
If you watch these games with a first-team head on, the natural thought is to look for players who could make the jump into the senior set-up.
It's going to be tough to break into manager Paul Lambert's plans, given the strength and size of the Town boss's senior squad, but there was no shortage of talent on display in this game.
Simpson and Gibbs have already appeared in the EFL Trophy, of course, and that same competition could give another youngster or two the chance to make their bows.
Right winger Brown, the younger brother of former Ipswich and now Chelsea hot prospect Charlie, is skilful, direct and quick to make good decisions.
O'Reilly is an attacking full-back, keen to support his man further up the field and get into the box, while Oppong is a powerful frontman who can operate with his back to goal.
There were plenty of good performances across the pitch, though, with Alley coming up big when needed between the sticks, captain Alex Henderson vocal throughout and substitute Allan Viral looking neat and tidy after coming on.
Ipswich have been drawn away to Peterborough in the first knockout round of the Trophy, which is the most likely route for any of the above to be given a first opportunity.
In reality, though, taking on leading roles for the Under 23s would be the natural progression for this group of talented teenagers.
What the manager said
Speaking after the game, Under 18s manager Adem Atay said: "The dressing is a little bit flat right now because they know they can perform better than that.
"Exeter brought a different challenge in the second half so credit to them, but we felt we were a bit naive in our style and decision-making.
"Jake Alley has made two fantastic saves to keep us in the game as we were on the back foot.
"If Tyreece's thunderbolt shot goes in at 3-0, it makes it a different game. It didn't so the lads had a new experience and two contrasting halves, but it is all about learning and those individuals who learn the quickest will progress in their journey.
"These types of games in stadiums have different challenges playing Cardiff, Exeter and King's Lynn, they give different experiences that can only be positive for the boys in their development."
Next up
The draw for round three of the competition has already been made, with the winners due to face Cardiff City in the next round.
That game needs to be played by December 14.
Ipswich Town U18s: Alley; O'Reilly, Fehrenbach, Henderson, Smith; Healy (Cutbush 64), Alexander; Brown, Gibbs, Simpson (Ruffles 83); Oppong (Viral 59)
Subs: Wyss, Bort, Baker, Reed
Exeter City U18s: Arthur, Veale, Clark, Morison, Pond, Stafford, Chrisene, Moyse (Z Collins 88), Wilson, Lovett (Johnson), Iseguan
Subs: Fuller, Nicholson, E Collins


| 022:029 Khan | : |
Then let them complete the prescribed duties (Manasik of Hajj) for them, and perform their vows, and circumambulate the Ancient House (the Ka'bah at Makkah). |
| 022:029 Maulana | : |
Then let them accomplish their needful acts of cleansing, and let them fulfil their vows and go round the Ancient House. |
| 022:029 Pickthal | : |
Then let them make an end of their unkemptness and pay their vows and go around the ancient House. |
| 022:029 Rashad | : |
They shall complete their obligations, fulfill their vows, and visit the ancient shrine. |
| 022:029 Sarwar | : |
Let the pilgrims then neatly dress themselves, fulfil their vows, and walk seven times around the Kabah. |
| 022:029 Shakir | : |
Then let them accomplish their needful acts of shaving and cleansing, and let them fulfil their vows and let them go round the Ancient House. |
| 022:029 Sherali | : |
'Then let them accomplish their needful acts of cleansing, and fulfill their vows, and go around the Ancient House.' |
| 022:029 Yusufali | : |
"Then let them complete the rites prescribed for them, perform their vows, and (again) circumambulate the Ancient House." |
Concepts/Themes Covered: أركان الإسلام > الحج والعمرة > فرضية الحج وآدابه Pillars of Islam> Hajj and Umrah> Duty of Hajj and its Morals أركان الإسلام > مسائل متفرقة من العبادة > النذور Pillars of Islam> Miscellaneous Points of Worship> The Vows الإنسان والعلاقات الأخلاقية > الأخلاق الحميدة > النظافة Man and The Moral Relations> Good Morals>Cleanliness العلاقات القضائية > أحكام قانونية > أحكام عامة > الوفاء بالنذر Judicial Relationships>Legal Rules>General Rules>Performing Vows العلوم والفنون > الحقائق العلمية و الإشاة إلى وقائع أيدتهاالإكتشافات العلمية > الصحة Science and Art> The Scientific Facts and the Indication to Facts which have been supported by the Scientific Discoveries>The Health
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


News story
Information intended to dispel some common myths and misconceptions about the academies programme.
By making every school an academy, education is being privatised.
Academies are free, state-funded schools which are run by charitable trusts. They cannot be run for profit. Profit-making schools were explicitly ruled out in our manifesto and will continue to be: charity law would expressly prevent this. The school system is not being privatised - instead heads and teachers are being given greater freedom to run their schools.
There are already strict rules in place which prevent individuals and companies profiting from their relationship with an academy, as with local-authority schools, academies cannot sell or change the use of publicly funded school land without government approval. This will not change.
Academies don’t lead to higher standards.
Evidence from around the world clearly demonstrates that educational performance is improved by giving autonomy to front-line teaching professionals and holding those professionals to account for the outcomes they achieve for young people.
It is not the case that every academy performs better than every local-authority school; but the academy system makes it easier to put in place those factors - better teaching, leadership, curriculums and accountability - that incontrovertibly drive up standards. It better allows underperformance to be tackled when it does occur; and establish a system more likely to lead to long-term improvements in results over the next decade.
Multi-academy trusts are national, remote organisations that don’t give local schools and communities a say.
Empowering the frontline and moving control away from managers and bureaucrats and directly to the frontline is an effective way of improving performance - holding them to account for the results they achieve, and to much stricter standards of financial propriety than we ever have with local-authority schools. That is exactly what a system where every school is an academy does - providing weaker schools with the expert support they need to improve and giving the best schools the ability, freedom from meddling, money and power to innovate, build on their success and spread their reach further.
Whereas one-size-fits-all approaches dictated from County Hall gives an impression of local control, in fact, it’s academy headteachers and governing bodies that hold direct relationships with the parents they serve and have the power to be much more responsive to their communities. If a parent tries to lobby County Hall for change, they’d have to persuade them to change things for the whole local authority; if the academy is approached, it’s their responsibility to make a change at the school the parent cares about.
All schools will have to join multi-academy trusts.
Successful, sustainable schools will not be forced to join up in a trust with other schools. As it happens, many academy schools have chosen to join a trust because they can see the benefits. Two-thirds of current academies have chosen to be part of multi-academy trusts.
For weaker schools, that means help from stronger schools; for stronger headteachers, it’s an opportunity to play a bigger role in improving standards for more children. But for all schools, including those that are already ‘outstanding’, it opens up opportunities to learn from others and share resources - for instance a small primary school that wouldn’t ordinarily be able to afford their own foreign language teacher can now share that teacher with a group of schools.
And strong schools that choose to come together in a trust can decide how it should be led. But to be absolutely clear - we will never make a successful, sustainable school that is performing well join a trust - and successful schools that do choose to set up or join a trust will always be able to decide how it works.
Academies won’t be accountable to parents.
We want parents to be more involved in their child’s education - not less. We are not, and never have suggested parents should no longer sit on governing boards and we know that many parents already play a valuable role in governance, and parents will always be encouraged to be governors or trustees.
Many parents have skills that make them very effective governors. All boards are and will continue to be free to appoint them as they see fit. But we want to enable academies to move from a model where parents are elected or appointed to governing boards for means of representation to one where they are chosen for their expertise.
That means that academy trust boards should be able to appoint all their trustees for their skills, insight and knowledge rather than who they represent.
Our white paper outlines a range of ways we are enabling parents to be more engaged with their children’s education. For the first time we will create an expectation that every academy puts in place arrangements for meaningful engagement with all parents, and to listen to their views and feedback. We will also introduce more regular surveys of parental satisfaction with schools and display this alongside their examination results in our league tables.
Academies will be forced to cut all ties with the local authority.
Schools will still be able to work closely with good local authorities as most academies already choose to do. The difference is that the arrangements will be determined locally and driven by headteachers deciding what works for their school, rather than functions and responsibilities designed in Whitehall.
Schools will also be free to group together to buy services from local authorities as is already the case - it’s just that they will also have the choice of other services and providers that may be better for their particular needs. For example, the local authority and some of their schools may decide to continue working together to offer HR and facilities-management services, but decide that school improvement is better delivered through small ‘families’ of schools working together with no need for the local authority.
We’ve set an end-point in 6 years’ time, giving heads and teachers certainty over the future of their schools and a clear sense of direction, so that they can plan effectively to give schools and local authorities time to carefully design arrangements that work locally, rather than an ad hoc approach that schools and local authorities were telling us wasn’t helping them plan.
What it does mean is the end of the local-authority monopoly on running schools and central government deciding a single approach to what services are delivered, where: schools will now be required to make a conscious choice over what will work best for their pupils. While there are well run local education authorities, there are also some local authorities that have been allowing schools to underperform, coast or fail for a long time.
Academies aren’t transparent.
Academies are actually much more accountable than local-authority schools. Academy performance is monitored directly by regional school commissioners who intervene promptly in instances of underperformance.
The Education Funding Agency ensures compliance with a funding agreement to make sure that spend is securing better outcomes for pupils. Unlike local-authority schools, academies are regulated charities - so they prepare annual financial statements that are fully audited by an independent external auditor. Academy schools are all charities held to account through a contract with government and bound by both company and charity law. That contract enshrines their freedom, and keeps them accountable for their results.
Like all schools, the performance of every academy is completely transparent on Ofsted’s website and DfE ’s performance tables. The latter have been re-designed to be easier to navigate and compare performance. We will also publish new academy trust-level performance tables each year.
Becoming an academy will mean my good school has to change.
Converting to an academy will not mean that a school that is performing well has to change its teaching practice or headteacher, or any of the things that make that school good. If new academies decide to opt into arrangements that look similar to those that currently work for them - working in the same local family of schools, choosing to fully follow the national curriculum and opting to work closely with the local authority, they’re free to do so.
The difference is that we’re asking them to make a conscious choice as to what to opt into; and we’ll be more able to hold them to account for the effectiveness of their decisions, to continue driving up standards for their pupils. We have seen that even schools that are ‘good’ or ‘outstanding’ continue to do well an academy - 2015 GCSE results show that secondary converter academies are performing 7.2 percentage points above the national average, with 64.3% of pupils achieving 5 or more good GCSEs, including English and maths.
Academy status frees the best heads and teachers to innovate, to raise the bar and to do what it takes to compete with the best schools not just in the UK but across the world.
Converting will be a bureaucratic and financial burden to schools.
We will ensure these new freedoms don’t become a bureaucratic burden and will make the process of converting to an academy simpler. We have given schools a 6-year timetable to become an academy, so no school has to rush into an arrangement that isn’t right for them and we will support small schools through this process.
The policy is fully-funded, offering the same academisation grants that have so far seen two-thirds of secondaries and one-fifth of primaries successfully become academies.
We have set aside funding to support a high-quality, fully academised school system. Overall, we have over £500 million available in this Parliament to build capacity - including recruiting excellent sponsors and encouraging the development of strong multi-academy trusts.
Criticisms that the policy is not fully-funded use grossly inaccurate costings, for example, in one case, erroneously calculating the average cost of academisation will be £66,000. This is crude and highly misleading - costs per academy have fallen significantly over the 5-year period, from over £250,000 in 2010 to 2011 to around £32,000 in 2015 to 2016. The cost per academy will continue to fall significantly in the years ahead as we move towards full academisation.
There is no longer a role for the local authority in schools.
The local authority will still play a key role making sure that education provision in their area is of the highest quality.
Rather than running schools, local authorities will instead play a role in ensuring the system works for parents, focused on ensuring there are enough school places, overseeing admissions complaints and commissioning support for children with specific needs, especially those with SEN . We want them to be an advocate for parents and encourage the best multi-academy trusts into their communities and encourage high-quality free school applications.
Alongside this, the opportunities provided by local devolution give local authorities the chance to act as champions and advocates for the education their community wants and deserves.
Published: 13 April 2016