Page MenuHomec4science

sgeCoat.py
No OneTemporary

File Metadata

Created
Wed, Jun 19, 20:00

sgeCoat.py

#!/usr/bin/env python
import run
import os,stat
import subprocess
import re
import socket
def launch(run,base,truerun):
_exec = run.getExecFile()
head = \
"""#!/bin/bash
#$ -S /bin/sh
#$ -cwd
#$ -j y
#$ -m eas -M guillaume.anciaux@epfl.ch
#$ -l walltime=200:00:00
"""
run["state"] = "SGE submit"
base.update(run)
sge_head_name = "#$ -N " + str(run.id) + "-" + run["run_name"] + "\n"
sge_head_name = sge_head_name.replace(":","_")
head += sge_head_name
nproc = run["nproc"]
if (nproc % 12 == 0):
head += "#$ -pe orte12 " + str(nproc) + "\n"
if (nproc % 8 == 0):
head += "#$ -pe orte8 " + str(nproc) + "\n"
if (socket.gethostname() == "lsmscluster1"):
head += "module load libqview"
_exec["file"] = head + _exec["file"]
f = open(_exec["filename"], 'w')
f.write(_exec["file"])
f.close()
# os.chmod(_exec["filename"], stat.S_IRWXU)
print ("execute qsub ./" + _exec["filename"])
print ("in dir ")
subprocess.call("pwd")
if (truerun == True):
ret = subprocess.call("qsub " + _exec["filename"],shell=True)

Event Timeline