(Open)Solaris doesn't use x64 TTH code

Bug #600806 reported by taemun
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LinuxDC++
Confirmed
Medium
Unassigned

Bug Description

Using rev 374, OpenSolaris b134.

TigerHash.cpp, chunk of code from line 26:

#ifdef _WIN32
#if defined(_M_X64)
#define TIGER_ARCH64
#endif
#if !(defined(_M_IX86) || defined(_M_X64))
#define TIGER_BIG_ENDIAN
#endif
#else // _WIN32
#if defined(__x86_64__) || defined(__alpha)
#define TIGER_ARCH64
#endif
#if !(defined(__i386__) || defined(__x86_64__) || defined(__alpha))
#define TIGER_BIG_ENDIAN
#endif
#endif // _WIN32

Apparently none of that matches my OSol box, and we end up using the slower 32-bit code.

If I add another line just forcing "#define TIGER_ARCH64", I get much better hashing speed. Using the normal code, I get around 58MB/s, with that define added, more like 81MB/s. Still not great, but its something.

Tags: core hashing
Razzloss (razzloss)
tags: added: core hashing
Revision history for this message
Razzloss (razzloss) wrote :

These numbers were from an Intel machine so maybe __x86_64__ isn't defined on OpenSolaris?

--RZ

Changed in linuxdcpp:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
taemun (taemun) wrote :

Well. This has been a productive hour. OSol doesn't naturally invoke gcc with -m64. So of course __x86_64__ wasn't defined. So I went into SConstruct and replaced:
 if os.sys.platform == 'sunos5':
                env['ICONV_CONST'] = 'const'
                env.Append(LINKFLAGS = ['-lsocket', '-lnsl'])
With:
        if os.sys.platform == 'sunos5':
                env['ICONV_CONST'] = 'const'
                env.Append(LINKFLAGS = ['-lsocket', '-lnsl', '-m64'])
                env.Append(CXXFLAGS = '-m64')

I can't speak to whether this is a good idea on SPARC hardware. The reasoning behind -m64 being off on OSol is apparently because on SPARC, 32 bit code is often faster. I'm on x86-64, so meh.

Hash speed .... is now 300MB/s. Or at least that is what it will push as long as the incoming data is coming in fast enough. This is what "fast hashing" off as related to https://bugs.launchpad.net/linuxdcpp/+bug/600815.

Revision history for this message
Steven Sheehy (steven-sheehy) wrote :

I'm glad it works for you, but I'm not sure if including that in linuxdcpp would be appropriate. I imagine people using OpenSolaris with 32 bit CPUs wouldn't want 64 bit binaries. You can always pass custom flags via the CXXFLAGS and LDFLAGS environment variable instead of hardcoding them in SConstruct.

Revision history for this message
taemun (taemun) wrote : Re: [Bug 600806] Re: (Open)Solaris doesn't use x64 TTH code

I would presume there is somethign that could be put in the SConstruct that
would say "if Sun" and "if x86-64" then "-m64". I don't know what that would
be.

At the least, something should be added to the appropriate Readme files for
future people coming along.

I've noticed that forcing -m64 appears to have broken TLS, an adcs hub
connection drops every minute or so, saying:
*** Connect failed: SSL Error: error:00000001:lib(0):func(0):reason(1) (-1,
1)
It can communicate fine for the time when it is connected.

Any thoughts on that?

On 2 July 2010 14:33, Steven Sheehy <email address hidden> wrote:

> I'm glad it works for you, but I'm not sure if including that in
> linuxdcpp would be appropriate. I imagine people using OpenSolaris with
> 32 bit CPUs wouldn't want 64 bit binaries. You can always pass custom
> flags via the CXXFLAGS and LDFLAGS environment variable instead of
> hardcoding them in SConstruct.
>
> --
> (Open)Solaris doesn't use x64 TTH code
> https://bugs.launchpad.net/bugs/600806
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
taemun (taemun) wrote :

I'll have to redact the comment about -m64 breaking TLS.

I just recompiled without the -m64 flags, and the connection is dying
presently. I'll have to do some digging.

On 2 July 2010 18:33, taemun <email address hidden> wrote:

> I would presume there is somethign that could be put in the SConstruct that
> would say "if Sun" and "if x86-64" then "-m64". I don't know what that would
> be.
>
> At the least, something should be added to the appropriate Readme files for
> future people coming along.
>
> I've noticed that forcing -m64 appears to have broken TLS, an adcs hub
> connection drops every minute or so, saying:
> *** Connect failed: SSL Error: error:00000001:lib(0):func(0):reason(1) (-1,
> 1)
> It can communicate fine for the time when it is connected.
>
> Any thoughts on that?
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.