Gpt multithreading


I am wondering if there is a way to limit the maximum number of threads gpt uses as the -q option currently does not respect this. For example, I set -q 1 however the process is observed to be using 321% CPU (ie 4 cores) in top:

23036 dchowdh+ 20 0 23.091g 609340 24860 S 321.0 0.7 0:22.82 /opt/snap/jre/bin/java -Dinstall4j.jvmDir=/opt/snap/jre -Dexe4j.moduleName=/opt/snap/bin/gpt -Dsnap.mainClass=org.esa.snap.core.gpf.mai+

Any information would be much appreciated.

I consider this as a bug. The -q option should work.

As a workaround you can try to use the following option:
or put this option into the file which is located in the etc folder of the SNAP installation directory.

Per ${SNAP_INSTALL_DIR}/etc/ it should probably be, unless the comment is incorrect:

# number of CPU cores used for image rendering and graph processing
# allow this to default to Runtime.getRuntime().availableProcessors()
#snap.parallelism = 1
1 Like

Of course 1. True doesn’t make much sense here.
Correct is: snap.parallelism = 1

Thank you, Marco.

++ Ian

Thank you Marco.

It appears that neither adding -Dsnap.parallelism=1 nor adding snap.parallelism=1 to the file affects this:

 9645 dchowdh+  20   0 16.805g 363912  21488 S 318.8  0.6   0:10.40 java```
1 Like

Hello Marco,

Do you know if this problem has been fixed ? I don’t get any performances differences when i put parallelism setting in command lines even when I try the solutions you gave before.

Best Regards,


1 Like

Unfortunately, there was no time to work on this. But I still think that the property snap.parallelism = 1 should work.

When calling gpt you could add -Dsnap.parallelism=1 to the command line call.

I also tried that and it had no effect - still spawning dozens of processes.

This issue is still present in SNAP 7.