ramess101 / IFPSC_10

Submission to Industrial Fluid Properties Simulation Challenge 10
1 stars 0 forks source link

Code Issues #7

Closed mostafa-razavi closed 5 years ago

mostafa-razavi commented 6 years ago

When running GreenKubo_analyze.py I got the following error:

Traceback (most recent call last):
  File "/home/mostafa/Git/IFPSC_10/Scripts/GreenKubo_analyze.py", line 39, in <module>
    Tsat = sim_sat[:,2]
IndexError: too many indices for array

Which refers to these lines:

sim_sat = np.loadtxt('SaturatedSettings.txt',skiprows=1)
Tsat = sim_sat[:,2]

Isn't sim_sat a 1D array? I think this should be correct:

Tsat = sim_sat[2]
ramess101 commented 6 years ago

@mostafa-razavi

No, sim_sat is a 3x5 matrix. The problem is that your SaturatedSettings file was corrupted because the old script didn't work right. So you probably have a 3x1 array. I have attached what SaturatedSettings should look like for butane. Make sure this is in the root directory.

SaturatedSettings.txt

mostafa-razavi commented 6 years ago

I think the simulation of Potoff C4H8 crashed for some reason. When I tried to post process I ran into the following error:

mostafa@chem20:~/myProjects/Gromacs/IFPSC_10/IFPSC_10/C4H10/Gromacs/Potoff$ python ../../../Scripts/GreenKubo_analyze.py --ilow 0 --ihigh 31 --nReps 1 --irho 0 --sat
Traceback (most recent call last):
  File "../../../Scripts/GreenKubo_analyze.py", line 1289, in <module>
    main()   
  File "../../../Scripts/GreenKubo_analyze.py", line 1260, in main
    MCMC_Mie = GreenKubo_SaturatedMCMC(args.irho,args.ilow,args.ihigh,args.nReps)
  File "../../../Scripts/GreenKubo_analyze.py", line 816, in __init__
    self.GK_MCMC_all, self.t_GK = self.compile_GK_MCMC() 
  File "../../../Scripts/GreenKubo_analyze.py", line 863, in compile_GK_MCMC
    GK_MCMC_all[:,iMCMC] = GK_MCMC[iMCMC].visc_GK
ValueError: could not broadcast input array from shape (2967) into shape (83333)

Then I checked the contents of all visco.xvg files. Here I output only last line of visco.xvg files. Sometimes it cannot find this file, sometimes the file is not complete and most of the times the file seems to be complete. Also, note that sometimes there is only rho0 and rho1-4 were not created.

[Ahmad@chem30 Potoff-backup]$ bash ~/Git/nestplore/nestplore.sh 7 "pwd; cat visco.xvg | tail -n1"

/MCMC_0/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   **499.997    0.406583    0.509987**

/MCMC_0/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: **No such file or directory**

/MCMC_10/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
     **21.42    0.674729    0.286366**

/MCMC_10/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_11/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
    20.178       0.244   -0.474511

/MCMC_11/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_12/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
     23.73    0.796275    0.203939

/MCMC_12/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_13/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
    25.176    0.575857   -0.154696

/MCMC_13/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_14/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
    25.956    0.501668     2.05058

/MCMC_14/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_15/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
    25.716    0.151856   -0.778687

/MCMC_15/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_16/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997    0.854332   -0.404282

/MCMC_17/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997   0.0579637    0.394517

/MCMC_18/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997   -0.123168    0.250569

/MCMC_19/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997    0.445804   -0.597215

/MCMC_1/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997    0.903283    0.859282

/MCMC_1/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_20/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997    0.448328   -0.565687

/MCMC_21/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997    0.378371   -0.639999

/MCMC_22/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997    0.435369    0.215883

/MCMC_23/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997     1.27357    0.168271

/MCMC_24/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997  0.00680116    0.103217

/MCMC_25/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997    0.989559   -0.515219

/MCMC_26/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997    0.321452       0.305

/MCMC_27/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997   -0.027326   -0.903142

/MCMC_28/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997   -0.387344    -1.58533

/MCMC_29/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997    0.556608    0.806966

/MCMC_2/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
    17.802     0.49392    0.447942

/MCMC_2/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_30/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997    0.590946    -1.85964

/MCMC_31/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
   499.997     1.59217    -4.09037

/MCMC_3/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
    21.156    0.142093    0.940841

/MCMC_3/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_4/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
    21.696     0.73268    -0.60915

/MCMC_4/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_5/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
    21.954    0.179565   -0.116582

/MCMC_5/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_6/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
    21.702    0.181495    0.110691

/MCMC_6/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_7/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
    22.734    0.265196    -1.16208

/MCMC_7/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_8/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
    23.418    0.570702     1.95874

/MCMC_8/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

/MCMC_9/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis
    23.436    0.292252   0.0164495

/MCMC_9/Saturated/rho1/Rep0/NVT_eq/NVT_prod/NVT_vis
cat: visco.xvg: No such file or directory

In MCMC_9/Saturated/rho0/Rep0/NVT_eq/NVT_prod/NVT_vis/vis_out file I see this error:

Error in user input:
Invalid command-line options
  In command-line option -f
    File 'nvt_vis.edr' does not exist or is not accessible.
    The file could not be opened.
      Reason: No such file or directory
      (call to fopen() returned error code 2)

Do you know what might have happened? Anyway, I tried running it again with small values of nstep to see if it proceeds normally. It seemed to OK, so now I am run C4 Potoff simulation again. Let's see what happens this time

ramess101 commented 6 years ago

@mostafa-razavi

I ran into this problem as well. Basically, for some replicates the viscosity run is not finishing by the time we are processing the data. At least, that is my best guess. My script removes the nvt_vis.edr after the data analysis, which is a problem when the data analysis does not run properly because visco.xvg is created from nvt_vis.edr. This explains why in some cases it cannot find visco.xvg.

I am going to look into this so that our code is more robust. I have a couple of guesses for why this happens on occasion.

ramess101 commented 6 years ago

@mostafa-razavi

By the way, we remove the nvt_vis.edr file because it gets quite large (outputting data every 3 time steps for a 500000 step simulation).

My original guess was that some simulations were not finishing before the data analysis started. But that does not appear to be the case...

mostafa-razavi commented 6 years ago

I'm post processing the n-butane Potoff now. It seems that rho0,rho1,and rho2 are finished this time. But some data for rho3 and most data for rho4 are corrupted. I'll update you once I finish post processing.

ramess101 commented 6 years ago

@mostafa-razavi

I can't figure out why it has issues some times. When I went back and ran a job that did not have the correct output it worked just fine... any ideas?

ramess101 commented 6 years ago

@mostafa-razavi

Which script are you running? I think all the scripts work the same way, but maybe you should try running nAlkanes_SaturatedViscosity_FiniteSize. I ran C3H8 for 100 and 200 molecules without any problems. I am currently running C4H10 with Nmol = 100 for Potoff. Try submitting C4H10 Nmol = 200 for Potoff to see if you have any problems.

ramess101 commented 6 years ago

@mostafa-razavi

I have modified the nAlkanes_SaturatedViscosity and nAlkanes_SaturatedViscosity_FiniteSize scripts so that they will no longer remove the large output files (nvt_vis.edr) unless the vis_out was generated successfully. This way you do not need to repeat all of your simulations if the post simulation analysis failed. This should help us debug the problem as well.

ramess101 commented 6 years ago

@mostafa-razavi

My email says that you posted this message, but it has not appeared on GitHub yet.

@ramess101 I'm trying to run TAMie-IC4H10 using and I get several errors in minimization step. Attached is a zip file containing MCMC_0 folder and the script that I'm running.

MCMC_0.zip nAlkanes_SaturatedViscosity.txt

Do you know why it's happening?

Yes, the problem is that the CH and C parameters were not assigned properly in the IC4H10.top file. TAMie does not have an C parameters, but that is not a problem for IC4H10, since it only has CH3 and CH.

So the issue is that you are using the nAlkanes_SaturatedViscosity scrip, when you need to use the branchedAlkanes_SaturatedViscosity. Make sure to use the most recent version. Also, I have changed the directory hierarchy by adding Saturation_Viscosity to the path. I did this because I already had a lot of ITIC simulation results in Compound/Gromacs. So now you need to have a directory IC4H10/Gromacs/Saturation_Viscosity/TAMie_N400, for example.

