jit failing

64 views
Skip to first unread message

Emma Wolpert

unread,
May 9, 2021, 7:01:03 AM5/9/21
to hoomd-users
Hi

I'm compiling hoomd-blue (version 2.9) from source in order to install jit and it all seems to be working apart from when i do ctest I have 3 tests failing:

274/363 Test #274: enthalpic_interaction.py-cpu ......................***Failed    0.73 sec

        Start 275: test_jit_external_field.py-cpu

275/363 Test #275: test_jit_external_field.py-cpu ....................***Failed    0.38 sec

        Start 276: test_jit_external_field.py-mpi-cpu

276/363 Test #276: test_jit_external_field.py-mpi-cpu ................***Failed    2.38 sec


I'm keen on using the external field function of jit so was wondering if you have any pointers of how I might be debug this?

Thanks,

Emma

Tim Moore

unread,
May 9, 2021, 9:56:25 PM5/9/21
to hoomd...@googlegroups.com
Hi Emma,

It would be helpful to see the output of those tests...which specific tests are failing? In my experience, building against an incompatible version of LLVM can cause this. What version are you using?

Tim

--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/3be5512f-5a40-4ccb-b287-038b36bea544n%40googlegroups.com.


--
Tim Moore

Emma Wolpert

unread,
May 10, 2021, 3:05:32 AM5/10/21
to hoomd-users
Hi Tim,

I'm using version 6 of LLVM as I read somewhere that its compatible with version 5-9, please let me know if there is another version I'm meant to be using. Heres the output I get in the log file for the failed tests:


274/363 Testing: enthalpic_interaction.py-cpu
274/363 Test: enthalpic_interaction.py-cpu
Command: "/opt/homebrew/bin/python3" "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/enthalpic_interaction.py" "--mode=cpu"
Directory: /Users/Emma/test/hoomd-blue/build/hoomd/hpmc/test-py
"enthalpic_interaction.py-cpu" start time: May 09 12:00 BST
Output:
----------------------------------------------------------
HOOMD-blue v2.9.6 DOUBLE HPMC_MIXED MPI 
Compiled: 09/05/2021
Copyright (c) 2009-2019 The Regents of the University of Michigan.
-----
You are using HOOMD-blue. Please cite the following:
* J A Anderson, J Glaser, and S C Glotzer. "HOOMD-blue: A Python package for
  high-performance molecular dynamics and hard particle Monte Carlo
  simulations", Computational Materials Science 173 (2020) 109363
-----
-----
You are using HPMC. Please cite the following:
* J A Anderson, M E Irrgang, and S C Glotzer. "Scalable Metropolis Monte Carlo
  for simulation of hard shapes", Computer Physics Communications 204 (2016) 21
  --30
-----
HOOMD-blue is running on the CPU
test_head_to_tail_antiparallel (__main__.enthalpic_dipole_interaction) ... enthalpic_interaction.py:081  |              init.read_snapshot(self.snapshot);
notice(2): Group "all" created containing 2 particles
enthalpic_interaction.py:082  |              self.mc = hpmc.integrate.sphere(seed=10,a=0,d=0);
enthalpic_interaction.py:084  |              self.patch = jit.patch.user(mc=self.mc,r_cut=self.r_cut, code=self.dipole_dipole);
**ERROR**: EvalFactory: error: expected ')' at end of argument list
define float @eval(%struct.vec3* nocapture nonnull readonly align 4 dereferenceable(12) %0, i32 %1, %struct.quat* nocapture nonnull readonly align 4 dereferenceable(16) %2, float %3, float %4, i32 %5, %struct.quat* nocapture nonnull readonly align 4 dereferenceable(16) %6, float %7, float %8) local_unnamed_addr #0 {
                                                                                        ^

ERROR
ERROR
test_head_to_tail_parallel (__main__.enthalpic_dipole_interaction) ... enthalpic_interaction.py:051  |              init.read_snapshot(self.snapshot);
**ERROR**: Cannot initialize more than once
ERROR
ERROR
test_head_to_tail_parallel_union (__main__.enthalpic_dipole_interaction) ... enthalpic_interaction.py:168  |              init.read_snapshot(self.snapshot);
**ERROR**: Cannot initialize more than once
ERROR
ERROR
test_side_to_side_parallel (__main__.enthalpic_dipole_interaction) ... enthalpic_interaction.py:139  |             init.read_snapshot(self.snapshot);
**ERROR**: Cannot initialize more than once
ERROR
ERROR
test_alphas (__main__.patch_alpha_user) ... enthalpic_interaction.py:223  |          system = init.read_snapshot(snapshot);
**ERROR**: Cannot initialize more than once
ERROR
test_alphas (__main__.patch_alpha_user_union) ... enthalpic_interaction.py:296  |          system = init.read_snapshot(snapshot);
**ERROR**: Cannot initialize more than once
ERROR

======================================================================
ERROR: test_head_to_tail_antiparallel (__main__.enthalpic_dipole_interaction)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/enthalpic_interaction.py", line 84, in test_head_to_tail_antiparallel
    self.patch = jit.patch.user(mc=self.mc,r_cut=self.r_cut, code=self.dipole_dipole);
  File "/Users/Emma/test/hoomd-blue/build/hoomd/jit/patch.py", line 158, in __init__
    self.cpp_evaluator = _jit.PatchEnergyJIT(hoomd.context.exec_conf, llvm_ir, r_cut, array_size);
RuntimeError: Error compiling JIT code.

======================================================================
ERROR: test_head_to_tail_antiparallel (__main__.enthalpic_dipole_interaction)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/enthalpic_interaction.py", line 194, in tearDown
    del self.patch;
AttributeError: patch

======================================================================
ERROR: test_head_to_tail_parallel (__main__.enthalpic_dipole_interaction)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/enthalpic_interaction.py", line 51, in test_head_to_tail_parallel
    init.read_snapshot(self.snapshot);
  File "/Users/Emma/test/hoomd-blue/build/hoomd/init.py", line 236, in read_snapshot
    raise RuntimeError("Error initializing");
RuntimeError: Error initializing

======================================================================
ERROR: test_head_to_tail_parallel (__main__.enthalpic_dipole_interaction)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/enthalpic_interaction.py", line 193, in tearDown
    del self.mc;
AttributeError: mc

======================================================================
ERROR: test_head_to_tail_parallel_union (__main__.enthalpic_dipole_interaction)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/enthalpic_interaction.py", line 168, in test_head_to_tail_parallel_union
    init.read_snapshot(self.snapshot);
  File "/Users/Emma/test/hoomd-blue/build/hoomd/init.py", line 236, in read_snapshot
    raise RuntimeError("Error initializing");
RuntimeError: Error initializing

======================================================================
ERROR: test_head_to_tail_parallel_union (__main__.enthalpic_dipole_interaction)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/enthalpic_interaction.py", line 193, in tearDown
    del self.mc;
AttributeError: mc

======================================================================
ERROR: test_side_to_side_parallel (__main__.enthalpic_dipole_interaction)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/enthalpic_interaction.py", line 139, in test_side_to_side_parallel
    init.read_snapshot(self.snapshot);
  File "/Users/Emma/test/hoomd-blue/build/hoomd/init.py", line 236, in read_snapshot
    raise RuntimeError("Error initializing");
RuntimeError: Error initializing

======================================================================
ERROR: test_side_to_side_parallel (__main__.enthalpic_dipole_interaction)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/enthalpic_interaction.py", line 193, in tearDown
    del self.mc;
AttributeError: mc

======================================================================
ERROR: test_alphas (__main__.patch_alpha_user)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/enthalpic_interaction.py", line 223, in setUp
    system = init.read_snapshot(snapshot);
  File "/Users/Emma/test/hoomd-blue/build/hoomd/init.py", line 236, in read_snapshot
    raise RuntimeError("Error initializing");
RuntimeError: Error initializing

======================================================================
ERROR: test_alphas (__main__.patch_alpha_user_union)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/enthalpic_interaction.py", line 296, in setUp
    system = init.read_snapshot(snapshot);
  File "/Users/Emma/test/hoomd-blue/build/hoomd/init.py", line 236, in read_snapshot
    raise RuntimeError("Error initializing");
RuntimeError: Error initializing

----------------------------------------------------------------------
Ran 6 tests in 0.335s

FAILED (errors=10)
<end of output>
Test time =   0.73 sec
----------------------------------------------------------
Test Failed.
"enthalpic_interaction.py-cpu" end time: May 09 12:00 BST
"enthalpic_interaction.py-cpu" time elapsed: 00:00:00
----------------------------------------------------------

