Closed pramodk closed 5 years ago
Oops..the ca_type is not initialised when mechanism is registered:
/** register channel with the simulator */
void _CaDynamics_DC0_reg() {
setup_global_variables();
int mech_type = nrn_get_mechtype("CaDynamics_DC0");
CaDynamics_DC0_global.mech_type = mech_type;
if (mech_type == -1) {
return;
}
_nrn_layout_reg(mech_type, get_memory_layout());
register_mech(mechanism, nrn_alloc_CaDynamics_DC0, NULL, NULL, nrn_state_CaDynamics_DC0, nrn_init_CaDynamics_DC0, first_pointer_var_index(), 1);
CaDynamics_DC0_global.ca_type = nrn_get_mechtype("ca_ion");
setup_global_variables
should be called after ca_type
is set.
Note : the error about
ml_list
in PRESENT clause was not found on device is still bit puzzle. But this also happens with mod2c generated code even though the code works perfectly fine. Most likely the issue with semantic of array of pointers. Will take care of this later.
Addressed in #146, specifically in the commit 49ea279164edd16ef28c8b1c54c5b1672616d7ca.
Currently CoreNEURON copied membrane list to GPU as:
Some mechanisms kernel use those in compute block as:
this sgfaults whenever
nt->_ml_list[ca_type]
is accessed. If I try to addnt->_ml_list
in present clause as:then we get :
Looking at CPU/GPU pi=pointers using
PGI_ACC_DEBUG=1
tells that the data is present on GPU.I am missing something but it's not clear at the moment :)