Replace sync vars with atomic vars where possible in SSCA2 kernels 3 & 4.
Replace sync vars with atomic vars where possible in SSCA2 kernels 3 & 4.

Kernel 3:
- Replaced min_distance$

Kernel 4:
- Replaced min_distance$
- Removed the lock in child_struct and made the count an atomic
- Replaced the sync and singles vars in the barrier code

Also factored out the barrier code into a record, making the kernel
code a little cleaner.

I left kernel 2 alone since Brad is going to work on rewriting it (and
it wasn't a simple search and replace).



git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@19847 3a8e244f-b0f2-452b-bcba-4c88e055c3ca

sungeunchoi/chapel,sungeunchoi/chapel,CoryMcCartan/chapel,hildeth/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,CoryMcCartan/chapel,hildeth/chapel,hildeth/chapel,chizarlicious/chapel,chizarlicious/chapel,chizarlicious/chapel,hildeth/chapel,chizarlicious/chapel,CoryMcCartan/chapel,chizarlicious/chapel,chizarlicious/chapel,sungeunchoi/chapel,sungeunchoi/chapel,chizarlicious/chapel,sungeunchoi/chapel,CoryMcCartan/chapel,CoryMcCartan/chapel,hildeth/chapel,sungeunchoi/chapel,hildeth/chapel,sungeunchoi/chapel,CoryMcCartan/chapel,hildeth/chapel