#NEWLINE# def prepareSbatch( self , cpu , mem , jobID ) : #NEWLINE# #INDENT# sbatch_line = [ 'sbatch' , '-Q' , '-J' , 'toil_job_{}' . format ( jobID ) ] #NEWLINE# if self . boss . environment : #NEWLINE# #INDENT# for ( k , v ) in self . boss . environment . iteritems ( ) : #NEWLINE# #INDENT# quoted_value = quote ( ( os . environ [ k ] if ( v is None ) else v ) ) #NEWLINE# sbatch_line . append ( '--export={}={}' . format ( k , quoted_value ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( mem is not None ) : #NEWLINE# #INDENT# sbatch_line . append ( '--mem={}' . format ( ( int ( mem ) / ( 2 ** 20 ) ) ) ) #NEWLINE# #UNINDENT# if ( cpu is not None ) : #NEWLINE# #INDENT# sbatch_line . append ( '--cpus-per-task={}' . format ( int ( math . ceil ( cpu ) ) ) ) #NEWLINE# #UNINDENT# return sbatch_line