Voro++ failed due to a: java.lang.Exception: Parsing failed: First line not "Basis:"

Issue #18 resolved
Former user created an issue

I tried to run the code from this paper: "Including crystal structure attributes in machine learning models of formation energies via Voronoi tessellations". I want to generate the attributes only so I tried to run voro-ml-si/scripts/csv-output/generate-attributes.in. Then it comes with this error: Voro++ failed due to a: java.lang.Exception: Parsing failed: First line not "Basis:". The csv file generated has many lines as NaN.

Comments (17)

  1. Logan Ward

    Thanks for reaching out!

    The "First line not 'Basis'" error happens when the Voro++ executable provided with Magpie does not start. I have seen this problem for users running Magpie on OS X before. Are you using OS X? If so, we can fix this by getting you a version of Voro++ compiled for Macs.

  2. buptxz

    Thank you for your reply!

    Yes, I am running on OS X. I have tried to compile Vassal and Magpie on my Mac but ended up with the same error. It is highly appreciated if you could provide me a Mac version :-)

  3. Logan Ward

    Are you familiar with compiling C++ on Mac?

    What you would need to do is:

    1. Download Voro++, unpack it in the voro++ folder of Vassal, and then compile the voro++ library (make all)
    2. Compile voroExt.cpp (also found in the voro++ folder) by calling: g++ voroExt.cpp -I src/ src/libvoro++.a -o voroExt.exe.
    3. Copy voroExt.cpp to Magpie’s “exes” folder, and Magpie should run after you recompile it.

    If this would be a problem, I can ask around to see if one of my coworkers with a Mac can compile Voro++ for you.

  4. buptxz

    Thank you!

    I followed your instruction. In the second step, the only voroExt.cpp file I could find was already in the voro++ folder of Vassal, not in the Voro++ source code I just downloaded. I think you mean voroExt.exe in the third step. After I recompiled Magpie, I had another error when I ran it: "Voro++ failed due to a: java.lang.Exception: Voro++ ran the wrong kind of tessellation". I am not sure if it has already solved the previous error.

  5. Logan Ward

    You are correct about voroExt.exe. Sorry about the typo.

    I haven't seen this 'wrong kind of tessellation' error before. Could you run the test.file program in the voro++ folder of Vassal by feeding test.file via stdin (i.e., ./voroExe.exe < test.file), and tell me whether it contains the line "Polydisperse: True"?

  6. Logan Ward

    Great, that's what it should do. If you change line 4 of test.file from "poly true" to "poly False"? The output should change to "Polydisperse: False".

    It sounds like the previous error of Voro++ not running on your system is solved. I'm not sure why it seems to be reading the incorrect options

  7. buptxz

    I found that when I changed the line 4 from True to False, the output didn't change correspondingly.

  8. Logan Ward

    Great! So, we found the problem. I just verified that voroExt.exe works on my computer.

    This is pretty weird. It seems your voroExt.exe is detecting a 'T' in 'False' when it shouldn't. I'll put together some debugging code, and an alternative implementation of voroExt soon to help figure this out. Since I haven't yet been able to reproduce this problem on my computer, would you be alright with running that debug code for me?

    Just to confirm, does your test.file look like this:

    basis 2.88 0 2.88 0 0 2.88
    periodicity True true True
    nAtoms 2
    poly False
    0 0 0 1
    0.5 0.5 0.5 1
    
  9. Logan Ward

    Thanks! I think the problematic part of voroExt.cpp starts at Line 114. Could you replace the following code:

        if (strchr(temp, 'T') != NULL || strchr(temp, 't') != NULL) {
            poly = true;
        }
    

    with this? As you'll likely notice, I changed how we detect what the user input is, and I added a debugging statement.

        std::cerr << "Polydisperse, read: " << temp << std::endl;
        if (strcmp(temp, "True") == 0 || strcmp(temp, "true") == 0) {
            poly = true;
        } else if (strcmp(temp, "False") == 0 || strcmp(temp, "false") == 0) {
            poly = false;
        } else {
            std::cerr << "Polydispersity choice not recognized: " << temp << std::endl;
            return 4;
        }
    

    Could you let me know what the "Polydisperse, read:" line says when you change the "poly" line in the input?

  10. buptxz

    Thank you! After modifying, Polydisperse output changes corresponding to the input and Magpie runs smoothly after recompiling now.

  11. Logan Ward

    Glad to hear it worked! Thanks for your patience about this and for testing the changed code!

    I'll update Vassal/Magpie to use this newer version, in case someone else has this problem!

  12. buptxz

    Sounds great. Thank you for your kindly help! By the way, what's a good way to contact you if I have some questions about your paper?

  13. Log in to comment