Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347232 - Add debugging support for interactive resource managers
Summary: Add debugging support for interactive resource managers
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: RM (show other bugs)
Version: 5.0   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: 5.0.4   Edit
Assignee: Greg Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 309343
Blocks:
  Show dependency tree
 
Reported: 2011-05-25 18:56 EDT by Greg Watson CLA
Modified: 2011-11-12 17:26 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Watson CLA 2011-05-25 18:56:07 EDT
Reminder that we need to provide debugging support for interactive jobs launched using the new JAXB framework.
Comment 1 Greg Watson CLA 2011-07-21 16:09:54 EDT
I have created a wiki page to document the launch process here: http://wiki.eclipse.org/PTP/designs/debugger_launch
Comment 2 Greg Watson CLA 2011-08-03 16:54:29 EDT
Currently, only the Open MPI and MPICH2 RMs use debug launch help. For these, the routing information is obtained using the legacy process information that is generated by the AbstractToolResourceManager framework. Since JAXB does not generate process information (for scalability reasons), so I don't think launch help can (or should) be used for JAXB.

Using the JAXB framework, the debug launch steps are likely to be:

1. Run a "start-debugger" command prior to the job submission in order to launch the sdm master process.
2. Submit the debug job to the target system.
3. Generate a routing file using information obtained from the target system:
 a. For a non batch-system interactive launch (e.g. Open MPI, MPICH2 or PE), a command must be run on the target to obtain the routing information. This command must be run after the debug job has started running.
 b. For a batch-system interactive launch (e.g. PBS), the command to obtain routing information will probably need to be sent as input to the interactive session. This command must be run after the interactive session has been started.
Comment 3 Albert L. Rossi CLA 2011-08-04 09:56:27 EDT
Greg,

It is highly unlikely I will have time to make the implementation modifications for this before I leave.  However, I can modify the XSD and generate the updated Java objects necessary to support this.  How do you see this as playing out, schema-wise?  IMO, it seems cleanest just to add a new command, "start-debugger" and have the command called in the JAXBcontrol in the correct place.  Do we also need a "stop-debugger"?  What XSD support should be there for the routing file? 

Al
Comment 4 Greg Watson CLA 2011-08-04 10:17:27 EDT
Yes, understood. Would you do me a favor and add something to the "Environment setup" page describing how to generate the Java objects from the XSD?

I've been toying with the idea of adding a command-sequence-type, which would run a series of commands sequentially (probably needs a stopOnError attribute, maybe others). The submit-interactive-debug element would then be able to be an arbitrary sequence of, say, start debugger, submit job, generate routing, stop debugger, etc. Haven't thought through all the implications yet though.
Comment 5 Albert L. Rossi CLA 2011-08-04 10:21:36 EDT
Sure, I'll try to remind myself to add the documentation on what to do for JAXB compilation (I use an external tools command).

The command-sequence already exists for start-up and shut-down.  All we'd have to do is generalize it to the submit command as well.  I don't believe that is hard.

The command-sequence by default already behaves the way you state: subsequent commands are not run if a command fails.  One can expose an option to ignore this if that is desirable.
Comment 6 Albert L. Rossi CLA 2011-08-04 10:25:32 EDT
(In reply to comment #5)
> Sure, I'll try to remind myself to add the documentation on what to do for JAXB
> compilation (I use an external tools command).
> 
> The command-sequence already exists for start-up and shut-down.  All we'd have
> to do is generalize it to the submit command as well.  I don't believe that is
> hard.
> 
> The command-sequence by default already behaves the way you state: subsequent
> commands are not run if a command fails.  One can expose an option to ignore
> this if that is desirable.

Just one further thought, though:  the behavior of the commands inside the control is slightly different if the command involves a jobId.  start-up and shut-down sequences don't.  It may be simplest not to generalize the command-sequence, but to provide for debugger start-up and shut-down specifically.
Comment 7 Albert L. Rossi CLA 2011-08-04 10:35:48 EDT
(In reply to comment #6)
> (In reply to comment #5)
> > Sure, I'll try to remind myself to add the documentation on what to do for JAXB
> > compilation (I use an external tools command).
> > 
> > The command-sequence already exists for start-up and shut-down.  All we'd have
> > to do is generalize it to the submit command as well.  I don't believe that is
> > hard.
> > 
> > The command-sequence by default already behaves the way you state: subsequent
> > commands are not run if a command fails.  One can expose an option to ignore
> > this if that is desirable.
> 
> Just one further thought, though:  the behavior of the commands inside the
> control is slightly different if the command involves a jobId.  start-up and
> shut-down sequences don't.  It may be simplest not to generalize the
> command-sequence, but to provide for debugger start-up and shut-down
> specifically.

Another possibility is to mark a command specifically as a "submit" or "get-status" command, and treat those inside the sequence differently.  I need to look at the code again, but it may not be all that much of a problem.

In terms of the option, we would probably want to mark each command separately for whether it should be run if there is a preceding error or not.  If you start the debugger, but the actual submit fails, you'll want to stop the debugger; but if the start-debugger fails, you won't want to submit (actually, you won't want to stop the debugger either, so there might need to be some further qualifier here ...)
Comment 8 Albert L. Rossi CLA 2011-08-04 10:52:13 EDT
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > Sure, I'll try to remind myself to add the documentation on what to do for JAXB
> > > compilation (I use an external tools command).
> > > 
> > > The command-sequence already exists for start-up and shut-down.  All we'd have
> > > to do is generalize it to the submit command as well.  I don't believe that is
> > > hard.
> > > 
> > > The command-sequence by default already behaves the way you state: subsequent
> > > commands are not run if a command fails.  One can expose an option to ignore
> > > this if that is desirable.
> > 
> > Just one further thought, though:  the behavior of the commands inside the
> > control is slightly different if the command involves a jobId.  start-up and
> > shut-down sequences don't.  It may be simplest not to generalize the
> > command-sequence, but to provide for debugger start-up and shut-down
> > specifically.
> 
> Another possibility is to mark a command specifically as a "submit" or
> "get-status" command, and treat those inside the sequence differently.  I need
> to look at the code again, but it may not be all that much of a problem.
> 
> In terms of the option, we would probably want to mark each command separately
> for whether it should be run if there is a preceding error or not.  If you
> start the debugger, but the actual submit fails, you'll want to stop the
> debugger; but if the start-debugger fails, you won't want to submit (actually,
> you won't want to stop the debugger either, so there might need to be some
> further qualifier here ...)

one could conceivably have something like this:

<command>
   <on-success>command2,command3</on-success>
   <on-failure>command3<on-failure>
</command>

or something similar
Comment 9 Greg Watson CLA 2011-09-09 20:11:22 EDT
I have added pre- and post-launch commands that are be invoked prior to, and immediately after the main command is launched. The syntax is:

<submit-interactive-debug ...>
	<arg>...</arg>
	<stdout-parser>...</stdout-parser>
	<pre-launch-cmd ... />
	<post-launch-cmd ... />
</submit-interactive-debug>

The pre-launch commands will typically be used to clean up any debugger files. In the case of the SDM, this would be the routing file from a previous debug session.

The post-launch commands will be used to perform any debugger actions after the main job is launched. In the case of the SDM, this would be a) generating a new routing file, and b) launching the SDM front-end.
Comment 10 Greg Watson CLA 2011-11-12 17:26:21 EST
Added a sample interactive RM to the contrib plugin.