ramess101 commented 6 years ago

@mostafa-razavi

Let me know if your jobs are not working for the branched alkanes. Specifically, tell me if it says "Waiting for saturated equilibration" even when all the jobs appear to have finished. I had this problem for isooctane. Periodically, Gromacs provided a poor initial configuration that would have -nan for the energy, so the job would crash. I have not had this problem previously, so I am still trying to figure out how to fix it. Hopefully for IC4H10 Gromacs does not have any problems with the energy minimization, which is supposed to prevent this problem.

mostafa-razavi commented 6 years ago

My email says that you posted this message, but it has not appeared on GitHub yet.

I thought I didn't push the Comment button, but apparently I did. I realized that I was using the nAlkanes... script.

Let me know if your jobs are not working for the branched alkanes. Specifically, tell me if it says "Waiting for saturated equilibration" even when all the jobs appear to have finished. I had this problem for isooctane. Periodically, Gromacs provided a poor initial configuration that would have -nan for the energy, so the job would crash. I have not had this problem previously, so I am still trying to figure out how to fix it. Hopefully for IC4H10 Gromacs does not have any problems with the energy minimization, which is supposed to prevent this problem.

My TraPPE-IC4H10 finished without any problems. I posted the results.

ramess101 commented 6 years ago

I thought I didn't push the Comment button, but apparently I did. I realized that I was using the nAlkanes... script.

No worries.

My TraPPE-IC4H10 finished without any problems. I posted the results.

Yeah, I saw that they look good. I think I just need to modify the script to restart a job if it crashes (but starting with a different initial configuration).

ramess101 commented 6 years ago

@mostafa-razavi

NEOC5H12 had the same issue for me, namely, since some jobs crashed the script kept waiting for them to finish. Did yours not have this issue? The strange thing is that I successfully ran NEOC5H12 for TraPPE but not for Potoff. This suggests that we might be able to fix it by setting a maximum U_nonbonded for the tabulated potential.

mostafa-razavi commented 6 years ago

@ I had the same experience. All my TraPPE branched simulations seem to run properly, but my TAMie-IC4 crashed. Here is an error I get:

GROMACS:      gmx mdrun, version 2018.1
Executable:   /usr/local/gromacs/bin/gmx
Data prefix:  /usr/local/gromacs
Working dir:  /home/mostafa/myProjects/Gromacs/IFPSC_10/TAMie-IC4H10-N800/IC4H10/Gromacs/TAMie/MCMC_30/Saturated/rho0/Rep0/NVT_eq
Command line:
  gmx mdrun -table /home/mostafa/myProjects/Gromacs/IFPSC_10/TAMie-IC4H10-N800/IC4H10/Gromacs/TAMie/MCMC_30/tab_it.xvg -nt 1 -nb cpu -pme cpu -deffnm nvt_eq

-------------------------------------------------------
Program:     gmx mdrun, version 2018.1
Source file: src/gromacs/options/options.cpp (line 189)
Function:    void gmx::internal::OptionSectionImpl::finish()

Error in user input:
Invalid input values
  In option s
    Required option was not provided, and the default file 'topol' does not
    exist or is not accessible.
    The following extensions were tried to complete the file name:
      .tpr

There is also several warnings and an error in gromppout file

ERROR 1 [file IC4H10.top, line 46]:
  Unknown bond_atomtype CH

gromppout.txt

ramess101 commented 6 years ago

@mostafa-razavi

This is actually a different issue than what I was having. My jobs were crashing because of a Gromacs problem, namely, the energy minimization still resulted in configurations that were too unfavorable. Your issue appears to be more of an input file problem. Specifically, the .top file is missing some parameters. Are you using the branchedAlkanes script? Can you send me the IC4H10_job_xxx file that shows exactly what you submitted?

ramess101 commented 6 years ago

@mostafa-razavi

We think that we fixed the problem where the energy minimization resulted in extremely high energies and pressures. The trick was to switch the order of the energy minimizations, such that em_l-bfgs runs before em_steep. em_l-bfgs does not allow for constrained bonds, while em_steep does. So I think the constraints were messing up the energy minimization for some systems.

