Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MFC seems to rebuild all targets on run even if they're already been built via build #288

Closed
sbryngelson opened this issue Jan 2, 2024 · 6 comments · Fixed by #307
Closed
Assignees

Comments

@sbryngelson
Copy link
Member

sbryngelson commented Jan 2, 2024

MFC rebuilds all targets on ./mfc.sh run even if they've already been built via ./mfc.sh build. Seems to be triggered via a GLOB MISMATCH though I haven't investigated why this occurs. Even occurs if one immediately runs after a build. One option is to avoid build altogether though this is obviously not a very attractive idea.

It even partially rebuilds some dependencies like FFTW/HDF5.

Example snippet:

[I]br011: bryngel-startup-proj/MFC $ ./mfc.sh run examples/1D_sodshocktube/case.py -t pre_process simulation -e batch -N 1 -n 8 -w "00:10:00" -p GPU -# "shb-test" -b mpirun -a phy210041p
mfc: OK > (venv) Entered the Python virtual environment.

      .=++*:          -+*+=.          [email protected] [Linux]
     :+   -*-        ==   =* .        -----------------------------------------
   :*+      ==      ++    .+-         --jobs 1
  :*##-.....:*+   .#%+++=--+=:::.     --mpi
  -=-++-======#=--**+++==+*++=::-:.   --gpu
 .:++=----------====+*= ==..:%.....   --no-debug
  .:-=++++===--==+=-+=   +.  :=       --targets pre_process and simulation
  +#=::::::::=%=. -+:    =+   *:
-----------------------------------------------------------
 .*=-=*=..    :=+*+:      -...--      $ ./mfc.sh [build, run, test, clean, count, packer]
--help

Run
  Acquiring /ocean/projects/phy210041p/bryngel/MFC/examples/1D_sodshocktube/case.py...
  Configuration:
    Input
