Some questions about v2.0

Hi,

I'm trying to prepare potfit for the kim-api v2.0. Currently I am having
some problems understanding the new concept of parameters.
Here are some questions:

1. Is there a way for a simulator to determine if the model is an actual
model or a model driver? At least "kim-api-v2-collections-management list"
does not distinguish them. Currently I am not sure if this information is
needed or even helpful, I was just wondering.

2. Is there a fixed name for "cutoff" or can a model call the cutoff parameter
however it pleases?

3. Is there a way to know which parameters are required for a certain model?
E.g. if the model supports lots of elements but I only have one type in my
simulator. Do I have to guess which parameter is required and which not?

4. This is a question for the model driver
LennardJones612_UniversalShifted__MO_959249795837_003. It requires
parameters with 9730 entries. Assuming the 139 element types this makes
70 parameters per element. This includes "cutoff". Could you elaborate on
which data is expected in this parameter?

And finally, while using LennardJones_Ar I encountered a global-buffer-
overlow. Maybe you can take a look at this as well, the address sanitizer
report is attached.

You can reproduce it easily when calling:

KIM_Model* pmodel;
int requestedUnitsAccepted = 0;
int res = KIM_Model_Create(
  KIM_NUMBERING_zeroBased,
  KIM_LENGTH_UNIT_A,
  KIM_ENERGY_UNIT_eV,
  KIM_CHARGE_UNIT_e,
  KIM_TEMPERATURE_UNIT_K,
  KIM_TIME_UNIT_ps,
  g_kim.model_name,
  &requestedUnitsAccepted,
  &pmodel);

where g_kim.model_name = "LennardJones_Ar" using the C API.

Thanks,
Daniel

asan_log.txt (3.44 KB)

Hi Daniel,

Great! We're looking forward to seeing you.

I'll try to address your questions below.

Hi,

I'm trying to prepare potfit for the kim-api v2.0. Currently I am having
some problems understanding the new concept of parameters.
Here are some questions:

1. Is there a way for a simulator to determine if the model is an actual
model or a model driver? At least "kim-api-v2-collections-management list"
does not distinguish them. Currently I am not sure if this information is
needed or even helpful, I was just wondering.

Model Drivers and Models are, infact, listed separately by the collections-management tool. Model Drivers are not visible to the simulator. Simulator only ever interact with Model Drivers through a parameterized model which provides a specific set of parameters. (In the fitting context, these could be used as the initial parameter values.)

2. Is there a fixed name for "cutoff" or can a model call the cutoff parameter however it pleases?

We have not included a standard name for a cutoff parameter. The model driver is free to provide such a parameter and to give it any "description" string it chooses. Also, note that in v2 "cutoff" is specifically the Neighbor List Cutoff. This is different than the Influence Distance, but is often taken to be synonymous. In short, the particle energy function must be insensitive to particle position for any/all particles outside the Influence Distance. The
Neighbor List cutoff controls which particle neighbors are included in the neighbor list. It is required that the Influence Distance is greater than or equal to the largest neighbor list cutoff defined by the model.

3. Is there a way to know which parameters are required for a certain model?
E.g. if the model supports lots of elements but I only have one type in my
simulator. Do I have to guess which parameter is required and which not?

The KIM API does not try to manage or provide such information. However, the Model or Model Driver is free to create a consistent naming scheme for its parameter descriptions, and this information could be encoded in those descriptions.

4. This is a question for the model driver
LennardJones612_UniversalShifted__MO_959249795837_003. It requires
parameters with 9730 entries. Assuming the 139 element types this makes
70 parameters per element. This includes "cutoff". Could you elaborate on
which data is expected in this parameter?

Here are some details:

Let N=139 be the number of species supported by the model.

Parameter Description: "shift"
Data Type: Integer
Number of params: 1
Note: 1/0 -- LJ's shifted are/not to zero energy at cutoff

Parameter Description: "cutoffs"
Data Type: Double
Number of params: N*(N+1)/2
Note: cutoff distance (really influence distance) for each unique particle pair
Note: lower-triangular row-major storage

Parameter Description: "epsilons"
Data Type: Double
Number of params: N*(N+1)/2
Note: LJ epsilon value for each unique particle pair
Note: lower-triangular row-major storage

Parameter Description: "sigmas"
Data Type: Double
Number of params: N*(N+1)/2
Note: LJ sigma value for each unique particle pair
Note: lower-triangular row-major storage

And finally, while using LennardJones_Ar I encountered a global-buffer-
overlow. Maybe you can take a look at this as well, the address sanitizer
report is attached.

You can reproduce it easily when calling:

KIM_Model* pmodel;
int requestedUnitsAccepted = 0;
int res = KIM_Model_Create(
KIM_NUMBERING_zeroBased,
KIM_LENGTH_UNIT_A,
KIM_ENERGY_UNIT_eV,
KIM_CHARGE_UNIT_e,
KIM_TEMPERATURE_UNIT_K,
KIM_TIME_UNIT_ps,
g_kim.model_name,
&requestedUnitsAccepted,
&pmodel);

where g_kim.model_name = "LennardJones_Ar" using the C API.

Thanks, I'll take a look at that.

Ryan

You can reproduce it easily when calling:

KIM_Model* pmodel;
int requestedUnitsAccepted = 0;
int res = KIM_Model_Create(
KIM_NUMBERING_zeroBased,
KIM_LENGTH_UNIT_A,
KIM_ENERGY_UNIT_eV,
KIM_CHARGE_UNIT_e,
KIM_TEMPERATURE_UNIT_K,
KIM_TIME_UNIT_ps,
g_kim.model_name,
&requestedUnitsAccepted,
&pmodel);

where g_kim.model_name = "LennardJones_Ar" using the C API.

I see the problem. Good. I've fixed this on the "kim-api" repo "devel-v2" branch.

Ryan