Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

Eliminate explicit use of node types #13

Open
crtrott opened this issue Dec 23, 2014 · 3 comments
Open

Eliminate explicit use of node types #13

crtrott opened this issue Dec 23, 2014 · 3 comments

Comments

@crtrott
Copy link
Contributor

crtrott commented Dec 23, 2014

Currently Nalu explicitly uses Kokkos::SerialNode in some places. It would be better to use:
KokkosClassic::DefaultNode::DefaultNodeType which would allow Nalu to pick up the Node type from the Trilinos configuration. THis is for example important when trying to build with OpenMP.
It would be even better to not specifiy Node at all but simply let Tpetra use its defaults.
I.e.
Tpetra::Export< LocalOrdinal, GlobalOrdinal>
instead of
Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >

@mhoemmen
Copy link

Another option would be to get default types from Tpetra::Map. If you want Tpetra's default Node type, just use Tpetra::Map<LO, GO>::node_type. Tpetra::Map<LO, GO>::device_type (preferred) works, as does Tpetra::Map<LO, GO>::node_type::device_type (not preferred).

The eventual plan is to replace Node entirely, in favor of some Kokkos thing. I'm pretty sure we can use C++11 template typedefs for backwards compatibility (using Node where a Kokkos thing would do), without increasing the amount of code to build.

@spdomin
Copy link
Owner

spdomin commented Aug 4, 2016

Is this still an issue?

@mhoemmen
Copy link

mhoemmen commented Aug 5, 2016

Is this still an issue?

Hi @spdomin ! Kokkos::SerialNode hasn't existed for a while. I would recommend getting the default Node type from Tpetra::Map<LO, GO>::node_type, rather than using the KokkosClassic typedef (which will go away at some point).

There are cases you might want a nondefault Node type. For example:

  1. You want to build Nalu against an installed Trilinos whose configuration is outside of your control. In that case, the default Node type may not be what you want.
  2. You want to do performance comparisons within Nalu of different Kokkos back-ends, without reconfiguring Trilinos in between. In that case, you would need to enable all the Node types in Trilinos that you plan to compare.

Otherwise, it's usually a good idea to use the default Node type. For example: Suppose that Nalu wants to use OpenMP. Trilinos would need to be built with OpenMP enabled anyway. In that case, the default Node type uses OpenMP. One can always command Tpetra at configure time to use a different default, but that takes extra effort.

Nalu's approach of having a typedef to specify its Node type works just fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants