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:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
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.
Thanks!
I consider this as a bug. The -q option should work.
As a workaround you can try to use the following option: -Dsnap.parallelism=true
or put this option into the snap.properties file which is located in the etc folder of the SNAP installation directory.
Per ${SNAP_INSTALL_DIR}/etc/snap.properties it should probably be -Dsnap.properties=1, 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
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.