Skip to content

Commit a6f7c9f

Browse files
committed
Merge branch 'develop'
2 parents dd1a343 + a310176 commit a6f7c9f

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

examples/src/cuda_example.cu

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ __device__ void foo()
3333
#ifdef NOHANG
3434
for (i = 0; i <= 1000000; i++)
3535
#else
36-
for (i = 0; i >=0; i++)
36+
for (i = 0; i >= 0; i++)
3737
#endif
3838
{
3939
x = i;
@@ -70,15 +70,18 @@ void add2(int *a, int *b)
7070
int main(int argc, char **argv)
7171
{
7272
int ha[N], hb[N], hc[N];
73+
char hostname[256];
74+
gethostname(hostname, 256);
7375
#ifdef USEMPI
7476
int numtasks, rank;
75-
char hostname[256];
7677
MPI_Init(&argc,&argv);
7778
MPI_Comm_size(MPI_COMM_WORLD, &numtasks);
7879
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
79-
gethostname(hostname, 256);
8080
printf("Hello world from %s %d/%d\n", hostname, rank, numtasks);
81+
#else
82+
printf("Hello serial world from %s\n", hostname);
8183
#endif
84+
fflush(stdout);
8285
int *da, *db;
8386
cudaMalloc((void **)&da, N*sizeof(int));
8487
cudaMalloc((void **)&db, N*sizeof(int));

scripts/gdb.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import signal
3131
import os
3232
import logging
33+
import time
3334
from datetime import datetime
3435

3536
def init_logging(input_loglevel, input_logfile):
@@ -115,6 +116,7 @@ def readlines(self, breakstring=None):
115116
line = ''
116117
lines = []
117118
while True:
119+
time.sleep(.00001) # the poll sometimes would hang in the absence of a short sleep
118120
ret = self.subprocess.poll()
119121
if ret != None:
120122
error_msg = 'Subprocess terminated with ret code %d\n' %(ret)

scripts/stat_cuda_gdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def new_gdb_instance(pid, gdb_type='gdb'):
4747
# (cudbgApiAttach) will be abandoned.
4848
# When the function is done executing, GDB will silently stop.
4949
if "TMPDIR" not in os.environ:
50-
os.environ["TMPDIR"]="/var/tmp/%s" %(pwd.getpwuid( os.getuid() ).pw_name)
50+
os.environ["TMPDIR"]="/var/tmp"
5151

5252
try:
5353
if 'cuda-gdb' in os.environ['STAT_GDB']:

0 commit comments

Comments
 (0)