[parsec-users] canneal on sparc?

Christian Bienia cbienia at CS.Princeton.EDU
Wed May 28 14:48:42 EDT 2008


Hi Javier,

I believe the program breaks on Sparc because the AtomicPtr class uses
unaligned accesses. AtomicPtr assumes to swap 32-bit or 64-bit pointers, if
the wrong type is used it can easily cause an unaligned access. Have a look
at the definition of ATOMIC_TYPE in AtomicPtr.h, the compiler might simply
use the wrong type here:

//determine whether machine uses 32-bit or 64-bit pointers and set pointer
type
#if defined(atomic_store_rel_64) || defined(atomic_set_64)
    typedef long unsigned int ATOMIC_TYPE;
#else
    typedef unsigned int ATOMIC_TYPE;
#endif //atomic_store_rel_64


The AtomicPtr class casts all pointers and values to ATOMIC_TYPE so the
atomic instructions get the type they expect. On x86 CPUs that's unsigned
int (i386) and long unsigned int (amd64) respectively. Make sure the pointer
width (32-bit vs. 64-bit) is detected correctly and the same type is used as
in the atomic instruction header files for Sparc and the program should work
fine.

- Chris



-----Original Message-----
From: parsec-users-bounces at lists.cs.princeton.edu
[mailto:parsec-users-bounces at lists.cs.princeton.edu] On Behalf Of Javier
Lira
Sent: Wednesday, May 28, 2008 11:37 AM
To: PARSEC Users
Subject: Re: [parsec-users] canneal on sparc?

Hi,

I am trying to execute canneal in SPARC, but I face the same result as
Huan (bus error). I has been investigating on it, and this exceptions
appears when AtomicPtr.Get() calls the function atomic_load_acq_ptr
which calls to some SPARC dependent methods.

My guessing is that the atomic.h, cpufunc.h and asi.h should work
properly because as I checked, they are the same files (with some
shrink) as FreeBSD project.

So, I am going deeply in the issue, but it still does not work... Could
you help me on that?

Many thanks in advance,

Javier

On Thu, 2008-05-22 at 13:09 -0400, Christian Bienia wrote:
> Huan,
> 
> Canneal should run without problems on sparc if that error gets fixed. I
> believe it's caused because the atomic instructions which swap two netlist
> elements assume a different word size than used for the netlist elements.
> You can change that e.g. in the AtomicPtr class.
> 
> - Chris
> 
> 
> -----Original Message-----
> From: parsec-users-bounces at lists.cs.princeton.edu
> [mailto:parsec-users-bounces at lists.cs.princeton.edu] On Behalf Of Huan
Fang
> Sent: Thursday, May 22, 2008 9:46 AM
> To: PARSEC Users
> Subject: [parsec-users] canneal on sparc?
> 
> Hello,
> 
> I am wondering if canneal supports Sparc platform because there is 
> always some bus error as following:
> 
> [HOOKS] PARSEC Hooks Version 1.0
> Threadcount: 1
> 5 moves per thread
> Start temperature: 100
> netlist filename: 10.nets
> ./parsecmgmt: line 864:  2334 Bus Error               (core dumped)
>
/home/parsec-1.0/bin/../pkgs/kernels/canneal/inst/sparc-solaris.gcc-hooks/bi
> n/canneal 
> 1 5 100 10.nets
> 
> Has anyone tested that?
> 
> /Huan
> 
> _______________________________________________
> parsec-users mailing list
> parsec-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/parsec-users
> 
> _______________________________________________
> parsec-users mailing list
> parsec-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/parsec-users

_______________________________________________
parsec-users mailing list
parsec-users at lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/parsec-users



More information about the parsec-users mailing list