From: tornaria <tornaria@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: pari: add config options
Date: Sat, 27 Mar 2021 20:39:41 +0100 [thread overview]
Message-ID: <20210327193941.y07QbU_dFcHholyl1zfOtAHMCMzynUhwRFvGNfnKz7k@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-29635@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 3008 bytes --]
New comment by tornaria on void-packages repository
https://github.com/void-linux/void-packages/pull/29635#issuecomment-808792043
Comment:
> Maybe I'm misinterpreting this?
>
> ...
> // *** Warning: increasing stack size to 1024000.
> *** the thread stack overflows !
> current stack size: 512000 (0.488 Mbytes)
> [hint] set 'threadsizemax' to a nonzero value in your GPRC
> *** matdet: Warning: increasing stack size to 2048000.
> *** at top-level: matdet([-10,-7,6,-7,1,4,-1,-2,-2,-5,1,7,-6,7,-
> *** ^----------------------------------------------
> *** matdet: the thread stack overflows !
> current stack size: 512000 (0.488 Mbytes)
> [hint] set 'threadsizemax' to a nonzero value in your GPRC
> *** the thread stack overflows !
> ...
I think you are confusing the actual stack used by the cpu, with the pari stack where computations are done (this is the basic design of pari using a stack for allocations instead of GC, etc).
Usually (with single threaded pari) when the stack overflows pari doubles the stack and retries the computation. I think this already happened for this test. However it seems that in multi-threaded pari the doubling-the-stack behaviour is limited by `threadsizemax` (I guess to avoid using up a lot of memory), so the stack size, originally at 512K, is increased to 1024K, but `threadsizemax` prevents that (note that the second time the current stack size is still 512K).
I will have a look into this. It might be: (a) that the particular computation giac is doing in this test is hard and it really require more than 512k of stack (b) there's a "bug" in pari, maybe some routine in pari is not checking the stack to reallocate often enough so it ends up not working in limited stack space.
Regarding pthread pari: I'd like to discuss a bit more what's the right way to proceed. Indeed for lots of applications having a pthread pari is a good thing (I use a 36-core machine for my computations so I'd definitely take advantage of this). However, I've noticed a slowdown by a factor of 2 with pthread pari in some of my computations, so I often use single-threaded pari and arrange my computation so it can be done by 36 independent pari processes. I think the reason is that TLS is _slow_.
I wonder if it would make sense to offer different versions of pari (single thread / multi thread). At the very least, I'd make pthread a build option so that one can easily compile one or the other as needed.
More generally: in math software is often important to have different versions of the same software available. I don't know if there is a reasonable way to offer this in void. Also might be desirable: offering a way to compile math software with -march=native so it can take advantage of avx, etc.
Is there a way void could support something like "subarchitectures"? Say `x86_64-avx` where some packages are compiled for this architecture and the rest default to the packages for `x86_64`.
next prev parent reply other threads:[~2021-03-27 19:39 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-20 17:20 [PR PATCH] " dkwo
2021-03-22 9:31 ` [PR PATCH] [Updated] " dkwo
2021-03-25 3:11 ` [wip] " ericonr
2021-03-25 20:21 ` [PR PATCH] [Updated] " dkwo
2021-03-25 20:23 ` dkwo
2021-03-26 9:51 ` dkwo
2021-03-26 16:30 ` ericonr
2021-03-26 17:09 ` dkwo
2021-03-26 17:42 ` ericonr
2021-03-27 14:53 ` [PR PATCH] [Updated] " dkwo
2021-03-27 14:58 ` dkwo
2021-03-27 19:39 ` tornaria [this message]
2021-03-27 22:28 ` tornaria
2021-03-27 22:38 ` tornaria
2021-03-28 6:12 ` ericonr
2021-03-28 6:13 ` ericonr
2021-03-28 10:10 ` [PR PATCH] [Updated] " dkwo
2021-03-28 10:11 ` dkwo
2021-03-28 14:23 ` tornaria
2021-03-28 19:15 ` [wip] " dkwo
2021-04-07 12:59 ` dkwo
2021-05-06 18:17 ` [PR PATCH] [Closed]: " dkwo
2021-08-17 19:06 ` tornaria
2021-08-17 19:42 ` ericonr
2021-08-17 21:41 ` tornaria
2021-08-18 9:15 ` dkwo
2021-08-18 9:15 ` [PR PATCH] [Closed]: " dkwo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210327193941.y07QbU_dFcHholyl1zfOtAHMCMzynUhwRFvGNfnKz7k@z \
--to=tornaria@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).