Skip to content

Reword/expand comments in Makefile.rule - #1988

Merged
martin-frbg merged 4 commits into
OpenMathLib:developfrom
TiborGY:patch-1
Feb 17, 2019
Merged

martin-frbg merged 4 commits into
OpenMathLib:developfrom
TiborGY:patch-1

Conversation

@TiborGY

@TiborGY TiborGY commented Jan 27, 2019

Copy link
Copy Markdown
Contributor

Lots of small changes in the wording of the comments, plus an expansion of the NUM_THREADS and NO_AFFINITY sections.

Lots of small changes in the wording of the comments, plus an expansion of the NUM_THREADS and NO_AFFINITY sections.
@martin-frbg

Copy link
Copy Markdown
Collaborator

I think the part about not wanting to install the static library is technically correct, as the gmake build proceeds via libopenblas.a in any case.
(And if you want to expand the NO_AFFINITY section it might make sense to spell out what the typical incompatibility is - any subsequent threads of the "other" program end up locked to the same core(s) as OpenBLAS )

Revert generate to install, explain the nature of the affinity conflict

@brada4 brada4 left a comment

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.

Your num_threads description states all redistributed packages configured with 32/64/128 threads are wrong.
Why generic fortran option os atributed to ifort?
Affinity is off by default and only affines threads to cores, nothing with memory. One certain application is numpy.

@TiborGY

TiborGY commented Jan 28, 2019

Copy link
Copy Markdown
Contributor Author

Your num_threads description states all redistributed packages configured with 32/64/128 threads are wrong.

Well, the old description was even worse, suggesting less threads than the number of cores. But I can add a note for package maintainers.

Why generic fortran option os atributed to ifort?

GCC does not recognize "-i8" at all, the option that turns on 64-bit integers is "-fdefault-integer-8".

Affinity is off by default and only affines threads to cores, nothing with memory. One certain application is numpy.

OK, I will fix this, I was following the old description, and that stated "CPU/memory affinity". I assumed the old description was not wrong.

@martin-frbg

Copy link
Copy Markdown
Collaborator

I suspect the original wording as "Basically should be less than actual number of cores" was meant in the sense of "you will want to define this only if you want less than what the autodetection would find anyway".
(This and most other comments are unchanged from GotoBLAS by Kazushige Goto. Apart from the slight language issues he probably did not foresee people building his library for redistribution rather than direct compilation on the target system. So allowing more threads than cpus seen on the build host was probably not a plausible scenario back then.)

I'm perfectly OK with labeling the "-i8" option in the comment as ifort dialect for clarity.

Lastly calling it "CPU/memory" affinity probably makes sense where memory access is not quite uniform e.g. between cores on separate dies. (Again the wording is Goto's, and I think he would have known)

@brada4

brada4 commented Jan 28, 2019

Copy link
Copy Markdown
Contributor

Probably worth saying that NUM_THREADS is maximum and can be reduced at runtime if needed (with some examples)
And the proposed edit said that affinity is on by default. It is actually off to play safe with others.

@TiborGY

TiborGY commented Jan 28, 2019

Copy link
Copy Markdown
Contributor Author

And the proposed edit said that affinity is on by default. It is actually off to play safe with others.

"For this reason, affinity handling is disabled by default." I cannot see how I could have made it clearer that it is disabled by default

add note about NUM_THREADS for package maintainers, add examples of programs that cause affinity troubles
@TiborGY

TiborGY commented Feb 16, 2019

Copy link
Copy Markdown
Contributor Author

I think if there are no further objections, this is ready to go.

@brada4

brada4 commented Feb 16, 2019

Copy link
Copy Markdown
Contributor

The thing is num_threads sizes memory buffers, and larger than CPUs value is desirable if using threading outside OpenBLAS. Accurate reference to OPENBLAS_NUM_THREADS would help there.

@TiborGY

TiborGY commented Feb 16, 2019 •

Copy link
Copy Markdown
Contributor Author

The thing is num_threads sizes memory buffers, and larger than CPUs value is desirable if using threading outside OpenBLAS.

AFAIK the current codebase always creates enough memory buffers for at least 50 threads.

Accurate reference to OPENBLAS_NUM_THREADS would help there.

I refrained from mentioning that environment variable on purpose. There are many ways to set the actual number of used threads at runtime, and that is already documented elsewhere. I feel like mentioning only one of the possible ways could be misleading.

@brada4

brada4 commented Feb 16, 2019

Copy link
Copy Markdown
Contributor

NUM_THREADS - Better to make a shortcut, current documentation could wish better structuring.

@martin-frbg

Copy link
Copy Markdown
Collaborator

Actually I think the new wording is quite adequate as it is now (minor nit: you retained a "the the" from the previous version in line 75). We may eventually want to move the lengthier descriptions to some new document named "OPTIONS" or the like, or rework the original GotoBLAS_* files.

@martin-frbg
martin-frbg merged commit aec9054 into OpenMathLib:develop Feb 17, 2019
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