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

Tpetra: Consolidate Node creation code in unit tests to avoid multiple Kokkos initialization & finalization cycles #484

Closed
mhoemmen opened this issue Jul 5, 2016 · 0 comments
Assignees

Comments

@mhoemmen
Copy link
Contributor

mhoemmen commented Jul 5, 2016

@trilinos/tpetra

Tpetra's current Node implementation initializes Kokkos automatically for users, if it has not yet been initialized. It uses a per-Node-class reference count to decide when to finalize Kokkos. However, Kokkos forbids multiple initialization / finalization cycles in the same run.

This works fine when applications or tests only have one Node instance. Tpetra has Node creation functions (defaultArgNode and getNode) that keep a Node instance around to avoid this problem. The issue comes up with Tpetra unit tests that, multiple times per run, create Node instances directly (without using the aforementioned creation functions), then destroy them. The reference count then goes to zero at the end of each test, so each test calls Kokkos::finalize.

To start fixing this, the best thing to do is not to create Nodes directly in tests. Instead, let Tpetra create the Node. Ideally, don't create or handle Node instances at all. This will make it easier for us to fix this issue inside Tpetra.

@mhoemmen mhoemmen self-assigned this Jul 5, 2016
mhoemmen pushed a commit that referenced this issue Jul 5, 2016
@trilinos/tpetra Fix #484 in Tpetra's unit tests, by deferring to
Tpetra functions to create a Node instance, rather than calling Node's
constructor directly.

Build/Test Cases Summary
Enabled Packages: TpetraCore
Disabled Packages: FEI,PyTrilinos,Moertel,STK,SEACAS,ThreadPool,OptiPack,Rythmos
0) MPI_DEBUG => Test case MPI_DEBUG was not run! => Does not affect push readiness! (-1.00 min)
1) SERIAL_RELEASE => Test case SERIAL_RELEASE was not run! => Does not affect push readiness! (-1.00 min)
2) MPI_DEBUG => passed: passed=97,notpassed=0 (0.77 min)
3) SERIAL_RELEASE => passed: passed=73,notpassed=0 (4.43 min)
@mhoemmen mhoemmen changed the title Tpetra: Consolidate Node creation code to avoid multiple initialization & finalization of Kokkos Tpetra: Consolidate Node creation code in unit tests to avoid multiple Kokkos initialization & finalization cycles Jul 5, 2016
@mhoemmen mhoemmen closed this as completed Jul 5, 2016
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