If you are not running any other jobs, could you try running the new branchedAlkanes... script for isooctane (IC8H18)? Let me know if you have any issues.

mostafa-razavi commented 6 years ago

@ramess101 OK. I'm running TraPPE-IC8H18-N400 using the new branchedAlkanes_SaturatedViscosity script.

mostafa-razavi commented 6 years ago

@ramess101 I should use branchedAlkanes_SaturatedViscosity_tabulated for TAMie, right?

ramess101 commented 6 years ago

@mostafa-razavi @Kaiveria

I'm running TraPPE-IC8H18-N400 using the new branchedAlkanes_SaturatedViscosity script.

Actually, our code has not fixed the problem. So I would not bother running these yet. You can try, but they will likely fail. We will try to figure this out tomorrow.

I should use branchedAlkanes_SaturatedViscosity_tabulated for TAMie, right?

No, you only need the branchedAlkanes_SaturatedViscosity file. All the files with _tabulated or _LennardJones are outdated and should be removed. I will clean up the directory tomorrow.

ramess101 commented 6 years ago

@mostafa-razavi @Kaiveria

Alright, @Kaiveria and I believe that we have a more robust code for running the branched alkanes. branchedAlkanes_SaturatedViscosity will now call restart_failed_jobs to resubmit a new simulation if the previous simulation crashed. However, the code does require the user to confirm that the job failed before it will resubmit the simulation.

@mostafa-razavi Let me know if your simulations of branched alkanes still have problems.

Kaiveria commented 6 years ago

The issue of bimodal distributions during bootstrapping with the GreenKubo_analyze.py script appear to have been resolved. The root of the issue was traced to poor fits to the averages generated during bootstrapping and providing a better initial guess to the fitting routine seems to have resolved this issue. Specifically, the fit for the entire data set is used as an initial guess for the bootstrapping fits.

It will be necessary to reanalyze data (rerun Green_Kubo_analyze.py) where there are bimodal bootstrapping distributions, and this should probably be done everywhere for consistency. I will look into writing a script to automate this reanalysis.

mostafa-razavi commented 6 years ago

Let me know if your simulations of branched alkanes still have problems.

My TraPPE-IC8H18-N800 simulation crashed. I'm getting this error

Error in user input:
Invalid command-line options
  In command-line option -f
    File 'nvt_vis.edr' does not exist or is not accessible.
    The file could not be opened.
      Reason: No such file or directory
      (call to fopen() returned error code 2)
  In command-line option -s
    File 'nvt_vis.tpr' does not exist or is not accessible.
    The file could not be opened.
      Reason: No such file or directory
      (call to fopen() returned error code 2)

Or

Error in user input:
Invalid input values
  In option s
    Required option was not provided, and the default file 'topol' does not
    exist or is not accessible.
    The following extensions were tried to complete the file name:
      .tpr

I used branchedAlkanes_SaturatedViscosity.txt script for this simulation. Is there a way to use

However, the code does require the user to confirm that the job failed before it will resubmit the simulation.

I run simulations through ssh and nohup, so I will lose the console input after starting the simulation. Is there a way to automate this part?

mostafa-razavi commented 6 years ago

@ramess101 When running TraPPE-IC8H18-N100, there seems to be a problem with the box length for rho0. The box length is 2.748432579 nm, so the cut-off length (1.4 nm) is longer than half the box length. Should we use a slightly larger N? What are the experimental saturated liquid densities that you used for IC8H18?

ramess101 commented 6 years ago

@mostafa-razavi

When running TraPPE-IC8H18-N100, there seems to be a problem with the box length for rho0. The box length is 2.748432579 nm, so the cut-off length (1.4 nm) is longer than half the box length. Should we use a slightly larger N?

I think we should just use 200 as the smallest system, so do not worry about N=100.

What are the experimental saturated liquid densities that you used for IC8H18?

I used REFPROP to compute these densities.

ramess101 commented 6 years ago

@mostafa-razavi

I run simulations through ssh and nohup, so I will lose the console input after starting the simulation. Is there a way to automate this part?

