Skip to content

Commit

Permalink
scripts and minor modifications to expand all includes and create a s…
Browse files Browse the repository at this point in the history
…tandalone ctf.hpp
  • Loading branch information
solomonik committed Nov 13, 2017
1 parent 225b6ef commit 1492589
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 13 deletions.
4 changes: 2 additions & 2 deletions include/ctf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef __CTF_HPP__
#define __CTF_HPP__

#include "mpi.h"
#include <mpi.h>
#include <stdio.h>
#include <stdint.h>
#include <vector>
Expand All @@ -12,7 +12,7 @@
#include <complex>
#include <assert.h>

#define CTF_VERSION 141
#define CTF_VERSION 150

#include "../src/interface/tensor.h"
#include "../src/interface/idx_tensor.h"
Expand Down
2 changes: 1 addition & 1 deletion src/contraction/contraction.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __INT_CONTRACTION_H__
#define __INT_CONTRACTION_H__

#include "assert.h"
#include <assert.h>
#include "ctr_tsr.h"

namespace CTF_int {
Expand Down
2 changes: 1 addition & 1 deletion src/interface/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <limits.h>
#include <random>

#include "mpi.h"
#include <mpi.h>
#include "../shared/model.h"

#ifndef USE_SP_MKL
Expand Down
6 changes: 6 additions & 0 deletions src/scripts/expand_includes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
SCRIPT=$(readlink -f $0)
SCRIPT_DIR=$(dirname $SCRIPT)
touch ${SCRIPT_DIR}/visited_list.txt
$SCRIPT_DIR/recursive_expand_includes.sh $SCRIPT_DIR/../../include/ctf.hpp &> $SCRIPT_DIR/../../include/ctf_all.hpp
rm -f ${SCRIPT_DIR}/visited_list.txt
24 changes: 24 additions & 0 deletions src/scripts/recursive_expand_includes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
SCRIPT=$(readlink -f $0)
SCRIPT_DIR=$(dirname $SCRIPT)
DIR=$(pwd)
cd $(dirname $1)
FNAME=$(basename $1)
FDIR=$(pwd)
FULLFNAME="${FDIR}/${FNAME}"
if grep -Fxq "$FULLFNAME" $SCRIPT_DIR/visited_list.txt
then
exit 0
else
echo $FULLFNAME >> $SCRIPT_DIR/visited_list.txt
TMP_FILE="${FNAME}.tmp.concat"
cp $FNAME $TMP_FILE
sed -i -e 's/#include "\(.*\)"/include \1/g' $TMP_FILE
awk '
$1=="include" && NF>=2 {
system("'$SCRIPT' " $2)
next
}
{print}' "$TMP_FILE"
rm $TMP_FILE
fi
4 changes: 2 additions & 2 deletions src/shared/fompi_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define __FOMPI_WRAPPER__

#ifdef USE_FOMPI
#include "fompi.h"
#include <fompi.h>

typedef foMPI_Win CTF_Win;
#define MPI_Init(...) foMPI_Init(__VA_ARGS__)
Expand All @@ -11,7 +11,7 @@ typedef foMPI_Win CTF_Win;
#define MPI_Win_free(...) foMPI_Win_free(__VA_ARGS__)
#define MPI_Put(...) foMPI_Put(__VA_ARGS__)
#else
#include "mpi.h"
#include <mpi.h>
typedef MPI_Win CTF_Win;
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/shared/int_timer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//#include <algorithm>
//#include <time.h>
//#include "string.h"
//#include "assert.h"
//#include <assert.h>
//#include <iostream>
//#include <vector>
#include "util.h"
Expand Down
2 changes: 1 addition & 1 deletion src/shared/model.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __MODEL_H__
#define __MODEL_H__

#include "mpi.h"
#include <mpi.h>
#include "init_models.h"

namespace CTF_int {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/pmpi.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __PMPI_H__
#define __PMPI_H__

#include "mpi.h"
#include <mpi.h>
#include "../interface/timer.h"
namespace CTF {
void set_context(MPI_Comm);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/util.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <stdio.h>
#include <stdint.h>
#include "string.h"
#include "assert.h"
#include <assert.h>
#include "util.h"

namespace CTF_int {
Expand Down
2 changes: 1 addition & 1 deletion src/summation/summation.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __INT_SUMMATION_H__
#define __INT_SUMMATION_H__

#include "assert.h"
#include <assert.h>
#include "sum_tsr.h"
#include "spsum_tsr.h"

Expand Down
2 changes: 1 addition & 1 deletion src/symmetry/sym_indices.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef __INT_SYM_INDICES_H__
#define __INT_SYM_INDICES_H__

#include "assert.h"
#include <assert.h>

template<typename RAIterator>
int relativeSign(RAIterator s1b, RAIterator s1e, RAIterator s2b, RAIterator s2e)
Expand Down
2 changes: 1 addition & 1 deletion src/symmetry/symmetrization.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __INT_SYMMETRIZATION_H__
#define __INT_SYMMETRIZATION_H__

#include "assert.h"
#include <assert.h>
#include "../tensor/untyped_tensor.h"
#include "../summation/summation.h"
#include "../contraction/contraction.h"
Expand Down

0 comments on commit 1492589

Please sign in to comment.