@@ -546,7 +546,24 @@ def submit(self, script_location):
546546 SUBMIT THE CALCULATION
547547 ======================
548548
549- Submit the calculation
549+ Submit the calculation. Compose the command into a cmd variable, then submit it through:
550+
551+ .. code ::
552+
553+ return self.ExecuteCMD(cmd, False)
554+
555+
556+
557+ Parameters
558+ ----------
559+ script_localtion : string
560+ Path to the submission script inside the cluster.
561+
562+ Results
563+ -------
564+ success : bool
565+ Result of the execution of the submission command.
566+ It is what returned from self.ExecuteCMD(cmd, False)
550567 """
551568
552569 cmd = "{ssh} {host} '{submit_cmd} {script}'"
@@ -557,7 +574,10 @@ def submit(self, script_location):
557574 cmd = cmd .format (ssh = self .sshcmd , host = self .hostname ,
558575 submit_cmd = self .submit_name , script = script_location )
559576
560- return cmd
577+ #cmd = self.sshcmd + " %s '%s %s/%s.sh'" % (self.hostname, self.submit_command,
578+ # self.workdir, label+ "_" + str(indices[0]))
579+ cp_res = self .ExecuteCMD (cmd , False )
580+ return cp_res
561581
562582
563583 def batch_submission (self , list_of_structures , calc , indices ,
@@ -658,9 +678,9 @@ def batch_submission(self, list_of_structures, calc, indices,
658678
659679
660680 # Run the simulation
661- cmd = self .sshcmd + " %s '%s %s/%s.sh'" % ( self . hostname , self . submit_command ,
662- self .workdir , label + "_" + str ( indices [ 0 ]) )
663- cp_res = self . ExecuteCMD ( cmd , False )
681+ sub_script_loc = os . path . join ( self .workdir , label + "_" + str ( indices [ 0 ]) + ".sh" )
682+ cp_res = self .submit ( sub_script_loc )
683+
664684# cp_res = os.system(cmd + " > /dev/null")
665685# if cp_res != 0:
666686# print "Error while executing:", cmd
0 commit comments