Giter VIP home page Giter VIP logo

Comments (6)

stevepur avatar stevepur commented on August 14, 2024

Implementing the above fix results in the tmux child threads giving the following error:
Saving FPMresp (ID = 35) as "piaacmcconf_i000/FPMresp1_s2_l0565_sr10_nbr032_mr200_ccnbr000_ccz002000_ocr0800_ocz000000_ssr50_ssm0_Mirror_wb10_mp04_thread00.fits" ...creating file "!_savefits_atomic_FPMresp.tmp.fits"
mv: rename !_savefits_atomic_FPMresp.tmp.fits to piaacmcconf_i000/FPMresp1_s2_l0565_sr10_nbr032_mr200_ccnbr000_ccz002000_ocr0800_ocz000000_ssr50_ssm0_Mirror_wb10_mp04_thread00.fits: No such file or directory

I found the file _savefits_atomic_FPMresp.tmp.fits in the working directory (not piaacmcconf_i000). It looks like the fnametmp should not contain the "!", while the name passed to save___fits should. Testing with the following change:
sprintf(fnametmp, "savefits_atomic%s.tmp.fits", ID_name);
sprintf(savename, "!%s", fnametmp);
where "savename" is the name passed to save___fits.

from piaacmcdesign.

stevepur avatar stevepur commented on August 14, 2024

I'm concerned about this being thread safe. Isn't there a danger of multiple threads writing to _savefits_atomic_FPMresp.tmp.fits at the same time? I'm adding thread number to the temp filename, which implies changes to the save_fits_atomic signature.

from piaacmcdesign.

stevepur avatar stevepur commented on August 14, 2024

I've successfully completed step 100 and am into step 101 with the above fixes. The performance is excellent, seeing a contrast of 1.45738e-09 compared to 1.5e-7 after three iterations of optsingle 200 with the 2.19 code. Something else must have gotten fixed.

from piaacmcdesign.

oguyon avatar oguyon commented on August 14, 2024

fixed in release 1.2.25

new function code appends pid and thread id to temporary file name, and fixes the sprintf and "!" bugs:

int save_fits_atomic(char *ID_name, char *file_name)
{
long ID;
int atype;
char fnametmp[1000];
char savename[1000];
char command[2000];
int ret;
pthread_t self_id;

ID = image_ID(ID_name);

self_id=pthread_self();
sprintf(fnametmp, "_savefits_atomic_%s_%d_%ld.tmp.fits", ID_name, (int) getpid(), (unsigned long) self_id);
sprintf(savename, "!%s", fnametmp);
if (ID!=-1)
{
    atype = data.image[ID].md[0].atype;
    switch(atype) {
    case FLOAT:
        save_fl_fits(ID_name, savename);
        break;
    case DOUBLE:
        save_db_fits(ID_name, savename);
        break;
    case USHORT:
        save_sh_fits(ID_name, savename);
        break;
    }

    sprintf(command, "mv %s %s", fnametmp, file_name);
    ret = system(command);
}

return 0;

}

from piaacmcdesign.

oguyon avatar oguyon commented on August 14, 2024

check:
https://guides.github.com/features/mastering-markdown/

On 10/09/2016 06:00 PM, Steve bryson wrote:

How do I turn off markdown? All I want to do is type plain text.
Markdown is removing characters I type.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#12 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFVuDT1hoKVcjHZalgIprk81L4yLl5k4ks5qybhugaJpZM4KSHFG.

from piaacmcdesign.

stevepur avatar stevepur commented on August 14, 2024

I don’t want to master markdown. I want the plain text I copied to be properly formatted when I paste it in a comment without having to type any extra characters. Imposing markdown in a comment context without it being asked for is absurd.

On Oct 12, 2016, at 12:39 AM, Olivier Guyon [email protected] wrote:

check:
https://guides.github.com/features/mastering-markdown/

On 10/09/2016 06:00 PM, Steve bryson wrote:

How do I turn off markdown? All I want to do is type plain text.
Markdown is removing characters I type.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#12 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFVuDT1hoKVcjHZalgIprk81L4yLl5k4ks5qybhugaJpZM4KSHFG.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from piaacmcdesign.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.