Skip to content
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

Synchronic in Kokkos::Impl #44

Closed
hcedwar opened this issue Jul 8, 2015 · 15 comments
Closed

Synchronic in Kokkos::Impl #44

hcedwar opened this issue Jul 8, 2015 · 15 comments
Assignees
Labels
Feature Request Create new capability; will potentially require voting

Comments

@hcedwar
Copy link
Contributor

hcedwar commented Jul 8, 2015

Need an implementation of Synchronic in Kokkos::Impl with unit testing. We have permission to use the prototype source code; no licensing issues.

@jgfouca
Copy link
Contributor

jgfouca commented Jul 8, 2015

OK, looking at it now.

@jgfouca
Copy link
Contributor

jgfouca commented Jul 10, 2015

@hcedwar, we have somewhat of a severe problem with the Synchronic stuff. The code uses std::this_thread::sleep_for which is only available if GCC detects that nanosleep is available. Apparently, there's a bug in GCC 4.7 and 4.8 where it fails to detect nanosleep and therefore compiles without sleep_for. The bug has since been fixed, but 4.7.2 is our standard compiler. Thoughts?

@nmhamster
Copy link
Contributor

Do you need timing for this, its only ever been a best efforts anyway. Can we not just stick in some NOOP values here to cause a core stall out?

@hcedwar
Copy link
Contributor Author

hcedwar commented Jul 10, 2015

We don't need a direct port, just the design and functionality. If there is an equivalent function that is conditionally available then we could use that function with the appropriate compiler version checks. The Synchronic concept (see previously linked paper and code for details) is to spin but with several incrementally applied back-off strategies to relieve pressure on memory system.

@nmhamster
Copy link
Contributor

Understood, but this does not need to be time based in order to meet specification (you can just execute a NOOP block with an exponential number of calls). The point of NOOPs is to prevent the cores from continuing to issue requests into the memory system.

@hcedwar
Copy link
Contributor Author

hcedwar commented Jul 10, 2015

Si - willing to consult with Jim for the implementation?

@jgfouca
Copy link
Contributor

jgfouca commented Jul 10, 2015

My current impl:
#ifdef _GLIBCXX_USE_NANOSLEEP
std::this_thread::sleep_for(time);
#else
usleep(time.count());
#endif

This assumes UNIX-type system, but I assume that should work fine for now.

@bmpersc
Copy link

bmpersc commented Jul 13, 2015

There is at least one project(DICE) using Tpetra on windows regularly right now. I don't know how important that build is to them, Dan Turner could answer that though.

Brent

From: James Foucar <notifications@github.commailto:notifications@github.com>
Reply-To: kokkos/kokkos <reply@reply.github.commailto:reply@reply.github.com>
Date: Friday, July 10, 2015 4:28 PM
To: kokkos/kokkos <kokkos@noreply.github.commailto:kokkos@noreply.github.com>
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

My current impl:
#ifdef _GLIBCXX_USE_NANOSLEEP
std::this_thread::sleep_for(time);
#else
usleep(time.count());
#endif

This assumes UNIX-type system, but I assume that should work fine for now.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120541935.

@crtrott
Copy link
Member

crtrott commented Jul 13, 2015

?There are more projects who want to do that. They currently use Intel compiler. I think we need a fallback which at least works on windows.


From: Brent Perschbacher notifications@github.com
Sent: Monday, July 13, 2015 8:20 AM
To: kokkos/kokkos
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

There is at least one project(DICE) using Tpetra on windows regularly right now. I don't know how important that build is to them, Dan Turner could answer that though.

Brent

From: James Foucar <notifications@github.commailto:notifications@github.com>
Reply-To: kokkos/kokkos <reply@reply.github.commailto:reply@reply.github.com>
Date: Friday, July 10, 2015 4:28 PM
To: kokkos/kokkos <kokkos@noreply.github.commailto:kokkos@noreply.github.com>
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

My current impl:
#ifdef _GLIBCXX_USE_NANOSLEEP
std::this_thread::sleep_for(time);
#else
usleep(time.count());
#endif

This assumes UNIX-type system, but I assume that should work fine for now.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120541935.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120943712.

@nmhamster
Copy link
Contributor

They are using Cygwin though right? Ie they have UNIX headers etc on the system?

S

Si Hammond
Scalable Computer Architectures
Sandia National Laboratories, NM
[Sent remotely, please excuse typing errors]


From: Christian Trott notifications@github.com
Sent: Monday, July 13, 2015 9:32:04 AM
To: kokkos/kokkos
Cc: Hammond, Simon David (-EXP)
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

?There are more projects who want to do that. They currently use Intel compiler. I think we need a fallback which at least works on windows.


From: Brent Perschbacher notifications@github.com
Sent: Monday, July 13, 2015 8:20 AM
To: kokkos/kokkos
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

There is at least one project(DICE) using Tpetra on windows regularly right now. I don't know how important that build is to them, Dan Turner could answer that though.

Brent

From: James Foucar <notifications@github.commailto:notifications@github.com>
Reply-To: kokkos/kokkos <reply@reply.github.commailto:reply@reply.github.com>
Date: Friday, July 10, 2015 4:28 PM
To: kokkos/kokkos <kokkos@noreply.github.commailto:kokkos@noreply.github.com>
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

My current impl:
#ifdef _GLIBCXX_USE_NANOSLEEP
std::this_thread::sleep_for(time);
#else
usleep(time.count());
#endif

This assumes UNIX-type system, but I assume that should work fine for now.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120541935.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120943712.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120969329.

@crtrott
Copy link
Member

crtrott commented Jul 13, 2015

?I don't know, but you might be right.


From: Si Hammond notifications@github.com
Sent: Monday, July 13, 2015 9:33 AM
To: kokkos/kokkos
Cc: Trott, Christian Robert (-EXP)
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

They are using Cygwin though right? Ie they have UNIX headers etc on the system?

S

Si Hammond
Scalable Computer Architectures
Sandia National Laboratories, NM
[Sent remotely, please excuse typing errors]


From: Christian Trott notifications@github.com
Sent: Monday, July 13, 2015 9:32:04 AM
To: kokkos/kokkos
Cc: Hammond, Simon David (-EXP)
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

?There are more projects who want to do that. They currently use Intel compiler. I think we need a fallback which at least works on windows.


From: Brent Perschbacher notifications@github.com
Sent: Monday, July 13, 2015 8:20 AM
To: kokkos/kokkos
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

There is at least one project(DICE) using Tpetra on windows regularly right now. I don't know how important that build is to them, Dan Turner could answer that though.

Brent

From: James Foucar <notifications@github.commailto:notifications@github.com>
Reply-To: kokkos/kokkos <reply@reply.github.commailto:reply@reply.github.com>
Date: Friday, July 10, 2015 4:28 PM
To: kokkos/kokkos <kokkos@noreply.github.commailto:kokkos@noreply.github.com>
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

My current impl:
#ifdef _GLIBCXX_USE_NANOSLEEP
std::this_thread::sleep_for(time);
#else
usleep(time.count());
#endif

This assumes UNIX-type system, but I assume that should work fine for now.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120541935.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120943712.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120969329.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120969965.

@bmpersc
Copy link

bmpersc commented Jul 13, 2015

I don't think they are using cygwin actually, but I don't know for sure. Their goal was to make libraries that are linkable by a native windows program so I would suspect not. Dan would have all the answers to these questions. I've CC'd him so that we don't have to continue playing the guessing game.

Dan, can you fill us in on how you are using Tpetra on windows and what your requirements are?

Thanks,

Brent

From: Christian Trott <notifications@github.commailto:notifications@github.com>
Reply-To: kokkos/kokkos <reply@reply.github.commailto:reply@reply.github.com>
Date: Monday, July 13, 2015 9:38 AM
To: kokkos/kokkos <kokkos@noreply.github.commailto:kokkos@noreply.github.com>
Cc: "Perschbacher, Brent M" <bmpersc@sandia.govmailto:bmpersc@sandia.gov>
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

?I don't know, but you might be right.


From: Si Hammond <notifications@github.commailto:notifications@github.com>
Sent: Monday, July 13, 2015 9:33 AM
To: kokkos/kokkos
Cc: Trott, Christian Robert (-EXP)
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

They are using Cygwin though right? Ie they have UNIX headers etc on the system?

S

Si Hammond
Scalable Computer Architectures
Sandia National Laboratories, NM
[Sent remotely, please excuse typing errors]


From: Christian Trott <notifications@github.commailto:notifications@github.com>
Sent: Monday, July 13, 2015 9:32:04 AM
To: kokkos/kokkos
Cc: Hammond, Simon David (-EXP)
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

?There are more projects who want to do that. They currently use Intel compiler. I think we need a fallback which at least works on windows.


From: Brent Perschbacher <notifications@github.commailto:notifications@github.com>
Sent: Monday, July 13, 2015 8:20 AM
To: kokkos/kokkos
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

There is at least one project(DICE) using Tpetra on windows regularly right now. I don't know how important that build is to them, Dan Turner could answer that though.

Brent

