← Back to team overview

yade-users team mailing list archive

[Question #667546]: The yade won't print anything until the python script is all finished in slurm command

 

New question #667546 on Yade:
https://answers.launchpad.net/yade/+question/667546

Hi everyone! I'm using the HPC to run yade with the operation system of centos. You have to submit your job via the slurm [1] system. So here is the problem:
when you use "yade sth.py" command, it will print the information that you use "print "sth" " command in your python script line by line.
And in hpc, however you need to create another script like "a.sbatch" which writes:

#!/bin/bash
#SBATCH -c 8 -p hpxg -t 100 
yade -j 8 gravity.py 

Then you can type "sbatch a.sbatch" to submit your job. And when you do this, all printed informations will only show up when all of your python script is finished. I.e., for the gravity.py:

from yade import pack
import time
print 1
O.bodies.append(geom.facetBox((.5,.5,.5),(.5,.5,.5),wallMask=31))
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),rMean=.01,rRelFuzz=.5)
sp.toSimulation()
print len(O.bodies)
O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
	InteractionLoop([Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys()],
		[Law2_ScGeom_FrictPhys_CundallStrack()]
	),
	NewtonIntegrator(gravity=(0,0,-9.81),damping=0.1),
	VTKRecorder(fileName='/data/pqji/yade-run/gravity-',recorders=['all'],label='vvtk',iterPeriod=200),
	PyRunner(command='checkUnbalanced()', iterPeriod=1000)
]
O.dt=.5*PWaveTimeStep()
print O.dt
def checkUnbalanced():
	print "unbalance force is %s" % unbalancedForce()
	if unbalancedForce()<.0001:
		print "Finish"
		O.pause()
O.run(wait=True)  #
time.sleep(1)         # I have to add this line so the slurm won't kill my job, as if this line is not added,  the ipython line will show up and the slurm will think my job has finished.(At least I guess)

All informtions that should be printed show up until time.sleep(1) is excuated. Before that, the output log of slurm (similar like the output window when you use the yade sth.py command) is just:

TCP python prompt on localhost:9000, auth cookie `sdkaue'
Welcome to Yade 2018.02b 
XMLRPC info provider on http://localhost:21000
Running script gravity.py

Nothing showup but the VTK files are being created, which means the simulations are running.
Any instructions?

[1]https://slurm.schedmd.com/

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.