Add checks for inefficient resource usage
[alexxy/gromacs.git] / src / programs / mdrun / resource-division.h
index b662f7100a51258ea5d50656fce494df0ac80e45..ca982377414f2c575358fdf0e5018513f01d9173 100644 (file)
@@ -53,6 +53,20 @@ int get_nthreads_mpi(const gmx_hw_info_t *hwinfo,
                      const t_commrec     *cr,
                      FILE                *fplog);
 
+/* Check if the number of OpenMP threads is within reasonable range
+ * considering the hardware used. This is a crude check, but mainly
+ * intended to catch cases where the user starts 1 MPI rank per hardware
+ * thread or 1 rank per physical node.
+ * With a sub-optimal setup a note is printed to fplog and stderr when
+ * bNtOptSet==TRUE; with bNtOptSet==FALSE a fatal error is issued.
+ * This function should be called after thread-MPI and OpenMP are set up.
+ */
+void check_resource_division_efficiency(const gmx_hw_info_t *hwinfo,
+                                        const gmx_hw_opt_t  *hw_opt,
+                                        gmx_bool             bNTOptSet,
+                                        t_commrec           *cr,
+                                        FILE                *fplog);
+
 /* Checks we can do when we don't (yet) know the cut-off scheme */
 void check_and_update_hw_opt_1(gmx_hw_opt_t *hw_opt,
                                gmx_bool      bIsSimMaster);