Gpt produces undesired target file when write is included in graph

~All my gpt graphs produce target files, even though they all include the write operator. This has been an issue in versions 6.x through 7.0. Below is a simple example of a graph processed with the command: “gpt graph.xml”, that produces the write operator output file as well as target.dim and target.data.
image

Should we use: “gpt graph.xml -t outfile” and abandon the write operator?
What is the overhead associated with writing both the target file and the write operator file? Just I/O and storage?

It’s recommended that your graph to be in this sequence,

Read —> Remove-GRD-Border-Noise—>Apply-Orbit—>Write

The simple way to call the gpt is, to navigate to the folder where your *xml file is saved, and then simply call it in this way,

gpt graph.xml

For more information about GB, please visit this link, Bulk Processing with GPT

Source: https://senbox.atlassian.net/wiki/spaces/SNAP/pages/70503475/Bulk+Processing+with+GPT

The order of Apply-Orbit-File does not have any bearing here and probably does not make any difference. The issue is that GPT creates a target file even though there is a write operator on the graph.

From my point of view it make sense of the results, I’m always using the sequence I mentioned in my previous post.

Did you mean it creates, Or doesn’t create a target file, within and without “Write Operator”?

Yes, target file is created with (and without) the write operator.

FYI: I believe that Apply-Orbit-File and Remove-GRD-Border-Noise are completely independent, and can be applied in any order.

But within Write operator, simply you could save the result in the preferred folder, and without WriteO. the result will be anywhere in your machine,

The real issue is that target file should not be created if there is a write operator on the graph.
Without the write operator, it may be possible to specify the path and file using -t:
gpt graph.xml -t $directory/$file

I’m not sure if this A bug, might be others (Developers) could give clue about this issue,

Should we use: “gpt graph.xml -t outfile” and abandon the write operator?
@jun_lu

Using the -t outfille does not work since that is not the output needed. That output is from an intermediate step. So we still need to eliminate this and just preserve the output from the write operation.

SOLVED!
If the write node is not the last node in the graph XML file, GPT will create a target file with data from the last node. The write node may be the last node in the Model Builder display. However that does not guarantee it will be the last in the XML file. This can occur if intermediate steps are added to the model. (Specifically this occurred after adding a Subset node)

The Write node must be the last node in the XML to avoid creation of undesired target files: target.data, target.dim.

2 Likes

thank you for reporting - this will surely help others to avoid this issue.