275/363 Testing: test_jit_external_field.py-cpu
275/363 Test: test_jit_external_field.py-cpu
Command: "/opt/homebrew/bin/python3" "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/test_jit_external_field.py" "--mode=cpu"
Directory: /Users/Emma/test/hoomd-blue/build/hoomd/hpmc/test-py
"test_jit_external_field.py-cpu" start time: May 09 12:00 BST
Output:
----------------------------------------------------------
HOOMD-blue v2.9.6 DOUBLE HPMC_MIXED MPI 
Compiled: 09/05/2021
Copyright (c) 2009-2019 The Regents of the University of Michigan.
-----
You are using HOOMD-blue. Please cite the following:
* J A Anderson, J Glaser, and S C Glotzer. "HOOMD-blue: A Python package for
  high-performance molecular dynamics and hard particle Monte Carlo
  simulations", Computational Materials Science 173 (2020) 109363
-----
HOOMD-blue is running on the CPU
test_gravity (__main__.jit_external_field)
This test simulates a sedimentation experiment by using an elongated ... -----
You are using HPMC. Please cite the following:
* J A Anderson, M E Irrgang, and S C Glotzer. "Scalable Metropolis Monte Carlo
  for simulation of hard shapes", Computer Physics Communications 204 (2016) 21
  --30
-----
test_jit_external_field.py:000  |  """This module contains the operation functions for this project."""
from __future__ import print_function, division, absolute_import

import unittest

import hoomd
hoomd.context.initialize()

