-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WorkGraph execution policy #771
Comments
hcedwar
added
the
Feature Request
Create new capability; will potentially require voting
label
May 4, 2017
A potentially reusable implementation by the phalanx library is a work graph queue with lock free while ( ! work.empty() ) {
int n = work.pop_ready();
// do work for 'n'
work.complete( n );
} |
some thoughts on the queue using p = pair<int32_t,int32_t> ;
int32_t pop()
{
int volatile * const queue = ... ;
p volatile * const range = ... ;
p w(-1,-1);
for ( int attempt = 1 ; attempt ; ) {
const p w_new( w.first + 1 , w.second );
w = CAS( range , w , w_new );
if ( w.first < w.second ) { // range was viable
// some work to pop, did I get it?
attempt = ! ( w_new.first == w.first + 1 && w_new.second == w.second );
}
else { // currently nothing to pop, wait for some work
attempt = w.first < total_work ;
}
}
if ( w.first < total_work ) {
int i = -1 ;
while ( -1 == ( i = queue[ w.first ] ); // racing with push
return i ;
}
else {
return -1 ;
}
}
void push( int32_t ready )
{
p w(-1,-1);
for ( int attempt = 1; attempt ; ) {
const p w_new( w.first , w.second + 1 );
w = CAS( range , w , w_new );
attempt = ! ( w.first == w_new.first && w.second + 1 == w_new.second );
}
queue[ w.second ] = ready ;
memory_fence();
} |
ibaned
added a commit
that referenced
this issue
Jun 15, 2017
ibaned
added a commit
that referenced
this issue
Jun 15, 2017
ibaned
added a commit
that referenced
this issue
Jun 15, 2017
ibaned
added a commit
that referenced
this issue
Jun 16, 2017
ibaned
added a commit
that referenced
this issue
Jun 16, 2017
ibaned
added a commit
that referenced
this issue
Jun 16, 2017
ibaned
added a commit
that referenced
this issue
Jun 16, 2017
ibaned
added a commit
that referenced
this issue
Jun 16, 2017
ibaned
added a commit
that referenced
this issue
Jun 21, 2017
ibaned
added a commit
that referenced
this issue
Jun 21, 2017
ibaned
added a commit
that referenced
this issue
Jun 21, 2017
ibaned
added a commit
that referenced
this issue
Jun 21, 2017
[#771] This works around the build system, which doesn't install Cuda/*.hpp if CUDA is disabled, etc.
ibaned
added a commit
that referenced
this issue
Jun 22, 2017
ibaned
added a commit
that referenced
this issue
Jun 22, 2017
ibaned
added a commit
that referenced
this issue
Jun 22, 2017
ibaned
added a commit
that referenced
this issue
Jun 22, 2017
ibaned
added a commit
that referenced
this issue
Jun 22, 2017
ibaned
added a commit
that referenced
this issue
Jun 22, 2017
ibaned
added a commit
that referenced
this issue
Jun 22, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ckrisgarrett : parallel pattern/policy useful for algorithms of type in https://github.com/lanl/tycho2
WorkGraph is a CRS graph that says the function can be called for row index i only after the
function has completed for the row's column indices. If multiple row indices can be called then
prioritize according to number of other rows waiting; e.g., if row 'i' has 4 waiting rows
and row 'j' has 2 waiting rows then choose row 'i' over row 'j'.
This prioritization attempts to clear dependences sooner and thus make more work available sooner.
Construct WorkGraph:
Primitive parallel pattern / policy for sweep algorithms.
Implementation:
Array of integers used for linked list queues of prioritized ready queues and waiting queues.
Atomically push and pop among queues as work items (indices) complete and pending work items are updated.
The text was updated successfully, but these errors were encountered: