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

BB-31: Pretty printing #17

Open
mcmillan03 opened this issue Sep 3, 2021 · 2 comments
Open

BB-31: Pretty printing #17

mcmillan03 opened this issue Sep 3, 2021 · 2 comments

Comments

@mcmillan03
Copy link
Member

GxB_Type_fprint print and check a GrB_Type
GxB_UnaryOp_fprint print and check a GrB_UnaryOp
GxB_BinaryOp_fprint print and check a GrB_BinaryOp
GxB_Monoid_fprint print and check a GrB_Monoid
GxB_Semiring_fprint print and check a GrB_Semiring
GxB_Descriptor_fprint print and check a GrB_Descriptor
GxB_Matrix_fprint print and check a GrB_Matrix
GxB_Vector_fprint print and check a GrB_Vector
GxB_fprint print/check any object to a file
GxB_print print/check any object to stdout

These methods do not modify the status of any object. If a matrix or vector has not been completed, the pending computations are guaranteed to {\em not} be performed.

Output is defined by the implementation. Printing nothing is a valid option (like GrB_error).

@tgmattso
Copy link
Collaborator

tgmattso commented Sep 3, 2021

Can we have GrB_fprintf() that takes a valid C format string and a GraphBLAS object and it will output a reasonable implementation defined message to an input file descriptor?

@DrTimothyAldenDavis
Copy link
Member

Tim M: I'm not sure I understand your question. This can't be done with a simple C printf format string.

What I'm asking here is a way for the user to ask the library to print the contents of their matrix, vector, or scalar. This is a common thing when trying to write an algorithm that uses GraphBLAS ... the algo. developer wants to see what the computations did to the matrix.

The alternative is to write a pretty-print in LAGraph, using (say) GrB_Matrix_export. However, this is such a common thing that anyone would want to do with any library, that I think it should be added to the spec.

The output to stdout or a FILE *, would be implementation-defined. If it likes, a library could choose to print nothing at all and still comply with the spec. The purpose of this output is not to be read back in to compute with, but just for reading by the algorithm developer. So printing nothing at all is an option, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants