unexpected "exit" message when running a yade code on a cluster

Asked by Rioual

Hello,

I have a code in yade which works very well on my local PC.
I want to use it on a cluster where yade has been installed.
When I make it run on line, it works well.
When I send the code on a node with a script (sbatch script),
the code stops at a certain moment with this message in the output file:

....
 [[ ^L clears screen, ^U kills line. F8 plot. ]]

In [1]: Do you really want to exit ([y]/n)?

My question is the following:
- what means In[1] ??
- Why does the yade program want to exit at a certain stage on the cluster whereas
 it works perfectly well on line ??

Thank you for your answer,

Best,

Vincent

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Rioual
Solved:
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hello,
[1] is simply  the message when you hit ctrl+d in a ipython shell.
What's the precise meaning of "on line"?
Did you try running a simple python script?
Did you try running a simple yade script?
If yes, why don't you post the test script?
If not, why not?
Why don't you mention yade version and OS?
Did you check with local IT or slurm/sbatch people (I'm unsure any of the yade people have experience with slurm)?
Bruno

Revision history for this message
Robert Caulk (rcaulk) said :
#2

It is also worth checking the stderr (assuming the cluster is generating one).

Revision history for this message
Rioual (francois-rioual-v) said :
#3

Hello,

Thanks for your suggestions.
I suspect the exit corresponds to the apparition of the qt graphical interface which is automatic in a normal yade script.
How can I disable the qt interface in a script ??

Thanks,

V.

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#4

> How can I disable the qt interface in a script ??

Please read https://yade-dem.org/doc/introduction.html

Bruno

Revision history for this message
Rioual (francois-rioual-v) said :
#5

Hello,

The problem seems to be related to the use of O.run which controls the apparition of the message "In[1]:"(which, with the use of the cluster, is followed by the following statement: "Do you really want to exit ([y]/n)?" and stops the simulation)

See this MWS:

##################################################################################
readParamsFromTable(rMean=1.2,rRelFuzz=.4,maxLoad=1e7,minLoad=1e5)
# make rMean, rRelFuzz, maxLoad accessible directly as variables later
from yade.params.table import *

from yade import pack, plot

## PhysicalParameters
Density=2400
frictionAngle=radians(25)
#tc = 0.001
#en = 0.05
#et = 0.05
tc = 0.01
en = 0.0001
et = 0.0001

sphereMat=O.materials.append(ViscElMat(density=Density,frictionAngle=frictionAngle,tc=tc,en=en,et=et))

###########################################

print 'test0'

sp=pack.SpherePack()
sp.makeCloud((-23,10,-23),(23,310,23),rMean=rMean,rRelFuzz=rRelFuzz)
sp.toSimulation(color=(0,0,1),material=sphereMat)

print 'test1'

O.engines=[
 ForceResetter(),
 # sphere, facet, wall
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),
 InteractionLoop(
  # the loading plate is a wall, we need to handle sphere+sphere, sphere+facet, sphere+wall
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 NewtonIntegrator(gravity=(0,-9.81,0),damping=0.1),
 # the label creates an automatic variable referring to this engine
 # we use it below to change its attributes from the functions called

 PyRunner(command='Poros()',iterPeriod=1,label='por'),
]
O.dt=.5*PWaveTimeStep()

#*******************************************************************************************************************************
def Poros():

 Rcylext=15
 Ycylmax = 110

        dx = (Rcylext-2)/1.414

 por = utils.voxelPorosity(200,(-dx ,4,-dx),(dx,Ycylmax,dx))
 print 'test2'
 print 'tstep=',O.iter,'Porosite=',por

#**************

print 'test3'

# POSITION OF O.RUN
O.run()

O.pause

#######################################################################################
****************************************************************

1- If I use O.run() in the MWS script, I have in the output the apparition of "In[1]:" then the exit message and the
 simulation is blocked:

test0
test1
test3
[[ ^L clears screen, ^U kills line. F8 plot. ]]

In [1]: Do you really want to exit ([y]/n)?

2- If I use O.run(10,True) instead of O.run(), I get:

....
test0
test1
test3
test2
tstep= 1 Porosite= 0.783404375
test2
tstep= 2 Porosite= 0.78340475
test2
tstep= 3 Porosite= 0.783404625
test2
tstep= 4 Porosite= 0.783404625
test2
tstep= 5 Porosite= 0.7834055
test2
tstep= 6 Porosite= 0.783404625
test2
tstep= 7 Porosite= 0.783404
test2
tstep= 8 Porosite= 0.783404
test2
tstep= 9 Porosite= 0.783405375
[[ ^L clears screen, ^U kills line. F8 plot. ]]

In [1]: Do you really want to exit ([y]/n)?

So the run is done indeed after 10 timesteps and the "In[1]:" appears only at the complete end of the run which is expected.

My problem: In my more complete case, I need to use O.run() and not 0.run(X,True) because I don't know the number of timesteps required (there is an aditional conditional statement in a function called by pyrunner in the engines).
So Do you know to avoid the apparition of "In[1]:" with O.run() ??

Thanks very much for your feed-back,

Best wishes,

Vincent

nb: version of yade installed is: yade-2019-01-28.git-20242db

Revision history for this message
Jérôme Duriez (jduriez) said :
#6

In case this brings some clarification "In[1]" is just the command line prompt that appears each time a YADE user can control/access its simulation from Python prompt.
It does *not* appear as long as a O.run(X,wait=True) is running for instance.
On the other hand, it appears as soon as O.run() is validated by the user (and the computer).

The question in your case is: why YADE wants to exit once the user has the ability to speak ?

If it's a cluster, such an exit may be seen as quite logical since an interactive use of a software is not really expected on a cluster...

To solve your problem, I think you should either dig into how clusters/YADE work in terms of interactivity, or you try to use something else than O.run()

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#7

Your script is for python2, I can't run it sorry.
Did you read #1 (mostly unanswered still) and #4 by any chance?
#4 would clearly discourage this:
> O.run()
> O.pause

Bruno

Revision history for this message
Rioual (francois-rioual-v) said :
#8

..Thanks, I will try to avoid O.run() then
but, Bruno, what are you referring to by #1 and #4 ...???

Vincent

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#9

The answers numbered #1 and #4 in this page, sorry.
B

Revision history for this message
Rioual (francois-rioual-v) said :
#10

 From #1:
O.run() returns control to Python and the simulation runs in background; if you want to wait for it to finish, use O.wait()

it works !

Thanks to you all,

Fr.