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

Zoltan2: Restore Zoltan2 test and Kokkos unordered map #4266

Merged
merged 1 commit into from
Feb 6, 2019

Conversation

MicheldeMessieres
Copy link
Contributor

@trilinos/zoltan2

Motivation and Context

This is a follow up PR to clean up a few issues from PR #4252.

It restores a missing zoltan2 test.
It restored the directory to use Kokkos unordered map (now host space) anticipating we'll be implementing parallel forms in the future.
It cleans up some of the directory hash code to avoid a global static method definition.

How Has This Been Tested?

Tested on white cuda.
Tested on mac clang parallel and serial.

Checklist

  • My commit messages mention the appropriate GitHub issue numbers.
  • My code follows the code style of the affected package(s).
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the code contribution guidelines for this project.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • No new compiler warnings were introduced.
  • These changes break backwards compatibility.

Using Host Space unordered map for now to avoid prior cuda issues.
Switching back to Kokkos anticipating we'll be developing
parallel forms for this later.

Also restores a new Zoltan2 test to working status.

Also cleans up some of the murmur hash code to avoid
the global function declarations.
@trilinos-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO REVIEWS HAVE BEEN PERFORMED ON THIS PULL REQUEST!

Copy link
Contributor

@mhoemmen mhoemmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments. It looks like you're relying on Kokkos::UnorderedMap's default hash function. If that's true, then this code might be "results impacting" in the sense of the Trilinos GitHub issue label.

