Skip to content

fix conflict specification included in module files#1017

Merged
boegel merged 14 commits intoeasybuilders:developfrom
boegel:fix_conflicts
Sep 5, 2014
Merged

fix conflict specification included in module files#1017
boegel merged 14 commits intoeasybuilders:developfrom
boegel:fix_conflicts

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Aug 22, 2014

fix conflict specification included in module files (see #994), base it on short module name obtained from active module naming scheme

this forced me to resort to another solution for verifying toolchain definitions vs the loaded toolchain module, since this basically means we can no longer obtain the (isolated) software name from a given module file (keeping in mind that a custom module naming scheme may be embedded a software name in some weird way)

the inner function tc_elem_present now using a regex to check whether a module name could be for a software package with the specified name, which is the best I can come up with

this approach should work most of the time, but it possible to come with a (weird) module naming scheme that breaks the assumptions made in tc_elem_present...

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Aug 22, 2014

@wpoely86: please review?
cc: @ikirker, @pforai

@pforai
Copy link
Copy Markdown
Contributor

pforai commented Aug 23, 2014

Looks very good to me. I like the work here. Good improvement getting rid of TC sanity checking via conflict stanza.

@boegel Could you just give an example of the limitations imposed by custom MNS and tc_elem_present() as you did on IRC? Should be left here for reference maybe.

Comment thread easybuild/tools/toolchain/toolchain.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

make it a class method? seems useful

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok, see is_dep_in_toolchain_module

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Aug 26, 2014

@stdweird: remarks fixed, please revisit

Comment thread easybuild/tools/toolchain/toolchain.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

see my previous remark that got lost: the regexp needs proper termination with (probably) (?:/|$).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it didn't get lost: I replied to it ;-)

This is deliberetaly open-ended, see also the examples mentioned. With your approach, the lib/math/BLACS-stable/1.1 wouldn't match anymore...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hmm, this worse then i thought...
with this code, looking for a with only /aa would return a match, which is clearly wrong (it now assume this is a with suffix a?). so this can't be open ended.

but actually, only the naming scheme can decide here what is possible or not. in principle blacs and BLACS are not the same software. so general case insensitive name search is clearly too open.

each found module should be inspected to see it matches the searched name. (or eg the show of info commands should contain the name of the software you are looking for)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

and to make matters worse, since we don't enforce a reverse for the naming scheme, there isn't a straightforward relation between modulename and software name to begin with.
also, nowhere do we assume that the software name is in the module name. the naming scheme has the mapping (eg imagine module name is md5sum of software name).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

we don't enforce being able to reverse the naming scheme yet, i.e. go from module name to software name/version and toolchain name/version; not only software name, we will need all four in the end (and even versionsuffix too)

I was also thinking to simply ask the module naming scheme what the software name is for a given module name. But then we need access to ActiveMNS here in toolchain.py, which brings back the cyclic imports issue...

If you agree this is the best approach (adding something like software_name_from_module(mod) to the MNS API), then I can make this work.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

One way to avoid making the regex open-ended is to use (?:\W) (i.e. close it with a non-alphanumeric character). That would make things slightly better, but only slightly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

reversability is not mandatory in this case. worst case you inspect all modules to find the ones with matching name 😄
but it would really help if this is delegated to the naming scheme.
then people who do stupid naming scheme can solve the isse (eg when using case insensitive names, the author of the naming scheme can decide how to handle clashes).

what cyclic imports issue was that again? the naming scheme instance can be passed as argument to this function from wherever it is called (or something like that).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the issue is not wheter it is openended or not (because of suffixes). look at the a vs aa example. in this case aa is a candidate (a with suffix a), but need inspection of the module itself. so the naming scheme can return candidates, they still need inspection. (but it's the naming scheme that should return the candidates)

@stdweird
Copy link
Copy Markdown
Contributor

one small bug, 2 non-blocking remarks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

any reason why this check is not part of _det_module_name_with?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the check should only be done using a short module name (e.g. OpenMPI/1.6.4), never with a full module name (e.g. Compiler/GCC/4.7.2/OpenMPI/1.6.4), while _det_module_name_with is used for both short/full module names

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

esp since you are actually doing a sanity check of mns, using self.mns.is_module_for seems only logical

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can use self.mns.is_module_for directly here, but that wouldn't make a difference, ActiveMNS still needs to wrap around self.mns.is_module_for with an own method is_module_for, since that one is called from toolchain.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants