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

Fully remove Meschach #2619

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions cmake/CompilerHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,13 @@ if(CMAKE_C_COMPILER_ID MATCHES "PGI" OR CMAKE_C_COMPILER_ID MATCHES "NVHPC")
# "src/modlunit/units.cpp", warning #170-D: pointer points outside of underlying object
# "src/nrnpython/grids.cpp", warning #174-D: expression has no effect
# "src/nmodl/nocpout.cpp", warning #177-D: variable "j" was declared but never referenced
# "src/mesch/conjgrad.c", warning #180-D: argument is incompatible with formal parameter
# "src/nrniv/partrans.cpp", warning #186-D: pointless comparison of unsigned integer with zero
# "src/mesch/machine.h", warning #301-D: typedef name has already been declared (with same type)
# "src/nrnpython/rxdmath.cpp", warning #541-D: allowing all exceptions is incompatible with previous function
# "src/nmodl/nocpout.cpp", warning #550-D: variable "sion" was set but never used
# "src/gnu/neuron_gnu_builtin.h", warning #816-D: type qualifier on return type is meaningless"
# "src/modlunit/consist.cpp", warning #2465-D: conversion from a string literal to "char *" is deprecated
# ~~~
list(APPEND NRN_COMPILE_FLAGS
--diag_suppress=1,47,111,128,170,174,177,180,186,301,541,550,816,2465)
list(APPEND NRN_COMPILE_FLAGS --diag_suppress=1,47,111,128,170,174,177,186,541,550,816,2465)
endif()
list(APPEND NRN_COMPILE_FLAGS -noswitcherror)
list(APPEND NRN_LINK_FLAGS -noswitcherror)
Expand Down
13 changes: 5 additions & 8 deletions docs/hoc/programming/math/matrix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,17 @@ Matrix
By default, a new Matrix is of type MFULL (= 1) and allocates storage for
all nrow*ncol elements. Scaffolding is in place for matrices of storage
type MSPARSE (=2) and MBAND (=3) but not many methods have been interfaced
to the meschach library at this time. If a method is called on a matrix type
to the eigen library at this time. If a method is called on a matrix type
whose method has not been implemented, an error message will be printed.
It is intended that implemented methods will be transparent to the user, eg
m*x=b (``x = m.solv(b)`` ) will solve the linear system
regardless of the type of m and
v1 = m*v2 (``v1 = m.mulv(v2)`` ) will perform the vector multiplication.

Matrix is implemented using the
`meschach c library by David E. Stewart <http://www.math.uiowa.edu/~dstewart/meschach/meschach.html>`_
(discovered at http://www.netlib.org/c/index.html\ ) which contains a large collection
of routines for sparse, banded, and full matrices. Many of the useful
routines have not
been interfaced with the hoc interpreter but can be easily added on request
or you can add it yourself
Matrix is implemented using the `eigen3 library <https://eigen.tuxfamily.org>`_
which contains a large collection of routines for sparse, banded, and full matrices.
Many of the useful routines have not been interfaced with the hoc
interpreter but can be easily added on request or you can add it yourself
by analogy with the code in ``nrn/src/ivoc/(matrix.c ocmatrix.[ch])``
At this time the MFULL matrix type is complete enough to do useful work
and MSPARSE can be used to multiply a matrix by a vector and solve
Expand Down
13 changes: 5 additions & 8 deletions docs/python/programming/math/matrix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,17 @@ Matrix
By default, a new Matrix is of type MFULL (= 1) and allocates storage for
all nrow*ncol elements. Scaffolding is in place for matrices of storage
type MSPARSE (=2) and MBAND (=3) but not many methods have been interfaced
to the meschach library at this time. If a method is called on a matrix type
to the eigen library at this time. If a method is called on a matrix type
whose method has not been implemented, an error message will be printed.
It is intended that implemented methods will be transparent to the user, eg
m*x=b (``x = m.solv(b)`` ) will solve the linear system
regardless of the type of m and
v1 = m*v2 (``v1 = m.mulv(v2)`` ) will perform the vector multiplication.

Matrix is implemented using the
`meschach c library by David E. Stewart <http://www.math.uiowa.edu/~dstewart/meschach/meschach.html>`_
(discovered at http://www.netlib.org/c/index.html\ ) which contains a large collection
of routines for sparse, banded, and full matrices. Many of the useful
routines have not
been interfaced with the hoc interpreter but can be easily added on request
or you can add it yourself
Matrix is implemented using the `eigen3 library <https://eigen.tuxfamily.org>`_
which contains a large collection of routines for sparse, banded, and full matrices.
Many of the useful routines have not been interfaced with the hoc
interpreter but can be easily added on request or you can add it yourself
by analogy with the code in ``nrn/src/ivoc/(matrix.c ocmatrix.[ch])``
At this time the MFULL matrix type is complete enough to do useful work
and MSPARSE can be used to multiply a matrix by a vector and solve
Expand Down
4 changes: 0 additions & 4 deletions src/ivoc/matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,6 @@ static Object** m_muls(void* v) {
if (ifarg(2)) {
out = matrix_arg(2);
}
// I believe meschach does this for us
// if (out != m) {
// out->resize(...
// }
m->muls(*getarg(1), out);
return temp_objvar(out);
}
Expand Down
7 changes: 0 additions & 7 deletions src/nrniv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ set(NRN_INCLUDE_DIRS
${PROJECT_SOURCE_DIR}/external/Random123/include
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/src/gnu
${PROJECT_SOURCE_DIR}/src/mesch
${PROJECT_SOURCE_DIR}/src/nrncvode
${PROJECT_SOURCE_DIR}/src/nrnmpi
${PROJECT_SOURCE_DIR}/src/nrnpython
Expand Down Expand Up @@ -327,12 +326,6 @@ if(NRN_USE_BACKWARD)
endif()

if(NRN_HAVE_NVHPC_COMPILER)
# NVHPC/21.7 cannot compile znorm.c with -O2 or above. See also:
# https://forums.developer.nvidia.com/t/nvc-21-7-regression-internal-compiler-error-can-only-coerce-indirect-args/184847
if(${CMAKE_CXX_COMPILER_VERSION} VERSION_EQUAL 21.7)
set_source_files_properties(${PROJECT_SOURCE_DIR}/src/mesch/znorm.c PROPERTIES COMPILE_OPTIONS
-Mnovect)
endif()
# For NVHPC we will rely on FE exceptions as opposed to errno in order to make use of faster
# builtins. One caveat is that if we use an optimization level greater than -O1, the FE exception
# is not raised. See https://github.com/neuronsimulator/nrn/pull/1930
Expand Down
1 change: 0 additions & 1 deletion src/nrnpython/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ if(NRN_ENABLE_PYTHON_DYNAMIC)
../ivoc
../nrniv
../gnu
../mesch
../nrnmpi
${PROJECT_BINARY_DIR}/src/nrnpython
${PROJECT_BINARY_DIR}/src/ivos
Expand Down
Loading