Concerning the simulator

Greetings,

I apologize in advance for what may appear to be a fundamental question, but I’m on my nth attempt (where n is greater than 5) to build a model driver, and I’m getting a seg fault in my current tests with the model driver in LAMMPS.

So, in an attempt to figure what may be the source of the seg fault, I looked at the kim.log file and it contains the following:

  • Info (KIM_API_model::is_it_match): The following descriptor file line may not match with simulator_name’s descriptor file.
    OneBasedLists flag none []

  • Info (KIM_API_model::is_it_match): The following descriptor file line may not match with jsg_model_Ti_MSMEAM’s descriptor file.
    ZeroBasedLists flag none []

  • Info: (KIM_API_model::model_init): call dynamically linked initialize routine for:jsg_model_Ti_MSMEAM
    from the shared library:/home/hpc3067/lib/kim-api-v1/models/jsg_model_Ti_MSMEAM/libkim-api-model-v1.so

Concerning the above output, my question is: how to I modify the simulator’s descriptor file so that matches with my model driver (and model shown above) - i.e. how do I make the simulator employ OneBasedLists?

Thank you,
Josh

Hi Josh,

It is great to hear you are keeping at it. We're always happy to help.

The messages you mention are "Info" messages which often do NOT indicate an error but sometimes do.

In this case the message is noting that the Simulator is using "OneBasedLists" and your model is using "ZeroBasedLists". This is OK; The KIM API translates automatically between these two systems. So, this is just information and not an error that needs to be fixed in this case...

However, it is odd that you are seeing the "OneBasedLists" from LAMMPS. It should be using "ZeroBasedLists". Are you sure you got this message from LAMMPS? You might delete the kim.log file and run LAMMPS again to check that you get the same output again..

Cheers,

Ryan

Hi Ryan,

I reran it as you requested, and the simulator (LAMMPS in this case) is running OneBasedLists:

  • Info (KIM_API_model::is_it_match): The following descriptor file line may not match with simulator_name’s descriptor file.
    OneBasedLists flag none []

  • Info (KIM_API_model::is_it_match): The following descriptor file line may not match with jsg_model_Ti_MSMEAM’s descriptor file.
    ZeroBasedLists flag none []

  • Info: (KIM_API_model::model_init): call dynamically linked initialize routine for:jsg_model_Ti_MSMEAM
    from the shared library:/home/hpc3067/lib/kim-api-v1/models/jsg_model_Ti_MSMEAM/libkim-api-model-v1.so

Is this not as it should be?

Thanks,
Josh

Hi Josh,

It seems there’s a bit of confusion over the KIM API’s specific phrasing in these info messages. When you see the message

“* Info (KIM_API_model::is_it_match): The following descriptor file line may not match with simulator_name’s descriptor file.
OneBasedLists flag none []”,

the KIM API is saying that the attribute “OneBasedLists” in the Model’s KIM descriptor file may not be compatible with the relevant attribute in the Test’s (a.k.a. simulator’s) KIM descriptor file. Likewise, the message

  • Info (KIM_API_model::is_it_match): The following descriptor file line may not match with jsg_model_Ti_MSMEAM’s descriptor file.
    ZeroBasedLists flag none []

indicates that the attribute “ZeroBasedLists” in the Test’s KIM descriptor file may not be compatible with the relevant attribute in the Model’s KIM descriptor file. So just to be clear, the simulator (LAMMPS in this case) is using ZeroBasedLists, while your Model is using OneBasedLists. This is not actually a problem in any way, as the KIM API automatically mediates the interaction of the Model and the Test so that these indexing choices make no difference. Therefore, you can safely ignore these info messages about OneBasedLists and ZeroBasedLists; the cause of your segfault must lie elsewhere in your Model Driver.

Happy hunting,
Dan

Hi Josh and Dan,

Great! Dan is correct.

Cheers,

Ryan

(P.S.; Yes, it is on my list to improve the erorr/info message text!)

Wait, I think I fixed the seg fault. I believe that one of my subroutines in the KIM model calls the neighbor lists of PURE_H, PURE_F, RVEC_H, and RVEC_F. However, for the sake of expediting functionality of the model, I am only concerned with RVEC_F. Still, I listed the four NEIGH descriptions in the descriptor file.

Now, I get the following in the kim.log file:

  • Info (KIM_API_model::get_model_kim_str): Found Model shared library file for Model name: ‘jsg_model_Ti_MSMEAM’
  • Info: (KIM_API_model::model_init): call dynamically linked initialize routine for:jsg_model_Ti_MSMEAM
    from the shared library:/home/hpc3067/lib/kim-api-v1/models/jsg_model_Ti_MSMEAM/libkim-api-model-v1.so

And I get the following errors in the lammps.log file:

WARNING: Resetting reneighboring criteria during minimization (…/min.cpp:168)
ERROR: All masses are not set (…/atom.cpp:1343)

Apparently, as far as LAMMPS is concerned, I have not yet to set the mass.

Right,

The KIM potential does not set masses. You need to do that with an additional line in the lammps input file.

Ryan

Hi Ryan,

So, I input the mass in LAMMPS, made sure the “pair_style” and “pair_coeff” parts of the LAMMPS input file were correct, and I am now debugging the KIM model-driver itself because I’m trying to find the source of a new seg fault.

Inserting some print statements into the model driver and then running LAMMPS, I know that the model driver seems to be read the model parameters correctly, and the cutoff at the end of the function model_driver_init.

Then I put some print statements in the function Compute_Energy_Forces, but my print statements are not appearing when I run LAMMPS.

So, this seg fault seems to occur after exiting the model_driver_init function and before the function Compute_Energy_Forces.

Would you be able to suggest at what part of the OpenKIM API that I should then be examining for this seg fault, which is after exiting the model_driver_init function and before the function Compute_Energy_Forces?

Thanks,
Josh

Hi Josh,

It is a bit difficult to know.

Two possible ways forward:

1) modify one of the example simulators (maybe ex_Ar_free_cluster) to do a simple computation for your model. This would allow you to debug more easily.

2) Send me (off list) your driver code, details on which lammps version you are using, and input. I would be able to take a quick look reasonably soon.

Cheers,

Ryan