<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Dear Federico,
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">If I remember correctly, until after the scope of INITIALIZE, mcget_ncount() will return the total number of neutron histories. </div>
<div class=""><br class="">
</div>
<div class="">So what we typically do in INITIALIZE is to assign some normalisation constants, including 1.0/mcget_ncount(). For an example, look at the ESS_butterfly.comp.</div>
<div class=""><br class="">
</div>
<div class="">Alternatively, you may also simply</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">#ifdef USE_MPI</div>
<div class=""> /* We always repeat by the number of nodes in an MPI run */</div>
<div class=""> p /= mpi_node_count;</div>
<div class="">#endif</div>
</div>
<div class=""><br class="">
</div>
<div class="">- example taken from Virtual_input.comp.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Best and hope this helps,</div>
<div class=""><br class="">
</div>
<div class="">Peter</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<table border="0" cellspacing="0" cellpadding="0" width="400px" style="font-family: Arial; font-size: 8pt; color: black; border-collapse: collapse; border-spacing: 2px;" class="">
<tbody class="">
<tr class="">
<td width="400px" colspan="2" valign="top" style="font-weight: bold; font-size: 8pt; margin-bottom: 0px; font-family: Arial;" class="">
Peter Kjær Willendrup</td>
</tr>
<tr class="">
<td width="400px" colspan="2" valign="top" style="color: rgb(155, 155, 155); font-size: 8pt; margin-bottom: 0px; font-family: Arial;" class="">
Senior Research Engineer, Special Advisor</td>
</tr>
<tr class="">
<td width="400px" colspan="2" valign="top" style="font-size: 8pt; margin-bottom: 0px; font-family: Arial;" class="">
</td>
</tr>
<tr class="">
<td width="400px" colspan="2" valign="top" style="font-size: 8pt; margin-bottom: 0px; font-family: Arial; padding-bottom: 5px;" class="">
DTU Physics</td>
</tr>
</tbody>
</table>
</span><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><span><span><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><span><span><br class="Apple-interchange-newline">
<span><img apple-inline="yes" id="B13607DC-D59F-473F-9254-9A1B06B78E3E" src="cid:image001.gif@01CCCAF1.5E6331F0" class=""></span><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-collapse: separate; border-spacing: 0px; -webkit-text-decorations-in-effect: none;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="border-collapse: collapse; font-size: 15px;"><br class="Apple-interchange-newline">
<br class="">
</span></span></span></span><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="border-collapse: collapse; font-family: Calibri, sans-serif; font-size: 15px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="400" style="width: 300pt; border-collapse: collapse; position: static; z-index: auto;">
<tbody class="">
<tr class="">
<td width="357" valign="top" style="width: 267.5pt; padding: 0cm;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<b class=""><span style="font-size: 8pt; font-family: Arial, sans-serif; color: black;" class="">Technical University of Denmark<o:p class=""></o:p></span></b></div>
</td>
<td width="43" rowspan="8" valign="top" style="width: 32.5pt; padding: 0cm;" class="">
<br class="">
</td>
</tr>
</tbody>
</table>
</span></span></span></span><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><span><span><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><span><span><br class="Apple-interchange-newline">
<span><img apple-inline="yes" id="B20B5FD3-9024-48F8-A0BE-71F556E62021" src="cid:image002.gif@01CCCAF1.5E6331F0" class=""></span><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; border-collapse: separate;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="border-collapse: collapse; font-family: Calibri, sans-serif;">
<div class=""><br class="Apple-interchange-newline">
<br class="">
</div>
</span></span></span></span></span></span></span><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-collapse: collapse; font-family: Calibri, sans-serif; font-size: 15px;">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="400" style="width: 300pt; border-collapse: collapse; position: static; z-index: auto;">
<tbody class="">
<tr class="">
<td width="400" colspan="2" valign="top" style="width: 300pt; padding: 0cm 0cm 3.75pt;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="400" style="width: 300pt; border-collapse: collapse; position: static; z-index: auto;">
<tbody class="">
<tr class="">
<td style="padding: 0cm;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 8pt; font-family: Arial, sans-serif; color: black;" class="">Department o</span><span style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(31, 73, 125);" class="">f</span><span style="font-size: 8pt; font-family: Arial, sans-serif; color: black;" class=""> Physics<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 8pt; font-family: Arial, sans-serif; color: black;" class="">Fysikvej</span></div>
</td>
</tr>
<tr class="">
<td style="padding: 0cm;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 8pt; font-family: Arial, sans-serif; color: black;" class="">Building 307<o:p class=""></o:p></span></div>
</td>
</tr>
<tr class="">
<td style="padding: 0cm;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 8pt; font-family: Arial, sans-serif; color: black;" class="">DK-2800 Kongens Lyngby<o:p class=""></o:p></span></div>
</td>
</tr>
<tr class="">
<td style="padding: 0cm;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 8pt; font-family: Arial, sans-serif; color: black;" class="">Direct +45 2125 4612<o:p class=""></o:p></span></div>
</td>
</tr>
<tr class="">
<td style="padding: 0cm;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 8pt; font-family: Arial, sans-serif; color: black;" class="">Mobil +45 2125 4612<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 8pt; font-family: Arial, sans-serif; color: black;" class="">Fax +45 4593 2399<o:p class=""></o:p></span></div>
</td>
</tr>
</tbody>
</table>
</span></div>
</td>
</tr>
</tbody>
</table>
</span><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; border-collapse: separate;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="border-collapse: collapse;"><a href="mailto:pkwi@fysik.dtu.dk" class="">pkwi@fysik.dtu.dk</a></span></span></span></span></span></span>
</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 10 Apr 2017, at 15:54 , Federico M. Bertalot <<a href="mailto:federicobertalot@cnea.gov.ar" class="">federicobertalot@cnea.gov.ar</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Hello,<br class="">
<br class="">
i have written my own source component, and in order to normalize the results i defined the weight of each neutron as:<br class="">
<br class="">
p=1.0/mcget_ncount()<br class="">
<br class="">
it works fine for one processor, but for more processors mcget_ncount() seems to return the number of neutron histories running on each processor, instead of the total number of neutron histories. Then, the normalization of the results changes with the number
of processors. Which is the best solution to this problem?<br class="">
<br class="">
<br class="">
Thank you very much,<br class="">
<br class="">
Federico.<br class="">
<br class="">
_______________________________________________<br class="">
mcstas-users mailing list<br class="">
<a href="mailto:mcstas-users@mcstas.org" class="">mcstas-users@mcstas.org</a><br class="">
http://mailman.mcstas.org/cgi-bin/mailman/listinfo/mcstas-users<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>