Move gmx_detect_hardware.h to gmxlib/
authorTeemu Murtola <teemu.murtola@gmail.com>
Fri, 13 Nov 2015 07:10:41 +0000 (09:10 +0200)
committerTeemu Murtola <teemu.murtola@gmail.com>
Fri, 13 Nov 2015 12:40:15 +0000 (14:40 +0200)
Some cleanup while there.

Change-Id: Ifb2b097972fe3e901054992751fee622abd7d4f2

src/gromacs/gmxlib/gmx_detect_hardware.cpp
src/gromacs/gmxlib/gmx_detect_hardware.h [moved from src/gromacs/legacyheaders/gmx_detect_hardware.h with 77% similarity]
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_data_mgmt.cpp
src/programs/mdrun/resource-division.cpp
src/programs/mdrun/runner.cpp

index 8dfd08abc6190ab7ec2925444b1051b16ece2549..0ab1515926e7c76711a585ae82e5930bd1d700b8 100644 (file)
@@ -34,7 +34,7 @@
  */
 #include "gmxpre.h"
 
-#include "gromacs/legacyheaders/gmx_detect_hardware.h"
+#include "gmx_detect_hardware.h"
 
 #include "config.h"
 
similarity index 77%
rename from src/gromacs/legacyheaders/gmx_detect_hardware.h
rename to src/gromacs/gmxlib/gmx_detect_hardware.h
index b9928871caf6d97c5545b8b86d62d204af8f0400..d9511b3e408a6db603160ae99f8cc165253a4911 100644 (file)
@@ -32,9 +32,8 @@
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-
-#ifndef GMX_HARDWARE_DETECT_H
-#define GMX_HARDWARE_DETECT_H
+#ifndef GMX_GMXLIB_DETECT_HARDWARE_H
+#define GMX_GMXLIB_DETECT_HARDWARE_H
 
 #include <cstdio>
 
 struct gmx_gpu_info_t;
 struct gmx_gpu_opt_t;
 struct gmx_hw_info_t;
+struct gmx_hw_opt_t;
 struct t_commrec;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-} /* fixes auto-indentation problems */
-#endif
-
 /*! \brief Return whether mdrun can use more than one GPU per node
  *
  * The OpenCL implementation cannot use more than one GPU per node,
@@ -64,38 +57,33 @@ gmx_bool gmx_multiple_gpu_per_node_supported();
  * example. */
 gmx_bool gmx_gpu_sharing_supported();
 
-/* the init and consistency functions depend on commrec that may not be
-   consistent in cuda because MPI types don't exist there.  */
-#ifndef __CUDACC__
 /* Construct the global hwinfo structure and return a pointer to
    it. Caller is responsible for freeing this pointer. */
-gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const struct t_commrec *cr,
+gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const t_commrec *cr,
                                    gmx_bool bDetectGPUs);
 
 /* Print information about the detected hardware to fplog (if != NULL)
  * and to stderr the master rank.
  */
-void gmx_print_detected_hardware(FILE *fplog, const struct t_commrec *cr,
+void gmx_print_detected_hardware(FILE *fplog, const t_commrec *cr,
                                  const gmx_hw_info_t *hwinfo);
 
 void gmx_hardware_info_free(gmx_hw_info_t *hwinfo);
 
 void gmx_parse_gpu_ids(gmx_gpu_opt_t *gpu_opt);
 
-void gmx_select_gpu_ids(FILE *fplog, const struct t_commrec *cr,
+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 struct gmx_hw_info_t *hwinfo,
-                                      const struct t_commrec     *cr,
-                                      const struct gmx_hw_opt_t  *hw_opt,
-                                      gmx_bool                    bUseGPU);
-#endif
-
+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);
 
 /* Check whether a GPU is shared among ranks, and return the number of shared
    gpus
@@ -105,10 +93,4 @@ void gmx_check_hw_runconf_consistency(FILE                       *fplog,
    returns: The number of GPUs shared among ranks, or 0 */
 int gmx_count_gpu_dev_shared(const gmx_gpu_opt_t *gpu_opt);
 
