prisms-center / CASMcode

First-principles statistical mechanical software for the study of multi-component crystalline solids
Other
105 stars 70 forks source link

Clarification on "dependent_runs" tag in canonical Monte carlo simulation and restarting the simulation #341

Open pandeydhanshree opened 11 months ago

pandeydhanshree commented 11 months ago

Hello I have couple of queries regarding the subject of the issue. 1: I was wondering how the "dependent_runs" would effect my canonical MC results performed at different temperatures. I did a small testing with two calculations, one with the dependent_runs = true, and the other with "false". As a result, I am getting different formation energies, which makes sense (as if it is true, begin the next calculation with the final DoF from the previous calculation. If false, begin each calculation with the DoF specified for the "motif".) Which of the option would help me achieve more accurate results?

2: Actually I am trying to perform canonical MC simulation at different temperatures and because of the limitation of the cluster walltime, I could scan only few temperatures in the first run. For example, let say, in the first run, I could get the results upto 1200 K and there is proper generation of "condition.x" till that point. Now, I wish to restart from that point and continue to my final condition of temperature specified in my input file. I could restart the calculations for the grand canonical ensemble, but for canonical, I am not really sure. Can you please suggest a way to achieve the same? For your reference, I attach my input file.

{ "comment" : "This is a sample input file. Unrecognized attributes (like the ones prepended with '_') are ignored.", "debug" : false, "ensemble" : "canonical", "method" : "metropolis", "model" : { "formation_energy" : "formation_energy" }, "supercell" : [ [12, 0, 12], [0, 12, 12], [12, 12, 12] ], "data" : { "sample_by" : "pass", "sample_period" : 1, "_N_sample" : 1000, "_N_pass" : 1000, "_N_step" : 1000, "_max_pass" : 10000, "min_pass" : 1000, "_max_step" : 10000, "_max_sample" : 500, "_min_sample" : 100, "confidence" : 0.95, "measurements" : [ { "quantity" : "formation_energy", "precision" : 1e-2 }, { "quantity" : "potential_energy" }, { "quantity" : "atom_frac" }, { "quantity" : "site_frac" }, { "quantity" : "comp", "precision" : 1e-3 }, { "quantity" : "comp_n" } ], "storage" : { "write_observations" : false, "write_trajectory" : false, "output_format" : ["csv", "json"] } }, "driver" : { "mode" : "incremental", "dependent_runs" : false, "motif" : { "configname" : "default", "_configname" : "SCEL9_1_9_1_0_0_0/0", "_configdof" : "path/to/final_state.json" }, "initial_conditions" : { "comp": [0.66666667, 0.22222222, 0.11111111], "temperature" : 100.0, "tolerance" : 0.001 }, "final_conditions" : { "comp": [0.66666667, 0.22222222, 0.11111111], "temperature" : 1500.0, "tolerance" : 0.001 }, "incremental_conditions" : { "comp": [0.000000, 0.000000, 0.00000], "temperature" : 100.0, "tolerance" : 0.001 } } } Looking forward for any suggestions. Thank you in advance and regards Dhanshree

xivh commented 10 months ago
  1. If you are doing a heating run, I would leave the dependent runs on so that you get a smooth path.
  2. Did it fail to restart?
pandeydhanshree commented 10 months ago

Thanks for the suggestion regarding the dependent run parameter. Regarding the restarting of canonical MC calculations, yes, I could not able to restart it. As I mentioned above, in the first run, I could get the results upto 1200 K and there is proper generation of "condition.x" till that point. Now, how do I restart from that point and continue to my final condition of temperature specified in my input file? Every time I restart, it considers condition.0 (initial temperature) to be the initial condition. Am I missing some point here?

xivh commented 10 months ago

Can you describe exactly what is happening? I used your input file and canceled the Monte Carlo at 1200 degrees, and it restarted okay for me. I tried both the conda version and the latest version of CASM.

pandeydhanshree commented 10 months ago

Sure. I am getting something like

