Merge branch release-4-6
[alexxy/gromacs.git] / src / gromacs / legacyheaders / gmx_detect_hardware.h
index f2dcb107d74758d801660633c6b1a9d5b8351b8a..860928ba381ce0dd10e2bc82d10eaf842a64a536 100644 (file)
@@ -31,33 +31,40 @@ extern "C" {
 } /* fixes auto-indentation problems */
 #endif
 
-/* the init and consistency functions depend on commrec that may not be 
+/* the init and consistency functions depend on commrec that may not be
    consistent in cuda because MPI types don't exist there.  */
 #ifndef __CUDACC__
 #include "types/commrec.h"
 /* return a pointer to a global hwinfo structure. */
 gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const t_commrec *cr,
-                                   gmx_bool bForceUseGPU, gmx_bool bTryUseGPU,
-                                   const char *gpu_id);
+                                   gmx_bool bDetectGPUs);
 
 void gmx_hardware_info_free(gmx_hw_info_t *hwinfo);
 
-/* Check the thread count + GPU assignment. This function must
-   either be run by all threads that persist (i.e. all tmpi threads),
-   or be run before they are created.  */
-void gmx_check_hw_runconf_consistency(FILE *fplog, gmx_hw_info_t *hwinfo,
-                                      const t_commrec *cr, int ntmpi_requsted,
-                                      gmx_bool bUseGPU);
+void gmx_parse_gpu_ids(gmx_gpu_opt_t *gpu_opt);
+
+void gmx_select_gpu_ids(FILE *fplog, const t_commrec *cr,
+                        const gmx_gpu_info_t *gpu_info,
+                        gmx_bool bForceUseGPU,
+                        gmx_gpu_opt_t *gpu_opt);
+
+/* Check the consistency of hw_opt with hwinfo.
+   This function should be called once on each MPI rank. */
+void gmx_check_hw_runconf_consistency(FILE                *fplog,
+                                      const gmx_hw_info_t *hwinfo,
+                                      const t_commrec     *cr,
+                                      const gmx_hw_opt_t  *hw_opt,
+                                      gmx_bool             bUseGPU);
 #endif
 
 
 /* Check whether a GPU is shared among ranks, and return the number of shared
    gpus
 
-   hwinfo        = the hwinfo struct
+   gpu_opt       = the gpu options struct
 
    returns: The number of GPUs shared among ranks, or 0 */
-int gmx_count_gpu_dev_shared(const gmx_gpu_info_t *gpu_info);
+int gmx_count_gpu_dev_shared(const gmx_gpu_opt_t *gpu_opt);
 
 
 #ifdef __cplusplus