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 nrncvode #3158

Open
wants to merge 2 commits into
base: cornu/reduce_warnings
Choose a base branch
from
Open
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
2 changes: 0 additions & 2 deletions src/nrncvode/cvodestb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ void nrn_record_init();
void nrn_play_init();
void fixed_play_continuous(NrnThread* nt);
void nrn_solver_prepare();
static void check_thresh(NrnThread*);

// for fixed step thread
void deliver_net_events(NrnThread* nt) {
int i;
if (net_cvode_instance) {
net_cvode_instance->check_thresh(nt);
net_cvode_instance->deliver_net_events(nt);
Expand Down
4 changes: 1 addition & 3 deletions src/nrncvode/netcvode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,6 @@ void NetCvode::del_cv_memb_list(Cvode* cvode) {
void CvodeThreadData::delete_memb_list(CvMembList* cmlist) {
CvMembList *cml, *cmlnext;
for (cml = cmlist; cml; cml = cmlnext) {
auto const& ml = cml->ml;
cmlnext = cml->next;
for (auto& ml: cml->ml) {
delete[] std::exchange(ml.nodelist, nullptr);
Expand Down Expand Up @@ -3065,8 +3064,7 @@ void PreSyn::deliver(double tt, NetCvode* ns, NrnThread* nt) {
TQItem* q = ns->p[i].tq_->least();
Cvode* cv = (Cvode*) q->data_;
if (tt < cv->t_) {
int err = NVI_SUCCESS;
err = cv->handle_step(nrn_ensure_model_data_are_sorted(), ns, tt);
cv->handle_step(nrn_ensure_model_data_are_sorted(), ns, tt);
Copy link
Member Author

Choose a reason for hiding this comment

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

We should write an error message here. Is anyone able to tell me what we should write?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't seem like something a user could do anything about if they encountered it. Therefore, something semi generic would be sufficient?

"warning: cv->handle_step failed with err = {err}"

Not sure it fits the theme of removing unused variables.

ns->p[i].tq_->move_least(cv->t_);
}
}
Expand Down
23 changes: 12 additions & 11 deletions src/nrncvode/nrndaspk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,24 +204,25 @@ static void do_ode_thread(neuron::model_sorted_token const& sorted_token, NrnThr
}
}

#if 0
static double check(double t, Daspk* ida) {
res_gvardt(t, ida->cv_->y_, ida->yp_, ida->delta_, ida->cv_);
double norm = N_VWrmsNorm(ida->delta_, ((IDAMem) (ida->mem_))->ida_ewt);
Printf("ida check t=%.15g norm=%g\n", t, norm);
#if 0
for (int i=0; i < ida->cv_->neq_; ++i) {
printf(" %3d %22.15g %22.15g %22.15g\n", i,
for (int i=0; i < ida->cv_->neq_; ++i) {
printf(" %3d %22.15g %22.15g %22.15g\n", i,
N_VGetArrayPointer(ida->cv_->y_)[i],
N_VGetArrayPointer(ida->yp_)[i],
N_VGetArrayPointer(ida->delta_)[i]);
}
}
#endif
return norm;
}
#endif

int Daspk::init() {
extern double t;
int i;
#if 0
printf("Daspk_init t_=%20.12g t-t_=%g t0_-t_=%g\n",
cv_->t_, t-cv_->t_, cv_->t0_-cv_->t_);
Expand Down Expand Up @@ -301,7 +302,7 @@ cv_->t_, t-cv_->t_, cv_->t0_-cv_->t_);
break;
}
#if 0
for (i=0; i < cv_->neq_; ++i) {
for (int i=0; i < cv_->neq_; ++i) {
printf(" %d %g %g %g %g\n", i, nt_t, N_VGetArrayPointer(cv_->y_)[i], N_VGetArrayPointer(yp_)[i], N_VGetArrayPointer(delta_)[i]);
}
#endif
Expand Down Expand Up @@ -449,10 +450,8 @@ void Cvode::daspk_gather_y(double* y, int tid) {
int Cvode::res(double tt, double* y, double* yprime, double* delta, NrnThread* nt) {
CvodeThreadData& z = ctd_[nt->id];
++f_calls_;
static int res_;
int i;
nt->_t = tt;
res_++;

#if 0
printf("Cvode::res enter tt=%g\n", tt);
Expand Down Expand Up @@ -482,10 +481,12 @@ for (i=0; i < z.nvsize_; ++i) {
// subtract yp from mechanism state delta's

#if 0
printf("Cvode::res after ode and gather_ydot into delta\n");
for (i=0; i < z.nvsize_; ++i) {
printf(" %d %g %g %g\n", i, y[i], yprime[i], delta[i]);
}
static int res_ = 0;
++res_;
Comment on lines +484 to +485
Copy link
Collaborator

Choose a reason for hiding this comment

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

isn't it still unused?

printf("Cvode::res after ode and gather_ydot into delta\n");
for (i=0; i < z.nvsize_; ++i) {
printf(" %d %g %g %g\n", i, y[i], yprime[i], delta[i]);
}
#endif
// the cap nodes : see nrnoc/capac.cpp for location of cm, etc.
// these are not in same order as for cvode but are in
Expand Down