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

add cmake support for Tpetra_ENABLE_DEPRECATED_CODE #3742

Merged
merged 4 commits into from
Jan 16, 2019

Conversation

GeoffDanielson
Copy link
Contributor

@GeoffDanielson GeoffDanielson commented Oct 26, 2018

This adds support to the CMakeLists.txt file to allow a macro switch to disable the old-style ordinal template args and dynamic allocation on matrices and graphs

@trilinos/tpetra

Description

Added a default value to the tpetra CMakeLists.txt file, support for the switch to the tpetra/src/core CMakeLists.txt, and a cmakedefine to TpetraCore_config.h.in

Motivation and Context

This is an effort toward removing the template arguments (local/global/index ordinal types) and dynamic profile support from tpetra without breaking backward compatibility with current apps

How Has This Been Tested?

This was tested by running CMake with -DTpetra_ENABLE_DEPRECATED_CODE explicitly included in both (ON|OFF) states, and excluded to make sure that CMake built appropriately.

Checklist

  • [NA] My commit messages mention the appropriate GitHub issue numbers.
  • My code follows the code style of the affected package(s).
  • [NA] My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the code contribution guidelines for this project.
  • [NA] 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.

@bartlettroscoe bartlettroscoe added the stage: in progress Work on the issue has started label Oct 26, 2018
@trilinos-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - Auto Inspected - Inspection Is Not Necessary for this Pull Request.

@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_intel_17.0.1

  • Build Num: 1504
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA f584735
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 67b817d

Build Information

Test Name: Trilinos_pullrequest_gcc_4.9.3

  • Build Num: 2067
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
COMPILER_MODULE sems-gcc/4.9.3
JENKINS_BUILD_TYPE Release
JENKINS_COMM_TYPE MPI
JENKINS_DO_COMPLEX OFF
JENKINS_JOB_TYPE Experimental
MPI_MODULE sems-openmpi/1.8.7
PULLREQUESTNUM 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA f584735
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 67b817d

Build Information

Test Name: Trilinos_pullrequest_gcc_4.8.4

  • Build Num: 1729
  • 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 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA f584735
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 67b817d

Build Information

Test Name: Trilinos_pullrequest_gcc_4.9.3_SERIAL

  • Build Num: 43
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA f584735
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 67b817d

Using Repos:

Repo: TRILINOS (trilinos/Trilinos)
  • Branch: tpetra_disable_deprecated_cmake
  • SHA: f584735
  • Mode: TEST_REPO

Pull Request Author: GeoffDanielson

Copy link
Contributor

@kddevin kddevin left a comment

Choose a reason for hiding this comment

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

Thanks for volunteering for this task, @GeoffDanielson
Two comments/questions:

  • Does this change make the #define value Tpetra_DISABLE_DEPRECATED_CODE into the source code? I expected to see a change to tpetra/core/cmake/TpetraCore_configs.h.in, adding a cmakedefine option there. I am not a Cmake wizard, so I would have followed the pattern of some other Tpetra option (e.g., Tpetra_INST_FLOAT).
  • This flag will be used for all deprecated code (e.g., for your work with @tjfulle deprecating DynamicProfile), not only for the template deprecation. Thus, more general MESSAGE STATUS text would be preferred.

@kddevin
Copy link
Contributor

kddevin commented Oct 26, 2018

BTW: If you want the learning experience of adding new tests to Tpetra, you could write a simple one that CMake enables only if the new CMake option is enabled and does something like

main() {
#ifdef TPETRA_DISABLE_DEPRECATED_CODE
   printf("PASS");
#else 
   printf("FAIL");
#endif 
}

For when the CMake option isn't set, you could have a test with the opposite behavior.

@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_intel_17.0.1

  • Build Num: 1504
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA f584735
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 67b817d

Build Information

Test Name: Trilinos_pullrequest_gcc_4.9.3

  • Build Num: 2067
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
COMPILER_MODULE sems-gcc/4.9.3
JENKINS_BUILD_TYPE Release
JENKINS_COMM_TYPE MPI
JENKINS_DO_COMPLEX OFF
JENKINS_JOB_TYPE Experimental
MPI_MODULE sems-openmpi/1.8.7
PULLREQUESTNUM 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA f584735
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 67b817d

Build Information

Test Name: Trilinos_pullrequest_gcc_4.8.4

  • Build Num: 1729
  • 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 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA f584735
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 67b817d

Build Information

Test Name: Trilinos_pullrequest_gcc_4.9.3_SERIAL

  • Build Num: 43
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA f584735
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 67b817d


CDash Test Results for PR# 3742.

@trilinos-autotester
Copy link
Contributor

Status Flag 'Pre-Merge 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

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

1 similar comment
@trilinos-autotester
Copy link
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

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.

Thanks for working on this! I've left a comment explaining how to define a new CMake option. Also, in order for the macro to exist, you must add the following line to Trilinos/packages/tpetra/core/cmake/TpetraCore_config.h.in:

#cmakedefine TPETRA_DISABLE_DEPRECATED_CODE

@trilinos-autotester
Copy link
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@mhoemmen mhoemmen added the AT: WIP Causes the PR autotester to not test the PR. (Remove to allow testing to occur.) label Oct 28, 2018
@mhoemmen
Copy link
Contributor