@@ -595,8 +538,7 @@ int Zoltan2_Directory<gid_t,lid_t,user_t>::update_local(
node.owner = owner;
node.errcheck = owner;

if(!node_map.insert({*gid, node}).second) {
// if(node_map.insert(*gid, node).failed()) { // TODO Switch to Kokkos map
if(node_map.insert(*gid, node).failed()) {
// Need more nodes (that's the assumption here if we have failure)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failed() isn't the only possible non-successful result; see freed_existing in Kokkos_UnorderedMap.hpp.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think freed_existing() is only relevant for parallel or threaded cases? I can add this when we develop parallel forms.

{
const Zoltan2_Directory_Node<gid_t,lid_t,user_t> & node =
node_map.at(*gid);
// node_map.value_at(node_index); // TODO: Switch to Kokkos map
node_map.value_at(node_index);
/* matching global ID found! Return gid's information */
if(lid) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of a pointer being called lid. That confused me until I saw the next line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Some code is still replicated from zoltan and as I continue to work on it, I need to convert the original c code to be more c++ like. We plan to return to this to add parallel forms. I will improve it.

@@ -1084,15 +1023,15 @@ int Zoltan2_Directory<gid_t,lid_t,user_t>::remove(
// eliminating remove_local and just calling here but will keep for now to
// keep symmetry with other modes.
if(nrec > 0) {
// node_map.begin_erase(); // TODO Switch to Kokkos Map
node_map.begin_erase();
for (int i = 0; i < nrec; i++) {
msg_t *ptr = reinterpret_cast<msg_t*>(&(rbuff[i*remove_msg_size]));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this obey ANSI strict aliasing rules? (Remember the memcpy line of code I showed a little while ago?)

Copy link
Contributor Author

@MicheldeMessieres MicheldeMessieres Jan 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// no strict-alias warning
{
char char_ptr[10];
int * ptr = reinterpret_cast<int *>(char_ptr);
}

// no strict-alias warning
{
char * char_ptr = new char[10];
int * ptr = reinterpret_cast<int *>(char_ptr);
}

// strict-alias warning
{
char char_ptr[10];
int * ptr;
*ptr = *(reinterpret_cast<int *>(char_ptr));
}

// no strict-alias warning
{
char * char_ptr = new char[10];
int * ptr;
*ptr = *(reinterpret_cast<int *>(char_ptr));
}

@trilinos-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
THE LAST COMMIT TO THIS PULL REQUEST HAS BEEN REVIEWED, BUT NOT ACCEPTED OR REQUIRES CHANGES

@trilinos-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED AND APPROVED by [ kddevin ]!

@trilinos-autotester
Copy link
Contributor

Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects:

Pull Request Auto Testing STARTING (click to expand)

Build Information

Test Name: Trilinos_pullrequest_gcc_4.8.4

  • Build Num: 2374
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
COMPILER_MODULE sems-gcc/4.8.4
JENKINS_BUILD_TYPE Release
JENKINS_COMM_TYPE MPI
JENKINS_DO_COMPLEX OFF
JENKINS_JOB_TYPE Experimental
MPI_MODULE sems-openmpi/1.8.7
PULLREQUESTNUM 4266
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH fixDirectoryCudaPart2
TRILINOS_SOURCE_REPO https:/Tech-XCorp/Trilinos
TRILINOS_SOURCE_SHA 182a259
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https:/trilinos/Trilinos
TRILINOS_TARGET_SHA 43d7165

Build Information

Test Name: Trilinos_pullrequest_intel_17.0.1

  • Build Num: 2175
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 4266
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH fixDirectoryCudaPart2
TRILINOS_SOURCE_REPO https:/Tech-XCorp/Trilinos
TRILINOS_SOURCE_SHA 182a259
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https:/trilinos/Trilinos
TRILINOS_TARGET_SHA 43d7165

Build Information

Test Name: Trilinos_pullrequest_gcc_4.9.3_SERIAL

  • Build Num: 666
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 4266
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH fixDirectoryCudaPart2
TRILINOS_SOURCE_REPO https:/Tech-XCorp/Trilinos
TRILINOS_SOURCE_SHA 182a259
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https:/trilinos/Trilinos
TRILINOS_TARGET_SHA 43d7165

Build Information

Test Name: Trilinos_pullrequest_gcc_7.2.0

  • Build Num: 293
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 4266
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH fixDirectoryCudaPart2
TRILINOS_SOURCE_REPO https:/Tech-XCorp/Trilinos
TRILINOS_SOURCE_SHA 182a259
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https:/trilinos/Trilinos
TRILINOS_TARGET_SHA 43d7165

Build Information

Test Name: Trilinos_pullrequest_cuda_9.2

  • Build Num: 78
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
JENKINS_JOB_TYPE Experimental
PULLREQUESTNUM 4266
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH fixDirectoryCudaPart2
TRILINOS_SOURCE_REPO https:/Tech-XCorp/Trilinos
TRILINOS_SOURCE_SHA 182a259
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https:/trilinos/Trilinos
TRILINOS_TARGET_SHA 43d7165

Using Repos:

Repo: TRILINOS (Tech-XCorp/Trilinos)
  • Branch: fixDirectoryCudaPart2
  • SHA: 182a259
  • Mode: TEST_REPO

Pull Request Author: MicheldeMessieres

@trilinos-autotester
Copy link
Contributor

Status Flag 'Pull Request AutoTester' - Jenkins Testing: all Jobs PASSED

Pull Request Auto Testing has PASSED (click to expand)

Build Information

Test Name: Trilinos_pullrequest_gcc_4.8.4

  • Build Num: 2374
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
COMPILER_MODULE sems-gcc/4.8.4
JENKINS_BUILD_TYPE Release
JENKINS_COMM_TYPE MPI
JENKINS_DO_COMPLEX OFF
JENKINS_JOB_TYPE Experimental
MPI_MODULE sems-openmpi/1.8.7
PULLREQUESTNUM 4266
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH fixDirectoryCudaPart2
TRILINOS_SOURCE_REPO https:/Tech-XCorp/Trilinos
TRILINOS_SOURCE_SHA 182a259
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https:/trilinos/Trilinos
TRILINOS_TARGET_SHA 43d7165

Build Information

Test Name: Trilinos_pullrequest_intel_17.0.1

  • Build Num: 2175
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 4266
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH fixDirectoryCudaPart2
TRILINOS_SOURCE_REPO https:/Tech-XCorp/Trilinos
TRILINOS_SOURCE_SHA 182a259
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https:/trilinos/Trilinos
TRILINOS_TARGET_SHA 43d7165

Build Information

Test Name: Trilinos_pullrequest_gcc_4.9.3_SERIAL

  • Build Num: 666
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 4266
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH fixDirectoryCudaPart2
TRILINOS_SOURCE_REPO https:/Tech-XCorp/Trilinos
TRILINOS_SOURCE_SHA 182a259
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https:/trilinos/Trilinos
TRILINOS_TARGET_SHA 43d7165

Build Information

Test Name: Trilinos_pullrequest_gcc_7.2.0

  • Build Num: 293
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 4266
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH fixDirectoryCudaPart2
TRILINOS_SOURCE_REPO https:/Tech-XCorp/Trilinos
TRILINOS_SOURCE_SHA 182a259
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https:/trilinos/Trilinos
TRILINOS_TARGET_SHA 43d7165

Build Information

Test Name: Trilinos_pullrequest_cuda_9.2

  • Build Num: 78
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
JENKINS_JOB_TYPE Experimental
PULLREQUESTNUM 4266
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH fixDirectoryCudaPart2
TRILINOS_SOURCE_REPO https:/Tech-XCorp/Trilinos
TRILINOS_SOURCE_SHA 182a259
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https:/trilinos/Trilinos
TRILINOS_TARGET_SHA 43d7165


CDash Test Results for PR# 4266.

@trilinos-autotester
Copy link
Contributor

Status Flag 'Pre-Merge Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED AND APPROVED by [ kddevin ]!

@trilinos-autotester
Copy link
Contributor

Status Flag 'Pull Request AutoTester' - AutoMerge IS ENABLED, but the Label AT: AUTOMERGE is not set. Either set Label AT: AUTOMERGE or manually merge the PR...

@kddevin kddevin merged commit 7b15f60 into trilinos:develop Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: Zoltan2 stage: in progress Work on the issue has started
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants