Ejemplo n.º 1
0
void lis_vector_set_values_f(LIS_INT *flag, LIS_INT *count, LIS_INT *index, LIS_SCALAR *values, LIS_VECTOR_F *v, LIS_INT *ierr)
{
	LIS_DEBUG_FUNC_IN;

	*ierr = lis_vector_set_values(*flag,*count,index,values,((LIS_VECTOR)LIS_V2P(v)));
	if( *ierr )	return;

	LIS_DEBUG_FUNC_OUT;
	return;
}
void LisMPIDiscreteVector::finishUpdate()
{
    int err = 0;
    // push
    //std::cout << _local_id << ": set values" << std::endl;
    //err = lis_vector_set_values2(LIS_INS_VALUE, _i_start, _local_n, &_data[0], _v);
    err = lis_vector_set_values(LIS_INS_VALUE, _local_n, &_list_index[0], &_data[0], _v);
    CHKERR(err);
    // pull
    if (_exist_any_ghost_global) {
        //std::cout << _local_id << ": get ghost values" << std::endl;
        err = lis_vector_gather(_v, &_temp_all_x[0]);
        CHKERR(err);
        for (size_t i=0; i<_ghost_id.size(); i++) {
            const int ghost_id = _ghost_id[i];
            //std::cout << _local_id << ": ghost_id=" << ghost_id << ", local id=" << access(ghost_id) << std::endl;
            _data[access(ghost_id)] = _temp_all_x[ghost_id];
            //err = lis_vector_get_value(_v, ghost_id, &_data[access(ghost_id)]);
        }
        CHKERR(err);
    }
}