Skip to content

Commit

Permalink
replace %I64u by %zu
Browse files Browse the repository at this point in the history
  • Loading branch information
Qianqian Fang committed Apr 3, 2020
1 parent c20ed88 commit 5d3df36
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/mcx_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,12 +803,12 @@ void mcx_loadconfig(FILE *in, mcconfig *cfg){

if(in==stdin)
MMC_FPRINTF(stdout,"Please specify the total number of photons: [1000000]\n\t");
MMC_ASSERT(fscanf(in,"%I64u", &(nphoton) )==1);
MMC_ASSERT(fscanf(in,"%zu", &(nphoton) )==1);
if(cfg->nphoton==0) cfg->nphoton=nphoton;
comm=fgets(comment,MAX_PATH_LENGTH,in);

if(in==stdin)
MMC_FPRINTF(stdout,">> %I64u\nPlease specify the random number generator seed: [123456789]\n\t",cfg->nphoton);
MMC_FPRINTF(stdout,">> %zu\nPlease specify the random number generator seed: [123456789]\n\t",cfg->nphoton);
if(cfg->seed==0x623F9A9E)
MMC_ASSERT(fscanf(in,"%d", &(cfg->seed) )==1);
else
Expand Down Expand Up @@ -968,7 +968,7 @@ void mcx_loadconfig(FILE *in, mcconfig *cfg){
void mcx_saveconfig(FILE *out, mcconfig *cfg){
int i;

MMC_FPRINTF(out,"%I64u\n", (cfg->nphoton) );
MMC_FPRINTF(out,"%zu\n", (cfg->nphoton) );
MMC_FPRINTF(out,"%d\n", (cfg->seed) );
MMC_FPRINTF(out,"%f %f %f\n", (cfg->srcpos.x),(cfg->srcpos.y),(cfg->srcpos.z) );
MMC_FPRINTF(out,"%f %f %f\n", (cfg->srcdir.x),(cfg->srcdir.y),(cfg->srcdir.z) );
Expand Down
2 changes: 1 addition & 1 deletion src/mmc_cl_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ is more than what your have specified (%d), please use the -H option to specify
mesh_saveweight(mesh,cfg,1);
}
// total energy here equals total simulated photons+unfinished photons for all threads
MMC_FPRINTF(cfg->flog,"simulated %I64u photons (%I64u) with %d devices (ray-tet %.0f)\nMCX simulation speed: %.2f photon/ms\n",
MMC_FPRINTF(cfg->flog,"simulated %zu photons (%zu) with %d devices (ray-tet %.0f)\nMCX simulation speed: %.2f photon/ms\n",
cfg->nphoton,cfg->nphoton,workdev, reporter.raytet,(double)cfg->nphoton/toc);
MMC_FPRINTF(cfg->flog,"total simulated energy: %.2f\tabsorbed: %5.5f%%\n(loss due to initial specular reflection is excluded in the total)\n",
cfg->energytot,(cfg->energytot-cfg->energyesc)/cfg->energytot*100.f);
Expand Down
4 changes: 2 additions & 2 deletions src/mmclab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ void mmc_set_field(const mxArray *root,const mxArray *item,int idx, mcconfig *cf
memcpy(cfg->photonseed,mxGetData(item),arraydim[0]*arraydim[1]);
cfg->seed=SEED_FROM_FILE;
cfg->nphoton=arraydim[1];
printf("mmc.nphoton=%I64d;\n",cfg->nphoton);
printf("mmc.nphoton=%zu;\n",cfg->nphoton);
}
}else if(strcmp(name,"replayweight")==0){
arraydim=mxGetDimensions(item);
Expand Down Expand Up @@ -649,7 +649,7 @@ void mmc_set_field(const mxArray *root,const mxArray *item,int idx, mcconfig *cf
mexErrMsgTxt("the workload list can not be longer than 256");
for(dimtype i=0;i<arraydim[0]*arraydim[1];i++)
cfg->workload[i]=val[i];
printf("mmc.workload=<<%I64d>>;\n",arraydim[0]*arraydim[1]);
printf("mmc.workload=<<%zu>>;\n",arraydim[0]*arraydim[1]);
}else if(strcmp(name,"isreoriented")==0){
/*internal flag, don't need to do anything*/
}else{
Expand Down
10 changes: 5 additions & 5 deletions src/tettracing.c
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ void onephoton(size_t id,raytracer *tracer,tetmesh *mesh,mcconfig *cfg,
}
// if(r.eid!=ID_UNDEFINED && mesh->med[mesh->type[oldeid-1]].n == cfg->nout ) break;
if(r.pout.x!=MMC_UNDEFINED && (cfg->debuglevel&dlMove))
MMC_FPRINTF(cfg->flog,"P %f %f %f %d %I64u %e\n",r.pout.x,r.pout.y,r.pout.z,r.eid,id,r.slen);
MMC_FPRINTF(cfg->flog,"P %f %f %f %d %zu %e\n",r.pout.x,r.pout.y,r.pout.z,r.eid,id,r.slen);

r.slen=(*tracercore)(&r,tracer,cfg,visit);
if(cfg->issavedet && r.Lmove>0.f && mesh->type[r.eid-1]>0)
Expand All @@ -1275,7 +1275,7 @@ void onephoton(size_t id,raytracer *tracer,tetmesh *mesh,mcconfig *cfg,
}
if(r.eid<=0 || r.pout.x==MMC_UNDEFINED) {
if(r.eid!=ID_UNDEFINED && (cfg->debuglevel&dlMove))
MMC_FPRINTF(cfg->flog,"B %f %f %f %d %I64u %e\n",r.p0.x,r.p0.y,r.p0.z,r.eid,id,r.slen);
MMC_FPRINTF(cfg->flog,"B %f %f %f %d %zu %e\n",r.p0.x,r.p0.y,r.p0.z,r.eid,id,r.slen);
if(r.eid!=ID_UNDEFINED){
if(cfg->debuglevel&dlExit)
MMC_FPRINTF(cfg->flog,"E %f %f %f %f %f %f %f %d\n",r.p0.x,r.p0.y,r.p0.z,
Expand All @@ -1289,9 +1289,9 @@ void onephoton(size_t id,raytracer *tracer,tetmesh *mesh,mcconfig *cfg,
mesh->dref[((-r.eid)-1) + tshift]+=r.weight;
}
}else if(r.faceid==-2 && (cfg->debuglevel&dlMove)){
MMC_FPRINTF(cfg->flog,"T %f %f %f %d %I64u %e\n",r.p0.x,r.p0.y,r.p0.z,r.eid,id,r.slen);
MMC_FPRINTF(cfg->flog,"T %f %f %f %d %zu %e\n",r.p0.x,r.p0.y,r.p0.z,r.eid,id,r.slen);
}else if(r.eid && r.faceid!=-2 && cfg->debuglevel&dlEdge)
MMC_FPRINTF(cfg->flog,"X %f %f %f %d %I64u %e\n",r.p0.x,r.p0.y,r.p0.z,r.eid,id,r.slen);
MMC_FPRINTF(cfg->flog,"X %f %f %f %d %zu %e\n",r.p0.x,r.p0.y,r.p0.z,r.eid,id,r.slen);

if(cfg->issavedet && r.eid<=0){
int i;
Expand All @@ -1309,7 +1309,7 @@ void onephoton(size_t id,raytracer *tracer,tetmesh *mesh,mcconfig *cfg,
}
break; /*photon exits boundary*/
}
if(cfg->debuglevel&dlMove) MMC_FPRINTF(cfg->flog,"M %f %f %f %d %I64u %e\n",r.p0.x,r.p0.y,r.p0.z,r.eid,id,r.slen);
if(cfg->debuglevel&dlMove) MMC_FPRINTF(cfg->flog,"M %f %f %f %d %zu %e\n",r.p0.x,r.p0.y,r.p0.z,r.eid,id,r.slen);
if(cfg->minenergy>0.f && r.weight < cfg->minenergy && (cfg->tend-cfg->tstart)*visit->rtstep<=1.f){ /*Russian Roulette*/
if(rand_do_roulette(ran)*cfg->roulettesize<=1.f){
r.weight*=cfg->roulettesize;
Expand Down

0 comments on commit 5d3df36

Please sign in to comment.