1
1

1) Done with the initilization test

2) To test the point-to-point

This commit was SVN r1551.
Этот коммит содержится в:
Weikuan Yu 2004-07-07 00:06:18 +00:00
родитель d499c81d27
Коммит fe505c759b
8 изменённых файлов: 124 добавлений и 48 удалений

Просмотреть файл

@ -39,7 +39,7 @@ ompi_class_t mca_ptl_elan_send_frag_t_class = {
static void static void
mca_ptl_elan_recv_frag_construct (mca_ptl_elan_recv_frag_t * frag) mca_ptl_elan_recv_frag_construct (mca_ptl_elan_recv_frag_t * frag)
{ {
OBJ_CONSTRUCT (frag, mca_ptl_elan_recv_frag_t); /*OBJ_CONSTRUCT (frag, mca_ptl_elan_recv_frag_t);*/
frag->frag_hdr_cnt = 0; frag->frag_hdr_cnt = 0;
frag->frag_msg_cnt = 0; frag->frag_msg_cnt = 0;
frag->frag.qdma = NULL; frag->frag.qdma = NULL;
@ -63,7 +63,7 @@ mca_ptl_elan_recv_frag_destruct (mca_ptl_elan_recv_frag_t * frag)
free (frag->alloc_buff); free (frag->alloc_buff);
frag->alloc_buff = NULL; frag->alloc_buff = NULL;
frag->unex_buff = NULL; frag->unex_buff = NULL;
OBJ_DESTRUCT (frag); /*OBJ_DESTRUCT (frag);*/
} }
ompi_class_t mca_ptl_elan_recv_frag_t_class = { ompi_class_t mca_ptl_elan_recv_frag_t_class = {

Просмотреть файл

@ -176,6 +176,16 @@ ompi_elan_attach_network (mca_ptl_elan_state_t * ems)
return OMPI_ERROR; return OMPI_ERROR;
} }
/* Allocate more than we need to keep the heap in sync */
ems->elan_localvps = (int *) malloc (sizeof (int) * (ems->elan_nvp + 1));
if (NULL == ems->elan_localvps) {
ompi_output (0,
"[%s:%d] error in malloc for elan_localvps \n",
__FILE__, __LINE__);
return OMPI_ERROR;
}
/* Set all to non local initially */ /* Set all to non local initially */
for (vp = 0; vp < ems->elan_nvp; vp++) for (vp = 0; vp < ems->elan_nvp; vp++)
ems->elan_localvps[vp] = -1; ems->elan_localvps[vp] = -1;

Просмотреть файл

@ -26,6 +26,8 @@
#include "ptl_elan_req.h" #include "ptl_elan_req.h"
#include "ptl_elan_priv.h" #include "ptl_elan_priv.h"
#define UNIT_TESTING 1
mca_ptl_elan_module_1_0_0_t mca_ptl_elan_module = { mca_ptl_elan_module_1_0_0_t mca_ptl_elan_module = {
{ {
/* Base module information about itself */ /* Base module information about itself */
@ -232,12 +234,14 @@ mca_ptl_elan_module_init (int *num_ptls,
return NULL; return NULL;
} }
#ifndef UNIT_TESTING
if (OMPI_SUCCESS != mca_ptl_elan_module_register(&mca_ptl_elan_module)) { if (OMPI_SUCCESS != mca_ptl_elan_module_register(&mca_ptl_elan_module)) {
ompi_output(0, ompi_output(0,
"[%s:%d] error in malloc for elan PTL references\n", "[%s:%d] error in registering with Runtime/OOB \n",
__FILE__, __LINE__); __FILE__, __LINE__);
return NULL; return NULL;
} }
#endif
ptls = (mca_ptl_t **) malloc (elan_mp->elan_num_ptls * ptls = (mca_ptl_t **) malloc (elan_mp->elan_num_ptls *
sizeof (mca_ptl_elan_t *)); sizeof (mca_ptl_elan_t *));

Просмотреть файл

@ -12,19 +12,21 @@ AM_CPPFLAGS = -I$(top_ompi_builddir)/src/include \
LDFLAGS += -L$(prefix)/lib -L../src/.libs LDFLAGS += -L$(prefix)/lib -L../src/.libs
EXECS = qsnet_init qsnet_qdma qsnet_rdma EXECS = qsnet_init qsnet_qdma qsnet_rdma mpitest
units: $(EXECS) units: $(EXECS)
qsnet_init: qsnet_init.c qsnet_init: qsnet_init.c
$(CC) $(AM_CPPFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lmpi -pthread -lm -lmca_ptl_elan $(CC) -g $(AM_CPPFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lmpi -pthread -lm -lmca_ptl_elan
qsnet_qdma: qsnet_qdma.c qsnet_qdma: qsnet_qdma.c
$(CC) $(AM_CPPFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lmpi -pthread -lm -lmca_ptl_elan $(CC) -g $(AM_CPPFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lmpi -pthread -lm -lmca_ptl_elan
qsnet_rdma: qsnet_rdma.c qsnet_rdma: qsnet_rdma.c
$(CC) $(AM_CPPFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lmpi -pthread -lm -lmca_ptl_elan $(CC) -g $(AM_CPPFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lmpi -pthread -lm -lmca_ptl_elan
mpitest: mpi_test.c
$(CC) -I${HOME}/installs/openmpi/include -L${HOME}/installs/openmpi/lib -o mpitest mpi_test.c -lmpi
clean: clean:
-rm -rf $(EXECS) -rm -rf $(EXECS)

16
src/mca/ptl/elan/tests/mpi_test.c Обычный файл
Просмотреть файл

@ -0,0 +1,16 @@
#include <stdio.h>
#include "mpi.h"
#include "test_util.h"
int main (int argc, char ** argv)
{
int proc, nproc;
/* Get some environmental variables set for Open MPI, OOB */
env_init_for_elan();
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &proc);
MPI_Comm_size(MPI_COMM_WORLD, &nproc);
MPI_Finalize();
return 0;
}

Просмотреть файл

@ -1,8 +1,11 @@
#include <stdio.h>
#include "qsnet/fence.h" #include "qsnet/fence.h"
#include "ptl_elan.h" #include "ptl_elan.h"
#include "ptl_elan_priv.h" #include "ptl_elan_priv.h"
#include "test_util.h"
extern mca_ptl_elan_module_1_0_0_t mca_ptl_elan_module; extern mca_ptl_elan_module_1_0_0_t mca_ptl_elan_module;
int main (int argc, char ** argv) int main (int argc, char ** argv)
{ {
bool allow_threads; bool allow_threads;
@ -10,6 +13,9 @@ int main (int argc, char ** argv)
int input; int input;
int num; int num;
/* Get some environmental variables set for Open MPI, OOB */
env_init_for_elan();
/* Initialization test */ /* Initialization test */
mca_ptl_elan_module_open(); mca_ptl_elan_module_open();
mca_ptl_elan_module_init(&num, &allow_threads, &have_hidden_threads); mca_ptl_elan_module_init(&num, &allow_threads, &have_hidden_threads);

Просмотреть файл

@ -1,39 +1,33 @@
#include "qsnet/fence.h" #include "qsnet/fence.h"
#include "ptl_elan.h" #include "ptl_elan.h"
#include "ptl_elan_priv.h" #include "ptl_elan_priv.h"
#include "test_util.h"
extern mca_ptl_elan_module_1_0_0_t mca_ptl_elan_module; extern mca_ptl_elan_module_1_0_0_t mca_ptl_elan_module;
int test_qdma(mca_ptl_elan_module_1_0_0_t *emp, int reps);
int ptl_elan_init_event();
int ptl_elan_free_event();
int ptl_elan_poll_event();
int ptl_elan_wait_event();
int ptl_elan_queue_send(); /* Initialize a Tx event */ int ptl_elan_queue_send(); /* Initialize a Tx event */
int ptl_elan_queue_recv(); /* Wait for a recv event */ int ptl_elan_queue_recv(); /* Wait for a recv event */
int test_qdma(mca_ptl_elan_module_1_0_0_t *emp, int reps);
int main (int argc, char ** argv) int main (int argc, char ** argv)
{ {
/* Initialization test */ bool allow_threads;
ompi_mca_ptl_elan_init (&mca_ptl_elan_module); bool have_hidden_threads;
int input;
int num;
/* Please replace with a barrier at the beginning */ /* Get some environmental variables set for Open MPI, OOB */
env_init_for_elan();
sleep(5); /* Sleep 5 seconds for others to catch up */ /* Initialization */
mca_ptl_elan_module_open();
mca_ptl_elan_module_init(&num, &allow_threads, &have_hidden_threads);
mca_ptl_elan_module_control(1, &input, 4);
/* Testing QDMA */
test_qdma(&mca_ptl_elan_module, 1); test_qdma(&mca_ptl_elan_module, 1);
/* Please replace with a barrier at the end */ mca_ptl_elan_module_close();
sleep(5); /* Sleep 5 seconds for others to catch up */
/* Finalize the device */
ompi_mca_ptl_elan_finalize (&mca_ptl_elan_module);
/* Tell alive */
fprintf(stdout, "I am still alive\n");
fflush(stdout);
return 0; return 0;
} }
@ -57,7 +51,6 @@ int test_qdma(mca_ptl_elan_module_1_0_0_t *emp, int reps)
if (0 != ptl->elan_vp) { if (0 != ptl->elan_vp) {
r--; r--;
/*elan_queueRxWait(qr,rbuf,waitType);*/
ptl_elan_queue_recv(); ptl_elan_queue_recv();
} }
@ -89,7 +82,3 @@ int ptl_elan_queue_recv ()
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }
int ptl_elan_init_event()
{
return OMPI_SUCCESS;
}

Просмотреть файл

@ -1,35 +1,84 @@
#include "qsnet/fence.h" #include "qsnet/fence.h"
#include "ptl_elan.h" #include "ptl_elan.h"
#include "ptl_elan_priv.h" #include "ptl_elan_priv.h"
#include "test_util.h"
extern mca_ptl_elan_module_1_0_0_t mca_ptl_elan_module; extern mca_ptl_elan_module_1_0_0_t mca_ptl_elan_module;
int ptl_elan_rdma_put(); /* Initialize a Tx event */
int ptl_elan_rdma_get(); /* Wait for a recv event */
int test_rdma(mca_ptl_elan_module_1_0_0_t *emp, int reps); int test_rdma(mca_ptl_elan_module_1_0_0_t *emp, int reps);
int main (int argc, char ** argv) int main (int argc, char ** argv)
{ {
/* Initialization test */ bool allow_threads;
ompi_mca_ptl_elan_init (&mca_ptl_elan_module); bool have_hidden_threads;
int input;
int num;
/* Please replace with a barrier at the beginning */ /* Get some environmental variables set for Open MPI, OOB */
sleep(5); /* Sleep 5 seconds for others to catch up */ env_init_for_elan();
/* Initialization */
mca_ptl_elan_module_open();
mca_ptl_elan_module_init(&num, &allow_threads, &have_hidden_threads);
mca_ptl_elan_module_control(1, &input, 4);
/* Testing QDMA */
test_rdma(&mca_ptl_elan_module, 1); test_rdma(&mca_ptl_elan_module, 1);
/* Please replace with a barrier at the end */ mca_ptl_elan_module_close();
sleep(5); /* Sleep 5 seconds for others to catch up */
/* Finalize the device */
ompi_mca_ptl_elan_finalize (&mca_ptl_elan_module);
/* Tell alive */
fprintf(stdout, "I am still alive\n");
fflush(stdout);
return 0; return 0;
} }
int test_rdma(mca_ptl_elan_module_1_0_0_t *emp, int reps) int test_rdma(mca_ptl_elan_module_1_0_0_t *emp, int reps)
{ {
/* TODO: To test rdma (put/get) function */ uint64_t start0, end0;
return 0; double t;
int r;
double nsec;
ELAN4_CTX *ctx;
RAIL *rail;
mca_ptl_elan_t *ptl;
r = reps;
ptl = emp->elan_ptls[0];
ctx = emp->elan_ctrl->elan_ctx;
rail = (RAIL *) emp->elan_ctrl->elan_rail[0];
start0 = elan4_clock(ctx);
if (0 != ptl->elan_vp) {
r--;
ptl_elan_rdma_get();
}
while (--r >= 0) {
/* Trigger a send event */
ptl_elan_rdma_put();
ptl_elan_rdma_get();
}
if (0 != ptl->elan_vp) {
/* Trigger one more send */
ptl_elan_rdma_put();
}
end0 = elan4_clock(ctx);
nsec = ((end0 - start0) / reps);
t = ((double) nsec)/(2*1000.0);
return(0);
} }
int ptl_elan_rdma_put() {
return OMPI_SUCCESS;
}
/* This function needs no event related knowledge */
int ptl_elan_rdma_get ()
{
return OMPI_SUCCESS;
}