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

Reduce warnings nrniv #3157

Open
wants to merge 3 commits into
base: cornu/reduce_warnings
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
20 changes: 0 additions & 20 deletions src/nrniv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -414,26 +414,6 @@ endif()
if(NRN_ENABLE_THREADS)
target_link_libraries(nrniv_lib Threads::Threads)
endif()

if(${NRN_ENABLE_DIGEST})
if(NRN_MACOS_BUILD)
# where to get openssl/sha.h after brew install openssl
set_property(
SOURCE ${NRN_OC_SRC_DIR}/debug.cpp
APPEND
PROPERTY INCLUDE_DIRECTORIES /opt/homebrew/Cellar/openssl@3/3.1.0/include)
find_library(LIB_CRYPTO crypto PATHS /opt/homebrew/Cellar/openssl@3/3.1.0/lib REQUIRED)
target_link_libraries(nrniv_lib ${LIB_CRYPTO})
else()
target_link_libraries(nrniv_lib crypto)
endif()
endif()

if(${NRN_ENABLE_ARCH_INDEP_EXP_POW})
find_library(LIB_MPFR mpfr REQUIRED)
target_link_libraries(nrniv_lib ${LIB_MPFR})
endif()

alkino marked this conversation as resolved.
Show resolved Hide resolved
if(NRN_WINDOWS_BUILD)
target_link_libraries(nrniv_lib ${TERMCAP_LIBRARIES} ${Readline_LIBRARY})
else()
Expand Down
3 changes: 0 additions & 3 deletions src/nrniv/kschan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,6 @@ void KSChan::update_prop() {
Symbol* gsym = rlsym_->u.ppsym[soffset_ - 2];
Symbol* isym = rlsym_->u.ppsym[soffset_ - 1];
Symbol* esym = ion_sym_ ? NULL : rlsym_->u.ppsym[gmaxoffset_ + 1];
int old_gmaxoffset = gmaxoffset_;
int old_soffset = soffset_;
int old_svarn = rlsym_->s_varn;

Expand Down Expand Up @@ -2183,7 +2182,6 @@ void KSChan::fillmat(double v, Datum* pd) {
void KSChan::mat_dt(double dt, Memb_list* ml, std::size_t instance, std::size_t offset) {
// y' = m*y this part add the dt for the form ynew/dt - yold/dt =m*ynew
// the matrix ends up as (m-1/dt)ynew = -1/dt*yold
int i;
double dt1 = -1. / dt;
for (int i = 0; i < nksstate_; ++i) {
*(diag_[i]) += dt1;
Expand Down Expand Up @@ -2422,7 +2420,6 @@ void KSChan::ion_consist() {
for (i = iligtrans_; i < ntrans_; ++i) {
trans_[i].lig2pd(poff);
}
int ppsize = poff + 2 * nligand_;
// ForAllSections(sec)
ITERATE(qsec, section_list) {
Section* sec = hocSEC(qsec);
Expand Down
2 changes: 0 additions & 2 deletions src/nrniv/kssingle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ void KSSingleNodeData::pr(const char* s, double tt, NetCvode* nc) {

void KSSingle::state(Node* nd, Datum* pd, NrnThread* nt) {
// integrate from t-dt to t
int i;
double v = NODEV(nd);
auto* snd = pd[sndindex_].get<KSSingleNodeData*>();
// if truly single channel, as opposed to N single channels
Expand All @@ -254,7 +253,6 @@ void KSSingle::state(Node* nd, Datum* pd, NrnThread* nt) {
void KSSingle::cv_update(Node* nd, Datum* pd, NrnThread* nt) {
// if v changed then need to move the outstanding
// single channel event time to a recalculated time
int i;
double v = NODEV(nd);
auto* snd = pd[sndindex_].get<KSSingleNodeData*>();
if (uses_ligands_ || !vsame(v, snd->vlast_)) {
Expand Down
6 changes: 5 additions & 1 deletion src/nrniv/multisend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,12 @@ void nrn_multisend_receive(NrnThread* nt) {
assert(nt == nrn_threads);
TBUF
double w2;
int ncons = 0;
int& s = multisend_receive_buffer[current_rbuf]->nsend_;
int& r = multisend_receive_buffer[current_rbuf]->nrecv_;
double w1 = nrnmpi_wtime();
#if TBUFSIZE
int ncons = 0;
#endif
if (use_multisend_) {
nrn_multisend_advance();
TBUF
Expand All @@ -489,7 +491,9 @@ void nrn_multisend_receive(NrnThread* nt) {
TBUF
while (nrnmpi_multisend_conserve(s, r) != 0) {
nrn_multisend_advance();
#if TBUFSIZE
++ncons;
#endif
}
TBUF
}
Expand Down
7 changes: 0 additions & 7 deletions src/nrniv/netpar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,6 @@ static int weightcnt(NetCon* nc) {
size_t nrncore_netpar_bytes() {
size_t ntot, nin, nout, nnet, nweight;
ntot = nin = nout = nnet = nweight = 0;
size_t npnt = 0;
if (0 && nrnmpi_myid == 0) {
printf("size Presyn=%ld NetCon=%ld Point_process=%ld Prop=%ld\n",
sizeof(PreSyn),
Expand All @@ -1611,9 +1610,6 @@ size_t nrncore_netpar_bytes() {
nnet += n;
for (auto nc: ps->dil_) {
nweight += weightcnt(nc);
if (nc->target_) {
npnt += 1;
}
}
}
}
Expand All @@ -1626,9 +1622,6 @@ size_t nrncore_netpar_bytes() {
nnet += n;
for (auto nc: ps->dil_) {
nweight += weightcnt(nc);
if (nc->target_) {
npnt += 1;
}
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/nrniv/nmodlrandom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,12 @@ static void nmodlrandom_destruct(void* v) {
}

void NMODLRandom_reg() {
class2oc(
"NMODLRandom", nmodlrandom_cons, nmodlrandom_destruct, members, retobj_members, nullptr);
class2oc("NMODLRandom",
nmodlrandom_cons,
nmodlrandom_destruct,
members,
retobj_members,
nullptr);
if (!nmodlrandom_sym) {
nmodlrandom_sym = hoc_lookup("NMODLRandom");
assert(nmodlrandom_sym);
Expand Down
1 change: 0 additions & 1 deletion src/nrniv/nonlinz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ void NonLinImpRep::dsds() {
// store element and restore s
// fill the ds/dv elements
for (in = 0; in < ml->nodecount; ++in) {
Node* nd = ml->nodelist[in];
ks = ieq + in * cnt + kks;
for (is = ieq + in * cnt, iis = 0; iis < cnt; ++iis, ++is) {
double ds = (*pvdot_[is] - v_[is].imag()) / deltavec_[is];
Expand Down
11 changes: 0 additions & 11 deletions src/nrniv/nrncore_write/data/cell_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ void CellGroup::mk_cellgroups(neuron::model_sorted_token const& cache_token, Cel
void CellGroup::datumtransform(CellGroup* cgs) {
// ions, area, and POINTER to v or mechanism data.
for (int ith = 0; ith < nrn_nthread; ++ith) {
NrnThread& nt = nrn_threads[ith];
CellGroup& cg = cgs[ith];
// how many mechanisms in use and how many DatumIndices do we need.
MlWithArt& mla = cgs[ith].mlwithart;
Expand Down Expand Up @@ -246,7 +245,6 @@ void CellGroup::datumtransform(CellGroup* cgs) {

void CellGroup::datumindex_fill(int ith, CellGroup& cg, DatumIndices& di, Memb_list* ml) {
NrnThread& nt = nrn_threads[ith];
int nnode = nt.end;
int mcnt = ml->nodecount;
int dsize = bbcore_dparam_size[di.type];
if (dsize == 0) {
Expand Down Expand Up @@ -553,33 +551,24 @@ size_t CellGroup::get_mla_rankbytes(CellGroup* cellgroups_) {
size_t mla_rankbytes = 0;
size_t nbytes;
NrnThread* nt;
NrnThreadMembList* tml;
FOR_THREADS(nt) {
size_t threadbytes = 0;
size_t npnt = 0;
size_t nart = 0;
int ith = nt->id;
nbytes = nt->end * (1 * sizeof(int) + 3 * sizeof(double));
threadbytes += nbytes;

int mechcnt = 0;
size_t mechcnt_instances = 0;
MlWithArt& mla = cellgroups_[ith].mlwithart;
for (size_t i = 0; i < mla.size(); ++i) {
int type = mla[i].first;
Memb_list* ml = mla[i].second;
++mechcnt;
mechcnt_instances += ml->nodecount;
npnt += (memb_func[type].is_point ? ml->nodecount : 0);
int psize = nrn_prop_param_size_[type];
int dpsize = nrn_prop_dparam_size_[type]; // includes cvodeieq if present
// printf("%d %s ispnt %d cnt %d psize %d dpsize %d\n",tml->index,
// memb_func[type].sym->name, memb_func[type].is_point, ml->nodecount, psize, dpsize);
// nodeindices, data, pdata + pnt with prop
int notart = nrn_is_artificial_[type] ? 0 : 1;
if (nrn_is_artificial_[type]) {
nart += ml->nodecount;
}
nbytes = ml->nodecount *
(notart * sizeof(int) + 1 * sizeof(double*) + 1 * sizeof(Datum*) +
psize * sizeof(double) + dpsize * sizeof(Datum));
Expand Down
1 change: 0 additions & 1 deletion src/nrniv/nrncore_write/utils/nrncore_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ int nrn_dblpntr2nrncore(neuron::container::data_handle<double> dh,
NrnThread& nt,
int& type,
int& index) {
int nnode = nt.end;
type = 0;
if (dh.refers_to<neuron::container::Node::field::Voltage>(neuron::model().node_data())) {
auto const cache_token = nrn_ensure_model_data_are_sorted();
Expand Down
4 changes: 2 additions & 2 deletions src/nrniv/nrnmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ static void point_menu(Object* ob, int make_label) {
deflt = false;
}
if (is_array(*vsym)) {
Arrayinfo* a = vsym->arayinfo;
for (m = 0; m < vsym->arayinfo->sub[0]; m++) {
if (m > 5)
break;
Expand Down Expand Up @@ -1129,7 +1128,8 @@ static Member_ret_obj_func mt_retobj_members[] = {{"pp_begin", mt_pp_begin},
{0, 0}};
static Member_ret_str_func mt_retstr_func[] = {{"code", mt_code}, {"file", mt_file}, {0, 0}};
void MechanismType_reg() {
class2oc("MechanismType", mt_cons, mt_destruct, mt_members, mt_retobj_members, mt_retstr_func);
class2oc(
"MechanismType", mt_cons, mt_destruct, mt_members, mt_retobj_members, mt_retstr_func);
mt_class_sym_ = hoc_lookup("MechanismType");
}

Expand Down
6 changes: 1 addition & 5 deletions src/nrniv/nvector_nrnparallel_ld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,7 @@ void N_VDestroy_NrnParallelLD(N_Vector v) {
}

void N_VSpace_NrnParallelLD(N_Vector v, long int* lrw, long int* liw) {
MPI_Comm comm;
int npes;

comm = NV_COMM_P_LD(v);
npes = nrnmpi_numprocs;
int npes = nrnmpi_numprocs;

*lrw = NV_GLOBLENGTH_P_LD(v);
*liw = 2 * npes;
Expand Down
13 changes: 0 additions & 13 deletions src/nrniv/nvector_nrnthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ N_Vector N_VNew_NrnThread(long int length, int nthread, long int* sizes) {
int i;
N_Vector v;
N_Vector data;
N_VectorContent_NrnThread* content;

v = N_VNewEmpty_NrnThread(length, nthread, sizes);
if (v == NULL)
Expand Down Expand Up @@ -396,9 +395,6 @@ void N_VPrint_NrnThread(N_Vector x) {
printf("\n");
}

static void pr(N_Vector x) {
N_VPrint_NrnThread(x);
}
alkino marked this conversation as resolved.
Show resolved Hide resolved
/*
* -----------------------------------------------------------------
* implementation of vector operations
Expand Down Expand Up @@ -696,10 +692,8 @@ static void* vwl2norm(NrnThread* nt) {
return nullptr;
}
realtype N_VWL2Norm_NrnThread(N_Vector x, N_Vector w) {
long int N;
retval = ZERO;
xpass wpass nrn_multithread_job(vwl2norm);
N = NV_LENGTH_NT(x);
mydebug2("vwl2norm %.20g\n", RSqrt(retval));
return (RSqrt(retval));
}
Expand Down Expand Up @@ -769,13 +763,6 @@ booleantype N_VConstrMask_NrnThread(N_Vector y, N_Vector x, N_Vector z) {
return (bretval);
}

static void* vminquotient(NrnThread* nt) {
realtype min;
int i = nt->id;
min = N_VMinQuotient_Serial(xarg(i), yarg(i));
lockmin(min);
return nullptr;
}
alkino marked this conversation as resolved.
Show resolved Hide resolved
realtype N_VMinQuotient_NrnThread(N_Vector x, N_Vector y) /* num, denom */
{
retval = BIG_REAL;
Expand Down
13 changes: 0 additions & 13 deletions src/nrniv/nvector_nrnthread_ld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ N_Vector N_VNew_NrnThreadLD(long int length, int nthread, long int* sizes) {
int i;
N_Vector v;
N_Vector data;
N_VectorContent_NrnThreadLD* content;

v = N_VNewEmpty_NrnThreadLD(length, nthread, sizes);
if (v == NULL)
Expand Down Expand Up @@ -396,9 +395,6 @@ void N_VPrint_NrnThreadLD(N_Vector x) {
printf("\n");
}

static void pr(N_Vector x) {
N_VPrint_NrnThreadLD(x);
}
alkino marked this conversation as resolved.
Show resolved Hide resolved
/*
* -----------------------------------------------------------------
* implementation of vector operations
Expand Down Expand Up @@ -707,10 +703,8 @@ static void* vwl2norm(NrnThread* nt) {
return nullptr;
}
realtype N_VWL2Norm_NrnThreadLD(N_Vector x, N_Vector w) {
long int N;
retval = ZERO;
xpass wpass nrn_multithread_job(vwl2norm);
N = NV_LENGTH_NT_LD(x);
mydebug2("vwl2norm %.20g\n", RSqrt(retval));
return (RSqrt(retval));
}
Expand Down Expand Up @@ -780,13 +774,6 @@ booleantype N_VConstrMask_NrnThreadLD(N_Vector y, N_Vector x, N_Vector z) {
return (bretval);
}

static void* vminquotient(NrnThread* nt) {
realtype min;
int i = nt->id;
min = N_VMinQuotient_Serial(xarg(i), yarg(i));
lockmin(min);
return nullptr;
}
alkino marked this conversation as resolved.
Show resolved Hide resolved
realtype N_VMinQuotient_NrnThreadLD(N_Vector x, N_Vector y) /* num, denom */
{
retval = BIG_REAL;
Expand Down
5 changes: 0 additions & 5 deletions src/nrniv/secbrows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ SectionBrowserImpl::SectionBrowserImpl() {
scnt_ = 0;
// ForAllSections(sec) //{
ITERATE(qsec, section_list) {
Section* sec = hocSEC(qsec);
++scnt_;
}
psec_ = new Section*[scnt_];
Expand All @@ -390,8 +389,6 @@ SectionBrowserImpl::~SectionBrowserImpl() {

SectionBrowser::SectionBrowser()
: OcBrowser(new BrowserAccept(this), NULL) {
LayoutKit& lk = *LayoutKit::instance();
WidgetKit& wk = *WidgetKit::instance();
sbi_ = new SectionBrowserImpl;
for (int i = 0; i < sbi_->scnt_; ++i) {
append_item(secname(sbi_->psec_[i]));
Expand Down Expand Up @@ -436,7 +433,6 @@ void SectionBrowser::select(GlyphIndex i) {

void SectionBrowser::make_section_browser() {
LayoutKit& lk = *LayoutKit::instance();
WidgetKit& wk = *WidgetKit::instance();
SectionBrowser* sb = new SectionBrowser();
Window* w = new StandardWindow(lk.hbox(sb->standard_glyph(),
lk.hspace(5),
Expand Down Expand Up @@ -492,7 +488,6 @@ PointProcessBrowser::~PointProcessBrowser() {

void PointProcessBrowser::make_point_process_browser(OcList* ocl) {
LayoutKit& lk = *LayoutKit::instance();
WidgetKit& wk = *WidgetKit::instance();
PointProcessBrowser* ppb = new PointProcessBrowser(ocl);
SectionBrowser* sb = new SectionBrowser();
Window* w = new StandardWindow(
Expand Down
Loading