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

iqmc_cooper2 regression test fails in numba mode on linux OS #139

Closed
spasmann opened this issue Dec 11, 2023 · 3 comments
Closed

iqmc_cooper2 regression test fails in numba mode on linux OS #139

spasmann opened this issue Dec 11, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@spasmann
Copy link
Collaborator

spasmann commented Dec 11, 2023

My branch iqmc/source_tilt is failing the iqmc_cooper2 regression test in Numba mode when I push to GitHub. You can see the test results here.
What's odd is it passes in pure python and numba mode on Windows and Mac.

This seems to be a Linux issue because it also passes in Python but fails in Numba on Quartz. I've tried messing with some of the input parameters, increasing/decreasing particles, but still can't get the test to pass.

Mac results:
image

PC results:
image

Linux (Quartz) results:
image

@spasmann
Copy link
Collaborator Author

Interestingly, the test is passing when I double the number of cells in each dimension of the tally mesh from 20 to 40. Here is the original input deck

import numpy as np
import mcdc


# =============================================================================
# Set model
# =============================================================================
# A shielding problem based on Problem 2 of [Coper NSE 2001]
# https://ans.tandfonline.com/action/showCitFormats?doi=10.13182/NSE00-34

# Set materials
SigmaT = 5.0
c = 0.8
m_barrier = mcdc.material(capture=np.array([SigmaT]), scatter=np.array([[SigmaT * c]]))
SigmaT = 1.0
m_room = mcdc.material(capture=np.array([SigmaT]), scatter=np.array([[SigmaT * c]]))

# Set surfaces
sx1 = mcdc.surface("plane-x", x=0.0, bc="reflective")
sx2 = mcdc.surface("plane-x", x=2.0)
sx3 = mcdc.surface("plane-x", x=2.4)
sx4 = mcdc.surface("plane-x", x=4.0, bc="vacuum")
sy1 = mcdc.surface("plane-y", y=0.0, bc="reflective")
sy2 = mcdc.surface("plane-y", y=2.0)
sy3 = mcdc.surface("plane-y", y=4.0, bc="vacuum")

# Set cells
mcdc.cell([+sx1, -sx2, +sy1, -sy2], m_room)
mcdc.cell([+sx1, -sx4, +sy2, -sy3], m_room)
mcdc.cell([+sx3, -sx4, +sy1, -sy2], m_room)
mcdc.cell([+sx2, -sx3, +sy1, -sy2], m_barrier)

# =============================================================================
# iQMC Parameters
# =============================================================================
N = 2e2
Nx = Ny = 20
maxit = 2
tol = 1e-3
x = np.linspace(0, 4, num=Nx + 1)
y = np.linspace(0, 4, num=Ny + 1)
generator = "halton"

# fixed source in lower left corner
fixed_source = np.zeros((Nx, Ny))
fixed_source[0 : int(0.25 * Nx), 0 : int(0.25 * Nx)] = 1

phi0 = np.ones((Nx, Ny))

mcdc.iQMC(
    x=x,
    y=y,
    fixed_source=fixed_source,
    phi0=phi0,
    maxitt=maxit,
    tol=tol,
    generator=generator,
    score=["tilt-x", "tilt-y", "tilt-xy"],
)

# =============================================================================
# Set tally, setting, and run mcdc
# =============================================================================
# Setting
mcdc.setting(N_particle=N)
# Run
mcdc.run()

@jpmorgan98
Copy link
Collaborator

Could we change the test to do that? I know that's an unsatisfying result but this would allow us to move on

@jpmorgan98 jpmorgan98 added the bug Something isn't working label Dec 20, 2023
@spasmann
Copy link
Collaborator Author

Sorry forgot to follow up on this, but that's what I did. The test is passing now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants