#!/usr/bin/env python# Change first line to point to your python if neededimportsysimportlinecacheif__name__=="__main__":index=os.getenv("SGE_TASK_ID",None)ifindexisNone:sys.exit(1)# or whatever you want to do when it isn't run as an array jobnslots=os.getenv("NSLOTS",None)ifnslotsisnotNone:os.environ['OMP_NUM_THREADS']=nslots# configure parallel environment# If reading parameters from a file, uncomment# param_file = sys.argv[1]# params = linecache.getline(param_file, index).strip()# Rest of script
#!/bin/sh# Change first line to point to your favorite shell if needed# Use environment variable ${SGE_TASK_ID} to grab a line from a parameter filePARAM=$(sed -n "${SGE_TASK_ID}p"$1)# Whatever your script needs to do# cmd $PARAM
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.