[torqueusers] Python submit scripts?

Brock Palen brockp at umich.edu
Wed Jul 9 09:31:01 MDT 2008


Don't know way to old.  We do do this all the time for bulk jobs:

#!/usr/bin/python
from popen2 import popen2

#put all this in a loop or make into a function
output, input = popen2('qsub')
#write inputs
input.write('#PBS -N jobname\n')
input.write('#PBS -M emailpy at umich.edu\n')
input.write('#PBS -m abe\n')
input.write('#PBS -l nodes=2:ppn=2,walltime=24:00\n')
input.write('#just a comment\n')
input.write('echo "I ran on"')
input.write('cat $PBS_NODEFILE')
input.wirte('mpirun -np 4 lmp_fink')

#finish script
input.close()

#end example
#this will be the job id if you want it,
print output.read()

Brock Palen
www.umich.edu/~brockp
Center for Advanced Computing
brockp at umich.edu
(734)936-1985



On Jul 9, 2008, at 10:44 AM, Prentice Bisbal wrote:
> Correction: E-mail below should read as follows:
>
> Is is possible to write job submission scripts in python using
> torque_1.1.0p2? My cluster is old and about to be replaced, so there's
> no point in upgrading now, but I have a user who wrote a submit script
> in Python to work around a bug we found in our antiquated version  
> of torque.
>
> --
> Prentice
>
> Prentice Bisbal wrote:
>> Is is possible to write job submission scripts using  
>> torque_1.1.0p2? My
>> cluster is old and about to be replaced, so there's no point in
>> upgrading now, but I have a user who wrote a submit script in  
>> Python to
>> work around a bug we found in our antiquated version of torque.
>>
> _______________________________________________
> torqueusers mailing list
> torqueusers at supercluster.org
> http://www.supercluster.org/mailman/listinfo/torqueusers
>
>



More information about the torqueusers mailing list