Two uloop variables?

Greetings,

I am trying to define a lammps input script that gets a list of forcefield files and for each forcefield file it runs simulations in multiple temperatures. One way to do this is to make an outer Uloop for force field files and an inner loop for the temperature. However, is it possible to make both loops as uloop?

This is my initial script:

label loopff

clear

variable ff_num  uloop ${ff_number}

        label looptm

        variable Tm loop 280 300

        include in.Tm.single.sim

        next Tm

        jump TmCalculations.in looptm

label break

variable Tm delete

next ff_num

jump TmCalculations.in loopff

What do you expect to gain from this? I can only see disadvantages versus writing a bash script that generates the NxM input files and submit them as individual calculations.

I do this because I want to run multiple simulations at the same time using the same input script. If I loop over the parameters in the job file then at each time only one simulation will be running on the allocated processors.

So there is no benefit. You would not loop in the input but rather generate one input for each iteration and run these independently. This has multiple benefits:

  • if one of the simulations has an issue, the others are unaffected. With running this from one input all calculations stop on any issue
  • one most queueing systems you have to wait longer for bigger/longer jobs. With many small jobs, you can them often “sneak” them in the so-called backfill
  • those many small submissions would run concurrently as you submit them

If memory serves me correctly, @srtee has explained the same to you before.

1 Like

Oh, I understand now. Thanks very much for the clarification!

Yes, and @m.adibi , I hope you will read this link and ponder it deeply: The Best Code Is No Code At All

1 Like

Thank you for the link. I went through and read it carefully.

1 Like