Skip to content
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

Subsets, masked ops question 2 #3

Open
bjoo opened this issue Sep 10, 2013 · 0 comments
Open

Subsets, masked ops question 2 #3

bjoo opened this issue Sep 10, 2013 · 0 comments

Comments

@bjoo
Copy link
Contributor

bjoo commented Sep 10, 2013

One issue that arises with sets and subsets is the annoying difference between ordered and unordered sets. In principle the idea in the 'scalarsite' ordering was that in an ordered subset one can do a straight for loop from 'start' to 'end'. In the scalarvecsite (e.g. parscalarvec) this is not immediately so straightforward since
contiguity may not span inner/outer site boundaries (ie, the subset could be contiguous but end mid-way through the inner sites of an outer block.)

Further there are subsets which are a discontiguous collection of contiguous subsets, e.g. for t-slice sums. WIth time running slowest, typically there is a portion (one timeslice, one checkerboard) that is contiguous.

A potential solution may be to store the subset as a 'list of contiquous bits'. Each member of this list could b
for scalarsite arch: just start/end sites
for scalarvecsite arch: start/end outer blocks, and mask on the last outer block

The lattice traversal could then proceed through the generic loop (written in very pseudocode)

scalarsite:

         for i in list of contiguous bits:
              for site in startsite[i]..endsite[i], site++
                   forEach( ...)  on site 'i'

scalarvecsite:

         for i in list of contiguous bits:
               for block in startblocks[i]..endblocks[i], block++
                     if ( block == endblocks[i] ) 
                          mask=endMask[i]
                     else  
                          mask[:] = true
               forEach(   ) on block with mask.

NB: For 2 D vectorization etc, it may be that each block will need a mask,
as linear 'filling up' may not be guaranteed then.

This should help subsets with lots of contiguous bits, should hopefully stay efficient for
all contiguous subsets, and fragment naturally to truly noncontiguous subsets.

It would also need to generalize ForEach() to work with masks. How to do that?
ForEach with masks can also help with where() statements in scalarvec/parscalarvec?
Thoughts ?

bjoo pushed a commit that referenced this issue Feb 6, 2015
compatibility with newest QDP++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant