#ifndef USEMPI_INCLUDED #define USEMPI_INCLUDED #include #include "spectrum.h" /* Using a master-slave approach, GROUP_SIZE is the number of processors for each slave. Each slave performs parallel matrix construction and diagonalization. GROUP_SIZE=0 means parallel matrix diagonalization across all processors. Does not use master-slave approach. GROUP_SIZE=1 master slave approach with each slave constructing and diagonalizing matrices locally. */ #ifndef GROUP_SIZE #define GROUP_SIZE 0 #endif /* processor rank for master */ #define WORLD_MASTER 0 /* mpi_specify_calculation, and mpitype are initialized in initmpisectors below: this should be called by the main program.*/ MPI_Datatype mpi_specify_calculation; /************************ function prototypes ********************/ int master(specify_calculation *base, element *couplings, element *vals, int *whichvals, int *nvals, int njob); /* master for MPI */ void slave(void); /* slave for MPI */ void init_mpi_types(void); /*initialize data structures and groups */ integer mpi_group; /* group for diagonalizing doing spectrum */ #if 1 /* GROUP_SIZE > 0 don't use any more */ MPI_Comm mpiallslaves; /* communicator handle of all slaves. */ #else void MasterShutDown(void); void spectrum2(sectors *s, /* basis, filled by initbasis(...) */ sectors *s2, /* second basis for nonzero momentum */ doublereal **vals, /* list of eigenvalues */ doublereal **vecin, /* list of eigenvectors */ integer nval, /* number of eigenvalues */ element *couplings, /* coupling constants */ element *angle, /* angles and momenta, length HINDEX+2 */ int globalkt, /* maximum value of kt, for mapcouplings */ integer nfig); /* number of significant digits in answer */ void FindChunk(integer *Size, int PeID, int Comm_Size, MPI_Comm Our_Comm); #endif /******************* New mpi data type ****************************/ #define MPI_SIZE_T MPI_UNSIGNED_LONG /* this should match type "size_mem" */ #endif