- Remove unused variables.
- Add missing extern "C" in thread-MPI.
Change-Id: I595f60ee27ab851e8c7c304b1f02a8f4aa15932f
#include "wait.h"
#include "atomic.h"
#include "wait.h"
#include "atomic.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Fast (possibly busy-wait-based) lock type
*
* This lock type forms an intermediate between the spinlocks and mutexes:
/** Fast (possibly busy-wait-based) lock type
*
* This lock type forms an intermediate between the spinlocks and mutexes:
TMPI_EXPORT
int tMPI_Lock_islocked(tMPI_Lock_t *lock);
TMPI_EXPORT
int tMPI_Lock_islocked(tMPI_Lock_t *lock);
+#ifdef __cplusplus
+}
+#endif
#endif /* TMPI_FASTLOCK_H_ */
#endif /* TMPI_FASTLOCK_H_ */
NOTE: We also assume that the open_file_mutex has been locked */
static void gmx_fio_remove(t_fileio *fio)
{
NOTE: We also assume that the open_file_mutex has been locked */
static void gmx_fio_remove(t_fileio *fio)
{
/* lock prev, because we're changing it */
gmx_fio_lock(fio->prev);
/* lock prev, because we're changing it */
gmx_fio_lock(fio->prev);
t_fileio *gmx_fio_open(const char *fn, const char *mode)
{
t_fileio *fio = NULL;
t_fileio *gmx_fio_open(const char *fn, const char *mode)
{
t_fileio *fio = NULL;
char newmode[5];
gmx_bool bRead, bReadWrite;
char newmode[5];
gmx_bool bRead, bReadWrite;
/* sanitize the mode string */
if (strncmp(mode, "r+", 2) == 0)
/* sanitize the mode string */
if (strncmp(mode, "r+", 2) == 0)
FILE * gmx_fio_fopen(const char *fn, const char *mode)
{
FILE * gmx_fio_fopen(const char *fn, const char *mode)
{
t_fileio *fio;
fio = gmx_fio_open(fn, mode);
t_fileio *fio;
fio = gmx_fio_open(fn, mode);
int gmx_fio_fclose(FILE *fp)
{
t_fileio *cur;
int gmx_fio_fclose(FILE *fp)
{
t_fileio *cur;
- t_fileio *found = NULL;
int rc = -1;
cur = gmx_fio_get_first();
int rc = -1;
cur = gmx_fio_get_first();
/* The fio_mutex should ALWAYS be locked when this function is called */
static int gmx_fio_int_get_file_position(t_fileio *fio, gmx_off_t *offset)
{
/* The fio_mutex should ALWAYS be locked when this function is called */
static int gmx_fio_int_get_file_position(t_fileio *fio, gmx_off_t *offset)
{
/* Flush the file, so we are sure it is written */
if (gmx_fio_int_flush(fio))
{
/* Flush the file, so we are sure it is written */
if (gmx_fio_int_flush(fio))
{
int gmx_fio_get_output_file_positions(gmx_file_position_t **p_outputfiles,
int *p_nfiles)
{
int gmx_fio_get_output_file_positions(gmx_file_position_t **p_outputfiles,
int *p_nfiles)
{
- int i, nfiles, rc, nalloc;
- int pos_hi, pos_lo;
- long pos;
gmx_file_position_t * outputfiles;
gmx_file_position_t * outputfiles;
t_fileio *cur;
nfiles = 0;
t_fileio *cur;
nfiles = 0;
we call this routine... */
if (cur->bOpen && !cur->bRead && cur->iFTP != efCPT)
{
we call this routine... */
if (cur->bOpen && !cur->bRead && cur->iFTP != efCPT)
{
/* This is an output file currently open for writing, add it */
if (nfiles == nalloc)
{
/* This is an output file currently open for writing, add it */
if (nfiles == nalloc)
{
static int gmx_fio_int_fsync(t_fileio *fio)
{
int rc = 0;
static int gmx_fio_int_fsync(t_fileio *fio)
{
int rc = 0;