Version 1 (modified by cmaggio, 9 years ago) ( diff )

migrated content from ccs wiki and edited for cypress

C Codes

Hello World

/* hello.c: display a message on the screen */
#include <stdio.h>
int main(){
  printf("hello, C world\n");
  return 0;

  • Text between /* and */ are comments.
  • #include <stdio.h> to load the header file.
  • There are many header files in the standard C library.
  • Program always begins with main() function.
  • main() returns a integer.

Compile with GNU C

[tulaneID@cypress1 ~]$ gcc hello.c

Compile with Intel C

[tulaneID@cypress1 ~]$ icc hello.c

Links for Tutorial

Examples of Jobscript

#SBATCH --job-name=HelloC 
#SBATCH --qos=normal         
#SBATCH --time=0-00:10:00     ### Wall clock time limit in Days-HH:MM:SS
#SBATCH --nodes=1             ### Node count required for the job
#SBATCH --ntasks-per-node=1   ### Nuber of tasks to be launched per Node

echo Start Job



echo End job

Parallel C

More Examples

  • Approximate Pi
  • Heat/Mass Transfer
  • Stokes Flow In a Cavity
  • Particle Strength Exchange Method
Note: See TracWiki for help on using the wiki.