[Mesa-users] ./re functionality for cluster
amber lauer
amberlauer at gmail.com
Thu Apr 11 11:39:24 EDT 2019
I think this is what I will actually have to do, either that or use Rob
Farmer's method. Right now I have it set up to check for files inside
./photos, but I don't think I can check for a file inside a folder if it
doesn't exist, at least I don't think the script will run correctly.
On Thu, Apr 11, 2019 at 4:20 AM Gururaj Wagle via Mesa-users <
mesa-users at lists.mesastar.org> wrote:
> I have a less sophisticated way of doing it than what Rob has suggested.
> But it is less complicated. I just run following script that checks if
> photos directory exists and it is not empty, and runs rn or re with latest
> photo accordingly. It is not very different than what has already been
> said, but just wanted to share it in case if someone finds it useful.
>
> 1 #!/bin/bash
> 2
> 3 function check_okay {
> 4 if [ $? -ne 0 ]
> 5 then
> 6 exit 1
> 7 fi
> 8 }
> 9
> 10 check_okay
> 11 if [ -d photos ] && [ "$(ls -A photos)" ]
> 12 then
> 13 photo=$(ls -t photos | head -1)
> 14 ./re "$photo"
> 15 else
> 16 ./rn
> 17 fi
> 18 check_okay
>
>
> Guru
> —
> Dr. Gururaj Wagle
> Research Associate (Astrophysics)
> HBCSE-TIFR, Mumbai
>
> On 11-Apr-2019, at 1:04 PM, Rob Farmer via Mesa-users <
> mesa-users at lists.mesastar.org> wrote:
>
> Hi
>
> So the ./re script just copies the photo you give it to a file called
> restart_photo into the current working directory then it calls ./star,
> while ./rn will remove any restart_photo before calling star. So what you
> could do is always just call ./star directly (no ./rn or ./re). Then in
> your extras_finish_step:
>
> use star_lib
> if(mod(s%model_number,s%photo_interval)==0) then
> call star_save_for_restart(s%id,'restart_photo',ierr)
> end if
>
> This will then write a photo out with the name restart_photo. The first
> time you run a model with ./star there wont be a restart_photo so it'll act
> like ./rn. while the second time the restart_photo will exist so calling
> ./star will act like ./re (without you needing to copy and photos yourself).
>
> Rob
>
>
>
> On Thu, 11 Apr 2019 at 03:14, amber lauer via Mesa-users <
> mesa-users at lists.mesastar.org> wrote:
>
>> Great, thanks. Though, for those attempting it in the future I found it
>> easier to just write the restart portion into the batch submission script.
>> At least with the aforementioned many jobs structure.
>>
>> On Wed, Apr 10, 2019, 5:16 PM Josiah Schwab <jwschwab at ucsc.edu> wrote:
>>
>>> 2)Alter re to copy the newest photo to restart_photo via
>>>>
>>>> *cp $(ls -t | head -1) restart_photo*
>>>>
>>>> and comment out everything above it. However, I almost usually find
>>>> when I want to do things like this that it already exists in some form. So
>>>> I'm checking with the mailing list.
>>>>
>>>
>>> I usually do some variant of this.
>>>
>>> Josiah
>>>
>> _______________________________________________
>> mesa-users at lists.mesastar.org
>> https://lists.mesastar.org/mailman/listinfo/mesa-users
>>
>> _______________________________________________
> mesa-users at lists.mesastar.org
> https://lists.mesastar.org/mailman/listinfo/mesa-users
>
>
> _______________________________________________
> mesa-users at lists.mesastar.org
> https://lists.mesastar.org/mailman/listinfo/mesa-users
>
>
--
Amber Lauer
Postdoctoral Researcher
Triangle Universities Nuclear Lab
Duke University
amber.lauer at tunl.duke.edu <amber.lauer at duke.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20190411/26dbe437/attachment.html>
More information about the Mesa-users
mailing list