Skip to content

Commit

Permalink
polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
thilinarmtb committed Feb 7, 2019
1 parent f38ced9 commit 4d28ff5
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 349 deletions.
22 changes: 7 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,35 @@ FC?=mpif77
PAUL?=1

SRCROOT=.

GSLIBDIR=$(GSLIBPATH)

SRCDIR =$(SRCROOT)/src
INCDIR =$(SRCDIR)
BUILDDIR=$(SRCROOT)/build
TESTDIR =$(SRCROOT)/tests

TARGET=parRSB
TESTS=$(TESTDIR)/gmsh/gmsh-test $(TESTDIR)/con/con-test
LIB=src/lib$(TARGET).a
TESTS=$(TESTDIR)/con/con-test
LIB=src/lib$(TARGET).so

INCFLAGS=-I$(SRCDIR) -I$(GSLIBDIR)/include

INCFLAGS=-I$(INCDIR) -I$(GSLIBDIR)/include
TESTLDFLAGS:=-L$(SRCDIR) -l$(TARGET) -L $(GSLIBDIR)/lib -lgs -lm $(LDFLAGS)

ifneq (,$(strip $(DESTDIR)))
INSTALL_ROOT = $(DESTDIR)
else
INSTALL_ROOT = $(SRCROOT)/build
endif

TESTLDFLAGS:=-L$(SRCDIR) -l$(TARGET) -L $(GSLIBDIR)/lib -lgs -lm $(LDFLAGS)

# Main source
CSRCS:= $(SRCDIR)/genmap-vector.c $(SRCDIR)/genmap-algo.c \
$(SRCDIR)/genmap-io.c $(SRCDIR)/genmap-comm.c $(SRCDIR)/genmap.c \
$(SRCDIR)/parRSB.c $(SRCDIR)/genmap-quality.c \
$(SRCDIR)/genmap-chelpers.c $(SRCDIR)/genmap-gmsh.c

$(SRCDIR)/genmap-chelpers.c
COBJS:=$(CSRCS:.c=.o)

FSRCS:=
FOBJS:=$(FSRCS:.f=.o)

SRCOBJS :=$(COBJS) $(FOBJS)
SRCOBJS:=$(COBJS)

PP= -DGENMAP_LONG_LONG
ifneq ($(MPI),0)
Expand Down Expand Up @@ -87,9 +82,6 @@ endif
$(COBJS): %.o: %.c
$(CC) $(CFLAGS) $(PP) $(INCFLAGS) -c $< -o $@

$(FOBJS): %.o: %.f
$(FC) $(FFLAGS) $(PP) $(INCFLAGS) -c $< -o $@

.PHONY: tests
tests: $(TESTS)

Expand Down
31 changes: 0 additions & 31 deletions src/genmap-comm.c
Original file line number Diff line number Diff line change
@@ -1,36 +1,5 @@
#include <genmap-impl.h>

int GenmapCreateComm(GenmapComm *c, GenmapCommExternal ce) {
GenmapMalloc(1, c);
comm_init(&(*c)->gsComm, ce);
(*c)->verticesHandle = NULL;
(*c)->laplacianWeights = NULL;
buffer_init(&(*c)->buf, 1024);
return 0;
}

int GenmapDestroyComm(GenmapComm c) {
if(&c->buf)
buffer_free(&c->buf);
if(c->verticesHandle)
gs_free(c->verticesHandle);
if(c->laplacianWeights)
GenmapFree(c->laplacianWeights);
if(&c->gsComm)
comm_free(&c->gsComm);
GenmapFree(c);

return 0;
}

int GenmapNp(GenmapComm c) {
return (int) c->gsComm.np;
}

int GenmapId(GenmapComm c) {
return (int) c->gsComm.id;
}

int GenmapAx(GenmapHandle h, GenmapComm c, GenmapVector u,
GenmapVector weights, GenmapVector v) {
assert(u->size == v->size);
Expand Down
244 changes: 0 additions & 244 deletions src/genmap-gmsh.c

This file was deleted.

21 changes: 0 additions & 21 deletions src/genmap-gmsh.h

This file was deleted.

7 changes: 4 additions & 3 deletions src/genmap-impl.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _GENMAP_IMPL_H_
#define _GENMAP_IMPL_H_

#include <genmap.h>

#include <stddef.h>
#include <stdlib.h>
#include <assert.h>
Expand All @@ -11,6 +9,8 @@
#ifdef GENMAP_DEBUG
#include <stdio.h>
#endif

#include "genmap.h"
//
// GenmapComm
//
Expand Down Expand Up @@ -89,8 +89,9 @@ struct GenmapHandle_private {
GenmapInt dbgLevel;
GenmapInt printStat;
};

//
// GenmapHandle
//
int GenmapCreateHandle(GenmapHandle h);
int GenmapDestroyHandle(GenmapHandle h);
//
Expand Down
2 changes: 0 additions & 2 deletions src/genmap-io.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _GENMAP_READERS_H_
#define _GENMAP_READERS_H_

#include "genmap-gmsh.h"

int GenmapCreateHandle_interface(GenmapHandle h);
int GenmapRead_interface(GenmapHandle h, void *data);

Expand Down
Loading

0 comments on commit 4d28ff5

Please sign in to comment.