"-- Error: Conditions mismatch -- existing conditions: "/leonardo_work/ICT23_CMSP_0/dpandey/CASM/WTaVac/MC-WTaVac/canonical/0.09Vac/testing/conditions.0/conditions.json" T: 0 param_composition: [ 0.300000000000, 0.610000000000 ] param_composition: [ 0.300000000000, 0.610000000000 ]

incremental conditions 0: T: 0 param_composition: [ 0.300000000000, 0.610000000000, 0.090000000000 ] param_composition: [ 0.300000000000, 0.610000000000, 0.090000000000 ] param_composition: [ 0.300000000000, 0.610000000000, 0.090000000000 ]

ERROR running Canonical Monte Carlo.

ERROR: initial_conditions or incremental_conditions has changed. " Just to let you know that in the present calculation, my input conditions are (which I provide for consistency sake) ""initial_conditions" : { "comp": [0.30, 0.61, 0.09], "temperature" : 0.0, "tolerance" : 0.001 }, "final_conditions" : { "comp": [0.30, 0.61, 0.09], "temperature" : 1200.0, "tolerance" : 0.001 }, "incremental_conditions" : { "comp": [0.000000, 0.000000, 0.00000], "temperature" : 200.0, "tolerance" : 0.001 } "

xivh commented 10 months ago

Can you try it with just the first two comp (or whichever two are the composition axes from casm composition -d):

"initial_conditions" : {
"comp": [0.30, 0.61],
"temperature" : 0.0,
"tolerance" : 0.001
},
"final_conditions" : {
"comp": [0.30, 0.61],
"temperature" : 1200.0,
"tolerance" : 0.001
},
"incremental_conditions" : {
"comp": [0.000000, 0.000000],
"temperature" : 200.0,
"tolerance" : 0.001
}
pandeydhanshree commented 10 months ago

Thanks!! I tried your suggestion and I get rid of the earlier problem of restarting. However, I am encountering "Segmentation fault" Below is the few last lines of the output:

"-- Check: For existing calculations -- update: "/leonardo_work/ICT23_CMSP_0/dpandey/CASM/WTaVac/MC-WTaVac/canonical/0.09Vac/testing/new/results.json" update: "/leonardo_work/ICT23_CMSP_0/dpandey/CASM/WTaVac/MC-WTaVac/canonical/0.09Vac/testing/new/results.csv" found existing calculations will begin with condition 1 will overwrite existing results for condition(s): [ 1 ]

-- Set: DoF -- Using: /leonardo_work/ICT23_CMSP_0/dpandey/CASM/WTaVac/MC-WTaVac/canonical/0.09Vac/testing/new/conditions.0/final_state.json

-- Enforce composition -- initial comp: [ 0.299851851852, 0.610074074074 ] initial comp_n: [ 0.610074074074, 0.299851851852, 0.090074074074 ]

=================================================================================== = BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES = PID 105335 RUNNING AT lrdn2451 = EXIT CODE: 139 = CLEANING UP REMAINING PROCESSES = YOU CAN IGNORE THE BELOW CLEANUP MESSAGES

YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault (signal 11) This typically refers to a problem with your application. Please see the FAQ page for debugging suggestions " Can you suggest what is the issue now? Thanks again in advance. With best regards Dhanshree

xivh commented 10 months ago

Does it only happen when restarting? Also, are you able to install the latest version from source? It might work better.

pandeydhanshree commented 10 months ago

Yes, it is happening at the time of restart. I have not tried installing from the source. I will try it. Thanks!!

xivh commented 9 months ago

One more thing to check, since you are doing canonical Monte Carlo, is that the values of comp correspond to the atomic compositions that you expect. You can see the composition axes with casm composition -d; compare casm query -k comp and casm query -k atom_frac.

pandeydhanshree commented 9 months ago

Sure!! I will check and compare. Yes, I do expect the values of "comp" which I see from casm query -k comp. Thanks a lot and wish you a very happy new year. With best regards Dhanshree