HΦ
3.2.0
|
MPI wrapper for init, finalize, bcast, etc. More...
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "wrapperMPI.h"
#include <math.h>
#include <complex.h>
#include "splash.h"
#include "global.h"
Go to the source code of this file.
Functions | |
void | InitializeMPI (int argc, char *argv[]) |
MPI initialization wrapper Process ID (myrank), Number of processes (nproc), Number of threads (nthreads), and pointer to the standard output (stdoutMPI) are specified here. More... | |
void | FinalizeMPI () |
MPI Finitialization wrapper. More... | |
void | exitMPI (int errorcode) |
MPI Abortation wrapper. More... | |
FILE * | fopenMPI (const char *FileName, const char *mode) |
MPI file I/O (open) wrapper. Only the root node (myrank = 0) should be open/read/write (small) parameter files. More... | |
char * | fgetsMPI (char *InputString, int maxcount, FILE *fp) |
MPI file I/O (get a line, fgets) wrapper. Only the root node (myrank = 0) reads and broadcast string. More... | |
void | BarrierMPI () |
MPI barrier wrapper. More... | |
unsigned long int | MaxMPI_li (unsigned long int idim) |
MPI wrapper function to obtain maximum unsigned long integer across processes. More... | |
double | MaxMPI_d (double dvalue) |
MPI wrapper function to obtain maximum Double across processes. More... | |
double complex | SumMPI_dc (double complex norm) |
MPI wrapper function to obtain sum of Double complex across processes. More... | |
double | SumMPI_d (double norm) |
MPI wrapper function to obtain sum of Double across processes. More... | |
unsigned long int | SumMPI_li (unsigned long int idim) |
MPI wrapper function to obtain sum of unsigned long integer across processes. More... | |
int | SumMPI_i (int idim) |
MPI wrapper function to obtain sum of integer across processes. More... | |
unsigned long int | BcastMPI_li (int root, unsigned long int idim) |
MPI wrapper function to broadcast unsigned long integer across processes. More... | |
double | NormMPI_dc (unsigned long int idim, double complex *_v1) |
Compute norm of process-distributed vector \(|{\bf v}_1|^2\). More... | |
double complex | VecProdMPI (long unsigned int ndim, double complex *v1, double complex *v2) |
Compute conjugate scaler product of process-distributed vector \({\bf v}_1^* \cdot {\bf v}_2\). More... | |
MPI wrapper for init, finalize, bcast, etc.
Definition in file wrapperMPI.c.
void BarrierMPI | ( | ) |
MPI barrier wrapper.
Definition at line 160 of file wrapperMPI.c.
unsigned long int BcastMPI_li | ( | int | root, |
unsigned long int | idim | ||
) |
MPI wrapper function to broadcast unsigned long integer across processes.
[in] | root | The source process of the broadcast |
[in] | idim | Value to be broadcasted |
Definition at line 273 of file wrapperMPI.c.
Referenced by Initialize_wave(), Lanczos_EigenVector(), and SetInitialVector().
void exitMPI | ( | int | errorcode | ) |
MPI Abortation wrapper.
[in] | errorcode | Error-code to be returned as that of this program |
Definition at line 86 of file wrapperMPI.c.
Referenced by CalcByLanczos(), CalcByLOBPCG(), CalcByTEM(), CalcByTPQ(), CalcSpectrum(), CalcSpectrumByBiCG(), CalcSpectrumByTPQ(), CheckMPI(), CheckMPI_Summary(), dsfmt_chk_init_by_array(), dsfmt_chk_init_gen_rand(), Initialize_wave(), InitializeMPI(), main(), MakeExcitedList(), MaxMPI_d(), MaxMPI_li(), Output_restart(), phys(), Read_sz(), ReadDefFileIdxPara(), SumMPI_d(), SumMPI_dc(), SumMPI_i(), SumMPI_li(), sz(), X_Ajt_MPI(), X_child_CisAit_GeneralSpin_MPIdouble(), X_child_CisAit_spin_MPIdouble(), X_child_CisAitCjuAjv_GeneralSpin_MPIdouble(), X_child_CisAitCjuAjv_GeneralSpin_MPIsingle(), X_child_CisAjt_MPIdouble(), X_child_CisAjt_MPIsingle(), X_child_CisAjtCkuAku_Hubbard_MPI(), X_child_CisAjtCkuAlv_Hubbard_MPI(), X_child_general_hopp_MPIdouble(), X_child_general_hopp_MPIsingle(), X_child_general_int_spin_MPIdouble(), X_child_general_int_spin_MPIsingle(), X_child_general_int_spin_TotalS_MPIdouble(), X_Cis_MPI(), X_GC_Ajt_MPI(), X_GC_child_CisAisCjuAjv_GeneralSpin_MPIdouble(), X_GC_child_CisAisCjuAjv_GeneralSpin_MPIsingle(), X_GC_child_CisAisCjuAjv_spin_MPIdouble(), X_GC_child_CisAisCjuAjv_spin_MPIsingle(), X_GC_child_CisAit_GeneralSpin_MPIdouble(), X_GC_child_CisAit_spin_MPIdouble(), X_GC_child_CisAitCiuAiv_spin_MPIdouble(), X_GC_child_CisAitCiuAiv_spin_MPIsingle(), X_GC_child_CisAitCjuAju_GeneralSpin_MPIdouble(), X_GC_child_CisAitCjuAju_spin_MPIdouble(), X_GC_child_CisAitCjuAjv_GeneralSpin_MPIdouble(), X_GC_child_CisAitCjuAjv_GeneralSpin_MPIsingle(), X_GC_child_CisAjt_Hubbard_MPI(), X_GC_child_CisAjtCkuAku_Hubbard_MPI(), X_GC_child_CisAjtCkuAlv_Hubbard_MPI(), X_GC_child_general_hopp_MPIdouble(), X_GC_child_general_hopp_MPIsingle(), and X_GC_Cis_MPI().
char* fgetsMPI | ( | char * | InputString, |
int | maxcount, | ||
FILE * | fp | ||
) |
MPI file I/O (get a line, fgets) wrapper. Only the root node (myrank = 0) reads and broadcast string.
[out] | InputString | read line. |
[in] | maxcount | Length of string |
[in] | fp | file pointer |
Definition at line 122 of file wrapperMPI.c.
References myrank.
Referenced by GetFileName(), inputHam(), Read_sz(), ReadcalcmodFile(), ReadDefFileIdxPara(), ReadDefFileNInt(), ReadTMComponents(), ReadTMComponents_BiCG(), and SetOmega().
void FinalizeMPI | ( | ) |
MPI Finitialization wrapper.
Definition at line 74 of file wrapperMPI.c.
References myrank, and stdoutMPI.
Referenced by main(), and MakeExcitedList().
FILE* fopenMPI | ( | const char * | FileName, |
const char * | mode | ||
) |
MPI file I/O (open) wrapper. Only the root node (myrank = 0) should be open/read/write (small) parameter files.
[in] | FileName | Input/output file |
[in] | mode | "w", "r", etc. |
Definition at line 105 of file wrapperMPI.c.
References myrank.
Referenced by childfopenMPI(), GetFileName(), ReadcalcmodFile(), ReadDefFileIdxPara(), and ReadDefFileNInt().
void InitializeMPI | ( | int | argc, |
char * | argv[] | ||
) |
MPI initialization wrapper Process ID (myrank), Number of processes (nproc), Number of threads (nthreads), and pointer to the standard output (stdoutMPI) are specified here.
Definition at line 43 of file wrapperMPI.c.
References exitMPI(), myrank, nproc, nthreads, splash(), and stdoutMPI.
Referenced by main().
double MaxMPI_d | ( | double | dvalue | ) |
MPI wrapper function to obtain maximum Double across processes.
[in] | dvalue | Value to be maximized |
Definition at line 188 of file wrapperMPI.c.
References exitMPI().
Referenced by check().
unsigned long int MaxMPI_li | ( | unsigned long int | idim | ) |
MPI wrapper function to obtain maximum unsigned long integer across processes.
[in] | idim | Value to be maximized |
Definition at line 171 of file wrapperMPI.c.
References exitMPI().
Referenced by check(), GetPairExcitedStateGeneralSpin(), GetPairExcitedStateHalfSpin(), GetPairExcitedStateHubbard(), GetSingleExcitedStateHubbard(), GetSingleExcitedStateHubbardGC(), and setmem_large().
double NormMPI_dc | ( | unsigned long int | idim, |
double complex * | _v1 | ||
) |
Compute norm of process-distributed vector \(|{\bf v}_1|^2\).
[in] | idim | Local dimension of vector |
[in] | _v1 | [idim] vector to be producted |
Definition at line 289 of file wrapperMPI.c.
References SumMPI_dc().
Referenced by CalcSpectrum().
double SumMPI_d | ( | double | norm | ) |
MPI wrapper function to obtain sum of Double across processes.
[in] | norm | Value to be summed |
Definition at line 222 of file wrapperMPI.c.
References exitMPI().
Referenced by CG_EigenVector(), expec_energy_flct_GeneralSpin(), expec_energy_flct_GeneralSpinGC(), expec_energy_flct_HalfSpin(), expec_energy_flct_HalfSpinGC(), expec_energy_flct_Hubbard(), expec_energy_flct_HubbardGC(), Lanczos_EigenVector(), and PowerLanczos().
double complex SumMPI_dc | ( | double complex | norm | ) |
MPI wrapper function to obtain sum of Double complex across processes.
[in] | norm | Value to be summed |
Definition at line 205 of file wrapperMPI.c.
References exitMPI().
Referenced by CG_EigenVector(), expec_cisajs_Hubbard(), expec_cisajs_HubbardGC(), expec_cisajs_SpinGCGeneral(), expec_cisajs_SpinGCHalf(), expec_cisajs_SpinGeneral(), expec_cisajs_SpinHalf(), expec_cisajscktalt_Hubbard(), expec_cisajscktalt_HubbardGC(), expec_cisajscktalt_SpinGCGeneral(), expec_cisajscktalt_SpinGCHalf(), expec_cisajscktalt_SpinGeneral(), expec_cisajscktalt_SpinHalf(), expec_energy_flct(), Lanczos_EigenValue(), Lanczos_EigenVector(), Lanczos_GetTridiagonalMatrixComponents(), mltply(), Multiply(), MultiplyForTEM(), NormMPI_dc(), PowerLanczos(), SetDiagonalTEChemi(), SetDiagonalTEInterAll(), SetDiagonalTETransfer(), SetInitialVector(), totalspin_Spin(), totalspin_SpinGC(), totalSz_HubbardGC(), totalSz_SpinGC(), and VecProdMPI().
int SumMPI_i | ( | int | idim | ) |
MPI wrapper function to obtain sum of integer across processes.
[in] | idim | Value to be summed |
Definition at line 256 of file wrapperMPI.c.
References exitMPI().
Referenced by CheckMPI_Summary().
unsigned long int SumMPI_li | ( | unsigned long int | idim | ) |
MPI wrapper function to obtain sum of unsigned long integer across processes.
[in] | idim | Value to be summed |
Definition at line 239 of file wrapperMPI.c.
References exitMPI().
Referenced by CheckMPI_Summary(), Initialize_wave(), Lanczos_EigenValue(), Lanczos_EigenVector(), Lanczos_GetTridiagonalMatrixComponents(), and SetInitialVector().
double complex VecProdMPI | ( | long unsigned int | ndim, |
double complex * | v1, | ||
double complex * | v2 | ||
) |
Compute conjugate scaler product of process-distributed vector \({\bf v}_1^* \cdot {\bf v}_2\).
[in] | ndim | Local dimension of vector |
[in] | v1 | [ndim] vector to be producted |
[in] | v2 | [ndim] vector to be producted |
Definition at line 314 of file wrapperMPI.c.
References SumMPI_dc().
Referenced by CalcSpectrumByBiCG(), Initialize_wave(), InitShadowRes(), and LOBPCG_Main().