If or function pointers in fortran

前端 未结 4 759
南旧
南旧 2021-01-21 01:39

as it is so common with Fortran, I\'m writing a massively parallel scientific code. In the beginning of my code I read my configuration file which tells me which type of solver

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-21 02:00

    If you only plan to use the function pointers once, at initialisation, and you are running codes on a BlueGene, isn't your concern for the efficiency mis-directed ? Generally, any initialisation which works is OK, if it takes 1sec instead of 1msec it's probably going to have 0 impact on total execution time.

    Code initialisation routines for clarity, ease of modification, that sort of thing.

    EDIT

    My guess is that using function pointers rather than your current code will have no impact on execution speed. But it's just a (educated perhaps) guess and I'll be very interested in any data you gather on this question.

提交回复
热议问题