It seems that Paul was asking about if STAX variables defined in one job 
could effect STAX variables defined in another job (to which I answered 
this should not be occurring).

But it seems that Joe is talking about the scope of STAX variables within 
a single STAX job.  These are different topics.  Note that there is a lot 
of good information about the scope of STAX variables in the "STAXGlobal 
Class" section in the STAX User's Guide at 
http://staf.sourceforge.net/current/STAX/staxug.html#STAXGlobal_Class.

Paul, for those STAX variables that  you're having problems with, what is 
the output of type(variableName)?  For example, to get the type of 
variables named x and y, you could do:

<log message="1">
  'type(x)=%s, type(y)=%s' % (type(x), type(y))
</log>

Are they all the same type? What type(s) are they?

When you say that "Python complains that an instance of class X does not 
have attribute Y", is this for a Python class that you defined within your 
STAX job or that you imported from a Python module?  If it's for an 
imported Python module, is it for one that may have been changed while the 
STAX service is running?  If so, make sure you've read section "4.1.6 Why 
aren't changes to imported Python modules picked up in my STAX job?" in 
the STAF/STAX FAQ at 
http://staf.sourceforge.net/current/STAFFAQ.htm#d0e2105.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




Joseph J Veilleux/Lexington/i...@ibmus 
03/05/2010 08:11 AM

To
Paul Ellsworth/San Jose/i...@ibmus
cc
staf-users@lists.sourceforge.net
Subject
Re: [staf-users] Python variable scope ... between jobs?






Paul --

Yes, I have seen this kind of error and the pattern of failure seemed to 
be just as you observed. In particular the complaint that an object 
doesn't have a specific attribute.

My experience suggests that you are on the right track -- the problem is 
with variable scoping. There are some very odd scoping rules for python 
variables in the context of a STAX job so you have to work through all the 
variations of STAX function scope, where your variables are declared, 
whether or not you use the STAXGlobal() wrapper class, etc.

This was a few months ago that I was encountering these problems so it's a 
little difficult to remember the precise details of the solution but I'm 
pretty sure it was to declare/populate my main control structures in my 
main STAX function, with the structure declared as a STAXGlobal. Using 
that strategy I haven't had any problems recently.

So -- I think you're on the right track.

Oh -- one other thing -- I think your observation about the multiple 
threads is on-target too. I found that some of these problems happened 
when I was using a <paralleliterate> element to do something 
simultaneously on each of four target machines, and in particular if I got 
a STAX execution error (e.g. Python syntax error or NameError or something 
like that) on one of the threads. I believe under such circumstances I 
would see the STAX job hang, as though it wasn't recognizing that all the 
threads were finished.

I was more focused on finding a solution that would work rather than 
thoroughly diagnosing and documenting the problem, so I don't have any 
detailed notes on what works and what doesn't... sorry.

----------------------------------------------------------------------------------------
Joe Veilleux
IBM/Lotus Domino Server Quality Engineering
550 King Street
Littleton MA 01460
Email: joeveill...@us.ibm.com


Paul Ellsworth---03/04/2010 03:32:01 PM---Hello,

Paul Ellsworth/San Jose/i...@ibmus 
03/04/2010 03:24 PM



To

staf-users@lists.sourceforge.net

cc


Subject

[staf-users] Python variable scope ... between jobs?





Hello,

I sometimes have strange python (/jython... I will probably refer to it as 
python though...) variable issues - e.g., it values from one variable end 
up in another variable for whatever reason, or a class somehow gets messed 
up and Python complains that an instance of class X does not have 
attribute Y when I know for a fact that it does :)

This happens *much* more frequently when many jobs are running (10 or 
more... large jobs; if they all completed, they would generate over 
100,000 user logs, not sure how many non-user logs, use around 20 XML 
files that can have up to 4000 lines in them, etc).

I'm working through possible variable scope issues... question is: is 
there a possibility that the python variables/scope/maybe shared memory is 
getting mixed up or leaked amongst the many running jobs?

Not necessarily saying this is happening but asking if it is possible 
while I explore various reasons it may be happening... :)

It also seems to happen more frequently when multiple jobs are running 
through the same XML sections (and thus the same python/jython scripting) 
at the same time...

Thanks!
Paul
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

<<image/gif>>

<<image/gif>>

<<image/gif>>

<<image/gif>>

<<image/gif>>

<<image/gif>>

<<image/gif>>

<<image/gif>>

<<image/gif>>

<<image/gif>>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to