Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mischmi96
Copy link
Member

adding a fastsum interface for Julia

@mischmi96 mischmi96 added this to the 3.5.1 milestone Jul 3, 2019
@mischmi96 mischmi96 self-assigned this Jul 3, 2019
@michaelquellmalz michaelquellmalz modified the milestones: 3.5.1, 3.5.2 Jul 16, 2019
@mischmi96
Copy link
Member Author

The request can now be properly reviewed.

if ( !(p->y) )
fastsum_init_guru_target_nodes( p, M, nn, m );
else {
fastsum_finalize_target_nodes( p );
Copy link
Member

Choose a reason for hiding this comment

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

This and the following line seem to be superfluous since N, nn, m cannot change in this Julia interface implementation. Moreover if this line is executed after alpha is set (i.e. you use set_x, set_alpha and then set_x again), alpha is quietly deleted.

Copy link
Member Author

Choose a reason for hiding this comment

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

I moved initializing the source and target nodes to the plan initializer.


for ( int k = 0; k < N; k++ )
if ( p -> permutation_x_alpha == NULL )
p -> alpha[k] = alpha[k];
Copy link
Member

Choose a reason for hiding this comment

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

p -> alpha is allocated in fastsum_init_guru_source_nodes, which is called in set_x. So if set_alpha is called before set_x, this means we write on the dangling pointer p -> alpha.

Copy link
Member Author

Choose a reason for hiding this comment

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

This can't happen with the new commit.

}

void jfastsum_finalize( fastsum_plan* p ){
fastsum_finalize_source_nodes( p );
Copy link
Member

Choose a reason for hiding this comment

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

we should check if the source nodes were initialized before calling fastsum_finalize_source_nodes

Copy link
Member Author

Choose a reason for hiding this comment

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

This won't be necessary with the new structure since the finalizer in julia checks if the plan was initialized.

@tvolkmer tvolkmer merged commit 1a85692 into develop Aug 13, 2019
@tvolkmer tvolkmer deleted the feature/julia/fastsum branch August 13, 2019 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants