Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331561

Summary: Open MPI launch fails when user selects version
Product: [Tools] PTP Reporter: Greg Watson <g.watson>
Component: RM.Open MPIAssignee: Greg Watson <g.watson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Greg Watson CLA 2010-12-01 11:36:28 EST
(First reported by Bob Fuhrer)

I seem to have discovered a bug in PTP 5's handling of user settings for the OpenMPI version.

When the user selects an explicit OpenMPI version, say 1.4, in our user interface, I'd later get an NPE inside the PTP because the discover/launch/debug commands hadn't been set in the OpenMPIServiceProvider. This happens even though the versionId property on the OpenMPIServiceProvider is "1.4".

I tracked this down to the following:

 - EffectiveOpenMPIResourceManagerConfiguration's constructor always asks the IOpenMPIResourceManagerConfiguration for the "detected version", which is stored in the fields OpenMPIServiceProvider.majorVersion and minorVersion. However, if the user set an explicit version, those fields are still at their defaults (0), since no version has been "detected". As a result, the constructor fails to initialize the discover/launch/debug command fields.

My proposed change is for EffectiveOpenMPIResourceManagerConfiguration to ask whether the version ID is "auto": if so, use what getDetectedVersion() returns; if not, use what getVersionId() returns. [see patch below]

I'm not sure this would be consistent with the code's intent, though.

On a related note:

 - OpenMPIServiceProvider.setVersionId() doesn't set the majorVersion and minorVersion fields. I'd think it should do so, analogously to what setDetectedVersion() does.
Comment 1 Greg Watson CLA 2010-12-01 11:37:19 EST
Yes, it does look like a bug. However, I'm a bit puzzled by what the code in the EffectiveOpenMPIResourceManagerConfiguration constructor is for, as the values seem to be already be set in OpenMPIConfigurationWizardPage#handleVersionSelected. Committing a simpler patch.
Comment 2 Greg Watson CLA 2010-12-01 12:19:27 EST
I'm less sure about the change to setVersionId(). From what I can tell, the discover command is always run regardless of the auto setting, and the major/minor versions will always be updated with the discovered values. The only difference I can see between the auto setting and selecting a version is that in the latter case if the version doesn't match the detected version, an error dialog will be displayed.
Comment 3 Greg Watson CLA 2010-12-02 08:32:12 EST
(In reply to comment #1)
> Yes, it does look like a bug. However, I'm a bit puzzled by what the code in the
> EffectiveOpenMPIResourceManagerConfiguration constructor is for, as the values
> seem to be already be set in
> OpenMPIConfigurationWizardPage#handleVersionSelected. Committing a simpler
> patch.

On further examination, it looks like OpenMPIConfigurationWizardPage#handleVersionSelected only sets the defaults for each version. The constructor for EffectiveOpenMPIResourceManagerConfiguration needs to check the detected version and select the correct commands for that version.
Comment 4 Greg Watson CLA 2010-12-02 08:56:17 EST
Committed fix.