-
-#ifdef __cplusplus
-}
 #endif
-
-
-#endif /* GMX_HARDWARE_DETECT_H */
index bd63308cad48af16c4f63a342a3596dfd3d8b30d..6c5612a115e374e2b1ffc27cb1a576cdb5b7e61a 100644 (file)
 #include "gromacs/fileio/copyrite.h"
 #include "gromacs/fileio/trx.h"
 #include "gromacs/fileio/txtdump.h"
+#include "gromacs/gmxlib/gmx_detect_hardware.h"
 #include "gromacs/gmxlib/gmx_omp_nthreads.h"
 #include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
 #include "gromacs/gmxlib/nonbonded/nonbonded.h"
-#include "gromacs/legacyheaders/gmx_detect_hardware.h"
 #include "gromacs/legacyheaders/names.h"
 #include "gromacs/legacyheaders/network.h"
 #include "gromacs/legacyheaders/types/commrec.h"
index d172e9117b8979a896192a96229280dc64e98f93..16fa6dc97e91353e8c9d9e8ed63d28d9ff2e7183 100644 (file)
 
 #include <cuda_profiler_api.h>
 
+#include "gromacs/gmxlib/gmx_detect_hardware.h"
 #include "gromacs/gmxlib/cuda_tools/cudautils.cuh"
 #include "gromacs/gmxlib/cuda_tools/pmalloc_cuda.h"
 #include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
-#include "gromacs/legacyheaders/gmx_detect_hardware.h"
 #include "gromacs/legacyheaders/types/enums.h"
 #include "gromacs/legacyheaders/types/force_flags.h"
 #include "gromacs/legacyheaders/types/interaction_const.h"
index 586210b95033b7c963196d81423a872421eb26a4..197b4cb50a94dff5d9030dde0ed747e82a7e9bde 100644 (file)
@@ -48,9 +48,9 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "gromacs/gmxlib/gmx_detect_hardware.h"
 #include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
 #include "gromacs/gmxlib/ocl_tools/oclutils.h"
-#include "gromacs/legacyheaders/gmx_detect_hardware.h"
 #include "gromacs/legacyheaders/types/enums.h"
 #include "gromacs/legacyheaders/types/force_flags.h"
 #include "gromacs/legacyheaders/types/interaction_const.h"
index 7dd0e9f50d360918c6bdf2d4d98177f60b193367..8d11ed0e5ddf22008a26620c553e702ddec9eb0b 100644 (file)
@@ -44,9 +44,9 @@
 
 #include <algorithm>
 
+#include "gromacs/gmxlib/gmx_detect_hardware.h"
 #include "gromacs/gmxlib/gmx_omp_nthreads.h"
 #include "gromacs/gmxlib/md_logging.h"
-#include "gromacs/legacyheaders/gmx_detect_hardware.h"
 #include "gromacs/legacyheaders/names.h"
 #include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/legacyheaders/types/inputrec.h"
index 5ce3c0fa772b727fabe0ed24e5966977d294d754..fe5e681847e92eca90a2b2a5f8b8f549958da7a4 100644 (file)
@@ -64,6 +64,7 @@
 #include "gromacs/fileio/trx.h"
 #include "gromacs/fileio/txtdump.h"
 #include "gromacs/gmxlib/disre.h"
+#include "gromacs/gmxlib/gmx_detect_hardware.h"
 #include "gromacs/gmxlib/gmx_omp_nthreads.h"
 #include "gromacs/gmxlib/main.h"
 #include "gromacs/gmxlib/md_logging.h"
@@ -71,7 +72,6 @@
 #include "gromacs/gmxlib/sighandler.h"
 #include "gromacs/gmxlib/thread_affinity.h"
 #include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
-#include "gromacs/legacyheaders/gmx_detect_hardware.h"
 #include "gromacs/legacyheaders/names.h"
 #include "gromacs/legacyheaders/network.h"
 #include "gromacs/math/calculate-ewald-splitting-coefficient.h"