non_sbgrid_apps

Calling SBGrid Programs from other Applications

In most cases, it is relatively straightforward to use SBGrid Programs from non-SBGrid applications. Using topaz,(developer's link) as an example, create an adapter/wrapper script:


#!/usr/bin/env bash

# activate the environment, so that it doesn't need to be always enabled under the user account running the non-SBGrid program.
source /programs/sbgrid.shrc

# Optionally, specify the SBGrid version of the title.
# Explict version configuration can help troubleshooting integration issues.
export TOPAZ_X=0.2.5a_cu11.3_py36

# call the executable with original arguments
topaz "$@"

make this script executable (for example, chmod +x topaz_adapter.bash, place it somewhere readable to (and exectuable by) the external program, and use the full path to the script (for example, /programs/local/adapter_scripts/topaz_adapter.bash) in configuring the non-SBGrid program.

Common Problems/Sub-optimal Approaches

  1. Using the output of which topaz (/programs/x86_64-linux/system/sbgrid_bin/topaz); this requires the SBgrid environment to be persistently active in the environment/user account of the other program, and makes it ambigious which version is being used.
  2. Using the output of sbwhich topaz (/programs/x86_64-linux/topaz/0.2.5a_cu11.3_py36/topaz_extlib/envs/topaz-py3.6/bin/topaz); this may work, but will miss capsule initialization, which may cause avoidable job failures.

Less Common Problems

  1. The above approach will work for executable calls. It will not usually work for cases where the other program is using the executable path to find library paths to import into a non-SBGrid interpreter or process memory space. If you encounter a case like this (or encounter other problems), please feel free to contact us at bugs@sbgrid.org.