Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • mosaic/software/parallel-computing/openfpm/openfpm_pdata
  • argupta/openfpm_pdata
2 results
Show changes
Showing
with 0 additions and 3451 deletions
#!groovy
parallel (
"nyu" : {node ('nyu')
{
deleteDir()
checkout scm
stage ('build_nyu')
{
sh "./build.sh $WORKSPACE $NODE_NAME pdata"
}
stage ('run_nyu')
{
parallel (
"1" : {sh "./run.sh $WORKSPACE $NODE_NAME 1"},
"2" : {sh "./run.sh $WORKSPACE $NODE_NAME 2"},
"3" : {sh "./run.sh $WORKSPACE $NODE_NAME 3"})
sh "./run.sh $WORKSPACE $NODE_NAME 5"
sh "./success.sh 2 nyu opefpm_pdata"
}
}
},
"sb15" : {node ('sbalzarini-mac-15')
{
deleteDir()
env.PATH = "/usr/local/bin:${env.PATH}"
checkout scm
stage ('build_sb15')
{
sh "./build.sh $WORKSPACE $NODE_NAME pdata"
}
stage ('run_sb15')
{
parallel (
"1" : {sh "./run.sh $WORKSPACE $NODE_NAME 1"},
"2" : {sh "./run.sh $WORKSPACE $NODE_NAME 2"},
"3" : {sh "./run.sh $WORKSPACE $NODE_NAME 3"}
)
sh "./run.sh $WORKSPACE $NODE_NAME 4"
sh "./run.sh $WORKSPACE $NODE_NAME 5"
sh "./run.sh $WORKSPACE $NODE_NAME 6"
sh "./run.sh $WORKSPACE $NODE_NAME 7"
sh "./success.sh 2 sbalzarini-mac-15 opefpm_pdata"
}
}
},
"gin" : {node ('gin')
{
deleteDir()
env.PATH = "/usr/local/bin:${env.PATH}"
checkout scm
stage ('build_gin')
{
sh "./build.sh $WORKSPACE $NODE_NAME pdata"
}
stage ('run_gin')
{
parallel (
"p1" : {sh "./run.sh $WORKSPACE $NODE_NAME 1"},
"p2" : {sh "./run.sh $WORKSPACE $NODE_NAME 2"},
"p3" : {sh "./run.sh $WORKSPACE $NODE_NAME 3"},
"p4" : {sh "./run.sh $WORKSPACE $NODE_NAME 5"}
)
sh "./success.sh 2 gin opefpm_pdata"
}
}
}
)
#!groovy
parallel (
"gin" : {node ('gin')
{
deleteDir()
checkout scm
stage ('build_gin')
{
sh "./build.sh $WORKSPACE $NODE_NAME pdata full && make install"
}
stage ('run_example_gin')
{
sh "source $HOME/openfpm_vars && cd example && make"
}
}},
"sb15" : {node ('sbalzarini-mac-15')
{
deleteDir()
checkout scm
env.PATH = "/usr/local/bin:${env.PATH}"
stage ('build_sb15')
{
sh "./build.sh $WORKSPACE $NODE_NAME pdata full && make install"
}
stage ('run_example_sb15')
{
sh "source $HOME/openfpm_vars && cd example && make"
}
}
}
)
#!groovy
parallel (
"gin" : {node ('gin')
{
deleteDir()
checkout scm
stage ('build_gin')
{
sh "./build.sh $WORKSPACE $NODE_NAME numerics"
}
stage ('run_gin')
{
parallel (
"1" : {sh "cd openfpm_numerics && ./run.sh $WORKSPACE $NODE_NAME 1"},
"2" : {sh "cd openfpm_numerics && ./run.sh $WORKSPACE $NODE_NAME 2"},
"3" : {sh "cd openfpm_numerics && ./run.sh $WORKSPACE $NODE_NAME 3"},
"4" : {sh "cd openfpm_numerics && ./run.sh $WORKSPACE $NODE_NAME 4"}
)
sh "./success.sh 2 gin openfpm_numerics"
}
}
},
"sb15" : {node ('sbalzarini-mac-15')
{
deleteDir()
env.PATH = "/usr/local/bin:${env.PATH}"
checkout scm
stage ('build_sb15')
{
sh "./build.sh $WORKSPACE $NODE_NAME numerics"
}
stage ('run_sb15')
{
parallel (
"1" : {sh "cd openfpm_numerics && ./run.sh $WORKSPACE $NODE_NAME 1"},
"2" : {sh "cd openfpm_numerics && ./run.sh $WORKSPACE $NODE_NAME 2"},
"3" : {sh "cd openfpm_numerics && ./run.sh $WORKSPACE $NODE_NAME 3"},
"4" : {sh "cd openfpm_numerics && ./run.sh $WORKSPACE $NODE_NAME 4"}
)
sh "./success.sh 2 sbalzarini-mac-15 openfpm_numerics"
}
}
}
)
SUBDIRS = src images openfpm_data openfpm_io openfpm_devices openfpm_vcluster openfpm_numerics
bin_PROGRAMS =
pdata:
cd src && make
data:
cd openfpm_data/src && make
devices:
cd openfpm_devices/src && make
vcluster:
cd openfpm_vcluster/src && make
io:
cd openfpm_io/src && make
numerics:
cd openfpm_numerics/src && make
test_pdata:
cd src && make test
test_data:
cd openfpm_data/src && make test
test_devices:
cd openfpm_devices/src && make test
test_vcluster:
cd openfpm_vcluster/src && make test
test_io:
cd openfpm_io/src && make test
test_numerics:
cd openfpm_numerics/src && make test
test: test_devices test_data test_vcluster test_pdata test_io test_numerics
.PHONY: test_pdata test_data test_devices test_vcluster test_io test_numerics
Openfpm is a library for computer simulation, but with our documentation it is also a valid resource
to drive people to do simulation.
There are at the moment 3 way to try openfpm.
1) Without installation: We provide ready to use Docker image compatible with codenvy and IDE on browser. More ...
2) We provide Docker image, Ubuntu Virtual Machine and OSX Virtual Machine with OpenFPM preinstalled. More ...
3) Installation from source. More ...
This diff is collapsed.
#! /bin/bash
# Make a directory in /tmp/OpenFPM_pdata
echo "Directory: $1"
echo "Machine: $2"
mkdir src/config
git submodule init
if [ $? -ne 0 ]; then
echo -e "Configure\033[91;5;1m FAILED \033[0m"
exit 1
fi
git submodule update
if [ $? -ne 0 ]; then
echo -e "Configure\033[91;5;1m FAILED \033[0m"
exit 1
fi
mkdir openfpm_numerics/src/config
if [ "$2" == "gin" ]
then
echo "Compiling on gin\n"
source ~/.bashrc
module load gcc/4.9.2
if [ x"$4" == x"full" ]; then
./install -s -c "--prefix=/home/jenkins/openfpm_install"
elif [ x"$3" == x"numerics" ]; then
./install -m -s -c "--prefix=/home/jenkins/openfpm_install"
make $3
else
./install -m -s -c "--prefix=/home/jenkins/openfpm_install --no-recursion"
make $3
fi
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
source $HOME/openfpm_vars
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
elif [ "$2" == "wetcluster" ]
then
echo "Compiling on wetcluster"
## produce the module path
source ~/.bashrc
module load gcc/4.9.2
module load openmpi/1.8.1
module load boost/1.54.0
sh ./autogen.sh
./install -m -s -c "--with-boost=/sw/apps/boost/1.54.0/ CXX=mpic++ --no-recursion"
make $3
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
elif [ "$2" == "taurus" ]
then
echo "Compiling on taurus"
source /etc/profile
echo "$PATH"
module load eigen/3.2.0
module load suitesparse/4.2.1-gnu-multimkl
module load boost/1.60.0
module load gcc/5.3.0
module load openmpi/1.10.2-gnu
module unload bullxmpi
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/incard/PARMETIS/lib:/home/incard/METIS/lib:/home/incard/HDF5/lib"
./install -m -i "/scratch/p_ppm/" -s -c"CXX=mpic++ --no-recursion"
make $3
source $HOME/openfpm_vars
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
else
echo "Compiling general"
source ~/.bashrc
if [ x"$4" == x"full" ]; then
./install -s -c "--prefix=/Users/jenkins/openfpm_install"
elif [ x"$3" == x"numerics" ]; then
./install -m -s -c "--prefix=/home/jenkins/openfpm_install"
make $3
else
./install -m -s -c "--prefix=/Users/jenkins/openfpm_install --no-recursion"
make $3
fi
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
fi
#! /bin/bash
# Make a directory in /tmp/OpenFPM_pdata
echo "Directory: $1"
echo "Machine: $2"
mkdir src/config
git submodule init
if [ $? -ne 0 ]; then
echo -e "Configure\033[91;5;1m FAILED \033[0m"
exit 1
fi
git submodule update
if [ $? -ne 0 ]; then
echo -e "Configure\033[91;5;1m FAILED \033[0m"
exit 1
fi
mkdir openfpm_numerics/src/config
if [ "$2" == "gin" ]
then
echo "Compiling on gin\n"
source ~/.bashrc
module load gcc/4.9.2
./install -s -c "--prefix=/home/jenkins/openfpm_install"
make
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
make install
source $HOME/openfpm_vars
if [ x"$3" == x"no_test" ]; then
exit 0;
fi
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 2 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 3 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 4 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 5 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 6 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 7 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 8 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 9 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 10 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 11 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 12 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
elif [ "$2" == "wetcluster" ]
then
echo "Compiling on wetcluster"
## produce the module path
source ~/.bashrc
module load gcc/4.9.2
module load openmpi/1.8.1
module load boost/1.54.0
sh ./autogen.sh
./install -s -c "--with-boost=/sw/apps/boost/1.54.0/ CXX=mpic++"
make
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
source $HOME/openfpm_vars
## Run on the cluster
bsub -o output_run2.%J -K -n 2 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0; mpirun -np 2 ./src/pdata"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
bsub -o output_run3.%J -K -n 3 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0; mpirun -np 3 ./src/pdata"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
bsub -o output_run4.%J -K -n 4 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0; mpirun -np 4 ./src/pdata"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
bsub -o output_run5.%J -K -n 5 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0; mpirun -np 5 ./src/pdata"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
bsub -o output_run6.%J -K -n 6 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0; mpirun -np 6 ./src/pdata"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
bsub -o output_run7.%J -K -n 7 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0; mpirun -np 7 ./src/pdata"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
bsub -o output_run8.%J -K -n 8 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0; mpirun -np 8 ./src/pdata"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
bsub -o output_run9.%J -K -n 9 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0; mpirun -np 9 ./src/pdata"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
bsub -o output_run10.%J -K -n 10 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0; mpirun -np 10 ./src/pdata"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
bsub -o output_run11.%J -K -n 11 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0; mpirun -np 11 ./src/pdata"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
bsub -o output_run12.%J -K -n 12 -R "span[hosts=1]" "module load openmpi/1.8.1 ; module load gcc/4.9.2; module load boost/1.54.0; mpirun -np 12 ./src/pdata"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
# bsub -o output_run32.%J -K -n 32 "module load openmpi/1.8.1 ; module load gcc/4.9.2; mpirun -np 32 ./src/vcluster"
# if [ $? -ne 0 ]; then exit 1 ; fi
# bsub -o output_run32.%J -K -n 64 "module load openmpi/1.8.1 ; module load gcc/4.9.2; mpirun -np 64 ./src/vcluster"
# if [ $? -ne 0 ]; then exit 1 ; fi
# bsub -o output_run32.%J -K -n 128 "module load openmpi/1.8.1 ; module load gcc/4.9.2; mpirun -np 128 ./src/vcluster"
# if [ $? -ne 0 ]; then exit 1 ; fi
elif [ "$2" == "taurus" ]
then
echo "Compiling on taurus"
source /etc/profile
echo "$PATH"
module load eigen/3.2.0
module load suitesparse/4.2.1-gnu-multimkl
module load boost/1.60.0
module load gcc/5.3.0
module load openmpi/1.10.2-gnu
module unload bullxmpi
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/incard/PARMETIS/lib:/home/incard/METIS/lib:/home/incard/HDF5/lib"
./install -i "/scratch/p_ppm/" -s -c"CXX=mpic++"
make
source $HOME/openfpm_vars
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
export
which salloc
salloc --nodes=1 --ntasks-per-node=24 --time=00:15:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 24 src/pdata --report_level=no"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
salloc --nodes=2 --ntasks-per-node=24 --time=00:15:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 48 src/pdata --report_level=no"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
salloc --nodes=4 --ntasks-per-node=24 --time=00:5:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 96 src/pdata --report_level=no"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
salloc --nodes=8 --ntasks-per-node=24 --time=00:5:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 192 src/pdata --report_level=no"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
salloc --nodes=10 --ntasks-per-node=24 --time=00:5:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 240 src/pdata --report_level=no"
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
else
echo "Compiling general"
source ~/.bashrc
./install -s
make
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
if [ x"$3" == x"no_test" ]; then
exit 0;
fi
source $HOME/openfpm_vars
mpirun -np 1 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 2 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 3 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 4 ./src/pdata
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
fi
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Info:\", \"color\": \"#00FF00\", \"text\":\"$2 completed succeffuly the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
#! /bin/bash
# Make a directory in /tmp/OpenFPM_pdata
echo "Directory: $1"
echo "Machine: $2"
mkdir src/config
git submodule init
if [ $? -ne 0 ]; then
echo -e "Configure\033[91;5;1m FAILED \033[0m"
exit 1
fi
git submodule update
if [ $? -ne 0 ]; then
echo -e "Configure\033[91;5;1m FAILED \033[0m"
exit 1
fi
mkdir openfpm_numerics/src/config
if [ "$2" == "taurus" ]; then
echo "Compiling on taurus with intel compiler"
source /etc/profile
echo "$PATH"
module load gcc/4.9.3
module load intel/2017.0.020
echo "3" > input_install
echo "1" >> input_install
echo "1" >> input_install
echo "24" >> input_install
echo "y" >> input_install
./install -i "/scratch/p_ppm/openfpm_deps_intel" < input_install
fi
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
## Take all the options with the exception of --enable-install-req
AC_PREREQ(2.59)
AC_INIT(OpenFPM_pdata, 0.8.0, BUG-REPORT-ADDRESS)
AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_SUBDIRS([openfpm_data openfpm_devices openfpm_vcluster openfpm_io openfpm_numerics])
#### Adding --with-pdata option and openfpm_pdata to prefix folder
if test "$prefix" = "NONE"; then
prefix=/usr/local
fi
base=$prefix
prefix="$prefix/openfpm_pdata"
echo "Installation dir is: $prefix"
ac_configure_args="$ac_configure_args --with-pdata=../../src"
########################
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_HEADER([src/config/config.h])
m4_ifdef([ACX_PTHREAD],,[m4_include([m4/acx_pthread.m4])])
m4_ifdef([ACX_MPI],,[m4_include([m4/acx_mpi.m4])])
m4_ifdef([AX_OPENMP],,[m4_include([m4/ax_openmp.m4])])
m4_ifdef([AX_CUDA],,[m4_include([m4/ax_cuda.m4])])
m4_ifdef([IMMDX_LIB_METIS],,[m4_include([m4/immdx_lib_metis.m4])])
m4_ifdef([IMMDX_LIB_PARMETIS],,[m4_include([m4/immdx_lib_parmetis.m4])])
m4_ifdef([AX_BOOST_BASE],,[m4_include([m4/ax_boost_base.m4])])
m4_ifdef([AX_BOOST_IOSTREAMS],,[m4_include([m4/ax_boost_iostreams.m4])])
m4_ifdef([AX_BOOST_PROGRAM_OPTIONS],,[m4_include([m4/ax_boost_program_options.m4])])
m4_ifdef([AX_BOOST_UNIT_TEST_FRAMEWORK],,[m4_include([m4/ax_boost_unit_test_framework.m4])])
m4_ifdef([AX_BLAS],,[m4_include([m4/ax_blas.m4])])
m4_ifdef([AX_LAPACK],,[m4_include([m4/ax_lapack.m4])])
m4_ifdef([AX_SUITESPARSE],,[m4_include([m4/ax_suitesparse.m4])])
m4_ifdef([AX_EIGEN],,[m4_include([m4/ax_eigen.m4])])
m4_ifdef([AX_LIB_HDF5],,[m4_include([m4/ax_lib_hdf5.m4])])
m4_ifdef([AX_LIB_PETSC],,[m4/ax_petsc_lib.m4])
m4_ifdef([AX_LIB_HILBERT],,[m4/ax_libhilbert.m4])
case $host_os in
*darwin*|*macosx*)
CXXFLAGS+=" --std=c++11 "
AC_DEFINE([HAVE_OSX],[],[We have OSX])
;;
*cygwin*)
# Do something specific for cygwin
CXXFLAGS+=" --std=gnu++11 "
;;
*)
#Default Case
CXXFLAGS+=" --std=c++11 "
;;
esac
NVCCFLAGS=" "
INCLUDES_PATH=" "
# Create a file with the install base folder
echo "$base" > install_dir
# Needed for build library
AC_PROG_RANLIB
AM_PROG_AR
# Checks for programs.
AC_PROG_CXX
# Checks g++ flags
AC_CANONICAL_HOST
# Check that the compiler support mpi
AC_LANG_PUSH([C++])
AC_CHECK_HEADER(mpi.h,[],[echo "mpi.h not found"
exit 200])
AC_LANG_POP([C++])
# Check target architetture
#AX_GCC_ARCHFLAG([], [CXXFLAGS="$CXXFLAGS $ax_cv_gcc_archflag"], [])
###### Check for debug compilation
AC_MSG_CHECKING(whether to build with debug information)
debuger=no
AC_ARG_ENABLE(debug,
AC_HELP_STRING(
[--enable-debug],
[enable debug data generation (def=no)]
),
debuger="$enableval"
)
AC_MSG_RESULT($debuger)
if test x"$debuger" = x"yes"; then
AC_DEFINE([DEBUG_MODE],[],[Debug])
AC_DEFINE([DEBUG],[],[Debug])
CXXFLAGS="$CXXFLAGS -g3 -Wall -O0 "
NVCCFLAGS+="$NVCCFLAGS -g -O0 "
else
CXXFLAGS="$CXXFLAGS -Wall -O3 -g3 -funroll-loops "
NVCCFLAGS+="$NVCCFLAGS -O3 "
fi
#########
## Check for Metis
IMMDX_LIB_METIS([],[echo "Cannot detect metis, use the --with-metis option if it is not installed in the default location"
exit 201])
#########
## Check for HDF5
AX_LIB_HDF5([parallel])
if test x"$with_hdf5" = x"no"; then
echo "Cannot detect hdf5, use the --with-hdf5 option if it is not installed in the default location"
exit 207
fi
##########
## Check for LIBHILBERT
AX_LIB_HILBERT([],[echo "Cannot detect libhilbert, use the --with-libhilbert option if it is not installed in the default location"
exit 210])
##########
## Check for PETSC
AX_LIB_PETSC()
## Check for quadmath
have_quad_lib=no
have_quad_head=no
AC_CHECK_LIB(quadmath, sinq, [have_quad_lib=yes], [])
AC_CHECK_HEADER(quadmath.h,[have_quad_head=yes],[])
if [x"have_quad_math" == x"yes" $&& x"have_quad_math" == x"yes" ]; then
AC_DEFINE(HAVE_LIBQUADMATH,[],[Have quad math lib])
LIBQUADMATH=" -lquadmath "
fi
AC_CHECK_LIB(ifcore, for_cpystr, [ LIBIFCORE=-lifcore ], [ LIBIFCORE= ])
AC_SUBST(LIBIFCORE)
AC_SUBST(OPENMP_CFLAGS)
AC_SUBST(OPENMP_LDFLAGS)
echo "$OPENMP_CFLAGS" > openmp_flags
########
## Enable scan coverty
AC_MSG_CHECKING(whether to build for scan coverty compilation)
AC_ARG_ENABLE(scan-coverty,
AC_HELP_STRING(
[--enable-scan-coverty],
[enable scan-coverty compilation (def=no)]
),
scancoverty="$enableval"
)
AC_MSG_RESULT($scancoverty)
if test x"$scancoverty" = x"yes"; then
AC_DEFINE([COVERTY_SCAN],[],[Compile for coverty scan])
fi
###### Check for performance test
AC_MSG_CHECKING(whether to build with performance test)
test_per=no
AC_ARG_ENABLE(test-performance,
AC_HELP_STRING(
[--enable-test-performance],
[enable test performance]
),
test_per="$enableval"
)
AC_MSG_RESULT($test_per)
if test x"$test_per" = x"yes"; then
AC_DEFINE([PERFORMANCE_TEST],[],[Test performance mode])
fi
###### Checking for compiler flags -fext-numeric-literals
AC_LANG_PUSH([C++])
my_save_cflags="$CXXFLAGS"
CXXFLAGS=-fext-numeric-literals
AC_MSG_CHECKING([whether CXX supports -fext-numeric-literals])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])
AM_CXXFLAGS="-fext-numeric-literals"
echo "-fext-numeric-literals" > openfpm_flags
],
[
AC_MSG_RESULT([no])
echo "" > openfpm_flags
]
)
AC_LANG_POP([C++])
CXXFLAGS="$my_save_cflags"
AC_SUBST([AM_CXXFLAGS])
## Check for parMetis
IMMDX_LIB_PARMETIS([],[echo "Cannot detect parmetis, use the --with-parmetis option if it is not installed in the default location"
exit 208])
####### include OpenFPM_devices include path
INCLUDES_PATH+="-I. -Iconfig/ -I../openfpm_io/src -I../openfpm_data/src -I../openfpm_devices/src -I../openfpm_vcluster/src/"
###### Check for se-class1
AC_MSG_CHECKING(whether to build with security enhancement class1)
se_class1=no
AC_ARG_ENABLE(se-class1,
AC_HELP_STRING(
[--enable-se-class1],
[enable security enhancement class1]
),
se_class1="$enableval"
)
AC_MSG_RESULT($se_class1)
if test x"$se_class1" = x"yes"; then
AC_DEFINE([SE_CLASS1],[],[Security enhancement class 1])
fi
###### Check for se-class 2
AC_MSG_CHECKING(whether to build with security enhancement class 2)
se_class2=no
AC_ARG_ENABLE(se-class2,
AC_HELP_STRING(
[--enable-se-class2],
[enable security enhancement class 2]
),
se_class2="$enableval"
)
AC_MSG_RESULT($se_class2)
if test x"$se_class2" = x"yes"; then
AC_DEFINE([SE_CLASS2],[],[Security enhancement class 2])
fi
###### Check for se-class 3
AC_MSG_CHECKING(whether to build with security enhancement class 3)
se_class3=no
AC_ARG_ENABLE(se-class3,
AC_HELP_STRING(
[--enable-se-class3],
[enable security enhancement class 3]
),
se_class3="$enableval"
)
AC_MSG_RESULT($se_class3)
if test x"$se_class3" = x"yes"; then
AC_DEFINE([SE_CLASS3],[],[Security enhancement class 3])
fi
###### Check for action on error
action_on_e=continue
AC_ARG_WITH([action-on-error],
AS_HELP_STRING([--with-action-on-error=stop,throw,continue],
[specify the action to do in case of error]),
[action_on_e="$withval"],
[action_on_e=continue])
if test x"$action_on_e" = x"stop"; then
AC_DEFINE([STOP_ON_ERROR],[],[If an error occur stop the program])
fi
if test x"$action_on_e" = x"throw"; then
AC_DEFINE([THROW_ON_ERROR],[],[when an error accur continue but avoid unsafe operation])
fi
##### CHECK FOR BOOST ##############
AX_BOOST_BASE([1.52],[],[echo "boost not found"
exit 202])
AX_BOOST_UNIT_TEST_FRAMEWORK
AX_BOOST_PROGRAM_OPTIONS
AX_BOOST_IOSTREAMS
if test x"$ax_cv_boost_unit_test_framework" = x"no"; then
echo "Notify boost unit test framework not usable"
exit 202
fi
if test x"$ax_cv_boost_iostreams" = x"no"; then
echo "Notify boost iostream not usable"
exit 202
fi
if test x"$ax_cv_boost_programs_options" = x"no"; then
echo "Notify boost program options not usable"
exit 202
fi
### Unfortunately a lot of linux distros install a pretty old MPI in the system wide folder,
### override such MPI with the installed one is extremely difficult and tricky, because we want
### to include "some" system library but exclude mpi. One possibility is to give specifically
### the wanted libmpi.so directly to the linker. But this is not possible because this lib is
### given by mpic++ in the form -L/path/to/mpi -lmpi, the other is completely eliminate every
### -L with a system default library
###
# eliminate any /usr/lib and and /usr/include from $BOOST_LIB and $BOOST_INCLUDE
BOOST_LDFLAGS=$(echo "$BOOST_LDFLAGS" | sed -e 's/ -L\/usr\/lib64[ \b]//g' | sed -e 's/ -L\/usr\/lib[ \b]//g')
BOOST_CPPFLAGS=$(echo "$BOOST_CPPFLAGS" | sed -e 's/-I\/usr\/include[ \b]//g')
AC_SUBST(BOOST_LDFLAGS)
AC_SUBST(BOOST_CPPFLAGS)
AX_BLAS([],[])
AX_LAPACK([],[])
###### Checking for SUITESPARSE
AX_SUITESPARSE([],[])
###### Checking for EIGEN
AX_EIGEN([],[])
###### RT runtime lib
AC_CHECK_LIB(rt, clock_gettime, [AC_DEFINE([HAVE_CLOCK_GETTIME],[],[Have clock time])
OPT_LIBS="$OPT_LIBS -lrt"
])
####### Checking for GPU support
AX_CUDA
## detect for NVCC
if test x"$NVCC_EXIST" = x"yes"; then
AC_MSG_CHECKING(whether to build with GPU support)
gpu_support=yes
AC_ARG_ENABLE(gpu,
AC_HELP_STRING(
[--enable-gpu],
[enable gpu support]
),
gpu_support="$enableval"
)
AC_MSG_RESULT($gpu_support)
if test x"$gpu_support" = x"yes"; then
AC_DEFINE([GPU],[],[GPU support])
else
CUDA_LIBS=""
CUDA_CFLAGS=""
fi
else
gpu_support=no
fi
if test x$gpu_support = x"no"; then
CUDA_LIBS=""
CUDA_CFLAGS=""
fi
# Set this conditional if cuda is wanted
AM_CONDITIONAL(BUILDCUDA, test ! x$NVCC = x"no")
###########################
# Define that there is MPI
AC_DEFINE([HAVE_MPI],[],[MPI Enabled])
AC_SUBST(NVCCFLAGS)
AC_SUBST(INCLUDES_PATH)
AC_SUBST(OPT_LIBS)
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CONFIG_FILES([Makefile src/Makefile images/Makefile ])
AC_OUTPUT
echo ""
echo "***********************************"
echo "* *"
if [ test x"$profiler" = x"yes" ]; then
echo "* profiler: yes *"
else
echo "* profiler: no *"
fi
if [ test x"$memcheck" = x"yes" ]; then
echo "* memcheck: yes *"
else
echo "* memcheck: no *"
fi
if [ test x"$debuger" = x"yes" ]; then
echo "* debug: yes *"
else
echo "* debug: no *"
fi
if [ test x"$se_class1" = x"yes" ]; then
echo "* se-class1: yes *"
else
echo "* se-class1: no *"
fi
if [ test x"$se_class2" = x"yes" ]; then
echo "* se-class2: yes *"
else
echo "* se-class2: no *"
fi
if [ test x"$se_class3" = x"yes" ]; then
echo "* se-class3: yes *"
else
echo "* se-class3: no *"
fi
if [ test x"$gpu_support" = x"no" ]; then
echo "* gpu: no *"
else
echo "* gpu: yes *"
fi
echo "* *"
echo "***********************************"
include ../../example.mk
CC=mpic++
LDIR =
OBJ = main.o
%.o: %.cpp
$(CC) -O3 -g3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
se_classes: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
all: se_classes
run: all
.PHONY: clean all run
clean:
rm -f *.o *~ core se_classes
[pack]
files = main.cpp Makefile
/*
* ### WIKI 1 ###
*
* ## Security enhancement example
*
* This example show several basic functionalities of Security Enhancements
*
*/
#define SE_CLASS1
#define SE_CLASS2
#define SE_CLASS3
#define THROW_ON_ERROR
#include "Memleak_check.hpp"
#include "Vector/vector_dist.hpp"
#include "Decomposition/CartDecomposition.hpp"
#include "Point_test.hpp"
/*
* ### WIKI END ###
*/
int main(int argc, char* argv[])
{
//
// ### WIKI 2 ###
//
// With print_unalloc we can check how much memory has been allocated and which structure
// has been allocated, initially there are not
//
std::cout << "Allocated memory before initializing \n";
print_alloc();
std::cout << "\n";
std::cout << "\n";
std::cout << "\n";
//
// ### WIKI 3 ###
//
// Here we Initialize the library, than we create a uniform random generator between 0 and 1 to to generate particles
// randomly in the domain, we create a Box that define our domain, boundary conditions and ghost
//
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
typedef Point<2,float> s;
Box<2,float> box({0.0,0.0},{1.0,1.0});
size_t bc[2]={NON_PERIODIC,NON_PERIODIC};
Ghost<2,float> g(0.01);
//
// ### WIKI 4 ###
//
// Here we ask again for the used memory, as we can see Vcluster and several other structures encapsulated inside
// Vcluster register itself
//
if (v_cl.getProcessUnitID() == 0)
{
std::cout << "Allocated memory after initialization \n";
print_alloc();
std::cout << "\n";
std::cout << "\n";
std::cout << "\n";
}
//
// ### WIKI 5 ###
//
// Here we are creating a distributed vector defined by the following parameters
//
// * Dimensionality of the space where the objects live 2D (1° template parameters)
// * Type of the space, float (2° template parameters)
// * Information stored by each object (3* template parameters), in this case a Point_test store 4 scalars
// 1 vector and an asymmetric tensor of rank 2
// * Strategy used to decompose the space
//
// The Constructor instead require:
//
// * Number of particles 4096 in this case
// * Domain where is defined this structure
//
// The following construct a vector where each processor has 4096 / N_proc (N_proc = number of processor)
// objects with an undefined position in space. This non-space decomposition is also called data-driven
// decomposition
//
{
vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> > vd(4096,box,bc,g);
//
// ### WIKI 6 ###
//
// we create a key that for sure overflow the local datastructure, 2048 with this program is started with more than 3
// processors, try and catch are optionals in case you want to recover from a buffer overflow
//
try
{
vect_dist_key_dx vt(5048);
auto it = vd.getPos(vt);
}
catch (size_t e)
{
std::cerr << "Error notification of overflow \n";
}
}
//
// ### WIKI 7 ###
//
// At this point the vector went out of the scope and if destroyed
// we create, now two of them using new
//
vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> > * vd1 = new vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> >(4096,box,bc,g);
vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> > * vd2 = new vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> >(4096,box,bc,g);
//
// ### WIKI 8 ###
//
// we can check that these two structure produce an explicit allocation checking
// for registered pointers and structures with print_alloc, in the list we see 2 additional
// entry for distributed vector in yellow, pdata to work use the data structures that register
// itself in magenta, the same things happen for the real memory allocation from devices in
// fully green
//
if (v_cl.getProcessUnitID() == 0)
{
std::cout << "Allocated memory with 2 vectors \n";
print_alloc();
std::cout << "\n";
std::cout << "\n";
std::cout << "\n";
}
//
// ### WIKI 9 ###
//
// we can also ask to the structure to identify their-self in the list
//
std::cout << "Vector id: " << vd1->who() << "\n";
std::cout << "Vector id: " << vd2->who() << "\n";
//
// ### WIKI 10 ###
//
// delete vd1 and print allocated memory, one distributed vector disappear
//
delete vd1;
if (v_cl.getProcessUnitID() == 0)
{
std::cout << "Allocated memory with 1 vector \n";
print_alloc();
std::cout << "\n";
std::cout << "\n";
std::cout << "\n";
}
//
// ### WIKI 11 ###
//
// delete vd2 and print allocated memory, all distributed vector de-register
//
delete vd2;
if (v_cl.getProcessUnitID() == 0)
{
std::cout << "Allocated memory with 1 vector \n";
print_alloc();
std::cout << "\n";
std::cout << "\n";
std::cout << "\n";
}
//
// ### WIKI 12 ###
//
// Try to use a deleted object
//
try
{
vect_dist_key_dx vt(0);
auto it = vd1->getPos(vt);
}
catch (std::exception & e)
{
std::cerr << "Error notification of invalid usage of deleted object \n";
}
//
// ### WIKI 13 ###
//
// Deinitialize the library
//
openfpm_finalize();
}
include ../../example.mk
CC=mpic++
LDIR =
OBJ = main.o
%.o: %.cpp
$(CC) -O3 -g3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
se_classes: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
all: se_classes
run: all
.PHONY: clean all run
clean:
rm -f *.o *~ core se_classes
[pack]
files = main.cpp Makefile
/*
* ### WIKI 1 ###
*
* ## Security enhancement example
*
* This example show how to see where an allocation or corruption happen offline and online.
* Every time an error occur, the library output where the detection happen filename and line,
* in order to debug, there is an online option and an offline option
*
* * online: put a breakpoint on the indicated line with your preferred debugger
* * offline: set ulimit -c unlimited to activate the core dump file and open the core dump with your debugger
*
*/
#define SE_CLASS1
#define SE_CLASS2
#define SE_CLASS3
#define THROW_ON_ERROR
#include "Memleak_check.hpp"
#include "data_type/scalar.hpp"
#include "Grid/grid_dist_id.hpp"
#include "Decomposition/CartDecomposition.hpp"
#include "Point_test.hpp"
/*
* ### WIKI END ###
*/
int main(int argc, char* argv[])
{
//
// ### WIKI 2 ###
//
// Here we Initialize the library,
// * message_on_allocation set a message to print when one allocation is reached, the filename and line number can be used to set a breakpoint and analyze the stacktrace.
// * throw_on_allocation throw when one allocation is reached, producing the termination of the program and a core dump (if no try catch is set-up)
//
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
throw_on_alloc(10);
// message_on_alloc(10);
//
// ### WIKI 3 ###
//
// Create several object needed later, in particular
// * A 3D box that define the domain
// * an array of 3 unsigned integer that define the size of the grid on each dimension
// * A Ghost object that will define the extension of the ghost part for each sub-domain in physical units
Box<3,float> domain({0.0,0.0,0.0},{1.0,1.0,1.0});
size_t sz[3];
sz[0] = 100;
sz[1] = 100;
sz[2] = 100;
// Ghost
Ghost<3,float> g(0.01);
//
// ### WIKI 4 ###
//
// Create a distributed grid in 3D (1° template parameter) defined in R^3 with float precision (2° template parameter)
// using a CartesianDecomposition strategy (3° parameter) (the parameter 1° and 2° inside CartDecomposition must match 1° and 2°
// of grid_dist_id)
//
// Constructor parameters:
//
// * sz: size of the grid on each dimension
// * domain: where the grid is defined
// * g: ghost extension
//
//
grid_dist_id<3, float, scalar<float[3]>, CartDecomposition<3,float>> * g_dist = new grid_dist_id<3, float, scalar<float[3]>, CartDecomposition<3,float>>(sz,domain,g);
//
// ### WIKI 6 ###
//
// print allocated structures
//
if (v_cl.getProcessUnitID() == 0)
print_alloc();
//
// ### WIKI 5 ###
//
// delete g_dist
//
delete g_dist;
//
// ### WIKI 6 ###
//
// On purpose we try to access a deleted object
//
g_dist->getGridInfo();
//
// ### WIKI 13 ###
//
// Deinitialize the library
//
openfpm_finalize();
}
SUBDIRS := $(wildcard */.)
all clean run: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: all clean $(SUBDIRS)
include ../../example.mk
CC=mpic++
LDIR =
OBJ = main.o
%.o: %.cpp
$(CC) -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
grid: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
all: grid
run: all
mpirun -np 2 ./grid
.PHONY: clean all run
clean:
rm -f *.o *~ core grid
[pack]
files = main.cpp Makefile
#include "Grid/grid_dist_id.hpp"
#include "data_type/aggregate.hpp"
/*! \page grid Grid
*
* \subpage grid_0_simple
* \subpage Grid_1_stencil
* \subpage Grid_2_solve_eq
* \subpage Grid_3_gs
*
*/
/*! \page grid_0_simple Grid 0 simple
[TOC]
# Simple grid example # {#simple_grid_example}
This example show several basic functionalities of the distributed grid
\htmlonly
<a href="#" onclick="if (document.getElementById('grid-video-1').style.display == 'none') {document.getElementById('grid-video-1').style.display = 'block'} else {document.getElementById('grid-video-1').style.display = 'none'}" >Video</a>
<div style="display:none" id="grid-video-1">
<video id="vid1" width="1200" height="576" controls> <source src="http://ppmcore.mpi-cbg.de/upload/video/Lesson1-1.mp4" type="video/mp4"></video><script>document.getElementById('vid1').addEventListener('loadedmetadata', function() {this.currentTime = 236;}, false);</script>
</div>
\endhtmlonly
*/
int main(int argc, char* argv[])
{
/*! \page grid_0_simple Grid 0 simple
*
* ## Initialization ## {#e0_s_initialization}
*
* Here we:
* * Initialize the library
* * Create A 3D box that define our the domain
* * an array of 3 unsigned integer that will define the size of the grid on each dimensions
* * A Ghost object that will define the extension of the ghost part in physical units
*
* \snippet Grid/0_simple/main.cpp initialization
*
*/
//! \cond [initialization] \endcond
// Initialize the library
openfpm_init(&argc,&argv);
// 3D physical domain
Box<3,float> domain({0.0,0.0,0.0},{1.0,1.0,1.0});
// Grid size on eaxh dimension
size_t sz[3] = {100,100,100};
// Ghost part
Ghost<3,float> g(0.01);
//! \cond [initialization] \endcond
/*! \page grid_0_simple Grid 0 simple
*
* ## Grid instantiation ## {#e0_s_grid_inst}
*
* Here we are creating a distributed grid in defined by the following parameters
*
* * 3 dimensionality of the grid
* * float Type used for the spatial coordinates
* * each grid point contain a vector of dimension 3 (float[3]),
* * float[3] is the information stored by each grid point a float[3]
* the list of properties must be put into an aggregate data structure aggregate<prop1,prop2,prop3, ... >
*
* Constructor parameters:
*
* * sz: size of the grid on each dimension
* * domain: where the grid is defined
* * g: ghost extension
*
* \snippet Grid/0_simple/main.cpp grid instantiation
*
*/
//! \cond [grid instantiation] \endcond
grid_dist_id<3, float, aggregate<float[3]>> g_dist(sz,domain,g);
//! \cond [grid instantiation] \endcond
/*!
* \page grid_0_simple Grid 0 simple
*
* ## Loop over grid points ## {#e0_s_loop_gp}
*
* Get an iterator that go through all the grid points. In this
* example we use iterators. Iterators are convenient way to explore/iterate data-structures in an
* convenient and easy way.
*
* \snippet Grid/0_simple/main.cpp get iterator
* \snippet Grid/0_simple/main.cpp get iterator2
*
*/
//! \cond [get iterator] \endcond
// Get the iterator (No ghost)
auto dom = g_dist.getDomainIterator();
// Counter
size_t count = 0;
// Iterate over all the grid points
while (dom.isNext())
{
//! \cond [get iterator] \endcond
/*!
* \page grid_0_simple Grid 0 simple
*
* ## Grid coordinates ## {#e0_s_grid_coord}
*
* Get the local grid key, one local grid key* identify one point in the grid and store the local grid coordinates of such point
*
* <sub><sup>(*)Internally a local grid store the sub-domain id (each sub-domain contain a grid) and the local grid point id identified by 2 integers in 2D 3 integer in 3D and so on. These two distinct elements are available with key.getSub() and key.getKey().</sup></sub>
*
* \snippet Grid/0_simple/main.cpp local grid
*
*/
//! \cond [local grid] \endcond
// local grid key from iterator
auto key = dom.get();
//! \cond [local grid] \endcond
/*!
* \page grid_0_simple Grid 0 simple
*
* **Short explanation**
*
* In oder to get the real/global coordinates of the grid point we have to convert the object key with getGKey
*
*/
/*!
*
* \page grid_0_simple Grid 0 simple
*
\htmlonly <a href="#" onclick="if (document.getElementById('long-explanation-div').style.display == 'none') {document.getElementById('long-explanation-div').style.display = 'block'} else {document.getElementById('long-explanation-div').style.display = 'none'}" >Long Explanation</a> \endhtmlonly
*
*
\htmlonly
<div style="display:none" id="long-explanation-div">
<p>Even if the local grid key identify an unique point in the grid, it does not store the real/global coordinates of the points in grid units.</p>
<p>Consider this scheme</p>
<pre class="fragment">
+-----+-----+--*--+-----+-----+-----+ (6,6)
| | P1,3 |
| P1,1 *--------------------*
| | P1,2 |
+ + + | + + + +
| *--------------------*
*--------------* |
| | |
+ + + | + + + +
| | |
| P0,2 | P1,0 |
| | |
+ + + | # + + +
| | |
*--------------* |
| *--------------------*
+ + + | + + + +
| | |
| P0,0 | P0,1 |
| | |
+-----+-----+--*--+-----+-----+-----+
(0,0) (6,0)
+,# = grid point
*--*
| | = uderline decomposition in sub-domain
*--*
PX,Y Processor X, sub-domain Y</pre><p>The point # has</p>
<ul>
<li>Global/Real coordinates are (3,2)</li>
<li>Local grid coordinates are Sub-domain = 0, grid position = (0,0)</li>
</ul>
<p>Here we convert the local grid coordinates, into global coordinates. key_g internally store 3 integers that identify the position of the grid point in global coordinates</p>
<p>
</div>
\endhtmlonly
*/
/*! \page grid_0_simple Grid 0 simple
*
* \snippet Grid/0_simple/main.cpp global coord
*
*/
//! \cond [global coord] \endcond
auto key_g = g_dist.getGKey(key);
//! \cond [global coord] \endcond
/*!
* \page grid_0_simple Grid 0 simple
*
* ## Assign properties ## {#grid_assign}
*
* Each grid point has a vector property we write on the vector coordinates the global coordinate of the grid point.
* At the same time we also count the points
*
* \snippet Grid/0_simple/main.cpp assign
*
*/
//! \cond [assign] \endcond
g_dist.template get<0>(key)[0] = key_g.get(0);
g_dist.template get<0>(key)[1] = key_g.get(1);
g_dist.template get<0>(key)[2] = key_g.get(2);
// Count the points
count++;
//! \cond [assign] \endcond
//! \cond [get iterator2] \endcond
//! ...
// next point
++dom;
}
//! \cond [get iterator2] \endcond
/*!
* \page grid_0_simple Grid 0 simple
*
* Each sub-domain has an extended part, that is materially contained in
* another processor. The function ghost_get guarantee (after return) that this extended part
* is perfectly synchronized with the other processor.
*
* \snippet Grid/0_simple/main.cpp ghost get
*
*/
//! \cond [ghost get] \endcond
g_dist.template ghost_get<0>();
//! \cond [ghost get] \endcond
/*!
* \page grid_0_simple Grid 0 simple
*
* count contain the number of points the local processor contain, if we are interested to count the total number across the processor
* we can use the function sum, to sum numbers across processors. First we have to get an instance of Vcluster, queue an operation of sum with
* the variable count and finally execute. All the operation are asynchronous, execute work like a barrier and ensure that all the
* queued operations are executed
*
* \snippet Grid/0_simple/main.cpp reduce
*
*/
//! \cond [reduce] \endcond
// Get the VCluster object
Vcluster & vcl = create_vcluster();
// queue an operation of sum for the counter count
vcl.sum(count);
// execute the operation
vcl.execute();
// only master output
if (vcl.getProcessUnitID() == 0)
std::cout << "Number of points: " << count << "\n";
//! \cond [reduce] \endcond
/*!
* \page grid_0_simple Grid 0 simple
*
* ## VTK and visualization ## {#e0_s_VTK_vis}
*
* Finally we want a nice output to visualize the information stored by the distributed grid.
* The function write by default produce VTK files. One for each processor that can be visualized
* with the programs like paraview
*
* \snippet Grid/0_simple/main.cpp write
*
*/
//! \cond [write] \endcond
g_dist.write("output");
//! \cond [write] \endcond
/*!
* \page grid_0_simple Grid 0 simple
*
* ## Decomposition ## {#grid_dec}
*
* For debugging purpose and demonstration we also output the decomposition of the
* space across processor. This function produce VTK files that can be visualized with Paraview
*
* \snippet Grid/0_simple/main.cpp out_dec
*
*/
//! \cond [out_dec] \endcond
g_dist.getDecomposition().write("out_dec");
//! \cond [out_dec] \endcond
/*!
* \page grid_0_simple Grid 0 simple
*
* ## Finalize ## {#finalize}
*
* At the very end of the program we have always to de-initialize the library
*
* \snippet Vector/0_simple/main.cpp finalize
*
*/
//! \cond [finalize] \endcond
openfpm_finalize();
//! \cond [finalize] \endcond
/*!
* \page grid_0_simple Grid 0 simple
*
* # Full code # {#code}
*
* \include Grid/0_simple/main.cpp
*
*/
}