firemodels / fds

Fire Dynamics Simulator
https://pages.nist.gov/fds-smv/
Other
660 stars 622 forks source link

Output of MPI processes #11845

Closed lu-kas closed 1 year ago

lu-kas commented 1 year ago

Dear all.

This is nothing big, but – in my opinion – an inconsistency. While debugging an MPI environment for the application of FDS, I misinterpreted the output of FDS, now for a second time, and was trying to find errors in the software stack – although everything was fine.

The output of FDS regarding the number of involved MPI processes is different if an input file is passed or not. To demonstrate this, the following two examples show the output of FDS within the same MPI environment (3 processes):

No input file passed leads to an output, as if FDS was called three times 'serially', i.e. the number of MPI processes is not correct:

> mpiexec -np 3 fds

 Fire Dynamics Simulator

 Current Date     : May 22, 2023  18:40:26
 Revision         : FDS-6.8.0-124-g6542893-master
 Revision Date    : Thu May 11 17:25:05 2023 -0400
 Compiler         : ifort version 2021.2.0
 Compilation Date : May 12, 2023 12:02:46

 MPI Enabled;    Number of MPI Processes:       1
 OpenMP Disabled

 Fire Dynamics Simulator

 Current Date     : May 22, 2023  18:40:26
 Revision         : FDS-6.8.0-124-g6542893-master
 Revision Date    : Thu May 11 17:25:05 2023 -0400
 Compiler         : ifort version 2021.2.0
 Compilation Date : May 12, 2023 12:02:46

 MPI Enabled;    Number of MPI Processes:       1
 OpenMP Disabled

 Fire Dynamics Simulator

 Current Date     : May 22, 2023  18:40:26
 Revision         : FDS-6.8.0-124-g6542893-master
 Revision Date    : Thu May 11 17:25:05 2023 -0400
 Compiler         : ifort version 2021.2.0
 Compilation Date : May 12, 2023 12:02:46

 MPI Enabled;    Number of MPI Processes:       1
 OpenMP Disabled

 MPI version: 3.1

 MPI version: 3.1
 MPI library version: Intel(R) MPI Library 2021.2 for Linux* OS

 MPI library version: Intel(R) MPI Library 2021.2 for Linux* OS

 MPI version: 3.1
 MPI library version: Intel(R) MPI Library 2021.2 for Linux* OS

 Consult FDS Users Guide Chapter, Running FDS, for further instructions.
 Consult FDS Users Guide Chapter, Running FDS, for further instructions.
 Consult FDS Users Guide Chapter, Running FDS, for further instructions.

Now with an input file passed:

> mpiexec -np 3 fds input.fds

 Starting FDS ...

 MPI Process      2 started on ana21004
 MPI Process      1 started on ana21004
 MPI Process      0 started on ana21004

 Reading FDS input file ...

 Fire Dynamics Simulator

 Current Date     : May 22, 2023  18:41:34
 Revision         : FDS-6.8.0-124-g6542893-master
 Revision Date    : Thu May 11 17:25:05 2023 -0400
 Compiler         : ifort version 2021.2.0
 Compilation Date : May 12, 2023 12:02:46

 MPI Enabled;    Number of MPI Processes:       3
 OpenMP Disabled

 MPI version: 3.1
 MPI library version: Intel(R) MPI Library 2021.2 for Linux* OS

 Job TITLE        : Steckler Compartment, Test 012
 Job ID string    : Steckler_012

STOP: Set-up only (CHID: Steckler_012)

I would not expect the first 'serial' output of an MPI application, if everything (application, environment, etc.) is set up correctly. I would like to propose two approaches:

  1. Initialize MPI also for the cases where no input file is passed. This would be – in my opinion – the best solution.
  2. Do not print the information about MPI processes if no input file is passed.

What are your opinions about this?

Thanks! Lukas

mcgratta commented 1 year ago

I implemented Option 2 for the moment. The reason why I did not implement Option 1 is because we often have trouble initiating MPI on a new system. If we print out the information about FDS before MPI_INIT, we can at least confirm that the program is running.

rmcdermo commented 1 year ago

@mcgratta I am not keen on the current implementation. I am running cases now that have input file errors, but I do not see the code version information. I think to address Lukas, we just need to not print the MPI information.

lu-kas commented 1 year ago

Or, initialise the variable with number of MPI processes to, e.g., 0. This value then gets set to the right number once MPI is initialised.

Overall, this is not a big thing. If it breaks common working paths, then just leave it as it is. I have my lesson learned.

mcgratta commented 1 year ago

This might be a red herring. The only thing I did was not print out the number of MPI processes if there is no input file. Everything else should be the same.

rmcdermo commented 1 year ago

OK, things looked odd, but could be something else. Thanks

rmcdermo commented 1 year ago

Well, I've discovered I used this info without the input file more than I thought; for example, just to see if I have pointed to the OMP or serial version.

MPI Enabled;    Number of MPI Processes:       1
OpenMP Disabled

Could we do something like this:

IF (INPUT_FILE_INCLUDED) THEN
   WRITE(LU,'(A,I6)')  ' MPI Enabled;    Number of MPI Processes:  ',N_MPI_PROCESSES
ELSE
   WRITE(LU,'(A)')     ' MPI not initialized '
ENDIF
IF (.NOT. USE_OPENMP) WRITE(LU,'(A)')  ' OpenMP Disabled'
IF (USE_OPENMP)       WRITE(LU,'(A,I6)')  ' OpenMP Enabled; Number of OpenMP Threads: ',OPENMP_AVAILABLE_THREADS
mcgratta commented 1 year ago

OK, I changed the output to what you suggested.