Build on newcomp with clang++. Added .cmd files for newcomp q.

This commit is contained in:
Cotton Seed 2012-08-02 19:05:51 -04:00
parent ca8c47cc5b
commit 48e17fb4a6
9 changed files with 124 additions and 56 deletions

3
.gitignore vendored
View File

@ -3,6 +3,7 @@
/gss
/main
/testsurfaces
/serial.cmd*
/serial.cmd.[eo]*
/parallel.cmd.[eo]*
/save
*/save

View File

@ -3,16 +3,16 @@ BISON = /opt/local/bin/bison
FLEX = /opt/local/bin/flex
# CXX = g++
# CXX = mpic++
CXX = clang++ -fno-color-diagnostics --stdlib=libc++ --std=c++11
CXX = OMPI_CXX=clang++ mpic++ -fno-color-diagnostics --stdlib=libc++ --std=c++11 -I/u/cseed/llvm-3.1/lib/c++/v1
# CXX = clang++ -fno-color-diagnostics --stdlib=libc++ --std=c++11
INCLUDES = -I/opt/local/include -I.
# OPTFLAGS = -g
OPTFLAGS = -O2 -g
# OPTFLAGS = -O2 -DNDEBUG
# OPTFLAGS = -O2 -g
OPTFLAGS = -O2 -DNDEBUG
LDFLAGS = -L/opt/local/lib
LDFLAGS = -L/opt/local/lib -L/u/cseed/llvm-3.1/lib
# LDFLAGS = -pg -L/opt/local/lib
CXXFLAGS = $(OPTFLAGS) -Wall -Wno-unused $(INCLUDES)
@ -95,7 +95,7 @@ parser_files: \
.PHONY: clean
clean:
rm -f *.o lib/*.o algebra/*.o knot_parser/*.o rd_parser/*.o
rm -f main gss
rm -f main gss mpimain
rm -f gmon.out
.PHONY: realclean

View File

@ -16,8 +16,8 @@ unsigned_gcd (unsigned a, unsigned b)
unsigned
int_gcd (int a, int b)
{
return unsigned_gcd ((unsigned)std::abs (a),
(unsigned)std::abs (b));
return unsigned_gcd ((unsigned)abs (a),
(unsigned)abs (b));
}
uint64
@ -35,8 +35,8 @@ uint64_gcd (uint64 a, uint64 b)
uint64
int64_gcd (int64 a, int64 b)
{
return uint64_gcd ((uint64)std::abs (a),
(uint64)std::abs (b));
return uint64_gcd ((uint64)abs64 (a),
(uint64)abs64 (b));
}
static tuple<unsigned, int, int>
@ -71,8 +71,8 @@ unsigned_extended_gcd (unsigned a, unsigned b)
tuple<unsigned, int, int>
extended_gcd (int a, int b)
{
tuple<unsigned, int, int> t = extended_gcd_1 (std::abs (a),
std::abs (b));
tuple<unsigned, int, int> t = extended_gcd_1 (abs (a),
abs (b));
unsigned d = get<0> (t);
int x = get<1> (t),
y = get<2> (t);
@ -100,12 +100,12 @@ uint64_lcm (uint64 a, uint64 b)
unsigned int_lcm (int a, int b)
{
return unsigned_lcm ((unsigned)std::abs (a),
(unsigned)std::abs (b));
return unsigned_lcm ((unsigned)abs (a),
(unsigned)abs (b));
}
uint64 int64_lcm (int64 a, int64 b)
{
return uint64_lcm ((uint64)std::abs (a),
(uint64)std::abs (b));
return uint64_lcm ((uint64)abs64 (a),
(uint64)abs64 (b));
}

View File

@ -1,7 +1,7 @@
#include <knotkit.h>
#define HOME "/Users/cotton/src/knotkit/"
#define HOME "/u/cseed/src/knotkit/"
bool verbose = 0;
@ -642,7 +642,7 @@ braid (unsigned n_strands, const basedvector<int, 1> &twists)
last_twist[i] = 0;
for (unsigned i = 1; i <= twists.size (); i ++)
{
unsigned t = std::abs (twists[i]);
unsigned t = abs (twists[i]);
last_twist[t] = i;
last_twist[t + 1] = i;
}
@ -657,7 +657,7 @@ braid (unsigned n_strands, const basedvector<int, 1> &twists)
for (unsigned i = 1; i <= twists.size (); i ++)
{
unsigned t = std::abs (twists[i]);
unsigned t = abs (twists[i]);
unsigned e1 = strands[t],
e4 = strands[t + 1];
unsigned e2, e3;

View File

@ -1,5 +1,6 @@
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
@ -39,6 +40,8 @@ typedef unsigned long ulong;
typedef long long int64;
typedef unsigned long long uint64;
inline int64 abs64 (int64 x) { return llabs (x); }
typedef size_t hash_t;
static const unsigned uint8_bits = 8;

View File

@ -692,12 +692,53 @@ test_knot_sq ()
}
}
pair<mod_map<Z2>, mod_map<Z2> >
compute_kh_sq (const knot_desc &desc)
{
}
int
main ()
{
#if 1
knot_desc desc;
desc.t = knot_desc::HTW;
desc.i = 15;
desc.j = 15020;
char buf[1000];
sprintf (buf, "/scratch/network/cseed/incoming/K%d_%d.dat.gz",
desc.i, desc.j);
desc = knot_desc (knot_desc::ROLFSEN, 3, 1);
knot_diagram kd = desc.diagram ();
cube<Z2> c (kd);
mod_map<Z2> d = c.compute_d (1, 0, 0, 0, 0);
chain_complex_simplifier<Z2> s (c.khC, d, 1);
assert (s.new_d == 0);
steenrod_square sq (c, d, s);
mod_map<Z2> sq1 = sq.sq1 ();
mod_map<Z2> sq2 = sq.sq2 ();
assert (sq1.compose (sq1) == 0);
assert (sq2.compose (sq2) + sq1.compose (sq2).compose (sq1) == 0);
#if 1
{
file_writer w (buf);
write (w, sq1);
write (w, sq2);
}
#endif
#endif
return 0;
// convert_knot_sq ();
test_knot_sq ();
return 0;
// test_sage_show ();
dump_sage ();

View File

@ -87,32 +87,6 @@ master ()
}
}
pair<mod_map<Z2>, mod_map<Z2> >
compute_kh_sq (const knot_desc &desc)
{
knot_diagram kd = desc.diagram ();
unsigned rank = self_rank ();
printf ("[% 2d] %s\n", rank, kd.name.c_str ());
fflush (stdout);
cube<Z2> c (kd);
mod_map<Z2> d = c.compute_d (1, 0, 0, 0, 0);
chain_complex_simplifier<Z2> s (c.khC, d, 1);
assert (s.new_d == 0);
steenrod_square sq (c, d, s);
mod_map<Z2> sq1 = sq.sq1 ();
mod_map<Z2> sq2 = sq.sq2 ();
assert (sq1.compose (sq1) == 0);
assert (sq2.compose (sq2) + sq1.compose (sq2).compose (sq1) == 0);
return pair<mod_map<Z2>, mod_map<Z2> > (sq1, sq2);
}
void
slave ()
{
@ -127,21 +101,35 @@ slave ()
{
knot_desc desc;
desc.t = (knot_desc::table)recv_int ();
desc.i = (knot_desc::table)recv_int ();
desc.j = (knot_desc::table)recv_int ();
desc.i = (unsigned)recv_int ();
desc.j = (unsigned)recv_int ();
printf ("[% 2d] CMD_DO %s\n", rank, desc.name ().c_str ());
char buf[1000];
sprintf (buf, "incoming/K%d_%d.dat", desc.i, desc.j);
sprintf (buf, "/scratch/network/cseed/incoming/K%d_%d.dat.gz",
desc.i, desc.j);
pair<mod_map<Z2>, mod_map<Z2> > p = compute_kh_sq (knot_kh_sq, desc);
// desc = knot_desc (knot_desc::ROLFSEN, 3, 1);
{
writer w (buf);
write (w, p.first);
write (w, p.second);
}
knot_diagram kd = desc.diagram ();
cube<Z2> c (kd);
mod_map<Z2> d = c.compute_d (1, 0, 0, 0, 0);
chain_complex_simplifier<Z2> s (c.khC, d, 1);
assert (s.new_d == 0);
steenrod_square sq (c, d, s);
mod_map<Z2> sq1 = sq.sq1 ();
mod_map<Z2> sq2 = sq.sq2 ();
assert (sq1.compose (sq1) == 0);
assert (sq2.compose (sq2) + sq1.compose (sq2).compose (sq1) == 0);
file_writer w (buf);
write (w, sq1);
write (w, sq2);
send_int (0, 0);
}

20
parallel.cmd Normal file
View File

@ -0,0 +1,20 @@
# mpi job, runtime max 5days
#PBS -l nodes=2:ppn=6,walltime=96:00:00
# xxx PBS -l mem=80gb
#
# sends mail if the process aborts, when it begins, and
# when it ends (abe)
#PBS -m abe
#
module load openmpi/gcc
# go to the directory with the program
cd $HOME/src/knotkit
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/u/cseed/llvm-3.1/lib
export LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH
# and run it
numprocs=`wc -l <${PBS_NODEFILE}`
mpiexec -np $numprocs ./mpimain

15
serial.cmd Normal file
View File

@ -0,0 +1,15 @@
# serial job
#PBS -l nodes=1:ppn=1,walltime=96:00:00
# xxx PBS -l mem=80gb
#
# sends mail if the process aborts, when it begins, and
# when it ends (abe)
#PBS -m abe
#
# load intel compiler settings before running the program
# since we compiled it with intel 10.1
# module load intel/10.1
# go to the directory with the program
cd $HOME/src/knotkit
# and run it
./main