<div class="gmail_quote">On Sat, Mar 17, 2012 at 10:17, Mark F. Adams <span dir="ltr"><<a href="mailto:mark.adams@columbia.edu">mark.adams@columbia.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">What does namespaced mean exactly?</div></blockquote><div><br></div><div>The symbol has to contain (usually prefixed) an identifier that makes it unique to PETSc. Currently this is Petsc, Vec, IS, Mat, DM, AO, PC, KSP, SNES, TS, EventPerfLog, EventRefLog, and Characteristic.</div>
<div><br></div><div>Vec and Mat are the most likely to conflict with user code, but also the most annoying to type if we renamed them all as PetscVec. Others would have low impact and should be changed. We've had this discussion before and it's not really what I wanted to bring up. The point is that if you define a symbol with extern linkage that does not have one of the prefixes above, it should be considered a bug.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div></div><div class="h5"><div><b><br></b><div><div>On Mar 17, 2012, at 10:58 AM, Jed Brown wrote:</div>
<br><blockquote type="cite"><div><b>Every</b> symbol (both functions and data) with extern linkage <b>must</b> be namespaced to avoid link- or run-time conflicts when the user (or any other library to be used in the same application) defines their own variable called "rankkey" or "actions" or "objects" or "ListCreate" or "createLevel", etc. No exceptions.</div>
<div><br></div><div>Either use static linkage or namespace the symbols. Some old code was sloppy about this (and needs to be fixed), but we really need to be careful to never do this is new code.</div><div><br></div><div>
You can build a libpetsc.a (--with-shared-libraries=0) and search for any defined symbols (T, B, R, C, D) that are not namespaced. Some examples below.</div><div><br></div><div><b><font face="'courier new', monospace">pthread.c:</font></b></div>
<div><div><font face="'courier new', monospace">00000000000004c5 T DoCoreAffinity</font></div><div><font face="'courier new', monospace">0000000000000232 T FuncFinish</font></div><div><font face="'courier new', monospace">0000000000000010 B MainThreadCoreAffinity</font></div>
</div><div><div><font face="'courier new', monospace">0000000000000100 R ThreadAffinityPolicyTypes</font></div><div><font face="'courier new', monospace">0000000000000008 B ThreadCoreAffinity</font></div>
<div>
<font face="'courier new', monospace">0000000000000060 R ThreadSynchronizationTypes</font></div></div><div><div><font face="'courier new', monospace">0000000000000004 C rankkey</font></div><div><font face="'courier new', monospace">0000000000000018 B threadranks<br>
</font></div><div style="font-weight:bold"><font face="'courier new', monospace"><br></font></div></div><div style="font-weight:bold"><font face="'courier new', monospace">plog.c:</font></div><div><div><font face="'courier new', monospace">0000000000000000 B actions</font></div>
<div><font face="'courier new', monospace">0000000000000010 B logActions<br></font></div><div><font face="'courier new', monospace">0000000000000014 B logObjects</font></div><div><font face="'courier new', monospace">0000000000000038 D maxActions</font></div>
<div><font face="'courier new', monospace">000000000000003c D maxObjects</font></div><div><font face="'courier new', monospace">0000000000000018 B numActions</font></div><div><font face="'courier new', monospace">000000000000001c B numObjects</font></div>
<div><font face="'courier new', monospace">0000000000000020 B numObjectsDestroyed</font></div><div><font face="'courier new', monospace">0000000000000008 B objects</font></div><div><div><font face="'courier new', monospace">0000000000000040 D traceblanks</font></div>
<div><font face="'courier new', monospace">00000000000000d8 B tracefile</font></div><div><font face="'courier new', monospace">00000000000000e0 B tracelevel</font></div><div><font face="'courier new', monospace">0000000000000060 D tracespace</font></div>
<div><font face="'courier new', monospace">00000000000000e8 B tracetime</font></div></div></div><div style="font-weight:bold"><font face="'courier new', monospace"><br></font></div><div><b><font face="'courier new', monospace">ctetgen.c:</font></b></div>
<div><div><div><font face="'courier new', monospace">000000000000ade7 T ArrayPoolCreate</font></div><div><font face="'courier new', monospace">000000000000b979 T ArrayPoolDestroy</font></div><div><font face="'courier new', monospace">000000000000b0cf T ArrayPoolGetBlock</font></div>
<div><font face="'courier new', monospace">000000000000b6f7 T ArrayPoolNewIndex</font></div><div><font face="'courier new', monospace">000000000000ac41 T ArrayPoolRestart</font></div><div><font face="'courier new', monospace">0000000000006cfe T ListAppend</font></div>
<div><font face="'courier new', monospace">00000000000082ec T ListClear</font></div><div><font face="'courier new', monospace">00000000000069c7 T ListCreate</font></div><div><font face="'courier new', monospace">00000000000077ad T ListDelete</font></div>
<div><font face="'courier new', monospace">0000000000008491 T ListDestroy</font></div><div><font face="'courier new', monospace">0000000000007ae2 T ListHasItem</font></div><div><font face="'courier new', monospace">000000000000718e T ListInsert</font></div>
<div><font face="'courier new', monospace">0000000000007ea0 T ListItem</font></div><div><font face="'courier new', monospace">0000000000007cf5 T ListLength</font></div><div><font face="'courier new', monospace">00000000000080c6 T ListSetItem</font></div>
<div><font face="'courier new', monospace">00000000000096af T MemoryPoolAlloc</font></div><div><font face="'courier new', monospace">000000000000a415 T MemoryPoolCreate</font></div><div><font face="'courier new', monospace">0000000000009a9d T MemoryPoolDealloc</font></div>
<div><font face="'courier new', monospace">000000000000a827 T MemoryPoolDestroy</font></div><div><font face="'courier new', monospace">000000000000a1ed T MemoryPoolRestart</font></div><div><font face="'courier new', monospace">0000000000009c6a T MemoryPoolTraversalInit</font></div>
<div><font face="'courier new', monospace">0000000000009e6e T MemoryPoolTraverse</font></div></div><div><div><font face="'courier new', monospace">0000000000008868 T QueueCreate</font></div><div><font face="'courier new', monospace">0000000000009324 T QueueDestroy</font></div>
<div><font face="'courier new', monospace">0000000000008c23 T QueueLength</font></div><div><font face="'courier new', monospace">00000000000090b0 T QueuePop</font></div><div><font face="'courier new', monospace">0000000000008dd5 T QueuePush</font></div>
</div><div><font face="'courier new', monospace">0000000000003f06 T lu_decmp</font></div><div><font face="'courier new', monospace">0000000000004303 T lu_solve</font></div></div><div><font face="'courier new', monospace"><br>
</font></div><div><b><font face="'courier new', monospace">gamg.c/agg.c/geo.c/tools.c:</font></b></div><div><div><font face="'courier new', monospace">0000000000000926 T createLevel</font></div><div><font face="'courier new', monospace">0000000000000050 C gamg_setup_events</font></div>
</div><div><div><font face="'courier new', monospace">00000000000054c6 T formProl0</font></div></div><div><div><font face="'courier new', monospace">0000000000002989 T smoothAggs</font></div></div><div><div>
<font face="'courier new', monospace">0000000000000629 T geo_mg_compare</font></div><div><font face="'courier new', monospace">00000000000012f0 T getGIDsOnSquareGraph</font></div></div><div><font face="'courier new', monospace">0000000000001292 T triangulateAndFormProl<br>
</font></div><div><div><font face="'courier new', monospace">0000000000000629 T createSimpleGraph</font></div><div><font face="'courier new', monospace">00000000000028fe T getDataWithGhosts<br></font></div>
<div><font face="'courier new', monospace">0000000000001415 T scaleFilterGrap</font><br></div></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br>