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

Regent: Support for intXd with X > 3 #467

Closed
manopapad opened this issue Jan 11, 2019 · 9 comments
Closed

Regent: Support for intXd with X > 3 #467

manopapad opened this issue Jan 11, 2019 · 9 comments
Assignees
Labels
Regent Issues pertaining to Regent

Comments

@manopapad
Copy link
Contributor

Legion and Regent now have support for a variable number of index space dimensions, and this support has been ported to the C interface.

What remains is to use this feature to extend Regent's int2d/3d to more dimensions. This should be straightforward, as most operations on int2d/3d are already handled uniformly, by mapping over the structs' fields.

Mainly, someone needs to run through the code looking for uses of hardcoded numbers for the maximum number of dimensions, and replace them with the appropriate compile-time constant (e.g. this assertion

assert(#entries >= 1 and #entries <= 3,
and this for-loop
for _ = #values + 1, 3 do
).

Also see #466.

@elliottslaughter
Copy link
Contributor

I have an initial patch that fixes this (not pushed yet), but right now Legion doesn't even compile with CC_FLAGS=-DLEGION_MAX_DIM=4, so even if I push it you won't be able to do anything until that is fixed.

@elliottslaughter
Copy link
Contributor

Compile error:

/home/elliott/legion/runtime/legion/legion_c.cc:3912:1633:   required from here
/home/elliott/legion/runtime/realm/dynamic_templates.h:183:50: error: no type named ‘TYPE’ in ‘struct Realm::DynamicTemplates::IntList<1, 3>::ERROR_INT_NOT_IN_LIST<4>’
  typedef typename ERROR_INT_NOT_IN_LIST<N>::TYPE TYPE;
                                                  ^

@elliottslaughter
Copy link
Contributor

Well, my patch is in. There is now a -flegion-dim flag you can use to tell Regent about the value of LEGION_MAX_DIM. It's now up to @lightsighter to get the runtime to pass when LEGION_MAX_DIM is something other than 3.

@lightsighter
Copy link
Contributor

This is not a bug. As I said in my original email, you have to update REALM_MAX_DIM in sync with LEGION_MAX_DIM. There is no coupling of them for obvious reasons. If you want I can make a static assertion if LEGION_MAX_DIM > REALM_MAX_DIM which will cause a compile error when you try to build Legion. Assigning back to @elliottslaughter to respond about what he thinks is best.

@elliottslaughter
Copy link
Contributor

I guess we want this to be lifted to a variable in the Makefile / CMake. So just like setting DEBUG causes DEBUG_LEGION / DEBUG_REALM to get passed as compiler flags, setting MAX_DIM causes LEGION_MAX_DIM / REALM_MAX_DIM to get set.

If that sounds good I'm happy to implement.

@lightsighter
Copy link
Contributor

That sounds good to me. I think I'll add the static assertion too just so people will get an better error message.

@elliottslaughter
Copy link
Contributor

@manopapad Please pull master and try this:

MAX_DIM=4 ./install.py --debug
./regent.py examples/circuit.rg -flegion-dim 4

@manopapad
Copy link
Contributor Author

That works. Presumably we also want to have some testcases with int4d etc.

@elliottslaughter
Copy link
Contributor

Closing, this has been supported for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regent Issues pertaining to Regent
Projects
None yet
Development

No branches or pull requests

3 participants