@Kaiveria and I have considered a few different options to automate this part. We will let you know when it is working.

ramess101 commented 6 years ago

branchedAlkanes_SaturatedViscosity now checks if the NVT_equilibration fails. But we found one case where the second energy minimization failed:

Fatal error: Too many LINCS warnings (1000) If you know what you are doing you can adjust the lincs warning threshold in your mdp file or set the environment variable GMX_MAXCONSTRWARN to -1, but normally it is better to fix the problem

For more information and tips for troubleshooting, please check the GROMACS website at http://www.gromacs.org/Documentation/Errors

mostafa-razavi commented 6 years ago

@Kaiveria @ramess101 The new general script is very helpful for me, because I used to spend a lot of time changing different lines of the scripts to make it suitable for my system. I have few comments and questions:

1- There is a typo in the name of .gro and .top files in C12H26/Gromacs/Gromacs_input directory. They should be C12H24

2- In line 62 and 63, we have LennardJonesNEMD and TabulatedNEMD, but these folders do not exist in the main directory. Should we rename LennardJones and Tabulated folders?

3- Can we add

source /usr/local/gromacs/bin/GMXRC

to the beginning of every script that run gmx executable file? This way I will save some time.

4- Can you modify line 413 and 579 so that they start with "bash" like what follows? I get a "Permission denied" error otherwise.

bash "$scripts_path"/force_field_params "$Compound" "$input_path" "$scripts_path" "$lam_sim" "$epsCH3_sim" "$sigCH3_sim" "$epsCH2_sim" "$sigCH2_sim" "$epsCH_sim" "$sigCH_sim" "$epsC_sim" "$sigC_sim" "$bondlength_CH3" "$Nmol"
bash "$scripts_path"/run_single.sh "$output_path"/MCMC_"$iMCMC"/tab_it.xvg "$nt_eq" cpu cpu nvt_eq "$pinoffset" "$j" "$nRep" "$output_path" "$NREP_low" "$NREP_high" "$Compound" "$Nmol" "$Tempbox" nvt &
mostafa-razavi commented 6 years ago

@Kaiveria @ramess101

My TraPPE-C12H26-N400 simulation using the new script is still not working. I'm running it using an old script in order not to waste time.

The problem seems to be related to gmx insert-molecules command in run_single script. Here is the output of this command: insertout.txt

  gmx insert-molecules -ci ../../../C12H26.gro -nmol 400 -try 100 -box 5.329806411
 5.329806411
 5.329806411
 -o C12H26_box.gro

When I open it using vim I see a ^M chaarcter, like this:

  gmx insert-molecules -ci ../../../C12H26.gro -nmol 400 -try 100 -box 5.329806411^M 5.329806411^M 5.329806411^M -o C12H26_box.gro

It seems like there is a new line character in liquid_box array which I don't know how get rid of. Did you guys ever run into this problem?

ramess101 commented 6 years ago

@mostafa-razavi

The new general script is very helpful for me, because I used to spend a lot of time changing different lines of the scripts to make it suitable for my system.

You have @Kaiveria to thank, she has done a very good job cleaning up these scripts. I'm glad you find them useful.

1- There is a typo in the name of .gro and .top files in C12H26/Gromacs/Gromacs_input directory. They should be C12H24

The chemical formula for dodecane is C12H26. Was there something else wrong with it?

2- In line 62 and 63, we have LennardJonesNEMD and TabulatedNEMD, but these folders do not exist in the main directory. Should we rename LennardJones and Tabulated folders?

Do not worry about NEMD stuff at all. We are just using EMD.

3- Can we add source /usr/local/gromacs/bin/GMXRC to the beginning of every script that run gmx executable file? This way I will save some time.

This sounds reasonable. @Kaiveria can you look into this.

Can you modify line 413 and 579 so that they start with "bash" like what follows? I get a "Permission denied" error otherwise.

I think so. @Kaiveria ?

It seems like there is a new line character in liquid_box array which I don't know how get rid of. Did you guys ever run into this problem?

Yes, we run into this problem quite frequently, This arises from crossing back and forth between Windows and Linux. @Kaiveria and I both have some different tricks. All you need to do is get rid of the extra character in the Saturation_Conditions file.

