40 int rank,
int nproc,
int check=1) {
49 int row=rank/proc_col, col=rank%proc_col;
51 const double width=300./(nrow-1),
length=300./(ncol-1);
53 double x0 = col*300, y0=row*300, y1=y0;
58 assert( coors[
i*ncol+
j][0]==x1 && coors[
i*ncol+
j][1]==y1 &&
59 coors[
i*ncol+
j][2]==0.5);
61 coors[
i*ncol+
j][0]=x1*check;
62 coors[
i*ncol+
j][1]=y1*check;
63 coors[
i*ncol+
j][2]=0.5;
72 int ncol,
int rank,
int nproc,
int check=1) {
82 int row=rank/proc_col, col=rank%proc_col;
84 const double width=300./(nrow-1),
length=300./(ncol-1);
86 double x0 = col*300, y0=row*300, y1=y0;
91 assert( coors[
i*ncol+
j][0]==x1 && coors[
i*ncol+
j][1]==y1 &&
92 coors[
i*ncol+
j][2]==0.0);
94 coors[
i*ncol+
j][0]=x1*check;
95 coors[
i*ncol+
j][1]=y1*check;
96 coors[
i*ncol+
j][2]=0.0;
104 for (
int i=0;
i<nrow-1; ++
i) {
105 for (
int j=0;
j<ncol-1; ++
j) {
107 assert( elmts[
i*(ncol-1)+
j][0]==
i*ncol+
j+1 &&
108 elmts[
i*(ncol-1)+
j][1]==
i*ncol+
j+ncol+1 &&
109 elmts[
i*(ncol-1)+
j][2]==
i*ncol+
j+ncol+2 &&
110 elmts[
i*(ncol-1)+
j][3]==
i*ncol+
j+2);
113 elmts[
i*(ncol-1)+
j][0]=check*
i*ncol+
j+1;
114 elmts[
i*(ncol-1)+
j][1]=check*
i*ncol+
j+ncol+1;
115 elmts[
i*(ncol-1)+
j][2]=check*
i*ncol+
j+ncol+2;
116 elmts[
i*(ncol-1)+
j][3]=check*
i*ncol+
j+2;
124 int ierr = MPI_Comm_rank( comm, &rank);
COM_assertion( ierr == 0);
130 int ierr = MPI_Comm_size( comm, &size);
COM_assertion( ierr == 0);
134 int main(
int argc,
char *argv[]) {
143 MPI_Init( &argc, &argv);
150 int vb = (argc>1) ? atoi(argv[1]) : 1;
155 if ( comm_rank == 0) cout <<
"Creating window \"unstr\"" << endl;
159 for (
int pid=0; pid<nproc; ++pid)
if (pid%comm_size==comm_rank) {
161 nrow, ncol, pid, nproc);
181 cout <<
"Output normals into file..." << endl;
191 if ( comm_rank == 0) cout <<
"Creating window \"str\"" << endl;
195 for (
int pid=0; pid<nproc; ++pid)
if (pid%comm_size==comm_rank) {
200 int dims[2] = {
ncol, nrow};
215 cout <<
"Output normals into file..." << endl;
double coors_f[total_npanes][nrow *ncol][3]
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
void init_structured_mesh(double coors[][3], int nrow, int ncol, int rank, int nproc, int check=1)
void COM_delete_window(const char *wname)
int get_comm_rank(MPI_Comm comm)
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
This file contains the prototypes for Roccom API.
void COM_set_verbose(int i)
int COM_get_attribute_handle(const char *waname)
double length(Vector3D *const v, int n)
void COM_load_module(const char *libname, const char *winname)
int get_comm_size(MPI_Comm comm)
int elmts[total_npanes][num_elmts][4]
void COM_window_init_done(const char *w_str, int pane_changed=true)
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
void COM_call_function(const int wf, int argc,...)
void COM_set_array(const char *wa_str, int pane_id, void *addr, int strd=0, int cap=0)
Associates an array with an attribute for a specific pane.
int COM_get_attribute_handle_const(const char *waname)
int main(int argc, char *argv[])
void COM_init(int *argc, char ***argv)
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
double coors_s[total_npanes][num_nodes][3]
void COM_resize_array(const char *wa_str, int pane_id=0, void **addr=NULL, int strd=-1, int cap=0)
Resize an attribute on a specific pane and return the address by setting addr.
int COM_get_function_handle(const char *wfname)
void init_unstructure_mesh(double coors[18][3], int elmts[4][8])