Satra and Brendan,
Thanks for the responses. I confirmed that, at least in our environment, the only perceived effect of the -V directive is to include environment variables that are defined after login. -b y (implicit or not) still pulls in the login environment. Since I do not change the environment after login, this has no effect for me. As Brendan notes, -b n will fail if the submitted command is not a real path. However, Nipype only submits the shell script that it builds, which in turn runs the interface, which in turn calls the wrapped command, e.g. fslmaths. Thus, the -b setting should have no effect on execution in my case. Therefore, the observed error remains a mystery. I moved past the error and can't reproduce it in a simpler example, so I will chalk it up to a transitory aberration.
The upshot is that AFAIK the -b flag is irrelevant except in the following situations:
- an environment variable or alias is set after login which changes the path resolution
- the user sets the Nipype node plugin_args template to include additional directives
Nipype already validates that a command is on the path in CommandLine._run_interface, but doesn't use the path in the command. (As an aside, this validation will incorrectly fail if the command is defined by an alias).
I suggest the following, as a low priority:
- Nipype remove the -S and -V directives in the batch script, since they have limited and uncertain effect.
- Nipype neither assume that the site's SGE has a vanilla setup nor set the -b n option.
- Add an SGE example to the documentation that defines a plugin_args template with directives. The example should include a note that if the user site has changed the SGE default behavior to -b y, then the plugin_args should include the -b n option.
The Nipype submission should exactly reflect a standard qsub submission in the user's environment. If the user needs to add an SGE option or embed a directive, then the user should set the plugin_args.
I find embedded SGE directives too much magic for my taste, and consider it a best practice to avoid them when possible.
Fred