/ocean/projects/phy210041p/bryngel/MFC/examples/1D_sodshocktube/case.py
    Job Name      (-#)  shb-test
    Engine        (-e)  batch
    Nodes         (-N)  1
    Tasks (/node) (-n)  8
    Walltime      (-w)  00:10:00
    Partition     (-p)  GPU
    Account       (-a)  phy210041p
    Email         (-@)

  Generating input files for pre_process...

    Generating pre_process.inp.
      INFO: Forwarded 32/50 parameters.

  Generating input files for simulation...

    Generating simulation.inp.
      INFO: Forwarded 32/50 parameters.

  Generating syscheck/include/case.fpp.
    INFO: Custom case.fpp file is up to date.

  $ cmake --build /ocean/projects/phy210041p/bryngel/MFC/build/no-debug_gpu_mpi/syscheck
--target syscheck -j 1 --config Release

[100%] Built target syscheck

  $ cmake --install
/ocean/projects/phy210041p/bryngel/MFC/build/no-debug_gpu_mpi/syscheck

-- Install configuration: "Release"
-- Installing: /jet/home/bryngel/bryngel-startup-proj/MFC/build/install/no-debug_gpu_mpi/bin/syscheck
-- Set runtime path of "/jet/home/bryngel/bryngel-startup-proj/MFC/build/install/no-debug_gpu_mpi/bin/syscheck" to ""
  Generating pre_process/include/case.fpp.
    INFO: Custom case.fpp file is up to date.

  $ cmake --build
/ocean/projects/phy210041p/bryngel/MFC/build/no-debug_gpu_mpi/pre_process --target
pre_process -j 1 --config Release

-- GLOB mismatch!
-- Enabled IPO / LTO
-- Configuring done
-- Generating done
-- Build files have been written to: /jet/home/bryngel/bryngel-startup-proj/MFC/build/no-debug_gpu_mpi/pre_process
[  2%] Preprocessing (Fypp) m_variables_conversion.fpp
[  5%] Preprocessing (Fypp) m_check_patches.fpp
[  8%] Preprocessing (Fypp) m_constants.fpp
[ 11%] Preprocessing (Fypp) m_data_output.fpp
[ 14%] Preprocessing (Fypp) m_derived_types.fpp
[ 17%] Preprocessing (Fypp) m_global_parameters.fpp
[ 20%] Preprocessing (Fypp) m_helper.fpp
[ 23%] Preprocessing (Fypp) m_initial_condition.fpp
[ 26%] Preprocessing (Fypp) m_model.fpp
[ 29%] Preprocessing (Fypp) m_mpi_common.fpp
[ 32%] Preprocessing (Fypp) m_mpi_proxy.fpp
[ 35%] Preprocessing (Fypp) m_patches.fpp
[ 38%] Preprocessing (Fypp) m_start_up.fpp
Scanning dependencies of target pre_process
[ 41%] Building Fortran object CMakeFiles/pre_process.dir/src/pre_process/autogen/m_constants.fpp.f90.o
nvfortran-Warning-CUDA_HOME has been deprecated. Please, use NVHPC_CUDA_HOME instead.
/jet/home/bryngel/bryngel-startup-proj/MFC/src/pre_process/autogen/m_constants.fpp.f90:
[ 44%] Building Fortran object CMakeFiles/pre_process.dir/src/pre_process/autogen/m_derived_types.fpp.f90.o
nvfortran-Warning-CUDA_HOME has been deprecated. Please, use NVHPC_CUDA_HOME instead.
/jet/home/bryngel/bryngel-startup-proj/MFC/src/pre_process/autogen/m_derived_types.fpp.f90:

[...]
@henryleberre
Copy link
Member

It would be interesting if you could find a way to reliably reproduce this issue. Here are a few ideas for what could be going wrong:

  • (improbable) A source file got written to.
  • The system's date/time is imprecise/unreliable.
  • Some process changed the last modification date of one or more files.
  • Maybe an issue with symbolic links? (multiple paths can point to the same file)

@sbryngelson
Copy link
Member Author

@henryleberre logging into Bridges2 then issuing:

[C]br013: bryngel-startup-proj/MFC $ . ./mfc.sh load -c b -m c

[I]br013: bryngel-startup-proj/MFC $ ./mfc.sh build -t pre_process simulation -j 8
[...builds...]

[I]br013: bryngel-startup-proj/MFC $ ./mfc.sh run ./examples/1D_sodshocktube/case.py -t pre_process -n 1
mfc: OK > (venv) Entered the Python virtual environment.

      .=++*:          -+*+=.          [email protected] [Linux]
     :+   -*-        ==   =* .        -----------------------------------------
   :*+      ==      ++    .+-         --jobs 1
  :*##-.....:*+   .#%+++=--+=:::.     --mpi
  -=-++-======#=--**+++==+*++=::-:.   --no-gpu
 .:++=----------====+*= ==..:%.....   --no-debug
  .:-=++++===--==+=-+=   +.  :=       --targets pre_process
  +#=::::::::=%=. -+:    =+   *:
-----------------------------------------------------------
 .*=-=*=..    :=+*+:      -...--      $ ./mfc.sh [build, run, test, clean, count, packer]
--help

Run
  Acquiring /ocean/projects/phy210041p/bryngel/MFC/examples/1D_sodshocktube/case.py...
  Configuration:
    Input
/ocean/projects/phy210041p/bryngel/MFC/examples/1D_sodshocktube/case.py
    Job Name      (-#)  MFC
    Engine        (-e)  interactive
    Nodes         (-N)  1
    Tasks (/node) (-n)  1
    MPI Binary    (-b)  srun
  Generating input files for pre_process...

    Generating pre_process.inp.
      INFO: Forwarded 32/50 parameters.

  Generating syscheck/include/case.fpp.
    INFO: Custom case.fpp file is up to date.

  $ cmake --build
/ocean/projects/phy210041p/bryngel/MFC/build/no-debug_no-gpu_mpi/syscheck --target
syscheck -j 1 --config Release

[100%] Built target syscheck

  $ cmake --install
/ocean/projects/phy210041p/bryngel/MFC/build/no-debug_no-gpu_mpi/syscheck

-- Install configuration: "Release"
-- Installing: /jet/home/bryngel/bryngel-startup-proj/MFC/build/install/no-debug_no-gpu_mpi/bin/syscheck
  Generating pre_process/include/case.fpp.
    INFO: Custom case.fpp file is up to date.

  $ cmake --build
/ocean/projects/phy210041p/bryngel/MFC/build/no-debug_no-gpu_mpi/pre_process --target
pre_process -j 1 --config Release

-- GLOB mismatch!
-- Enabled IPO / LTO
-- Configuring done
-- Generating done
-- Build files have been written to: /jet/home/bryngel/bryngel-startup-proj/MFC/build/no-debug_no-gpu_mpi/pre_process
[  2%] Preprocessing (Fypp) m_variables_conversion.fpp
[  5%] Preprocessing (Fypp) m_check_patches.fpp
[  8%] Preprocessing (Fypp) m_constants.fpp
[ 11%] Preprocessing (Fypp) m_data_output.fpp
[...]

@henryleberre
Copy link
Member

Thanks, I'll take a look!

@wilfonba
Copy link
Collaborator

wilfonba commented Jan 2, 2024

@henryleberre --case-optimization seems to be hit or miss lately too... My fork is up to date with master, and I keep getting an unsupported value of weno_order error when using case optimization. When I look at the case.fpp file, it's empty. I'm also seeing the rebuild on every run behavior that @sbryngelson is seeing.

@henryleberre
Copy link
Member

@wilfonba, I can look into it. Are you looking at the case.fpp in the build folder or src/? It transitioned to the former recently. Since we don’t test for case-optimization right now, it’s possible that someone (including myself) might have broken it.

@wilfonba
Copy link
Collaborator

wilfonba commented Jan 2, 2024

Hmm, it appears to have been updated in the build directory. Maybe I'm missing something else then.

@sbryngelson sbryngelson linked a pull request Jan 3, 2024 that will close this issue
henryleberre added a commit to henryleberre/ChemMFC that referenced this issue Jan 5, 2024
henryleberre added a commit to henryleberre/ChemMFC that referenced this issue Jan 5, 2024
henryleberre added a commit to henryleberre/ChemMFC that referenced this issue Jan 5, 2024
henryleberre added a commit to henryleberre/ChemMFC that referenced this issue Jan 5, 2024
henryleberre added a commit to henryleberre/ChemMFC that referenced this issue Jan 6, 2024
henryleberre added a commit to henryleberre/ChemMFC that referenced this issue Jan 7, 2024
henryleberre added a commit to henryleberre/ChemMFC that referenced this issue Jan 7, 2024
henryleberre added a commit to henryleberre/ChemMFC that referenced this issue Jan 7, 2024
henryleberre added a commit to henryleberre/ChemMFC that referenced this issue Jan 7, 2024
henryleberre added a commit to henryleberre/ChemMFC that referenced this issue Jan 9, 2024
henryleberre added a commit to henryleberre/ChemMFC that referenced this issue Jan 9, 2024
henryleberre added a commit to henryleberre/ChemMFC that referenced this issue Jan 10, 2024
henryleberre added a commit to henryleberre/ChemMFC that referenced this issue Jan 14, 2024
@henryleberre henryleberre linked a pull request Jan 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants