Skip to content

Commit

Permalink
[bug] fix stdout not found bug after make cudamex
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Nov 2, 2024
1 parent 126e53d commit 351b61f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
12 changes: 6 additions & 6 deletions commons/Makefile_common.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
########################################################
# MMC: Mesh-based Monte Carlo
# Copyright (C) 2009 Qianqian Fang
# Copyright (C) 2009-2024 Qianqian Fang
# <q.fang at neu.edu>
#
# $Id$
Expand Down Expand Up @@ -176,14 +176,14 @@ ifeq ($(CC),clang)
OPENMPLIB:= -lomp
endif

ifneq (,$(filter mex,$(MAKECMDGOALS)))
ifneq (,$(filter $(MAKECMDGOALS),mex cudamex))
CCFLAGS+=-DMATLAB_MEX_FILE
endif

ARFLAGS :=
ARFLAGS :=

OBJSUFFIX := .o
BINSUFFIX :=
BINSUFFIX :=
CLHEADER=.clh

OBJS := $(addprefix $(OBJDIR)/, $(FILES))
Expand Down Expand Up @@ -231,8 +231,8 @@ debug: CUCCOPT+=-DMCX_DEBUG
TARGETSUFFIX:=$(suffix $(BINARY))

ifeq ($(TARGETSUFFIX),.so)
CCFLAGS+= $(DLLFLAG)
ARFLAGS+= -shared -Wl,-soname,$(BINARY).1
CCFLAGS+= $(DLLFLAG)
ARFLAGS+= -shared -Wl,-soname,$(BINARY).1
endif

ifeq ($(TARGETSUFFIX),.a)
Expand Down
3 changes: 1 addition & 2 deletions examples/replay/plotjacobian.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
data1 = data1(data1(:, 1) == 1, :);

% the two sets of captured photons should be identical
if (all(ismember(round(data1 * 1e10) * 1e-10, round(data2 * 1e10) * 1e-10, 'rows')) && ...
all(ismember(round(data1 * 1e10) * 1e-10, round(data2 * 1e10) * 1e-10, 'rows')))
if (all(ismember(round(data1 * 1e10) * 1e-10, round(data2 * 1e10) * 1e-10, 'rows')))
disp('replay is successful :-)');
else
disp('replay failed :-(');
Expand Down
6 changes: 3 additions & 3 deletions examples/replay/run_test.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh

# first run to get the seeds for each detected photon (-q 1)
../../bin/mmc -f replaytest.inp -s step1 -n 3e6 -b 0 -q 1 -x 1 -d 1 -D TP
../../bin/mmc -f replaytest.inp -s step1 -n 3e6 -b 0 -q 1 -x 1 -d 1 -D TP $@

# replay the detected photons (-E *.mch) detected by detector#1 (-P 1) without normalization (-U 0)
../../bin/mmc -f replaytest.inp -E step1.mch -s step2 -P 1 -b 0 -q 1 -x 1 -d 1 -O L -D TP
../../bin/mmc -f replaytest.inp -E step1.mch -s step2 -P 1 -b 0 -q 1 -x 1 -d 1 -O L -D TP $@

# replay the detected photons (-E *.mch) detected by detector#1 (-P 1) without normalization (-U 0)
../../bin/mmc -f replaytest.inp -E step1.mch -s step3 -P 1 -b 0 -q 1 -x 1 -d 1 -O P -D TP
../../bin/mmc -f replaytest.inp -E step1.mch -s step3 -P 1 -b 0 -q 1 -x 1 -d 1 -O P -D TP $@

2 changes: 1 addition & 1 deletion src/mmc_cu_host.cu
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void mmc_run_simulation(mcconfig* cfg, tetmesh* mesh, raytracer* tracer, GPUInfo
cfg->bary0,
cfg->e0,
cfg->isextdet,
(int)(meshlen / cfg->srcnum),
(uint)(meshlen / cfg->srcnum),
(uint)(mesh->prop + 1 + cfg->isextdet) + cfg->detnum,
(uint)(MIN((MAX_PROP - (mesh->prop + 1 + cfg->isextdet) - cfg->detnum), ((mesh->ne) << 2)) >> 2), /*max count of elem normal data in const mem*/
cfg->issaveseed,
Expand Down

0 comments on commit 351b61f

Please sign in to comment.