Type of `SparsityPatternView::numColumns()` should be `COL_TYPE`

Open
#258 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
hpc

Research direction

Inspect SparsityPatternView and the declarations or uses of m_numCols, numColumns(), and resize() to identify all affected types. Add coverage for column counts wider than INDEX_TYPE and run the relevant LvArray test suite; done means the column count and related parameters use COL_TYPE without narrowing warnings or debug-check failures.

Written by the indexing model from the issue text.

Description

Type of SparsityPatternView::m_numCols and related method parameters/return values (numColumns(), resize(), etc.) is currently specified to be INDEX_TYPE, but should perhaps be COL_TYPE instead.

Currently this only results in rare clang-tidy warnings about narrowing conversions (e.g. with INDEX_TYPE = int and COL_TYPE = long long), but as soon as we try to assemble a matrix with >2B global DOFs, it becomes a real issue (at the very least, it would fail the column index check in Debug, since m_numCols would truncate in an implementation-defined way).

Dominant language
C++
Stars
49
Forks
9
Avg merge
5d 15h
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GEOS-DEV/LvArray

All issues in GEOS-DEV/LvArray

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.