Click here to Skip to main content
15,891,184 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionHow to realize multi progress bar show at the same time ? Pin
redleafzzh2-May-12 4:02
redleafzzh2-May-12 4:02 
AnswerRe: How to realize multi progress bar show at the same time ? Pin
Richard MacCutchan2-May-12 6:28
mveRichard MacCutchan2-May-12 6:28 
AnswerRe: How to realize multi progress bar show at the same time ? Pin
Albert Holguin4-May-12 10:02
professionalAlbert Holguin4-May-12 10:02 
QuestionAsyncIO C++ Pin
TalSt29-Apr-12 0:55
TalSt29-Apr-12 0:55 
AnswerRe: AsyncIO C++ Pin
Richard MacCutchan2-May-12 6:26
mveRichard MacCutchan2-May-12 6:26 
AnswerRe: AsyncIO C++ Pin
Ashish Tyagi 4022-May-12 7:29
Ashish Tyagi 4022-May-12 7:29 
QuestionCUDA and MPI combination Pin
Ron120223-Apr-12 18:48
Ron120223-Apr-12 18:48 
Questionerror while loading shared libraries: libcudart.so.4: cannot open shared object file: No such file or directory Pin
Ron120220-Apr-12 18:48
Ron120220-Apr-12 18:48 
Hi,
I am trying to run following code which contains OpenMPI and CUDA.
 #include <stdio.h>
#include <stdlib.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <sys/time.h>
#include <mpi.h>

#define NREPEAT 10
#define NBYTES 10.e6

int main (int argc, char *argv[])
{
int rank, size, n, len, numbytes;
void *a_h, *a_d;
struct timeval time[2];
double bandwidth;
char name[MPI_MAX_PROCESSOR_NAME];
MPI_Status status;

MPI_Init (&argc, &argv);
MPI_Comm_rank (MPI_COMM_WORLD, &rank);
MPI_Comm_size (MPI_COMM_WORLD, &size);

MPI_Get_processor_name(name, &len);
printf("Process %d is on %s\n", rank, name);

printf("Using regular memory \n");
a_h = malloc(NBYTES);

cudaMalloc( (void **) &a_d, NBYTES);

/* Test host -> device bandwidth. */
MPI_Barrier(MPI_COMM_WORLD);

gettimeofday(&time[0], NULL);
for (n=0; n<NREPEAT; n )
{
cudaMemcpy(a_d, a_h, NBYTES, cudaMemcpyHostToDevice);
}
gettimeofday(&time[1], NULL);

bandwidth = time[1].tv_sec - time[0].tv_sec;
bandwidth = 1.e-6*(time[1].tv_usec - time[0].tv_usec);
bandwidth = NBYTES*NREPEAT/1.e6/bandwidth;

printf("Host->device bandwidth for process %d: %f MB/sec\n",rank,bandwidth);

/* Test MPI send/recv bandwidth. */
MPI_Barrier(MPI_COMM_WORLD);

gettimeofday(&time[0], NULL);
for (n=0; n<NREPEAT; n )
{
if (rank == 0)
MPI_Send(a_h, NBYTES/sizeof(int), MPI_INT, 1, 0, MPI_COMM_WORLD);
else
MPI_Recv(a_h, NBYTES/sizeof(int), MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
}
gettimeofday(&time[1], NULL);

bandwidth = time[1].tv_sec - time[0].tv_sec;
bandwidth = 1.e-6*(time[1].tv_usec - time[0].tv_usec);
bandwidth = NBYTES*NREPEAT/1.e6/bandwidth;

if (rank == 0)
printf("MPI send/recv bandwidth: %f MB/sec\n", bandwidth);

cudaFree(a_d);
free(a_h);

MPI_Finalize();
return 0;
} 

To compile I am using :

mpicc mpibandwidth.c -o mpibandwidth -I /usr/local/cuda/include -L /usr/local/cuda/lib -lcudart

To execute I am using :

/usr/local/bin/mpirun --mca btl tcp,self --mca btl_tcp_if_include eth0 --hostfile slaves -np 5 mpibandwidth

I am getting error after executing :
error while loading shared libraries: libcudart.so.4: cannot open shared object file: No such file or directory

My PATH and LD_LIBRARY_PATH variables are:

PATH = /usr/lib/qt-3.3/bin:/usr/local/ns-allinone/bin:/usr/local/ns- allinone/tcl8.4.18/unix:/usr/local/ns-allinone/tk8.4.18/unix:/ usr/local/cuda/cuda/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/ sbin:/usr/sbin:/sbin:/usr/local/lib/:/usr/local/lib/openmpi:/usr/ local/cuda/bin

LD_LIBRARY_PATH = :/usr/local/lib:/usr/local/lib/openmpi/:/usr/local/cuda/lib

:/usr/local/lib:/usr/local/lib/openmpi/:/usr/local/cuda/lib

libcudart.so.4 is present in usr/local/cuda/lib and it is in LD path

Any idea what is missing?
Can someone help please

Thanks
QuestionRe: error while loading shared libraries: libcudart.so.4: cannot open shared object file: No such file or directory Pin
Richard MacCutchan20-Apr-12 22:08
mveRichard MacCutchan20-Apr-12 22:08 
GeneralRe: error while loading shared libraries: libcudart.so.4: cannot open shared object file: No such file or directory Pin
Ron120220-Apr-12 22:16
Ron120220-Apr-12 22:16 
GeneralRe: error while loading shared libraries: libcudart.so.4: cannot open shared object file: No such file or directory Pin
Richard MacCutchan20-Apr-12 22:39
mveRichard MacCutchan20-Apr-12 22:39 
Questionhow to access the history list of CHtmlView? Pin
amwwcwujqw_18-Apr-12 23:03
amwwcwujqw_18-Apr-12 23:03 
AnswerRe: how to access the history list of CHtmlView? Pin
«_Superman_»22-Apr-12 17:38
professional«_Superman_»22-Apr-12 17:38 
QuestionTrying to take ownership of a Directory but it fails... Pin
varunpandeyengg12-Apr-12 23:32
varunpandeyengg12-Apr-12 23:32 
Questionswprintf_s procedure not find in xp Pin
vishalgpt1-Apr-12 6:09
vishalgpt1-Apr-12 6:09 
AnswerRe: swprintf_s procedure not find in xp Pin
Richard MacCutchan1-Apr-12 22:25
mveRichard MacCutchan1-Apr-12 22:25 
Questionwindow hooks and control ID Pin
daemonna28-Mar-12 5:43
daemonna28-Mar-12 5:43 
AnswerRe: window hooks and control ID Pin
«_Superman_»28-Mar-12 21:58
professional«_Superman_»28-Mar-12 21:58 
GeneralRe: window hooks and control ID Pin
daemonna28-Mar-12 22:27
daemonna28-Mar-12 22:27 
Questionusage of KeyboardLayout function Pin
subhendu_m27-Mar-12 4:38
subhendu_m27-Mar-12 4:38 
QuestionIWebBrowser2: When submitting data via a form, the form appears again Pin
Pachner20-Mar-12 1:36
Pachner20-Mar-12 1:36 
AnswerRe: IWebBrowser2: When submitting data via a form, the form appears again Pin
Pachner22-Mar-12 1:15
Pachner22-Mar-12 1:15 
QuestionRelease COM dll crash problem (Windows 7 64bit OS) Pin
MrKBA8-Mar-12 22:14
MrKBA8-Mar-12 22:14 
AnswerRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
barneyman9-Mar-12 0:36
barneyman9-Mar-12 0:36 
GeneralRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
MrKBA21-Mar-12 2:11
MrKBA21-Mar-12 2:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.