 #ifdef _OPENMP
             #pragma omp parallel for schedule(static,1) ordered private(thread, cpuid)
             for ( j=0; j<nthreads; j++) {
-                thread = omp_get_thread_num();
+                int thread = omp_get_thread_num();
                 cpuid = sched_getcpu();
                 #pragma omp ordered
                 printf("node %s, task %3d of %3d tasks, thread %3d of %3d threads, on cpu %3d\n",

#endif
#include <sched.h>

int sched_getcpu(void); //forward declare glibc function to avoid compiler warnings

//**************************************************************************************//
//Determine on which CPU a thread in an MPI, MPI+OpenMP, or MPI+CUDA program executes.  //

            }
#elif defined __CUDACC__
            cpuid = sched_getcpu();
            printf("node %s, task %3d of %3d tasks, GPU %3d out of %3d, on cpu %3d\n",
                    &node_name[0], task, ntasks, device, num_devices, cpuid);
#else //pure MPI
            cpuid = sched_getcpu();
