- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Small C Quick sort program ran on OpenVMS Blade Se...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2017 09:14 PM
12-06-2017 09:14 PM
Small C Quick sort program ran on OpenVMS Blade Server much slower than on Windows or Linux
Dear everybody,
We try to run a simple C program as below:
#include <stdio.h>
#include <stdlib.h> // qsort
#include <time.h>
int uint64cmpfunc ( const void * a, const void * b ) {
return ( *(unsigned long long int*)a - *(unsigned long long int*)b );
}
unsigned long long int *uint64random( unsigned long int sizw ) {
unsigned long int n;
unsigned long long int *p;
long int val1, val2;
p = malloc( sizeof(unsigned long long int) * sizw );
if( p == NULL )
{
fprintf( stderr, "could not alloc memory\n" );
return NULL;
}
for( n = 0; n < sizw; ++n ) {
val1 = random();
val2 = random();
p[n] = val2 + val1;
}
return p;
}
int main( int argc, char *argv[] )
{
unsigned long int n = 50000000;
unsigned long int i;
unsigned long long int *vals = NULL;
time_t begin, end;
srand( time(NULL) );
begin = time(NULL);
vals = uint64random( n );
end = time(NULL);
fprintf( stdout, "random tooked: %ld seconds\n", end - begin );
if( vals == NULL )
return (-1);
begin = time(NULL);
qsort( vals, n, sizeof(unsigned long long int), uint64cmpfunc );
end = time(NULL);
fprintf( stdout, "sort tooked: %ld seconds\n", end - begin );
free(vals);
return 0;
}
It took us around 30s to finish qsort on our BL860c i2 with 96 GB RAM. However, on my Windows 10 laptop (4 GRAM), just take less than 1 second.
Do you have any idea about that?
Thanks,
Kanchimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2017 10:26 AM
12-07-2017 10:26 AM
Re: Small C Quick sort program ran on OpenVMS Blade Server much slower than on Windows or Linux
- check compiler options notably for optimizer and architecture settings. OpenVMS tools default are typically on the safe and slow side.
- Where is the time going, and if CPU time which 'mode' ($ MONI MODE) it should be 100% User-mode, but cosidering the size of the array there may be soft pagefaulting to access the whole array through a limites workgin set (again, openVMS starts with a safe but slow setting to make sure a user, out-of-the-box, cannot impact the whole server with other users too much.
50,000,000 elements of 64 bytes, that's 400MB right? So that could be bigger that your workingset(extend)
$ SHOW WORK
Hope this helps some,
And... it might just be slower.
If it is critical, then you may need a CPU profiler to see where the time is spend (moving, comparing,...)
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2017 12:34 PM
12-07-2017 12:34 PM
Re: Small C Quick sort program ran on OpenVMS Blade Server much slower than on Windows or Linux
> - check compiler options notably for optimizer and architecture
> settings. [...]
Around here, /OPTIMIZE=LEVEL=5 made approximately no difference.
its $ tcpip show version
HP TCP/IP Services for OpenVMS Industry Standard 64 Version V5.7 - ECO 2
on an HP rx2660 (1.59GHz/9.0MB) running OpenVMS V8.4
its $ cc /version
HP C V7.3-020 on OpenVMS IA64 V8.4
its $ show work
Working Set (pagelets) /Limit=133600 /Quota=267200 /Extent=2103296
Adjustment enabled Authorized Quota=267200 Authorized Extent=2103296
Working Set (8Kb pages) /Limit=8350 /Quota=16700 /Extent=131456
Authorized Quota=16700 Authorized Extent=131456
its $ cc qsort1 /obj = qsort1id
its $ link qsort1id
its $ cc qsort1 /obj = qsort1io /optimize=level=5
its $ link qsort1io
its $ r qsort1id
random tooked: 2 seconds
sort tooked: 32 seconds
its $ r qsort1io
random tooked: 1 seconds (The random() loop may get little better.)
sort tooked: 32 seconds
> If it is critical, then you may need a CPU profiler to see where the
> time is spend (moving, comparing,...)
Practically all the execution is in the CRTL: HELP CRTL qsort
> And... it might just be slower.
Looks that way (to a casual observer).