/*
copyV.cu (CUDA+MPI) = ../mpi/copyV.c

entry point
*/

#include "oth.h"
#include "oth_mpi.h"
#include "oth_prototype.h"

void copyV(cuDoubleComplex *v)
{
	// share boundary
	if (commSize > 1) {
		comm_boundary(v);
	}

	// PBC
	if (Pbc.xpbc) {
		if (commSize > 1) {
			comm_Xpbc(v);
		}
		else {
			copyXpbc(v);
		}
		factorXpbc(v);
	}
	if (Pbc.ypbc) {
		copyYpbc(v);
		factorYpbc(v);
	}
	if (Pbc.zpbc) {
		copyZpbc(v);
		factorZpbc(v);
	}
}
