/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012, by the GROMACS development team, led by
- * David van der Spoel, Berk Hess, Erik Lindahl, and including many
- * others, as listed in the AUTHORS file in the top-level source
- * directory and at http://www.gromacs.org.
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
*
* GROMACS is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
*/
#ifndef GMX_THREAD_AFFINITY_H_
#define GMX_THREAD_AFFINITY_H_
-#include "types/commrec.h"
-#include "typedefs.h"
+
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/types/hw_info.h"
+#include "gromacs/utility/basedefinitions.h"
#ifdef __cplusplus
extern "C" {
} /* fixes auto-indentation problems */
#endif
+struct t_commrec;
+
/* Sets the thread affinity using the requested setting stored in hw_opt.
* The hardware topologu is requested from hwinfo, when present.
*/
void
-gmx_set_thread_affinity(FILE *fplog,
- const t_commrec *cr,
- gmx_hw_opt_t *hw_opt,
- const gmx_hw_info_t *hwinfo);
+gmx_set_thread_affinity(FILE *fplog,
+ const struct t_commrec *cr,
+ gmx_hw_opt_t *hw_opt,
+ const gmx_hw_info_t *hwinfo);
/* Check the process affinity mask and if it is found to be non-zero,
* will honor it and disable mdrun internal affinity setting.
* made by the OpenMP library.
*
* Note that this will only work on Linux as we use a GNU feature.
+ * With bAfterOpenmpInit false, it will also detect whether OpenMP environment
+ * variables for setting the affinity are set.
*/
void
-gmx_check_thread_affinity_set(FILE *fplog, const t_commrec *cr,
+gmx_check_thread_affinity_set(FILE *fplog, const struct t_commrec *cr,
gmx_hw_opt_t *hw_opt, int ncpus,
gmx_bool bAfterOpenmpInit);