Maybe it does not change too much, but you can extract the gsim as soon as you loop over sources because ruptures have same tectonic region type of a source