Gpt multithreading


#1

Hi,

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!


Reprojecting S3 OLCI consumes insane amount of memory - on some scenes
#2

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.


#3

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

#4

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


#5

Thank you, Marco.

++ Ian


#6

Thank you Marco.

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

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

#7

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,

Stan


#8

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.


#9

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