-
Notifications
You must be signed in to change notification settings - Fork 137
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
[Tester] Faster tester and iut #223
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if you could revert the whitespace changes.
This is great stuff, we needed to make testing faster! Thank you for working on this.
src/libm-tester/tester.c
Outdated
@@ -4311,7 +4316,7 @@ void do_test() { | |||
|
|||
// | |||
|
|||
mpfr_set_default_prec(1280); | |||
mpfr_set_default_prec(320); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you reduce the precision of MPFR because it gives speedup? Why did you choose the original values? Are these new values enough to make sure we don't miss errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1280 is for double precision.
320 is more than 128(exponent of single precision) + 24(mantissa length). Actually, 160 should be enough.
src/libm-tester/testerutil.c
Outdated
@@ -124,7 +124,11 @@ int readln(int fd, char *buf, int cnt) { | |||
} | |||
|
|||
int startsWith(char *str, char *prefix) { | |||
return strncmp(str, prefix, strlen(prefix)) == 0; | |||
while(*str != '\0' && *prefix != '\0') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this code is faster then the library call? I believe that strncmp have highly specialized implementations in glibc...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original code is strncmp + strlen.
This code is faster if defined as a static function.
I will move this to testerutil.h.
@@ -47,6 +47,7 @@ void stop(char *mes) { | |||
|
|||
int ptoc[2], ctop[2]; | |||
int pid; | |||
FILE *fpctop; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it have to be global? Can't it be private inside of main?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fpctop is reference by many functions.
@@ -2,6 +2,7 @@ | |||
set -ev | |||
cd /build/build-cross | |||
make -j 2 all | |||
export OMP_WAIT_POLICY=passive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for changing OpenMP setting.
With the default setting, it does not run fast if there are many OpenMP processes running simultaneously.
@shibatch , where do you see the 50% speedup you claim in the PR? |
Running time at travis includes time for comiplation. |
With this patch, testing time is reduced to 50%.