
/*******************************************************************************
*
* File start.h
*
* Copyright (C) 2005 Martin Luescher
*
* This software is distributed under the terms of the GNU General Public
* License (GPL)
*
*******************************************************************************/

#ifndef START_H
#define START_H

#ifndef SU3_H
#include "su3.h"
#endif

#include "dds_interface.h"

typedef enum
{
   ALL_PTS,EVEN_PTS,ODD_PTS,NO_PTS,PT_SETS
} ptset_t;

#ifndef BLOCK_H
#include "block.h"
#endif

#ifndef FLIPBC_C
extern void flipbc(void);
extern void flipbcd(void);
#endif

#ifndef GEOMETRY_C
extern int ipr_global(int n[]);
extern void ipt_global(int x[],int *ip,int *ix);
void geometry(void);
void geometry_flex(dds_lat_grid *par);
extern void block_geometry(block_t *b);
extern void bndry_geometry(block_t *b);
#endif

#ifndef START_C
extern void start_ranlux(int level,int seed);
extern void alloc_u(void);
extern void alloc_ud(void);
extern void alloc_s(int no_fields);
extern void alloc_sd(int no_fields);
extern void free_u(void);
extern void free_ud(void);
extern void free_s(void);
extern void free_sd(void);
extern void random_u(void);
extern void random_ud(void);
extern void renormalize_u(void);
extern void renormalize_ud(void);
extern void assign_u2ud(void);
extern void assign_ud2u(void);
void *alloc_ssfield();
void *alloc_dsfield();
void *alloc_qsfield();
#endif

#ifndef SINIT_C
extern void set_s2zero(int vol,spinor *pk);
extern void set_sd2zero(int vol,spinor_dble *pk);
extern void random_s(int vol,spinor *pk,float sigma);
extern void random_sd(int vol,spinor_dble *pk,double sigma);
extern void assign_s2s(int vol,spinor *pk,spinor *pl);
extern void assign_s2sd(int vol,spinor *pk,spinor_dble *pl);
extern void assign_sd2s(int vol,spinor_dble *pk,spinor *pl);
extern void assign_sd2sd(int vol,spinor_dble *pk,spinor_dble *pl);
#endif

#ifndef UTILS_C
extern int safe_mod(int x,int y);
extern void *amalloc(size_t size,int p);
extern void afree(void *addr);
extern int mpi_permanent_tag(void);
extern int mpi_tag(void);
extern void error(int test,int no,char *name,char *format,...);
extern void error_root(int test,int no,char *name,char *format,...);
extern int error_loc(int test,int no,char *name,char *message);
extern void error_chk(void);
extern void message(char *format,...);
#endif

#endif
