Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2fffb77
initialization
cmontemuino Apr 12, 2016
9d98d92
Merge branch 'master' into multi-level-mw
cmontemuino Apr 12, 2016
858985e
routine signature simplification and result accumulation
cmontemuino Apr 13, 2016
2b1b9b4
shm preparation and some pseudo-code
cmontemuino Apr 15, 2016
cf3550c
right cmake conf for ubuntu
cmontemuino Apr 15, 2016
5aa2764
global master / node master processing
cmontemuino Apr 18, 2016
cb00a48
computation / communication interleaving improvement
cmontemuino Apr 19, 2016
03f5f33
fix processing with higher master-worker topology
cmontemuino Apr 20, 2016
defd7b6
fix processing with higher master-worker topology
cmontemuino Apr 20, 2016
b88bc40
improvement for the scenario with 1 node only
cmontemuino Apr 20, 2016
4b8e969
Direct output and all-work mode in in master
cmontemuino Apr 25, 2016
f67e74f
reduce number of messages used for coordination
cmontemuino Apr 29, 2016
5e7b880
deactivate sample generation at master level
cmontemuino May 2, 2016
b8f415b
revert back mspar code and bring makefile
cmontemuino May 29, 2016
7fc4ea2
semi-autonomous scheduling
cmontemuino Jun 6, 2016
3004ef3
fix shm rank gathering process
cmontemuino Jun 6, 2016
4b6c0ae
missing bcast for number of nodes to all processes
cmontemuino Jun 6, 2016
d3dc3e1
fix master-worker collection
cmontemuino Jun 6, 2016
3fe009e
fix sending results to node master
cmontemuino Jun 6, 2016
c48f5e9
add diagnose option
cmontemuino Jun 7, 2016
9c63b9e
simplify code and remove dead code
cmontemuino Jun 7, 2016
aebebe2
code simplification
cmontemuino Jun 8, 2016
3cfc76b
code documentation
cmontemuino Jun 8, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.5.1)
project(msparsm)

# Require MPI for this project:
Expand All @@ -7,7 +7,6 @@ find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})

set(MPI_COMPILE_FLAGS "-O3 -std=gnu99 -I.")
set(MPI_LINK_FLAGS "-lm")
set(SOURCE_FILES
ms.c
ms.h
Expand All @@ -17,7 +16,7 @@ set(SOURCE_FILES
streec.c)

add_executable(msparsm ${SOURCE_FILES})
target_link_libraries(msparsm ${MPI_LIBRARIES})
target_link_libraries(msparsm ${MPI_LIBRARIES} -lm)

if(MPI_COMPILE_FLAGS)
set_target_properties(msparsm PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")
Expand Down
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
#
# 'make' make executable file 'mspar'
# 'make clean' removes all .o and executable files
#

# Compiler
CC=mpicc

# Compilation flags
CFLAGS?=-O3 -std=gnu99 -I.

# define any libraries to link into executable:
LIBS?=-lm

# Dependencies
DEPS=ms.h mspar.h

# Folder to put the generated binaries
BIN?=./bin

# Object files
OBJ=$(BIN)/mspar.o $(BIN)/ms.o $(BIN)/streec.o

# Random functions using drand48()
RND_48=rand1.c

# Random functions using rand()
RND=rand2.c

.PHONY: clean

$(BIN)/%.o: %.c $(DEPS)
$(CC) $(CFLAGS) -c -o $@ $<

default: $(BIN)/mspar

# download: packages
# wget http://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.2.tar.gz
# tar -xf openmpi-1.8.2.tar.gz -C $(CURDIR)/packages

#packages:
# mkdir packages

clean:
rm -f $(BIN)/*
@echo ""
@echo "*** All resources were cleaned-up ***"
@echo ""

$(BIN)/mspar: $(OBJ)
$(CC) $(CFLAGS) -o $@ $^ $(RND_48) $(LIBS)
@echo ""
@echo "*** make complete: generated executable 'mspar' ***"
12 changes: 2 additions & 10 deletions ms.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ int main(int argc, char *argv[]){
char **tbsparamstrs ;
double probss, tmrca, ttot ;
struct params pars ;
void seedit( const char * ) ;
struct params getpars( int argc, char *argv[], int *howmany, int ntbs, int count ) ;

int samples;
Expand All @@ -139,14 +138,7 @@ int main(int argc, char *argv[]){
pars = getpars(argc, argv, &howmany, ntbs, count);

// Master-Worker
int myRank = masterWorkerSetup(argc, argv, howmany, pars, SITESINC);

if(myRank <= howmany && myRank > 0)
{
while(workerProcess(pars, SITESINC));
}

masterWorkerTeardown();
masterWorker(argc, argv, howmany, pars, SITESINC);
}

struct gensam_result
Expand Down Expand Up @@ -206,7 +198,7 @@ gensam( char **list, double *pprobss, double *ptmrca, double *pttot, struct para
free(seglst[seg].ptree) ;
}
result.tree = treeOutput;
printf(treeOutput);
printf("%s", treeOutput);
}

if( pars.mp.timeflag ) {
Expand Down
Loading