Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated VTune easyblock to behave like sourcing the amplxe-vars.sh script #1229

Merged
merged 9 commits into from
Dec 7, 2017

Conversation

damianam
Copy link
Member

@damianam damianam commented Aug 15, 2017

(ie: do not add LD_LIBRARY_PATH, LIBRARY_PATH and CPATH)

Otherwise error like this appear:

$PREFIX/VTune/2017_update4/vtune_amplifier_xe/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by XXX)

…ript (ie: do not add LD_LIBRARY_PATH, LIBRARY_PATH and CPATH)

if self.cfg['m32']:
guesses.update({
'PATH': [os.path.join(self.subdir, 'bin32')],
'LD_LIBRARY_PATH': [os.path.join(self.subdir, 'lib32')],
'LIBRARY_PATH': [os.path.join(self.subdir, 'lib32')],
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is now a single update, let's change this to:

guesses['PATH'] = [os.path.join(self.subdir, 'bin32')]

same below

'MANPATH': [os.path.join(self.subdir, 'man')],
})

for ev in do_not_set:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do_not_set is not used anywhere else, so no need to introduce a variable

also, clarify with a comment why this is being done, and include (debug) log messages for kicking those out:

# make sure $CPATH, $LD_LIBRARY_PATH and $LIBRARY_PATH are not updated in generated module file,
# because that leads to problem when the libraries included with VTune are being picked up
for key in ['CPATH', 'LD_LIBRARY_PATH', 'LIBRARY_PATH']:
    if key in guesses:
        self.log.debug("Purposely ot updating $%s in VTune module file", key)
        del guesses[key]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@damianam ping?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boegel pong back at ya'!

@boegel boegel added this to the 3.4.0 milestone Aug 16, 2017
@boegel boegel modified the milestones: 3.5.0, 3.4.0 Sep 4, 2017
@damianam
Copy link
Member Author

I think it makes sense to define an IntelTools that inherits from IntelBase, and used as a base for EB_Advisor, EB_Vtune and EB_Inspector. Thoughts?

@damianam damianam modified the milestones: 3.5.0, 3.4.1 Sep 18, 2017
@boegel boegel modified the milestones: 3.4.1, 3.5.0 Oct 11, 2017
@boegel boegel modified the milestones: 3.5.0, next release Dec 6, 2017
@boegel boegel changed the title Updated VTune easyblock to behave like sourcing the amplxe-vars.sh sc… Updated VTune easyblock to behave like sourcing the amplxe-vars.sh script Dec 7, 2017
Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small remarks, nice cleanup on the side, yaay!

@@ -46,31 +46,12 @@ def __init__(self, *args, **kwargs):
else:
self.base_path = 'advisor'

def make_module_req_guess(self):
"""Find reasonable paths for Advisor"""
return _make_module_req_guess_tools(self)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.make_module_req_guess_tools()

}

binaries = ['advixe-cl', 'advixe-feedback', 'advixe-gui', 'advixe-runss', 'advixe-runtrc', 'advixe-runtc']
custom_paths = _get_custom_paths_tools(self,binaries)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

custom_paths = self.get_custom_paths_tools(binaries)

@@ -44,7 +44,8 @@ def __init__(self, *args, **kwargs):

# recent versions of Inspector are installed to a subdirectory
self.subdir = ''
if LooseVersion(self.version) >= LooseVersion('2013_update7') and LooseVersion(self.version) < LooseVersion('2017'):
if LooseVersion(self.version) >= LooseVersion('2013_update7') and \
LooseVersion(self.version) < LooseVersion('2017'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, not a big fan of the break via \ (we don't do this anywhere else either).

If you want to shorten this, I'd suggest:

loosever = LooseVersion(self.version)
if loosever >= LooseVersion('2013_update7') and loosever < LooseVersion('2017'):

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I've just done it like that because the vtune easyblock had that break in that point.


return guesses
"""Find reasonable paths for Inspector"""
return _get_guesses_tools(self)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.get_guesses_tools()

'files': [os.path.join(self.subdir, f) for f in files],
'dirs': [os.path.join(self.subdir, d) for d in dirs],
}
custom_paths = _get_custom_paths_tools(self, binaries)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

custom_paths = self.get_custom_paths_tools(binaries)

self.subdir = ''
if LooseVersion(self.version) >= LooseVersion('2013_update12'):
if LooseVersion(self.version) >= LooseVersion('2013_update12') and \
LooseVersion(self.version) < LooseVersion('2018'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loosever = LooseVersion(self.version)
if loosever >= LooseVersion('2013_update12') and loosever < LooseVersion('2018'):
    self.subdir = 'vtune_amplifier_xe'
elif loosever >= LooseVersion('2018'):
    self.subdir = 'vtune_amplifier'


return guesses
"""Find reasonable paths for VTune"""
return _get_guesses_tools(self)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.get_guesses_tools()

'files': [os.path.join(self.subdir, f) for f in files],
'dirs': [os.path.join(self.subdir, d) for d in dirs],
}
custom_paths = _get_custom_paths_tools(self, binaries)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

custom_paths = self.get_custom_paths_tools(binaries)

@@ -111,6 +112,42 @@ def __init__(self, *args, **kwargs):

self.install_components = None

def _get_guesses_tools(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@damianam I wouldn't make these hidden/private, since that is an indication these are/should only be used inside IntelBase, which is the opposite of what you're doing...

So, use def get_guesses_tools(self):

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I was a bit confused on the exact meaning of the underscore. I mean, I want these methods to be called exclusively by classes that inherited from IntelBase. But I think python don't have that kind of distinction.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The leading underscore is only a convention too, it doesn't actually prevent you to do anything, it's just an indication that you shouldn't.

I don't think there's a way to restrict these methods to only be called by specific easyblocks, at least not without making an IntelTools that sits on top of IntelBase...


return guesses

def _get_custom_paths_tools(self, binaries):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, use def _get_custom_paths_tools(self, binaries):

@easybuilders easybuilders deleted a comment from boegelbot Dec 7, 2017
@easybuilders easybuilders deleted a comment from boegelbot Dec 7, 2017
@easybuilders easybuilders deleted a comment from boegelbot Dec 7, 2017
@boegel
Copy link
Member

boegel commented Dec 7, 2017

Tested with all existing VTune, Advisor and Inspector easyconfigs, lgtm so going in...

Thanks @damianam!

@boegel boegel merged commit 5455a25 into easybuilders:develop Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants