<div><div>OpenMP did not prevent OpenCL, C11, C++11 or Fortran 2008 from introducing parallelism. Not sure if your comment was meant to be serious, but it appears unfounded nonetheless.</div></div><div><br></div><div>Jeff</div><div><br><div class="gmail_quote"><div>On Sun, Mar 12, 2017 at 11:16 AM Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg">Implementation-defined, but it's exactly the same as malloc, which also doesn't promise unfaulted pages. This is one reason some of us keep saying that OpenMP sucks. It's a shitty standard that obstructs better standards from being created.</div><div class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On March 12, 2017 11:19:49 AM MDT, Jeff Hammond <<a href="http://jeff.science" class="gmail_msg" target="_blank">jeff.science</a>@<a href="http://gmail.com" class="gmail_msg" target="_blank">gmail.com</a>> wrote:<blockquote class="gmail_quote gmail_msg" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">On Sat, Mar 11, 2017 at 9:00 AM Jed Brown <<a href="mailto:jed@jedbrown.org" class="gmail_msg" target="_blank">jed@jedbrown.org</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Jeff Hammond <<a href="mailto:jeff.science@gmail.com" class="gmail_msg" target="_blank">jeff.science@gmail.com</a>> writes:<br class="gmail_msg">
> I agree 100% that multithreaded codes that fault pages from the main thread in a NUMA environment are doing something wrong ;-)<br class="gmail_msg">
><br class="gmail_msg">
> Does calloc *guarantee* pages are not mapped? If I calloc(8), do I get the zero page or part of the arena that's already mapped that is zeroed by the heap manager?<br class="gmail_msg">
<br class="gmail_msg">
Is your argument that calloc() should never be used in multi-threaded code?<br class="gmail_msg">
</blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I never use it for code that I want to behave well in a NUMA environment. </div><div class="gmail_msg"><br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
If the allocation is larger than MMAP_THRESHOLD (128 KiB by default for<br class="gmail_msg">
glibc) then it calls mmap. This obviously leaves an intermediate size<br class="gmail_msg">
that could be poorly mapped (assuming 4 KiB pages), but it's also so<br class="gmail_msg">
small that it easily fits in cache.</blockquote><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Is this behavior standardized or merely implementation-defined? I'm not interested in writing code that assumes Linux/glibc. </div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Jeff </div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
</blockquote></div></div><div class="gmail_msg">-- <br class="gmail_msg"></div><div data-smartmail="gmail_signature" class="gmail_msg">Jeff Hammond<br class="gmail_msg"><a href="mailto:jeff.science@gmail.com" class="gmail_msg" target="_blank">jeff.science@gmail.com</a><br class="gmail_msg"><a href="http://jeffhammond.github.io/" class="gmail_msg" target="_blank">http://jeffhammond.github.io/</a></div>
</blockquote></div></div></blockquote></div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature">Jeff Hammond<br><a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a></div>