I just marked this as a WIP, mainly so that it doesn't clog the testing pipeline, since we know what changes it needs.

@GeoffDanielson GeoffDanielson changed the title add cmake support for Tpetra_DISABLE_DEPRECATED_CODE add cmake support for Tpetra_ENABLE_DEPRECATED_CODE Nov 2, 2018
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.

Some possibly incorrect CMake syntax, and suggestions for changes to docstrings and comments. Thanks!

MESSAGE (STATUS " - Tpetra_DISABLE_DEPRECATED_CODE is OFF, so Tpetra will assume you want the old template behavior.")
ENDIF()
SET (Tpetra_ENABLE_DEPRECATED_CODE_DEFAULT ON)
MESSAGE (STATUS "Determine whether Tpetra will enable ordinal template arguments and dynamic allocation. By default, this will be ON.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please just specify a general message here. "Whether Tpetra enables deprecated code at compile time. Default is ON (deprecated code enabled)." We plan on using this macro in the future, for deprecating other things that we inevitably will want to deprecate :-) . This also imitates Kokkos, which uses its macro in a generic way, for all deprecated features.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. Thanks

Tpetra_ENABLE_DEPRECATED_CODE
TPETRA_ENABLE_DEPRECATED_CODE
"Disable Tpetra deprecated code (templated ordinal types and dynamic graph/matrix allocation)"
Tpetra_ENABLE_DEPRECATED_CODE_DEFAULT
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you need to dereference the default value here. Do this:

${Tpetra_ENABLE_DEPRECATED_CODE_DEFAULT}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, I did need that for the default.

@@ -2,6 +2,9 @@
#define TPETRACORE_CONFIG_H
/* CMake uses this file to generate TpetraCore_config.h automatically */

/* define if user is using the deprecated codebase (templated ordinals, dynamicprofile) or not */
Copy link
Contributor

Choose a reason for hiding this comment

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

See above. "Deprecated code" is a generic thing; we should not refer to specifically deprecated features here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

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.

Thanks for the fixes! :-D

@mhoemmen
Copy link
Contributor

mhoemmen commented Nov 3, 2018

@kddevin It looks like Geoff addressed your concerns; shall we go ahead with the merge?

@kddevin kddevin added AT: AUTOMERGE Causes the PR autotester to automatically merge the PR branch once approvals are completed AT: RETEST Causes the PR autotester to run a new round of PR tests on the next iteration and removed AT: WIP Causes the PR autotester to not test the PR. (Remove to allow testing to occur.) labels Jan 15, 2019
@trilinos-autotester
Copy link
Contributor

Status Flag 'Pull Request AutoTester' - User Requested Retest - Label AT: RETEST will be reset after testing.

@trilinos-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - Auto Inspected - Inspection Is Not Necessary for this Pull Request.

@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: 2245
  • 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 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA 45c850a
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA e879ac4

Build Information

Test Name: Trilinos_pullrequest_intel_17.0.1

  • Build Num: 2048
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA 45c850a
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA e879ac4

Build Information

Test Name: Trilinos_pullrequest_gcc_4.9.3_SERIAL

  • Build Num: 535
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA 45c850a
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA e879ac4

Build Information

Test Name: Trilinos_pullrequest_gcc_7.2.0

  • Build Num: 146
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA 45c850a
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA e879ac4

Using Repos:

Repo: TRILINOS (trilinos/Trilinos)
  • Branch: tpetra_disable_deprecated_cmake
  • SHA: 45c850a
  • Mode: TEST_REPO

Pull Request Author: GeoffDanielson

@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: 2245
  • 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 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA 45c850a
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA e879ac4

Build Information

Test Name: Trilinos_pullrequest_intel_17.0.1

  • Build Num: 2048
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA 45c850a
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA e879ac4

Build Information

Test Name: Trilinos_pullrequest_gcc_4.9.3_SERIAL

  • Build Num: 535
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA 45c850a
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA e879ac4

Build Information

Test Name: Trilinos_pullrequest_gcc_7.2.0

  • Build Num: 146
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
PULLREQUESTNUM 3742
TEST_REPO_ALIAS TRILINOS
TRILINOS_SOURCE_BRANCH tpetra_disable_deprecated_cmake
TRILINOS_SOURCE_REPO https://github.com/trilinos/Trilinos
TRILINOS_SOURCE_SHA 45c850a
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA e879ac4


CDash Test Results for PR# 3742.

@trilinos-autotester trilinos-autotester removed the AT: RETEST Causes the PR autotester to run a new round of PR tests on the next iteration label Jan 16, 2019
@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 mhoemmen ]!

@trilinos-autotester
Copy link
Contributor

Status Flag 'Pull Request AutoTester' - Pull Request will be Automerged

@trilinos-autotester trilinos-autotester merged commit e154ca8 into develop Jan 16, 2019
@trilinos-autotester
Copy link
Contributor

Merge on Pull Request# 3742: IS A SUCCESS - Pull Request successfully merged

@trilinos-autotester trilinos-autotester removed the AT: AUTOMERGE Causes the PR autotester to automatically merge the PR branch once approvals are completed label Jan 16, 2019
@bartlettroscoe bartlettroscoe removed the stage: in progress Work on the issue has started label Jan 16, 2019
@jhux2 jhux2 deleted the tpetra_disable_deprecated_cmake branch August 14, 2019 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants