Variables on Specific ids (MPI)
I'm running a simple SPMD program with MPI.
Is there a way to define special variables, defined on only some of the ids. Lets say only for worker id 4.
Gives error when compiling.
MPI_Comm_rank (MPI_COMM_WORLD, &labindex);
/* get current process id */
if ((labindex==4) && (tsn>save_start) && (tsn<save_end))
PPICC.c: In function ‘main’:
PPICC.c:213: warning: unused variable ‘taym’
PPICC.c:212: warning: unused variable ‘V_mean’
PPICC.c:329: error: ‘taym’ undeclared (first use in this function)
PPICC.c:329: error: (Each undeclared identifier is reported only once
PPICC.c:329: error: for each function it appears in.)
PPICC.c:332: error: ‘V_mean’ undeclared (first use in this function)
If I define the variable V_mean for all of the workers, I will use excessive memory. Is there a solution for this?
With Best Regards