Coder Social home page Coder Social logo

leetmaa / kmclib Goto Github PK

View Code? Open in Web Editor NEW
115.0 15.0 50.0 2.55 MB

A kinetic Monte Carlo Python/C++ library.

License: GNU General Public License v3.0

CMake 0.58% Makefile 0.47% C++ 37.03% C 0.10% CSS 0.98% JavaScript 2.47% HTML 16.44% Python 41.73% SWIG 0.22%
kinetic-monte-carlo kmc python

kmclib's People

Contributors

aschankler avatar leetmaa avatar pytlab avatar xstl91 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kmclib's Issues

Count KMCProcess events

I've read through the documentation and I can't figure out how to count the number of times an event fires without printing the trajectory information or launching an analysis plugin after every step. Is there a way to print/record a running tally of how many times an event type has been fired?

Typo in MSD output

The header of the output produced by printResults has a key 'DSD_y' rather than 'MSD_y'.

stream.write("%11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s\n"%("TIME ", "MSD_x ", "DSD_y ", "MSD_z ", "MSD_xy ", "MSD_xz ", "MSD_yz ", "MSD_xyz ", "STD_x ", "STD_y ", "STD_z ", "STD_xy ", "STD_xz ", "STD_yz ", "STD_xyz ", "N_eff"))

I am installing KMCLib-2.0-a1 in ubuntu 15.04. I followed the installation steps. I am getting an error message when I do 'make test.x' in build directory. Can you please solve this problem.

I am installing KMCLib-2.0-a1 in ubuntu 15.04. I followed the installation steps. I am getting an error message when I do 'make test.x' in the build directory. Can you please solve this problem.
Thanks in Advance.

home/rao/Downloads/KMCLib-2.0-a1/c++/unittest/test_hash.cpp:177:40: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
const unsigned long int ref0 = 17780468236463825071u;
^
cc1plus: all warnings being treated as errors
unittest/CMakeFiles/unittest.dir/build.make:80: recipe for target 'unittest/CMakeFiles/unittest.dir/test_hash.cpp.o' failed
make[3]: *** [unittest/CMakeFiles/unittest.dir/test_hash.cpp.o] Error 1
make[3]: Leaving directory '/home/rao/Downloads/KMCLib-2.0-a1/c++/build'
CMakeFiles/Makefile2:212: recipe for target 'unittest/CMakeFiles/unittest.dir/all' failed
make[2]: *** [unittest/CMakeFiles/unittest.dir/all] Error 2
make[2]: Leaving directory '/home/rao/Downloads/KMCLib-2.0-a1/c++/build'
CMakeFiles/Makefile2:189: recipe for target 'unittest/CMakeFiles/test.x.dir/rule' failed
make[1]: *** [unittest/CMakeFiles/test.x.dir/rule] Error 2
make[1]: Leaving directory '/home/rao/Downloads/KMCLib-2.0-a1/c++/build'
Makefile:180: recipe for target 'test.x' failed
make: *** [test.x] Error 2

neighbour list in custom rate calculator

Does CustomRateCalculator class has neighbour list of the central coordinate available through backend?

  1. In KMCLib/python/functest/IsingSpin/IsingSpinTest.py the rate function requires neighbours of the central coordinate at which a flip of spin is made. I've checked all the associated files and this information is not explicitly specified when calling the CustomRateCalculator. However, as per the calculations in the rate function, the elements_before and elements_after arrays should have the neighbours at indices 1-4.

  2. Additionally, if the custom rate is for a diffusive hop on orthogonal lattice, e.g., in KMCLib/python/functest/OnTheFlyRateCalculator/OnTheFlyRateCalculatorTest.py, how the indices are defined for next nearest neghbours. Pasting the relevant portion from code below:

    Before move the central particle has neighbour indices 1, 2, 3, 4.

     # After the move the central particle has meighbour indices,
     # if we move to the right, 0, 7, 8, 12
     # if we move up,           0, 6, 8, 11
     # if we move down,         0, 5, 7, 10
     # if we move left,         0, 5, 6, 9
    

Compilation Error for make test.x on Ubuntu 18.04

Hi,
I have tried to compile the module on Ubuntu 18.04, using gcc, g++ and mpicxx. All seems to be fine, until I try to run the test.

Indeed, by typing make test.x in the c++/build directory, I get the following error:

/home/xelad/KMCLib-2.0-a1/c++/unittest/test_interactions.cpp:146:25: error: the compiler can assume that the address of 'rc' will never be NULL [-Werror=address] CPPUNIT_ASSERT( &rc != NULL ); ^ /home/xelad/KMCLib-2.0-a1/c++/externals/include/cppunit/TestAssert.h:131:37: note: in definition of macro 'CPPUNIT_ASSERT' ( CPPUNIT_NS::Asserter::failIf( !(condition), \ ^~~~~~~~~ cc1plus: all warnings being treated as errors unittest/CMakeFiles/unittest.dir/build.make:185: recipe for target 'unittest/CMakeFiles/unittest.dir/test_interactions.cpp.o' failed make[3]: *** [unittest/CMakeFiles/unittest.dir/test_interactions.cpp.o] Error 1 make[3]: Leaving directory '/home/xelad/KMCLib-2.0-a1/c++/build' CMakeFiles/Makefile2:233: recipe for target 'unittest/CMakeFiles/unittest.dir/all' failed make[2]: *** [unittest/CMakeFiles/unittest.dir/all] Error 2 make[2]: Leaving directory '/home/xelad/KMCLib-2.0-a1/c++/build' CMakeFiles/Makefile2:208: recipe for target 'unittest/CMakeFiles/test.x.dir/rule' failed make[1]: *** [unittest/CMakeFiles/test.x.dir/rule] Error 2 make[1]: Leaving directory '/home/xelad/KMCLib-2.0-a1/c++/build' Makefile:193: recipe for target 'test.x' failed make: *** [test.x] Error 2

I have read the known issue and I have found that you suggested to comment the line "CPPUNIT_ASSERT( &rc != NULL );"

However, by doing that, I got another error:

/home/xelad/KMCLib-2.0-a1/c++/unittest/test_interactions.cpp:145:28: error: unused variable 'rc' [-Werror=unused-variable] const RateCalculator & rc = interactions.rateCalculator(); ^~ cc1plus: all warnings being treated as errors unittest/CMakeFiles/unittest.dir/build.make:185: recipe for target 'unittest/CMakeFiles/unittest.dir/test_interactions.cpp.o' failed make[3]: *** [unittest/CMakeFiles/unittest.dir/test_interactions.cpp.o] Error 1 make[3]: Leaving directory '/home/xelad/KMCLib-2.0-a1/c++/build' CMakeFiles/Makefile2:233: recipe for target 'unittest/CMakeFiles/unittest.dir/all' failed make[2]: *** [unittest/CMakeFiles/unittest.dir/all] Error 2 make[2]: Leaving directory '/home/xelad/KMCLib-2.0-a1/c++/build' CMakeFiles/Makefile2:208: recipe for target 'unittest/CMakeFiles/test.x.dir/rule' failed make[1]: *** [unittest/CMakeFiles/test.x.dir/rule] Error 2 make[1]: Leaving directory '/home/xelad/KMCLib-2.0-a1/c++/build' Makefile:193: recipe for target 'test.x' failed make: *** [test.x] Error 2

Can you please suggest me how to solve this?

KMCRateCalculatorPlugin question

Hi, Mikael, I find I can't input any parameters for my own rate calculator. In KMCInteractions, the rate_calculator under setRateCalculator should be a class, not object. I can't provide any specific parameters into my own rate calculator. For example, I want to make the rate to be temperature related. I can't input the temperature except use a global variable. Do I understand correct?

Best,
Albert

MacOS 10.12.1 build

Hi, I'm trying to build for MacOS using homebrew to install swig. I get through the unit tests, but make install fails because a bunch of python symbols are not found:

[ 83%] Linking CXX shared module _Custom.so
cd /Users/scott/Documents/Code/git/KMCLib/c++/build/wrap && /usr/local/Cellar/cmake/3.6.2/bin/cmake -E cmake_link_script CMakeFiles/_Custom.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++   -O3 -fPIC -Wall -Wextra -Werror -pedantic -stdlib=libc++  -std=c++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -bundle -Wl,-headerpad_max_install_names  -o _Custom.so CMakeFiles/_Custom.dir/customPYTHON_wrap.cxx.o -framework python ../custom/libcustom.a ../src/libsrc.a 
Undefined symbols for architecture x86_64:
  "_PyInstanceMethod_New", referenced from:
      SWIG_PyInstanceMethod_New(_object*, _object*) in customPYTHON_wrap.cxx.o
  "_PyModule_Create2", referenced from:
      _PyInit__Custom in customPYTHON_wrap.cxx.o
  "_PyUnicode_Concat", referenced from:
      SwigPyObject_repr(SwigPyObject*) in customPYTHON_wrap.cxx.o
  "_PyUnicode_DecodeUTF8", referenced from:
      SWIG_From_std_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in customPYTHON_wrap.cxx.o
  "_PyUnicode_FromFormat", referenced from:
      SwigPyObject_repr(SwigPyObject*) in customPYTHON_wrap.cxx.o
      SwigPyPacked_repr(SwigPyPacked*) in customPYTHON_wrap.cxx.o
      SwigPyPacked_str(SwigPyPacked*) in customPYTHON_wrap.cxx.o
  "_PyUnicode_FromString", referenced from:
      SWIG_Python_GetSwigThis(_object*) in customPYTHON_wrap.cxx.o
      SWIG_Python_NewPointerObj(_object*, void*, swig_type_info*, int) in customPYTHON_wrap.cxx.o
      SWIG_Python_DestroyModule(_object*) in customPYTHON_wrap.cxx.o
      SwigPyPacked_str(SwigPyPacked*) in customPYTHON_wrap.cxx.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [wrap/_Custom.so] Error 1
make[1]: *** [wrap/CMakeFiles/_Custom.dir/all] Error 2
make: *** [all] Error 2

I installed swig using homebrew and not macports, and I wonder if something is missing?

There were some problems running the test file?

when I running the Diffusion1DTest.py test file and KMC operation terminated suddenly

Then the error is reported as follows:
Diffusion1DTest.txt

ERROR: testRun (main.Diffusion1DTest)
Run the model and check the results.

Traceback (most recent call last):
File "Diffusion1DTest.py", line 119, in testRun
fit = numpy.linalg.lstsq(A, b, rcond=None)
File "/usr/lib64/python2.7/site-packages/numpy/linalg/linalg.py", line 1838, in lstsq
0, work, -1, iwork, 0)
TypeError: a float is required


Ran 1 test in 13.851s

FAILED (errors=1)

Does anyone know what the problem is?

python-dev / Python.h

Hello,

Just a quick comment regarding installation on ubuntu 18.04.
For the final make (make test.x worked fine) Python.h wasn't found.

Solution:
sudo apt install python-dev
locate Python.h # find where it is
in CMakeLists.txt:
include_directories(where_it_is)

Thanks for making this available

AssertionError

Hello
While I was running the 'utest.py' file, the final result was shown as

======================================================================
FAIL: testScript (KMCLibTest.CoreComponents.KMCConfigurationTest.KMCConfigurationTest)
Test that we can generate a valid script.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/zyzhang/KMCLib/python/unittest/KMCLibTest/CoreComponents/KMCConfigurationTest.py", line 678, in testScript
    self.assertEqual(script, ref_script)
AssertionError: "\n# -----------------------------------------------------------------------------\n# Unit cell\n\ncell_vectors = [[   2.800000e+00,   0.000000e+00,   0.000000e+00],\n                [   0.000000e+00,   3.200000e+00,   0.000000e+00],\n                [   0.000000e+00,   5.000000e-01,   3.000000e+00]]\n\nbasis_points = [[   0.000000e+00,   0.000000e+00,   0.000000e+00]]\n\nunit_cell = KMCUnitCell(\n    cell_vectors=cell_vectors,\n    basis_points=basis_points)\n\n# -----------------------------------------------------------------------------\n# Lattice\n\nlattice = KMCLattice(\n    unit_cell=unit_cell,\n    repetitions=(1,1,1),\n    periodic=(False, False, False))\n\n# -----------------------------------------------------------------------------\n# Configuration\n\ntypes = ['ThisIsTheTypeOfMyOnlySiteInThisUnrealisticallyShortStructure']\n\npossible_types = ['A','CDEFGHI','ThisIsTheTypeOfMyOnlySiteInThisUnrealisticallyShortStructure',\n                  'B']\n\nconfig = KMCConfiguration(\n    lattice=lattice,\n    types=types,\n    possible_types=possible_types)\n" != "\n# -----------------------------------------------------------------------------\n# Unit cell\n\ncell_vectors = [[   2.800000e+00,   0.000000e+00,   0.000000e+00],\n                [   0.000000e+00,   3.200000e+00,   0.000000e+00],\n                [   0.000000e+00,   5.000000e-01,   3.000000e+00]]\n\nbasis_points = [[   0.000000e+00,   0.000000e+00,   0.000000e+00]]\n\nunit_cell = KMCUnitCell(\n    cell_vectors=cell_vectors,\n    basis_points=basis_points)\n\n# -----------------------------------------------------------------------------\n# Lattice\n\nlattice = KMCLattice(\n    unit_cell=unit_cell,\n    repetitions=(1,1,1),\n    periodic=(False, False, False))\n\n# -----------------------------------------------------------------------------\n# Configuration\n\ntypes = ['ThisIsTheTypeOfMyOnlySiteInThisUnrealisticallyShortStructure']\n\npossible_types = ['ThisIsTheTypeOfMyOnlySiteInThisUnrealisticallyShortStructure',\n                  'A','B','CDEFGHI']\n\nconfig = KMCConfiguration(\n    lattice=lattice,\n    types=types,\n    possible_types=possible_types)\n"

======================================================================
FAIL: testRunInitialMatch (KMCLibTest.CoreComponents.KMCLatticeModelTest.KMCLatticeModelTest)
Test the output of initial matchinformation from a run of the A-B flip model.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/zyzhang/KMCLib/python/unittest/KMCLibTest/CoreComponents/KMCLatticeModelTest.py", line 493, in testRunInitialMatch
    self.assertTrue(ref in stream_1.getvalue())
AssertionError: False is not true

----------------------------------------------------------------------
Ran 190 tests in 1.675s

FAILED (failures=2)

How can such an error solved?

Question about cutoff in CustomRateCalculator

I am trying to apply KMCLib on diffusion problem within a hexagonal lattice.
I want the diffusion rate to be calculated from nearest neighbor atoms so I tried CustomRateCalculator.
As there seems to be no explicit nearest neighbor list so I thought that defining cutoff might work.
However the cutoff is seems to be like:

The distance D between a site and the center is calculated as
D = sqrt(x^2 + y^2 + z^2)
where (x,y,z) is the internal coordinate of the site.
Only the sites with D < cutoff will be counted.

So cutoff only works when the lattice is a cubic with a = b = c.
Since I have a hexagonal lattice, in which, for example, the distance between (0,0,0) and (1,1,0) is just the same as that between (0,0,0) and (1,0,0), while setting cutoff to 1 just includes (1,0,0) but excludes (1,1,0).
Is there any way to define cutoff as an absolute distance?

There were some problems running the utest.py test file?

when I running the utest.py test file and KMC operation terminated suddenly

Then the error is reported as follows:

Traceback (most recent call last):
File "utest.py", line 13, in
from KMCLibTest import KMCLibTests
File "/home/biao/KMCLib-master/python/unittest/KMCLibTest/KMCLibTests.py", line 14, in
from .CoreComponents import CoreComponentsTests
File "/home/biao/KMCLib-master/python/unittest/KMCLibTest/CoreComponents/CoreComponentsTests.py", line 15, in
from .KMCLatticeModelTest import KMCLatticeModelTest
File "/home/biao/KMCLib-master/python/unittest/KMCLibTest/CoreComponents/KMCLatticeModelTest.py", line 604
exec(compile(open(trajectory_filename, "rb").read(), trajectory_filename, 'exec'), global_dict, local_dict)
SyntaxError: unqualified exec is not allowed in function 'testRunNoMatch' it contains a nested function with free variables

Does anyone know what the problem is?

Problem in running utest.py: ModuleNotFoundError: No module named 'Analysis'

I use python 3.8 for installing KMCLib version 2.0-a1

I have an error, it says no module named 'Analysis':
Traceback (most recent call last): File "utest.py", line 13, in <module> from KMCLibTest import KMCLibTests File "/home/azka/02_Software/KMCLib-2.0-a1/python/unittest/KMCLibTest/KMCLibTests.py", line 12, in <module> from Analysis import AnalysisTests ModuleNotFoundError: No module named 'Analysis'

Eventhough I had installed it before successfully
$ python3.8 -m pip install analysis Requirement already satisfied: analysis in /home/azka/anaconda3/envs/kmclib2/lib/python3.8/site-packages (0.1.7)

Do you know why does this happen?

wrong command in the content in KMCLib 1.1 documentation - Make system

in the paragraph Make system:

Make system
The make system is based on CMake. Installing CMake can be done by typing on Ubuntu:

sudo apt-get install swig

and on Mac OSX using macports:

sudo port install swig && sudo port install swig-python

The command for installation of CMake is wrong, it is the installation of swig which is the same with the next paragraph.

I am using ubuntu 14, is Cmake 3.5.1 proper for kMClib?

Abort Trap 6 mistake

Dear KMCLib developer,
Thank you for this amazing software. I've been searching for similar programs for a long time.
The installation is successful, but when I do "python utest.py", an error occured:

Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

Could you help me fix this ?
Thanks,
Zhengda

Installation error in cluster

Hi, I succeeded in installing it on my own redhat. But when installing on cluster which have a lot c++, mpi modules, it failed. I doubt the reason comes from cmake. The make file used the /user/bin/c++ instead of provided gcc path. Could you fix this error or tell me how to fix it?

Best,
Albert

linking libstdc++ statically

Hi Leetmaa:
Is it better to link libstdc++ statically by adding -static-libstdc++ compiler option for compatible working in different linux?

ShaoZhengjiang

python test fail

I am compiling with CentOS, gcc/7.3.0, and python 2.7.18. there are some errors. Is there specific requirements for python version?

raceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/Analysis/OnTheFlyMSDTest.py", line 568, in testPrintResults
msd.printResults(stream)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Analysis/OnTheFlyMSD.py", line 288, in printResults
stream.write("%11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s\n"%("TIME ", "MSD_x ", "MSD_y ", "MSD_z ", "MSD_xy ", "MSD_xz ", "MSD_yz ", "MSD_xyz ", "STD_x ", "STD_y ", "STD_z ", "STD_xy ", "STD_xz ", "STD_yz ", "STD_xyz ", "N_eff"))
TypeError: unicode argument expected, got 'str'

======================================================================
ERROR: testPrintResults (KMCLibTest.Analysis.TimeStepDistributionTest.TimeStepDistributionTest)
Test the time step distribution print result function.

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/Analysis/TimeStepDistributionTest.py", line 139, in testPrintResults
tsd.printResults(stream)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Analysis/TimeStepDistribution.py", line 108, in printResults
stream.write("%10.5f %10i %20.15f\n"%(t, v, n))
TypeError: unicode argument expected, got 'str'

======================================================================
ERROR: testPrintResults (KMCLibTest.Analysis.ProcessStatisticsTest.ProcessStatisticsTest)
Test that we can print the results

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/Analysis/ProcessStatisticsTest.py", line 188, in testPrintResults
ps.printResults(stream)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Analysis/ProcessStatistics.py", line 102, in printResults
stream.write("%15s %15s %15s %12s\n"%(" time (t)", " count (n)", "(dn/dt) ", "(n/t)"))
TypeError: unicode argument expected, got 'str'

======================================================================
ERROR: testPrintResults (KMCLibTest.Analysis.CompositionTest.CompositionTest)
Test that we can print the results

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/Analysis/CompositionTest.py", line 215, in testPrintResults
cc.printResults(stream)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Analysis/Composition.py", line 97, in printResults
stream.write(format_str_1%tuple(types_str))
TypeError: unicode argument expected, got 'str'

======================================================================
ERROR: testRunInitialMatch (KMCLibTest.CoreComponents.KMCLatticeModelTest.KMCLatticeModelTest)
Test the output of initial matchinformation from a run of the A-B flip model.

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/CoreComponents/KMCLatticeModelTest.py", line 482, in testRunInitialMatch
ab_flip_model.run(control_parameters=control_parameters)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/CoreComponents/KMCLatticeModel.py", line 125, in run
prettyPrint(msg)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Utilities/PrintUtilities.py", line 31, in prettyPrint
output.write(msg)
TypeError: unicode argument expected, got 'str'

======================================================================
ERROR: testPrettyPrint (KMCLibTest.Utilities.PrintUtilitiesTest.PrintUtilitiesTest)
Test that we can call the pretty print function.

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/Utilities/PrintUtilitiesTest.py", line 35, in testPrettyPrint
prettyPrint(ref_str)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Utilities/PrintUtilities.py", line 31, in prettyPrint
output.write(msg)
TypeError: unicode argument expected, got 'str'

======================================================================
ERROR: testPrintHeader (KMCLibTest.Utilities.PrintUtilitiesTest.PrintUtilitiesTest)
Test the print header function.

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/Utilities/PrintUtilitiesTest.py", line 71, in testPrintHeader
printHeader()
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Utilities/PrintUtilities.py", line 46, in printHeader
prettyPrint("# -----------------------------------------------------------------------------", output)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Utilities/PrintUtilities.py", line 31, in prettyPrint
output.write(msg)
TypeError: unicode argument expected, got 'str'

======================================================================
FAIL: testScript (KMCLibTest.CoreComponents.KMCConfigurationTest.KMCConfigurationTest)
Test that we can generate a valid script.

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/CoreComponents/KMCConfigurationTest.py", line 676, in testScript
self.assertEqual(script, ref_script)
AssertionError: "\n# -----------------------------------------------------------------------------\n# Unit cell\n\ncell_vectors = [[ 2.800000e+00, 0.000000e+00, 0.000000e+00],\n [ 0.000000e+00, 3.200000e+00, 0.000000e+00],\n [ 0.000000e+00, 5.000000e-01, 3.000000e+00]]\n\nbasis_points = [[ 0.000000e+00, 0.000000e+00, 0.000000e+00]]\n\nunit_cell = KMCUnitCell(\n cell_vectors=cell_vectors,\n basis_points=basis_points)\n\n# -----------------------------------------------------------------------------\n# Lattice\n\nlattice = KMCLattice(\n unit_cell=unit_cell,\n repetitions=(1,1,1),\n periodic=(False, False, False))\n\n# -----------------------------------------------------------------------------\n# Configuration\n\ntypes = ['ThisIsTheTypeOfMyOnlySiteInThisUnrealisticallyShortStructure']\n\npossible_types = ['A','CDEFGHI','ThisIsTheTypeOfMyOnlySiteInThisUnrealisticallyShortStructure',\n 'B']\n\nconfig = KMCConfiguration(\n lattice=lattice,\n types=types,\n possible_types=possible_types)\n" != "\n# -----------------------------------------------------------------------------\n# Unit cell\n\ncell_vectors = [[ 2.800000e+00, 0.000000e+00, 0.000000e+00],\n [ 0.000000e+00, 3.200000e+00, 0.000000e+00],\n [ 0.000000e+00, 5.000000e-01, 3.000000e+00]]\n\nbasis_points = [[ 0.000000e+00, 0.000000e+00, 0.000000e+00]]\n\nunit_cell = KMCUnitCell(\n cell_vectors=cell_vectors,\n basis_points=basis_points)\n\n# -----------------------------------------------------------------------------\n# Lattice\n\nlattice = KMCLattice(\n unit_cell=unit_cell,\n repetitions=(1,1,1),\n periodic=(False, False, False))\n\n# -----------------------------------------------------------------------------\n# Configuration\n\ntypes = ['ThisIsTheTypeOfMyOnlySiteInThisUnrealisticallyShortStructure']\n\npossible_types = ['ThisIsTheTypeOfMyOnlySiteInThisUnrealisticallyShortStructure',\n 'A','B','CDEFGHI']\n\nconfig = KMCConfiguration(\n lattice=lattice,\n types=types,\n possible_types=possible_types)\n"


Ran 190 tests in 5.015s

FAILED (failures=1, errors=7)

[Compilation on macOS] Unidentified CXX compiler version

I would like to report some testings on macOS. Following the installation guides to install KMCLib via clang + MPI on macOS 10.15 throws unsupported compiler error.

Steps to reproduce

  • System: macOS 10.15, AppleClang 11.0 (Clang 3.9)
  • MPI version: open-mpi 4.0.3 based on clang-3.9 (distributed via Homebrew)
    -Running command under the c++/build directory:
CC=clang CXX="clang++ -stdlib=libc++" cmake -DMPI=mpicxx ..
  • Error message:
CMake Error at CMakeLists.txt:103 (message):
  Invalid CXX compiler.  Only g++, Intel and Clang supported

Possible causes

The newest version of open-mpi based on clang is recognized as System CXX compiler with MPI wrapping by CMake, which makes the rules in CMakeLists invalid.

Possible solutions

Update CMakeLists.txt so that when user puts CXX=mpicxx it can automatically recognise the MPI option.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.