From: James Foucar <notifications@github.commailto:notifications@github.commailto:notifications@github.com>
Reply-To: kokkos/kokkos <reply@reply.github.commailto:reply@reply.github.commailto:reply@reply.github.com>
Date: Friday, July 10, 2015 4:28 PM
To: kokkos/kokkos <kokkos@noreply.github.commailto:kokkos@noreply.github.commailto:kokkos@noreply.github.com>
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

My current impl:
#ifdef _GLIBCXX_USE_NANOSLEEP
std::this_thread::sleep_for(time);
#else
usleep(time.count());
#endif

This assumes UNIX-type system, but I assume that should work fine for now.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120541935.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120943712.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120969329.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120969965.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120971511.

@bmpersc
Copy link

bmpersc commented Jul 13, 2015

Hi Brent,

We are not using cygwin. We compile Trilinos via the Intel 15 compilers. Is there anything else you wanted feedback on?

Thanks,
Dan

On Jul 13, 2015, at 9:59 AM, Perschbacher, Brent M <bmpersc@sandia.govmailto:bmpersc@sandia.gov> wrote:

I don't think they are using cygwin actually, but I don't know for sure. Their goal was to make libraries that are linkable by a native windows program so I would suspect not. Dan would have all the answers to these questions. I've CC'd him so that we don't have to continue playing the guessing game.

Dan, can you fill us in on how you are using Tpetra on windows and what your requirements are?

Thanks,

Brent

From: Christian Trott <notifications@github.commailto:notifications@github.com>
Reply-To: kokkos/kokkos <reply@reply.github.commailto:reply@reply.github.com>
Date: Monday, July 13, 2015 9:38 AM
To: kokkos/kokkos <kokkos@noreply.github.commailto:kokkos@noreply.github.com>
Cc: "Perschbacher, Brent M" <bmpersc@sandia.govmailto:bmpersc@sandia.gov>
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

?I don't know, but you might be right.


From: Si Hammond <notifications@github.commailto:notifications@github.com>
Sent: Monday, July 13, 2015 9:33 AM
To: kokkos/kokkos
Cc: Trott, Christian Robert (-EXP)
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

They are using Cygwin though right? Ie they have UNIX headers etc on the system?

S

Si Hammond
Scalable Computer Architectures
Sandia National Laboratories, NM
[Sent remotely, please excuse typing errors]


From: Christian Trott <notifications@github.commailto:notifications@github.com>
Sent: Monday, July 13, 2015 9:32:04 AM
To: kokkos/kokkos
Cc: Hammond, Simon David (-EXP)
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

?There are more projects who want to do that. They currently use Intel compiler. I think we need a fallback which at least works on windows.


From: Brent Perschbacher <notifications@github.commailto:notifications@github.com>
Sent: Monday, July 13, 2015 8:20 AM
To: kokkos/kokkos
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

There is at least one project(DICE) using Tpetra on windows regularly right now. I don't know how important that build is to them, Dan Turner could answer that though.

Brent

From: James Foucar <notifications@github.commailto:notifications@github.commailto:notifications@github.com>
Reply-To: kokkos/kokkos <reply@reply.github.commailto:reply@reply.github.commailto:reply@reply.github.com>
Date: Friday, July 10, 2015 4:28 PM
To: kokkos/kokkos <kokkos@noreply.github.commailto:kokkos@noreply.github.commailto:kokkos@noreply.github.com>
Subject: [EXTERNAL] Re: [kokkos] Synchronic in Kokkos::Impl (#44)

My current impl:
#ifdef _GLIBCXX_USE_NANOSLEEP
std::this_thread::sleep_for(time);
#else
usleep(time.count());
#endif

This assumes UNIX-type system, but I assume that should work fine for now.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120541935.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120943712.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120969329.

Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120969965.


Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-120971511.

@jgfouca
Copy link
Contributor

jgfouca commented Jul 14, 2015

OK, I'll redo the implementation to work on Windows.

@crtrott crtrott added the Feature Request Create new capability; will potentially require voting label Aug 10, 2015
@crtrott
Copy link
Member

crtrott commented Aug 10, 2015

Merged in.

@crtrott crtrott closed this as completed Aug 10, 2015
crtrott added a commit that referenced this issue Apr 11, 2016
This enables more scenarios of view assignments and subview taking
to occur. For example the following works now (for LayoutRight/Left):
Kokkos::View<int*> a("A",N1);
Kokkos::View<int[N1]> a1(a);

Also for LayoutRight similar scenarios in higher dimension work such as
Kokkos::View<int*[N1][N2]> a("A",N0);
Kokkos::View<int[N1][N2]> a1(a,0,Kokkos::ALL(),Kokkos::ALL());

Where appropriate those assignments do runtime checks of dimensions.

This is part of addressing issue #44.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Create new capability; will potentially require voting
Projects
None yet
Development

No branches or pull requests

5 participants