How can one run a prologue script as root in gridengine?
The prolog script can actually be run as any user.
From man queue_conf
:
prolog
The executable path of a shell script that is started before execution of Grid Engine jobs with the same environment set- ting as that for the Grid Engine jobs to be started afterwards. An optional prefix "user@" specifies the user under which this procedure is to be started.
So setting prolog root@/path/to/prolog
should have it execute as root.