mostafa-razavi commented 6 years ago

@ramess101

Thanks @Kaiveria. The new script is very useful. I wrote a bash script that sends me an email when the simulation is done. Personally, this helps me save a lot of time. Let me know if you guys think this might help you as well.

Yes, we run into this problem quite frequently, This arises from crossing back and forth between Windows and Linux. @Kaiveria and I both have some different tricks. All you need to do is get rid of the extra character in the Saturation_Conditions file.

My Saturation_Conditions file didn't have any extra character. In my case, the problem was solved by manually typing the box lengths into a new file.

The chemical formula for dodecane is C12H26. Was there something else wrong with it?

The files in C12H26/Gromacs/Gromacs_input directory are named C12H16 instead of C12H26.

Do not worry about NEMD stuff at all. We are just using EMD.

Then line 62 and 63 should be modified from

lj_mdp_path=~/LennardJonesNEMD
t_mdp_path=~/TabulatedNEMD
to
lj_mdp_path=~/LennardJones
t_mdp_path=~/Tabulated

Right?

mostafa-razavi commented 6 years ago

@ramess101 @Kaiveria I used the new script to run TAMie-C12H26-N400. Can you verify that everything in the script that I used is correct (C12H26_job_2018_07_05_22_22_19.txt)?

ramess101 commented 6 years ago

@mostafa-razavi

Then line 62 and 63 should be modified from> lj_mdp_path=~ /LennardJonesNEMD t_mdp_path=~ /TabulatedNEMD to lj_mdp_path=~ /LennardJones t_mdp_path=~ /Tabulated Right?

I believe so. @Kaiveria will take a look at your script as well.

Kaiveria commented 6 years ago

Hello. I hope I find you well. Here are some answers to some questions.

  1. On the initial parameters NREPS*batches should equal 60 as this is the total number of replicates that will be run, so "batches=3" and "NREPS=20" or "batches=4" and "NREPS=15" are the usual settings. Line 27 "RDF=YES" should probably be "RDF=NO" as I don't think we're trying to get an RDF out of these runs and the topology and .gro files probably aren't set up to do it. Leaving this as "YES" should not break anything but it might give you some odd warnings. This is probably left over from something else I was testing that day. Sorry about that.

I should also note that we were running these simulations for 2 ns during the production NVT runs with the presumption that this might be necessary for such a large molecule. This requires changing any hard coded "500000" step specifications in the .mdp files to "some_nsteps" as discussed below and requires the following lines for step size information:

OVERRIDE_STEPS=YES equil_steps=(500000 500000 500000 500000 500000) prod_steps=(1000000 1000000 1000000 1000000 1000000)

In this case, you could also hard code "1000000" for the steps into the files if you preferred. I do not know whether you would like to run these simulations for 2 ns or 1 ns as it was unclear whether the longer run was actually making the results any better.

I presume that the pin0=1 (start first job on processor 1 not processor 0) and number of threads being 1 for both equilibration and production runs makes sense for your machine?

  1. On the issue of lines 62 and 63 I am constantly changing which directories the .mdp files are read from for one reason or another. I just happened to be testing out some NEMD things (which did not work and will not be pursued further) at the time I last committed the script. Usually you will want the mdp directories to be "~ /LennardJones" and "~ /Tabulated" respectively. I checked on and updated these directories this morning. The updates were to NPT files which don't matter for saturation runs. There are a few subtleties that need to be checked for when choosing these mdp paths. First off, if you want to use variable steps sizes during equilibration or production (ie run rho0 NVT production for 1 ns but rho1 NVT production for 2 ns) you need to make sure that the number of steps specified in all the relevant .mdp files is "some_nsteps" rather than hard coded as something like "500000." There are a few other issues for NPT followed by NVT runs which are worth noting in case they come up in the future. The script doesn't have a way to specify different numbers of steps for NPT production and NVT production (ie if you only want to run the NPT production phase for 1 ns for rho0 but want to run the NVT production phase for 4 ns for rho0 there isn't a neat way to do that in the script at the moment). The same issue exists for equilibration but that usually doesn't come up. I get around this when I want all NPT production simulations to run for the same amount of time by putting a hard coded "500000" steps in the NPT production .mdp files and leaving "some_nsteps" in the NVT production .mdp files.

  2. On changing the lines to start with "bash" to avoid a permission denied error I can do this some time today or you can do it if you like. Running "chmod +x script_name" for each of the helper scripts called by AlkanesViscosity.sh fixes that issue.

  3. On C12H16 which should be C12H26 Apparently I though 16 looked a lot like 26. That should be fixed now.

  4. On adding the "source /usr/local/gromacs/bin/GMXRC" line That shouldn't be a problem. I can take care of that sometime today. You can also add it yourself if you like.

mostafa-razavi commented 6 years ago

@ramess101

I just realized that the 2,2,4-TMH simulations have stopped. The NPT equilibrium and production is done for MCMC0 to MCMC14, but nvt_eq simulations did not start. I'm attaching MCMC0 folder. Could you take a look?

MCMC0.zip

Also, this zip file contains files in Potoff_N200_LINCS directory

Potoff_N200_LINCS.zip

mostafa-razavi commented 6 years ago

@ramess101

I guess run_single.sh never ran, because the run_single.sh script was not properly executed in AlkanesViscosity.sh script . It's missing "bash". I'll run it again .

ramess101 commented 6 years ago

@mostafa-razavi

Yeah, I couldn't see anything else wrong with your .mdp files. So I think that has to be the problem. Sorry about that!

mostafa-razavi commented 6 years ago

@ramess101

Can you take a look at MCMC_15 folder? It seems that this time energy minimization failed. (rho0 simulations of MCM_0 to MCMC_14 ran successfully.)

MCMC_15.zip Potoff_N200_LINCS.zip

ramess101 commented 6 years ago

@mostafa-razavi

I don't know why 0-14 ran successfully but MCMC_15 did not. You can see in the gromppout file that you have a bunch of warnings about two few parameters, etc. I think that is the problem. Insertout is also missing box sizes, but I don't think that is the problem because I think the insertout was created after the NPT failed, so it had no box size. The large number of backed up .gro files shows that it was restarting the process repeatedly...

ramess101 commented 6 years ago

@mostafa-razavi

OK, so you are running 15 replicates at a time. So the problem appears to be when you go into your second batch of simulations...

ramess101 commented 6 years ago

@mostafa-razavi

There is something wrong with your .top files. In MCMC_15 the C6 and Clam parameters are identical for CH3_C, CH2_C, CH_C, C_C. The strange thing is that you did not have this problem for MCMC_0 (according to what you sent me yesterday). Did you make sure to update the scripts directory?

ramess101 commented 6 years ago

@mostafa-razavi

OK, so the problem is that in MCMC_15 the .top file has an error in the parameters:

CH3_C CH3 15.03450 0.000 A 0.0016333023402H3 1.3708296184e-05H3; [CH3]-CHX CH2_C CH2 14.02660 0.000 A 0.0016333023402H2 1.3708296184e-05H2; (CHX)2-[CH2] CH_C CH 13.01900 0.000 A 0.0016333023402H 1.3708296184e-05H; (CHX)3-[CH] C_C C 12.01100 0.000 A 0.0016333023402 1.3708296184e-05; (CHX)4-[C]

Notice the extra "H3", "H2", and "H" at the end. It appears that it replaced some_C6_C before it replaced some_C6_CH, some_C6_CH2, and some_C6_CH3. I don't know how that order would have gotten inverted, especially just by going into the next batch.

ramess101 commented 6 years ago

@mostafa-razavi

This is done in the "force_field_params" script. It should look like this:

sed -i -e s/some_C6_CH3/"$C6_CH3_sim"/ "$Compound".top sed -i -e s/some_Clam_CH3/"$Clam_CH3_sim"/ "$Compound".top sed -i -e s/some_C6_CH2/"$C6_CH2_sim"/ "$Compound".top sed -i -e s/some_Clam_CH2/"$Clam_CH2_sim"/ "$Compound".top sed -i -e s/some_C6_CH/"$C6_CH_sim"/ "$Compound".top sed -i -e s/some_Clam_CH/"$Clam_CH_sim"/ "$Compound".top sed -i -e s/some_C6_C/"$C6_C_sim"/ "$Compound".top sed -i -e s/some_Clam_C/"$Clam_C_sim"/ "$Compound".top

sed -i -e s/some_C6_combCH3CH2/"$C6_CH3CH2_sim"/ "$Compound".top sed -i -e s/some_Clam_combCH3CH2/"$Clam_CH3CH2_sim"/ "$Compound".top sed -i -e s/some_C6_combCH3CH/"$C6_CH3CH_sim"/ "$Compound".top sed -i -e s/some_Clam_combCH3CH/"$Clam_CH3CH_sim"/ "$Compound".top sed -i -e s/some_C6_combCH3C/"$C6_CH3C_sim"/ "$Compound".top sed -i -e s/some_Clam_combCH3C/"$Clam_CH3C_sim"/ "$Compound".top sed -i -e s/some_C6_combCH2CH/"$C6_CH2CH_sim"/ "$Compound".top sed -i -e s/some_Clam_combCH2CH/"$Clam_CH2CH_sim"/ "$Compound".top sed -i -e s/some_C6_combCH2C/"$C6_CH2C_sim"/ "$Compound".top sed -i -e s/some_Clam_combCH2C/"$Clam_CH2C_sim"/ "$Compound".top sed -i -e s/some_C6_combCHC/"$C6_CHC_sim"/ "$Compound".top sed -i -e s/some_Clam_combCHC/"$Clam_CHC_sim"/ "$Compound".top

Can you verify that the order is still correct?

ramess101 commented 6 years ago

@mostafa-razavi

This is one place where you added "bash" in your script:

Mine:

"$scripts_path"/force_field_params "$Compound" "$input_path" "$scripts_path" "$lam_sim" "$epsCH3_sim" "$sigCH3_sim" "$epsCH2_sim" "$sigCH2_sim" "$epsCH_sim" "$sigCH_sim" "$epsC_sim" "$sigC_sim" "$bondlength_CH3" "$Nmol" "$MCMC_tors" "$iMCMC"

Yours:

bash "$scripts_path"/force_field_params "$Compound" "$input_path" "$scripts_path" "$lam_sim" "$epsCH3_sim" "$sigCH3_sim" "$epsCH2_sim" "$sigCH2_sim" "$epsCH_sim" "$sigCH_sim" "$epsC_sim" "$sigC_sim" "$bondlength_CH3" "$Nmol" "$MCMC_tors" "$iMCMC"

But I can't see how that would matter. Is your force_field_params file updated? Even if it weren't, how would this work for the first batch but not the second?

ramess101 commented 6 years ago

@mostafa-razavi

Maybe your 224TMHexane_temp.top file got corrupted in your 224TMHexane/Gromacs/Gromacs_input folder? If the some_C6_C... terms were overwritten somehow after the first batch this would affect your .top files in the second batch.

mostafa-razavi commented 6 years ago

@ramess101

It turns out that only MCMC_15 has a corrupted 224TMHexane.top file. Even the values of C6 and Clam are different in MCMC_15. I'm shared the whole simulation folder in Google Drive. Here is the link: https://drive.google.com/open?id=12bBgq8HA4Pr2OnlhUCDU8bLUMV6gj5UI

ramess101 commented 6 years ago

@mostafa-razavi

This is REALLY strange... any ideas? My only guess is that some files were being written to at the same time they were being read, and this is only manifest for the first run of a new batch. Try running it again? Maybe throw a "sleep 10s" right before and right after running the "bash force_field_params" line?

mostafa-razavi commented 6 years ago

@ramess101

OK. I ran it again with "sleep 10s". I'll let you know tomorrow.

ramess101 commented 6 years ago

@mostafa-razavi

Any news with these simulations?

mostafa-razavi commented 6 years ago

@ramess101

There are running now. I think the problem was related to the folder name. When the first simulation failed, I cleaned it up and ran the Alkanes_Viscosity.sh script in the same folder. I think this script leaves some "zombie" processes that keep running basically forever, and this might have corrupted some files. Renaming the main simulation folder fixed the problem (so far).