class jit_external_field(unittest.TestCase):

    def test_gravity(self):
        """This test simulates a sedimentation experiment by using an elongated
        box in the z-dimension and adding an effective gravitational
        potential with a wall. Note that it is technically probabilistic in
        nature, but we use enough particles and a strong enough gravitational
        potential that the probability of particles rising in the simulation is
        vanishingly small."""
        from hoomd import hpmc, jit
        import numpy as np


        # Just creating a simple cubic lattice # is fine here.
        system = hoomd.init.create_lattice(hoomd.lattice.sc(
test_jit_external_field.py:000  |  """This module contains the operation functions for this project."""
from __future__ import print_function, division, absolute_import

import unittest

import hoomd
hoomd.context.initialize()

class jit_external_field(unittest.TestCase):

    def test_gravity(self):
        """This test simulates a sedimentation experiment by using an elongated
        box in the z-dimension and adding an effective gravitational
        potential with a wall. Note that it is technically probabilistic in
        nature, but we use enough particles and a strong enough gravitational
        potential that the probability of particles rising in the simulation is
        vanishingly small."""
        from hoomd import hpmc, jit
        import numpy as np


        # Just creating a simple cubic lattice # is fine here.
        system = hoomd.init.create_lattice(hoomd.lattice.sc(
notice(2): Group "all" created containing 125 particles
test_jit_external_field.py:026  |          mc = hpmc.integrate.sphere(80391, d=0.1, a=0.1)
test_jit_external_field.py:027  |          mc.overlap_checks.set('A', 'A', False)
test_jit_external_field.py:000  |  """This module contains the operation functions for this project."""
from __future__ import print_function, division, absolute_import

import unittest

import hoomd
hoomd.context.initialize()

class jit_external_field(unittest.TestCase):

    def test_gravity(self):
        """This test simulates a sedimentation experiment by using an elongated
        box in the z-dimension and adding an effective gravitational
        potential with a wall. Note that it is technically probabilistic in
        nature, but we use enough particles and a strong enough gravitational
        potential that the probability of particles rising in the simulation is
        vanishingly small."""
        from hoomd import hpmc, jit
        import numpy as np


        # Just creating a simple cubic lattice # is fine here.
        system = hoomd.init.create_lattice(hoomd.lattice.sc(
            1), n=5)

        mc = hpmc.integrate.sphere(80391, d=0.1, a=0.1)
        mc.overlap_checks.set('A', 'A', False)
        mc.shape_param.set('A', diameter=1)

        # Expand system, add walls, and add gravity
        hoomd.update.box_resize(Lx=system.box.Lx*1.5, Ly = system.box.Ly*1.5,
test_jit_external_field.py:034  |          wall = hpmc.field.wall(mc)
test_jit_external_field.py:035  |          wall.add_plane_wall([0, 0, 1], [0, 0, -system.box.Lz/2])
test_jit_external_field.py:036  |          gravity_field = hoomd.jit.external.user(mc=mc, code="return 1000*(r_i.z + box.getL().z/2);")
**ERROR**: ExternalFieldEvalFactory: error: expected ')' at end of argument list
define float @eval(%struct.BoxDim* nocapture nonnull readonly align 8 dereferenceable(123) %0, i32 %1, %struct.vec3* nocapture readonly %2, %struct.quat* nocapture nonnull readnone align 8 dereferenceable(32) %3, double %4, double %5) local_unnamed_addr #0 {
                                                                                           ^

ERROR

======================================================================
ERROR: test_gravity (__main__.jit_external_field)
This test simulates a sedimentation experiment by using an elongated
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/test_jit_external_field.py", line 36, in test_gravity
    gravity_field = hoomd.jit.external.user(mc=mc, code="return 1000*(r_i.z + box.getL().z/2);")
  File "/Users/Emma/test/hoomd-blue/build/hoomd/jit/external.py", line 142, in __init__
    self.cpp_compute = cls(hoomd.context.current.system_definition,
RuntimeError: Error compiling JIT code.

----------------------------------------------------------------------
Ran 1 test in 0.112s

FAILED (errors=1)
<end of output>
Test time =   0.38 sec
----------------------------------------------------------
Test Failed.
"test_jit_external_field.py-cpu" end time: May 09 12:00 BST
"test_jit_external_field.py-cpu" time elapsed: 00:00:00
----------------------------------------------------------

276/363 Testing: test_jit_external_field.py-mpi-cpu
276/363 Test: test_jit_external_field.py-mpi-cpu
Command: "/opt/homebrew/bin/mpiexec" "-n" "2" "/opt/homebrew/bin/python3" "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/test_jit_external_field.py" "--mode=cpu"
Directory: /Users/Emma/test/hoomd-blue/build/hoomd/hpmc/test-py
"test_jit_external_field.py-mpi-cpu" start time: May 09 12:00 BST
Output:
----------------------------------------------------------
HOOMD-blue v2.9.6 DOUBLE HPMC_MIXED MPI 
Compiled: 09/05/2021
Copyright (c) 2009-2019 The Regents of the University of Michigan.
-----
You are using HOOMD-blue. Please cite the following:
* J A Anderson, J Glaser, and S C Glotzer. "HOOMD-blue: A Python package for
  high-performance molecular dynamics and hard particle Monte Carlo
  simulations", Computational Materials Science 173 (2020) 109363
-----
Ranks 0-1: HOOMD-blue is running on the CPU
test_gravity (__main__.jit_external_field)
This test simulates a sedimentation experiment by using an elongated ... test_gravity (__main__.jit_external_field)
This test simulates a sedimentation experiment by using an elongated ... -----
You are using HPMC. Please cite the following:
* J A Anderson, M E Irrgang, and S C Glotzer. "Scalable Metropolis Monte Carlo
  for simulation of hard shapes", Computer Physics Communications 204 (2016) 21
  --30
-----
test_jit_external_field.py:000  |  """This module contains the operation functions for this project."""
from __future__ import print_function, division, absolute_import

import unittest

import hoomd
hoomd.context.initialize()

class jit_external_field(unittest.TestCase):

    def test_gravity(self):
        """This test simulates a sedimentation experiment by using an elongated
        box in the z-dimension and adding an effective gravitational
        potential with a wall. Note that it is technically probabilistic in
        nature, but we use enough particles and a strong enough gravitational
        potential that the probability of particles rising in the simulation is
        vanishingly small."""
        from hoomd import hpmc, jit
        import numpy as np


        # Just creating a simple cubic lattice # is fine here.
        system = hoomd.init.create_lattice(hoomd.lattice.sc(
test_jit_external_field.py:000  |  """This module contains the operation functions for this project."""
from __future__ import print_function, division, absolute_import

import unittest

import hoomd
hoomd.context.initialize()

class jit_external_field(unittest.TestCase):

    def test_gravity(self):
        """This test simulates a sedimentation experiment by using an elongated
        box in the z-dimension and adding an effective gravitational
        potential with a wall. Note that it is technically probabilistic in
        nature, but we use enough particles and a strong enough gravitational
        potential that the probability of particles rising in the simulation is
        vanishingly small."""
        from hoomd import hpmc, jit
        import numpy as np


        # Just creating a simple cubic lattice # is fine here.
        system = hoomd.init.create_lattice(hoomd.lattice.sc(
HOOMD-blue is using domain decomposition: n_x = 1 n_y = 1 n_z = 2.
1 x 1 x 2 local grid on 1 nodes
notice(2): Group "all" created containing 125 particles
test_jit_external_field.py:026  |          mc = hpmc.integrate.sphere(80391, d=0.1, a=0.1)
test_jit_external_field.py:027  |          mc.overlap_checks.set('A', 'A', False)
test_jit_external_field.py:000  |  """This module contains the operation functions for this project."""
from __future__ import print_function, division, absolute_import

import unittest

import hoomd
hoomd.context.initialize()

class jit_external_field(unittest.TestCase):

    def test_gravity(self):
        """This test simulates a sedimentation experiment by using an elongated
        box in the z-dimension and adding an effective gravitational
        potential with a wall. Note that it is technically probabilistic in
        nature, but we use enough particles and a strong enough gravitational
        potential that the probability of particles rising in the simulation is
        vanishingly small."""
        from hoomd import hpmc, jit
        import numpy as np


        # Just creating a simple cubic lattice # is fine here.
        system = hoomd.init.create_lattice(hoomd.lattice.sc(
            1), n=5)

        mc = hpmc.integrate.sphere(80391, d=0.1, a=0.1)
        mc.overlap_checks.set('A', 'A', False)
        mc.shape_param.set('A', diameter=1)

        # Expand system, add walls, and add gravity
        hoomd.update.box_resize(Lx=system.box.Lx*1.5, Ly = system.box.Ly*1.5,
test_jit_external_field.py:034  |          wall = hpmc.field.wall(mc)
test_jit_external_field.py:035  |          wall.add_plane_wall([0, 0, 1], [0, 0, -system.box.Lz/2])
test_jit_external_field.py:036  |          gravity_field = hoomd.jit.external.user(mc=mc, code="return 1000*(r_i.z + box.getL().z/2);")
ERROR
ERROR

======================================================================
ERROR: test_gravity (__main__.jit_external_field)
This test simulates a sedimentation experiment by using an elongated
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/test_jit_external_field.py", line 36, in test_gravity
    gravity_field = hoomd.jit.external.user(mc=mc, code="return 1000*(r_i.z + box.getL().z/2);")
  File "/Users/Emma/test/hoomd-blue/build/hoomd/jit/external.py", line 142, in __init__
    self.cpp_compute = cls(hoomd.context.current.system_definition,
RuntimeError: Error compiling JIT code.

----------------------------------------------------------------------
Ran 1 test in 0.123s

FAILED (errors=1)

======================================================================
ERROR: test_gravity (__main__.jit_external_field)
This test simulates a sedimentation experiment by using an elongated
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Emma/test/hoomd-blue/hoomd/hpmc/test-py/test_jit_external_field.py", line 36, in test_gravity
    gravity_field = hoomd.jit.external.user(mc=mc, code="return 1000*(r_i.z + box.getL().z/2);")
  File "/Users/Emma/test/hoomd-blue/build/hoomd/jit/external.py", line 142, in __init__
    self.cpp_compute = cls(hoomd.context.current.system_definition,
RuntimeError: Error compiling JIT code.

----------------------------------------------------------------------
Ran 1 test in 0.123s

FAILED (errors=1)
--------------------------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpiexec detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:

  Process name: [[3968,1],1]
  Exit code:    1
--------------------------------------------------------------------------
<end of output>
Test time =   2.38 sec
----------------------------------------------------------
Test Failed.
"test_jit_external_field.py-mpi-cpu" end time: May 09 12:00 BST
"test_jit_external_field.py-mpi-cpu" time elapsed: 00:00:02
----------------------------------------------------------

Thanks for taking a look.

Emma


Joshua Anderson

unread,
May 10, 2021, 8:42:34 AM5/10/21
to hoomd...@googlegroups.com
Emma,

The relevant error message in your output is this:
```**ERROR**: ExternalFieldEvalFactory: error: expected ')' at end of argument list
define float @eval(%struct.BoxDim* nocapture nonnull readonly align 8 dereferenceable(123) %0, i32 %1, %struct.vec3* nocapture readonly %2, %struct.quat* nocapture nonnull readnone align 8 dereferenceable(32) %3, double %4, double %5) local_unnamed_addr #0 {
```

I would guess that the `clang` executable on your PATH is not compatible with the LLVM library you linked to when building HOOMD. These should match.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
> To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/5d419e4b-31ae-4839-8b6c-3f1a348668b9n%40googlegroups.com.

Luis Rivera-Rivera

unread,
May 10, 2021, 9:02:17 AM5/10/21
to hoomd...@googlegroups.com
Emma, 

I've seen this error before and as Josh guessed above, it is most definitely a clang-LLVM mismatch issue. Try passing a different clang executable to the jit.patch.user class via the clang_exec argument.



--
Luis Y. Rivera-Rivera
(787) 806-7512
University of Michigan
Chemical Engineering
Ph.D. Candidate
The Glotzer Group
Reply all
Reply to author
Forward
0 new messages