added a hacky and experimental mapG that analyses the body of the local computation to derive the numbers of threads to use