1
1
This commit was SVN r1606.
Этот коммит содержится в:
Ralph Castain 2004-07-09 01:58:08 +00:00
родитель 2f2a67882d
Коммит 64fda9a437
3 изменённых файлов: 86 добавлений и 23 удалений

26
test/mca/ns/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,26 @@
# -*- makefile -*-
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
AM_CPPFLAGS = -I$(top_srcdir)/test/support -DOMPI_ENABLE_DEBUG_OVERRIDE=1
noinst_PROGRAMS = \
test_ns_replica
test_ns_replica_SOURCES = test_ns_replica.c
test_ns_replica_LDADD = \
$(top_builddir)/src/class/ompi_object.lo \
$(top_builddir)/src/util/malloc.lo \
$(top_builddir)/src/util/output.lo \
$(top_builddir)/src/util/argv.lo \
$(top_builddir)/src/util/strncpy.lo \
$(top_builddir)/src/mca/ns/base/libmca_ns_base.la \
$(top_builddir)/src/libmpi.la \
$(top_builddir)/src/threads/mutex.lo \
$(top_builddir)/src/threads/mutex_pthread.lo \
$(top_builddir)/src/threads/mutex_spinlock.lo \
$(top_builddir)/src/threads/mutex_spinwait.lo \
$(top_builddir)/test/support/libsupport.la
test_ns_replica_DEPENDENCIES = $(test_ns_replica_LDADD)

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

@ -1,23 +0,0 @@
#include <stdio.h>
#include "ns/name_server.h"
int main(int argc, char **argv)
{
int i;
uint32_t *foo;
ompi_process_name_t j;
foo = (uint32_t*) &j;
for (i=0; i<30; i++) {
j = ompi_process_name_new();
fprintf(stderr, "name: %x %x\n", foo[0], foo[1]);
}
for (i=0; i<3; i++) {
j = ompi_process_name_get_range(30000);
fprintf(stderr, "range name: %x %x\n", foo[0], foo[1]);
}
}

60
test/mca/ns/test_ns_replica.c Обычный файл
Просмотреть файл

@ -0,0 +1,60 @@
/*
* unit test for name server replica.
--------------------------------------------------------------------------
Authors: Ralph H. Castain <rhc@lanl.gov>
--------------------------------------------------------------------------
*/
#include <stdio.h>
#include <string.h>
#include "ompi_config.h"
#include "include/constants.h"
#include "mca/mca.h"
#include "mca/base/base.h"
#include "mca/ns/base/base.h"
int main(int argc, char **argv)
{
ompi_process_name_t *test_name;
/* startup the MCA */
if (OMPI_SUCCESS == mca_base_open()) {
fprintf(stderr, "MCA started\n");
} else {
fprintf(stderr, "MCA could not start - please report error to bugs@open-mpi.org\n");
exit (1);
}
/* open the name server */
if (OMPI_SUCCESS == mca_ns_base_open()) {
fprintf(stderr, "NS opened\n");
} else {
fprintf(stderr, "NS could not open\n");
exit(1);
}
/* startup the name server */
if (NULL == mca_ns_replica_init()) {
fprintf(stderr, "NS could not start\n");
exit(1);
} else {
fprintf(stderr, "NS started\n");
}
/* create a name */
test_name = ompi_name_server.create_process_name(0, 1, 1);
if (NULL == test_name) { /* got error */
fprintf(stderr, "create process name failed\n");
exit(1);
} else {
fprintf(stderr, "got process name: %x %x %x\n", test_name->cellid, test_name->jobid, test_name->vpid);
}
return(0);
}