void run_store_energy(Chunk* chunk, Settings* settings) { START_PROFILING(settings->kernel_profile); store_energy( chunk->ext->raja_lists, chunk->energy0, chunk->energy); STOP_PROFILING(settings->kernel_profile, __func__); }
// Shared solver kernels void run_copy_u(Chunk* chunk, Settings* settings) { START_PROFILING(settings->kernel_profile); copy_u( chunk->x, chunk->y, settings->halo_depth, chunk->u0, chunk->u); STOP_PROFILING(settings->kernel_profile, __func__); }
void mp_remove2_1_svc_nb(void * pt_req, rozorpc_srv_ctx_t *rozorpc_srv_ctx_p, void * pt_resp, uint32_t cnx_id) { mp_status_ret_t * ret = (mp_status_ret_t *) pt_resp; mp_remove2_arg_t * args = (mp_remove2_arg_t*) pt_req; storage_t *st = 0; DEBUG_FUNCTION; START_PROFILING(remove); ret->status = MP_FAILURE; if ((st = get_storage(args->cid, args->sid, cnx_id)) == 0) { ret->mp_status_ret_t_u.error = errno; goto out; } if (storage_rm2_file(st, (unsigned char *) args->fid, args->spare) != 0) { ret->mp_status_ret_t_u.error = errno; goto out; } ret->status = MP_SUCCESS; out: STOP_PROFILING(remove); }
void mp_subthread_locate(void * pt, rozorpc_srv_ctx_t *req_ctx_p) { mp_locate_arg_t * args = (mp_locate_arg_t*) pt; storage_t * st = 0; static mp_locate_ret_t ret; START_PROFILING(locate); /* ** Use received buffer for the response */ req_ctx_p->xmitBuf = req_ctx_p->recv_buf; req_ctx_p->recv_buf = NULL; if ((st = get_storage(args->cid, args->sid, req_ctx_p->socketRef)) == 0) { goto error; } if (storaged_sub_thread_intf_send_req(MP_LOCATE,req_ctx_p,st,tic)==0) { return; } error: ret.status = MP_FAILURE; ret.mp_locate_ret_t_u.error = errno; rozorpc_srv_forward_reply(req_ctx_p,(char*)&ret); /* ** release the context */ rozorpc_srv_release_context(req_ctx_p); STOP_PROFILING(locate); }
int main() { for (unsigned int N = INITIAL_SIZE_2D; N <= LIMIT_2D; INCREMENT) { for (unsigned int itr = 0; itr < NUM_ITERATIONS; itr++) { const unsigned int NX = N; const unsigned int NY = N; // Data size const size_t dataSize_fftwf = sizeof(float)* NX * NY; // CPU allocation float* dataCPU; dataCPU = (float *) malloc(dataSize_fftwf); // Initialize CPU array with random numbers for (unsigned int i = 0; i < NX * NY; i++) { dataCPU[i] = float(i % 256) + i * 0.00001; } char profileName [2048] = "b_fftShift_2D_Real"; char N_char[1024]; sprintf(N_char, "__%dx%d__%d", NX, NY, itr); strcat(profileName, N_char); // FFT execution START_PROFILING(profileName); FFTShift_Real_2D(dataCPU, NX, NY); END_PROFILING(); // Write the data to a file for a single iteration only if (NUM_ITERATIONS == 1) { std::ofstream fileStream; char fileName[1024]; sprintf(fileName, "c_fftShift_2D_Real__%dx%d.check", NX, NY); fileStream.open(fileName); unsigned int index = 0; for (unsigned int i = 0; i < NX; i++) for (unsigned int j = 0; j < NY; j++) { if (index < 8 || index > NX * NY - 8) fileStream << i << "," << j <<":" << dataCPU[index] << std::endl; index++; } fileStream.close(); } free(dataCPU); } } return 0; }
// PPCG solver kernels void run_ppcg_init(Chunk* chunk, Settings* settings) { START_PROFILING(settings->kernel_profile); ppcg_init( chunk->x, chunk->y, settings->halo_depth, chunk->theta, chunk->r, chunk->sd); STOP_PROFILING(settings->kernel_profile, __func__); }
void run_calculate_residual(Chunk* chunk, Settings* settings) { START_PROFILING(settings->kernel_profile); calculate_residual( chunk->x, chunk->y, settings->halo_depth, chunk->u, chunk->u0, chunk->r, chunk->kx, chunk->ky); STOP_PROFILING(settings->kernel_profile, __func__); }
void run_cg_calc_w(Chunk* chunk, Settings* settings, double* pw) { START_PROFILING(settings->kernel_profile); cg_calc_w( chunk->ext->raja_lists, chunk->x, chunk->y, settings->halo_depth, pw, chunk->p, chunk->w, chunk->kx, chunk->ky); STOP_PROFILING(settings->kernel_profile, __func__); }
void run_calculate_2norm( Chunk* chunk, Settings* settings, double* buffer, double* norm) { START_PROFILING(settings->kernel_profile); calculate_2norm( chunk->x, chunk->y, settings->halo_depth, buffer, norm); STOP_PROFILING(settings->kernel_profile, __func__); }
void run_finalise(Chunk* chunk, Settings* settings) { START_PROFILING(settings->kernel_profile); finalise( chunk->x, chunk->y, settings->halo_depth, chunk->energy, chunk->density, chunk->u); STOP_PROFILING(settings->kernel_profile, __func__); }
void run_cg_calc_p(Chunk* chunk, Settings* settings, double beta) { START_PROFILING(settings->kernel_profile); cg_calc_p(chunk->x, chunk->y, settings->halo_depth, beta, chunk->p, chunk->r); STOP_PROFILING(settings->kernel_profile, __func__); }
void Test::TimerMicroSeconds(const unsigned int microSeconds) { char fileName[1024]; sprintf(fileName, "TimerTestMicroSeconds_%d", microSeconds); START_PROFILING(fileName); usleep(microSeconds); END_PROFILING(); }
void run_ppcg_inner_iteration( Chunk* chunk, Settings* settings, double alpha, double beta) { START_PROFILING(settings->kernel_profile); ppcg_inner_iteration( chunk->ext->raja_lists, chunk->x, chunk->y, settings->halo_depth, alpha, beta, chunk->u, chunk->r, chunk->kx, chunk->ky, chunk->sd); STOP_PROFILING(settings->kernel_profile, __func__); }
// Chebyshev solver kernels void run_cheby_init(Chunk* chunk, Settings* settings) { START_PROFILING(settings->kernel_profile); cheby_init( chunk->ext->raja_lists, chunk->x, chunk->y, settings->halo_depth, chunk->theta, chunk->u, chunk->u0, chunk->p, chunk->r, chunk->w, chunk->kx, chunk->ky); STOP_PROFILING(settings->kernel_profile, __func__); }
void run_cg_calc_w(Chunk* chunk, Settings* settings, double* pw) { START_PROFILING(settings->kernel_profile); cg_calc_w(chunk->x, chunk->y, settings->halo_depth, pw, chunk->p, chunk->w, chunk->kx, chunk->ky, chunk->ext->a_row_index, chunk->ext->a_col_index, chunk->ext->a_non_zeros); STOP_PROFILING(settings->kernel_profile, __func__); }
void run_pack_or_unpack( Chunk* chunk, Settings* settings, int depth, int face, bool pack, double* field, double* buffer) { START_PROFILING(settings->kernel_profile); pack_or_unpack(chunk->x, chunk->y, depth, settings->halo_depth, face, pack, field, buffer); STOP_PROFILING(settings->kernel_profile, __func__); }
void run_cg_calc_ur( Chunk* chunk, Settings* settings, double alpha, double* rrn) { START_PROFILING(settings->kernel_profile); cg_calc_ur(chunk->x, chunk->y, settings->halo_depth, alpha, rrn, chunk->u, chunk->p, chunk->r, chunk->w); STOP_PROFILING(settings->kernel_profile, __func__); }
void run_jacobi_iterate( Chunk* chunk, Settings* settings, double* error) { START_PROFILING(settings->kernel_profile); jacobi_iterate( chunk->x, chunk->y, settings->halo_depth, error, chunk->kx, chunk->ky, chunk->u0, chunk->u, chunk->r); STOP_PROFILING(settings->kernel_profile, __func__); }
void run_field_summary( Chunk* chunk, Settings* settings, double* vol, double* mass, double* ie, double* temp) { START_PROFILING(settings->kernel_profile); field_summary( chunk->x, chunk->y, settings->halo_depth, chunk->volume, chunk->density, chunk->energy0, chunk->u, vol, mass, ie, temp); STOP_PROFILING(settings->kernel_profile, __func__); }
// Solver-wide kernels void run_local_halos( Chunk* chunk, Settings* settings, int depth) { START_PROFILING(settings->kernel_profile); local_halos(chunk->x, chunk->y, depth, settings->halo_depth, chunk->neighbours, settings->fields_to_exchange, chunk->density, chunk->energy0, chunk->energy, chunk->u, chunk->p, chunk->sd); STOP_PROFILING(settings->kernel_profile, __func__); }
void run_cheby_iterate( Chunk* chunk, Settings* settings, double alpha, double beta) { START_PROFILING(settings->kernel_profile); cheby_iterate( chunk->ext->raja_lists, chunk->x, chunk->y, settings->halo_depth, alpha, beta, chunk->u, chunk->u0, chunk->p, chunk->r, chunk->w, chunk->kx, chunk->ky); STOP_PROFILING(settings->kernel_profile, __func__); }
// Jacobi solver kernels void run_jacobi_init( Chunk* chunk, Settings* settings, double rx, double ry) { START_PROFILING(settings->kernel_profile); jacobi_init( chunk->x, chunk->y, settings->halo_depth, settings->coefficient, rx, ry, chunk->density, chunk->energy, chunk->u0, chunk->u, chunk->kx, chunk->ky); STOP_PROFILING(settings->kernel_profile, __func__); }
void Test::TimerSeconds(const unsigned int seconds) { char fileName[1024]; sprintf(fileName, "TimerTestSeconds_%d", seconds); const unsigned int microSeconds = seconds * 1000 * 1000; START_PROFILING(fileName); usleep(microSeconds); END_PROFILING(); }
int mslnk_write_attributes(mslnk_t *mslnk, mattr_t *attrs) { int status; START_PROFILING(mslnk_write_attributes); status = pwrite(mslnk->fdattrs, attrs, sizeof(mattr_t), 0) == sizeof(mattr_t) ? 0 : -1; STOP_PROFILING(mslnk_write_attributes); return status; }
void run_cheby_iterate( Chunk* chunk, Settings* settings, double alpha, double beta) { START_PROFILING(settings->kernel_profile); cheby_iterate( chunk->x, chunk->y, settings->halo_depth, alpha, beta, chunk->u, chunk->u0, chunk->p, chunk->r, chunk->w, chunk->kx, chunk->ky, chunk->ext->a_row_index, chunk->ext->a_col_index, chunk->ext->a_non_zeros); STOP_PROFILING(settings->kernel_profile, __func__); }
// Chebyshev solver kernels void run_cheby_init(Chunk* chunk, Settings* settings) { START_PROFILING(settings->kernel_profile); cheby_init( chunk->x, chunk->y, settings->halo_depth, chunk->theta, chunk->u, chunk->u0, chunk->p, chunk->r, chunk->w, chunk->kx, chunk->ky, chunk->ext->a_row_index, chunk->ext->a_col_index, chunk->ext->a_non_zeros); STOP_PROFILING(settings->kernel_profile, __func__); }
// CG solver kernels void run_cg_init( Chunk* chunk, Settings* settings, double rx, double ry, double* rro) { START_PROFILING(settings->kernel_profile); cg_init(chunk->ext->raja_lists, chunk->x, chunk->y, settings->halo_depth, settings->coefficient, rx, ry, rro, chunk->density, chunk->energy, chunk->u, chunk->p, chunk->r, chunk->w, chunk->kx, chunk->ky); STOP_PROFILING(settings->kernel_profile, __func__); }
int mslnk_read_link(mslnk_t *mslnk, char *link) { char link_name[ROZOFS_PATH_MAX]; START_PROFILING(mslnk_read_link); if (pread(mslnk->fdattrs, link_name, ROZOFS_PATH_MAX, sizeof(mattr_t)) != ROZOFS_PATH_MAX) return -1; strcpy(link, link_name); STOP_PROFILING(mslnk_read_link); return 0; }
int mdir_write_attributes(mdir_t *mdir, mattr_t *attrs) { int status = -1; START_PROFILING(mdir_write_attributes); // write attributes if (pwrite(mdir->fdattrs, attrs, sizeof (mattr_t), 0) != sizeof (mattr_t)) { return -1; } status = 0; STOP_PROFILING(mdir_write_attributes); return status; }
int mdir_read_attributes(mdir_t *mdir, mattr_t *attrs) { int status = -1; START_PROFILING(mdir_read_attributes); // read attributes if (pread(mdir->fdattrs, attrs, sizeof (mattr_t), 0) != sizeof (mattr_t)) { goto out; } status = 0; out: STOP_PROFILING(mdir_read_attributes); return status; }